Posts

Showing posts from March, 2011

gwt - How to add a Button to a HeaderSpan in SmartGWT? -

gwt - How to add a Button to a HeaderSpan in SmartGWT? - i want add together button headerspan in smartgwt. @ start, title of button + (plus), when user clicks button, rows of table shown , title of button becomes - (minus). there around 25 columns in listgrid hence want behaviour. i have tried using headerspan.setattribute("button", new button("+")) method did not work. please help. any other approach hide/unhide columns much appreciated. i've watched link. per overview given in screen, provide hide/show of particular column particular headerspan. on right side of each column dropdown button given visible on mouse on & serves purpose. if want alter it's icon, can seek next code, headermenubuttonicon path of image: grid.setheadermenubuttonicon(headermenubuttonicon); hope helps you. gwt smartgwt

objective c - CATransition NOT working when kCATransitionFromTop -

objective c - CATransition NOT working when kCATransitionFromTop - catransition not working when subtype kcatransitionfromtop . calayer *layer = [self.view layer]; catransition *transition = [catransition animation]; transition.type = @"pagecurl"; transition.duration = 0.5; transition.delegate = self; if(viewmode == portrait) [transition setsubtype:kcatransitionfromright]; else if(viewmode == upsidedown) [transition setsubtype:kcatransitionfromleft]; else if(viewmode == right) [transition setsubtype:kcatransitionfrombottom]; else if(viewmode == left) [transition setsubtype:kcatransitionfromtop]; [layer addanimation:transition forkey:nil]; everything works fine except kcatransitionfromtop . (comes bottom) i think subtype of @"pagecurl" can't fromtop , default value ( frombottom ) is assigned. right? , there anyway prepare this? objective-c ios

Can't Logout of my Facebook OAuth Session without logging User Out of Facebook -

Can't Logout of my Facebook OAuth Session without logging User Out of Facebook - per sdk, using logout.php redirect: https://www.facebook.com/logout.php?confirm=1&next={some url}&access_token={accesstoken} it logging me out fine, it's logging user out of facebook. isn't there way of logging out of oauth session without logging out of facebook? yes, ran same issue myself. dont logout.php or js sdk's fb.logout(). rather phone call graph api http delete command me/permissions . kill access token, remove app user's app listing , maintain browser's cookie facebook. can phone call either server side or client side. here's client side javascript sdk way: fb.api("me/permissions","delete", function(response){/*do if want*/}) facebook oauth

iphone - putting local tabBar on the global tabBar (I have a global tabBarController) -

iphone - putting local tabBar on the global tabBar (I have a global tabBarController) - i have set 1 global tabbarcontroller in iphone app have been working on. in 1 of screen needed set local tabbar different global tabbarcontroller. i have done in 2 ways: 1) hiding global tabbar self.tabbarcontroller.tabbar.hidden = yes; , putting local tabbar in place of in view. frame of tabbar showing blank white. 2) tried adding local tabbar subview of global tabbar worked after screen unloaded not removing local tabbar though applying [localtabbar removefromsuperview]; thanks in advance.. global tabbarcontroller: tabbarcontroller = [[uitabbarcontroller alloc] init]; tabbarcontroller.viewcontrollers = [nsarray arraywithobjects:activitytabnav,nav2,privatechatnav,exploretabnav,nav3,temptabnav, nil]; localtabbar tabbar on view xib of viewcontroller. in viewdidload > uiwindow* window = [[uiapplication sharedapplication] keywindow]; [window addsubview:self.tabbar]...

Can't get comments to display correctly and comments not showing in moderation tool -

Can't get comments to display correctly and comments not showing in moderation tool - i'm setting facebook comments on wordpress blog. have specific requirements can't utilize wordpres plugins this. problem can't fb comments show comment count or show comments in fb moderation dashboard. attached how comment box coming out i used facebook page instructions setting fb comments: https://developers.facebook.com/docs/reference/plugins/comments/ created new app , have app id. have 2 fb meta tags app id , admin in header. used settings in image below. first under , other in comments.php file. where going wrong? i able resolve first of issues. create comment count (the noe has drop downwards alternative sort comments) show, reduced number of default number of posts ( data-num-posts="2" 15 had set default 2. still don't have in moderation panel though comments facebook-comments

html - Preventing repeating background from appearing through offset transparent child elements? -

html - Preventing repeating background from appearing through offset transparent child elements? - so, have layout have repeating transparent shadow element set background of parent container element. set atop this, , supposedly hovering on topmost border of background, supposed image frame , drop shadow. however, because image frame continues parent element, background image continues upward. visible vertical lines above top border of frame's drop shadow. see screenshot below: this happens regardless if utilize transparent image or css3's box-shadow property. setting negative margins doesn't work bring out of parent element, nor setting positioning relative or absolute. normally i'd seek "fake" transparency effect setting solid image @ top border of image frame, there's repeating stucco pattern set body background, means there'd visible, unnatural-looking edge. (insert cursing re: repeating patterns here.) any suggestions how preve...

Python String method Obscured -

Python String method Obscured - i'm trying split string returned python implementation of interactive broker's api, maintain getting a: attributeerror: 'tickprice' object has no attribute 'split' def my_price_handler(msg): fields=msg.split() print fields[0] checked api code , (1) msg string , (2) 'split' not redefined elsewhere. msg string looks <tick cost tickerid=1, field=1, price=74.0, canautoexecute=1> , can printed console directly. same error message when using syntax: def my_price_handler(msg): fields=string.split(msg) print fields[0] i have imported string @ top of program. is variable scope issue? clearly, msg not string when enters my_price_handler ; it's tickprice . put print(type(msg)) before split phone call convince of fact. (the fact msg can printed not mean it's string, if that's thought.) python string

wordpress - CSS Font Color Mis-interpretation by IE8, but not IE7 or IE9 -

