Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
2,778,010
2,778,011
simulation of static class in java
<p>What do you think of the following way to simulate a static class in java? You can add non static methods but you wouldn't be able to call them.</p> <pre><code> /** * Utility class: this class contains only static methods and behaves as a static class. */ // ... prevent instantiation with abstract keyword pub...
java
[1]
5,191,626
5,191,627
Help with retrieving answers from radio buttons
<pre><code>$host = 'localhost'; $user = 'root'; $pw = ''; $db = 'pmdb'; mysql_connect($host,$user,$pw); mysql_select_db($db); $result = mysql_query("SELECT * FROM Questions WHERE QuizID=1"); $num_rows = mysql_num_rows($result); while($row = mysql_fetch_assoc($result)) { $array[] = $row; } for($i=0; $i&lt;=($num_...
php
[2]
4,795,794
4,795,795
How can I decode a URL with jQuery?
<p>How can I decode a URL using jQuery? My url is </p> <blockquote> <p>http%3A%2F%2Fdtzhqpwfdzscm.cloudfront.net%2F4ca06373624db.jpg</p> </blockquote>
jquery
[5]
605,863
605,864
Way to force image to reload from server
<p>I've seen all of the other posts on similar issues with setAttribute() in IE, but can't seem to get any of the workarounds to, er, work (specifically for the src attribute of an img element.</p> <p>The example:</p> <pre><code>function reloadCaptcha(sImgElementId) { var oImgElement = document.getElementById(sIm...
javascript
[3]
4,932,727
4,932,728
adb shell input events
<p>What is the basic difference between "adb shell input keyevent" and "adb shell sendevent " .Which one should I use for inputting a character and are the both keycodes same that we pass to both the commands?</p> <p>Regards, KVR</p>
android
[4]
2,335,483
2,335,484
Create XML file in Local Memory
<p>I want to read XML data from the net and then store it in a XML file in android device's local memory. How do i do that. I have used following code for getting XML data:</p> <pre><code>HttpClient hc = new DefaultHttpClient(); HttpPost post = new HttpPost(url); HttpResponse rp = hc.execute(post); if(rp.getStatusLi...
android
[4]
3,246,897
3,246,898
Drawing with a canvas over an ImageView
<p>I want to create an ImageView and then draw text on top of the ImageView. I also need to be able to modify the text periodically. Currently I've created a custom view that extends ImageView. Then I overwrite onDraw() and use it to draw the text. Only problem then is that when I use my custom ImageView it doesn't dra...
android
[4]
1,790,276
1,790,277
Create Text File in Memory and return it over ajax, possible?
<p>I can create a text file easily enough but I want to avoid having to keep the file on the server. </p> <p>How can I create a text file in memory and return it over ajax so the file itself is returned and no file is kept on server? It doesn't need to be ajax but I want to avoid a postback if at all possible.</p>
asp.net
[9]
4,390,022
4,390,023
cpp run function that before it is declared?
<p>I'm new to CPP, and I want to know how to run a function that isn't in its scope. I'm used to doing such things in javascript, and I get an error CPP when I try to do that. What I mean is the below:</p> <pre><code>#include &lt;iostream&gt; using namespace std; int tic_h; int tic_v; void echo(string e_val){ cout...
c++
[6]
5,096,526
5,096,527
Handling Multiple UITableViews and Insertion/Deletion of cells in those tables
<p>I have two table views in a single controller.One is grouped whose frame is (0,0,320,70), other one is plain whose frame is (0,70,320,300).In the grouped tableView, I am adding the cells dynamically and want this plain tableView to shift down, so that the grouped tableView is completely visible. In a similar way,whe...
iphone
[8]
3,408,921
3,408,922
Weird JavaScript Code
<pre><code>for (var i=a.length-1;i&gt;0;i--) { if (i!=a.indexOf(a.charAt(i))) { a=a.substring(0,i)+a.substring(i+1); } } </code></pre> <p>I found this in a web app I'm auditing, it just baffles me why it's there. I can't seem to see a case where <code>i!=a.indexOf(a.charAt(i))</code> would be false.</p...
javascript
[3]
454,254
454,255
Javascript Bitwise Operators
<p>I'm trying to figure out some differences between C# and Javascript. Ok, take this code in Javascript:</p> <pre><code>var j = 0x783a9b23; var bt = ((16843134 ^ (16843134 - 1)) * j); </code></pre> <p>After executing this, "bt" will be 6051320169. </p> <p>Now after doing this in C#:</p> <pre><code>int j = 0x783a9b...
javascript
[3]
4,967,957
4,967,958
How does the compiler know where control should return to after a function call?
<p>Consider the following functions:</p> <pre><code>int main() { //statement(s); func1(); //statement(s); } void func1() { //statement(s); func2(); //statement(s); } void func2() { //statement(s); } </code></pre> <p>How does the compiler know where to return to after the <code>func2</cod...
c++
[6]
2,390,721
2,390,722
pass method as parameter using anonymous inner class
<p>There was an answer similar to this here: <a href="http://stackoverflow.com/questions/4685563/how-to-pass-a-function-as-a-parameter-in-java">How to pass a function as a parameter in Java?</a></p> <p>but the correct answer provided does not work. I have a class:</p> <pre><code>public class randomClass { 2 3 ...
java
[1]
4,975,189
4,975,190
Pythonic equivalent of this function?
<p>I have a function to port from another language, could you please help me make it "pythonic"?</p> <p>Here the function ported in a "non-pythonic" way (this is a bit of an artificial example - every task is associated with a project or "None", we need a list of distinct projects, distinct meaning no duplication of t...
python
[7]
2,925,527
2,925,528
Is there a javascript equivalent of python's __getattr__ method?
<p>In python you can define a object having <code>__getattr__(self,key)</code> method to handle all unknown attributes to be solvable in programmatic manner, but in javascript you can only define getters and setters for pre-defined attributes. Is there a generic way of getting the former thing done also in javascript?<...
javascript
[3]
4,134,000
4,134,001
Android - How can I programmatically add a VPN network
<p>The Settings on Android provides an option to add VPN manually.</p> <p>Can this be done programmatically through some kind of an API?</p> <p>I'm not looking for a way to connect to a VPN. I'm only concerned about configuring a VPN profile.</p>
android
[4]
3,598,489
3,598,490
jQuery - Check a Input Field for a Word in a String
<p>I have users that are putting in links to youtube videos and we want to only enable the button if the string (URL) they enter contains the word, 'youtube'. Below is the code and I can't get it to work how I need it to. Thanks...</p> <pre><code>var inputValue = $('#inputLink').val(); </code></pre> <hr> <pre><cod...
jquery
[5]
3,512,724
3,512,725
Correct javascript inheritance
<p>I've been reading a lot of articles about "inheritance" in javascript. Some of them uses <code>new</code> while others recommends <code>Object.Create</code>. The more I read, the more confused I get since it seems to exist an endless amount of variants to solve inheritance.</p> <p>Can someone be kind to show me the...
javascript
[3]
5,252,492
5,252,493
javascript date and loop check
<p>Hey all, this is the code i have to check for a day thats equal to the list of days in the comma seperated list:</p> <pre><code>for(var i = 0; i &lt; daysHidden.length; i++){ if (daysHidden[i] == d.getDate()); { alert(daysHidden[i] + '=' + d.getDate()); } } </code></pre> <p>the daysHidden = 1 (its...
javascript
[3]
4,377,621
4,377,622
Or symbol for JavaScript object declaration
<p>I just started to read some JavaScript project. Most of the .js file to start with have an object declared as the following:</p> <pre><code>window.Example || { bleh: "123"; blah: "ref" } </code></pre> <p>What does the <code>||</code> symbol do here?</p>
javascript
[3]
5,187,209
5,187,210
Sqllite or shared preferences to persist the changes
<p>I have a scenario where upon clicking on a button, i need to show/hide an <code>listView</code>. I have a <code>Activity</code> which holds 12 <code>ListViews</code>, if the user hides 5 <code>listViews</code>, then for that entire session until he log's out of app, the acitvity should show only 5 <code>ListViews</c...
android
[4]
4,798,667
4,798,668
Aligning text to the right in the C++ console
<p>How do I format my console output so that it's aligned to the right in C++? </p>
c++
[6]
3,667,711
3,667,712
iphone security : Does the app screenshot get saved in cache even if backgrounding is removed?
<p>From what I have read , I understand that iOS takes a screenshot whenever the app goes into the background and stores it in the cache for transition purposes. My client has security issues, therefore I have removed backgrounding from my app to make sure that the screenshot is not taken.</p> <p>Now, I have read in s...
iphone
[8]
2,442,743
2,442,744
how to to scroll smoothly between divs without jquery
<p>i want to to scroll up and down a page with javascript smoothly. i have follow some code on this page-</p> <p><a href="http://www.xfunda.com/index.php?view=article&amp;id=55%3Ajavascript-page-scroll-scroll-a-web-page-from-bottom-to-top-smoothly&amp;option=com_content&amp;Itemid=75" rel="nofollow">http://www.xfunda....
javascript
[3]
5,898,485
5,898,486
Ontouch of two imageButtons at the same time
<p>I have two image-buttons on my layout I have to handle three cases 1.button 1 get touched 2. Button 2 get touched 3. button 1 and 2 both touched at the same time</p> <p>In my OntouchListner I have cached the first two cases But how to catch the 3rd one ? please Help me... </p>
android
[4]
5,465,073
5,465,074
Python Multiple inheritance
<p>I have 3 classes A,B and D as given below</p> <pre><code>class A(object): def test(self): print "called A" class B(object): def test(self): print "called B" class D(A,B): def test(self): super(A,self).test() inst_d=D() inst_d.test() ---------------------------------------- Ou...
python
[7]
5,916,076
5,916,077
Add properties to an anonymous JavaScript type after defined?
<p>I know that in JavaScript you can add new properties to an existing type (like Date), but is it possible to add new properties to an anonymous type after it's been defined?</p> <p>For example, say I have the following script:</p> <pre><code>var employee = { 'Name': 'Scott', 'Age': 32, 'JavaScriptNewbie...
javascript
[3]
323,290
323,291
How do I access members in John Resig's class in ajax callbacks?
<p>I am using John resig's implementation class mentioned here: <a href="http://ejohn.org/blog/simple-javascript-inheritance/" rel="nofollow">http://ejohn.org/blog/simple-javascript-inheritance/</a></p> <p>Now I have a function, which is actually a callback supplied to an ajax method. Now, how do I access the class me...
javascript
[3]
734,779
734,780
jquery selector
<p>I am having trouble getting my selector right here. What this function is suppose to do is</p> <ol> <li>Select the image and shift the opacity on hover</li> <li>Select the anchor tag an slideUp on hover</li> </ol> <p>If you can help me get the anchor tag selected specific to the particular image that is being hove...
jquery
[5]
4,659,680
4,659,681
Why isn't this showing?
<p>Web Developer is showing my JavaScript as being valid, but if I run the page this does not work. I tried following the usage on jquery-color's site, but it kept returning property id missing everytime. I really wish when I took JavaScript in college that I had a better instructor. He flashed through jQuery and most ...
jquery
[5]
583,072
583,073
how loaders deliver new result when the content change
<p>from the <a href="http://developer.android.com/guide/topics/fundamentals/loaders.html" rel="nofollow">API</a> it says that one of the loaders characteristics is :</p> <blockquote> <p>They monitor the source of their data and deliver new results when the content changes.</p> </blockquote> <p>i used a loader wi...
android
[4]
4,507,120
4,507,121
Storing a pointer to an object created in a method
<p>Using C++:</p> <p>I currently have a method in which if an event occurs an object is created, and a pointer to that object is stored in a vector of pointers to objects of that class. However, since objects are destroyed once the local scope ends, does this mean that the pointer I stored to the object in the vector ...
c++
[6]
5,929,323
5,929,324
asp.net stored procedure problem
<p>Why this code don't work,when i want run this code vwd 2008 express show me this error message:Invalid object name 'answers'.</p> <p>this is my ascx.cs code:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Web.UI; using System.Web....
asp.net
[9]
673,150
673,151
Why does "a + + b" work, but "a++b" doesn't?
<p>I was fiddling around with different things, like this</p> <pre><code>var a = 1, b = 2; alert(a + - + - + - + - + - + - + - + b); //alerts -1 </code></pre> <p>and I could remove the spaces, and it would still work.</p> <pre><code>a+-+-+-+-+-+-+-+b </code></pre> <p>Then I tried</p> <pre><code>a + + b </code></pr...
javascript
[3]
825,498
825,499
How should i understand built-in function bin(x)?
<blockquote> <p><a href="http://docs.python.org/library/functions.html#bin" rel="nofollow"><strong><code>bin(x)</code></strong></a></p> <p>Convert an integer number to a binary string. The result is a valid Python expression. If <code>x</code> is not a Python int object, it has to define an <code>__index__()</co...
python
[7]
448,943
448,944
jquery two different date validation
<pre><code>var cin = $("#datepicker").val(); var cout = $("#datepicker2").val(); dateformat is : dateFormat: 'DD, d MM, yy' </code></pre> <p>how do i use jquery to check cin(checkin) date not past cout(checkout) date? which means, cout date cannot earlier then cin date</p>
jquery
[5]
2,964,663
2,964,664
jquery ajax error when nothing wrong with http request
<p>I am using jquery to do ajax calls:</p> <pre><code> // omitting the code for the options properties var options = { type: Type, url: Url, data: '{aString:"abc"}', contentType: ContentType, dataType: dataType, //processdata: ProcessData, success: functi...
jquery
[5]
2,416,311
2,416,312
get parent li text by jquery
<p>I need alert <strong>thisparenttext</strong> in following code by clicking on <strong>clickedlicontent</strong></p> <pre><code>&lt;script&gt; $("#one").live("click",function(){ var partxt=$(this).parent().parent().text(); alert(partxt); }); &lt;/script&gt; &lt;ul&gt; &lt;li&gt;thisparenttext&lt;ul&gt;&lt;li...
jquery
[5]
5,883,788
5,883,789
how to set the value of textarea with toolbar using javascript?
<p>I'm trying (from my firefox extension) to set the value of a textarea with toolbar which placed when creating a blog before posting it like in blogger or live-journal.</p> <p>In simple textarea I can get or set the textarea value by:</p> <pre><code>var myTextArea = gBrowser.contentDocument.getElementsByTagName("te...
javascript
[3]
3,321,083
3,321,084
Array name is not defined in python NameError
<p>I am a beginner in python and started to learn basics. I have a sample program here in python </p> <pre><code>#Simple Program Python tf=float(input("Enter total time of run in seconds ")) delt = float(input("Enter the time step of run ")) dx = float(input("Enter the value of dx ")) xf = float(input("Enter the total...
python
[7]
4,231,458
4,231,459
Whats wrong with this header code?
<pre><code>$return_url = $_SERVER['REQUEST_URI']; header("Location: /logout?msg=You must login to view that page&amp;c=2&amp;path=$return_url"); </code></pre> <p>For some reason its taking me to <code>http://my.domain/login?msg=You%20must%20login%20to%20view%20that%20page&amp;c=2</code></p> <p>when it should take me...
php
[2]
5,363,715
5,363,716
Android unique id
<p>How do I get an unique ID from an Android phone?</p> <p>Whenever I try to get the unique ID from the phone as a string it always shows <em>android id</em> and no other unique hex values.</p> <p>How do I get that one?</p> <p>This is the code I use to get the ID until now:</p> <pre><code>String id=Settings.Secure....
android
[4]
1,170,848
1,170,849
Java two get() methods after each other
<p>I am trying to compare two int values with a method. </p> <p>I have put two get methods after each other because the array[i] is a list of person objects and gethouse only gives the house object, the houseid is in another class. </p> <p>I'm wondering if I can set up two get() methods after each other?</p> <pre><c...
java
[1]
2,500,101
2,500,102
function with multiple arguments **args
<p>I am learning python and this is from </p> <pre><code>http://www.learnpython.org/page/MultipleFunctionArguments </code></pre> <p>They have an example code that does not work- I am wondering if it is just a typo or if it should not work at all.</p> <pre><code>def bar(first, second, third, **options): if option...
python
[7]
2,933,073
2,933,074
How to perform syncing in android?
<p>I am creating a networking website's Application in android.I want to know how can I perform syncing ie I want to store all user contacts on websites to my android phone. user's details will come in XML format.</p> <p>Please Guide me .. </p>
android
[4]
1,241,006
1,241,007
Clarification of methods being called using a stoplight example
<p>The code below appears in my book in the chapter about Methods. I'm a little confused about a couple of things.</p> <ol> <li>Is my understanding correct when I believe that the <code>run()</code> method is calling the <code>createFilledCircle</code> method?</li> <li>Is the <code>run()</code> method the receiver and...
java
[1]
73,405
73,406
Date Conversion in objective c?
<p>I have an array containing the String objects with this format 22/04/2011.My question is that how can I change this string into the <code>yyyy-mm-dd format</code>. I am using <code>NSDateFormatter</code> but it's not working. </p>
iphone
[8]
955,452
955,453
Only one insertion happens for multiple insertions
<p>Below is my code.</p> <pre><code>&lt;?php $f3=require(dirname(__FILE__).'/../../lib/base.php'); $f3-&gt;set('AUTOLOAD',dirname(__FILE__).'/'); $db=new DB\Jig('../data/'); $importer = new Importer($db); $importer-&gt;import(); &lt;?php /** * Imports the data from the format that was provided * @author pubu...
php
[2]
1,193,042
1,193,043
how to check CD or DVD in DVD-RAM drive in java
<p>I wrote how to detect this drive,but not able to check whether it is a CD or DVD in DVD-RAM drive in java?</p>
java
[1]
1,463,677
1,463,678
How to extract end of URL in Javascript?
<p>I have URLs in the form:</p> <blockquote> <p>serverName/app/image/thumbnail/2012/4/23/1335228884300/bb65efd50ade4b3591dcf7f4c693042b</p> </blockquote> <p>Where <code>serverName</code> is the domain name of the server.</p> <p>I would like to write a JS function that accepts one of these URLs and returns the very...
javascript
[3]
5,567,550
5,567,551
Printing Hindi characters as string in java results in error
<p>I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8.</p> <pre><code>public class MainClass { public static void main(String args[]) throws Exception { String s = "साहिलसाहिल"; System.out.print(s); } } </code></pre> <p>After compil...
java
[1]
566,341
566,342
Table like data structure in Java
<p>Forgive me if this question has been answered elsewhere, but I have searched long and hard and have not found an answer.</p> <p>I am new to Java programming and I wish to create a simple table like data structure, that I can manipulate as required.</p> <p>For example:</p> <p>Name,Age,Hair_Colour Bob,20,Black John...
java
[1]
5,942,659
5,942,660
use of jquery-latest
<p>I recently had some code I wrote a year ago fail because someone linked my code to </p> <blockquote> <p><a href="http://code.jquery.com/jquery-latest.js" rel="nofollow">http://code.jquery.com/jquery-latest.js</a></p> </blockquote> <p>In the latest version, jquery had deprecated/replaced a function.</p> <p>Nice ...
jquery
[5]
4,644,048
4,644,049
php script outputs itself
<p>after submitting a form my php script outputs its code. sometimes not all of it.</p>
php
[2]
719,342
719,343
About Tool Strip Status in C#
<p>I'm trying to change the text in the Tool Strip Status from one message to another message in 2 second. Why can't I do like below? </p> <pre><code>toolStripStatusLabel1.Text = "Cool"; Thread.Sleep(2000); toolStripStatusLabel1.Text = "Status: IP Address update complete"; </code></pre> <p>I've tried ...
c#
[0]
3,955,572
3,955,573
How can jquery $ act as an object as well as a function in javascript?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8734115/how-can-jquery-behave-like-an-object-and-a-function">How can jQuery behave like an object and a function?</a> </p> </blockquote> <p>In jquery we can use $ as a function as well as a namespace. for exampl...
javascript
[3]
2,688,964
2,688,965
Video creation from series of images?
<p>How to create the video from series of png images. Is it possible in android can any body suggest me to do that thanks in advance </p>
android
[4]
2,649,353
2,649,354
Parse error: syntax error, unexpected T_STRING on line
<p>I'm getting the "Parse error: syntax error, unexpected T_STRING in" on the below, on the first line. Any idea why its happening?</p> <pre><code>if( !is_numeric($bday_day) || !is_numeric($bday_month) || !is_numeric($bday_year)  ){ $this-&gt;error[$this-&gt;errorCount] = REGISTRATION2error_age; $this-...
php
[2]
1,771,534
1,771,535
ASP.net custom error page
<p>im trying to implement a custom error page, what i want to be able to do is have a single generic error page which can display the error which occurred or other information (custom error message). when a error occurs on the website, the user should be directed to this page which shows the error message. </p> <p>so...
asp.net
[9]
4,492,867
4,492,868
Javascript CR+LF will break string?
<p>When storing '\n\r' inside a string constant it will make the Javascript engine throw an error like "unterminated string" and so on.</p> <p>How to solve this?</p> <p>More info: basically I want to use Javascript to select text into a TEXTAREA HTML field and insert newlines. When trying to stuff those constants, I ...
javascript
[3]
4,564,861
4,564,862
mysql_assoc error - displaying fine
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/795746/warning-mysql-fetch-array-supplied-argument-is-not-a-valid-mysql-result">Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result</a> </p> </blockquote> <p>i have an error being drawn w...
php
[2]
5,107,175
5,107,176
What to do when the user hit the home key and the IPhone Application exit
<p>How do i handle the user pressing the home button at any time, while my app is still processing stuff with the server?</p> <p>I have this problem both in ios3 &amp; ios4 - i believe maybe the answers would be different because in ios4 it can last in the background.</p> <p>how do you usually handle such events? Tha...
iphone
[8]
6,020,851
6,020,852
Does turning a list into a set, then back again, cause problems in Python?
<p>I'm turning a list into a set in Python, like so:</p> <pre><code>request.session['vote_set'] = set(request.session['vote_set']) </code></pre> <p>So I can easily do a <code>if x in set</code> lookup and eliminate duplicates. Then, when I'm done, I reconvert it:</p> <pre><code>request.session['vote_set'] = list(req...
python
[7]
1,353,749
1,353,750
getting error as document is empty(size 0kb) when opening pdf file in micromax funbook
<p>Iam trying to Downloading pdf from server and displaying it as it is in android micromax funbook.</p> <p>I am getting the error as document size is empty(0 KB).when open the pdf file...</p> <p>I'm new to android suggest me the coding what i am using is correct or not for downloading</p> <pre><code> public static ...
android
[4]
756,789
756,790
Java, how to continue running while ServerSocket.accept() takes in clients?
<p>I am trying to make a multiplayer game where many calculations are done on the server with multiple clients. How could I have my server listen for new clients, while calculating for the game. Everything I have tried pauses the entire program while it runs ServerSocket.accept(). Is there any way around this? Thanks i...
java
[1]
4,849,700
4,849,701
Debugging .aspx in WAP
<p>In WAP, should you expect to get errors when debugging an .aspx during compile time? I'm not getting any errors when my .aspx has errors until runtime when using Web Application Projects. I never really thought about it, because I've always just used WAP. I'm asking the question for someone else and I don't see a...
asp.net
[9]
3,401,141
3,401,142
How can I show a pop-up after completing a task in the background?
<p>I want to show a pop-up message after completing my current task, which is running in the background. The pop-up message must be poped up on current activity.</p> <p>How i can achieve this?</p>
android
[4]
2,939,354
2,939,355
best book to learn fast javascript
<p>I want to learn javascript and implement it in my real work asap.</p> <p>Can anybody suggest me best book or link? Currently I am lookins javascritp step by step book by Steve Suehring but it is taking a lot of time. and yes no w3schools link.</p> <p>This will really help me.</p>
javascript
[3]
5,470,785
5,470,786
Where clause in PHP doesn't work with variable
<p>I am learning PHP and have been trying to make this following work for some time but no luck. </p> <pre><code>$sql = "SELECT * FROM add_employee WHERE employee_id='".$employee_id."'"; </code></pre> <p>I am getting this following error:</p> <pre><code>Notice: Undefined variable: employee_id in www/suman/payroll_pr...
php
[2]
2,419,761
2,419,762
jQuery Toggle Bug
<p>I use the following code to toggle some stuff on a page. The problem is that if a user clicks too fast then more than one panel will open and stay on the page. I'm guessing this is because I'm using <code>click()</code> rather than <code>toggle()</code> but in order to get the full control of the animation I opted f...
jquery
[5]
4,860,046
4,860,047
Rendering and jaggering
<p>I have a html 5 canvas using the 2d context. I am able to get up to 120 frames per second, but the rendering can be jagged, where the animation just jumps. I would like to know any ideas what may be causing it, especially with such a high (but pointless) frame rate? What are known ways or smoothing out animation as ...
javascript
[3]
5,030,479
5,030,480
ASP.NET Site slow until recycle
<p>I just recently move a site from IIS6 to IIS7 and are experiencing a lot of performance problems. </p> <p>The site performance is really bad until I do a recycle on the Application Pool. What can this be a symptom of?</p> <p>I recycle ever night but that seems not to be enough?</p> <p>I'm not relying that much on...
asp.net
[9]
534,330
534,331
jquery doing two ajax calls under on function
<p>if have the following two scripts, when a button is clicked i wish for them both to be loaded, at the moment they are conflicting? any suggestions? the first needs to run before the second. I have tried calling two separate function but still i get a conflict </p> <pre><code>function showUser3(str) { if (str==""...
jquery
[5]
523,699
523,700
Optimal Code for initialization
<p>Which of the following code would be optimal for initializing array?</p> <pre><code>char szCommand[2048] ={0} </code></pre> <hr> <pre><code>char szCommand[2048]; memset(szCommand,0,2048); </code></pre>
c++
[6]
2,862,900
2,862,901
How to pass this variable to this function?
<p>I have to pass <strong>aaa</strong> to <strong>ehi()</strong> function in the <strong>mitt</strong> parameter.</p> <p><strong>aaa</strong> is an array of numbers like: 29837,127365,5645,12323,47656564,2312,4534,2343</p> <p>This is the correct way that the <strong>ehi()</strong> works:</p> <pre><code> function e...
javascript
[3]
2,011,249
2,011,250
Diff between getExternalFilesDir and getExternalStorageDirectory()
<p>I understand that ExternalFiles is to be used on API 8 and up and getExternalStorageDirectory is for 7 and down. However I am a little confused between the use. For example I wanted to check that a folder that exists and previously you would use something like:</p> <pre><code>File ChildFolder = new File(Environment...
android
[4]
1,292,944
1,292,945
how to add three default images to wordpress?
<p>how to add three default images to wordpress <strong>custom background</strong>?</p> <p><img src="http://i.stack.imgur.com/fNCQ4.jpg" alt="enter image description here"></p> <p>now, i want to add three default images which can be selected one by the user.and it locates on the <strong>upload Image</strong> part.li...
php
[2]
1,829,909
1,829,910
Replacing image src with input hidden value using Jquery
<p>I have below input hidden with value ="/fr/images/findacourse_logo_tcm10-268.gif".</p> <pre><code>&lt;input type="hidden" id="Qt_Email_Image" value="/fr/images/findacourse_logo_tcm10-268.gif"/&gt; </code></pre> <p>I have another input image below with src = "/images/quote/Quote_Email_Button.JPG"</p> <pre><code>&l...
jquery
[5]
2,762,241
2,762,242
jQuery SlideToggle on checkbox
<p>I currently have this working with a button. How do I switch display/hide to work with a Checkbox?</p> <pre><code>$(document).ready(function(){ $(".slidingDiv").hide(); $(".show_hide").show(); $('.show_hide').click(function(){ $(".slidingDiv").slideToggle(); }); }); </code></pre>
jquery
[5]
3,114,179
3,114,180
How do I read character by character from a text file and put it in a character array?
<p>I'm trying to read character by character from a text file until EOF, put them into a character array, so that I can manipulate it after. Compiled with g++ without errors, and when run, I'm prompted for the input file but then it just hangs. </p> <pre><code>int main (int argc, char *argv[]) { string filename; ...
c++
[6]
2,036,175
2,036,176
php empty values
<p>I have a problem with my php script it is...</p> <pre><code> Parse error: syntax error, unexpected T_LOGICAL_OR, expecting ')' in C:\wamp\www\register.php on line 34 </code></pre> <p>I am a nube with !Empty so let me know if im doing something wrong.</p> <pre><code>if (!empty($username or $email or $password or $...
php
[2]
1,134,578
1,134,579
returned function result is confused in conditional statement
<p>I have a class that works with database in PHP. the Add function in this class is: </p> <pre><code> function Add($post_id) { if(!is_numeric($post_id)) { return 1181; } $query = "..."; $result = mysql_query($query, $this-&gt;link); return $result;...
php
[2]
5,512,804
5,512,805
ImageView is being re-sized - why?
<p>I have the following image in my app: It's a 59x60 PNG. </p> <p><img src="http://i.stack.imgur.com/SOEo4.png" alt="enter image description here"></p> <p>I use it in the following layout:</p> <pre><code>&lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id...
android
[4]
4,852,766
4,852,767
detect power state change
<p>What is the best way to detect when Windows power state is changing?</p> <p>I need to preform some actions depending on wether the computer is going to Stanby/Hibernate/Shut Down</p> <p>Thanks Sp</p>
c#
[0]
4,015,900
4,015,901
How to Capture image from Camera Application in Android Programming?
<p>I am trying to implement Camera application in android,and i got some code from net to create a Live Camera through WebCam.Upto this no problem.Now i have to capture the images when click the button, and i displayed the captured images in the Dialog window.Without any exception the program is running but the capture...
android
[4]
5,360,021
5,360,022
How to remove \ from a string in c#?
<p>I want to remove <code>\</code> (backslash) from a string in C#. How can I do this ?</p> <pre><code>string scrip = "$(function () {$(\"[src='" + names[i, 0] + "']\"" + ").pinit();});"; </code></pre> <p>I used <code>scrip..Replace(@"\", "") ;</code> but <code>\</code> is not replacing with empty string </p>
c#
[0]
4,857,013
4,857,014
How can I access the contents of a form submission via Javascript?
<p>I have server side caching running on a website, and need to trigger functionality based on the submission of a form. How can I access the contents of a form submission via Javascript? Usually I would access these with PHP via $_POST.</p> <p>I can't get the values via PHP because the page that is being served aft...
javascript
[3]
5,502,262
5,502,263
Error making C++ functions virtual
<p>The error states: <br>"error: virtual outside class definition"</p> <p>Cpp members in question:</p> <pre><code>virtual void Account::creditBalance(double plus) { if(plus &gt; 0) balance += plus; else cout &lt;&lt; "Cannot credit negative."; } virtual void Account::debitBalance(double minus) { ...
c++
[6]
1,082,422
1,082,423
Accessing sqlite db value between applications
<p>I have an sqlite db in one of my applications, and I need to get the value of a particular column in this database from another application.</p> <p>Using Content providers to access this field is the only(and best?) approach, or are there other alternatives?</p> <p>Any help is appreciated</p>
android
[4]
108,156
108,157
Will everything work the same if I cut and paste my .cpp to the bottom of my .h?
<p>I have a <strong>very simple</strong> class and I'd like to consolidate it to a single .h file. Will everything work the same if I cut and paste the guts of my .cpp to the bottom of my .h?</p> <p>In particular, there are static member variable initializations <code>int MyClass::myStaticVar = 0;</code> outside of a...
c++
[6]
475,584
475,585
use span id value as a conditional javascript
<p>I have this span in the html body:</p> <pre><code>&lt;span id="username_status"&gt;&lt;/span&gt; </code></pre> <p>snippet of sql query:</p> <pre><code>if($exist &gt; 0) { echo 'Sorry, That username is Taken!'; //value in username_status } else{ echo 'Username available!'; //value in username_s...
javascript
[3]
4,818,899
4,818,900
Mediascanner not working in 2.2 and above
<p>Can someone please tell me why the following works fine on 2.1 and not on 2.2 or 3.1? The final toast message even shows indicating MediaScanner completed.</p> <pre><code> scanner = new MediaScannerConnection(this, new MediaScannerConnection.MediaScannerConnectionClient () { public ...
android
[4]
1,486,939
1,486,940
How to write a PHP batch file that will execute a series of PHP files one after another?
<p>I know I can set up a cron for each of the individual PHP files, but is there a way for a cron to run one PHP file that calls a list of files in a specific order. For example, It should only call the second file if the first file has completed. </p>
php
[2]
3,519,542
3,519,543
accessing a registry key throws an exception?
<p>I am trying to access a key in the following path in registry on widows 8:</p> <blockquote> <p>Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run</p> </blockquote> <p>and I am using the folowing in code to do that:</p> <pre><code>using (RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMach...
c#
[0]
2,626,083
2,626,084
OOP, assigment operator does not work
<p>This is from my code:</p> <pre><code>struct R3 { float x; float y; float z; R3(float, float, float); R3(); }; R3::R3(float a, float b, float c) { x = a; y = b; z = c; } R3::R3() { x = 0; y = 0; z = 0; } struct Bodies { int...
c++
[6]
1,977,179
1,977,180
Storing 'struct' data to binary file
<p>I need to store a binary file with a 12 byte header composed of 4 fields. They are namely: sSamples (4-bytes integer), sSampPeriod (4-bytes integer), sSampSize (2-bytes integer), and finally sParmKind (2-bytes integer). I'm using 'struct' to my variables to the desired fields. Now that I have them defined separately...
python
[7]
2,495,368
2,495,369
Where to find a python module, py4cs?
<p>I need the python moduel py4cs, but I cannot find it anywhere, it is not on pypi or anywhere else. Please Help. Thanks!</p>
python
[7]
1,432,052
1,432,053
PHP Loop to search for string, execute if no match
<p>I am trying to search for multiple strings within a larger string and if none of them are a match, manipulate the original string. Here is the code:</p> <pre><code>$searchthis = 'this is a string' $arr = array('foo', 'bar'); foreach ($arr as &amp;$value) { if (strpos($searchthis, $value) !== false) { break; ...
php
[2]
1,400,359
1,400,360
Xoom avd - API 11 attach google map
<p>I have download avd "<strong>Xoom (Motorola Mobility Holding INC) - Api Level 11</strong>" for motorola tablet development and configure and integrate the Google map but "<strong>MapActivity</strong>" class required google API class. so i have copy <em>map.jar</em> file and add it as External library but not run.i k...
android
[4]