Posts

html - Navigating back to webpage when in a sub folder -

i'm designing new website , having few problems navigating page in root directory when i'm in sub folder. below how have got setup: index.htm page1.htm page2.htm folder/page1.htm so when i'm in folder/page1.htm, when try , click on page2.htm, thinks should in "folder/page2.htm" rather "website.com/page2.htm" in root directory. now maybe complicate things more, have links set in template file 1 editable region (just content inside). changes links, saved pages. is there anyway can navigate other pages such page2.htm when i'm in folder/page1.htm? thanks, chris add code @ folder/page1.htm <a href='../page2.htm' />page 2</a>

python syntax error in dict comprehension -

here i'm trying do: i want count letters frequency in sentence. here code in python far: for in line: if in my_count.keys(): my_count[i]+=1 else: my_count[i]=1 is there way fulfill same goal dict comprehension, same list comprehension? i have thought @ such : my_count = { x:(my_count[x]+=1) x in line if x in my_count else x:1 } but not pass syntax check (syntaxerror: invalid syntax @ +=). thanks , advices! counter in collections seems accomplish this. in [1]: line = 'the quick brown fox jumps on lazy dog' in [2]: collections import counter in [3]: c = counter(line) in [4]: c out[4]: counter({' ': 8, 'o': 4, 'e': 3, 'h': 2, 'r': 2, 'u': 2, 't': 2, 'a': 1, 'c': 1, 'b': 1, 'd': 1, 'g': 1, 'f': 1, 'i': 1, 'k': 1, 'j': 1, 'm': 1, 'l': 1, 'n': 1, 'q': 1, 'p': ...

ios - How to fetch a PFObject with all it's fields and related objects in one go? -

i have nsarray of pfobjects , want fetch data related objects in array in 1 go, afterwards there no need make new call parse. how can this? my answer assuming array want contained in pfobject. can query object , use include key include array contained within key. pfquery *query = [pfquery querywithclassname:@"<object's class name>"]; [query wherekey:@"objectid" equalto:object.objectid]; [query includekey:@"<array key>"]; if objects in array have pointers other objects within them can use dot syntax fetch @ once. [query includekey@"<array key>.<pointer in object array key>"]; run query once set , should retrieve array of 1 object since objectids unique, within object array. [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error){ if(error){ // handle error }else{ if([objects count] > 0){ pfobject *o...

java - How to access all components beneath top JFrame -

partly learning purposes, made jframe 4 jpanel s, 2 jlabel s, , jmenubar . put various components (buttons, textboxes, textarea) 4 jpanels. disabled every 1 of components throughout. i wrote 2 methods try enable everything. worked partially. here's code: public void enableeverything(){ component [] p = this.getcontentpane().getcomponents(); for(component pp : p) if(pp instanceof jpanel) enableall((jpanel) pp); } public void enableall(jpanel p){ component [] c = p.getcomponents(); for(component cc: c) cc.setenabled(true); jtextarea1.setenabled(true); jscrollpane1.setenabled(true); } the jtextarea (inside jscrollpane ) didn't enabled last 2 lines above. why? i tried: component [] s = jscrollpane1.getcomponents(); for(component ss: s) ss.enableinputmethods(true); how enable textarea? and jmenubar didn't enabled either. don't know find it. read it's in jlayeredpane, ... tried didn't work: ...

r - Getting factor analysis scores when using the factanal function -

i have used factanal function in r factor analysis on data set. viewing summary of output, see have access loading , other objects, interested in scores of factor analysis. how can scores when using factanal function? i attempted calculate scores myself: m <- t(as.matrix(factor$loadings)) n <- (as.matrix(dataset)) scores <- m%*%n and got error: error in m %*% n : non-conformable arrays which i'm not sure why, since double checked dimension of data , dimensionality in agreement. thanks help. ah. factormodel$loadings[,1] %*% t(dataset)

c# - Keydown Eventhandler Process -

i trying process keydown event below code process first char of string , not able remove second char of string. private void game_keydown(object sender, keyeventargs e) { if(birdsarray[selectedindex].this_string.first()== (char)e.keydata) { birdsarray[selectedindex].this_string = birdsarray[selectedindex].this_string.remove(0, 1); this.validate(); } } in below code birdsarray array of panels, this_string string type of string object in birdsarray . the keydown event gives virtual key code of key pressed. keys.a if press a-key. tells key, not letter that's produced key. depends on active keyboard layout (it not in japan or russia example) , modifier keys down. shift being obvious example, producing either a or a . or alt which, when down, doesn't produce letter @ all. so code work accident if first letter of string capitalized. you'll run out of luck when rest not. a not match a . it pretty unclear me why need feat...

How to get button Response/Request URLs in QTP? -

how response/request urls (which shown in f12 developer tools - network tab) using qtp 11? based on these urls, need perform action in application. there alternate solution urls? scenario: open ie browser , navigate url, press f12, go 'network' tab. click on 'start capturing' button. click on button or link on page, set of urls in developer tool (f12). firstly, need of url requests generated button and/or link click? remember "network" tab in developer tools include url's fetching e.g. javascript , css in addition to, instance request external api. i'll try provide alternative approach. if requiring url associated each interactive element, should able using getroproperty method so: strurl = browser("yourbrowser").page("mainpage").webbutton("abutton").getroproperty("href") a more generic script fetching e.g. "href" properties links on page may found in following post: (hp quicktest)...