Posts

PHP LOAD DATA LOCAL INFILE Realtime Update MySQL -

good evening, i having problems trying achieve in php/mysql. i have text file (in real time) taking 1 row of numbers i.e. 1.43 etc sensor on com port. information needs sent mysql pretty in real time. as test have used text document without real time using php load data local infile seems sending data mysql database. my question is, how send data 1 second, next second send latest information not on mysql database, otherwise have loads of duplicate data? my current code follows: <?php $username = "root"; $password = ""; $hostname = "localhost"; // connect database , table $dbhandle = mysql_connect($hostname, $username, $password) or die("unable connect mysql"); echo "connected mysql<br>"; $selectdatabase = mysql_select_db("data",$dbhandle) or die("could not select iwemsdata"); echo "connected iwemsdata<br>"; // text file read in $textfile = 'data.txt'; mys...

webos - enyo mixin: Is this proper usage? -

i have following code, looks following: var shared = { create: function(){ //do stuff on create } } enyo.kind(enyo.mixin({ name: "custominput", //properties unique input. kind: enyo.input },shared)); enyo.kind(enyo.mixin({ name: "customtextarea", //properties unique input. kind: enyo.textarea },shared)); enyo.kind(enyo.mixin({ name: "customselect", //properties unique input. kind: enyo.select },shared)); i'm being informed peers incorrect way of doing things, , potentionally break something, or confusing because they've never seen mixins used in way. my question is, there wrong doing this, in way? if extending kinds mixins, here newer way this: enyo.createmixin({ name: 'mymixin', mymethod: function() { // stuff } }); enyo.control.extend({ mixins: ['mymixin'] }); this mix in before instantiation. if wish add properties @ run time, ...

android - Clear Data on update -

i'm maintaining long living app on android, , i've decided change data model behind merging few sqlite databases single new one. the thing is, if create new db , stop using old ones, every app user out there still have old sqlite files in local storage. is there way force "clear data" upon new version of app? (i'm looking "right" way it, know can check if new db exists , act according, think there may better way) thanks whenever database needs upgraded(when user downloads new version of app, example), change in database version number calls onupgrade() method, can override thiis method provided sqliteopenhelper class: @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { log.w("taskdbadapter", "upgrading version "+oldversion +" "+newversion +", destroy old data"); (string string : table_names) db.execsql("drop table...

hibernate - Order second table before joining -

i have topicentity contains many postentity . each postentity belongs 1 topicentity . need sort topics last post creation date, creationdate property of newest post in topic. what think needs happen: get topics join posts belong topic sort posts creation date get newest post each topic , use date sort topics this have currently: this.session.createcriteria(topicentity.class, "topic") .createalias("topic.posts", "post", criteriaspecification.left_join) .addorder(order.asc("post.creationdate")).list(); this not sort topics in way. believe because not perform points 3 , 4 list. anyway, hint me proper way of achieving desired result? prefer criteria, if hql required, that's fine.

vb.net - Get file from "Windows Explorer - Open With" -

i'm not quite sure start this. on right-clicking on generic file in windows explorer (e.g. *.doc word document) 1 can choose "open with...". 'd know how program knows file has been "passed" (is right word?). done via arguments? how can implement in own application? i tried manually adding file path arguments of 1 of applications when run, path includes spaces (which denotes new argument). how windows round this/what need solve this? regards, robbie to retrieve arguments used command line: private sub form1_load(sender object, e system.eventargs) handles me.load dim smsg string = "" each sarg string in my.application.commandlineargs smsg &= sarg & ": " next msgbox(smsg) end sub place code in winform _load, console main, etc. if above run with: hello world command line hello: world: display.

Is there a Java/JVM server that supports streaming binary over websocket? -

does there exist open source java server/library/framework supports bidirectional streaming of binary on websockets? looked @ couple of them couldn't find them mentioning binary support. this explains want do, think: http://binaryjs.com/ want java/jvm server instead of node.js. so, want send raw bytes , forth between client , server little overhead possible. if there one, direct link documentation using binary appreciated. tomcat 7 has built in support web sockets via org.apache.catalina.websocket.websocketservlet . there example of writing binary data using subclass of class here: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/web-inf/classes/websocket/echo/echostream.java?view=markup high level root of how-to here: http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html

android - Light Sensor collecting inaccurate data -

i collecting data light sensor amount of time: msensormanager.registerlistener(this, lightsensor, sensormanager.sensor_delay_fastest); the problem values collected not accurate , frequent. "not accurate", mean if start sensor @ time, first reading old 1 of long before began collecting data. also, since delay declared sensormanager.sensor_delay_fastest , lot of values , sometime 100s of records in 1 second , sometime not 1 reading in 3 seconds. can explain issue might , if there solutions please? i believe because these light sensors send data when there change in light. not readings if light level not change, if wave hand in front of or turn dimmer switch slowly, 100s of readings.