Posts

Android Change textView text from another method/class -

after click on button1, layout , class gets called. want change text of textview out of class 2 results in app crash java.lang.nullpointerexception important parts of class 1 public static textview a; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); [button stuff in class 1] setcontentview(r.layout.raten); final textview = (textview) findviewbyid(r.id.a); //the textview wanna chage max = 10; easy easy = new easy(); // other class easy.e(); [now method in class 1 should change text] public static void tx(int i) { a.settext("adsfasdf"); } [important parts of class 2 ("easy")] public void e(){ system.out.println("called class easy"); int max = mainactivity.max; system.out.println(max); (int i= 0; i<max; i++){ syste...

plot - How can I remove the strange white margin around my .png (plotted with r, ggplot)? -

Image
i save plots ggplot .png. background has black, there allways small white margin (only top, down left; not right). how can remove margin? thank you! here code library(ggplot2) require(grid) dat <- data.frame("xvar"=runif(500, 1, 10), "yvar"=runif(500, 1, 10)) n <- 1 for(i in 1:n){ png(file=paste("green", i, ".png", sep=""), width=400, height=400) x <- sample(500, 50) <- ggplot(data=dat[x,], aes(x=xvar, y=yvar))+ geom_point(col="green", size=3,shape=15)+ theme(panel.background=element_rect(fill="black"), panel.grid.minor=element_blank(), panel.grid.major=element_blank(), axis.text.x=element_blank(), axis.text.y= element_blank(), axis.title.x=element_blank(), axis.title.y=element_blank(), axis.ticks=element_blank(), plot.background=element_rect(fill="black"), panel.margin = unit(c(0,0,0,0), "cm"), plot.margin = unit(c(0,0,0,0), ...

asp.net - IIS Rewrite root folder to different subfolders -

i'm setting folder structure inside application looks such: c:\inetpub\wwwroot\contoso\public c:\inetpub\wwwroot\contoso\secured i wanting map following urls folder structures: http://www.contoso.com/login -> \public\login.aspx http://www.contoso.com/myaccount -> \secured\myaccount.aspx http://www.contoso.com/(css|images|js)/ * -> \public(css|images|js)* (not represented in below rules) i have application request routing version 2 installed on server. thought process build few rewrite rules mapping me such these ... <rewrite> <rules> <rule name="rewrite pub page aspx" stopprocessing="false"> <match url="^([a-z0-9/]+)$" ignorecase="true" /> <conditions> <add input="public\{request_filename}.aspx" matchtype="isfile" ignorecase="true" /> </conditions> <action type=...

unix - No rule to make target in Maefile -

i'm learning write makefiles. made own simple 1 try , test, every time run make, get: make: *** no rule make target `/%.cpp', needed `obj'. stop. i googled. i'm pretty sure typed correctly, , folders set way should be. here makefile: cc = g++ ld = g++ name = app obj_dir = obj src_dir = src cc_flags = -std=c++0x all: $(name) $(name): $(obj_dir)/%.o $(ld) $(obj_dir)/%.o -o $@ $(obj_dir)/%.o: $(src_dir)/%.cpp $(cc) $< -o $@ $(cc_flags) clean: rm $(name) $(obj_dir) -rf what problem? the line: $(name): $(obj_dir)/%.o is not correct. not pattern rule (because target doesn't contain pattern character, % ) , it's interpreted explicit rule, saying app depends on actual file named obj/%.o doesn't exist, , make doesn't know how build (because there's no file src/%.cpp ). you need change to: $(name): $(obj_dir)/foo.o ... or whatever object files have.

c# - Entity Framework - Linq to query where value in a list -

Image
i'm using entity framework on .net 3.5 , can't life of me figure out how write linq traverse following design: basically trying figure out if user has permission (entityaction) specific entitytype. users , roles maintained in active directory - system can lookup find role/groups user belongs. let's assume have following data: entitytype entitytypeid: 1 name: entity one user userid: 1 accountname: andez role roleid: 1 accountname: myrole entityaction entityactionid: 1 name: something roleentityactionassociation (association between role , entityaction) entityactionid: 1 roleid: 1 i storing group names user (from active directory) in list: list<string> groupnames = new list<string>(); question however trying piece linq find out whether user (or 1 of roles assigned in list groupnames) associated particular entityaction given entitytype. // reference user user user = context.users.where(x => x.account...

javascript - Clear form inputs and keep placeholder -

i know using jquery tool $('.mydiv input').each(function () { $(this).val(""); }); clears form can me suggestions how keep placeholders of input? right placeholders appears after focus on @ least 1 input. jquery function clear() { $('.mydiv input').each(function () { $(this).val(""); x=1; }); $('.mydiv input').first().focus(); } working demo http://jsfiddle.net/s8vpg/2/

grouping - Highcharts Grouped Data In Subgroup -

Image
is possible achieve this? need draw graph , it's based on categories. each category have subcategory , aggregator. this column bar chart , must draw this. look. exaplanation: agg 1 , 2 fixed categories in xaxis. cat 1, cat 2, cat... dynamic on it. data column bars in specified cat group. i dunno if graph can handle want , if possible. know how draw simple graphs , don't found example this. i've tried stacks don't got want or used wrong. there not built in way achieve in highcharts. one thing can spoof it, using multiple x axes, making use of axis offset property, , setting different categories and/or tickpositions on different axes. there feature request can add votes and/or comments here: http://highcharts.uservoice.com/forums/55896-general/suggestions/2230615-grouped-x-axis relevant thread old forum: http://highslide.com/forum/viewtopic.php?f=9&t=16011