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
536,414
536,415
My $.ajax call is doing nothing
<p>I am executing the following and sending a request to my MVC controller.</p> <pre><code> $.ajax({ url: "/Administration/Packages/GetOptions", data: { ac: accountID, pr: productID, pa: packageID }, success: function (data) { $('#PackageID...
jquery
[5]
388,560
388,561
What happens when C++ reference leaves it's scope?
<p>If I interpret C++ references correctly, they are like pointers, but with guaranteed data integrity (no NULL, no (int*) 0x12345). But what happens when scope of referenced object is leaved? If there are no magic involved (and probably it is not), referenced object will be destroyed behind my back. </p> <p>I wrote a...
c++
[6]
4,339,575
4,339,576
Java concurrent queue for broadcast?
<p>I have a bunch of producer threads adding to a <code>BlockingQueue</code> and one worker thread taking objects. Now I want to extend this so two worker threads are taking objects, but doing different work on the objects. Here's the twist: <em>I want an object that has been put on the queue to be worked on by <strong...
java
[1]
5,285,932
5,285,933
jQuery event handlers always execute in order they were bound - any way around this?
<p>It can be anoying that jQuery event handlers always execute in the order they were bound. For example:</p> <pre><code>$('span').click(doStuff1); $('span').click(doStuff2); </code></pre> <p>clicking on the span will cause <code>doStuff1()</code> to fire, followed by <code>doStuff2()</code>.</p> <p>At the time I bi...
jquery
[5]
6,017,311
6,017,312
Something like jQuery.extend() but standalone?
<p>I'm looking for a way to merge two configuration objects together, something like:</p> <pre><code>var developmentConfig = { url: "localhost", port: 80 }; var productionConfig = { url: "example.com" }; var config = isDevelopment ? developmentConfig : jQuery.extend(developmentConfig, productionConfig); </code...
javascript
[3]
3,889,352
3,889,353
ContextMenu title -> get from clicked listView item
<p>Trying to set ContextMenu title according to the ListView clicked item. The ListView contains Bookmarks list -> FAVICON + BOOKMARK TITLE</p> <pre><code>@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.a...
android
[4]
2,871,120
2,871,121
asp.net webserver slow loading page
<p>i am working with visual studio 2010. When i run the application it page loads very slow. I found with firebug that the images are taking lot of time to get loaded. All images are of size 50kb or less. </p>
asp.net
[9]
4,738,997
4,738,998
calling a function and passing it values in a struct
<p>so i have this structure:</p> <pre><code>// Structure used to define a point (x,y) in the grid. typedef struct { int x, y; } Point; </code></pre> <p>and this function </p> <pre><code>Sequence getSequence(int grid[][MAXCOLS], Point startPos) { // Create an empty sequence Sequence emptySeq; emptySeq...
c++
[6]
4,950,484
4,950,485
Java compiler behaviour question
<p>I have an interface &amp; its implementation class in the same package. I using javac in commandline to compile them. I am able to compile the interface class successfully, but when try to compile the implementation class after compiling the interface class, I get the error - Symbol not found. However, as both the i...
java
[1]
3,793,122
3,793,123
execute when div reaches position
<p>I have a function that moves a box from right to left of a page on click. When the div starts to exit the window and thus has a negative position based on my function, I would like to fire an event. I however get no response when the div passes the edge of the left side of the screen. Anyone have any ideas? </p> <p...
jquery
[5]
838,973
838,974
JavaScript Extending Prototypes #81 from John Resig learning advanced JavaScript
<p>The is example #81 from John Resigs Learning Advanced JavaScript, called Beware: Extending Prototypes Can Be Dangerous.http://ejohn.org/apps/learn/#81 As it is written (length == 3), the assert fails, but if you assert <code>obj.keys().length == 4</code> it passes. </p> <p>Here are some questions</p> <p>1) Why is...
javascript
[3]
762,361
762,362
How to add functionality to the official Take Photo Button of Android Phones?
<p>I need to add functionality to that button, but i dont know the name of the button, and I dont know how to give it functionality.</p> <p>Does someone know what to do?</p> <p>SOLVED: </p> <pre><code> mSurfaceView.requestFocus(); mSurfaceView.setFocusableInTouchMode(true); public boolean onKey(View v, int k...
android
[4]
5,271,368
5,271,369
Remove Same Element from Array in C#
<p>How can i remove the same element from Array in C#. e.g. array{0,2,2,8,4,6,1,0,4} and output will be array{0,2,8,4,6,1} plz help me out...</p>
c#
[0]
2,160,090
2,160,091
no suitable method for sort error
<pre><code>import java.util.Scanner; import java.util.ArrayList; import java.util.Collections; import java.util.Collection; public class ClearlyAnArrayList { public static void main(String[] args){ Scanner kb=new Scanner(System.in); ArrayList&lt;Integer&gt;ints=new ArrayList&lt;Integer&gt;(); ...
java
[1]
3,969,126
3,969,127
Can a Page Source include JavaScript contents?
<p>Is there a way to view whole content of javascript file in a normal page source? My javascipt file consists of many links which i want to be visible when i do a normal page source? can anyone please suggest a way how i could achieve it?</p>
javascript
[3]
3,892,226
3,892,227
jQuery add class if dropdown active, else remove class
<p>I have a script that looks if the <strong>unordered list</strong> is visible, if it is, it will add a class. My problem is, it's not removing the class. Probably a noobie error, help appreciated though.</p> <p>HTML:</p> <pre><code>&lt;div class="nav"&gt; &lt;ul id="menu" class="menu"&gt; &lt;li id="menu0"&gt...
jquery
[5]
1,619,314
1,619,315
Can anybody explain reference in php?
<pre><code>$b=2; $a=&amp;$b; $a=3; print $a; print $b; </code></pre> <p><strong>output is 33</strong></p> <p>Can anybody explain how '$b' became 3?</p>
php
[2]
5,228,398
5,228,399
android imageview not getting focus
<p>Recently I designed a view. there is 2 framelayout inside one layout. first layout has a list view second layout has an imageview. Issue is any touch or click event will not get for imagevew.</p>
android
[4]
865,402
865,403
Closest textarea w/ jQuery
<p>I am trying to select a value from a drop-down and on select enter its value in the textarea that follows this selector. I tried defining my var but failed:</p> <pre><code>var input = $(this).closest("input") </code></pre> <p>I don't want to assign IDs since I have the same combination repeat on the page more tha...
jquery
[5]
3,632,539
3,632,540
Trying to hide all other elements with class name using .not(this)
<p>Trying to hide all others, but it keeps affecting the $(this) item.</p> <pre><code>$(function() { $(".FL-pest-indv").css({ display: 'none' }); $(".FL-pest-cat").live('click', function() { $(".FL-pest-indv").not($(this)).hide(600); $(this).children('.FL-pest-indv').stop(true, true).animate({ "height": "toggl...
jquery
[5]
1,472,612
1,472,613
how to get value from an array
<p>how to get the value 4500 to a variable</p> <pre><code>stdClass Object ( [total] =&gt; 4500 ) </code></pre> <p>i tried like these </p> <pre><code>$abc['total'] $abc-&gt;total </code></pre> <p>when i print the $abc->total</p> <p>i got</p> <p>Array ( [0] => stdClass Object ( [total] => 4500 ) ) </p> <p>please...
php
[2]
4,618,381
4,618,382
Convert an array into a separate argument strings
<p>How would I get this array to be passed in as a set of strings to the function? This code doesn't work, but I think it illustrates what I'm trying to do.</p> <pre><code>var strings = ['one','two','three']; someFunction(strings.join("','")); // someFunction('one','two','three'); </code></pre> <p>Thanks!</p>
javascript
[3]
4,114,124
4,114,125
How to reset data in previous view controller?
<p>I am using multiple view controllers associated with a corresponding tab.</p> <p>I need to be able to move from tab2 to tab1 and to initialize my previous view controller associated with tab1 just as if I had open the tab for the first time when app launches. However, it does not initialize it like I expect when...
iphone
[8]
1,782,828
1,782,829
Won't Insert into mysql table
<p>I am building a private messaging network and it doesn't seem to be inserting them into my table specified. The messages are posted into the table and then accessed in a different script. What is wrong my my query? </p> <pre><code> $new_of_id = $_SESSION['user_login']; $send_msg = mysql_query("INSERT INTO...
php
[2]
5,822,941
5,822,942
javascript substr window.location.href
<p>this is a very beginner question but I don't know javascript, I only wants implement a snipplet I found googling around.</p> <p>The original code is:</p> <pre> <code> var langcodes=["it", "es"]; var langCode = navigator.language || navigator.systemLanguage; var lang = langCode.toLowerCase(); lang = lang.substr(0,...
javascript
[3]
5,187,350
5,187,351
How to store and retrieve images in sqlite database in android?
<p>I am working on <strong>quiz application</strong> and I need to display <strong>questions along with images</strong>. I have <strong>stored the questions in sqlite database</strong> and <strong>displaying them in android</strong>. But I dont know how to store the images in sqlite db and display them. I have go...
android
[4]
4,410,258
4,410,259
How to find event listeners on a DOM node using JavaScript
<p>I still can't belive this is not possible but is there a way to loop through the dom and see all event handlers attached using 'addEventListener'. <a href="http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node">This post</a> and many others says no. </p> <p>If that's the case then how ...
javascript
[3]
3,877,577
3,877,578
Calendar.apk running problem?
<p>I have an apk of Calendar application. I have installed the apk on android 2.1 API level 7 emulator successfully. But the problem is I can not run the application. When I click on the app icon it shows the following message. Sorry! The appliaction Calendar(process com.android.calendar) has stopped unexpectedly. Plea...
android
[4]
4,998,457
4,998,458
i want to send url on another page throught url
<p>i want to send $c2=@'http://marvelconcepts.net/fb3/02.php?c='.$c.'&amp;&amp;'.'c1='.$c1; on 02.php when i get $C ON 02.php it is not showing full url </p> <pre><code> &lt;?php $c='Flower'; $c1='http://aux.iconpedia.net/uploads/1337412470.png'; $c2=@'http://marvelconcepts.net/fb3/02.php?c='.$c.'&amp;amp;&amp;amp;'.'...
php
[2]
1,776,819
1,776,820
how can we play audio and video together in ipod/iphone?
<p>HI all </p> <p>i am playing a video(.mp4 format) without sound (i mean it doesn't have sound it is a mute video ) and in the background i am playing an audio file (.mp3 format) when i play my code through simulator it works fine as i want like when i tap on the video it is just mute but behind i am playing the aud...
iphone
[8]
5,968,994
5,968,995
How to load animation from Assets folder?
<p>I m working on a Android Java Plugin for Unity3D.</p> <p>I my Android Project, I have a class which is not extending Activity, but i m calling a function from unity &amp; sending current activity in it.</p> <pre><code>public class abc{ void init(final Activity currActivity, .. and some other params) { ...
android
[4]
4,912,546
4,912,547
how to play rtsp url in android?
<p>how to play rtsp url in android ?</p>
android
[4]
4,330,733
4,330,734
How to get substring from string in c#?
<p>I have a large string and its stored in a string variable str. And i want to get a substring from that in c#? Suppose the string is : <code>" Retrieves a substring from this instance. The substring starts at a specified character position."</code></p> <p>Substring result what i want to display is: <code>The substri...
c#
[0]
2,681,776
2,681,777
Android - show webview in same tab containing a list
<p>I am using a TabWidget that contains a List in one tab. What I want to do is when a user selects an item, a webview is shown in that tab. </p> <p>If the user then wants to go back to the list, they would click on the list tab.</p> <p>I can get the webview up that replaces the whole tabwidget but don't know how to ...
android
[4]
2,225,823
2,225,824
Can I launch different Activities on startup depending on user preferences?
<p>I have a ListActivity and a MapActivity. I would like to launch either one of these activities on application startup that has been chosen by the user in a preferences window.</p> <p>So far the only way I see to launch an activity on application startup is to specify it in the application manifest file using...</p...
android
[4]
4,145,264
4,145,265
how to limit the number of characters
<p>i need to control the numer of characters enter by the user on a single textbox, but i don't know how, for example y have this</p> <pre><code>$.validator.addMethod('selectNone', function(value, element) { return this.optional(element) || (value.ind...
jquery
[5]
2,010,605
2,010,606
List conversion between different data types
<p>What would be the simplest way to convert <code>List&lt;Integer&gt; to List&lt;String&gt;</code> objects. Currently I iterate through all the integers and add them to a <code>List&lt;String&gt; objects</code>, is there a utility function which is already available?</p>
java
[1]
2,384,221
2,384,222
how to scrape html generated by javascript using python?
<p>I want to scrape the html generated by javascript , just like what you can see in Firebug.</p> <p><strong>UPDATE</strong>: I've found this article: <a href="http://blog.motane.lu/2009/07/07/downloading-a-pages-content-with-python-and-webkit/" rel="nofollow">http://blog.motane.lu/2009/07/07/downloading-a-pages-conte...
python
[7]
3,621,864
3,621,865
Restrict users with a number of wrong logins
<p>I have a login form in a backend application</p> <p>I need to find a way to restrict/denied users that for example has entered a bad username/password at least five times and show a meesage like:</p> <pre><code>echo "You have entered wrong 5 times your username/password, you have to wait 10 minutes to the next log...
php
[2]
1,853,308
1,853,309
$_SESSION, wise to use to hold data?
<p>I was wondering if using $_SESSION['data'] would be a smart way to hold information about a user who is logged in.</p> <p>For example:</p> <p>Say i have a game and i want to display their level/exp/username etc, well currently every page load i have to recall the database... so im wondering if i store it in a SESS...
php
[2]
4,444,224
4,444,225
Overloading and any number of arguments
<p>Write a new function called superOperator() that can take any number of arguments (up to 3). First, it multiplies all the arguments and stores the result in a variable (result1), then it adds up all the arguments and stores the result in another variable (result2). Finally it returns the difference between result1 a...
c++
[6]
3,989,675
3,989,676
How to cut off the filename of this url using PHP?
<p>How can I transform the following link ( and many other that have the same structure) from</p> <pre><code>http://www.domain.com/gb/news/12/13311/here-goes-the-name-of-article.htm </code></pre> <p>and echo it to</p> <pre><code>http://www.domain.com/gb/news/12/13311/ </code></pre> <p>I will use PHP and $_GET to ge...
php
[2]
952,199
952,200
hide id using jquery but the input is an array
<p>I have a JQuery code I have been using for some time however today I ran into a roadblock - this roadblock comes in the form of an array input.</p> <pre><code>&lt;div id="primary"&gt; //oopse this one contains the survey info &lt;input type="radio" name="quest[]" value="yes"&gt; //was typing fast didnt realize ...
jquery
[5]
4,193,146
4,193,147
Renaming specific files
<p>In python 2.7, How can I rename a file's filename and file extension in my current directory? If I have these files: <code>[abc.txt, 123.mp3, 54.jpg, 145.bat]</code>. How can I change that one .txt file to a file named <code>testing.bat</code>?</p>
python
[7]
5,921,423
5,921,424
copy constructor with ArrayList parameter
<p>I'm trying to make a copy constructor for an object and one of the parameters is an ArrayList.</p> <p>when creating the ArrayList object, I had in mind to use the ArrayList constructor where you can pass a collection as a parameter, but I'm not sure if this will work as a "pointer" to the arraylist or if this will ...
java
[1]
2,711,135
2,711,136
How to replace the last occurence of an expression in a string
<p>Is there a quick way in Python to replace strings by starting from the end? For example:</p> <pre><code>&gt;&gt;&gt; def rreplace(old, new, occurence) &gt;&gt;&gt; ... # Code to replace the last occurences of old by new &gt;&gt;&gt; '&lt;div&gt;&lt;div&gt;Hello&lt;/div&gt;&lt;/div&gt;'.rreplace('&lt;/div&gt;',...
python
[7]
1,907,620
1,907,621
PHP: Count number of occurrences of a particular day in a month?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1653891/how-to-find-number-of-mondays-or-tuesdays-between-two-dates">how to find number of mondays or tuesdays between two dates?</a> </p> </blockquote> <p>I am working on a program that will generate a monthly ...
php
[2]
5,705,278
5,705,279
MRAID file reference
<p>The IAB MRAID specification <a href="http://www.iab.net/media/file/IAB_MRAID_VersionOne_final.pdf" rel="nofollow">http://www.iab.net/media/file/IAB_MRAID_VersionOne_final.pdf</a></p> <h2>Says that a reference to an mraid.js file should be the first line within an MRAID compliant ad</h2> <p>MRAID script reference T...
javascript
[3]
1,025,263
1,025,264
Java: Resetting all values in the program
<p>I am working on this program where at the end of the game I ask the user if they want to play again. If they say yes, I need to start a new game. I made a restart() method:</p> <pre><code>public void restart(){ Game g = new Game(); g.playGame(); } </code></pre> <p>However when I call this method some of ...
java
[1]
405,788
405,789
iphone application
<p>how to display output of html file in iphone</p>
iphone
[8]
1,562,047
1,562,048
A cleaner/shorter way to solve this problem?
<p>This exercise is taken from <a href="http://code.google.com/intl/de-DE/edu/languages/google-python-class/index.html" rel="nofollow">Google's Python Class</a>:</p> <blockquote> <p>D. Given a list of numbers, return a list where all adjacent == elements have been reduced to a single element, so [1, 2, 2, 3] ret...
python
[7]
3,888,218
3,888,219
comparing two array of strings in javascript
<p>How to compare two array of strings using javascript ? </p>
javascript
[3]
2,859,877
2,859,878
Implement change black/light theme feature in Android app
<p>I want to have a "change theme" feature in my app. If I call setTheme() in onCreate(), there is one problem.</p> <p>The moment after I launch my app, a plain white background appears for a second (because I have set light theme in the manifest). After that, the complete layout of my Activity is displayed - it is ei...
android
[4]
3,567,302
3,567,303
How can I make a function return IEnumerable<string> instead of a string in C#
<p>I have the following function that returns a string:</p> <pre><code>public static string GetFormattedErrorMessage(this Exception e) { if (e == null) { throw new ArgumentNullException("e"); } var exError = e.Message; if (e.InnerException != null) { exError += "&lt;br&gt;" + e...
c#
[0]
1,450,755
1,450,756
How should lists be cast to their conrecte implementations?
<p>Let's suppose I'm using a library for which I don't know the source code. It has a method that returns a List, like so:</p> <pre><code>public List&lt;SomeObj&gt; getObjs() { ... } </code></pre> <p>I'm wondering if this is a good idea:</p> <pre><code>ArrayList&lt;SomeObj&gt; objs = (ArrayList&lt;SomeObj&gt;) getOb...
java
[1]
2,151,140
2,151,141
Android Black Glossy Header/Footer View?
<p>In the Gmail app on my HTC Android phone, the headers are glossy black, much like the header on an iPhone.</p> <p>Is there a setting on a view that I can use to create this background look, or is it a graphic they are over laying?</p>
android
[4]
2,364,641
2,364,642
Extract Whitespace in addition to text from input file, C++?
<p>I have to write a function that will read input from a file. The file is set up: one character, space, word, space, throughout the file, like such:</p> <p><code>A space 1 space 2 space...</code> etc</p> <p>I need to extract the whitespace following the one character and NOT the whitespace following the word.</p> ...
c++
[6]
4,129,082
4,129,083
Operator '&&' cannot be applied to operands of type 'int' and 'bool'
<pre><code>if (Console.CursorTop=3 &amp;&amp; Console.CursorLeft==7) { Console.WriteLine(); } </code></pre> <p>there is an error</p> <pre><code>Error 1 Operator '&amp;&amp;' cannot be applied to operands of type 'int' and 'bool' </code></pre> <p>Why is it not working?</p>
c#
[0]
4,620,023
4,620,024
GPRS data usage information
<p>In my application, I need to get the information about gprs usage per request on internet. How can I get that information?</p> <p>Thanks in advance ...</p>
android
[4]
5,861,847
5,861,848
apply event after DOM modifies
<p>This is probably a very common question but here it goes. I created an image carousel for some small thumbs pics . When i click on a thumb it makes it slightly bigger and adds the id #click to it . I want to add the fancybox viewer if you click it again. Obviously $('a#click').click() did not work because the elemen...
jquery
[5]
5,607,853
5,607,854
Create a char from a string that contains the utf code
<p>I'm trying to create a char out of the utf code. I'm reading this code from a file which is a map of characters. All characters are specified by their UTF code.</p> <p>0020 SPACE<br> 0021 EXCLAMATION MARK<br> 0022 QUOTATION MARK<br> .<br> .<br> .<br></p> <p>After reading the code from the file, I end up w...
java
[1]
634,340
634,341
access calling classes atrributes
<p>I have 2 classes defined as such</p> <pre><code>class class1(): self.stuff = 1 def blah(self): foo = class2() foo.start() class class2(threading.Thread): def run(self): #access class1.stuff </code></pre> <p>How would I access class1.stuff from class2</p>
python
[7]
1,849,540
1,849,541
the top option option in a selected list is being loaded as one of the dynamic drop down options
<p>I have a dynamic drop down menu which is hooked up to a query_string to send to the next screen, how can I validate the information from the drop down menu before it gets sent to the next page? I just don't know how to indentify the dynamic drop down. Thanks again!! This is through the server also. here is the code ...
php
[2]
1,989,002
1,989,003
IndexError message in Python using 'with' statement
<p>I have input and output variables assigned to a function definition to grab entries from a GUI, input(read) a .txt file and create(write) an output .txt file that will split some columns of data specifically below:</p> <pre><code>def runTransferDialog(): e1, e2 = StringVar(), StringVar() PackDialog(e1, e2) ...
python
[7]
6,017,851
6,017,852
How to change original html code in runtime via jquery?
<p><code>&lt;blockquote&gt;&lt;p&gt;We prefer questions that can be answered, not just discussed. Provide details. Write clearly and simply.If your question is about this website, ask it on meta instead.&lt;/p&gt;&lt;/blockquote&gt;</code>.</p> <p>I want to change above code to this.</p> <pre><code> &lt;blockquote...
jquery
[5]
804,165
804,166
textarea is endless , no limit
<p>i really search on the internet, but i didnt reach anything.</p> <p>i have a textarea with javascript.In this textarea, there is no limit, no scrollbar appears.</p> <p><strong>You can see the normal view</strong> <img src="http://i.stack.imgur.com/UJlkO.png" alt="enter image description here"></p> <p><strong>Howe...
javascript
[3]
5,437,499
5,437,500
Message box on selection jquery grid row,
<p>I have editable dropdown list box on jquery grid, if I am not selecting the dropdown list box item I need to give a messagebox to the user saying please select.. </p> <p>how do I do this using jquery?</p> <p>Thanks</p>
jquery
[5]
4,126,254
4,126,255
Draw part of the content of a CGLayer
<p>I have CGLayerRef which is updated periodically, I also have a CGRect indicates which part of the CGLayer got updated. Is there any way I can draw only the updated area of the CGLayer to the targeted CGContext. The CGLayer and the CGContext may of different size, and I don't want any scaling.</p> <p>Thanks!</p>
iphone
[8]
3,643,214
3,643,215
Netbeans + servlet
<p>In my J2EE application I use a servlet, but Netbeans doesn't appears to recongnice the libraries javax.servlet.http.HttpServlet, javax.servlet.http.HttpServletRequest, or javax.servlet.http.HttpServletResponse, is valid to mention that I use Netbena 6.7...how can I fix the problem??????</p>
java
[1]
4,833,244
4,833,245
Convert exponential number presented as string to a decimal
<p>Let's suppose I have a <strong>string</strong> that contains "7.2769482308e+01" (this number came from 3rd party software, I cannot control the format).</p> <p>What is the cheapest way to convert it into decimal <code>72.769482308</code>?</p> <p>The only solution I can think of is to split decimal + exponential pa...
php
[2]
724,020
724,021
enabling - disabling form elements checking - unchecking checkbox input jquery
<p>I want to enable all form elements when checking a checkbox form element. And reverse.<br> This is my code (which doesn't work): </p> <pre><code>$(document).ready(function(){ $('#coments input[type=text]').attr('disabled', 'disabled'); $('#coments textarea').attr('disabled', 'disabled'); $('#coments...
jquery
[5]
4,843,468
4,843,469
how to call an activity class in onBackPressed()-android
<pre><code>public void onBackPressed() { Intent setIntent = new Intent(this,xxxxx.class); startActivity(setIntent); return; } </code></pre> <p>I call <code>onBackPressed()</code> to one activity the processing happen well.but it call same activity once again (ie) If we press back in a...
android
[4]
3,541,347
3,541,348
jQuery submit form on checkbox press
<p>I am trying to submit a form on checking or unchecking a checkbox using jQuery and using the data value of that checkbox, can someone help me on how to do this?</p>
jquery
[5]
2,288,075
2,288,076
binary formatter to string
<pre><code> BinaryFormatter formatter = new BinaryFormatter(); using (MemoryStream m = new MemoryStream()) { formatter.Serialize(m, list); StreamReader sr = new StreamReader(m); HiddenField1.Value = sr.ReadToEnd(); } </code></pre> <p>i'm getting a blank value for HiddenField1.Va...
c#
[0]
5,684,053
5,684,054
Notice: Undefined offset: 1 in /somepath/index.php on line 115
<p>I got a problem, I get an error with this code:</p> <pre><code>&lt;td&gt;&lt;?=$datas[$i]['devicename']?&gt;&lt;/td&gt; </code></pre> <p>This is the error I get:</p> <blockquote> <p>Notice: Undefined offset: 1 in /somepath/index.php on line 115</p> </blockquote> <p>Any one know the solution please help me.<...
php
[2]
2,078,740
2,078,741
Template Specialization in Header File
<p>I realize I have to put the below code (For template specialization) in CPP file instead of Header file? Is there any way I can make it in Header file?</p> <pre><code>template&lt;&gt; inline UINT AFXAPI HashKey&lt;const error_code &amp;&gt; (const error_code &amp; e) { // Hash code method required for MFC CMap....
c++
[6]
1,826,362
1,826,363
How to get total sum of array
<p>i'm trying to add together the contents of an array (integers). for example:</p> <pre><code>var myArray; var answer; myArray[0]=2; myArray[1]=5; answer=myArray[0]+myArray[1]; </code></pre> <p>answer should equal 7.Could you help me, please? Thank you so much.</p>
javascript
[3]
5,943,690
5,943,691
ASP.NET displaying fixed DIV on top of page
<p>I'm using VS2010,C# to develop my ASP.NET web app, I'm going to insert a fixed header on top of my pages so that my content area has a smaller width and these fixed DIVs are always on top of my page, in this way contents should start displaying from bottom of DIVs and not from screen top, I'm not going to use master...
asp.net
[9]
1,840,575
1,840,576
Is there a difference between name decoration/mangling and attribute decoration?
<p>I've been reading a text about an extension to C# and at one point it says that "An attribute decoration X may only be applied to fields of type Y."</p> <p>I haven't been able to find a definition for attribute decoration, and I'm not making much sense out of this by exchanging the two.</p>
c#
[0]
2,985,791
2,985,792
Android Telephone manager to detect sim
<p>I am working on an Android auto-start app that's basically dependent on SIM card state. When my app auto starts I need it to check where the SIM card has been changed or not. After that I compare the current SIM with the past SIM by obtaining the shared preference. But the app returns a null pointer exception whe...
android
[4]
5,483,337
5,483,338
Bypass the .submit() handler
<p>I have an event handler for a form submittal that needs to do some work. That work includes making an ajax call to perform some very specific validations. Because of the asynchronous nature, my intent was to <code>preventDefault</code> at the top of the event handler and, if everything went well, submit the form "ma...
jquery
[5]
2,000,960
2,000,961
How to determine whether specified file is placed inside of the specified folder?
<p>Let's say I have two paths: the first one (may be file or folder path): <code>file_path</code>, and the second one (may only be a folder path): <code>folder_path</code>. And I want to determine whether an object collocated with <code>file_path</code> is inside of the object collocated with <code>folder_path</code>.<...
python
[7]
1,836,474
1,836,475
Using numbers outside the range of unsigned long long?
<p>I've been trying to use numbers beyond the range of <code>unsigned long long</code>. Can anyone help me regarding the use of numbers beyond the range of <code>unsigned long long</code>?</p>
c++
[6]
3,628,975
3,628,976
Jquery Scrollable grid view not working inside of ajax tab container
<p>Scrollable gridview not working inside of ajax tab container. I have designed two tab panels inside ajax tab container. Each tab panel has gridview. I have applied jquery scrollable gridview plugin for each gridview. But inside of ajax tab container jquery scrollable gridview not working?</p>
asp.net
[9]
4,249,448
4,249,449
print out all website directories names
<p>If i've the following main directories into my website</p> <pre><code>/dir1/ /dir2/ /dir3/ /dir4/ </code></pre> <p>Is there any php function or code can print all directories names once i execute it. ~Thanks</p>
php
[2]
2,127,158
2,127,159
Calculate age from birthdate
<p>I have two textboxes. The first one is a date, the second one is an age. I have 2 cases :</p> <ul> <li>I know the birthdate, I fill in the textbox and the age is calculated and displayed in the second textbox, this textbox is readonly</li> <li>I don't know the birthdate, I enter an age, no birthdate and no more act...
jquery
[5]
5,003,039
5,003,040
Comparing names given method header?
<p>Given the header: </p> <pre><code>public boolean equals(Name otherName) </code></pre> <p>I'm supposed to compare two name objects for equality. What I have right now is: </p> <pre><code>public boolean equals(Name otherName){ return (name1.equalsIgnoreCase(name2)); } </code></pre> <p>However, I get an identi...
java
[1]
4,215,478
4,215,479
OptionMenu does not show....
<pre><code> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // mEditor=(TextView)findViewById(R.id.text); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMen...
android
[4]
3,625,969
3,625,970
Android AccountAuthenticator and Sync Service: Display under "Synchronization and Data"
<p>I have an AccountAuthenticator and associated SyncService that are working when I test via Dev Tools -> Sync Tester on the emulator. I also have a preferences intent working on the Account screen.</p> <p>However, I have been unable to figure out how to get my Sync Service listed under the "Data &amp; Synchronizatio...
android
[4]
5,428,500
5,428,501
Is there a simple way to get li:gt(-1) in jquery?
<p>Is there a simple way to get <code>li:gt(-1)</code> in jQuery? Or greater than or equal to zero using jQuery's <code>:gt</code> filter?</p> <p>When the I use the following code, it is not taking <code>li:gt(-1)</code>:</p> <pre><code> $('#Input li:gt(-1)').each(function() </code></pre>
jquery
[5]
1,722,914
1,722,915
is these code cause memory leak in java?
<pre><code> ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;(); for (int i = 0; i &lt; 10; i++) { Object o = new Object(); list.add(o); } list = null; </code></pre> <p>or</p> <pre><code> ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;(); for (int i = 0; i &lt...
java
[1]
1,356,794
1,356,795
javascript function to hide and show a hyperlink depending upon the mobile browser?
<p>I am creating a mobile website which targets all the mobile platforms(i-phone, i-pad,Blackberry,android e.t.c).</p> <pre><code> &lt;div data-role="header" data-position="inline"&gt; &lt;a href="index.html" data-role="button" data-icon="home"&gt;&lt;/a&gt; &lt;div id="title"&gt;Venue Information&lt;/div&gt...
javascript
[3]
1,448,494
1,448,495
How to 'merge' two beans, but sum numeric values inside
<p>If I have a bean such as</p> <pre><code>public class SimpleBean { private String name; private int int1; private int int2; private double double1; private double double2; // getters/setters snipped } </code></pre> <p>what is the best way to merge two instances of the bean into one, where w...
java
[1]
4,659,872
4,659,873
can't get javascript function to execute
<p>I'm a beginner with Javascript and can't get the code below to work. When I click the button, nothing happens. Could someone point out what I did wrong? Thanks!</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Sarah's Puppy Game&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="input"&gt; &lt;in...
javascript
[3]
5,801,561
5,801,562
How to return the specific page in jQuery Datatables paging?
<p>I have a datable and "Edit" button in each row. When I click that button, /edit/ url opens. Everything is Ok until now. But if I need to go back to the datatable, it starts from the first page. What can I do for that?</p> <pre><code> $('#table').dataTable({ "sDom" : 'rtFip&gt;', 'fnDrawCallback' : f...
jquery
[5]
4,806,064
4,806,065
textbox Empty validation
<p>I'm trying to validate a text box in a form to not having empty string if the user didn't entered anything in the text box, so if the text box was empty, the user has to enter a value ,and my code was like this, but it is not working</p> <pre><code> public int TextBox_Validation(string sender) { try ...
c#
[0]
4,514,430
4,514,431
in jQuery, how is .live pronounced?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4972698/in-jquery-what-is-the-correct-pronunciation-of-live">In jquery, what is the correct pronunciation of &ldquo;live&rdquo;?</a> </p> </blockquote> <p>How should it be pronounced; live as in to be alive or l...
jquery
[5]
5,717,600
5,717,601
How do I reverse a part (slice) of a list in Python?
<p>Why doesn't this work?</p> <pre><code># to reverse a part of the string in place a = [1,2,3,4,5] a[2:4] = reversed(a[2:4]) # This works! a[2:4] = [0,0] # This works too. a[2:4].reverse() # But this doesn't work </code></pre>
python
[7]
2,900,950
2,900,951
iphone os 4.0 adding images to simulator 4.0 folder
<p>i have two iphone SDK 3.0 and 4.0 on two different folders i want to add images to my iphone simulator 4.0 how could i do that the directory such as application support/media/ does not shows when selecting iphone simulator 4.0 please guide me how i could do that </p>
iphone
[8]
4,427,436
4,427,437
dynamically creating objects
<p>I have a method that receives an array of strings and I need to create objects with appropriate names. </p> <p>For example:</p> <pre><code>public class temp { public static void main(String[] args){ String[] a=new String[3]; a[0]="first"; a[1]="second"; a[2]="third"; createObjects(a); ...
java
[1]