Posts

java - How should I set a HttpURLConnection to be the same as a HttpServletRequest? -

i have server, , want forward requests other server (maybe modifications). i use httpurlconnection connect second server (from first server). can lot of information httpservletrequest, example: getattributenames -> getattribute getheadernames -> getheader getparameternames -> getparameter getquerystring getreader (for body) but httpurlconnection can setrequestproperty(key, value). don't know whats different between attributes, headers, paramteres. how should set httpurlconnection same httpservletrequest? what information need "copy" or "clone" request? should attributes, headers, parameters , querystrings request , set of them setrequestproperty(key, value)?

javascript - On the basis of quantity and product price, total price Update -

my html structure: <div class="pricesection"> <label id="productprice"> <strong> <span id="totalprice"> 129,00</span> <span>$</span> </strong> </label> <input type="text" value="1" name="am" id="quantity"> <button class="submitbtn" type="submit">add cart</button> </div> my js code: $('#quantity').keyup(function(){ $('#quantity').each(function () { var qty = $('#quantity').val(); var price = $('#totalprice').val(); var total = price * qty; }); $('#totalprice').html(total); }); i have found many examples, not suitable. :-( after entering quantity item price automatically updated. if "0", letter, "empty" or after canceling original price must restored. i "0" val...

modeling - How to store molecule data using SMILES when building a toy chemistry model -

i'm building toy chemistry model based around gillespie's algorithm . starting food set of {h,o,n,c} let system evolve, have been storing molecules strings in smiles format. for instance: [o] reacts [h] --> [o] ([h]) [o] ([h]) reacts [h] --> [o] ([h]) ([h]) using square brackets i've been able keep molecules in system consistent smiles interpretation. however system of storage allowing me construct linear molecules. how can create, instance, carbon ring, interpreted in smiles ring of carbon atoms, without hydrogen atoms? for instance c1ccccc1 gives http://www.chemicalize.org/structure/#!mol=c1ccccc1&source=calculate how generate 6 carbon atoms in ring without 12 hydrogen?

c# - Server Error in '/' Application 4 -

this question has answer here: response not available in context 3 answers response not available in context. how can solve problem need please tried solve couldnt website work on local host when upload host doesnt work me please { response not available in context. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.web.httpexception: response not available in context. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [httpexception (0x80004005): response not available in context.] system.web.httpcontext.get_response() +8820296 asp.global_asax.application_start(object se...

c# - Update Graph while picking values from the database -

i trying pick values database , keep updating graph there . using how update gui thread in c#? code is: private void button1_click(object sender, eventargs e) { string myconnection = "datasource=localhost;port=3306;username=root;password=root"; mysqlconnection condatabase = new mysqlconnection(myconnection); mysqlcommand cmddatabase = new mysqlcommand(" select * data.test; ", condatabase); mysqldatareader myreader; this.invoke((methodinvoker)delegate { try { condatabase.open(); myreader = cmddatabase.executereader(); while (myreader.read()) { this.chart1.series["series1"].points.addxy(myreader.getstring("datetime"), myreader.getint32("temp")); ...

Can you define your own self-closing tag in HTML5? -

i have read this topic, still have doubts. there way define void tag? i tried this: <icon class="home"/> (know slash isn't obligatory) but, if there text content after tag ff closes them. <icon class="home"/> go home makes <icon class="home">go home</icon> should define somewhere tag void-element? or impossible html5? this not answer because not address question, did not fit comment section. the / in /> ignored browsers if parsed html5 specs (except foreign elements of mathlm , svg , because elements of modules specs has self enclosing element, there needs stay valid) relevant parts of specs: w3c - hmtl5 - elements w3c - hmtl5 - start tags (the relevant part how browsers should handle missing tags , ignore / missing, need up) if element void element no closing tag generated, because not require one. for other elements closing tag created if missing. if write this: <div...

ios - Creating a completely custom UIRefreshControl -

i need create entirely custom uirefresh control. animation, image, pull down amount, etc... my initial thought start scratch, use uiviewcontroller, add own view it, animate accessing uiscrollviewdelegate methods. i can there way less work , easier add multiple uitableview s? is possible subclass uirefreshcontrol , change amount of stuff inside it? answer updated github project update swift 3.1 updated quartzcode version 1.55.0 (changes on generated code) code refactored use new refreshcontrol property (introduced in ios 10) (also more "swifty" now). included @hanny's suggestion (down below) (thanks!) i youtube link posted. :) nice result. for reference: quartzcode pretty creating uirefreshcontrol animation scratch. check out this little project (github). in it, find quartzcode project file example on how integrate uitableview . i think important part in there refresh function: /// called everytime refresh control's valu...