Posts

android - TextInputLayout not showing when View added programmatically -

Image
i noticed strange behaviour of textinputlayout : when add following layout: <android.support.design.widget.textinputlayout android:layout_width="match_parent" android:layout_height="wrap_content"> <edittext android:id="@+id/txtfirstname" style="@style/edittextstyle" android:layout_width="match_parent" android:layout_height="match_parent" android:hint="in layout" android:singleline="true" /> </android.support.design.widget.textinputlayout> everything works expected. when inflate similar layout like: view v = layoutinflater.from(this).inflate(r.layout.edittext_w_surrounding_textinputlayout, null); edittext edittext = (edittext) v.findviewbyid(r.id.edittext); edittext.sethint("added programmatically"); viewgroup root = (viewgroup) findviewbyid(r.id....

asp.net - Installing NuGet package Owin, get reference error -

i'm trying install nuget package owin , nuget gives me error: already referencing newer version of 'microsoft.jquery.unobtrusive.validation'.. this wierd, , has come somewhere else, because owin doesn't have dependecies. turns out, happens other packages well. this asp.net mvc 5 project uses episerver cms do know is? edit: turns out, error in vs 2015 rc package manager console host version 3.0.0.0. i'll report bug. edit 2: posting error message nuget: install-package : referencing newer version of 'microsoft.jquery.unobtrusive.validation'.. @ line:1 char:1 + install-package owin + ~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [install-package], exception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.packagemanagement.powershellcmdlets.installpackagecommand i'm not sure how of useful answer is; solved using visual studio 2012 , package manager console host version 2.8.50126.400. have u...

Updating fields from two tables of Sql CE in C#? -

i have 2 tables in stock.sdf database called: product (pid, pname, unitprice) sales (pid, qty, totalprice) i want add totalprice sales table using update query. because want store data permanently, whenever new sales added. sales.totalprice = (sales.qty * product.unitprice sales.pid = product.pid); i have tried follows , got parsing error. possible solution try { stockdbconnection dbcon = new stockdbconnection(); sqlceconnection conn = new sqlceconnection(dbcon.returnconnection("connstring")); conn.open(); sqlcecommand command = new sqlcecommand("update set a.tprice=@qty * b.uprice sales join product b on @pid=b.pid", conn); command.parameters.add("@qty", txtqty.text); command.parameters.add("@pid", cmbpid.text); command.executenonquery(); messagebox.show("data upated successfully.")...

HTML form not updating mySQL through PHP file [SOLVED] -

i'm not quite sure what's going on because i'm following same concept of implementation on page several other pages on site. reason, page not update database. throws no errors or anything, doesn't update user information. the html shows text box , radio buttons @ top admin user can type name , select whether promote, demote, activate, or deactivate account entered text box. once submitted, code doesn't yell @ me instead nothing. i've tried several different ways of doing no matter it's not updating database. here html file (shortened): <?php include_once ($_server['document_root'] . '/public_html/templates/areadmin.php'); if(isset($_post['user'])) { checkfunc(); } else { ?> <!-- contents of page--> <div class="container2"> <div align="center"><br/><br/> <div id="box1"><br/><br/><br/> ...

javascript - How writing text onto specific place [Opal] -

i need write static web page simple data. in form have data user , in tag <div id="prog"> output how using opal writing string specyfic place? <div id="prog"> </div><script type="text/javascript"> <div id="prog"> </div> </script> pp = document.getelementbyid("prog").innerhtml = opal.main() </script> ok, based on sample code, need make opal.main() return string def main # logic return str end but think want use opal-jquery or opal-browser, don't have experience later, here's simple example of opal-jquery (of understood asking) document.ready? element["form"].on(:submit) element["#prog].text = element["#input-id"].value end end

My code fails at a certain point. Java File IO -

i new java. programmed in c++. trying work files code fails when try create file, is, when program tests if file exists, fails, have created file. public schedule(string name, string event) { string filename= name+event+".txt"; file timetable=new file(filename); if (timetable.exists()&&timetable.isfile()){ writetofile(timetable,name,event,filename); system.out.println("in constructor"); }//fails here } i have created file if following line reason saying this, you're wrong. file timetable=new file(filename); this making abstract representation of file/directory pathnames not make file if doesn't exist. file timetable=new file(filename); timetable.createnewfile(); the createnewfile method make physical file if doesn't exist.

haskell - To and From JSON for custom data types -

i have following classes: type id = uuid data mysubclass1 = mysubclass1 { svar1 :: utctime , svar2 :: utctime } data mymainclass = mymainclass { var1 :: id , var2 :: mysubclass1 , var3 :: (int, string) , var4 :: maybe string } and here's json itself: { "var1" : ..., "var2_1": ..., "var2_2": ..., "var3_1": ..., "var3_2": ..., "var4": ..., "svar1": ..., "svar2": ... } and need create instances of json them: --ok instance fromjson mysubclass1 parsejson (object v) = mysubclass1 <$> v .: "svar1" <*> v .: "svar2" --ok instance tojson mysubclass1 tojson (mysubclass1 svar1 svar2) = object ["svar1" .= svar1 , "svar2" .= svar2 ] and here's have difficulty instance fromjson mymainclass parsejson (object v) = mymainclass <$> v .: "var1...