wordpress - CSS Font Color Mis-interpretation by IE8, but not IE7 or IE9 - i'm having issue wordpress theme project i'm working on (the theme based on roots theme wordpress). i'm having problem controlling font color of main navigation sub-menus: in ie8. font appears same color background submenu, making invisible user. oddly, issue happens in ie8, , doesn't happen in chrome, firefox, ie7 or ie9. the site http://precisionmfgmn.com, see error seek hovering on "companies" link on main navigation. here details may relevant: using cufon font replacement. any ideas? it looks cufon using canvas ie8 , not ie7. ie8 doesn't seem back upwards ie9 does. here 2 possible solutions : - modify source code of module, if browser ie8 should not utilize canvas - forcefulness ie7 compatibility view, can adding <meta http-equiv="x-ua-compatible" content="ie=emulateie7"> in template file the first solution best sec ea...

math - Rotate 3D object to mouse with Three.js -

math - Rotate 3D object to mouse with Three.js - i want rotate object in 3d space, front end side looks mouse. function onmousemove(event){ mouse3d = projector.unprojectvector( new three.vector3( event.clientx, event.clienty, 0.5 ), photographic camera ); } var angle = ??; box.rotation.y = angle; first unprojection right ? , secondly how calculate angle ? tan(mousex/mousey) ? i'm trying more 3d mathematics, little bit explanation nice. thanks in advance. class="lang-js prettyprint-override"> // direction facing (without rotation) var forwards = new vector3(0,0,-1); // direction want facing (towards mouse pointer) var target = new vector3().sub(mouse3d, box.position).normalize(); // axis , angle of rotation var axis = new vector3().cross(forward, target); var sinangle = axis.length(); // |u x v| = |u|*|v|*sin(a) var cosangle = forward.dot(target); // u . v = |u|*|v|*cos(a) var angle = math.atan2(sinangle, cosa...

java - How to solve ConcurrentModificationException in GoogleMaps in Android -

java - How to solve ConcurrentModificationException in GoogleMaps in Android - i have written code displaying multiple markers in googlemaps in android. code follows. list<overlay> markerslist; private myitemizedoverlay funplaces; runnable r = new runnable() { public void run() { if (markerslist != null) { mapcontroller mc = mapview.getcontroller(); mc.setzoom(15); (int i=0; < markerslist.size(); i++) { funplaces = (myitemizedoverlay) markerslist.get(i); geopoint pt = funplaces.getcenterpt(); mc.setcenter(pt); mapview.postinvalidate(); } } } }; thread t=new thread(r,"classname"); t.start(); when i'm running above code working fine giving concurrentmodificationexception. how prepare problem? thought appreciated. if that's you're getting error, you'...

iphone - uiautomation recorded scripts save location -

iphone - uiautomation recorded scripts save location - i can't seem figure out how save recorded scripts in "ui automation" tool in instruments. i launch iphone app "profile" select "ui automation" tool, add together "new script" , start script recording. click around , can replay script , watch iphone app behave correctly. if save instrument's trace file, has debug info no scripts. how save scripts , end up? thanks! scripts created in automation tool , not exported exist part of saved instruments trace document. re-opening trace document should list scripts created. you can export scripts stand-alone .js files if you'd prefer right-clicking on script editor , choosing export. iphone ui-automation ios-ui-automation xcode-instruments

iphone - Is it possible to show dynamic data in default Settings app from my app -

iphone - Is it possible to show dynamic data in default Settings app from my app - i using settings bundle insert items in iphone's default settings app. now when selecting app name  from iphone's settings app , can able list info database of application. when checking urls, seems cant show dynamic info in settings app. what trying is, settings -> myappname -> when tapped myappname i want fetch info db , display below in uitableview.also add together new entry tapping + ( add together button ) there. fruits vegtables icecream chocolates mobiles like , when tapping on each entry take next set of list. , there can add together new entry can done? please allow me know no, sorry, can't done. you'll have have settings within app , include own view controller same purpose. iphone objective-c database settings

jsf - Is conditional rendering of components possible inside datatable without updating the entire datatable? -

jsf - Is conditional rendering of components possible inside datatable without updating the entire datatable? - <h:datatable value="#{bean.listofrows}" var="eachrow" id="thedatatable"> <h:column> <p:outputpanel rendered="#{eachrow.visible}"> <h:selectmanycheckbox value="#{xxxx}" label="#{xxxx}"> <f:selectitems value="#{checkboxitems}" var="eachitem" itemlabel="#{eachitem.label}" itemvalue="#{eachitem.value}" /> <p:ajax event="change" update="thedatatable" /> </h:selectmanycheckbox> </p:outputpanel> <p:outputpanel rendered="#{eachrow.visible}"> <h:selectoneradio value="#{xxxx}" label="#{xxxx}...

javascript - jQuery AJAX callback does not set variable before function returns? -

javascript - jQuery AJAX callback does not set variable before function returns? - i have function: var foo=function(){ var ret="false"; var data={}; data["blah"]="blah"; $.ajax({ type: "post", url: "https://website.com/a", data: data, datatype: "json" }).success(function (data) { ret=data["stuff"]; alert("set "+ret); }).error(function (a, b, c) { alert("error"); ret="false"; }); homecoming ret; } when following: alert(foo()); i follow order of output: 1.false 2.set true i expecting ret set true , returning false, not what's happening. doing wrong? the $.ajax async default. basicly return ret; before javascript set ajax response. try utilize async: false in $.ajax phone call options. javascript jquery

ruby on rails - :Method => Delete Route Not Working -

ruby on rails - :Method => Delete Route Not Working - this button delete path seems routed friendships#create action somehow: <%= button_to "unfriend", unfriend_path(@user), :method => :delete, :class => "btn primary", :remote => true %> routes file: match 'friendships/:id', :to => 'friendships#create', :method => :post, :as => 'friendship_request' match 'friendships/:id', :to => 'friendships#destroy', :method => :delete, :as => 'unfriend' here server log started post "/friendships/45" 127.0.0.1 @ 2012-01-11 19:56:46 -0500 processing friendshipscontroller#create js parameters: {"authenticity_token"=>"uicoeyatnuqtd1nag8xiutki7b5ioidtpgj/wu8z+i0=", "_"=>"", "method"=>:post, "id"=>"45"} user load (0.2ms) select "users".* "users" "users"....

android - Custom Javascript for existing Websites -

android - Custom Javascript for existing Websites - i create android application views existing web url, however, button controls on android app able run custom javascript code on website's context. any ideas on how create happen? perhaps extend or create custon webview?? ideas? thanks in browsers in general can execute arbitrary javascript via url bar injection (also called bookmarklet if saved in bookmarks). // first load normal page, webview.loadurl("javascript: var x = 1; "); you can test pasting in desktop browser url bar window.alert("hello") . javascript android android-webview

