Monday, 15 July 2013

spring xd - SpringXD stream with Tail source reads ALL the lines in file again and again instead of just last n lines -



spring xd - SpringXD stream with Tail source reads ALL the lines in file again and again instead of just last n lines -

stream create --name tailtest --definition "tail --name=/users/name/documents/springxd/poc/input/try.txt --outputtype=text/plain --lines=1 |file --name=output --dir=/users/name/documents/springxd/poc/output --mode=append" --deploy

here see whether give --lines=1 or 2 or 0 there additional line entered in try.txt , saved, reading entire try.txt , dumping output file. 1 time again when add together line try.txt same reads entire file content rather lastly line , appends @ end of previous content in output, thought going wrong here, why tail not read lastly 1 (or specified n) lines set come in @ end of each line in input file?

it sounds replacing file when "and saved".

tail follows existing file and, yes, expects newline terminate new message.

i ran test , works fine...

xd:>stream create --name foo --definition "tail --lines=1 --name=/users/foo/documents/foo.txt | log" --deploy

logs lastly line of file,

23:15:58,925 info simpleasynctaskexecutor-1 sink.foo - sdsd

then

$ echo foo >> ~/documents/foo.txt

(which appends foo\n file)

results in

23:17:07,744 info simpleasynctaskexecutor-1 sink.foo - foo

the lines=1 applies existing file; if replace file new one, whole file used - log rotation.

tail spring-xd

How the IP address is recognized in the Internet in multicast? -



How the IP address is recognized in the Internet in multicast? -

i referring "broadcasting multiple recipients" oracle java tutorial:

both server , client utilize grouping identifier identify belong same group. grouping id duplicate in net (and goolged , said grouping identifier not need unique)

then how come client on other side of net can know belongs same grouping of server? give me links describe process?

if server mutlicasts sound streams, server b multicasts video streams. server uses grouping id 203.0.113.0:4446 server b happens uses grouping id 203.0.113.0:4446. how come clients in net knows differences? since server not know existence of server b @ all, not know how take unique grouping id, uniqueness in ip address.

it seems cross articles, talking adding mac address. in oracle java tutorial, coding client not mention mac address @ all.

i don't know mean 'reorganized' in title, client doesn't 'know belongs same grouping [as] server'. knows belongs grouping defined ip address. if there multiple hosts sending ip address receive of them.

multicast

couchdb - Status of a filtered pull replication with Couchbase Lite -



couchdb - Status of a filtered pull replication with Couchbase Lite -

how reliably check filtered pull replication has completed couchbase lite?

the replication status set stopped on completion or on fatal error. a alter listener fires on incoming changes can't used monitor connection status. you can find seq number of database not lastly seq of grouping of filtered changes.

the replication object lasterror property. guide says if set nil, there has not been error since replication started. check when see replication status go stopped.

http://docs.couchbase.com/couchbase-lite/cbl-ios/#working-with-replications

couchdb couchbase database-replication

java - mysql query in clause at playframework -



java - mysql query in clause at playframework -

in below 2 sql query sql1 not selecting row, , sql2 selecting 1 111@k2.com

var ids="'111@k2.com','222@k2.com','333@k2.com','444@k2.com','555@k2.com','666@k2.com'" val sql1 = sql("select id,point,privacy `pointtable` state=1 , id in ({users})").on("users" -> ids) sql1().map { row => val point = if (row[boolean]("privacy")) { row[double]("point").tostring } else { "0" } println(write(map("id" -> row[string]("id"), "point" -> point))) } val sql2 = sql("select id,point,privacy `pointtable` state=1 , id in (" + ids + ")") sql2().map { row => val point = if (row[boolean]("privacy")) { row[double]("point").tostring } else { "0" } println(write(map("id" -> row[string]("id"), "point" -> point))) }

in phpmyadmin when run query manualy returns 6 rows why not working here. using play framework 2.2 scala 2.1

that's not going work. passing users though on going escape entire string, it's going appear one value instead of list. anorm in play 2.3 allows pass lists parameters, here you'll have work around that.

val ids: list[string] = list("111@k2.com", "222@k2.com", "333@k2.com") val indexedids: list[(string, int)] = ids.zipwithindex // create bunch of parameter tokens in clause.. {id_0}, {id_1}, .. val tokens: string = indexedids.map{ case (id, index) => s"{id_${index}}" }.mkstring(", ") // create parameter bindings tokens val parameters = indexedids.map{ case (id, index) => (s"id_${index}" -> toparametervalue(id)) } val sql1 = sql(s"select id,point,privacy `pointtable` state=1 , id in (${tokens})") .on(parameters: _ *)

java mysql sql scala playframework

JavaScript create csv column names -



JavaScript create csv column names -

i generating csv file in javascript:

var csvcontent = "data:text/csv;charget=uft-8,data1, data2, data3 /n data1, data2, data3";

i wondering how add together column names? info appearing properly. looking add together column names. possible?

javascript csv

php - Unable to retrieve serialized data from database -



php - Unable to retrieve serialized data from database -

