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
4,685,004
4,685,005
Populate ListView with Dynamic Array
<p>I have a <code>EditText</code> box so a user can input names and then click the <em>Add</em> button and the name saves to the array <code>playerList</code> and clears the box so another name can be added.</p> <p>I also have a <code>ListView</code> on the same Activity which will then be populated by the names in th...
android
[4]
1,311,566
1,311,567
jQuery: How can I output content of an XML document to a node?
<p>How can i output the content of an XML document to $(this) in the success event handler?</p> <pre><code>var useJson = false; var acceptHeader; if (useJson) { acceptHeader = "application/json"; } else { acceptHeader = "text/xml" } $.ajax({ url: '&lt;%= Url.Action("GetAllCategories") %&gt;', before...
jquery
[5]
5,954,599
5,954,600
C# database retrieval
<p>Again I can't get the answer for my query. I have written the code to retrieve the data from the database and load it into a textbox by selecting the dropdown list. If I have selected my data in dropdown list it will not give the answer exactly, instead it'll show selected index 0. I mean it'll show "-Select-". ther...
c#
[0]
1,262,284
1,262,285
Java how to add int in an array using loop
<p>i cant seem to figure out the logic, here's my code</p> <pre><code>class stringrays { public static void main (String[] args) { int[] numrays = {23, 6, 47, 35, 2, 14}; int i; int z; int y; for (i=1; i &lt; numrays.length; i++) { z = numrays[0] + numrays[i]; System.out.println(z...
java
[1]
5,906,506
5,906,507
jQuery Change Value based on Value
<p>Can you change the value of an input field based on the original value?</p> <pre><code>&lt;input type="checkbox" value="fooBar1" class="checkbox" /&gt; &lt;input type="checkbox" value="fooBar2" class="checkbox" /&gt; </code></pre> <p>Was trying something like this ...</p> <pre><code>if ($('.checkbox').val() == 'f...
jquery
[5]
3,701,116
3,701,117
Initializer is overwriting second array
<p>I cannot solve this, I'm almost accepting the fact that it might be a memory issue with my machine at this point.</p> <p>I have this initializer:</p> <pre><code>Search::Search(ifstream&amp; inFile) { int id = 0; int i = 0; inFile &gt;&gt; id; while (inFile) { if(i &lt; SEARCH_DATA_SIZE)...
c++
[6]
2,992,292
2,992,293
Action_INSERT always returns result code 0 (ZERO) on Droid-X
<p>My code is as following </p> <p>Permission </p> <pre><code>&lt;uses-permission android:name="android.permission.WRITE_CONTACTS" /&gt; </code></pre> <p>And caller Activity code is </p> <pre><code>Intent addNewContact = new Intent(Intent.ACTION_INSERT); addNewContact.setType(ContactsContract.Contacts.CONTENT_TYPE)...
android
[4]
2,249,995
2,249,996
auto back to top in jquery
<p>Does anyone there have any way that I can auto make the page back to top without refresh the page after a submit process is completed in jquery?</p>
jquery
[5]
4,044,329
4,044,330
PHP : Foreach Loop Not Starting With Zero
<p>I have this variable : </p> <pre><code>$key = 'text1-text2-text3-021-039-947-927-827-927'; $key = explode ('-', $key); </code></pre> <p>first three of $key <code>($key[0]...$key[2])</code> always contains text and it won't be a problem to me. but the rest of it is dynamic.</p> <p>in that case, the rest of it cont...
php
[2]
1,696,378
1,696,379
val method in jquery
<p>What does the following code do in jquery? Please explain to me. Thank you.</p> <pre><code>$(document).ready(function(){ $('#btn1').click(function(){ $('select#s1').val('Hello'); }); </code></pre>
jquery
[5]
4,227,384
4,227,385
Is it possible to get early/static binding using function pointers in c++? If yes then how?
<p>In C++, one way to get late/dynamic binding is to use function pointers we can also use virtual functions.</p> <p><strong>But don't know about the early/static binding.</strong></p>
c++
[6]
4,536,595
4,536,596
How to convert DateTime to Date
<p>How can I convert <code>Date</code> to <code>DateTime</code> and vice versa?</p> <p>E.g.</p> <pre><code>Date dt = new Date(); </code></pre> <p>Now I want to covert this to <code>DateTime</code>.</p> <p>Also</p> <pre><code>DateTime dtim = new DateTime(); </code></pre> <p>Now I want to convert it to Date.</p>
java
[1]
2,381,279
2,381,280
How to access shared folder(with username and password) in the windows service
<p>I'm currently trying to create a windows service in c#. The service needs to access a shared network drive and sql server. The problem is, I'm not allow to use a domain account to access the network drive and the drive will never join the domain. The only thing I have is the username and password of the drive.</p> ...
c#
[0]
3,256,059
3,256,060
I want to print the value in sales
<p>I want to print the value of the amount of sales entered by user times .10. My first issue is I want to store a value that a user enters into sales then times that by .10 then print the value of sales. We I run the program I get two lines one is the amount of sales entered the other is .5. </p> <pre><code> c...
c#
[0]
3,297,632
3,297,633
How to display two lists from two tables in single view in Android
<p><a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html" rel="nofollow">The Notepad example on android developer</a> is good for a single list, but I want two lists drawing from two tables in a single view. Can anyone expand on how to implement something like this?</p> <p>I'm wondering ab...
android
[4]
2,399,884
2,399,885
Change a portion of a url
<p>a have a url that is as follows</p> <pre><code>&lt;a href="www.mysite.com/foo/content"&gt;Link&lt;/a&gt; </code></pre> <p>How do I remove the "/foo" using jquery so it'll end up like this.</p> <pre><code>&lt;a href="www.mysite.com/content"&gt;Link&lt;/a&gt; </code></pre>
jquery
[5]
4,985,252
4,985,253
how to create a calculating property
<p>say i have a some properties</p> <pre><code>public int redBalls { get; set; } public int blueBalls { get; set; } </code></pre> <p>I now want to have a totalBalls property which will add the two.</p> <p>Would I do this?</p> <pre><code>public int totalBalls { get { return redBalls + blueBalls; } } </code></pre> <...
c#
[0]
4,904,321
4,904,322
sort of Include in an include - php
<p>Here is what we have :- </p> <p>We currently have a file system like this </p> <p>$price = '3.00'; - this in turn is then included into a different file for use within the template system.</p> <p>what we want to do may seem a bit long winded but it seems the easiest to us to get around.</p> <p>what we are going ...
php
[2]
1,629,973
1,629,974
How to push text into newly created file by shell script from PHP?
<p>i used PHP site to run a shell script and it created my desired name file "result.txt" inside /opt/xampp/htdocs. However, the result.txt is totally empty, when it is supposed to have output values from the shell script. Tried on terminal, result.txt is created on Desktop and outputs are there. Tried on PHP, result.t...
php
[2]
2,756,617
2,756,618
Python error : X() takes exactly 1 argument (8 given)
<p>I'm trying to bulid an Anonymous FTP scanner , but i got an error about calling function X , i defined X to recieve ony 1 arguement which is the ip address , the same code works if i don't use the loop and send the IPs one by one .</p> <p>The error is : X() takes exactly 1 argument (8 given)</p> <pre><code>from ft...
python
[7]
4,259,757
4,259,758
android list contents notifications
<p>how to calculate total number of items in a listbox and display in a text box?</p> <p>I want to dynamically add the number of items in the list and display in front of the heading in brackets and also in front of its image like a notification showing the pending requests</p>
android
[4]
1,641,636
1,641,637
C# how to make a clock run after reading from device
<p>I know that if we want to display the pc time, we will use the below coding:</p> <pre><code> System.Windows.Forms.Timer tmr = null; private void StartTimer() { tmr = new System.Windows.Forms.Timer(); tmr.Interval = 1000; tmr.Tick += new EventHandler(tmr_Tick); tmr.Enabled =...
c#
[0]
636,587
636,588
class not working on jQuery prepend
<p>I am prepending a list item <code>&lt;li&gt;</code> to my <code>&lt;ul&gt;</code> in my jQuery code and in the prepended <code>&lt;li&gt;</code> I have a text link that calls fancybox.</p> <p>Any clicked item with the class 'fb' attached to it will call and open fancybox only the newly appended list item with text ...
jquery
[5]
1,998,344
1,998,345
Can an Android application duplicate "Auto-rotate" functionality?
<p>In other words, can an application sit in the background, read the g-sensor of the device, and accordingly set (or rotate) the view of the active Android application?</p>
android
[4]
417,562
417,563
outofmemoryerror in android
<p>I have one running some methods in doInBackground in AsyncTask ,which is calling webservices and inserting number of records into the database , at the same user click on other screen then outOfmemoryError is coming I want to stop the background thread temporarily till the screen loads and then thread has to resum...
android
[4]
2,975,739
2,975,740
JQuery syntax issue with screen width
<p>Please look over my syntax here. I am getting the following error: Object doesn't support this property or method. Any help would be appreciated. I am trying to append a new stylesheet if the screen resolution is less then or equal to 1024 pixels wide. </p> <pre><code> $(document).ready(function() { if ((scree...
jquery
[5]
2,272,883
2,272,884
REQUEST_URI contains favicon.ico path in php $_SERVER why
<p>Variable <code>$_SERVER['REQUEST_URI']</code> contains <code>favicon.ico</code> file path in home page. Why?</p>
php
[2]
4,638,228
4,638,229
digital signature in android
<p>I want to create Digital signature application in android. It should capture user signature and store it as an image. If anybody know please let me know.</p>
android
[4]
4,540,967
4,540,968
assignment in PHP
<p>I am learning php and read this example in this <a href="http://www.php.net/manual/en/language.types.boolean.php" rel="nofollow">http://www.php.net/manual/en/language.types.boolean.php</a> tutorial, I want to understand what occur when assigning the return value of method to a variable, why it may change?? please se...
php
[2]
2,693,377
2,693,378
Setting tabBarItem.badgeValue in other classes?
<p>I seem to have a problem with my tabBar items. Doing the creation of the tabBar I'm able to set this property of the tabBarItem that I want like so:</p> <pre><code>viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; UIViewController *viewController3 = [[ThirdVie...
iphone
[8]
3,923,322
3,923,323
binary_search with Pointers
<p>i want to implement binary_search with pointers</p> <pre><code>#include &lt;cstdlib&gt; #include &lt;iostream&gt; using namespace std; int binary_p(int x[],int size,int target){ int *p=&amp;x[0]; int *q=&amp;x[size]; while(p&lt;q){ int mid=(p+q)&gt;&gt;2; if (target==x[...
c++
[6]
711,510
711,511
list without Alphabetical
<p>I read in data from a website, and I need to create some lists in its original order as below:</p> <pre><code>url = 'https://example.com' try: dataset = open_url(url) except: print 'Sorry, ' + url + ' not available' var = dataset['emolt'] sites = list(var['SITE']) depth = list(var['BTM_DEPTH']) </code>...
python
[7]
1,550,101
1,550,102
How to find out specifics of 400 Http error in Java?
<p>I'm getting 400 errors trying to connect to a website.</p> <p>How do I set the connection to display why the server is rejecting me?</p> <pre><code>try { doc = Jsoup.connect(URL).timeout(10 * 30000).get(); } catch (IOException ioe) { System.out.println("Error:" + ioe); } </code></pre> <p><a href="http://jsoup.org...
java
[1]
4,838,285
4,838,286
Is there a way to call a function when the interface rotates in Iphone?
<p>When my interface rotates i want to call certain functions. How can I do these actions?</p>
iphone
[8]
5,935,316
5,935,317
Please help with my twodimensional array source code
<p>Here is what i have done but i have some questions: </p> <pre><code>class masivins { public static void main (String args[]) { int mas[][] = {{0, 2, 7, 0, 8, 5, 3}, {0, 4, 0, 6, 0, 0, 0}, {0, 0, 0, 0, 3, 0, 0}, {7, 0, 0, 9, 1, 0, 7}, ...
java
[1]
2,716,076
2,716,077
Erase using brush in GLPaint
<p>As part of modifying the <code>GLPaint</code>, I am trying to add erase functionality where user could select an eraser button and erase the painted area just as painting. </p> <p>I am trying have a conditional statement within <code>"renderLineFromPoint:(CGPoint)start toPoint:(CGPoint)end"</code> method so that I ...
iphone
[8]
2,372,932
2,372,933
iPhone - general methods on a separate file
<p>I have some methods that are used by several classes. My idea was to put these methods on a general separate file and have this be seen by other classes.</p> <p>How do I do that in Xcode?</p> <p>Sorry but I am new to iPhone development.</p> <p>thanks</p>
iphone
[8]
4,920,643
4,920,644
Array with in an array
<p>I have an array like:</p> <pre><code>Array ( [id] =&gt; 1 [code] =&gt; FAC876 ) </code></pre> <p>How do I push it into another array using PHP, such that the result is like:</p> <pre><code>Array ( [0] =&gt; Array ( [id] =&gt; 1 [code] =&gt; FAC876 ) [1] =&gt; Array ( [id] =&gt; 2 [code] =&gt; GEO980 ) ...
php
[2]
1,016,183
1,016,184
2 Binary Equal php files, one works while the other emits White Screen of Death
<p>I edited the <code>&lt;title&gt;</code> in a php file (myfile.php) then re-uploaded it to the server; that is all I changed.</p> <p>Now navigating to that page/file doesn't work. I get php's White Screen of Death (view-source is blank too).</p> <p>I then renamed that file locally and reuploaded it as <code>myfile2...
php
[2]
4,378,100
4,378,101
Reverse order of years
<p>I am trying to implement the array_reverse function into this foreach array, I believe I'm calling the wrong variables in line 3(well, 4)</p> <pre><code>&lt;?php $j=1; $skill_slugs = array_reverse( $skill_slugs ); foreach ($skills as $skill) { $skill = get_term_by( 'slug', trim(h...
php
[2]
5,483,959
5,483,960
Array and Arraylist in C#
<p>Which is having fast seaching Array or Arraylist and Why?</p>
c#
[0]
2,914,824
2,914,825
Java Script: How to ammend a datetime variable to set a specific time?
<p>I need to take a datetime values from an MSSQL based app which is read into the script as 22/12/2010 3:56pm and adjsut the time component toa set time.</p> <p>I've used what I know of javascript and what I can find in google searches to try and progress this but to no avail.</p> <p>Premis: I need to read the date...
javascript
[3]
3,023,961
3,023,962
Detect delete key on the entire page with jQuery
<p>I need to be able to detect a delete key over any portion of the page. I have this code...</p> <pre><code>$(document).keydown(function (e) { console.log(e); }); </code></pre> <p>but I can't seem to get the event to fire at all..</p>
jquery
[5]
1,576,181
1,576,182
Casting Class into String and vice versa in Java
<p>I have a program in which I need to store a Class object into memory by casting it into String. Is it possible to convert the String back into the original Class so that I can use that class variables? I am doing this in JAVA.</p> <p>Example: test.java</p> <pre><code>class hello{ public String h1; public String ...
java
[1]
5,936,810
5,936,811
Access field from class where list belong to
<p>let say i have following class:</p> <pre><code>class Shape { public int widht; public List&lt;Point&gt; points; } </code></pre> <p>and in class Point i want to use this widht property from class Shape, so if "point" belong to that list i wish to have possibility to use "container" properties. I also want ...
c#
[0]
3,951,163
3,951,164
How save the value entered in the Quick Search box when turning screen
<p>I implemented a quick search in my application. But when I turned the screen, the Instant Search box is destroyed. How save the value entered in the Quick Search box when turning screen?</p> <p>I need to save the value when user turned the screen. That is, the user has entered something into the search box, do not ...
android
[4]
4,396,977
4,396,978
Javascript :: Multiple variable assignments in one row
<p>As each programming language is different and my experience with Javascript is on basic level, I would like to know, how multiple variable assignments in one row are evaluated</p> <p>Example:</p> <pre><code> a = b = c = d = 5; </code></pre> <p>Will such statement assign <code>5</code> to each of 4 variables <code...
javascript
[3]
5,124,434
5,124,435
C++ Exception Specification for overloaded functions
<pre><code>class ESClass { public: void PrintMe() throw(); void PrintMe(int) throw(int); }; </code></pre> <p>I want to know whether or not we can define different exception specification for overloaded functions. In other words, can we give different exception specification to different version of the function...
c++
[6]
338,120
338,121
Why does parseInt("014") come out to 12?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/850341/workarounds-for-javascript-parseint-octal-bug">Workarounds for JavaScript parseInt octal bug</a> </p> </blockquote> <p>It seems as though leading zeroes should just be ignored when parsing for an Int. Wh...
javascript
[3]
2,962,281
2,962,282
Jquery progress-bar or chart to show multiple values
<p>I need a horizontal <strong>Jquery progress bar / Chart</strong>, which can show multiple values in different colors . i could not find any related component, pls help me.</p> <p>pls check this link <a href="http://stackoverflow.com/questions/8749892/how-to-change-label-on-jqplot-stacked-horizontal-bar-chart">how t...
jquery
[5]
4,588,936
4,588,937
C++ variable number of arguments
<p>I need to define a virtual function that can take variable number of arguments, problem is c style ellipses does not work for non pod types, I have limited amount of memory (2KB) so i am trying to avoid allocating temp object just to pass to the function, all arguments will be of the same type (a custom shared point...
c++
[6]
4,631,744
4,631,745
Javascript Books for Pure Noob
<p>this site has been a great help to me. I am working as a UI designer, and i am very interested in learning Javascript, but i am not able to find a right way to start from. I don't have a programming background.</p> <p>I need a book for Javascript, which is totally for a Noobs, starting from the fundamentals. I trie...
javascript
[3]
98,227
98,228
Killing the Background running Activities such as Messaging, Browser, Contact etc in Android
<p>I am trying to Kill the Background running Activities such as Messaging, Browser, Contact etc in Android. I have written the following code.</p> <pre><code>amm=(ActivityManager) getSystemService(ACTIVITY_SERVICE); List&lt;RunningTaskInfo&gt;task1=amm.getRunningTasks(20); for (ActivityManager.RunningTaskInfo a...
android
[4]
5,884,389
5,884,390
Javascript to scrape its own instance of a page
<p>My javascript foo is a bit weak, is it possible to use javascript to scrape the page its on into a string? I don't want it to make another request for the webpage, I need it to read in itself and any other source sitting on the page which will include a unique token generated for each page request, hence the need fo...
javascript
[3]
4,206,563
4,206,564
Access to __init__ arguments
<p>Is is possible to access the arguments which were passed to <code>__init__</code>, without explicitly having to store them?</p> <p>e.g.</p> <pre><code>class thing(object): def __init__(self, name, data): pass # do something useful here t = thing('test', [1,2,3,]) print t.__args__ # doesn't exist &gt;&gt; (...
python
[7]
1,601,403
1,601,404
reloading php file with static urls
<p>I have a PHP file with a few variables that load URLs, e.g.:</p> <pre><code>&lt;? php $URL_1 = "http://local.web.site/my-test-page.html"; $URL_2 = ...; ... ?&gt; </code></pre> <p>These are used on a different page inside a link:</p> <pre><code>&lt;a href="&lt;?=$URL_1?&gt;"&gt;Click here&lt;/a&gt; </code></pre> ...
php
[2]
5,421,091
5,421,092
Please explain the >> in this program
<p>What is the extraction operator doing? I have never seen it used this way.</p> <pre><code>void DecimalToBinary(int decimal) { int remainder; if(decimal &lt;= 1) { cout &lt;&lt; decimal; return; } remainder = decimal % 2; /*-----&gt;&gt;&gt;*/ DecimalToBinary(decimal &gt;&gt; 1);/*what is the extracti...
c++
[6]
3,069,981
3,069,982
subprocceses are still alive after parent process was stopped
<p>I wrote a python daemon. After I stop it I see in the memory that its sub processes are still alive and have parent with pid=1. what should I do to kill these child processes while stopping the daemon? </p>
python
[7]
3,963,781
3,963,782
Shorthand <? issue
<p>I want to use the <a href="http://en.wikipedia.org/wiki/CakePHP" rel="nofollow">CakePHP</a> shorthand <code>&lt;?</code> in my project code instead of <code>&lt;?php</code>, but my <a href="http://en.wikipedia.org/wiki/WAMP" rel="nofollow">WAMP</a> server (<code>v2.1d-x64</code> on localhost) doesn't recognize it.</...
php
[2]
1,570,745
1,570,746
C# - Enumerating Custom Attributes via Reflection
<p>Here is my attribute definition:</p> <pre><code>[AttributeUsage(AttributeTargets.Field)] public class Optional : System.Attribute { public Optional() { } } </code></pre> <p>In MyClass:</p> <pre><code>[Optional] public TextBox Name; </code></pre> <p>Finally in another function:</p> <pre><code>typeof(...
c#
[0]
5,853,856
5,853,857
String match problem
<p>I have two strings:</p> <p>string1 = "ABCD" </p> <p>string2 = "-A---C-D-"</p> <p>and I want to adjust string1 to become sth like "-AB--C-D-" which has max similarity (i.e. min Levenshtein Distance) with string2.</p> <p>How can I do that? </p> <p>Thanks</p> <hr> <p>Guys, thanks for replying.</p> <p>Actually ...
c#
[0]
5,847,580
5,847,581
size (in KB) of variable in php
<p>is it possible to calculate / estimate the size (in KB) of a variable (string, array but mostly array). What happen is that we store some data inside memcache, and we would like to know how much memory space that data would take inside memcache.</p>
php
[2]
1,972,629
1,972,630
How to store the data from pen drive
<p>Thanks for previous reply I am new to android development. I just trying to develop a simple app. is it possible to retrieve data from pen drive to SD card through tablet. my table have provision to connect the pen drive facility, i want to get the data from the pen drive and store it in sd card. is this possible. p...
android
[4]
5,149,644
5,149,645
Load bitmap as a content of webview
<p>First I load the bitmap from url and then I want to load this bitmap to webview element. Is there a way to load bitmap from the app install folder?</p>
android
[4]
4,334,724
4,334,725
What is wrong with my guess game?
<p>I tried to make a simple "guess game", but all it does is asks for an input and that's it.</p> <p>Here is my code:</p> <pre><code>import random def guess(): if a == b: print "Correct!" n = input("Press 0 to quit or 1 to try again.") if n == 0: print "" if n == 1: ...
python
[7]
4,210,666
4,210,667
Edit text hides behind on-screen keyboard
<p>How can i keep my edit text floating above the on screen keyboard?</p>
android
[4]
1,584,842
1,584,843
Getting error when using global variables
<p>I use a global variables as follows:</p> <pre><code>var someArray = new Array(); for(i=1;i&lt;=50;i++) someArray[i] = 0; </code></pre> <p>Then in a function, I use:</p> <pre><code>if(something == anotherThing) someArray[i] = 1; //works fine </code></pre> <p>In another function:</p> <pre><code>if(some...
javascript
[3]
5,942,805
5,942,806
explanation of the following javascript
<p>currently stuck on a piece of code as im not sure what the below code does, can someone explain it to me</p> <pre><code>var limits = settings.show != null &amp;&amp; settings.show &lt; length ? settings.show : length; </code></pre>
javascript
[3]
4,146,159
4,146,160
Generate 2 arrays from an array
<p>i have an array like this, with x-coordinate and y-coordinate forming an individual entry.</p> <pre><code>$polygon = array("10 0", "20 5", "15 15", "22 15"); </code></pre> <p>Now how can i break this array into 2 different arrays, such that all x-coordinates will fall into one array and all y-coordinates will fall...
php
[2]
1,467,342
1,467,343
Could we work with percentual values? keep design in layout android
<p>wide range of products with Android OS. we have from 240x320 px to 640x480 px... Any suggestion to keep design in layout? What should i do? Could we work with percentual values? </p>
android
[4]
2,995,464
2,995,465
getting location from a background service, is this correct?
<p>I have a background service that is getting updates from the location manager every 5 minutes. When on locationChaged is called, I call a function in my activity to update the GeoPoint that holds my user location. This is working fine and does what I want. I am just unsure if it is better to use something like broad...
android
[4]
1,225,884
1,225,885
Platform Game - Getting the Object to adjust angle according to mouse position
<p>What I basically am going for is a platform game where you can advance through stages by getting past enemies and such. You will get different weapons as you advance and pick things up. I would like for these different weapons you pick up to be able to be pointed in the direction that the mouse is currently at.</p> ...
java
[1]
3,548,698
3,548,699
Special character validation in Password using Javascript
<pre><code>function SpecialCharacters(e) { var keynum var keychar var numcheck // For Internet Explorer if (e=window.event) { keynum = e.keyCode; } // For Netscape/Firefox/Opera else if (e.which) { keynum = e.which; } ...
javascript
[3]
1,581,922
1,581,923
One chance to get other interested in python
<p>This question is not technical, but is still about programming.</p> <p>What is the funniest, most interesting part of programming for someone who have never programmed? What do you do to light the programming interest on a adult person? I don't feel like talking about print, functions and loops will be a good way w...
python
[7]
1,537,657
1,537,658
Strange Javascript behaviour
<p>I am using JQuery to append images, like this:</p> <pre><code>$('#event_list_main').append('&lt;img class="listed_event" id="event_'+event_counter+'" data-count="'+event_counter+'" src="final_tutorial_buttons/event.png" height="50" width="50" onclick="highlight();" /&gt;'); </code></pre> <p>I am assign a <code>hig...
javascript
[3]
887,771
887,772
null pointer exception : println needs a message in android
<p>in my media player i play a song from sdcard. it shows error as null pointer exception : println needs a message e in android. i tried long time but i do not know the reason .please assist me.</p> <p>code:</p> <pre><code> try{ mediaPlayer = new MediaPlayer(); mediaPlayer.setDataSource("/sd...
android
[4]
3,090,021
3,090,022
operations on 2-D arrays
<p>How to claculate the sum or product of each row and column separately in a 2-d array.</p>
c++
[6]
4,811,104
4,811,105
overflow button on jellybean
<p>I am developing an application with target Sdk 17. My current device is Nexus 7.<br> My app should be without an action bar so I am using the theme <em>Theme.Holo.NoActionBar</em> on the activity.</p> <p>I want to show the overflow button (3 dots) at the bottom right (next to the recent task). but I can't make it t...
android
[4]
4,830,702
4,830,703
UIButtons from different views add images to same view?
<p>So, I am building an application with different views. Each of them has a number of buttons. When pressing a button in a view, it should add an image to a addedImages view (the main one). How do I make a loop that will add the images dynamically according to the position of previously added images? Im quite new in t...
iphone
[8]
4,484,761
4,484,762
offline message in chat application C#
<p>Hai. I'm developing an office messenger app just like Network assistant (http://www.gracebyte.com/nassi/). One of the features is broadcasting message to all contacts in network. but i have problem in sending message to offline contact. i mean if there's one (or more) of my contacts is offline, but i still wanna sen...
c#
[0]
917,507
917,508
Changing relative layout programmatically
<p>I've relative layout i.e. <strong>main.xml</strong> which I set as follows. But now I've to put view1 on view2 with <strong>width=200dp and height =100dp</strong>, so that view2 will be large one and view1 will be small one on it.</p> <pre><code>public void onCreate(Bundle savedInstanceState) { ...
android
[4]
5,289,309
5,289,310
Cast string to date Java
<p>Any ideas why this isnt working?</p> <pre><code>DateFormat df = new SimpleDateFormat("dd/mm/yyyy"); Date date1 = null, date2 = null; String start, finish; System.out.println("Please enter a start date:"); while(date1 == null){ try{ start = scan.next(); date1 = (Date) ...
java
[1]
3,116,558
3,116,559
Accessing key names dynamically in a dictionary in python
<p><strong>Python{ 'Good' : '0', 'Bad' :'9', 'Lazy' : '7'} I need to access the key names dynamically in a program. Eg.</strong></p> <pre><code>a= raw_input (" which is the final attribute:") for i in python.items(): if python.items()[i] == a: finalAttribute = python.items()[i] </code></pre> <p><strong>Th...
python
[7]
121,401
121,402
compare datetime values just by date
<p>i wish to compare to datetime values just by date, not by hour. How can i do so ?</p> <p>I want to remove some values that are outside an interval selected by me :</p> <pre><code>if (DateTime.Compare(DateTime.Parse(t.Rows[i][1].ToString().Trim()), dateTimePicker1.Value) &lt; 0 || DateTime.Compare(DateTime.Parse(t....
c#
[0]
2,390,127
2,390,128
Python: Why does my function not display what's being returned in the interpreter?
<h1>In the Python interactive interpreter:</h1> <p>I am importing a module that contains a class. These are the methods of that class (some of them):</p> <pre><code> def do_api_call(self, params): return self.__apicall(params) def __apicall(self, params): return urllib2.urlopen(self.endpoint, ...
python
[7]
613,118
613,119
How to check the downloaded zip file is encrypted or password protected
<p>iam developing one application.In that Iam downloading the one zip file.So here my requirment is i need to check that file is encrypted or not and password protected or not .So please tell me how can i check that zip file is encrypted or not and passwordprotected or not.</p>
iphone
[8]
3,481,218
3,481,219
C++ How to access an object initialized in main() from outside of main()?
<p>My main() looks like this:</p> <pre><code> int main(int argc, char** argv) { // Initialize GLUT glutInit(&amp;argc, argv); ... glutDisplayFunc(display); ... // Set robot's parameters Robot robot; // Initialize global object robot robot.setSize(50); robot.setColor('G'); ...
c++
[6]
5,650,327
5,650,328
PHP: message box in the same page
<p>I have a form called orderform. now i want to order the equipment. after i ordered the things, the details are stored in the database, and the mail will sent to the server. i got the above mentioned processes. but it goes to the another page. I want all these process should be done with in the same page. that means ...
php
[2]
285,132
285,133
Which browsers support Microsoft JScript?
<p>Which browsers support Microsoft JScript?</p>
javascript
[3]
6,028,316
6,028,317
python change source code while running
<p>simple questions for those who know, pretty hard for me, as I think that it is not pratically possible.</p> <p>After making a simple python program, it is possible to run it on the computer's command prompt.</p> <p>I was wondering or it is possible to allow someone who runs it that way, to add an element to a list...
python
[7]
829,542
829,543
How to redirect a page using Javascript?
<p>My Scenario,</p> <p>We Have wriitten a javascript in click on image to open the curtain raiser.When its done it should redirect to a page in website.How do we achive this? Please Help</p>
javascript
[3]
4,284,407
4,284,408
New line with ConfigParser - PYTHON
<p>I have a config file using configParser:</p> <pre><code>&lt;br&gt; [ section one ]&lt;br&gt; one = Y,Z,X &lt;br&gt;&lt;br&gt; [EG 2]&lt;br&gt; ias = X,Y,Z&lt;br&gt; </code></pre> <p>My program works fine reading and proccessing these values. </p> <p>However some of the sections are going to be quite large, I need...
python
[7]
344,097
344,098
$_POST as a function parameter
<p>I've been working on a project for a game (so you'll understand that I can't post the actual script), and I'm cleaning up the code and placing code into functions instead of just after the "if ($_POST['name'] { //code }".</p> <p>Is this the correct method of doing what I'm trying? (I tried, but it broke my system)<...
php
[2]
5,258,174
5,258,175
How can I view a PHP file without having to upload it to my ftp?
<p>This is probably embarrassing short-sighted or just completely wrong, but I've made a header.php and a footer.php file and then an index.php file that calls them. Is there a way to view that index.php file from my desktop?</p>
php
[2]
673,677
673,678
Why does PHP 5.3.10 (fcgi) choke on this line?
<p>Why does PHP 5.3.10 (fcgi) choke on this line?</p> <pre><code>&lt;? echo $dadosboleto["ponto_venda"]." &lt;img src='imagens/b.png' width=10 height=1&gt; ".$tmp2?&gt; </code></pre> <p>Thanks in advance</p>
php
[2]
5,914,580
5,914,581
Add Button to C1 flex grid dynamically in C#.net
<p>How can i add a button to the rows of a <strong>c1 flex grid</strong> , Here the grid is created dynamically,, i have to created the button to all rows dynamically..please help</p> <p>NB: here the grid created at runtime, </p>
c#
[0]
5,482,096
5,482,097
Handling quick succession taps on overlay items
<p>I have created a map application to show near by places on the map.When the user clicks on the pin on the map a Alert dialog box pops up asking user to show the route.My problem is that when the pin is clicked many times at quick succession the message box is appearing more than once.I don't want that message to app...
android
[4]
5,590,172
5,590,173
"Cannot Find Symbol" in Sub Class Java
<p>I am trying to make a sub class named "<strong>public class Once</strong>" and am getting the error "<strong>Cannot Find Symbol</strong>" on the lines "<strong>return date</strong>;" and "<strong>return descript</strong>;". I know its probably something really stupid I am missing, but any help would be great.</p> ...
java
[1]
2,330,459
2,330,460
swipejs add class to current div
<p>i am using swipejs written in pure javascript from <a href="http://swipejs.com/" rel="nofollow">http://swipejs.com/</a>, however i am not really familiar with javascript. would like to know how can I detect the event and apply the class for current shown div. Something i want like this.</p> <pre><code>&lt;script&gt...
javascript
[3]
5,569,586
5,569,587
Canceling Threads
<p>I have an application that uses 20 threads. It's an email client that uses threads to mail from.</p> <p>Currently the threads are created in the main thread. But I am wondering, what if I want to cancel the whole operation? The only way I can see of doing it is killing the main thread ... thus ending the program.</...
c#
[0]