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
3,735,102
3,735,103
Timestamp has Decimal?
<p>I'm using the following code to get a timestamp in Javascript, but it's returning a decimal. When I checked the timestamp with an online converter it's actually correct. I've never seen this format before.</p> <pre><code>var currentTS = new Date().getTime() / 1000; </code></pre> <p>How can I get a whole number and...
javascript
[3]
4,321,522
4,321,523
Error for timeIntervalSinceNow using to pause and resume timer
<p>Using pause timer and resume timer in my code to pause and resume timer. Got error <code>'NSInvalidArgumentException', reason: '-[__NSCFNumber timeIntervalSinceNow]: unrecognized selector sent to instance 0x164590'</code></p> <p>code for pause timer and resume timer</p> <pre><code>-(void)pauseTimer{ pauseStart = ...
iphone
[8]
825,405
825,406
Cant find the android keytool
<p>I am trying to follow the Android mapping tutorial and got to this part where I had to get an API key <a href="http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint" rel="nofollow">http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint</a></p> <p>I have found...
android
[4]
4,158,419
4,158,420
how to clear the query string in PHP
<p>How to Clear the Query string.</p> <p>my query string is "index.php?name=sugumar&amp;id=49"</p> <p>using meta tag I redirect the same page. that time the query string values are not cleared. for that I have used. </p> <blockquote> <p>Request.QueryString[1] = string.Empty;</p> </blockquote> <p>but it shows the ...
php
[2]
2,343,065
2,343,066
Beginner, trying to setup Python
<p>I'm a PHP programmer, but I want to learn Python. I'm a bit confused with how to actually execute a script. I've created test.py in my web server root, in the file I've written:</p> <pre><code>#!/usr/bin/python import jon.cgi as cgi import jon.fcgi as fcgi print "Content-type: text/html" print "hello world" </code...
python
[7]
5,740,759
5,740,760
Create a byte array according to given String In Java
<p>I just need to create a byte array out of the given String.</p> <p>For example, if my String is <code>String ss = "21331UA";</code> then the byte array elements should correspond to them as follows.</p> <pre><code>2 1 3 3 1 U A </code></pre> <p>I could have created it statically as this. <code>byte[] arr = new by...
java
[1]
456,882
456,883
Searching List of Tuples by nth element in Python
<p>So I have a list of tuples, with 3 elements each. Both the second and third elements are ints. For a value n, I need to return all the tuples that contain n as either the second or third element. </p> <p>I'm not entirely sure how to do this, unfortunately. I'm sure it's not too complicated, but although there are s...
python
[7]
1,152,341
1,152,342
php header not forwarding ie9
<p>I use the following which works perfectly in all browsers, except ie9</p> <pre><code>$result = mysql_query("SELECT u_id, from users where (id = '$userID')",$db); $item = mysql_fetch_row($result); $how_many = mysql_num_rows($result); // if not a user send to reg if ($how_many &lt; 1){ header("Location: /pages/re...
php
[2]
5,497,935
5,497,936
copy and paste the file in swt
<p>I am having a zip file in my E:\temp\file.zip. Now I need to copy the whole zip file and paste it to my desktop and the original zip file should not be deleted. This should be done using java SWT lib.</p> <pre><code>import java.io.*; import javax.swing.*; public class MovingFile { public static void copyStream...
java
[1]
3,173,839
3,173,840
Is there a risk in running file_put_contents() on the same file from different PHP threads?
<p>I know <a href="http://us.php.net/file_put_contents" rel="nofollow">file_put_contents()</a> makes it really easy to append data to a file in PHP. I'd like to try using PHP "<a href="http://www.funkynerd.com/knowledgebase/articles/2" rel="nofollow">threads</a>" to <code>file_put_contents()</code> to the same log file...
php
[2]
484,311
484,312
JQuery and radio button help
<p>I have data being imported from a database and I would like to represent that data in a set of radio buttons. If the value in the database is 1 the "customer status" should show the "active" radio button else show the "inactive" button.</p> <p>I don't know much at all about JQuery but am learning day by day so any ...
jquery
[5]
5,687,756
5,687,757
php howto unset static var
<p>i have a function like this. i want reset the $output var first call.</p> <pre><code>function create_tree($tree_array, $reset = TRUE, $ul_class = FALSE) { if($reset) unset($output); // NOT WORK!!! static $output = ''; $class = ''; if ($ul_class) { $class = ' class="' . $ul_class . '"'; ...
php
[2]
2,446,714
2,446,715
Is possible to replace an expression with a text in PHP?
<p>For exemple, it's possible to replace</p> <pre><code>{'a1b2,left'} </code></pre> <p>with</p> <pre><code>&lt;img src="a1b2" class="left"/&gt; </code></pre> <p>in Php?</p>
php
[2]
2,397,028
2,397,029
Javascript if number < 10 add a "0"
<p>I made a simple countdown with javascript, here you can see a example:<a href="http://jsfiddle.net/PCwx8/" rel="nofollow">http://jsfiddle.net/PCwx8/</a></p> <p>It simply counts to today midnight. May problem is that i simply want that javascript adds a "0" to the numbers that are minor then 10. I have a idee like :...
javascript
[3]
1,740,330
1,740,331
Access JS object with a key
<p>I can access a value like <code>driver.my_friends["793659690"].name</code> but now I am using it in a loop where <code>key</code> will hold the key.</p> <p><code>driver.my_friends[key].name</code> doesn't work. Says undefined, and <code>driver.my_friends["key"].name</code> will look for a key named key. So how do I...
javascript
[3]
3,263,460
3,263,461
Jquery $.post issue
<p>I have below code that reads file name after browse and sends it to another page using POST. if i have alert after $.post, then it works fine. If I remove the alert message, then post is not forwarding the file name to another page. </p> <pre><code>&lt;input type="file" name="fileupload" id="fileupload" value=""&gt...
jquery
[5]
2,270,733
2,270,734
Liferay Login page redirect
<p>Hi every one i am new to liferay i ve developed my own page and when i click sign-in In main page i want to redirect to my custom page instead going to default home page.. can anyone pls suggest me how to do this where i should redirect it thanks in advance.</p>
java
[1]
82,943
82,944
clear value of text input if checkbox is checked restore value if unchecked using javascript
<p>I have a text field with an image value populated from database. I need to have a checkbox that would clear value when checked and restore value when unchecked.</p> <pre><code>&lt;input type="text" value="/images/sampleimage.jpg" /&gt; Remove this image &lt;input type="checkbox" name="remove"&gt; </code></pre>
javascript
[3]
719,491
719,492
How to get information about mobile service plans?
<p>Is there any way to get information by programming about the mobile service plan like call minutes limit or amount of MB from my internet data plan??</p> <p>Thanks!</p>
android
[4]
4,825,102
4,825,103
Help me with some c++ code
<p>I only want it to update server_record. Dont send any messgaes. What can I remove so it dont say "New record of players online is: 2839". Can I remove everything under query.str("");? I have no idea what char buffer[50]; do. I dont wanna mess anything up. And How can u get current time in c++? I want to insert the c...
c++
[6]
1,963,111
1,963,112
How to make ASPNETDB.mdf appear?
<p>Hi I recently started to learn asp.net.I know that when you drag a login control on the page and a register control asp generates a database called ASPNETDB.mdf.I also know that this database should be in App_Data.For some reason after I added the login control , register control and also selected the authentificati...
asp.net
[9]
3,650,591
3,650,592
I am converting a working .NET 4.0 application to .NET 3.5 with string.join
<p>I am converting a working .NET 4.0 application to .NET 3.5. Please, help me Here is the code:</p> <pre><code>NameValueCollection qs = new NameValueCollection(); qs["aid"] = "aaa"; qs["fields"] = "1"; qs["aaa"] = "d"; tb.Text = String.Join("&amp;", from item in qs.AllKeys select item + "=" + qs[item]); </code></pre...
c#
[0]
1,791,710
1,791,711
How can I find out when a picture was actually taken in C# running on Vista?
<p>In windows XP "FileInfo.LastWriteTime" will return the date a picture is taken - regardless of how many times the file is moved around in the filesystem.</p> <p>In Vista it instead returns the date that the picture is copied from the camera.</p> <p>How can I find out when a picture is taken in Vista? In windows ex...
c#
[0]
3,283,096
3,283,097
Convert Microsoft snp to pdf
<p>Can any body tell me is there any API in Java (1.5) which converts a Microsoft <a href="http://en.wikipedia.org/wiki/SNP_file_format" rel="nofollow">SNP</a> file to PDF format please?</p>
java
[1]
5,291,249
5,291,250
android menu press action for android-sliding-menu-demo
<p>I'm currently using this <a href="https://github.com/gitgrimbo/android-sliding-menu-demo" rel="nofollow">android-sliding-menu-demo</a> as sidemenu for my application. In this project, sidemenu can be only display when press icon at topbar but what I want is to display sidemenu when I press on menu button of android ...
android
[4]
1,458,451
1,458,452
Calling a new Form from a separate thread and avoid frozing the form
<p>I am currently creating a chat system. The receiving end of the client side is managed by a separate thread so that when it receives a message from another client, a new Form is loaded bearing the message of the sender. The problem is, the newly loaded form is frozen and is not responding [due to the blocked methods...
c#
[0]
3,398,886
3,398,887
Is CONSTANT.equals(VARIABLE) faster than VARIABLE.equals(CONSTANT)?
<p>I had an interesting conversation with one of my team mate.</p> <p>Is <code>CONSTANT.equals(VARIABLE)</code> faster than <code>VARIABLE.equals(CONSTANT)</code>in Java?</p> <p>I suspect this to be a false statement. But I am trying to figure out what should be qualitative reasoning behind this?</p> <p>I know in bo...
java
[1]
1,173,615
1,173,616
C++ Calling Static Function pointer with Predefined parameters
<p>I have a rather unusual problem... we are tasked with mapping a series of hexadecimal values to function pointers. However, I want to be able to call the function with already predefined parameters. Here is a segment of code that I am trying to get to work:</p> <pre><code>map&lt;short, void(*)(MyClass, MyClass)&g...
c++
[6]
3,467,075
3,467,076
how to simulate timeout on Ie 8?
<p>one of my user has time out issue on my website - where in my php script takes more than 30 seconds to execute, her IE times out and shows an IE error message.</p> <p>But it never does to me - my IE will continously just wait even if i let my PHP script to sleep for 6 minutes. </p> <p>Is there any way to set the t...
php
[2]
2,930,924
2,930,925
How this is code is getting compiled even though we are using a constant which is defined later?
<p>In the following code DEFAULT_CACHE_SIZE is declared later, but it is used to assign a value to String variable before than that, so was curious how is it possible?</p> <pre><code>public class Test { public String getName() { return this.name; } public int getCacheSize() { return this.cacheSize; } public...
java
[1]
3,971,016
3,971,017
how to initialize static ArrayList<myclass> in one line
<p>i have myclass as</p> <pre><code>myclass(String, String, int); </code></pre> <p>i know about how to add to add to ArrayList in this way:</p> <pre><code>myclass.name = "Name"; myclass.adress = "adress"; myclass.age = age; </code></pre> <p>then add to arrayList like:</p> <pre><code>list.add(myclass); </code></pre...
java
[1]
4,372,888
4,372,889
Difference between function(){ and function(e){
<p>What is the difference between function(){ and function(e){? All over the web, i have seen in lot of places like,</p> <p><code>$('element').bind(function(){});</code></p> <p>and</p> <p><code>$('element').bind(function(e){});</code>.</p> <p>But can anyone differentiate this clearly? So that i can understand that....
jquery
[5]
1,090,817
1,090,818
Overriding the hardware buttons on Android
<p>Is it possible to override the function of a hardware button programmically on a droid? Specifically, I'd like to be able to override the camera button on my phone programmically. Is this possible?</p>
android
[4]
4,529,410
4,529,411
adding duplicate type of column to a datatable
<p>How can i add same fields for columns in a datatable. I wan to make a datatable which repeate column name of same type multiple times, but dot net dont allow me to add that, but i want to do that hw can i do that?</p> <pre><code>table.Columns.Add("S.NO", typeof(int)); table.Columns.Add("DC", typeof(stri...
asp.net
[9]
1,065,634
1,065,635
jQuery treat hover on two elements as one elements
<p>I have an image map which I have overlaid with some markers in the form of anchors. I currently have a hover trigger on each image map area and the associated anchor - as shown in screen shot <img src="http://i.stack.imgur.com/gMF3C.png" alt="enter image description here"></p> <p>I need to treat these two elements ...
jquery
[5]
843,828
843,829
Media Formats in Android?
<p>What is the Difference between Encoder and Decoder in <a href="http://developer.android.com/guide/appendix/media-formats.html" rel="nofollow">Supported Media Formats</a> in android? What is the Need of it? Which is the recommended image Format by you?</p>
android
[4]
5,110
5,111
android custom button with default selector
<p>I have a listview in which i have an image and text content getting populated from the java code.</p> <p>I'm unable to get the default orange selector working on the image. The image is placed ontop of button as <code>setBackgroundResource()</code> from Java.</p> <p>Can anyone help me with the same?</p>
android
[4]
5,994,034
5,994,035
Way to shorten jquerycode
<p>I have several modal popup windows which all use the same settings. One of these requires the following code.</p> <pre><code>var $modal = $('#modal') .attr('id', 'modal') .css({zIndex: 3000}); $('#modal-trigger').click(function(evt) { evt.preventDefault(), $('#modal').css("visibility","visible"); $(this)....
jquery
[5]
4,149,548
4,149,549
Illegal Cross Thread Operation error
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/606642/help-needed-for-cross-thread-operation-error-in-c-sharp">Help needed for &#39;cross-thread operation error&#39; in C#</a><br> <a href="http://stackoverflow.com/questions/5868783/solve-a-cross-threading-exce...
c#
[0]
5,336,849
5,336,850
how to send email in iphone SDK?
<p>how to send email in iphone SDK? any example tutorial to take email address from iphone also?</p>
iphone
[8]
5,670,007
5,670,008
using $this or parent:: to call inherited methods?
<p>Not really a problem, more like curiosity on my part but as an example, say I have a php class:</p> <pre><code>class baseTestMain { protected function testFunction() { echo 'baseTestMain says hi'; } } </code></pre> <p>and another class that extends from that class above:</p> <pre><code>class a...
php
[2]
417,917
417,918
Get Substring - everything before certain char
<p>I'm trying to figure out the best way to get everything before the - character in a string. Some example strings are below. The length of the string before - varies and can be any length</p> <pre><code>223232-1.jpg 443-2.jpg 34443553-5.jpg </code></pre> <p>so I need the value that's from the start index of 0 to ...
c#
[0]
3,930,721
3,930,722
Does exit($status) violate the single responsibility principle?
<p>The <a href="http://www.php.net/manual/en/function.exit.php" rel="nofollow">the PHP manual page</a> about the exit construct states:</p> <blockquote> <p>exit — Output a message and terminate the current script</p> </blockquote> <p>Based on that, would it be correct to think that it violates <a href="http://www.c...
php
[2]
2,107,020
2,107,021
How do I select an input by it's value after a value is entered using jQuery?
<p>See my example below. I'm trying to enter Mike into the input and then hit "remove input" to remove the input from the page. It doesn't seem like the value is updated in the DOM when a user types a value. How can I get around this?</p> <p>Example: <a href="http://jsfiddle.net/ZMSaD/" rel="nofollow">http://jsfidd...
jquery
[5]
1,849,335
1,849,336
Calculating shift hours worked
<p>I'm am trying to calculate the hours for someone based on the number of hours worked and the time period in which they worked.</p> <p>For example: </p> <p>The shift patterns are 07:00 to 15:00 is 'morning', 15:00 to 23:00 is 'afternoons', and 23:00 to 07:00 is 'nights'.</p> <p>Therefore if I started at 08:00 and ...
php
[2]
2,966,115
2,966,116
Difference between androidannotations and droidparts frameworks?
<p>I'm just starting to learn about android, but already have a question:</p> <p><a href="http://droidparts.org/parts/di.html" rel="nofollow">AndroidParts</a> and <a href="https://github.com/excilys/androidannotations/wiki" rel="nofollow">AndroidAnnotations</a> frameworks looks very similar. Which one is better to use...
android
[4]
5,200,713
5,200,714
how to find if a control inherited from a base type?
<p>i want to disable validation controls on some conditions. how can i find that a control is inherited from "BaseValidator"?</p> <p>note all validator controls are inherited from BaseValidator <a href="http://www.startvbdotnet.com/aspsite/controls/validation.aspx" rel="nofollow">(+)</a></p>
asp.net
[9]
2,580,259
2,580,260
Datacall channel implementaion in android
<p>I want to know if datacall channel can be implemented in android. IS it possible to do it in the application level? If so what are the available APIs in android?</p>
android
[4]
4,009,809
4,009,810
How to get rid of the file type when using getName()?
<p>Only doing this because I am lazy. I just wrote a program to list all my music into an excel file.</p> <pre><code> import java.io.*; import org.apache.commons.io.FileUtils; public class NewClass { public static void main( String args[] ) { File folder = new File("C:/Users/Pu...
java
[1]
1,235,075
1,235,076
java.util.NoSuchElementException No Such Element Exception
<p>New to Java - just trying to get a handle on it. The program is executing as follows:</p> <pre><code>What's your age?23 23 What's your name?Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at king.getName(...
java
[1]
4,169,625
4,169,626
install curl extension fail
<p>I try to install php curl extension in my win xp environment but failed. To follow the manual ,I have copied libeay32.dll and ssleay32.dll into %systemroot%/system32 dir ,the ';' in front of 'extension=php_curl.dll' also has been opened but in the test function phpinfo(), there is still not any clues </p> <p>but t...
php
[2]
295,404
295,405
jQuery - addClass() mouseover
<p>I have a jQuery effect where if the user mouse over the reply image, the image would change to another image. The problem I am having is that when you mouse over another object, which is set to addClass() for the reply image, this new reply image does not change its image when mouseovered. </p> <p>Demo of my proble...
jquery
[5]
384,795
384,796
JQuery Tabs Custom CSS
<p>I need to apply Custom CSS for jquery tabs.... I have two Jquery tab panels on single View...How to apply diffrent CSS for both Tab panels</p> <p>Css for Selected and hover and default </p> <p>Please give me suggestion</p> <p>Thanks Narasimha</p>
jquery
[5]
3,748,764
3,748,765
What is Difference between using the Scanner class in Java for input and using Strings Args[] with parseint?
<p>What is the difference between the following</p> <pre><code>import java.util.Scanner; //Creating the scanner Scanner input=new Scanner(System.in); System.out.println("Enter the number 1"); int number1=input.nextInt(); </code></pre> <p>vs</p> <pre><code>int number1=parseInt(args[0]); </code></pre>
java
[1]
3,140,522
3,140,523
How should this be achieved? Activity/ActivityGroup or ViewFlipper?
<p>I have a ListView with let's say 5 items. When I click on one of these it automatically start a new activity based on the position of my ListView.</p> <p>Then, in the new activity, it shows like "1 of 5".</p> <p>I have two buttons (back and next) to show 2 of 5 etc, but how should I implement so it loads new conte...
android
[4]
4,429,777
4,429,778
play a wav file c# code
<p>How can I play a wav file to a another computer? I know i have to send the wav file as a buffer on the out device. Can someone give a short eq in c#?</p>
c#
[0]
571,068
571,069
key value style javascript array`s length keeps being 0
<p>I fill my key value array like this:</p> <pre><code>/** * Callback: Gets invoked by the server when the data returns * * @param {Object} aObject */ function retrieveStringsFromServerCallback(aObject){ for(var i = 0;i &lt; aObject['xml'].strings.appStringsList.length;i++){ var tKey = aObject['xml'].st...
javascript
[3]
1,012,135
1,012,136
ASP.NET + QueryString Encoding Problem
<p>I'm passing query string parameter to .aspx page with 'Ñ' character in value. But Request.QueryString returns some other box '[]' character in return. I think this request encoding issue. and I do not want to use that HttpUtility.UrlDecode and HttpUtility.UrlEncode methods.</p> <p>Does anyone know how to solve this...
asp.net
[9]
1,562,813
1,562,814
timer.scheduleAtFixedRate is executed in a second not after delay time
<p>i am using timer like:</p> <pre><code>Timer timer = new Timer(); timer.scheduleAtFixedRate(new CheckWifi(), 0, 50000); // 5 seconds class Wifi extends BroadcastReceiver { protected class CheckWifi extends TimerTask { @Override public void run() { } } </code></pre> <p>but <code>CheckWif...
android
[4]
4,628,996
4,628,997
Not able to unlock screen in android
<p>I am able to lock a screen in android using Device policy manager. It will lock a screen even when the user is in other applications(Globaly). Same thing i want to do with Unlock. My application unlocks a screen when user locks a screen within my application. But when user locks a screen with other application it is...
android
[4]
5,661,201
5,661,202
how to add the integer values using foreach in php
<p>I just want to know the syntax of adding the quantity using <code>foreach</code>. Any help is greatly appreciable.</p> <p>Here is the code what I do so far:</p> <pre><code>$qproducts = '0'; foreach ($this-&gt;cart-&gt;getProducts() as $product) { $qproducts .= $product['quantity']; } $this-&gt;data['p...
php
[2]
5,084,837
5,084,838
How can I check that username contains only english letters, punctuation and digits?
<p>How can I check that username contains only english letters, punctuation symbols and digits?</p> <p>Thank you.</p>
php
[2]
4,915,275
4,915,276
In Java, how to get attribute given the string with its name?
<p>I'm sorry for asking this sort of questions, but I really couldn't find the answer in Google. So say I have a class with <code>private String myColor</code> and I have a string "myColor". Now I want to manipulate the <code>myColor</code> attribute. How can I do that?</p> <p><strong>Edit:</strong> Sorry for an uncl...
java
[1]
2,706,354
2,706,355
Time Consuming to occur error when not able to reach the URL
<p>I have connected to my web service hosted in remote machine using ksoap protocl.But when connection to that url is not reachable it took time to occur exception.Is there any way to set timeout for making a connection in the ksoap.</p> <p>The code i have written is given below.</p> <pre><code>String SOAP_ACTION = "...
android
[4]
4,378,470
4,378,471
what does this mean: var _gaq = _gaq || [];
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/3088098/in-javascript-what-does-it-mean-when-there-is-a-logical-operator-in-a-variable-d">In Javascript, what does it mean when there is a logical operator in a variable declaration?</a><br> <a href="http://stack...
javascript
[3]
371,309
371,310
Search a file that was created
<p>When I create the file and append to it the rest of the information I now want to have the ability to read the text file then display the Month of a birthday thats listed in the file. I want to be able to pull in just the info by birthday. So if I choose month 11 I want to pull in all the data entries that have a bi...
c#
[0]
5,427,207
5,427,208
How to give input for the double[] array in Java
<p>How do I give input directly, when that function is invoked in another method, especially when that input is a <code>double[]</code> array?</p> <pre><code>public double dotPro1(double[] vectorA, double[] vectorB) { double[] vecPro; vecPro = new double[2]; vecPro[0] = vectorA[0]*vectorB[0]; vecPro[1]...
java
[1]
5,063,476
5,063,477
condition with eval {php}
<pre><code>&lt;?php eval("if (1==1){"); echo ('abc'); eval("}"); ?&gt; </code></pre> <p>Then i get a error : Parse error: parse error in C:\wamp\www\test\index.php(2) : eval()'d code on line 1 abc Parse error: parse error in C:\wamp\www\test\index.php(4) : eval()'d code on line 1<br> How to fix?</p>
php
[2]
5,051,259
5,051,260
Renaming a File
<p>In my application there is a file available that<br> Say <strong>one.pdf</strong>. I want to change the file name as <strong>two.pdf</strong> with in the same directory. <br>i tried using java which doesn't Work. </p> <pre><code>File f1=new File("E:\\one.pdf"); File f2=new File("E:\\two.pdf"); f1.renameTo(f2); </...
java
[1]
2,494,916
2,494,917
Build Java application from .net perspective
<p>I have been a .net developer for some time now and recently started using java and eclipse.</p> <p>Up until now i've been executing a little test app by right-clicking in Eclipse and "Run As-> Java Application".</p> <p>Everything works fine until i go to try set this up so i can deploy it to another machine.</p> ...
java
[1]
1,427,831
1,427,832
Cycle through array
<p>Supposing I had an array with 4 elements, and I want to cycle through them until a certain condition is met, what would the best way I would have to do so? My idea would be something like:</p> <pre><code>ArrayList&lt;Player&gt; myList = new ArrayList&lt;Player&gt;(); myList.add(new Player("a")); myList.add(new Play...
java
[1]
3,816,104
3,816,105
How can I calculate at compiletime in c++
<p>How to calculate some mathematical expression i.e. finding factorial of n; during compiletime in c++ ?</p>
c++
[6]
192,357
192,358
Impersonation in ASP.NET 2.0
<p>Good Day,</p> <p>My web app is set to use Windows Authentication and Impersontation is set to true.</p> <p>I wan't to launch a process using the logged-in user account. However, when I tried to launch notepad.exe, it was run as a NETWORK SERVICE.</p> <p>I've tried different impersonation techniques, but none of t...
asp.net
[9]
581,323
581,324
how to prevent multiple clicks on an executable jar
<p>I have an executable jar that runs a Java Swing application with an internal SqlLite db. Users (by mistake) do more than a click on the jar, causing the db lock. I'd like to prevent this behavior. What can I do? thank you very much</p>
java
[1]
1,621,316
1,621,317
How to Map Paths in ASP.NET Non-Form Class File
<p>I've been using the following code in my Web form code-behind classes. I want to use it in my regular .cs files: for example, when making database calls. But when I try to use it outside of a Web form I get the following error when attempting to map with base.Request.ApplicationPath: 'object' does not contain a defi...
asp.net
[9]
838,873
838,874
Implement the strcmp(str1, str2) function in c#
<p>I have the following homework problem:</p> <blockquote> <p>There are many ways one can implement the strcmp() function.<br> Note that strcmp(str1,str2) returns a negative number if str1 is alphabetically above str2, 0 if both are equal and postiveve if str2 is alphabetically above str1.</p> <p>In it can ...
c#
[0]
3,000,126
3,000,127
python first web application - where
<p>I am rookie in python - have experience in PHP</p> <p>my service provider (Bluehost) say that python 2.6 is available, however I am not able to run any script (basic hello word) on it - probably because I try do it PHP way. create a script.php file and place the link to it in browser... :)</p> <p>Where I can find...
python
[7]
3,441,080
3,441,081
How to pass a class instance dynamically?
<p>What is wrong with the following android java code</p> <pre><code>Class&lt;?&gt; c = Class.forName(PACKAGENAME+"."+className); Constructor&lt;?&gt; cons = c.getConstructor(String.class); Object object = cons.newInstance(result); </code></pre> <p>i want it to call a constructor of one parameter. </p>
java
[1]
5,611,684
5,611,685
Is there a function like "bcadd" except it performs multiplication?
<p>I'm hoping to do some math operations on numbers being represented as strings. So far, I haven't found anything that could do multiplication.</p> <p>Thanks!</p>
php
[2]
5,964,886
5,964,887
setTimeout() doesn't allow me to pass text values
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1190642/how-can-i-pass-a-parameter-to-a-settimeout-callback">How can I pass a parameter to a setTimeout() callback?</a><br> <a href="http://stackoverflow.com/questions/6081560/is-there-ever-a-good-reason-to-pass-a...
javascript
[3]
3,959,837
3,959,838
show timer in label
<p>As in most games i hv seen the timer in a format "01:05"</p> <p>I m trying to implement a timer, and on reset i need to reset the timer to "00:00".</p> <p>This timer value should be in label.</p> <p>How to create a timer which is incrementing? like 00:00---00:01---00:02..........somthing like dat.</p> <p>suggest...
iphone
[8]
1,777,694
1,777,695
jquery to change image src of current row only
<p>I have a table with multiple rows that all have the same class. When an image is clicked, there's a db call then returning json. I have everything working correctly but when I click the image, ALL in the table change. I would only like the current row image to be affected.</p> <p>Example Table:</p> <pre><code>&lt;...
jquery
[5]
297,258
297,259
How to force close my Android application?
<p>Well apparently my android application doesnt close when I finish the activity so it there a way to force close it including any activity in my app that could be opened?</p>
android
[4]
5,845,422
5,845,423
reuse function logic in a const expression
<p>I think my question is, is there anyway to emulate the behaviour that we'll gain from C++0x's <code>constexpr</code> keyword with the current C++ standard (that is if I understand what <code>constexpr</code> is supposed to do correctly).</p> <p>To be more clear, there are times when it is useful to calculate a valu...
c++
[6]
4,930,525
4,930,526
Tabletool Icon Removes Select entries from toolbar
<p>Hi I am using below code to display tabletool in datatable, everythings work perfectly but tabletool icons remove Select entry icon, any idea how can i display both in same div.</p> <pre><code> $(document).ready(function () { $('#tblOscarNominees').dataTable({ "bJQueryUI": true, "s...
asp.net
[9]
704,059
704,060
Question about focus and activites on Android
<p>I have a chat application here that uses a handler and a runnable to frequently poll for updates. On receiving an update as HTML, it adds this content to the TextView in the main activity.</p> <p>Now, I've noticed that when the activity loses focus and I use other applications/view the home screen, the runnable kee...
android
[4]
455,281
455,282
jQuery backgroundPostion and animate can't only get the Y
<p>I have a problem. I have this 3060 px wide image as my background-image, and when I press a menu link I want to 'slide' the background to the right or left, but when I'm doing this I can only get it to use the X. If I use backgroundPositionX, it doesn't do anything. When I use backgroundPosition, though, I can only ...
jquery
[5]
4,534,346
4,534,347
Handling different datatypes in a single structure
<p>I need to send some information on a VxWorks message queue. The information to be sent is decided at runtime and may be of different data types. I am using a structure for this - </p> <pre><code>struct structData { char m_chType; // variable to indicate the data type - long, float or string long m_lData; //...
c++
[6]
4,611,912
4,611,913
Is it possible to do all these on an Android phone?
<p>I am wondering is it possible to do all these on an Android phone? Example, Samsung Galaxy S phone</p> <ol> <li>To automatically launch a video clip upon phone start up i.e. from off position or phone ‘reboot’/’restart’</li> <li>To run the video clip while the phone is idling</li> <li>To launch to a particular wap ...
android
[4]
3,451,824
3,451,825
Change the name of the radiobutton in the gridview while render
<p>After render group name comes in the name attribute with different name for each radiobutton in the gridview.</p> <p>I tried to set all the names as same. But when we see the source in the browser it is unique.</p> <p>How to change the name for all the radiobutton in the gridview as same.</p> <pre><code>protected...
asp.net
[9]
2,000,859
2,000,860
Clearing value before submitting form (not canceling submit)
<p>I want to clear my default value in two input fields before submitting them. But this don’t work…</p> <pre><code>&lt;form action="page.html" id="myForm"&gt; &lt;input type="text" value="Firstname" name="firstname" id="firstname"&gt; &lt;input type="text" value="Lastname" name="lastname" id="lastname"&gt; ...
jquery
[5]
3,198,869
3,198,870
SendInput putting the system to sleep
<p>I'm trying to figure out the proper use of the SendInput function so I can directly manipulate the cursor on the screen, so for a basic test to see how things work, I made this short snippet that should move the cursor 10 pixels to the right. In theory.</p> <pre><code>#include &lt;windows.h&gt; #include &lt;winable...
c++
[6]
3,927,426
3,927,427
Changes being made to an object in Java
<p>I have created a Compound class that holds the number of Carbon, Hydrogen, Oxygen, Nitrogen and it's bond count. I have a stack that holds these objects. </p> <p>Initially the stack will start off at empty and I will pop that. Then I will apply addHydrogen function to it so it's Hydrogen will = 1, Oxygen=0, Nitroge...
java
[1]
2,065,072
2,065,073
How to get the Information of the Music track playing on a android device?
<p>I want to get the Information of the Music track playing on a android device? Is there any android powered api available for this?</p> <p>Or do I have to write a plugin for respective android media players?</p>
android
[4]
5,121,691
5,121,692
jquery set value of div
<p>I have this div:</p> <pre><code> &lt;div style="height:100px; width:100px" class="total-title"&gt; first text &lt;/div&gt; </code></pre> <p>and I have a jquery statement to change its value:</p> <pre><code> $('div.total-title').html('test'); </code></pre> <p>But it doesn't work.</p>
jquery
[5]
3,934,207
3,934,208
Pointer to function won't compile
<pre><code>//mediafactory.h class MediaFactory{ public: typedef Media* (*funPointer)(); funPointer somePointer; } //mediafactory.cpp Media* MediaFactory::returnMedia(){ } </code></pre> <p>when I try to do</p> <pre><code>somePointer = returnMedia; </code></pre> <p>I get this error:</p> <pre><code>1 ...
c++
[6]
2,760,768
2,760,769
Javascript contains statement
<p>I'm trying check a field in a database to see if it does not contain either "UK_CONTACTS or a blank. If it is either of these conditions I want to copy the that field to another field. I am very very new at this and have come up with the following and have written in text "does not contain" as I don't know the corre...
javascript
[3]
3,805,879
3,805,880
character counter in 2D array
<p>I tried to create a 2D array and place four <code>X</code> in the same column. I created a loop for detecting and counting the number of <code>X</code>s but it doesn't work.</p> <pre><code> var creatematrix = function (nbRang, nbColumn) { var result = Array(nbRang); for (var i=0; i&lt;nbRang; i++) { ...
javascript
[3]
4,489,626
4,489,627
How do I iterate over a Python dictionary, ordered by values?
<p>I've got a dictionary like:</p> <pre><code>{ 'a': 6, 'b': 1, 'c': 2 } </code></pre> <p>I'd like to iterate over it <em>by value</em>, not by key. In other words:</p> <pre><code>(b, 1) (c, 2) (a, 6) </code></pre> <p>What's the most straightforward way?</p>
python
[7]
5,382,683
5,382,684
How to disable/enable all children on LinearLayout in Android
<p>Is there way by programming that all the children of a certain layout? </p> <p>For example i have this layout with two children: </p> <pre><code>&lt;LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="fill_parent"&gt; &lt;SeekBar android:layout_he...
android
[4]