i'm able update using serialize info database not able retrieve properly. echoing array when seek unserialize , retrieve database.

here how update using serialize:

$query ="update dashboard_widget_users set dashboard_widget_users.configuration='".serialize($tmp)."' dashboard_widget_users.dsnr_yw_user =12 , dashboard_widget_users.dsnr_dashboard_widget=1";

result:

a:4:{i:0;s:30:""anzahl_fahrzeuge_ohne_bilder"";i:1;s:22:""fahrzeuge_ohne_preis"";i:2;s:23:""fahrzeuge_mit_fehlern"";i:3;s:19:""herausforderungen"";}

this how tried unserialize() , retrieve database not getting output properly:

$config= unserialize($row['configuration']); echo $config['configuration'];

here code:

if($param['aktion'] == 'save-widget-vehicle') { $page['register-fahrzeuge'] = array( 1 => array( 'fahrzeug','aktiv',$page['script'],''), 0 => array( 'edit-fahrzeug','enabled',$page['script'],'',''), ); $opts = !empty($param['filteropts']) ? $param['filteropts'] : array(); $tmp = array(); foreach ($opts $opt) { $tmp[] = '"'.$opt.'"'; } $data = array(); $query ="update dashboard_widget_users w set w.configuration=\"".mysql_real_escape_string(serialize($tmp))."\" w.dsnr_yw_user =12 , w.dsnr_dashboard_widget=1"; $result = mysql_query($query, $myconnection); $html = '<table width="538" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <div>'.createregister($page['register-news']).'</div> '.createmessage().' <div class="cont-liste-verlauf register"> <table id="fahrzeuge"> <tr> <td> </td> </tr> </table> </div> </td> </tr> </table>'; $return = array( 'status' => 1, 'html' => $html ); echo json_encode($return); die(); $param['aktion'] = 'get-widget-vehicle'; } if($param['aktion'] == 'get-widget-vehicle') { $page['register-fahrzeuge'] = array( 1 => array( 'fahrzeug','aktiv',$page['script'],''), 0 => array( 'edit-fahrzeug','enabled',$page['script'],'',''), ); $data = array(); $opts = !empty($param['filteropts']) ? $param['filteropts'] : array(); $tmp = array(); foreach ($opts $opt) { $tmp[] = '"'.$opt.'"'; } $query ='select dashboard_widget_users.configuration dashboard_widget_users inner bring together yw_user on dashboard_widget_users.dsnr_yw_user = yw_user.intern inner bring together dashboard_widget on dashboard_widget_users.dsnr_dashboard_widget = dashboard_widget.id dashboard_widget_users.dsnr_yw_user =12 , dashboard_widget.id =1'; $result = mysql_query($query, $myconnection); /*while ($row = mysql_fetch_assoc($result)) { if($row['name'] == 'anzahl_fahrzeuge_mit_und_ohne_bilder') { $sql = 'select * amo_bilder_live l left bring together afzdaten on l.dsnr_afzdaten = a.dsnr l.dsnr_afzdaten null'; $sql_result=mysql_query($sql); //get result... // $row['number'] = $result } $data[] = $row; }*/ $html = '<table width="538" cellspacing="0" cellpadding="0" border="0" > <tr> <td> <div>'.createregister($page['register-fahrzeuge']).'</div> '.createmessage().' <div class="cont-liste-verlauf register"> '; while ($row = mysql_fetch_assoc($result)) { $config= unserialize($row['configuration']); //$config= $row['configuration']; $html .= '<table id="fahrzeuge"> <a href="amo_fahrzeuge.php"> '. $config .'</a> </table>'; } $html .= '</div> </td> </tr> </table>'; $return = array( 'status' => 1, 'html' => $html ); echo json_encode($return); die(); }

you escape string depending on going utilize mysqli_real_escape_string() on value before putting into database - not when retrieving database:

$row=mysqli_fetch_assoc($result); $config=unserialize($row['config']);

you've tagged jsonserializer - using php serialization here.

php mysql serialization

How do I prevent Fiddler from blocking random websites? -



How do I prevent Fiddler from blocking random websites? -

i using fiddler2 telerik , running weird issue programme blocking websites. here's illustration of randomly blocking www.slacker.com.

now when comes can close fiddler , refresh page , come without problem. however, since updated fiddler latest version it's started doing this:

why in world fiddler , how stop breaking random websites?

i found post on stackoverflow suggested using custom onbeforerequest rule this:

if (osession.fullurl == "http://slacker.com"){ osession["ui-hide"] = "do not want see"; }

i've tried adding custom rules did not seem prepare anything. have tried setting fiddler hear traffic ie since ie want see traffic from.

is there setting somewhere within fiddler prepare or need find different program?

edit: additional information: i'm running version v4.4.8.4 of fiddler.

this isn't fiddler.

the problem tcp/ip stack on computer, why chrome cannot connect site either.

are running firewall software? on managed corporate network, or home isp?

if type prefs show fiddler.network.egress.ip , nail come in within black quickexec box below web sessions list, see?

fiddler