actionscript 3 - Aboud flash download -

actionscript 3 - Aboud flash download - i using download functionality of as3 download wav file given http adress , save other location. file beign downloaded 1.03 mb file downloaded 655 bytes :) . used sample code adobe page filereference class filereference dont have prolem code itself. any thought why download working bad, i.e 655 bytes out of 1 mb file? thanks vlad, open 655 byte file text editor more clues. regards flash actionscript-3 file flex4 download

c# 4.0 - Limit the number of parallel threads in C# -

c# 4.0 - Limit the number of parallel threads in C# - i writing c# programme generate , upload half 1000000 files via ftp. want process 4 files in parallel since machine have 4 cores , file generating takes much longer time. possible convert next powershell illustration c#? or there improve framework such actor framework in c# (like f# mailboxprocessor)? powershell example $maxconcurrentjobs = 3; # read input , queue $jobinput = get-content .\input.txt $queue = [system.collections.queue]::synchronized( (new-object system.collections.queue) ) foreach($item in $jobinput) { $queue.enqueue($item) } # function pops input off queue , starts job function runjobfromqueue { if( $queue.count -gt 0) { $j = start-job -scriptblock {param($x); get-winevent -logname $x} -argumentlist $queue.dequeue() register-objectevent -inputobject $j -eventname statechanged -action { runjobfromqueue; unregister-event $eventsubscriber.sourceidentifier; remove-job $eventsu...

android - running new Activity from Activity selected with TabHost so that only contents of Frame change -

android - running new Activity from Activity selected with TabHost so that only contents of Frame change - im still newbie in android, appreciate help couldnt find info on this. i have tabhost 2 activities assigned. tabs "shops" , "people" both activities contain listviews. now.. if click on 1 of elements of listview "shoes/people" tab remain still while contents of frame alter (where listview is) @ given time can switch other tab , start process begining. currently after user clicks on listview item intent merchant = new intent(v.getcontext(), merchantview.class); startactivity(merchant); a new activity started (tabs dissapear) , view completly replaced. questions : copmpletly total new view created when click on listview item. how can run merchantview activity within frame? this merchantview have clickable element 1 time again behave in similar way (tab remains still).is approach here good?(to alter activites per click). mean m...

iphone - Custom annotation not showing callout -

