Posts

javascript - What should be the timeout for window resize dragging? -

i have code fires when user has stopped resizing window (by dragging). uses 100ms timeout not fire @ every single window resize event. i'd find balance between swiftness , unnecessary runs of code heavy. user experience standpoint, how many ms should set to? var resizeto = false; $(window).resize(function(){ if(resizeto !== false){ cleartimeout(resizeto); } resizeto = settimeout(function(){ // code }, 100); });

utf 8 - How to convert windows-1256 to utf-8 in lua? -

i need convert arabic text windows-1256 utf-8 how can that? help? thanks try lua-iconv , binds iconv lua.

iOS6 XCode4.6.2 Passing Row Number via a Segue -

if pass data via seque view controller, e.g. - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"mysequeidentifier"]) { nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; recipientviewcontroller *destviewcontroller = segue.destinationviewcontroller; destviewcontroller.intpassedrow = indexpath.row; } } this passes correct row number but... i error saying "incompatible integer pointer conversion assigning 'int' 'int'." if both ints have done wrong?

xml - Data at the root level is invalid. Line 2, position 12 -

i trying create .xml file in isolatedstorage , updating when try read file getting xmlexception. here code using (isolatedstoragefile isostore = isolatedstoragefile.getuserstoreforapplication()) { xmlwritersettings settings = new xmlwritersettings(); settings.indent = true; try { isolatedstoragefilestream isofilestream = isostore.openfile("favourites.xml", filemode.open, fileaccess.readwrite); using (xmlwriter writer = xmlwriter.create(isofilestream, settings)) { xdocument doc = xdocument.load(isofilestream); doc.root.add( new xelement("recipe", new xattribute("id", thisrecipe.recipeid), new xattribute("title", thisrecipe.title), new xattribute("youtubeid", thisrecipe.youtubei...

Get xml attribute in PHP -

i want know temperature city using yahoo wheater (xml), xpath , php. code use doesn't work. can element (description) not attribute (temperature) want. $xml = new domdocument(); $xml->load("http://weather.yahooapis.com/forecastrss?w=12818432&u=c"); $xpath = new domxpath($xml); $result = $xpath->query("//channel"); foreach ($result $value) { //$weather = $value->getelementsbytagname("description"); $weather = $value->getelementsbytagname("yweather:wind"); $temp = $weather->getattribute("chill"); print $temp->item(0)->textcontent; } you should use getelementsbytagnamens() elements within namespace. $ns_yweather = "http://xml.weather.yahoo.com/ns/rss/1.0"; $weer = $value->getelementsbytagnamens($ns_yweather, "wind")->item(0); print $weer->getattribute("chill");

Draw faster circles with Python turtle -

i have exercise wherein have draw lot of circles python turtle. have set speed(0) , using: from turtle import* speed(0) i=0 while < 360: forward(1) left(1) i+=1 to draw circles. takes long. there faster way? you draw fewer segments, rather 360 go 120: while < 360: forward(3) left(3) i+=3 that make circle less smooth, 3 times faster draw.

HTTP Status 500 - java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.el.ELContextImpl -

this question has answer here: how import javax.servlet api in eclipse project? 12 answers when try browse "localhost:8080" on myeclipse, following error: type exception report message java.lang.noclassdeffounderror: not initialize class org.apache.jasper.el.elcontextimpl description server encountered internal error prevented fulfilling request. exception javax.servlet.servletexception: java.lang.noclassdeffounderror: not initialize class org.apache.jasper.el.elcontextimpl org.apache.jasper.servlet.jspservlet.service(jspservlet.java:343) javax.servlet.http.httpservlet.service(httpservlet.java:728) root cause java.lang.noclassdeffounderror: not initialize class org.apache.jasper.el.elcontextimpl org.apache.jasper.compiler.validator$validatevisitor.prepareexpression(validator.java:1568) org.apache.jasper.compiler.validator$validate...