Posts

javascript - How do I take code from Codepen, and use it locally? -

how take code codepen, , use locally in text-editor? http://codepen.io/mfields/pen/bhilt i trying have play creation locally, when open in chrome, blank white page nothing going on. <!doctype html> <html> <head> <script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="celtic.js"></script> <link rel="stylesheet" type="text/css" src="celtic.css"></link> </head> <body> <canvas id="animation" width="400" height="400"></canvas> </body> </html> i have copy, pasted , saved css , js different files , saved them, tried link them html file have shown above. i have included jquery library understand lot of codepen creations use it. the console error i'm getting uncaught typeerror: cannot read property 'getcontext' of ...

c++ - does not continue reading input from the user? -

when run program input 50000, output stops @ 633 instead of 50000, why , how fix !?? int main() { long int n; cin>>n; //n = input = 50000 double* r = new double[n]; for(long int i=0;i<n;i++) { cin>>r[i]; // each value in range 6 digits cout<<i<<" "<<r[i]<< endl; //i should stops @ 49999 } return 0; } you don't check result of cin>>r[i]; so happen cin goes fail state after getting invalid input. hit situation, no more data can retrieved cin until cin.clear() called. you should have code like if(!(cin >> r[i])) { cout << "invalid input, please try again" << endl; --i; cin.clear(); } to handle this.

java - Changing the visibility of views one at a time with a button -

i have 3 views visibility set view.setvisibility(view.gone) , have button want change visibilities visible 1 @ time user keeps clicking button. think have use loop centred on button click don't know how. ideas appreciated. int = 0; onclick(view v){ switch(++i){ case 1: view1.setvisibility(view.gone); break; case 2: view2 setvisibility(view.gone); break; case 3: view3.setvisibility(view.gone); = 0; break; } }

asp.net - Handle large number of PUT requests to a rest api -

i have been trying find way make task more efficient. consuming rest based web service , need update information on 2500 clients. i using fiddler watch requests, , i'm updating table update time when complete. i'm getting 1 response per second. expectations high? i'm not sure define 'fast' in context. i handling in controller , have tried running multiple web requests in parallel based on examples around place doesn't seem make difference. honest don't understand enough , trying build. suspect still waiting each request complete before firing again. i have increased connections in web config file per suggestion no success: <system.net> <connectionmanagement> <add address="*" maxconnection="20" /> </connectionmanagement> </system.net> my controllers action method looks this: public async task<actionresult> updatemattersasync() { //only matters haven...

Excel; how to combine left and right functions -

i have column of text values want delete first 8 , last 4 characters i.e '12345678john1234' become 'john'. know how use left , right functions separately can't seem them working together. mid function won't work in case. possible? thanks problem solved with: =mid(a1,9,len(a1)-12)

javascript - onclick method doesn't work in Chrome -

this code works in mozilla firefox, not in chrome. <html> <head> <script language="javascript"> <!-- function onbutton1() { document.form1.action = "response1.php" document.form1.target = "_blank"; // open in new window document.form1.submit(); // submit page return true; } function onbutton2() { document.form1.action = "response2.php" document.form1.target = "_blank"; // open in new window document.form1.submit(); // submit page return true; } --> </script> <noscript>you need javascript enabled work</noscript> </head> <body> <form name="form1" method="post"> name <input type="text" name="name" size="10" /><br /> <input type="button" value="button1" name=name onclick="onbutton2();onbutton1();"> </form> ...

javascript - How to replace an image tag with an video tag in jsp -

how replace image tag video tag in jsp? trying display video after series of images on same position image time interval 1 sec. the jsp code below: <%-- document : index created on : apr 22, 2015, 8:33:41 pm author : name <vj> --%> <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>cat clicker</title> <script lang="javascript" src="changeimage.js"></script> </head> <body onload="changeimage();"> <img id="img1" style="position: absolute;top :35; left:170px; width:500px; height:250px" src="image/image.jpg" alt=""/> <video id="vid1" style="position: absolute;top :35; left:170px; width:500px; he...