iphone - Custom annotation not showing callout - i getting weird stuff in custom mkannotaionview. when click on pin not show detail. making mistake? here code: - (mkannotationview *) mapview:(mkmapview *)mapview1 viewforannotation:(id <mkannotation>) annotation { mkpinannotationview *annotationview = [[mkpinannotationview alloc] initwithannotation:annotation reuseidentifier:@"redpin"]; annotationview.pincolor = mkpinannotationcolorred; annotationview.animatesdrop = yes; uibutton *button = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; button.frame = cgrectmake(0, 0, 23, 23); annotationview.rightcalloutaccessoryview = button; // image , 2 labels uiview *leftcav = [[uiview alloc] initwithframe:cgrectmake(0,0,23,23)]; uilabel *label1 = [[uilabel alloc]init]; label1.text = [nsstring stringwithformat:@"hello"]; [leftcav addsubview :label1]; annotationview.leftcalloutaccessoryview = leftcav; annotationview.canshowcallout = yes; homec...

javascript - Set variable value from input before submit -

javascript - Set variable value from input before submit - first, have input in form. <select id="entry_14"> <option value="woman">woman</option> <option value="man">man</option> </select> then declared variable. var mygender = document.getelementbyid('entry_14').value; but then, when document.write, shows "man" before user makes selection, , after selecting woman, still shows man. how can set value of variable change, each time user selects 1 of options? it executes because code not in function. need phone call function when select changes. add together onchange handler select. in illustration pass this.value select lists value function. can whatever want value. <select id="entry_14" onchange="myfunction(this.value);"> <option value="woman">woman</option> <option value="man">man</op...

Monodroid application not working in real phone -

Monodroid application not working in real phone - i created monodroid application, worked in emulator no problem @ all. , re-create .apk file in andorid phone. but after installation, doesnt works. i getting forcefulness close issue how install monodroid application in android phone? are using total version of mono android or evaluation? if you're using evaluation, doesn't back upwards deploying device. if you're using total version, building in debug or release mode? if you're in debug mode shared library enabled, means apk not contain app needs run. should utilize monodevelop/visual studio deploy device, install shared runtime app. monodroid

bash - How to handle parenthesis in grep? -

bash - How to handle parenthesis in grep? - str of next pattern: 1 abc (1 <something>) for example: 1 abc (1 hello) 1 abc (1 shalom) 1 abc (1 hola) how extract <something> str using egrep ? if want extract <something> i'd suggest grep -p (perl regex): grep -p -o '(?<=\(1 ).*?(?=\))' inputfile the -o returns matched portion beingness <something> . regex looks text preceded (1 , followed ) . you wouldn't able egrep doesn't back upwards lookarounds. best you'd extract (1 <something>) with: egrep -o '\(1 (.*)\)' inputfile [foo@bar ~]$ grep -p -o '(?<=\(1 ).*?(?=\))' inputfile hello shalom hola [foo@bar ~]$ egrep -o '\(1 (.*)\)' inputfile (1 hello) (1 shalom) (1 hola) bash grep

asp classic - Load() method of Msxml2.DOMDocument sometimes take around 3 seconds to execute -

asp classic - Load() method of Msxml2.DOMDocument sometimes take around 3 seconds to execute - we have asp classic page read xml file, somtimes load() method takes around 3 seconds , less 1 second, xml files size 7k. i think symptoms of memory shortage have dedicated server @ godaddy.com 4gb ram (32-bit platform). how can troubleshoot problem? asp-classic msxml6

How do I traverse a directory in Mozilla Firefox 4.0 and beyond? -

How do I traverse a directory in Mozilla Firefox 4.0 and beyond? - used this: class="lang-js prettyprint-override"> // firefox 3.6 , before; mozilla 1.9.2 , before var ext = this.cc["@mozilla.org/extensions/manager;1"] .getservice(this.ci.nsiextensionmanager) .getinstalllocation(id) .getitemlocation(id); // list xml files in installation folder: var entries = ext.directoryentries; var files = []; while(entries.hasmoreelements()) { ) how ext variable now? have gotten far following: class="lang-js prettyprint-override"> components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid(id, function(addon) { ext = addon.getresourceuri(""); } but not sure how directory info traverse it... there might not directory traverse - starting firefox 4 extensions no longer unpacked when install them, resource uri point xpi file (via jar: ...

codeigniter loading models list errors -

codeigniter loading models list errors - i loading models in controller can utilize them in view there weird problem going on doesnt allow me load model1 above model2 , throws error... if switch how load them work fine... ex. $this->load->model("model1"); $this->load->model("model2"); gives error model1 doesnt load below when phone call function model1 model throws error. $this->load->model("model2"); $this->load->model("model1"); works. the problem was extending ci_controller in of models , not ci_model... seems working now... codeigniter model

javascript - Floating divs - variable height and variable columns - with no gaps -

javascript - Floating divs - variable height and variable columns - with no gaps - i have updated fiddles, see bottom i developing wordpress theme work on iphone , ipads , other webkit devices. i using media queries alter width of divs depending on size , orientation of device. these divs float left, fill device screen. my problem floated div's height variable. , div's higher some, causing gap issues on floated elements. i need possible advice on prepare there never gaps, , elements float, if there higher div in path. is there possible way of equalizing div heights highest div, problem need work orientation changes on ipad. on iphone it's not bad because there 1 column. on ipad, portrait has 2 columns , landscape has 3 columns. please see diagram below explaining issue. current css /* global style ( iphone uses first - 1 column ) ----------- */ .module { display: block; overflow: hidden; width: 100%; float: left; } /* ipads ...

debugging - magento - how to debug? product not visible, cloned product not visible, new product is visible -

debugging - magento - how to debug? product not visible, cloned product not visible, new product is visible - we have 1 of famous "product not visible in frontend" problems, 1 seems bit harder. we worked checklist (like 1 http://www.aschroder.com/2010/07/why-are-my-magento-products-not-showing-up/) still: this product 404s: http://www.in-due.de/hochzeitsshop/catalog/product/view/id/15034 this 1 clone , 404s: http://www.in-due.de/hochzeitsshop/catalog/product/view/id/15745 this product new , works perfectly: http://www.in-due.de/hochzeitsshop/catalog/product/view/id/15746 what best approach debug problem? pat try go on checklist status should enabled inventory should positive , in stock should assigned less 1 active category go index manager , reindex all if not helps seek debug starting catalog product controller, view action. hope helps. upd: answer, there should 1 more point product should assigned desired store (which checking on front...

jquery - background color to an element which is positioned before the identified tag? -

jquery - background color to an element which is positioned before the identified tag? - i'm trying add together background color element positioned before identified tag. example, know class of 1 elment , have list below. <ul id="one"> <li><a href='#'>text0</a></li> <li><a href='#'>text1</a> <ul> <li><a href='#'>text2</a></li> <li><a href='#'>text3</a> <ul> <li class="item-1"><a href='#' class='identified'>item1</a></li> <li class="item-2"><a href='#'>item2</a></li> <li class="item-3"><a href='#'>item3</a></li> </ul> </li> <li class="item-c">c</li> </ul> </li> <li class="item-iii...

c# - Serial ports - how do I set characters? -

c# - Serial ports - how do I set characters? - consider: baud rate 19200 rts on dtr on info bits=8, stop bits=1, parity=none set chars: eof=0x00, error=0x2a, break=0x2a, event=0x00, xon=0x11, xoff=0x13 handflow: controlhandshake=(dtr_control), flowreplace=(transmit_toggle, rts_control), xonlimit=0, xofflimit=4096 ok, using port scanner i've found usb device needs these settings facilitate import. can recreate of these follows: port = new serialport("com4"); port.dtrenable = true; port.rtsenable = true; port.handshake = handshake.none; port.baudrate = 19200; port.stopbits = stopbits.one; port.parity = parity.none; port.databits = 8; port.open(); byte[] = new byte[2] { 0x0 , 0x1 }; port.write(a, 0, 1); port.write(a, 0, 1); port.write("mem"); port.write("mem"); string output = port.readexisting(); system.diagnostics.debug.writeline("found: " + output); however, codes produced these: ...

objective c - AFNetworking upload file to server, parameters -

objective c - AFNetworking upload file to server, parameters - i trying upload file this: nsmutabledictionary * lparameters = [nsmutabledictionary dictionary]; [lparameters setobject:@"temp.jpg" forkey:@"file"]; nsmutableurlrequest *request = [self multipartformrequestwithmethod:@"post" path:@"uploads/add.json" parameters:lparameters constructingbodywithblock: ^(id <afmultipartformdata>formdata) { nsdata * info = [nsdata datawithcontentsoffile:filepath]; [formdata appendpartwithfiledata:data name:@"temp.jpg" filename:@"temp.jpg" mimetype:@"image/jpeg"]; }]; afjsonrequestoperation *operation = [afjsonrequestoperation jsonrequestoperationwithrequest:request success:^(nsurlrequest *request, nshttpurlresponse *response, id json){ .... my upload json looking this: http://base/url/uploads/add.json and have 1 parameter "file". server returns me error: "mandator...

turn off buildnumber-maven-plugin for submodules -

turn off buildnumber-maven-plugin for submodules - parent: class="lang-xml prettyprint-override"> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>buildnumber-maven-plugin</artifactid> <version>1.0</version> <executions> <execution> **<inherited>false</inherited>** <goals> <goal>create</goal> </goals> </execution> </executions> <configuration> <format>${project.version}-b{0,number}</format> <items> <item>buildnumber0</item> </items> <docheck>false</docheck> <doupdate>false</doupdate...

Parsing XML file stored in internal storage using DOM parser in android. -

Parsing XML file stored in internal storage using DOM parser in android. - i have created xml file in device's internal storage described on android developers website. want parse file using dom parser. need create dom parser read xml file?? here's snippet: documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocumentbuilder(); document dom = db.parse(new inputsource(new stringreader(data))); dom.getdocumentelement().normalize(); what need set in place of "data" in: document dom = db.parse(new inputsource(new stringreader(data))); i know it's silly help appreciated. you can create input stream of xml string below , getting nodes can parse values. inputstream = new bytearrayinputstream(thexmlstring.getbytes("utf-8")); // build xml document documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocume...

beautifulsoup - python finding index of tag in string -

beautifulsoup - python finding index of tag in string - html <div class="productdescriptionwrapper"> <p>a worm worth getting hands dirty over. on 6 feet of crawl space, playhut&rsquo;s wiggly worm brightly colored , friendly play structure. </p> <ul> <li>6ft of crawl through fun</li> <li>18&rdquo; diameter easy crawl through</li> <li>bright colorful design</li> <li>product measures: 18&quot;&quot;diam x 60&quot;&quot;l</li> <li>recommended ages: 3 years &amp; up<br /> &nbsp;</li> </ul> <p><strong>intended indoor use</strong></p> code def getbullets(self, soup): bulletlist = [] bullets = str(soup.findall('div', {'class': 'productdescriptionwrapper'})) bullets_re = re.compile('<li>(.*)</li>') bullets_pat = str(re.fin...

jstl + java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; -

jstl + java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; - i getting error likewise error 500--internal server error java.lang.nosuchmethoderror: javax.servlet.jsp.pagecontext.getelcontext()ljavax/el/elcontext; @ javax.servlet.jsp.jstl.core.looptagsupport.unexposevariables(looptagsupport.java:587) @ javax.servlet.jsp.jstl.core.looptagsupport.dofinally(looptagsupport.java:323) @ jsp_servlet._jsp.__searchsuccess._jsp__tag3(__searchsuccess.java:359) @ jsp_servlet._jsp.__searchsuccess._jspservice(__searchsuccess.java:191) @ weblogic.servlet.jsp.jspbase.service(jspbase.java:34) i have jars included; guess clashing of jar files. can verify?? please remove servlet-2.3.jar & esapi-1.4.4.jar file lib folder & execute programme again. it should work... below link help more details. how import javax.servlet api in eclipse project? jstl

python - Workaround to return a list from a ComputedProperty function in NDB -

python - Workaround to return a list from a ComputedProperty function in NDB - i converting app utilize ndb. used have before: @db.computedproperty def somecomputedproperty(self, indexed=false): if not self.somecondition: homecoming [] src = self.somereferenceproperty list = src.list1 + src.list2 + src.list3 + src.list4 \ + [src.str1, src.str2] homecoming map(lambda x:'' if not x else x.lower(), list) as can see, method of generating list bit complicated, prefer maintain way. when started converting ndb, replaced @db.computedproperty @model.computedproperty got error: notimplementederror: property somecomputedproperty not back upwards <type 'list'> types. i see in model.py in ext.ndb computedproperty inherits genericproperty in _db_set_value there several if/else statements handle value according type, except there's no handling lists currently goes through first status , gi...

sql - Return only records where there is a difference in field data -

sql - Return only records where there is a difference in field data - return records there difference in fte or position title field. i have table of employee info fields employee#, job#, start date fte , position. each employee , job want homecoming records there alter in fte or position record,employee#,job#,start date, fte,position 1, 1000, 01, 01/01/2011, 100, 2, 1000, 01, 01/06/2011, 100, 3, 1000, 01, 01/07/2011, 80, b 4, 1000, 01, 01/08/2011, 80, c 5, 1000, 01, 01/10/2011, 80, c 6, 1000, 02, 01/01/2011, 20, 7, 1000, 02, 01/05/2011, 20, 8, 1000, 02, 01/08/2011, 20, b the query should homecoming records 1, 3,4,6,8. (these records fte , position different previous row) this looks typical self-join scenario: need query table 1 time again , see if there's before record different fte or position. something (no did not seek this): select later....

asp.net mvc 3 - Bridge table with no primary key -

asp.net mvc 3 - Bridge table with no primary key - i have bridge table in database design , not have primary key. when seek utilize database first approach asp.net mvc 3 create model, creates model warning saying "the table/view 'crm_test_1.dbo.salesorderproduct' not have primary key defined , no valid primary key inferred. table/view has been excluded. utilize entity, need review schema, add together right keys, , uncomment it." am doing wrong or there way create warning go away?? thanks. you add together primary key (int, autonumber) if want suppress error message. need primary key. or create compound key of bridged ids, if makes sense in info model. asp.net-mvc-3 entity-framework database-first ef-database-first

Configuring Coffeescript SBT in Build.scala not build.sbt? -

Configuring Coffeescript SBT in Build.scala not build.sbt? - often come across instructions tell me how add together sbt tool build.sbt , have build.scala , not build.sbt . want know how same in build.scala ? the particular case causing me problem coffeescript sbt has instructions how add together build.sbt . don't have built.sbt , have build.scala , don't know do. the code referenced here helps solve problem. two options: go ahead , create build.sbt line given in coffeescript instructions. can coexist build.scala. in build.scala, find "settings" line within project , add together ++ coffeesettings it. may need import coffeescript.plugin.coffeesettings @ top. scala sbt

How can I create a 3d object/class in Python? -

How can I create a 3d object/class in Python? - my end goal right take points read text file, , turn them 3d objects. not need visualized, need stored in objects instead of string containing x, y, , z values. file gives me 6 numbers, 2 of each x, y, , z, , wondering how go creating point class/object take 3 variables , line object/class take 2 of points. just define point , line class: class point(object): def __init__(self, x=0, y=0 ,z=0): self.x = x self.y = y self.z = z class line(object): def __init__(self, point1=none, point2=none): self.point1 = point1 or point() # (0,0,0) default self.point2 = point2 or point() # (0,0,0) default to create points , lines objects: >>> p1 = point(1, 2, 3) >>> p2 = point(4, 5, 6) >>> line = line(p1, p2) python 3d

iphone - cocos2d error while loading sprite -

iphone - cocos2d error while loading sprite - i having quite unusual problem in loading sprite correctly loaded. error depicted in xcode console: cctexture2d. can't create texture. uiimage nil couldn't add together image:test.png in cctexturecache i can not see changed advice? do see test.png in project navigator ? if yes, click on it, , create included in target (show utilities, @ top right, above word 'view', right button of grouping of 3 buttons). create in pane 'target membership', build target selected. if not, well... know do. also, 'personal rule', before trying when sort of thing occurs, tend clean target (including project derived data), build , test again. xcode can have moments respect keeping track of files , stuff. iphone objective-c cocos2d-iphone

var - When will I need a javascript anonymous function immediately invoked? -

var - When will I need a javascript anonymous function immediately invoked? - i see no situation need this (function(param){ alert(param); //do })("derp"); istead of this alert("derp"); //do edit: ok, everybody, think got it. if have this: var param = "x"; var heya = "y"; (function(param){ alert(param); //do })(heya); the global variable "param" ignored in scope of anonymous function? how scenario? example #1 - uses invoked function look closes on single variable , returns function. resulting in beautiful, encapulated function. var tick = (function () { //example of function look + closure var tock = 0; homecoming function() { homecoming ++tock; } }()); //it impossible alter `tock` other using tick() tick(); //1 tick(); //2 tick(); //3 tick(); //4 versus example #2 - uses function declaration w/ global variable //unnecssary global (unless wrapped in funct...

autocomplete - Emacs documentation popup -

autocomplete - Emacs documentation popup - is possible emacs provide short list of possible function arguments whenever phone call function? for example, if type out this: foo( i see like foo(int x) foo(std::string x) foo(int x, int y, int z = 5) pop out under foo( currently using emacs c++ work, know such features other languages lisps, python, etc., well. also, not sure kind of feature called, appreciate if tell me too. take @ gccsense. it's tool author of auto-complete-mode , uses gcc find candidates code completion name suggests. cedet provides smart completion mechanism c/c++ (and other languages). this article on setting cedet might useful well. emacs autocomplete

android - Handling rotation of Cube with button -

android - Handling rotation of Cube with button - i have created rotating cube help of opengl want add together listener handle rotation of cube i.e. when click button cube must start rotating , vice versa. android opengl-es

android - Connect to SQL Server and show data in the app -

android - Connect to SQL Server and show data in the app - i have sql server 2008 r2 table contains info ordered numbers 1 99999. i want connect table , show lastly number of row in app, automatically without selecting anything. how it? thanks. if connect server android app recommend using webservice. take @ example: rest webservice and don't want select anything? can phone call stored procedure maybe? android sql-server select

c++ - Void Parameter Type Causes Missing Type Error -

c++ - Void Parameter Type Causes Missing Type Error - here prototype: void recvproxy_togglesights( const crecvproxydata* pdata, void* pstruct, void* pout ); and function itself: void recvproxy_togglesights( const crecvproxydata* pdata, void* pstruct, void* pout ){ cbasecombatweapon *pweapon = (cbasecombatweapon*)pstruct; if( pdata->m_value.m_int ) pweapon->enableironsights(); else pweapon->disableironsights();} and error message code, both prototype , definition, generates: error 19 error c4430: missing type specifier - int assumed. note: c++ not back upwards default-int f:\mods\ci testbed\src\game\shared\basecombatweapon_shared.cpp 47 how can resolve error? is type 'crecvproxydata' defined? code otherwise right (assuming user defined types defined properly), although suggest place opening , closing braces function definition on own lines. also, take issue void*: it's bit of hangover c, should aim eliminate source ...

java - JSF2.0 - Handling erroneous Ajax calls with Primefaces 3.0 -

java - JSF2.0 - Handling erroneous Ajax calls with Primefaces 3.0 - i have commandbutton in .xhtml page: <p:commandbutton action="#{someone.dosomething()}" ajax="true" onerror="errordialog.show();"> </p:commandbutton> it's making ajax call. how can observe situations such net connection problem (of client/browser), timeout, session-timeout, server-side exceptions, crashes etc in middle of ajax phone call show informative message user? does onerror attribute of p:ajax handle of those? if not, what? :) what's default timeout btw? any help appreciated, thanks. onerror calls function: onerror(xhr, status, exception) - javascript callback process when ajax request fails. takes 3 arguments, xmlhttprequest, status string , exception thrown if any. this info documentation. xhr - request. there can found request status , lot of other info. <p:commandbutton action="#{someone.d...

c# - Are there any code analysis tools to detect the == operator when it's comparing specific types? -

c# - Are there any code analysis tools to detect the == operator when it's comparing specific types? - in legacy code-base, many technical reasons, replacing parameters have been of base of operations class type interface type. example: public interface idomainobject { int id { get; } } public abstract class basedomainobject : idomainobject { public int id { get; protected set; } public override bool equals(object obj) { var domainobj = obj basedomainobject; homecoming domainobj != null && id.equals(domainobj.id); } public static bool operator ==(basedomainobject x, basedomainobject y) { homecoming !referenceequals(x, null) && !referenceequals(y, null) && x.equals(y); } public static bool operator !=(basedomainobject x, basedomainobject y) { homecoming !(x == y); } } public class mydomainobject : basedomainobject { public mydomainobject(int id) { id = id; } ... } ...

Android: How to make a Spinner invisible and then visible again? -

Android: How to make a Spinner invisible and then visible again? - i have next spinner : spinner spinner = (spinner)findviewbyid(r.id.sp1); and create invisible this: spinner.setvisibility(trim_memory_background); this create spinner invisible how create visible again? thanks in advance. //hide spinner.setvisibility(view.gone); //show spinner.setvisibility(view.visible); android

arrays - Java Game Dev: Sprite sheet frame by row and column? -

arrays - Java Game Dev: Sprite sheet frame by row and column? - i'm trying figure out how x , y coords of frames of animated sprite sheet giving frame width, height, rows, columns, , framecount. want give me row , column number frame in given framenumber. (counting top bottom right left) i realized column number (if consider rows , columns represented int[][] ) doing framenumber % rows i'm stumped on how row number. ideas? if have cols columns, can use: use: row = math.floor(framenumber / cols); col = framenumber % cols; so if have 1000 cols , want frame number 3989 give you: row = 3; col = 989; java arrays math multidimensional-array

java - removing deadlock issue with sql server 2008 while reading and writing data -

java - removing deadlock issue with sql server 2008 while reading and writing data - java.sql.batchupdateexception: transaction (process id 58) deadlocked on lock resources process , has been chosen deadlock victim. rerun transaction. i have 2 java application 1 reading info sybase , writing sql server 2008 , reading info sql server 2008 table , writing other table. 2 application works fine. have many people accessing info mssql table sec application updates info every 30 sec. above exception. saw similar thread here in stackoverflow help deadlock in sql server 2008 have problem solution presented here row versioning can user rowversioning avoid dead locks in situation , how utilize it? edit string selectallquery = "select new_site_id gis.map.ro"; string selectquery = "select siteid gis.map.status alarmcode in ('1','2','3') , localnodealias 'flm%'"; string updatequery = "upd...

Android FragmentPagerAdapter with LoaderManager -

Android FragmentPagerAdapter with LoaderManager - i have fragmentactivity viewpager , fragmentpageradapter. each fragment in viewpager needs load info webservice. i've written loadermanager/custom loaders perform webservice calls, parse xml etc , these working fine. there 2 possible designs managing loading , fragments. 1) main activity manages loading on behalf of fragments. the fragment makes phone call main fragmentactivity requesting it's data. activity checks if loader info running, if not creates 1 , performs load. in case how tell fragment info has been loaded , ready painting. using custom loaders not simplecursors fragment populate textviews etc object instance must told when objects have been populated. it doesn't seem fragmentpageradapter allows allocate tags or id's fragments when instantiate them in getitem. how can find fragment fragmentactivity , tell paint data? 2) each fragment manages own loading. the fragment initialise...

javascript - How to detect moving of an item between knockout observable arrays -

javascript - How to detect moving of an item between knockout observable arrays - i building web-abb using query , knockout. on page have couple of lists of items. these lists sortable , connected, far jquery goes working ok. have used ryan niemeyer's illustration create custom binding sortables update view-model's observable arrays. this works quite nicely want save changes back-end server. using subscriptions on observable arrays can observe item removed from, , added array leads 2 update calls back-end server. if goes wrong during 1 of these calls backend in invalid state. how 1 go detecting removal of item , subsequent adding of same item web-application can create 1 move-call back-end server? i think way handle add together callback alternative sortablelist binding passes item, original parent, , new parent arguments. here binding using ko 2.0 might callback: //connect items observablearrays ko.bindinghandlers.sortablelist = { init: function...

php - Javascript, onClick event is producing different than I asked -

php - Javascript, onClick event is producing different than I asked - i'm designing web project cooking recipes. when user wants add together ingredient recipe, needs add together ingredients 1 1 using dynamic list i'm trying code jquery(ajax). my problem is, if user enters 1 word ingredient, works great. if user enters more 1 word ingredient, weird things happening. (yes cannot explain what's going on. newbie javascript coder spotted.) here codeline: $("#inglist").append("<br id="+i+"><div id="+i+">"+$("#ingredient").val()+" <a href='#' onclick=removeingr('"+ingr+"',"+i+")>remove</a></div>"); this codeline suppose add together <br> , <div> tags, index number of ingredient id attribute, name of ingredient (from input line id ='ingredient') tag onclick event calls removeingr(ingredientname,index) method if use...

r - How do you relate ggplot2 grobs back to the data? -

r - How do you relate ggplot2 grobs back to the data? - given ggplot of, example, points, how find out row of info given point corresponded to? a sample plot: library(ggplot2) (p <- ggplot(mtcars, aes(mpg, wt)) + geom_point() + facet_wrap(~ gear) ) we can grobs contain points grid.ls + grid.get . grob_names <- grid.ls(print = false)$name point_grob_names <- grob_names[grepl("point", grob_names)] point_grobs <- lapply(point_grob_names, grid.get) this lastly variable contains details of x-y coordinates, , pointsize, etc. (try unclass(point_grobs[[1]]) ), isn't obvious how row of info in mtcars each point corresponds to. to reply kohske's question why doing this, i'm using gridsvg create interactive scatterplot. when roll mouse on point, want display contextual information. in mtcars example, show tooltip name of auto or other values row of info frame. my hacky thought far include id column invisible text l...

Distance between two elements in an two dimensional array -

Distance between two elements in an two dimensional array - i trying solve 8 puzzle game program. reason need find distance between 2 elements of 2 dimensional array. illustration int[][] input = { { 8, 5, 1 }, { 7, 4, 3 }, { 2, 0, 6 } }; if want move '8' position [2][2], need 4 moves(move 2 cells horizontally , 2 vertically) distance [0][0] [2][2]. how can distance? the distance [a1][b1] [a2][b2] abs(a1-a2)+abs(b1-b2). arrays

haskell - Writing "fib" to run in parallel: -N2 is slower? -

haskell - Writing "fib" to run in parallel: -N2 is slower? - i'm learning haskell , trying write code execute in parallel, haskell runs sequentially. , when execute -n2 runtime flag take more time execute if omit flag. here code: import control.parallel import control.parallel.strategies fib :: int -> int fib 1 = 1 fib 0 = 1 fib n = fib (n - 1) + fib (n - 2) fib2 :: int -> int fib2 n = `par` (b `pseq` (a+b)) = fib n b = fib n + 1 fib3 :: int -> int fib3 n = runeval $ <- rpar (fib n) b <- rpar (fib n + 1) rseq rseq b homecoming (a+b) main = putstrln (show (fib3 40)) what did wrong? tried sample in windows 7 on intel core i5 , in linux on atom. here log console session: ghc -rtsopts -threaded -o2 test.hs [1 of 1] compiling main ( test.hs, test.o ) test +rts -s 331160283 64,496 bytes allocated in heap 2,024 byt...

java - Grails JSON converter does not respect array order? -

java - Grails JSON converter does not respect array order? - this first question @ so. not last. i have 3 tier application this javascript (mootools) <-> grails 1.3.7 <-> j2ee (<-> persistance layer) as know, grails has wonderful conversion tool, allowing serialize object json. i'm seeing weird behavior in json output, order of arrays not preserved. in java backend it's represented dto several list attributes containing more dto's, requested grails via remote ejb. it's serialized json , passed javascript. in case grails application proxy. has else experienced serializing problem in grails or should start search farther downwards stack? the json conversion should 1:1, i'm trying rule out culprit here. best regards, michael -- edit: wasn't json conversion obscure place farther down. java json grails ejb

How to break date field into year, quater, month, day in FastCube (under Delphi XE2) using coding? -

How to break date field into year, quater, month, day in FastCube (under Delphi XE2) using coding? - what want achieve:- want add together fields such year_mydatefield, month_mydatefield, quater_mydatefield on x-axis. these break downwards fields available during runtime in fields list, want code them appear automatically. is there variable defined in fccube.pas type of fields? or can utilize other methods such fcslice.addcalcfieldto? how utilize them? research done:- example, have larn how set measures on x-axis using smeasuresfieldname. fcslice1.addfieldto(smeasuresfieldname, '', rf_capxax); smeasuresfieldname defined in fccube.pas. unfortunately, delphi xe2 cannot locate fccube.pas, , programmer manual fastcube lists out methods , parameters not explain how utilize them, limited illustration well. alternatively, add together dateutils unit , use myreportvalue1 := yearof(mydatefield); myreportvalue2 := monthof(mydatefield); myreportval...

hard drive - bash protect HD from excessive use -

hard drive - bash protect HD from excessive use - how avoid breaking hd? have bash script running on ubuntu machine, meta code: bash1.sh while(true) run bash2.sh sleep 60 seconds done bash2.sh: if(directory empty): exit process file delete file the directory network shared, , computer not doing else. 1 time per day new file arrives , processed. (i know bash1.sh can replaced watch). concern bash1.sh reading bash2.sh everytime - can presumably avoided having 1 script!? , bash2.sh reading same directory everytime. directory read hd, or ubuntu somehow caching dir in ram? -so read when changes? problem same place on hd read every time, or not matter because hd spinning? if hd never sleeps, matter if set loop time downwards 1 second? maybe directory pure ram dir - how do that? -or there simple way check if has arrived on network without reading directory? reading file or directory 1 time every 60 seconds not excessive use. seriously, don't worry it. ...

How do you edit compiled Java bytecode? -

How do you edit compiled Java bytecode? - i used decompiler find next function in compiled code: public static void sub_e5b() { var_972 = null; system.gc(); vservconfighashtable = new hashtable(); vservconfighashtable.put("appid_end", "498"); vservconfighashtable.put("showat", "both"); vservconfighashtable.put("categoryid", "22"); vservconfighashtable.put("viewmandatory_end", "true"); (new vserv_bci_class_000(var_93a, vservconfighashtable)).showatend(); } now want alter "true" value "false" . what tools and/or techniques used create change? this can done using disassembler krakatau (disclosure, wrote it). the advantage of using disassembler on decompiler it's guaranteed work. not code can decompiled, can disassembled. for example, take class this. public class a{ public static v...

php - Enter variable into sql table Problems -

php - Enter variable into sql table Problems - ok having problems insert variable sql table. heres code if (isset ($_get['comment'])) $commententered = $_get['comment']; else $commententered = "refuse"; above variable seek pass database code below $sql = "insert $db_table (comment) values('$commententered');"; $res = mysql_query($sql,$con) or die(mysql_error()); mysql_close($con); if ($res) { echo "success"; }else{ echo "faild"; }// end else my problem is, when pass single word works, when text box comment received has spaces in it, not insert? i.e - user enters hello - works the user enters hello world - doesn't work any help much appreciated! try $sql = "insert " . $table . " (comment) " . "values ('" . mysql_real_espace_string($commententered) . "')"; also, dump var $commententered before "$sql = ......

java - Unlimited quantifiers in a complex lookbehind -

java - Unlimited quantifiers in a complex lookbehind - i'm having lot of problem writing regular expression: (?<=\s+|^\s*|\(\s*|\.)(?:item|item1|item2)(?=\s+|\s*$|\s*\)|\.) it works on regex editor (expresso) , in .net environment, in java environment (jre 1.6.0.25 using eclipse helios r2) doesn't work because pattern.compile() method throws "syntax error u_regex_look_behind_limit" exception. that's because behind pattern (?<=\s+|^\s*|\(\s*|\.) must have defined limit (unlimited quantifiers such * , + not allowed here far know). i tried specify range of repetition in way no luck: (?<=\s{0,1000}|^\s{0,1000}|\(\s{0,1000}|\.)(?:item|item1|item2)(?=\s+|\s*$|\s*\)|\.) so, how can write identical regex works on java environment? can't believe there's no workaround kind of mutual situation.... keep in mind lookbehind far behind must. example, (?<=\s+) satisfied if previous character space; doesn't need farther b...

c# - Reflection: Type of item contained in non-generic subclass of generic list -

c# - Reflection: Type of item contained in non-generic subclass of generic list - public class mylist : list<myclass> how can type myclass through reflection if have object contains instance of mylist ? list can empty, can't mylist[0].gettype() . p.s. can't stop using mylist , straight utilize generic list instead (the situation bit more complicated, , there reasons "hiding" generic argument), can't pick myclass through getgenericarguments() . var elementtype = ( iface in mylist.gettype().getinterfaces() iface.isgenerictype iface.getgenerictypedefinition() == typeof(ilist<>) select iface.getgenericarguments()[0]) .single(); i utilize ilist<t> instead of list. more generic. however, there alter of type implementing multiple ilis<t> versions (such ilist<string> , ilist<int> ). c# reflection

tsql - What to do with same subquery repeating many times in select statement, if it includes outside condition -

tsql - What to do with same subquery repeating many times in select statement, if it includes outside condition - i'll seek create specific possible. have table containing transaction info on items. possible transactions purchase (type_id: 1) , sale(type_id: 2). stripped downwards version of table "transactions" following: transaction_id item_id transaction_type_id quantity cost date 1, 1, 1, 50, 10, 6/1, 2, 2, 1, 40, 20, 13/1, 3, 1, 2, 10, 13, 14/1, 4, 2, 2, 20, 25, 3/2, 5, 1, 2, 20, 12, 20/2 i have next query: select b.item_id b.quantity - (select sum(quantity) transactions a.item_id = b.item_id , a.transaction_type_id = 2) 'quantity left' b.price * (b.quantity - (...