Posts

apache camel - How to stop file transferring in spring-batch -

i have created spring-batch job reading files local directory , upload remote directory through ftp using camel-spring-batch. doing same using chunk. spring batch job configuration looks : <bean id="consumertemplate" class="org.apache.camel.impl.defaultconsumertemplate" init-method="start" destroy-method="stop"> <constructor-arg ref="camelcontext"/> </bean> <bean id="producertemplate" class="org.apache.camel.impl.defaultproducertemplate" scope="step" init-method="start" destroy-method="stop"> <constructor-arg ref="camelcontext"/> </bean> <bean id="localfilereader" class="com.camel.springbatch.reader.localfilereader" scope="step" destroy-method="stop"> <constructor-arg value="file:#{jobparameters['dirpath']}"/> <constructor-arg ref="consumert...

c# - How to render MS date time JSON format in Razor files -

microsoft asp.net mvc's json serializer converts date time values "\/date(1239018869048)\/" . i have component on client side uses format show date-time picker. however, create date time values different sources: from json returned controller's action from values rendered in razor page the first source creates date times of required format, is, "\/date(1239018869048)\/" . however, second source renders date time in human-readable format, is, 7/31/2013 10:03:53 am . is there anyway create json serialized date formats in razor pages? json not define date format. however, date format used client side component number of milliseconds elapsed since 01 january 1970 00:00:00. produce expected output need compute number of milliseconds elapsed , can (assuming datetime contains date want convert): var epoch = new datetime(1970, 1, 1, 0, 0, 0, datetimekind.utc); var elapsedsinceepoch = datetime - epoch; var formatteddatetime = string.format(...

android - method called by javascript interface wont update view -

been stuck on while now. have webviewfragment has html file, created, loaded. in html file javascript allow me call methods in android application. here html: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <img src="guideline1.gif" usemap="#guideline9" border="0" /> <map name="guideline9" id="generalguideline9"> <area shape="rect" coords="124,329,290,357" onclick="android.testmethod();" /> </map> </body> </html> the webviewfragment code looks this: @suppresslint("javascriptinterface") public class mywebview extends webviewfrag...

Jquery Globalization -

i using mvc4.0 , jquery globalization plugin microsift " http://www.scottgu.com/blogposts/jqueryglobalizationdemos.zip " got " http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx ". plugin using amount formating e.g var result= $.format(1000, "c", "en-gb"); this plugin working fine when giving reference "glob.js" , "glob.all.js" files directly on page(view), when giving reference same files on master page crashing in jquery.validate.js file. $.each(params, function( i, n ) { source = source.replace( new regexp("\\{" + + "\\}", "g"), function() { return n; }); }); i getting error replace function undefined. please me. and, link latest version of microsoft jquery globalization plugin? thanks in advance the jquery globalization plugin microsoft has been accepted offical jquery plugin couple of years ago ( htt...

Android arduino communication via usb using adk mode -

i working on android , arduino application uses adk mode communication have implemented runnable in main activity , in run method of reading values , when reading finishes writing values arduino board , communication running infinite.i using handler updating gui application stops it's communication after sometime not able figure out problem? gui update in handler takes more time happening or else? following code receiving , sending data: while (true) { // read data try { int ret_read = 0; byte[] buffer_read = new byte[128]; ret_read = minputstream.read(buffer_read); (int p = 0; p < 2 * (nooffsensors); p = p + 2) { intlistvalues.add((int) composeint(buffer_read[p], buffer_read[p + 1])); log.d("jankari", "pu value : "+string.valueof((int) composeint(buffer_read[p], buffer_read[p + 1]))); } message mpu = message.obtain(mhandlerpusensors); mpu.obj = new valuemsgpusensors(...

java - Parallelizing many GET requests -

is there efficient way parallelize large numer of requests in java. have file 200,000 lines, each 1 needing request wikimedia. , have write part of response common file. i've pasted main part of code below reference. while ((line = br.readline()) != null) { count++; if ((count % 1000) == 0) { system.out.println(count + " tags parsed"); fbw.flush(); bw.flush(); } //system.out.println(line); string target = new string(line); if (target.startswith("\"") && (target.endswith("\""))) { target = target.replaceall("\"", ""); } string url = "http://en.wikipedia.org/w/api.php?action=query&prop=revisions&format=xml&rvprop=timestamp&rvlimit=1&rvdir=newer&titles="; url = url + urlencoder.encode(target, "utf-8"); url obj = new url(url); httpurlconnection con = (httpurlconnection) obj.openconnection()...

Determine if a Java class is a portable SE class -

i'm working on java code analyzer (ast stuff using trees api) , i'm trying create report on whether or not code being inspected makes use of non-portable apis. stuff sun packages , such should cause warning. defined list of se 7 portable classes? there more machine parsable se javadocs? if javadocs "the" portable listing how generated java source openjdk? portable code kept separate or ...? the core se classes defined 1 of files used in jdk build process can found at: https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/make/docs/core_pkgs.gmk # core_pkgs list of packages form # java api specification. # ### ***important note*** ### there "regexp" variable in docs/makefile ### determines table packages go in on main page. ### currently, there table ("platform packages") , ### goes in it, regexp "*". if policy ### changes, packages added need reflected in ### list of wildcard expressions, well. ### core_pkgs = ...