Posts

javascript - SQLite plugin Cordova basic code -

i'm new cordova & sqlite wrote code , can't figure out wrong it? suggestions? following output javascript debugger: click see error messages <script type="text/javascript"> // wait cordova load document.addeventlistener('deviceready', ondeviceready, false); var output = document.getelementbyid('outputfield'); // cordova ready function ondeviceready() { window.sqliteplugin.opendatabase({ name: 'test.db', location: 2 }, function (db) { output.innerhtml += '</br> - database created/opened'; db.transaction(function (tx) { tx.executesql(tx, "create table localstorage2 if not exists (key unique, value)"); }); output.innerhtml += '</br> - table localstorage2 created'; storevalue(db, 'localstorage2', 'testkey', 'testvalue'); output.innerhtml += '...

spring - Error creating bean with name 'dao': Injection of persistence dependencies failed -

i dont know ahy got error main ibanquemetier metier; classpathxmlapplicationcontext context = new classpathxmlapplicationcontext( new string[]{"applicationcontext.xml"}); metier = (ibanquemetier) context.getbean("metier"); metier.addclient(new client("client1","adress1")); banquedaoimpl public class banquedaoimpl implements ibanquedao { @persistencecontext private entitymanager em; @override public client addclient(client c) { // j'enregistre le client c et je le retourne em.persist(c); return c; } .... and 1rst error : info : org.springframework.context.support.classpathxmlapplicationcontext - refreshing org.springframework.context.support.classpathxmlapplicationcontext@1be847c: startup date [fri feb 05 14:22:40 cet 2016]; root of context hierarchy info : org.springframework.beans.factory.xml.xmlbeandefinitionreader - loading xml bean d...

java 8 - How do streams stop? -

i wondering when created own infinite stream stream.generate how streams in standard library stop... for example when have list records: list<record> records = getlistwithrecords(); records.stream().foreach(/* */); the stream won't infinite , running forever, stop when items in list traversed. how work? same functionality applies stream created files.lines(path) (source: http://www.mkyong.com/java8/java-8-stream-read-a-file-line-by-line/ ). and second question, how can stream created stream.generate stopped in same manner then? finite streams aren’t created via stream.generate . the standard way of implementing stream, implement spliterator , using the iterator detour . in either case, implementation has way report end, e.g. when spliterator.tryadvance returns false or foreachremaining method returns, or in case of iterator source, when hasnext() returns false . a spliterator may report expected number of elements before processing begins. ...

html - Span content over two divs -

i have following code text in red div respond/wrap around yellow box. possible (ideally without js)? #div1 { float: left; width: 300px; } #div2 { float: left; width: 50%; background-color: blue; } #div3 { float: left; width: 50%; background-color: red; } p span { width: 250px; height: 50px; left: 20px; display: inline-block; clear: both; float: left; background-color: yellow; position: relative; } <div id="div1"> <div id="div2"> <p>bonorum has. ut cibo quas tantas, vis ut probo adhuc definiebas, has @ meis debet vulputate. no sed velit essent suavitate, <span>overlap me</span> in pro decore ceteros temporibus, usu in odio offendit theophrastus. mel labore indoctum cu, ad soleat admodum delicatissimi sed, mei viris tritani ullamcorper eu. ut vim simul aperiam.</p> </div> <div id="div3"> <p>bonorum has. ut cibo qu...

javascript - Meteor fetch on client undefined outside of helper -

i trying fetch entry in collection with: client/views/home.js : criticalcrewnumber = configvalues.find({ name: 'criticalcrewnumber' }).fetch()[0].value; but i'm getting error: uncaught typeerror: cannot read property 'value' of undefined if run code in browser console, desired value returned string. i have tried various things, e.g. using findone ; placing code elsewhere in app; using iron-router waiton subscription come, etc. every attempt far has failed end undefined . here's how collection defined, published , subscribed to: lib/config/admin_config.js : configvalues = new mongo.collection("configvalues"); configvalues.attachschema(new simpleschema({ name: { type: string, label: "name", max: 200 }, value: { type: string, label: "value", max: 200 } })); both/collections/eventscollection.js : if (meteor.isclient) { meteor.subscribe('events'); meteor.subscribe(...

angularjs - ui-router $urlRouterProvider wait until all states loaded -

i'm trying dynamically load bunch of states, merging them disperse files. i'm collecting of them $http.get , add $stateprovider.state(name, config) . all ok here. the problem if enter url, besides root url "/", same url never resolved correct state. it seems that, if load app root state , navigate there, $urlrouterprovider can match loaded states, but, if try enter app child state, example "/#/anotherpage", cannot match url/state , fallback .otherwise('/') . it's if tries resolve url without waiting states loaded. i'm using $urlrouterprovider.deferintercept() try stop continue, , after configuration, enable again sync. app.config(configure).run(['$urlrouter', function($urlrouter){ $urlrouter.sync(); $urlrouter.listen(); }]); how make sure $urlrouterprovider waits until states loaded during .config() , , try match correct state? thanks. i'm not sure had related i'll post : c...

CUDA C++ Linking error undefined reference threadIdx.x -

hello trying parallelize lattice boltzmann solver on cuda. somehow getting error while linking object files together. objects compiles without error. lbmsolver.o: in function > lbmsolver::calcmoments_gpu(lbmuniformgrid2d::lbmgridnode**, int)': tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x939): undefined >reference to blockdim' tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x93f): undefined >reference blockidx' tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x948): undefined >reference to threadidx' tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x953): undefined >reference blockdim' tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x959): undefined >reference to blockidx' tmpxft_00004b33_00000000-3_lbmsolver.cudafe1.cpp:(.text+0x962): undefined >reference `threadidx' here makefile: objs = main.o lbmsolver.o lbmuniformgrid2d.o lbmboundaryconditions.o writevtk.o cc...