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,150,327 | 4,150,328 | how to stop activity recreation on screen orientation? | <p>how i can stop the restarting or recalling of on create() on screen orientation ,i want to stop the recreation of activity on screen orientation. thanks in advance please tell me any better solution its really creating a problem. like in my program i am selecting some picture but on screen orientation the image goes... | android | [4] |
4,221,253 | 4,221,254 | Using a Seekbar declared in one activity in a class that extends application | <p>I am currently trying to find a way of using a seekbar I created a tab host activity i.e
<code>seekBar1 = (SeekBar) findViewById(R.id.seekBar1);</code></p>
<p>in a class that extends application, as I need to add it to a singleton object in the class. (So the singleton object can listen for it)
Currently I am tryin... | android | [4] |
711,312 | 711,313 | Extracting last two characters from a numeric string | <p>Okay. Say I have string</p>
<pre><code>'193'
</code></pre>
<p>And I want to remove the last numbers and store them in an array so I can do operations with them. I know substr can delete the 2 characters, but I'm not sure how to store them after they've been removed..</p>
| php | [2] |
4,101,740 | 4,101,741 | How to Refresh GridView in C#.Net Windows Form? | <p>I'm trying to Refresh GridView after data inserted.
In ASP.Net GridView1.DataBind().That's work.
But I don't know how to do that in C#.Net Windows Form.
Please answer me if you know.
Thanks.</p>
| c# | [0] |
2,311,063 | 2,311,064 | operator delete standard behavior | <p>I can't understand what standard need to do with calling operator delete for void* == nullptr.</p>
<p>Something like this:</p>
<pre><code>void foo(void* ptr) // ptr == nullptr here
{
delete ptr;
}
</code></pre>
<p>On the one hand, we have the following statement in standard:</p>
<p><strong>ISO/IEC 14882:2011... | c++ | [6] |
2,207,699 | 2,207,700 | Javascript: [] = 5, No Syntax Error? Why? | <p>Yeah, it works in my firebug console. Why does something like this present no syntax error?</p>
<pre><code>[] = 5; [] = doThis(); [] = (function() {})();
</code></pre>
<p>Just curious about why it's allowed.</p>
| javascript | [3] |
4,707,927 | 4,707,928 | Is there a way to preserve duplicate keys in python dictionary | <p>is there any way to store duplicate keys in a dictionary?</p>
<p>I have a specific requirement to form pairs of requests and responses. </p>
<p>Requests from a particular node to another particular node form same keys. I need to store both those.</p>
<p>But if I tried to add them to dictionary, first one is being... | python | [7] |
757,329 | 757,330 | Android create custom IM type | <p>In my android application I want to create a custom type of IM that should be editable via standard contacts editing application. There are several built-it IMs that user can select from: Aim, Windows Live, Yahoo, etc. I want to add "My Very Best IM" to the list, so that user can pick it quickly without the need to ... | android | [4] |
5,570,467 | 5,570,468 | println(char), characters turn into Chinese? | <p>Please help me to troubleshoot this problem.</p>
<p>A have an input file 'Trial.txt' with content "Thanh Le".</p>
<p>Here is the function I used in an attempt to read from the file:</p>
<pre><code> public char[] importSeq(){
File file = new File("G:\\trial.txt");
char temp_seq[] = new char[100];
... | java | [1] |
2,520,641 | 2,520,642 | Alert Dialog in android | <p>In my application I used an alert dialog box to show 'connection error' message if API call fails.
API calls are written with in an AsyncTask. While API is called 'loading' dialog is shown, onPostExecute I will dismiss this 'loading' dilaogue , after that if the API call fails I will show the 'connection error' mess... | android | [4] |
1,018,991 | 1,018,992 | Input String was not in correct format in asp.net | <p>We've been facing an issue while saving our page. It throws "Input String was not in correct format". After trying so many time, we found there was no problem with the code, but with the "Cache (Temporary Internet File"). After Cache was cleared, it saved without any error. Does anyone knew the reason behind it?</p>... | asp.net | [9] |
3,801,591 | 3,801,592 | how can i fix this Javascript with to document write on multiple location.href.indexOf | <p>how can i fix this JavaScript with to document write on multiple <code>location.href.indexOf</code></p>
<pre><code>if (location.href.indexOf( "/smispage""/tpfpage""/client_images_new""/client_images_list" ) > -1) {
document.write( '<base target="_blank" />' );
}
</code></pre>
<p>It only seems to work ... | javascript | [3] |
751,173 | 751,174 | sqlite3 connection and holding onto it during the lifetime of the app | <p>I am following the 'SQLiteBooks' sample to understand how to work with sqlite3 for the iPhone and am wondering if the connection to the database should be closed immediately after you do a query and reopened each time you need to talk to the db or should the connection be kept open at the start of the app and close ... | iphone | [8] |
5,303,529 | 5,303,530 | Submit html form via Window form | <p>I need to automize login process of a widsite.
After googling for a while, I wrote this code.
But the problem is after running this code, no errors, no output.
I am unable to know where I went wrong.</p>
<pre><code>private void Form1_Load(object sender, EventArgs e)
{
WebBrowser browser = new W... | c# | [0] |
2,835,577 | 2,835,578 | How pass data to parent window from iframe? | <p>I using 3 .asp pages</p>
<p>Page 1 :Parent.asp
page 2 :Subparent.asp
Page 3 :Child.asp</p>
<p>using javascript in the child.asp. I wand to pass data from Child window(iframe) to Parent window</p>
<pre><code><title>parent.asp</title>
<html>
<body>
<iframe name="I1" frameborder="0" scroll... | javascript | [3] |
4,312,819 | 4,312,820 | Best online resource to learn Python? | <p>I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?</p>
<p>[Response Summary:] </p>
<p>Some Online Resources:</p>
<p><a href="http://docs.python.org/tut/tut.html" rel="nofollow"> <... | python | [7] |
5,461,018 | 5,461,019 | Tightly Encapsulated Class | <p>This is my homework question :
Which among the following classes is NOT Tightly Encapsulated?</p>
<pre><code>class A
{
private int x;
}
class B
{
private int x;
public void setX(int x)
{
this.x=x;
}
public int getX()
{
return x;
}
}
class C
{
private int x;
p... | java | [1] |
4,812,032 | 4,812,033 | How to validate a string from a set of permuted values with fixed prefixes in C# | <p>I have a variable which I have to validate at server side.
The field should be like Thh, Qhh, Bhh where 'h' is a hex digit in the set {02, 82, 03, 83, 04, 84, 05, 85, 06, 86, 07, 87}</p>
| c# | [0] |
4,428,037 | 4,428,038 | Strongly typed dataset Adapter.Update not inserting row | <p>I have the following code which (according to a <a href="http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspx" rel="nofollow">guide</a>) should insert a record into my strongly typed dataset and in turn my database. However, the record is not entered into the database but is correctly entered into the data... | c# | [0] |
1,657,242 | 1,657,243 | how to assing values into global array inside a function? (php) | <p>I have a function that searches for a string inside a text file. I want to use the same function to assign all lines to an array in case I am going to replace that string. So I will read the input file only once.</p>
<p>I have the search function working but I do not know how to deal with the array thing.</p>
<p>t... | php | [2] |
4,770,666 | 4,770,667 | General C++ Performance Improvement Tips | <p>Could someone point me to an article, or write some tips right here about some c++ programming habits that are generally valid (no real drawbacks) and improves performance? I do not mean programming patterns and algorithm complexity - I need small things like how you define your functions, things to do/to avoid in ... | c++ | [6] |
3,851,815 | 3,851,816 | PHP - Sphinx Search Integration Issues | <p>I have installed sphinx.0.9.9 in my LINUX server, and tested the application in terminal. It is working, when i tried to use the sphinxapi.php, I'm getting the following issue. "Query failed: connection to localhost:9312 failed (errno=111, msg=Connection refused). ". Can anybody help me to figure out this issue</p>
... | php | [2] |
4,233,219 | 4,233,220 | using less than calculation in php mysql | <p>i have three dates to compare:</p>
<pre><code>$pDate = date("d/m/Y G:i A");
$lDate = new DateTime('last wednesday G:i A');
$cDate = new DateTime('next tuesday G:i A');
</code></pre>
<p>if <em>$pDate</em> is in between <em>$lDate</em> and <em>$cDate</em> then mysql table field is updated yes</p>
<p>i.e. the 9th is... | php | [2] |
4,064,756 | 4,064,757 | Application Process still around after app is closed | <p>I have an application that I suspect might be leaking a thread or its context. What makes me think so is that after closing the app, the process is still running (visible process monitoring applications). I've cut everything in the code, going as far as calling finish() from the onCreate. The process is still around... | android | [4] |
2,938,345 | 2,938,346 | Correct syntax for setting object's property to return value of an object-function? | <p>I'm learning javascript and was going through an example here:
<a href="https://developer.mozilla.org/en/A_re-introduction_to_JavaScript" rel="nofollow">https://developer.mozilla.org/en/A_re-introduction_to_JavaScript</a></p>
<pre><code>function personFullName() {
return this.first + ' ' + this.last;
}
fu... | javascript | [3] |
5,237,806 | 5,237,807 | C# How to detect whether there is a '/' character? | <p>I have three IP addresses from serial port in one string. For example the string is like <code>192.168.1.1/192.168.1.12/192.168.1.118</code>. How do we detect the '/' character so that we can split this string into 3 IP address string and put each one into IP1 string, IP2 string and IP3 string?</p>
| c# | [0] |
888,903 | 888,904 | How do numbers work in Python? | <p>So, I open terminal.</p>
<pre><code>> python
> 1 / 3
0
> 1.0 / 3
0.33333333333333331
</code></pre>
<p>Could someone tell me what the rules are when it comes to decimals. Does it matter which number when being divided carries the decimal? Is there a best practice?</p>
<p>If I want more decimal points, or ... | python | [7] |
5,419,718 | 5,419,719 | Rationale for why JavaScript converts primitive values to numbers in == operator comparisons when one is boolean? | <p>I know the rule: </p>
<blockquote>
<p>If the two operands are not of the same type, JavaScript converts the operands then applies strict comparison. If either operand is a number or a boolean, the operands are converted to numbers if possible; else if either operand is a string, the other operand is converted to ... | javascript | [3] |
2,098,634 | 2,098,635 | PHP invoking another script but through http (isolating them) | <p>Let's see if I make myself clear. I have an old set of scripts that run well on PHP4 and better don't thouch em. I have to integrate a new functionality implemented on PHP5, I need just to invoke a script on the new app from the old one.</p>
<p>To not have to touch the old stuff I think to somehow "kin of remotely"... | php | [2] |
1,401,962 | 1,401,963 | Database.Script Method Throwing - ArgumentOutOfRangeException | <p><strong>Hello, I'm running the following code:</strong></p>
<pre><code>database.UserDefinedFunctions[name, schema].Script(dropstoredProcOptions);
</code></pre>
<p>With this as dropstoreProcOptions:</p>
<pre><code> ScriptingOptions dropstoreProcOptions = new ScriptingOptions();
dropstoreProcOptions.... | c# | [0] |
5,758,875 | 5,758,876 | global keyword outside the function in php | <p>As we know, global keyword makes variable( or object, array) visible inside current function we are dealing with</p>
<pre><code><?php
$some_var = 'some string';
function __test(){
global $some_var;
echo $some_var; // some string
}
</code></pre>
<p>But some dev's still use the global keyword outside th... | php | [2] |
4,551,308 | 4,551,309 | Does an IEnumerable have to use Yield to be deferred | <p>Does an IEnumerable have to use Yield to be deferred?</p>
<p>Here is test code which has helped me understand deferred execution and yield.</p>
<pre><code> //immediate execution
public IEnumerable Power(int number, int howManyToShow)
{
var result = new int[howManyToShow];
re... | c# | [0] |
1,785,968 | 1,785,969 | unable to cancel schedule task | <p>hello i am using java.util.Timer for scheduling task and show notification for appointments only one time but if i cancel schedule appointment with help of timer.cancel(); and timer.purge();<br>
it's unable to cancel and it performs on a particular time...</p>
<p>Please Help....</p>
| android | [4] |
1,453,270 | 1,453,271 | How to fake time in javascript? | <p>I would like to mock the Date constructor so that whenever I call new Date(), it always return specific time.</p>
<p>I found Sinon.js provide useFakeTimers to mock time. But the following code doesn't work for me.</p>
<pre><code>sinon.useFakeTimers(new Date(2011,9,1));
//expect : 'Sat Oct 01 2011 00:00:00' ,
//r... | javascript | [3] |
3,517,019 | 3,517,020 | moving images relatively | <p>i have an image that rotates around an arbitrary point. but i need 3 such images to rotate simultaneously
this is how i try to implement the same</p>
<pre><code>private void rotateLogo(float degrees){
Matrix matrix1 = new Matrix();
//int radius = turntable.getWidth()/2;
double radians = degrees* (Math.P... | android | [4] |
810,304 | 810,305 | Is there software to help with consolidating/combining/deduplicating contacts for the iPhone | <p>I have some contacts on my iPhone that's clearly duplicated. E.g. I have two James Fong contacts, one contains the person's home number and the other the person's mobile. Is there some software that can help me to combine them into one?</p>
| iphone | [8] |
804,075 | 804,076 | popup window on mozilla | <p>i'm using javascript to open a new window in a html page. It works fine ie whereas mozilla opens a new tab. is there a way to make the mozilla open the popup in a new window instead of new tab using javascript or any parameter?</p>
<p>-Vivek</p>
| javascript | [3] |
662,323 | 662,324 | If I return inside a with block is the file guaranteed to close? | <p>Take the following code</p>
<pre><code>with open(path, mode) as f:
return [line for line in f if condition]
</code></pre>
<p>Will the file be closed properly, or does return somehow bypass the context manager?</p>
<p>(Python 2.7)</p>
| python | [7] |
5,718,513 | 5,718,514 | Problem with passing control to Preference activity | <p>i created application in that it will call preference from main activity based on menu option
it is done using Explicit intent but it not working . when clicking the menu item
calling activity</p>
<pre><code>public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
menu.add(0, Me... | android | [4] |
3,567,051 | 3,567,052 | NullPointerException Android ActionBar Back (but not Menu Bar Back) | <p>I get an error with the ActionBar back button when I'm moving back to a previous activity, but when I use the Menu Button Back, everything works as planned! I think I have an idea of what is going on, because using the Action Bar back button causes a recreation of the previous activity, but I don't want that to happ... | android | [4] |
2,506,412 | 2,506,413 | android: How can I define custom colors, drawables, etc. in themes? | <p>I hope I can explain what I'm after. In essence, my users have asked me to allow different looks in my application, which I hope I can do with themes.</p>
<p>I hoped I could do something like this:</p>
<pre><code><style name="NewTheme" parent="android:Theme.Dark">
<item name="labelColor">#f90</it... | android | [4] |
5,316,178 | 5,316,179 | Will I be able to read xml from php file? | <p>I have apps that read online settings, and until now these settings are stored in xml. So my app read it's setting straight forward:</p>
<pre><code>"http://foo.net/app/setting.xml"
</code></pre>
<p>But I want it to be easier to maintain, and store a lot of data in the database, So im thinkink of replacing <code>..... | php | [2] |
4,230,768 | 4,230,769 | Wait for callback to complete with dialog | <p>I am very new to Android development, so please bare with me.
I have a GPS class which returns the current GPS coordinates to the calling activity via a callback.</p>
<p>The user either takes a picture or chooses one from the library and then returns to the main activity. After he returns to the main activity, I po... | android | [4] |
1,980,898 | 1,980,899 | Activity does not scroll when rotating screen | <p>when I turn the phone and the screen is rotating I cannot see the whole screen anymore. This is ok but I cannot scroll! Do I have to set some flag or property for scrolling? This is part of my xml...</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.c... | android | [4] |
1,035,018 | 1,035,019 | Troubleshooting error when creating array from database values | <p>Can someone see what I'm doing wrong with this php array? I"m trying to create a dynamic array but somehow it not working and get an Server internal error when attempting to access it from a browser</p>
<pre><code>$index = 0;
$columnIndex = 0
while($row = mysqli_fetch_array($result, MYSQL_NUM))
{
$test = array()... | php | [2] |
512,540 | 512,541 | Show div on text entry | <p>I have a form and I'd like to show a div based on the entered text in a text field. The script I'm using works just fine on my latest version of chrome but it doesn't work on IE or any of my members browswers. What they heck is wrong with the script?</p>
<pre><code> <script>
$('document').ready(function(){... | jquery | [5] |
972,200 | 972,201 | Count the prime numbers from 2 to 100 with simpler code than this | <p>It has to be with just functions, variables, loops, etc (Basic stuff). I'm having trouble coming up with the code from scratch from what I've I learned so far(Should be able to do it). Makes me really mad :/. <strong>If you could give me step by step to make sure I understand I'd really really appreciated.</strong>... | javascript | [3] |
1,624,477 | 1,624,478 | How to extract <pre> within <div> using jQuery | <pre><code><div id='Thirdsamplecodesnippet' class='clearfix'>
<pre class='brush:html;'>&lt;html&gt;
&lt;body&gt;
&lt;p&gt;Hello world.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<input type='hidden' id='codeid' value='process'>
</div>
</co... | jquery | [5] |
4,113,313 | 4,113,314 | How to make app like Flipboard? | <p>I want to make an application similar like Flipboard on android like <a href="https://play.google.com/store/apps/details?id=flipboard.app&feature=search_result#?t=W251bGwsMSwxLDEsImZsaXBib2FyZC5hcHAiXQ" rel="nofollow">this</a>. I am using gridview for showing Gallery images, but it's not applicable. How can I ac... | android | [4] |
3,707,681 | 3,707,682 | Send message to a server from android device without internet connection | <p>Basically I want to create an application on Android device which able to send a message to my third-party server without being connected to internet through wi-fi or 3G service.
Is there anyway to achieve this?</p>
| android | [4] |
266,461 | 266,462 | Intent gallery to save un the same content? | <p>I have trouble with this Intent and Gallery editor</p>
<pre><code> //fileURI is a content://
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setDataAndType(fileUri, "image/jpeg");
intent.putExtra("return-data", true);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
intent.putExtra("outputFormat", Bitma... | android | [4] |
5,223,883 | 5,223,884 | Is there a discontinuous range class for Python? | <p>I'd like to represent an arbitrarily complex range of real values, which can be discontinuous, i.e.:</p>
<pre><code>0--4 and 5--6 and 7.12423--8
</code></pre>
<p>Where I'll be adding new ranges incrementally:</p>
<pre><code>(0--4 and 5--6 and 7.12423--8) | ( 2--7) = (0--7 and 7.12423--8)
</code></pre>
<p>I don't... | python | [7] |
5,953,180 | 5,953,181 | The correct way to limit results in jquery ui autocomplete with map | <p>What is the correct way to limit results of ui.autocomplete when used with map?</p>
<p>I found similar issue with solution which works for simple array here: <a href="http://stackoverflow.com/questions/7617373/limit-results-in-jquery-ui-autocomplete">limit results in jquery ui autocomplete</a>
But my array is a bit... | jquery | [5] |
991,157 | 991,158 | Get MS-Windows Installed Applications from Java | <p>Is it possible to get a list of installed applications (like the list from the un-install programs) from a windows vista computer with java?</p>
| java | [1] |
4,475,023 | 4,475,024 | Execute python program without having specific packages in system | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/49146/how-can-i-make-an-exe-file-from-a-python-program">How can I make an EXE file from a Python program?</a> </p>
</blockquote>
<p>I am looking for a method in which i can run python program without having pack... | python | [7] |
1,815,056 | 1,815,057 | How can I fix this screen > php > No screen session found | <p>I send screen command for php but</p>
<p>for example</p>
<pre><code><?php
system("screen -S screen444 -X -p0 eval 'stuff \"restart\"^m'")
?>
</code></pre>
<p>I send this command</p>
<p>Error: No screen session found.</p>
<p>But screen is running</p>
<p>with any idea?</p>
<p>Thanks</p>
| php | [2] |
2,137,797 | 2,137,798 | How to get the previous page url using js | <p>how do I get URL of previous page in js.</p>
<p>say , I go from page A to B, and use browser back button to go back to page A.</p>
<p>I've tried history.previous, but am not getting it to work.</p>
| javascript | [3] |
1,657,836 | 1,657,837 | Javascript function is not working properly in Master pages | <p><code>document.getelementbyid('txtbox')</code> is not working when I used in content page as it is working in the normal web page. The value is null when it is used in contentpage. Plz anybody help me</p>
| asp.net | [9] |
4,171,498 | 4,171,499 | printing data from phone in android | <p>In my android application i would like to allow the user to print the data on phone to the nearest printer on click of print button.</p>
<p>Is it possible in android.How could i get the printers nearby?</p>
<p>Please share your valuable suggestions.</p>
<p>Thanks in advance :)</p>
| android | [4] |
154,718 | 154,719 | Have occured error in the following given code in the below website | <p><a href="https://developers.facebook.com/docs/mobile/android/build/" rel="nofollow">https://developers.facebook.com/docs/mobile/android/build/</a></p>
<p>Have occurred error in the following given code in the below website </p>
<pre><code> package com.greatapp;
import android.app.Activity;
import android.conten... | android | [4] |
2,425,340 | 2,425,341 | Smart String Replacements | <p>This works well for case insensitive replacements:</p>
<pre><code>str = str.replace(new RegExp(phrase, 'gi'), '<span style="color:red;">' + phrase + '</span>');
</code></pre>
<p>But what I do want is to not change case when replaced which above-mentioned does. </p>
| javascript | [3] |
760,110 | 760,111 | Open Spinner while touching a TextField | <p>I have an EditText and a spinner and I want to open the spinner when I gets focus on the Edittext. How to do that in android.?
Please help.</p>
| android | [4] |
4,879,434 | 4,879,435 | In Python, When yield cost over the return an list? | <p>In many case, people all ways say "use the <code>yield</code> to lazily create element."
but I think everything have cost, include the <code>yield</code> and its iterator.</p>
<p>In effective nord eyes, I think it's nice question.
so,for example, when I get an function.</p>
<pre><code>def list_gen(n):
if n >... | python | [7] |
1,143,887 | 1,143,888 | building a dom tree reading html using java | <p>I am trying to build the dom tree using the scanner class in java to read a give html. Below is my implementation using a stack. for some strange reason when i try to print my tree only the root is showing up and nothing else</p>
<pre><code>public void build() {
root = new TagNode("", null, null);
... | java | [1] |
1,907,189 | 1,907,190 | Java thread question | <p>I'm taking Java lessons. We're now into threads. It is the first time I'm experiencing multithreading so please excuse me if the question is very dumb :)</p>
<p>I've the following program:</p>
<pre><code>public class Foo extends Thread {
private int x = 2;
public static void main(String[]args) {
n... | java | [1] |
3,941,631 | 3,941,632 | How can I check my banner application on my actual android device that is it working correctly or not? | <p>I have developed a simple application using SDK(Android: 3.2[API-13]) for, to display Google banners.
I have tow problems in this application.</p>
<p>Problem No.1:
I have checked the application it runs on emulator but how can i check it that it working correctly or not?</p>
<p>Problem No.2:
I want to run the app... | android | [4] |
2,686,880 | 2,686,881 | HTTP Error 500.0 - Internal Server Error. Error Code 0x00000000 | <p>I have a php page of ContactUs form when i submit the form a error page displayed with following error.I am not sure about my code.Please let me know cause of this error so that i can improve it.
Waiting for early response.</p>
<p><em><strong>Error:</em></strong></p>
<p>"Server Error in Application "GIST.IN"
Inter... | php | [2] |
1,824,704 | 1,824,705 | Validation of File Upload Control using jquery | <p>How to validate asp.net FileUpload control using jquery.
I need to validate two things, FileUpload should not be empty when user clicks ok button and it should contain only excel and csv files. </p>
<p>please help.</p>
| jquery | [5] |
1,766,775 | 1,766,776 | How to get local variable by its name in JS? | <p>Working example with global var:</p>
<pre>
var example_var = 'global var example';
var x = function(){
var var_name = 'example_var';
alert('Global var value is: ' + window[var_name]);
}
</pre>
<p>How can I do same thing with a local variable? Like this (not working example):</p>
<pre>
var x = function(){... | javascript | [3] |
987,983 | 987,984 | Record 44KHz audio from bluetooth? | <p>Assuming I am using an A2DP-compatible bluetooth headset and that the headset is properly paired and connected, how can I record to an audio file using the bluetooth headset as the source?</p>
<p>In this case, when there isn't a Bluetooth headset, I record from the microphone to an M4A file containing AAC data with... | android | [4] |
1,583,137 | 1,583,138 | Error converting parameter in C++ | <p>Header file</p>
<pre><code>#include <iostream>
#include <cstring>
const unsigned MaxLength = 11;
class Phone {
public:
Phone(const char *phone) {
setPhone(phone);
}
void setPhone(const char Phone[ ]);
const char* getPhone();
private:
char phone[MaxLength+1];
};
</code... | c++ | [6] |
2,329,267 | 2,329,268 | How do I get an overview and a methodology for programming in Python | <p>I've started to learn Python and programming from scratch. I have not programmed before so it's a new experience. I do seem to grasp most of the concepts, from variables to definitions and modules. I still need to learn a lot more about what the different libraries and modules do and also I lack knowledge on OOP and... | python | [7] |
5,294,060 | 5,294,061 | Why isn't my date parsing correctly? | <p>I'm having issues parsing dates after 01/01/2000. The results are being returned incorrectly. 1999 is getting parsed as the year 1999, when it gets to 2000 it is parsing it as 0100, and then 2001 as 0101, etc. Here is the test code to illustrate this issue:</p>
<pre><code><script type="text/javascript" langua... | javascript | [3] |
1,739,738 | 1,739,739 | Can I post-back <asp:HiddenField>'s value modified with JS | <p>As title, would this raise the same problem like <a href="http://stackoverflow.com/questions/228969/asp-net-invalid-postback-or-callback-argument-event-validation-is-enabled-usi">http://stackoverflow.com/questions/228969/asp-net-invalid-postback-or-callback-argument-event-validation-is-enabled-usi</a> ?</p>
<p>Than... | asp.net | [9] |
2,346,197 | 2,346,198 | Enforcing Values Supplied Are Changed | <p>Hoping someone can assist. Within my web app, I allow the user to create a record stored in a temporary table via an iframe and then allow them to clone/copy the same record just created but with three fields within the cloned record substituted with dummy values, that need to be changed.</p>
<p>Just to elaborate f... | jquery | [5] |
5,174,325 | 5,174,326 | How can i show correct last login date time in website? | <p>I have created a asp.net website, that we are going to deploy at India. All client of this website would be from SWEDEN.</p>
<p>This site have option (last login date time) at user's dashboard after successfull login.</p>
<p>Now my problem is that if application is deploy at India and user loggedin from SWEDEN the... | asp.net | [9] |
3,740,141 | 3,740,142 | To disable Clear button while all input fields are null | <p>In the form that I am developing, I need to implement a screen rule which is - Clear button is greyed out until atleast one input field is not null. For this, I have added a js function which checks all input fields and gets called during "onmousemove" event. I have added this to body tag.
I does work, but I suspec... | javascript | [3] |
1,193,319 | 1,193,320 | Tab bar appearing below the edge of the screen | <p>I'm creating an application that, when the user selects a project in a table, displays a view with a tab bar at the bottom. I'm using this code:</p>
<pre><code>- (id)init
{
[super initWithNibName:nil bundle:nil];
tabController = [[UITabBarController alloc] init];
// Create all view controllers to be included i... | iphone | [8] |
2,772,118 | 2,772,119 | Handling the different results from parsedatetime | <p>I'm trying to learn python after spending the last 15 or so years working only in Perl and only occasionally.</p>
<p>I can't understand how to handle the two different kinds of results from the parse method of Calendar.parse() from parsedatetime</p>
<p>Given this script:</p>
<pre><code>#!/usr/bin/python
import p... | python | [7] |
423,621 | 423,622 | Dismissing DialogFragment programatically | <p>How does one programatically dismiss a DialogFragment? I am currently creating dialogs by:</p>
<pre><code>void showDialogWithId(int id){
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
... | android | [4] |
5,871,129 | 5,871,130 | PHP rounding function not working for rounding up | <p>For the code below, sometimes the value <strong>$endorsepoints</strong> is not a whole number. I want it to be rounded off, up or down, depending on normal math rules. </p>
<p>Then, I want to input the rounded number into two MySQL tables, <strong>comment</strong> and <strong>submission</strong>. </p>
<p>I want... | php | [2] |
4,128,241 | 4,128,242 | Programatically Generating WebControls | <p>I have a page that, depending on input from a previous page, lists a varying number of different questions pulled from a database. I can't seem to find an example of this online: For each question that is displayed, I need to programatically generate a DropDownList so that the user can select yes or no for each of t... | asp.net | [9] |
2,214,918 | 2,214,919 | encoding from .txt file to string using php | <p>I'm doing this project where I receive a .txt file from a MATLAB program in a PHP server. I would like to extract the data in the .txt file and encode it to a string to be sent by the server to an android. Any ideas on how to do that?</p>
| php | [2] |
5,140,439 | 5,140,440 | file_get_contents() failed to open stream: | <p>I'm trying to use file_get_contents() to grab a twitter feed, however I'm getting the following warning: </p>
<pre><code>failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
</code></pre>
<p>My code:</p>
<pre><code>$feed = 'http://twitter.com/statuses/user_timeline.rss?screen_name=google&count... | php | [2] |
1,156,409 | 1,156,410 | onkeypress event not working in firefox ? how to fix it? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4496910/onkeypress-event-not-working-in-firefox">onKeyPress event not working in Firefox</a> </p>
</blockquote>
<pre><code><div><textarea maxlength="1000" rows ="5" cols ="5"
style="width:398px; hei... | javascript | [3] |
4,881,038 | 4,881,039 | Function argument as filename | <p>Addig a file to MediaPlayer is easy:</p>
<pre><code>mp = MediaPlayer.create(Myctivity.this, R.raw.sound);
</code></pre>
<p>But what if I have the filename as an argument coming from a function like this?</p>
<pre><code> public void CreateSound(String filename, float volume)
{
mp = MediaPlayer.create(... | android | [4] |
3,715,421 | 3,715,422 | Removing white spaces from string using loops | <p>Hi guys I'm trying to remove white spaces using loops specifically. Heres what I've come up with so far</p>
<pre><code> import java.util.Scanner;
public class Q2 {
public static void main(String[] args) {
String input = "";
char noSpace = ' ';
Scanner scan = new Scanner(System.in);
input =... | java | [1] |
2,496,581 | 2,496,582 | Cannot set property of innerHTML | <p>I have a small script which grabs a file and outputs in Javascript. Then after that output i want to edit the innerHTML. </p>
<p>But its saying it cannot set it. "Uncaught TypeError: Cannot set property 'innerHTML' of null"</p>
<p>This is what i have:</p>
<pre><code>function call_file(file,div_id){
var xmlhttp;
... | javascript | [3] |
2,858,508 | 2,858,509 | How do i get count of an unknown attribute in a JSON object without a loop | <p>eg. </p>
<pre><code>var myObject = {
'item_123': {
'id': 1,
'name': 'Some name'
},
'item_789': {
'id': 2,
'name': 'Another name'
}
};
</code></pre>
<p>The number part of the item attribute/object is not known before hand since they are unique ids and are auto genera... | javascript | [3] |
3,738,499 | 3,738,500 | access the outer div using an element inside it | <pre><code><div class='container'>
<a href="#">Click</a>
</div>
</code></pre>
<p>How can I access the outer div using the anchor as a starting point in jQuery?</p>
| jquery | [5] |
1,064,387 | 1,064,388 | Bad value from AttributeSet.getAttributeValue() | <p>I have a custom SeekBarPreference, which extends DialogPreference. I'm building my own layout, yet still using the parent's attributes.</p>
<pre><code><com.example.preference.SeekBarPreference
android:key="key"
android:title="title"
android:summary="summary"
android:dialogMessage="diag messag... | android | [4] |
3,379,582 | 3,379,583 | Android: How to optimize ListView with ImageView + 3 TextViews? | <p>I've been looking everywhere to see if there is a standard way of achieving this but I find a different solution everytime. Basically, I am trying to build a Custom ListView with an image and two-three lines of text besides it. In order to optimize it, I understand that the following have to be used:</p>
<ol>
<li>c... | android | [4] |
2,180,661 | 2,180,662 | Java objects created inside main method and created outside main | <p>//Test.java</p>
<pre><code>class Example {
public int size = 5;
}
public class Test{
public static void main(String[] args) {
Example eg = new Example();
System.out.printlin(eg.size);
}
}
</code></pre>
<p>//Person.java</p>
<pre><code>public class Person {
public Person(){
priv... | java | [1] |
5,219,210 | 5,219,211 | Required Minimum Distribution Calculation not working | <p>I am trying to make an app for the Android that does RMD calculations. The program, however, keeps giving 0.0.</p>
<p>I think that my problem lies in this code:</p>
<pre><code>package com.MinDis.android;
import java.util.*;
import java.text.*;
public class RMD
{
double balance;
double rmd;
long age;
String ... | android | [4] |
3,758,753 | 3,758,754 | If-then-else statement doesn't work | <p>I have a main class, what looks like this: </p>
<pre><code>class Main {
public static void main (String[] args) {
Mobil one = new Mobil ("xxxxxx", "yyyyyy", 00000001, true);
Mobil two = new Mobil ("yyyyyy", "xxxxxx", 10245624, false);
one.touchcontrol();
two.touchcontrol();
... | java | [1] |
139,280 | 139,281 | Best way to send data to aspx page in ASP.NET 2.0/3.5? | <p>Which is Best way to send data to aspx page, and <strong>why</strong>?</p>
<ul>
<li>using query string</li>
<li>using session</li>
<li>using cross page postback </li>
<li>Something else</li>
</ul>
<p>Thanks.</p>
<hr>
<blockquote>
<p>What are you trying to achieve? More
info. please</p>
</blockquote>
<p>For ... | asp.net | [9] |
3,892,332 | 3,892,333 | PHP form not working on new server | <p>I have created a form for my website by following a tutorial at tutorialzine</p>
<p>I have this form working nicely on one of my websites but when I tried to install the form on a new website the form fields are full of script and it doesn't work. I have put the same form on both servers to demonstrate the problem.... | php | [2] |
2,579,553 | 2,579,554 | Jquery data attributes as selectors | <p>I have input with either some given or empty "data-file":</p>
<pre><code><input type="text" value="path/to/file.gif" name="some_file" data-fileid=".selector" data-file="/path/to/file.gif">
</code></pre>
<p>The cancel:</p>
<pre><code><button class="cancel" type="button" accesskey="c">Cancel</button&... | jquery | [5] |
5,192,424 | 5,192,425 | Bi-directional ScrollView | <p>I'm curious if anyone has run into the same problem as me. I have an image that I can manipulate with pinch zooming. I'd like to be able to scroll horizontally and vertically when the image is too large for the screen. I've accomplished this with a ScrollView and HorizontalScrollView combo. But this implementation l... | android | [4] |
3,845,627 | 3,845,628 | how to get request in JSON Web service with C# | <p>How to handle, request and response in JSON Webservice Using C# Coding?
I need to get request from client and processing after that i return the response to client.. I dont know how i do it..Any one please help me.. I am beginner to webservice and .Net.. It is very urgent.. Please Help me</p>
| asp.net | [9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.