Posts

java - How to have integration tests setUp() manipulate HSQL data in an in-memory DB running in embedded Jetty container? -

java - How to have integration tests setUp() manipulate HSQL data in an in-memory DB running in embedded Jetty container? - i trying run integration tests against rest web service process started in embedded jetty container within maven integration test phase. much working. i want configure server utilize in-memory hsql db such each junit test can setup database (create tables, insert records), , tear downwards (delete records). the application context of web services process defines next datasource: <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="#{applicationproperties['jdbc.driver.class.name']}" /> <property name="url" value="#{applicationproperties['jdbc.url']}" /> <property name="username" value="#{applicationproperties['db.user']}" /> <pro...

jslint - How can I ensure that all of my JavaScript functions return a value? -

jslint - How can I ensure that all of my JavaScript functions return a value? - i've had numerous bugs happening because of missing return in function. see, when of code write in ruby, it's easy forget explicit returns. so i'd utilize similar jslint (which use) check functions homecoming something. yes, think it's improve explicitly homecoming when it's not required hunt downwards missing returns. so, there tools check returns? or maybe can assert in runtime in simple manner? please don't suggest coffeescript, i'm aware of existence. jsunit example: <script language="javascript" src="jsunitcore.js"></script> <script language="javascript"> function testwithvalidargs() { assertequals("somefunction should homecoming something", "expected homecoming value", somefunction(2, 3)); } </script> javascript jslint

multithreading - Blackberry multi threading issue -

multithreading - Blackberry multi threading issue - i developping blackberry application communicates server via http requests( javax.microedition.io.httpconnection ). on device, user clicks ui items, , device sends requests server, when response comes, ui changes. communication takes place under new thread, while ui thread pushes , pops progressdialogscreen. the problem sometimes, when response comes , progressdialogscreen popped, ui not alter after couple seconds ui changes. if have requested in between when progressdialogscreen popped , when new screen pushed, there comes mess. first oldest new screen pushed, , newest new screen pushed. , situation can observed server responsing wrong requests. problems occur on simulator , device. the other problem is, 2 same response returns 1 request. able see these 2 problems on simulator @ logs, have not able see issue on device since can not see logs. edit: string utf8response; httpconnection httpconn = null; try{ httpconn =...

lisp - Issue on displaying successive items of an infinite stream -

lisp - Issue on displaying successive items of an infinite stream - ; defining stream-for-each (define (stream-for-each proc s) (if (stream-null? s) 'done (begin (proc (stream-car s)) (stream-for-each (stream-cdr s))))) ; defining method display stream (define (display-stream s) (stream-for-each display-line s)) (define (display-line x) (newline) (display x)) ; creating stream uses newton-raphson ; method find square root of 2 (define (sqrt-improve guess x) (avg guess (/ x guess))) (define (sqrt-stream x) (define guesses (cons-stream 1.0 (stream-map (lambda (guess) (sqrt-improve guess x)) guesses))) guesses) now testing it.. => (stream-ref (sqrt-stream 2) 11) value: 1.414213562373095 so seems stream working correctly; when seek , display it: => (display-stream (sqrt-stream 2)) 1. ;the procedure #[compound-procedure 13 stream-for-each] has b...

c# - Incompatible Type when using web service -

c# - Incompatible Type when using web service - i have utilize web service returns string result, gets string parameters too, things have done this: 1- have added service reference project. 2- have created instance of service class 3- have phone call want function within class instance here code: myservicens.pscowsdlporttypeclient mys= new myservicens.pscowsdlporttypeclient(); string res; res =mys.srvreq("11320000", "21310000", "13901009", "1", "3"); but problem when phone call mys.srvreq error below: the content type text/xml; charset=iso-8859-1 of response message not match content type of binding (text/xml; charset=utf-8). if using custom encoder, sure iscontenttypesupported method implemented properly. first 572 bytes of response were: ?xml version="1.0" encoding="iso-8859-1"?soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/...

Android SQLite- View 'raise()' exception messages in Log -

Android SQLite- View 'raise()' exception messages in Log - if wrote trigger 'then raise(abort, "my error message")' clause sqlite in android app, there way view "my error message" in logcat? wanted know if it's @ possible write own custom error messages log rather have rely on sqlite's vague error codes when constraints fail. thanks. android sqlite

drupal - How do I make a template file for a specific display in a view when I have multiple displays of the same type -

drupal - How do I make a template file for a specific display in a view when I have multiple displays of the same type - i have view using articles on front end page (view called frontpage top). in 1 block display (named: top story) selects recent article. in other block display (named: top 5 stories) selects 2nd-6th recent. i need create template single top story, , display other 5. this template: views-view--frontpage-top.tpl.php works, it's beingness used both blocks. the way know how multiple views, these closely related i'd maintain them in one. possible, , if filename like? it doesn't seem documented in views2 ( http://drupal.org/node/352970 ) , ( drupal: views, can displays have different styles view? ) close not same. if "right" way create multiple views ok that, cannot find resource saying , i'd prefer not if don't have to. thanks! each display can themed independently another. in views admin, go display want custom...