Posts

react native - Onesignal making user appear 'active' every hour -

i segmenting users location filter. location updated if mobile app in foreground. there way mimic user's last activity / location every hour if app in background? using react native. you can update player / user record last location through rest api sending lat , long . https://documentation.onesignal.com/reference#edit-device you need use plugin or own native code location of device in background.

java - Moving Vehicle Path Distance Calculation Using Android Device and LocationManager -

any , gives accurate traveled distance example welcomed. tried calculating latitude , longitude. storing previous , current points data , distance , adding every 5 seconds when vehicle speed != 0 checked many rounds of moving vehicle, every time getting different kms distance. not accurate. accuracy solution moving vehicle path distance calculation. private double journeypathdistance(double currentlat, double currentlng) { if (isfirsttime && vehiclespeedvalue != 0) { location loc1 = new location(""); loc1.setlatitude(currentlat); loc1.setlongitude(currentlng); location loc2 = new location(""); loc2.setlatitude(currentlat); loc2.setlongitude(currentlng); isfirsttime = false; prevlat = currentlat; prevlng = currentlng; distancekms = loc1.distanceto(loc2) / 1000; } else { if (vehiclespeedvalue != 0) { location loc1 = new location(""); ...

android - Get PicturePath selected from gallery to store it in dataBase -

i used code upload image gallery .it works perfectly..but problem wanna image's path store in wamp database ..` public class image extends activity { imageview contact; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_image); contact = (imageview) findviewbyid(r.id.candidat); contact.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_get_content); startactivityforresult(intent.createchooser(intent, "select contact image"), 1); } }); } public void onactivityresult(int reqcode, int rescode, intent data) { if (rescode == result_ok) { if (reqcode == 1) contact.setimageuri(data.getdata()); } } } thank help ...

javascript - jquery selector for id starts with specific text -

this question has answer here: find html element id starts 4 answers i have jquery code: $( "#editdialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); but have several divs id's this: editdialog-0, editdialog-1, ...., editdialog-n. how can make jquery code of these divs, 1 above? use jquery starts with attribute selector $('[id^=editdialog]') alternative solution - 1 (highly recommended) a cleaner solution add common class each of divs & use $('.commonclass') . but can use first 1 if html markup not in hands & cannot change reason. alternative solution - 2 (not recommended if n large number ) (as per @mihai stancu's suggestion) $('#editdialog-0, #editdialog-1, #editdialog-...

java - Can't access sqlite db from Spark -

i have following code: val conf = new sparkconf().setappname("spark test") val sc = new sparkcontext(conf) val sqlcontext = new org.apache.spark.sql.sqlcontext(sc) val data = sqlcontext.read.format("jdbc").options( map( "url" -> "jdbc:sqlite:/nv/pricing/ix_tri_pi.sqlite3", "dbtable" -> "select security_id ix_tri_pi")).load() data.foreach { row => println(row.getint(1)) } and try submit with: spark-submit \ --class "com.novus.analytics.spark.sparktest" \ --master "local[4]" \ /users/smabie/workspace/analytics/analytics-spark/target/scala-2.10/analytics-spark.jar \ --conf spark.executer.extraclasspath=sqlite-jdbc-3.8.7.jar \ --conf spark.driver.extraclasspath=sqlite-jdbc-3.8.7.jar \ --driver-class-path sqlite-jdbc-3.8.7.jar \ --jars sqlite-jdbc-3.8.7.jar but following exception: exception in thread "main" java.sql.sqlexception: no suitable driver ...

swift - IOS Push Notifications using Parse -

i'm trying ping users in channel within distance current user's location. problem stuck on inability satisfy both constraints. 1 or other works itself. both, message sent nobody somehow. missing here? in advance! func finddriver(loc: cllocationcoordinate2d) { let driverquery = pfinstallation.query() driverquery?.wherekey("channels", equalto:"drivers") let geopoint = pfgeopoint(latitude: loc.latitude, longitude: loc.longitude) driverquery?.wherekey("location", neargeopoint: geopoint) let push = pfpush() push.setquery(driverquery) push.setmessage("looking drivers!") push.sendpushinbackground() } maybe try , query ? here link: https://www.parse.com/questions/combining-or-queries func finddriver(loc: cllocationcoordinate2d) { let driverquery = pfinstallation.query() driverquery?.wherekey("channels", equalto:"drivers") let geopoint = pfgeopoint(latitude: loc.latitude, lon...

html - autocomplete off still keep history? -

did puting autocomplete off on input text browser not remember text or not using it? i have textbox personal things , want sure cannot retrieve on public computer. according mdn page regarding html autocompletion, browsers not save data if autocomplete turned off form or field: setting autocomplete="off" here has 2 effects: it stops browser saving field data later autocompletion on similar forms though heuristics vary browser. it stops browser caching form data in session history. when form data cached in session history, information user has filled in visible after user has submitted form , clicked on button go original form page.