Posts

ios - Merge html files into UIWebView -

i have create uiwebview adding data i'm getting api html file have locally. it's first time have , can't find how this. my html file looks : <h1>%%%title%%%</h1> <p class="date">%%%date%%%</p> <a %%%hrefimage%%% class="link-diapo"> <div class="image"> <img src="%%%img%%%" alt="%%%title%%%"/> %%%diapo%%% </div> </a> <div id="content" style="font-size:%%%size%%%px;"> <p>%%%chapo%%%</p> <p>%%%html%%%</p> <p class="source">%%%author%%%</p> </div> and data : "title": "my title", "date": "2013-07-10", "hour": "19h45", "chapo": "blablabla", ...

javascript - create three circles using D3 -

i started learning d3. tutorial website, found following code: <!doctype html> <html> <head> <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> </head> <body> <div id="viz"></div> <script type="text/javascript"> var samplesvg = d3.select("#viz") .append("svg") .attr("width", 100) .attr("height", 100); samplesvg.append("circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", 50) .attr("cy", 50) .on("mouseover", function(){d3.select(this).style("fill", "aliceblue");}) .on("mouseout", function(){d3.select(this).style("fill", "white");}); </script> </body...

java - Re-Attaching detached objects in Playframework -

i have process user can create object (let's call a) , manipulate in several steps. user can add reference persisted entity object (let's call persisted entity b). not want persist in database unless last step has been finished, i'm caching after each step. i using playframework java , jpa , b gets detached retrieve database, assign , cache a. after submitting last step, need have transient object b again in order persist it. here exception [persistenceexception: org.hibernate.persistentobjectexception: detached entity passed persist: models.b] what best way archive that? thanks in advance i'm bit puzzled question. entity objects in detached state if ever been managed persistence context (eg: ever been saved / updated / retrieved database) or create new entity object , set primary key field. until entities transient. looking @ requirement why not keep transient (eg: save in http session) until last step , persist ? on side note, if i'm not...

javascript - jqm panel stops opening after refresh to the page (edited) -

i using jquery mobile 1.3.1 panels. have 2 panels (one on left, 1 on right) , open panels there buttons , @ same time swipe events. working fine if user doesn't refresh page. if user refreshes page can open panel @ page when clicks link on panel , routes page can't open panels more (swipe or button both of them doesn't work). if refresh page again again starts work 1 time. way using ajax transitions in jqm. couldn't find out why. missing in usage of panels. here html; <div data-role="page"> <div data-role="panel" id="left-panel" class="panel" data-display="push" data-position="left" data-theme="a" class="ui-response"> <div data-role="fieldcontain"> <input type="search" name="password" id="search" value="" placeholder="search"/> </div> <a data-role="button" href="home...

c# - Is there any point in declaring arguments as [In] when PInvoking? -

when using platform invokes, specifying arguments [in] make difference in how runtime approaches these? for instance, when pinvoking createremotethread , lpthreadid specified out per article on msdn: handle winapi createremotethread( _in_ handle hprocess, _in_ lpsecurity_attributes lpthreadattributes, _in_ size_t dwstacksize, _in_ lpthread_start_routine lpstartaddress, _in_ lpvoid lpparameter, _in_ dword dwcreationflags, _out_ lpdword lpthreadid ); and other arguments _in_ . in c# code, handle specific function so: [dllimport("kernel32.dll", entrypoint = "createremotethread", setlasterror = true)] public static extern intptr createremotethread( intptr hprocess, intptr lpthreadattributes, uint dwstacksize, intptr lpstartaddress, intptr lpparameter, uint dwcreationflags, [out] intptr lpthreadid); adding [out] attribute lpthreadid runtime knows marshal caller. ...

android - IBM Worklight 5.0.6.1 - Not getting Push Notifications when phone/app is closed -

i have worklight hybrid app basic push notification working in android. if app running , in focus when notification pushed, behaves expect. notification callback in app called, , pops simpledialog. all good . if dismiss app clicking on home button, , new message arrives, see notification in android notification area, , when click on item in android notification list, item gets dismissed list (but app not come focus) if launch app apps menu, sitting left , simpledialog showing. (my notification handler called) mostly good , expected app come focus when selected notification in android notification list. if dismiss app clicking on button, , new message arrives, see notification in android notification area, , when click on item in android notification list, item gets dismissed list (but app not come focus) if launch app apps menu, launches app fresh (i have log in again) , notification handler never called. not good . if force stop app, or turn phone off while notificatio...

Change edge thickness with tkplot (Igraph, R) -

Image
i wondering if there way change edge thickness when using tkplot() i know can right clicking edge , changing manually, able call attribute use edge. similar when using normal plot function in igraph can edge.width=e(g)$weight also, there way save tkplot png without use of other packages? thanks! yes, can change edge width, works same way plot() . the tk canvas not support png format, cannot save tkplot() output in png. if use tkplot() adjusting coordinates, use tkplot.getcoords() query adjusted coordinates , use plot() these coordinates create png file. library(igraph) g <- graph.ring(10) id <- tkplot(g, edge.width=1:10) ## adjust coordinates hand, , continue. ## e.g. moved vertex 7 middle co <- tkplot.getcoords(id) png("output.png") plot(g, layout=co, edge.width=1:10) dev.off()