Posts

php - PHPUnit and Extended Classes -

i curious, have base class - called base , controller class called - controller - apparently cannot test controller - in netbeans - because cannot find base class. class controller extends base{} class base{} netbeans generate tests base not controller. because a) every test must extend php unit , b) if test logic in base , passes it's safe assume controller too? - seems rather untrustworthy. what 1 in situation? you must include file or can use autoload (check autoload of composer. psr-0 or classmap). , preferably use phpunit.xml passing autoload or bootstrap automated testing. (no need stay including files tested in test file).

asp.net - Date format conversion in c# -

how convert 04/09/2013 8:09:10 pm 09/04/2013 (mm-dd-yyyy). tried convert taking 09 date , 04 month. please help [httppost] public string getdailynote(datetime selecteddate) //selecteddate gets date 04/09/2013 8:09:10 pm { string x = selecteddate.tostring("mm-dd-yyy", cultureinfo.invariantculture); string daily; datetime dt = convert.todatetime(x); //dt gets value {09/04/2013 12:00:00 am} 09 date , 04 month dnote.realdate =dt; daily = _scheduler.getdailynote(dnote); return daily; } it taking 09 date , 04 month yes, because have said it, change "mm-dd-yyy" to "dd/mm/yyyy h:mm:ss tt" datetime.parseexact("04/09/2013 8:09:10 pm","dd/mm/yyyy h:mm:ss tt", cultureinfo.invariantculture); demo now, if want convert string format mm-dd-yyyy : string result = dt.tostring("mm-dd-yyyy", cultureinfo.invariantculture);

eclipse - Jetty Startup issue: WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,null} -

i´m trying start new project war maven , spring spring tool suite ide, downloaded project git hub, project made on macs , i´m working in windows. this i´m getting when try start jetty server: 2013-09-03 10:01:47.161:info:oejs.server:jetty-8.1.12.v20130726 2013-09-03 10:01:47.179:info:oejdp.scanningappprovider:deployment monitor c:\users\hp\documents\workspace-sts-3.3.0.release\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps @ interval 1 2013-09-03 10:01:47.183:info:oejdp.scanningappprovider:deployment monitor c:\users\hp\documents\workspace-sts-3.3.0.release\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts @ interval 1 2013-09-03 10:01:47.187:info:oejd.deploymentmanager:deployable added: c:\users\hp\documents\workspace-sts-3.3.0.release\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\contexts\moca-console.xml 2013-09-03 10:01:47.238:warn:oejw.webinfconfiguration:web application not found c:\users\hp\documents\workspace-sts-3.3.0.release\.metadata\.pl...

javascript - Jquery check if special char exists in text value -

i need check if textarea contains special characters, need count them 2 (sms lenght). i wrote piece of code seems doesn't find no special chars, if write "€€€" could please me? if rewrite directly function, without problem. thank tou! var special_chars = array('€', '%'); function charused() { var count = $('#text').val().length; var chars = $('#text').val().split(""); var numberofspecialchars = 0; if ($.inarray(chars, special_chars) > -1) { numberofspecialchars++; } return count + numberofspecialchars; } // function a rewrite : var nbspecialchars = $('#text').val().split(/[€%]/).length - 1; the idea make array of strings, using special characters separator : 'some € chars %' => ["some ", " chars ", ""] and use length of array deduce count of chars. there many other (faster) soluti...

searchable spinner not working in Android Java -

i have java.lang.unsupportedoperationexception @ iterator .remove() believe considered safe , think code "ok" can me? final list<string> livelist = arrays.aslist((string[]) button.getitems().toarray()); //create mutable list<string> button.getitems() list<string> final premspinner dropdown = new premspinner(this); //spinner (eg: "dropdown") of options dropdown.setlayoutparams(col); final arrayadapter<string> dataadapter = new arrayadapter<string>(this, android.r.layout.simple_spinner_item, livelist); // <---+ dataadapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); // | dropdown.setpadding(45, 15, 45, 15); // | dropdown.setadapter(dataadapter); //the way [populate] `dropdown(spinner)` via `a...

Call SOAP service from android with ksoap error -

this question has answer here: how fix android.os.networkonmainthreadexception? 44 answers i have webservice running on google app engine, , call available service android device. i've follow , merge code of tutorial ksoap2, still obtain exception on android. code: private static string method_name = "getdata"; private static string soap_action = "http://example.com/getdata"; private static string wsdl_url = "http://arduino-data-server.appspot.com/functionsservice.wsdl"; private static string namespace = "http://example.com/"; soapobject request = new soapobject(namespace, method_name); soapserializationenvelope envelope = new soapserializationenvelope( soapenvelope.ver12); envelope.setoutputsoapobject(request); httptransportse androidhttptransport = new httptransportse(wsdl_url); try { androidhttptransport...

c# - The view must derive from WebViewPage -

i had working mvc application when decided time maintenance. views under shared directory , decided move them separate directories. i implemented customviewengine found here: can specify custom location "search views" in asp.net mvc? view structure lookes views appviews otherappviews ... shared ... this error getting: the view @ '~/views/appviews/someview.cshtml' must derive viewpage, viewpage<tmodel>, viewusercontrol, or viewusercontrol<tmodel>. i tried inherit @inherits system.web.mvc.webviewpage (as explained here: the view must derive webviewpage, or webviewpage<tmodel> ) , when error saying can't use @inherits , @model @ same time. thank you your customengine should derive razorviewengine instead of webformviewengine since use .cshtml files (razor engine). docs: razorviewengine webformviewengine