Posts

javascript - ExtJS - Differentiate items in MultiSelect -

i have 2 multiselects in itemselector , in formpanel . each multiselect composed of 2 stores : left side, , right side (with arrows move items between 2). when load panel, feed reference, in order highlight items moved 1 side other (e.g. set style red moved items) because today there no way differentiate them. i managed catch event afteradd on stores , apply style through dom access. works during trace, later on remaining extjs standard calls performed, overriding style applied... i feel i'm doing not way, i'm new extjs i'm bit lost here... ! edit : here sample of code, forgot tell worked on extjs 3.2 (hum...). pool_cnx_to_rule formpanel : pool_cnx_to_rule.aftermethod('add', function () { //var pools_available_ = ext.getcmp('pools_available').getvalue(); var pools_selected_ = ext.getcmp('pools_selected').getvalue(); var i, j; (i = 0; < pool_cnx_to_rule.data.length; ++i) { var pool_descr_ = pool_cnx_...

Assert Javascript value in C# with Selenium -

i'm writing test webapp. @ 1 point in application webpage completed using javascript. testing i'm using visual studio 2012 nunit , selenium . want check if box id=j_idt13:jnumber has text value of sometext . ijavascriptexecutor js = driver ijavascriptexecutor; string valoare = (string)js.executescript("return $('#j_idt13\\:jnumber').val();"); assert.istrue(valoare.equals("sometext")); i keep getting error: "syntax error, unrecognized expression: unsupported pseudo:jnumber". what missing here? i know have works i'd caution avoid using javascript fetch value of element, in fact in general should avoided when doing tests except when there no other way want do. reason selenium supposed behave typical user would. typical users don't type javascript page or interact directly. goes using jquery tests should not assume jquery exists on page , functioning. selenium provides ability fetch values of fields i'd re...

Titanium Android webView evalJS does not deal well with typeof -

i've got webview in titanium app returns empty string when ask check typeof variable. point of exercise figuring out if function exists on page reloads in different forms. var hasauth = self.registerview.evaljs("typeof authenticate;") this works fine in ios, , in fact in android works on many occasions well. yet on android, return nothingness, represented 'undefined.' ps: no, problem not including 'return' in javascript string. titanium , causes errors if too. the solution in case turns out be: var hasauth = self.registerview.evaljs("'' + typeof authenticate;") somehow evaljs can typeof work, not if line starts typeof.

java - How to handle collision after detecting it -

i've been trying past few days put simple collision simple game. i've looked in lots of places on internet haven't found helpful. i'm using bounding boxes , want player box stop when hits block of 4 sides (and not stuck or bounce against block). doesn't sound difficult i've found incredibly difficult. wanna know code need put in if statement's brackets, i've read , heard theory can take. please if can. if(bb_collide(player,block)){ //detection works fine, //just not sure afterwards } else{ player.setx((player.getx() + velx)); player.sety((player.gety() - vely)); player.set_coll(player.getx(),player.gety(),player.getwidth(),player.getheight()); block.set_coll(block.getx(),block.gety(),block.getwidth(),block.getheight()); } i figured out, having couple of bad days, sorry if had bad attitude or got wanted to. heres did if anyone's interested because works 1...

eclipse gef - Add a newly created/custom component on the palette -

i wondering if possible add newly created diagram component on palette. i adding components on diagram programmatically (with wizard ask user variables add in/on component). , give user possibility make similar component dragging , dropping palette. (say created component "wheel" variables, nice able create 4 of them without having use wizard every time)

performance - Difference between Hierarchical and Non Hierarchical Clustering? -

i trying see if performance of both can compared based on objective functions work on? hierarchical : single linkage, complete linkage , average linkage algorithms non hierarchical : fuzzy c means , k means don't confuse algorithms , tasks . there more 1 algorithm k-means. there @ least 2 dozen. use k-d-trees acceleration, example. , heuristics, because finding optimal k-means solution shown np-hard in general, believe. similarly, there naive o(n^3) runtime , o(n^2) memory approach hierarchical clustering, , there algorithms such slink single-linkage hierarchical clustering , clink complete-linkage hierarchical clustering run in o(n^2) time , o(n) memory. last not least, if use dbscan , set minpts=2 , result same single-link hierarchical clustering when cut @ height of epsilon . yet, appropriate index, dbscan runs in o(n log n) (e.g. in elki - scipy implementation not clever, needs o(n^2) memory , runtime). so why can have such different runtimes ...

java - How to make the 'open with' dialog box? -

i made program search .txt files. if click file means "open with" dialog box should appear, , dialog box contain list of installed programs. i using code searching through files: public file[] finder( string dirname) { // create file object on directory. file dir = new file(dirname); // return list of files in directory. return dir.listfiles(new filenamefilter(); } public boolean accept(file dir, string filename) { return filename.endswith(".txt"); } what java code can use make "open with" dialog box appear? you should use filechooser this. take here : //create file chooser final jfilechooser fc = new jfilechooser(); ... //in response button click: int returnval = fc.showopendialog(acomponent); public void actionperformed(actionevent e) { //handle open button action. if (e.getsource() == openbutton) { int returnval = fc.showopendialog(filechooserdemo.this); i...