Posts

c# - String not recognized a timespan -

hope me this. yesterday code working, after did cleaning stop working , keeps on saying: string not recognized valid timespan datatable dt = new datatable(); dt = database.getschedule(); timespan amtime; timespan pmtime; timespan nntime; timespan _timenow = timespan.parse(timenow); foreach (datarow row in dt.rows) { amtime = timespan.parse(row["amintake"].tostring()); pmtime = timespan.parse(row["pmintake"].tostring()); nntime = timespan.parse(row["nnintake"].tostring()); if (amtime == _timenow || pmtime == _timenow || nntime == _timenow) { messagebox.show("drink medicine"); } else { /*do nothing*/ }

java - Adding a profile to a child container does not replicate in the other child containers in an ensemble? -

i have started working on fabric8 in have created ensemble of 3 fabric servers - node1, node2 , node3. each fabric server has child preferably node1-child1, node2-child1 , node3-child1 respectively. i want add profile child containers. thought because in cluster, adding profile in 1 child container replicate profile in other child containers well. not happen! is there way can achieve above without going each container , adding profile? adding profile 1 child container not automatically add other child containers. in case, child containers in cluster duplicates of each other, not desirable. you have add profile every child container has run contents of profile. once done, if change in profile, containers profile update automatically.

mysql - Convert all the data of table (which have both encoding data) into single encoding either utf8 or latin1 -

we have table consists of 2 different encoding data (utf8 , latin1) has been inserted 2 different use cases of application. getting broken strings issue other languages text if data in 1 encoding.we need convert total table data single encoding. eg: table x id name data encoded 1 ébarber - utf8 2 à gogo - latin1 if use "latin1" connection charset, issue "ébarber"(broken strings). if use "utf8" connection charset, issue "à gogo"(broken strings). how can convert table data single encoding either utf8 or latin1? please share thoughts fix issue. it possible. painful. convert binary identify rows contain encoding. can automated, may not 100% correct. do special update against rows. convert utf8 . details: step 1: convert binary: alter table tbl modify column col varbinary(...) ...; -- suitable matching other stuff, or alter table tbl modify column col blob ...; -- if text. step 2: find latin...

cookies - Okta Session hand-over from desktop application to web application -

we have desktop application used upload content web application, both use okta authentication. before uploading, desktop application authenticates user via okta using embedded browser control. later in workflow want open user's default browser he/she can start using web application directly. @ moment user need login second time when default browser opens. we planned implement mechanism generate one-time key (transferable session token) can passed url parameter when browser opened. our application's own token can achieve need transfer okta session (cookie) , have not found way transfer desktop browser control standalone browser. what options available achieve this? edit: acceptable if new session created standalone browser long user identity stays same , user not have provide login details second time. unfortunately, okta not have way transfer 1 active session describe. however, if have enough control on organization's environment, simulate behavior. okt...

java - AngularJS $http.post method passing null arguments to JAX-RS API -

i'm trying pass arguments angularjs post method: function create(email, password, phonenumber) { return $http.post('resources/users/register', {email: email, password: password, phonenumber: phonenumber}).then(handlesuccess, handleerror('error creating user')); } to jax-rs method : @post @produces(mediatype.application_json ) @path("/register") public response register(@formparam("email") string email, @formparam("password") string password, @formparam("phonenumber") string phonenumber) { i have loggers before $http.post , on beggining of register method, when arguments on web side contains info, every argument on server null -> trying use curl method - fine! anyone have idea? try change json object : {'email': email, 'password': password, 'phonenumber': phonenumber} javascript var ---> string name values json data written name/...

sql - Selecting different number of columns in a CSV file -

the task extract data multiple csv files according criteria. file contains sampleid (this criteria) , other columns. @ end of file there measurement values under 0...100 named columns (the numbers actual names of columns). make bit more interesting there can variations in different csv files, depending on customer needs. means measurement data count can 15, 25, 50 etc. no more 100 , no variations within 1 file. data placed in end of line, there set of columns before numbers. i'd have sql statement can accept parameters: select {0} {1} sampleid = {2} 0 numbers, 1 csv file name , 2 sampleid looking for. other solution came mind columns after last fix column. don't know possible or not, thinking out loud. please descriptive, sql knowledge basic. appreciated. so managed solve it. code in vb.net, logic quite clear. private function getdatafromcsv(sampleids integer()) list(of keyvaluepair(of string, list(of integer))) dim datafiles() string = sy...

android - how to open an activity from a speech to text output -

here code: public void promptspeechinput(){ intent = new intent(recognizerintent.action_recognize_speech); i.putextra(recognizerintent.extra_language_model, recognizerintent.language_model_free_form); i.putextra(recognizerintent.extra_language, locale.getdefault()); i.putextra(recognizerintent.extra_prompt, "say something!"); try{ startactivityforresult(i, 100); } catch(activitynotfoundexception a){ toast.maketext(voicesearch.this, "sorry! device doesn't support speech language!", toast.length_long).show(); } } public void onactivityresult(int request_code, int result_code, intent i){ super.onactivityresult(request_code,result_code,i); switch(request_code){ case 100: if(result_code == result_ok && != null){ arraylist<string> result = i.getstringarraylistextra(recognizerintent.extra_results); resulttext.settext(result.get(1)); string text = ...