Posts

c# - how to implement stream readtimeout property -

i'm fixing bug : app hang in download process 5 minutes while losing network connection. need reduce hanging time 20 seconds. log snippet: severe 2016-01-27 , 11:03:14 在 httpsdownload.dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) message: init method:get info 2016-01-27 , 11:08:29 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) message: exception while reading response stream exception: message: time out type: system.net.webexception 在 system.net.connectstream.read(byte[] buffer, int32 offset, int32 size) 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) code snippet: private void dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) { //code webresponse = (httpwebresponse)webreques...

ios - Alamofire Getting Response -999 = cancelled using URLRequestConvertible -

i have problem alamofire 3.0, i'm trying data server authentication. when run device iphone 6 ios 9.2.1 have no response, in iphone 6 ios 9.2 simulator have response. i follow how created in alamofire documentation in : https://github.com/alamofire/alamofire#crud--authorization appreciate answers. class apicontroller { ... enum router: urlrequestconvertible { static let baseurlstring = "link_with_user:password" static var oauthtoken: string? case mylisting([string: anyobject]) var method: alamofire.method { switch self { case .mylisting:return .get } } var path: string { switch self { case .mylisting: return "listing.php" } } var urlrequest: nsmutableurlrequest { let url = nsurl(string: router.baseurlstring)! let mutableurlrequest = nsmutableurlrequest(url: url.urlbyappendingpathcomponent(path)) mutableurlrequest.httpmethod =...

r - Forecasting with holt returns horizon of 10 instead of 100 (package forecast) -

i'm trying create forecast horizon of 100 days holt's ets method. although im specifing in h argument (from forecast.ets , package forecast manual ) h: number of periods forecasting library(forecast) test_holt<-holt(ts(for_stack),exponential=true) # for_stach forecast_holt<-forecast(test_holt,h=100) # specifing horizon of 100! forecast_holt$mean getting horizon of 10! > forecast_holt$mean time series: start = 157 end = 166 frequency = 1 [1] 198.1574 194.7383 191.3782 188.0760 184.8308 181.6417 178.5075 175.4275 172.4005 169.4259 input t.series: for_stack <- c(1207.62834260185, 1502.97991236229, 1291.45089028721, 1351.6869272969, 1381.7337386443, 1244.04910076058, 1285.61969637944, 1224.70540587755, 993.218464987378, 1125.04197704554, 767.791463542128, 902.531518752993, 1013.95661277622, 1111.62557328744, 853.080312916107, 826.696739320563, 1048.69293285107, 870.696259541534, 1095.77677433032, 1078.64988512876, 1079.91456251364...

java - cups4j : how to print with monochrome attribute -

i want print document using cups4j monochrome attribute. can't find job-attributes option. could me please ? the part of code related attribute is: hashmap<string, string> attributemap = new hashmap<string, string>(); attributemap.put("job-attributes", "print-color-mode-supported:keyword:monochrome"); printjob printjob = new printjob.builder(fileinputstream).jobname("testjobname").username("admin").copie‌​s(copies).pageranges(pages).duplex(duplex).attributes(attributemap).build(); printrequestresult printrequestresult = printer.print(printjob);

android - FusedLocationProviderApi.KEY_LOCATION_CHANGED deprecated. What to do now? -

i had locationreceiver used fusedlocationproviderapi.key_location_changed extract location intent . key_location_changed deprecated should change to? current code: @override public void onreceive(context context, intent intent) { final location location = (location) intent.getextras().get(fusedlocationproviderapi.key_location_changed); if (location != null) { float accuracy = location.getaccuracy(); log.d(locationreceiver.class.getsimplename(), "*** accuracy is: " + accuracy + " ***"); } else { log.d(locationreceiver.class.getsimplename(), "*** location object null ***"); } } after research found answer: @override public void onreceive(context context, intent intent) { if (locationresult.hasresult(intent)) { locationresult locationresult = locationresult.extractresult(intent); location location = locationresult.getlastlocation(); if (location != null) { ...

How to consume WebService returned DataTable from ASP.net with PHP -

Image
i want know, how "consume" datatable returned in asp.net webservice method. i work on examples: asp.net webservice: [webmethod] public datatable searchdatabase(string search) { sqlconnection conn = null; sqldatareader rdr = null; conn = new sqlconnection("data source=asusx301a\\mssqlinstance;initial catalog=db_sp_vaje;integrated security=true;pooling=false"); conn.open(); // 1. create command object identifying // stored procedure sqlcommand cmd = new sqlcommand( "dbo.sp_iskanje", conn); //here stored procedure works 100% // 2. set command object knows // execute stored procedure cmd.commandtype = commandtype.storedprocedure; // 3. add parameter command, // passed stored procedure cmd.parameters.add( new sqlparameter("@myinput", search)); // execute command sqldataadapter da = new sqldataadapter(); da.selectcommand = cmd;...

jsf - rich:calendar displays a date in far future when Thailand is selected -

i have application works 5 countries , local languages. rich:calendar seems working fine countries. except, when select thailand , thai language. see odd date 1st january 2559 in calendar when click on it. rest of languages works fine. can issue. below code. <rich:calendar id="schoolstartdate" enablemanualinput="true" datepattern="#{mycontroller.datepattern}" styleclass="inputreqschoolday" showapplybutton="false" defaultvalue="#{actionform.progressform.detailsform.schoolstartdate}" showinput="true" value="#{mycontroller.progressform.detailsform.schoolstartdate}" locale="#{schoolmanagedbean.sessiondata.countrylanguage}" > <f:validator validatorid="validatedateformat" /> <f:converter converterid="caldatestrconverter" /> </rich:calendar> this seems rich:faces bug. able solve issue checking date's value going null (that worked other ...