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,183,016 | 4,183,017 | What I am doing wrong with c++ maps? (scary memory errors) | <p>I am new to C++ and I'm having trouble using a map correctly in class that I'm writing. Basically, when I make a new Block object in a test program and call its write method, the program totally shits itself and gives me a double free or corruption error. What is weird is that everything works fine if I uncomment th... | c++ | [6] |
2,022,890 | 2,022,891 | validating a user controls form without validating the form on the page | <p>I have a page with two user controls(modal popups in each), each with its own form. When a user interacts with the form on either user control, I would like the user controls form to validate without causing the page to validate as well. Currently it is causing both forms and the page to validate, which is a huge ... | c# | [0] |
2,813,837 | 2,813,838 | python-read multiple files and write | <p>I have 2 sets of files. One starts as:sinu_bh8_np...dat, and the other as: sinu_bh9_np...dat. Each set has say, 3 files.</p>
<p>The first four lines in each file have some text (which is to be ignored), follwed by data in 2 columns.</p>
<p>The number of lines in the files are not equal.</p>
<p>I need to read one ... | python | [7] |
2,486,955 | 2,486,956 | What's the best way to get the full path and filename of the invoked executable in c#? | <p>Given the following code:</p>
<pre><code>using System;
namespace Sandbox
{
class CommandLine
{
static void Main()
{
String[] args = Environment.GetCommandLineArgs();
String executable = args[0];
String[] paramList = getParamList(args);
System.Console.WriteLine... | c# | [0] |
5,185,206 | 5,185,207 | Changing default dialer tones | <p>I am creating an android app in which I am trying to modify the default dialer keyboard tones (1,2,3....) (NOT the incoming caller tunes etc)
This is my first approach for such kind of android app. </p>
<p>Can anyone please guide me how to achieve this?
I read it somewhere that "ToneGenerator" class can be used t... | android | [4] |
1,555,765 | 1,555,766 | I am getting errors in php | <p>I am getting this error and I have done everything I can think about. Can someone help me out I have been working on this all day. I am still a little newbie at it. Thanks.</p>
<p>Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in C:\wamp\www\me... | php | [2] |
1,339,262 | 1,339,263 | inline virtual function | <p>In C++, my understanding is that virtual function can be inlined, but generally, the hint to inline is ignored. It seems that inline virtual functions do not make too much sense.</p>
<p>Is that right?</p>
<p>Can anybody give a case in which an inline virtual function is good?</p>
| c++ | [6] |
5,138,709 | 5,138,710 | Hiding the main layout of Custom Dialog | <p>I have made layout for custom dialog, it has inside two imageview. I want to show both Imageview when dialog appear. and i want to hide the main layout of my xml file I have used "#00000000" as background:color, but it is not working.
Is there any way to do the same?</p>
<p>Thanks.</p>
<p>Here is my layout. I have... | android | [4] |
5,913,927 | 5,913,928 | What is the best way to do a list[0] with a default value in python? | <p>I am looking for a list functionnality in Python.</p>
<p>I am doing this :</p>
<pre><code>abcd = [1, 2, 3, 4]
try:
item = list[5]
except:
item = 0
</code></pre>
<p>How can I make it looks like :</p>
<pre><code>item = abcd.get(5, 0)
</code></pre>
<p>Thanks for your help</p>
| python | [7] |
5,452,762 | 5,452,763 | When we called rezise member function of Vector(STL Type) type variable, content from vector remains constant or not? | <p>I am using a vector variable.</p>
<pre><code>std::vector<> mArray;
</code></pre>
<p>when i need to resize this variable i called <code>mArray.resize()</code> function. Does that keep the content of <code>mArray</code> remains same?</p>
<p>Thanks in advance.</p>
| c++ | [6] |
5,152,289 | 5,152,290 | How to index from an array in increments with jQuery | <p>I have an array with multiple data, and I'd like to index a div with an incremental value.</p>
<pre><code>var fancyboxInfo = [
'Title1', 'Details1', 'Location1',
'Title2', 'Details2', 'Location2',
'Title3', 'Details3', 'Location3',
]
$(".fancybox").each(function(index) {
$(this).attr("title", fancyboxInfo[inde... | jquery | [5] |
3,461,954 | 3,461,955 | How to write code for get photo from photo library in android? | <p>I want code for get the photo from photo library and add that photo into profile in android.</p>
| android | [4] |
5,148,123 | 5,148,124 | Android GestureLibrary save and gestureLibrary is readOnly | <p>I am posting this question after a lot of google searching
and after looking at the gesture builder source code, which I am using to create and save gestures.
The thing is my gesture Library that I am loading from a raw file gets loaded correctly but when I try to save a new gesture to it, it failed and the save me... | android | [4] |
2,092,049 | 2,092,050 | How to parse XML file in chunks | <p>I have a very large XML file with 40,000 tag elements.
When i am using element tree to parse this file it's giving errors due to memory.
So is there any module in python that can read the xml file in data chunks without loading the entire xml into memory?And How i can implement that module?</p>
| python | [7] |
477,264 | 477,265 | jQuery.browser or jQuery.support? | <p>Here's the problem. IE doesn't render a scrollable tbody in a table element right as far as I've tested (definitely not in IE8). Firefox does, and I've heard of most others. So I found a jquery plugin to make it scrollable.</p>
<p>So I figured, hey if IE is the only one that's not doing it, why not just call the jq... | jquery | [5] |
3,949,369 | 3,949,370 | set system setting "use only 2g networks" programatically | <p>how can i force the system to use 2g instead of 3g? there is an option for this in the system settings but i didn't find a function in the android-sdk to set this option!</p>
<p>thx</p>
| android | [4] |
5,573,408 | 5,573,409 | Importing csv from a subdirectory in Python | <p>My project has a bunch of csv files that may or may not be called based on user input. I'd like to store these files in a subdirectory to keep my project folder uncluttered. I'm utterly confused as to how to do this. Most of the resources I've dug up involve importing a module or package from a subdirectory rather t... | python | [7] |
2,558,060 | 2,558,061 | .delay() doesn' t work | <pre><code>$('.link').click(function(){
$paneTarget.stop().scrollTo('#due', 800, { margin: true } ).toggleClass('selected'),
$("body").delay(1000).animate({backgroundColor: "#1c6e7a"},800);
});
</code></pre>
<p>The delay function doesn't work in the example. If I remove the .delay value the code works, but... | jquery | [5] |
4,655,232 | 4,655,233 | Checking if user is using a specific locale | <p>I need to check if the locale of a user's device is Japanese. I'm doing the following:</p>
<pre><code>public boolean isJapaneseLocale() {
String locale = Locale.getDefault().toString();
locale = locale.toLowerCase();
return locale.startsWith("ja");
}
</code></pre>
<p>should that be sufficient? I'm gett... | android | [4] |
5,113,564 | 5,113,565 | Creating xml like the below format | <p>I want to create a XML file in csharp like the below format pls help me with the code</p>
<pre><code> <MasterEntries>
<fruit>Apple</fruit>
<animal>Fox</animal>
<color>Violet</color>
</MasterEntries>
</code></pre>
| c# | [0] |
4,263,629 | 4,263,630 | Serial Asynchrounous XmlHTTPRequest | <p>Is this a better way to do a serial asyn call. </p>
<p><a href="http://ajaxian.com/archives/serial-async-xhr" rel="nofollow">http://ajaxian.com/archives/serial-async-xhr</a></p>
<pre><code>function run() {
request1(function () {
request2(function () {
request3(function () {
... | javascript | [3] |
2,553,594 | 2,553,595 | Animation in ListView item doesn't work after scrolling | <p>I have animation in one listview item. After scrolling list when list item with animation started not visible I am scrolling back to the listview item with animation but animation doesn't work anymore.</p>
<pre><code>getView() method :
iv.setImageResource(R.drawable.anim);
iv.requestFocus();
((Animat... | android | [4] |
3,932,343 | 3,932,344 | Question about machine.config file | <p>It is known that we use web.config file to override the setting of machine.config file.</p>
<p>My questions are </p>
<p>a) how come machine.config file knows that only changes made in web.config file are to be overwritten. I mean to say, if I use some other name for the config file say xyz.config, will it be able ... | asp.net | [9] |
2,559,190 | 2,559,191 | NSDate getting the last day of a month? | <p>any one have a solution for that.</p>
<p>thanks</p>
| iphone | [8] |
1,462,335 | 1,462,336 | Cannot implicitly convert type 'string' to 'long' | <p>I have two tables in my MS Sql database, Course and StudyCase, with a FK ID (Course table) to Course_ID (in the StudyCase table). I am trying to find the StudyCase ID from the Course id.</p>
<p>In the Repository:</p>
<pre><code> public IQueryable<StudyCase> ListStudyCases(long courseId)
{
... | c# | [0] |
568,585 | 568,586 | Trim with php | <p>I have a sentence like this.</p>
<pre><code>1 $nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; 3 &nbsp; 4
</code></pre>
<p>As you see, in between 1 2 and 3 text, there are extra spaces. I want the output with only one space between them. so my output will be 1 2 3 4 </p>
<p>How can i use php trim to get t... | php | [2] |
1,282,682 | 1,282,683 | how to set two volume control in media player for two simultaneously playing sound in android | <p>i am making a media player apps in this apps i want to set two volume control seek bar for controlling two sound clip one is VOICE and another is BACKGROUND SOUND playing simultaneously by making two instance of media player.
i want to manage there volume separately</p>
| android | [4] |
5,641,821 | 5,641,822 | Create a Timer to send HTTP request Periodically - Android | <p>I want to end HTTP request from a Android device to a web server and check a particular data of a database periodically (once a minute). I couldn't implement a timer for this. Please guide me.</p>
<p>Thanks</p>
| android | [4] |
4,469,596 | 4,469,597 | How to decrypt hashed password using php? | <p>I'm currently using MD5 and SHA1 to save my users' passwords in a database but I don't know how to get them back in plain text. I tried to roll back same code I used to encrypt passwords but it gives me an error.</p>
<p>Code I'm using to encrypt passwords:</p>
<pre><code> $hashedpassword = md5(md5(sha1(sha1(md5(... | php | [2] |
4,931,788 | 4,931,789 | PHP: session expiring automatically on some servers | <p>I have a website built using PHP. My website consists of some Education Material/Documents which users can get only when they pay for it through clickbank. On the backend, their payment status will change from "Unpaid" to "paid".</p>
<p>But when I test it by paying on clickbank website and redirecting back to my we... | php | [2] |
367,030 | 367,031 | image upload on server | <p>I am trying to upload an image to server using iphone .
I haven't done it before.</p>
<p>But I am not getting how can i do it. </p>
<p>I know how to add text data on server.</p>
<p>But how to add the image data or an Image to server . Can any one suggest!?</p>
| iphone | [8] |
6,012,277 | 6,012,278 | Writing to the Authentification Popup | <p>I'm trying to write code in C# that accesses a website but i get a popup authentication. I've tried to write to code that would skip this page by entering it for the user but it still pops up. Any suggestions ?</p>
<pre><code>HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(@"http://example"));
request.... | c# | [0] |
3,755,061 | 3,755,062 | Using Named Parameters in java Class | <p>I have a use case to use named and optional parameter.I tried to use named parameter as in a tutorial but it doesn't work</p>
<p>My code is</p>
<pre><code>public static void Main(String[] args)
{
System.out.println((CalculateBMI(weight= 123, height: 64));
}
public static int CalculateBMI(int weight, in... | java | [1] |
685,059 | 685,060 | get html and text of highlighted (selected) elements (spans) and store text in hidden textarea | <p>I want to know how to get the html and text of spans that are selected. Example html:</p>
<pre><code><span>a</span>
<span>b</span>
<span>c</span>
<span>d</span>
</code></pre>
<p>so if I highlighted with my cursor (a-b)...I would get </p>
<pre><code>var storedHtml = ... | jquery | [5] |
5,592,271 | 5,592,272 | iPhone SDK 2.2.1 based app should be launched on iPhone 3.0 OS device | <p>My app was built with SDK 2.2.1 version even before 3.0 beta appear.</p>
<p>User going to install my app to the last iPhone 3Gs with 3.0 FW version. Will my app behave differently with last iPhone? Will items described <a href="http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.htm... | iphone | [8] |
1,425,383 | 1,425,384 | Are generics a form of polymorphism? | <p>Can we say generics are form of polymorphism?</p>
| c# | [0] |
1,580,387 | 1,580,388 | Prime Numbers in Python | <p>I was trying to write a program that would display the prime numbers between 2 and 200.</p>
<p>This is the program that i wrote.</p>
<pre><code>liste = [ ]
liste.append(2)
liste = [2]
for primeCandidate in range (2,10):
isPrime = True
for divisor in range (2,primeCandidate):
if primeCandidate % di... | python | [7] |
2,848,316 | 2,848,317 | how to convert decimal to binary in c++ | <p>I have a method to convert dec to bin </p>
<pre><code>QList<bool> widgetInput::decToBin(int number)
{
int remainder;
QList<bool> result;
if(number <= 1) {
result << number;
return result;
}
remainder = number%2;
decToBin(n... | c++ | [6] |
2,557,092 | 2,557,093 | Android camera:I want start camera and capture images automatically when i received a message from particular number,please help me | <p>I want start camera and capture images automatically when i received a message from particular number,please help me.</p>
| android | [4] |
893,832 | 893,833 | ASCII char to hexa value in C# | <p>How to convert ASCII char values example <code>'a'</code> to its eqvelent hexa value <code>41</code> ?</p>
| c# | [0] |
5,643,750 | 5,643,751 | Simple equation not calculating as expected |
<pre class="lang-java prettyprint-override"><code>System.out.println(300 + ((160 - 300) / (240 - 20)) * (27 - 20));
//Should print 295.5 but prints 300
System.out.println(300 + ((160 - 300) / (240 - 20)) * (26 - 20));
//Should print 296.1 but prints 300
</code></pre>
<p>I can't seem to figure out what's going wrong... | java | [1] |
3,049,772 | 3,049,773 | How can I set session timeout for 2-3 days in PHP? | <p>I would like to set my sessions to last for 2-3 days so that my users will not have to login to get data after days of being idle.</p>
<p>Please help me with the code to achieve this.</p>
| php | [2] |
1,272,554 | 1,272,555 | using merge with layouts giving error for one file, no error on other. same code! | <p>I am creating a few layouts with the root element being <code>merge</code>. inside the <code>merge</code> element i have a <code>ScrollView</code> containing a <code>TextView</code>. Here is the file:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com... | android | [4] |
502,006 | 502,007 | Is there a way to protect a php script from being used without a valid license? | <p>Is there any chance to restrict a php script from being shared and used without license? The scripts are paid and I am thinking what could be a way to prevent "sharing" this php script from happening. Is this possible or impossible? Because the code is open and I can't encrypt all of it.</p>
<p>I came to a conclusi... | php | [2] |
3,945,418 | 3,945,419 | emulator throwing hostunresolved exception in android? | <p>i have as my first activity in my application a request to a certain address, from where i get XML and then i parse it...
I have added the permission on for internet access in my android.manifest file.</p>
<p><strong>my problem</strong></p>
<p>whenever i run my application on my emulator the following exception is... | android | [4] |
1,191,409 | 1,191,410 | Toggle div states won't work on self clicks | <p>What I want: to have a divs toggle between show/hide associated divs on click. This would include if I click on a link and then re-click same link it should toggle states.</p>
<p>What I am using </p>
<pre><code>function toggleVisibility(newSection) {
$(".section").not("#" + newSection).hide();
$("#" + ... | jquery | [5] |
1,149,651 | 1,149,652 | ASP.NET tooltips | <p>I'm using VS2010,C# to develop my ASP.NET web app, I'm going to display some small and simple tooltips over my objects, I want to be able to set tooltip text from codebehind, what are my options (solutions for all browsers)? how can I find some easy-to-use tooltips with usage tutorials?</p>
<p>thanks</p>
| asp.net | [9] |
4,792,762 | 4,792,763 | Problem with extra space at the bottom of android Webview | <p>I have an Webview in my application where i display the html content using loadData() method. The Problem is HTML content is displayed along with some extra space at the bottom, I could not understand why the white space is coming. This problem is occurring only in Motorola Milestone device(Android 2.1). Please some... | android | [4] |
794,080 | 794,081 | jquery addClass not working after ajax call | <p>hello i made a code which required to add a class after the ajax call . I am sure the code is right but still the class is not being added . Its really strange as everything else in code works and i am sure the code for addClass is right also i have checked console for any errors but there are no errors . here is my... | jquery | [5] |
4,711,740 | 4,711,741 | Javascript to substring hours minutes and seconds | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1493407/how-to-split-a-string-in-javascript">how to split a string in javascript</a> </p>
</blockquote>
<p>Please help me to substring and separate the below string in three variables using javascript. </p>
<pr... | javascript | [3] |
1,328,081 | 1,328,082 | How to display custom title and action bar at the bottom of the screen in android | <p>Im facing an issue in supporting the menu options in <strong>android 4.0 and above</strong>.
I have managed to display the action bar with the menu options. I also got a workaround to be able to display the action bar at the bottom.
But im unable to add a custom title which was already existing in the app supporting... | android | [4] |
5,589,817 | 5,589,818 | Php, DirectoryIterator | <p>I am trying to understand part of the output I get from this code:</p>
<pre><code><?php
class DirectoryReader extends DirectoryIterator
{
function __construct($path)
{
parent::__construct($path);
}
function current()
{
return parent::getFile... | php | [2] |
3,474,657 | 3,474,658 | Javascript - object key->value | <pre><code>var obj = {
a: "A",
b: "B",
c: "C"
}
console.log(obj.a); // return string : A
</code></pre>
<p>but i want to get by through a variable like this</p>
<pre><code>var name = "a";
console.log(obj.name) // but return undefined
</code></pre>
<p>How to do this?</p>
| javascript | [3] |
2,806,046 | 2,806,047 | JQuery: Why using .find() | <p>why are some developers using JQuery's .find-function like this:</p>
<pre><code>$(document).find('.progress').show();
</code></pre>
<p>If you know the name of the class, you can just use:</p>
<pre><code>$('.progress').show();
</code></pre>
<p>Even if i have ul-lists and want to select all li-children i can do th... | jquery | [5] |
1,845,005 | 1,845,006 | jquery review image | <p>I want to put the image url into an input box, after click the botton, I can review the image at onece.</p>
<p>But in my code, Why I can not put the image url into the <code>jquery.html</code> code? </p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1">
<meta http-equiv="Cont... | jquery | [5] |
6,018,089 | 6,018,090 | INSTALL_REFERRER Intent not working in above 3.2 version | <p>We developed an application based on INSTALL_REFERRER intent.
Our application tries to retrieve the utm parameters sent at the time
of installation from Google Play.
We are successfully able to receive the intent (with utm parameters)
on Android 2.3.5 device, but the same intent is not being received on
Android 3.2.... | android | [4] |
215,532 | 215,533 | in a "for" loop, is the Terminating Condition Re-Evaluated on Each Iteration? | <blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/6093537/for-loop-optimization">for loop optimization</a><br>
<a href="http://stackoverflow.com/questions/4477296/for-loop-optimization-needed-or-not">for-loop optimization - needed or not?</a> </p>
</blockquote>... | c# | [0] |
1,064,028 | 1,064,029 | How to find a string right after the searched string from a text file using Java? | <p>I have text file in which I have following content.</p>
<pre><code>Name Sahar Hassan
Age 26
</code></pre>
<p>I have wrote a Java code to find the location of the word "Name" and it works fine. I want to output the string right after the word "Name", that is "Sahar Hassan".</p>
| java | [1] |
904,212 | 904,213 | How and where to add custom xml in my android app? | <p>I want to add one xml file(which is having some static data of the application) to my android app and important thing is that we can't add those data to string.xml file. Whenever application launched at that time it should load all static data from the xml to some data structure.</p>
<p>Problem:
1. how to add xml t... | android | [4] |
5,020,092 | 5,020,093 | How to separate Name list from File System in Android | <p>Can we separate the List of only names from the data from file system as </p>
<pre><code>Name Age Sex Address
dani 21 Male US
ron 34 Male NY
stella 23 Female NY
steave 43 Male US
[End]
</code></pre>
<p>I have tried to set the Delimiters as'\t' in above data while inserting into file.<b... | android | [4] |
5,757,360 | 5,757,361 | Get immediate nect drop down to the current dropdown | <p>Here is my HTML Code. </p>
<pre><code> <table>
<tr>
<select class="dropdown">
<option value="">Select answer</option>
<option value="1" selected="selected">A</option>
<option value="2">B</option>
<option value="3">C</option>
&... | jquery | [5] |
5,544,925 | 5,544,926 | Replace default android media volume toast | <p>My requirement is to replace the default volume toast with a customized one.Is there any solution?</p>
| android | [4] |
4,700,463 | 4,700,464 | FALSE if statements | <p>I'm looking for a good explanation for what is the differences/advantages to using which of the following:</p>
<p><code>if (!$whatever)</code> or <code>if ($whatever == FALSE)</code></p>
| php | [2] |
4,754,455 | 4,754,456 | How to loop animation with delay? | <p>I have images that change every 5000ms and I wanted to put subtitles on them. I have this:</p>
<pre><code> function showEl1(){
$('#wrap').animate({
left: '-450',
}, 500, function() {
$('#wrap').html($('#el1').html());
}).animate({ left: '70',}, 5... | jquery | [5] |
3,384,538 | 3,384,539 | PHP design advice | <p>I've been working on a website, and currently at the stage of login/session handling.</p>
<p>I want to know what is a better design in your opinion. (this website will be available to the public, so it should be user-friendly too).</p>
<p>P.S. sorry if this is not the correct php 'conventions', I am used to c/c++ ... | php | [2] |
4,326,203 | 4,326,204 | How would I go about cropping an image automatically on the server? | <p>Like at Digg.com, I want to get members' pictures cropped for an avatar use. Please show me how to do this in PHP.</p>
| php | [2] |
5,742,275 | 5,742,276 | Object of another class in another class member function | <p>I have following code:</p>
<pre><code>class A
{
public:
A();
private:
void slot();
};
</code></pre>
<p>The second class B looks like:</p>
<pre><code>class B
{
public:
B();
private:
// Some stuff...
};
</code></pre>
<p>In file1.cpp there are static objects of both classes:</p>
<pre><code>static... | c++ | [6] |
2,221,589 | 2,221,590 | Simple function in PHP with Calculation | <p>I am making very simple program in PHP . Tryig to addition first ..</p>
<p>But dont know .. </p>
<p>Here is code </p>
<pre><code><?php
$a=12;
$b=10;
$c="+";
$res=$a."$c".$b;
echo $res;
?>
</code></pre>
<p>it output 12+10 as it is concecate.. </p>
<p>$c is anything.</p>
<p>Any idea how to do this</p>
| php | [2] |
2,938,537 | 2,938,538 | How to set the image for imageview from library wheen we click on imageview? | <p>I am developing an application.In that I want to set the image for imageview.So when iam click on imageview,in that time only library will be open.For that i use the below method.But library will be opened at every click at every where.</p>
<pre><code>-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event.
<... | iphone | [8] |
2,448,455 | 2,448,456 | URL Facebook redirected to https://www.facebook.com/xampp/ | <p>any idea on how can i solve these problem? when i am going to www.facebook.com, i will be redirected to <a href="https://www.facebook.com/xampp/" rel="nofollow">https://www.facebook.com/xampp/</a> or lets jst say the local xampp in my pc. Please could anyone help me?</p>
| php | [2] |
3,344,999 | 3,345,000 | javascript getDate issue | <p>I was wondering if anyone could help me get the leading zero to show up when I do a getDate? Right now it's showing up as 8/3/2010 ... I would like it 08/03/2010.</p>
| javascript | [3] |
1,895,491 | 1,895,492 | How to number arrays? Why doesn't this code work? | <p>This is my JavaScript code:</p>
<pre><code>Array.prototype.number = function () {
var tempNum = this;
for (i in this) {
tempNum[i] = tempNum[(i + 1)] + ". " + tempNum[i]
}
return tempNum;
}
</code></pre>
<p>What I am trying to do is simple: number each item in an Array.</p>
<p>So I want to... | javascript | [3] |
3,770,051 | 3,770,052 | Android - display a persistent view over all activities | <p>I'd like to recreate a functionality similar to a Swing GlassPane to be able to display animations while the user uses the app "below" normally. I cannot simply create a separate layout and attach it to each activity since the animation state would be lost when switching activities.
Is there a way to keep a persiste... | android | [4] |
860,620 | 860,621 | Custom alert using Javascript | <p>How can I create a custom alert function in Javascript?</p>
| javascript | [3] |
693,227 | 693,228 | Remove all class from an element matching a specific format, using jQuery | <p>I asked a similar question earlier, however my wording provided correctly submitted answers but not for the question I was actually trying to answer:) In an attempt to not muddle SO's listings, I've posted this question separately.</p>
<p>Given the HTML below, what is the most convenient means of removing all the <... | jquery | [5] |
1,880,211 | 1,880,212 | Comparing 2 Integer values are giving different output | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3351837/java-question-about-autoboxing-and-object-equality-identity">Java question about autoboxing and object equality / identity</a> </p>
</blockquote>
<pre><code>Integer i1 = 10;
Integer i2 = 10;
Integer i3 =... | java | [1] |
1,543,058 | 1,543,059 | object will not return from prototype function | <p>I instantiate an object like this: ( I mean to say object when I say array )</p>
<pre><code>text_object = new SText( form_elements );
</code></pre>
<p>I call it like this for purposes of debug:</p>
<pre><code>console.log('text_array in caller' + ( text_object.getArray().toSource() ) );
</code></pre>
<p>And the a... | javascript | [3] |
553,447 | 553,448 | How to get the DialogResult in android? | <p>I want to create a DialogAlert with two buttons 'YES' and 'NO'. I want to capture the result of the Dialog in a boolean variable. Suppose the user clicks the 'YES' button then the DialogResult Should return a true Value and if the user clicks the 'NO' button then the DialogResult should return a False value. Please ... | android | [4] |
5,449,872 | 5,449,873 | jQuery Doesnt work In Windows 8 jScript App | <p>I started getting up to speed with the whole Windows 8 JavaScript development.</p>
<p>I have a basic app up and running using pure JavaScript, but I want to use jQuery since I love using the library, I added the script src to my default page, added some basic jQuery functionality, and all I get when running the deb... | jquery | [5] |
5,832,026 | 5,832,027 | How to get PID of all running Java applications programmatically? | <p>I need to find the PID of all running java applications using my program.</p>
| java | [1] |
2,307,191 | 2,307,192 | Converting JavaScript into PHP code: Is year a leap year? | <p>The function should take a date as its parameter and return <code>true</code> or <code>false</code>. Here is a JavaScript model of what I need:</p>
<pre><code>function isLeapYear(date) {
var year = date.getFullYear();
if (year % 4 == 0)
if ((year % 100 != 0) || (year % 400 == 0))
return ... | php | [2] |
5,656,568 | 5,656,569 | session is not woking in my login script | <p>session is not woking in my login script. What is wrong with this code. When I echo $_SESSION['userid'] in same file, it shows the userid. But when I echo that another file, there is no any response.</p>
<pre><code><?php
session_start();
include '../../classes/check.class.php';
include '../../classes/user.class... | php | [2] |
4,576,586 | 4,576,587 | php code to find the difference between two dates | <p>I want to calculate difference between two dates.</p>
<p>I am new in php.......</p>
<p>I have a field called last login in which date and time entered if user gets login and with this calculation i can block the user if he does not login in 15 days so i need to calculate number of days.</p>
<p>Please help me full... | php | [2] |
5,794,651 | 5,794,652 | Drawing over my own custom View | <p>I've created my own View (in which I draw on Canvas), and I want to make another Layer (with buttons etc.) on top of it. How can I do this? </p>
| android | [4] |
1,052,438 | 1,052,439 | Fill up an array IF statement | <pre><code><?php
if ($handle = opendir('gallery3/var/thumbs/Captain-America/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";?><br/><?
echo rtrim($file, '.jpg');?><br/><?
$name... | php | [2] |
1,094,813 | 1,094,814 | jQuery toggle functions only assign a css to an element for a second (then removes it)? | <p>I have this HTML:</p>
<pre><code> <div class="user-contribution">
<p class="user-review"> Review</p> 2. Animate this
<a class="user-review-toggle" href="#">Read more...</a> // 1. Clicking this
</code></pre>
<p>this CSS:</p>
<pre><code> .user-contribution {
... | jquery | [5] |
5,111,337 | 5,111,338 | jQuery selector for newer HTML5 inputs not working | <p>I have an array that outputs inputs, with a type of number, but i cant seem to get the selector to find it. Is it not supported?</p>
<pre><code>$('#container :text').each(...
$('#container input:number').each(...
$('#container :number').each(...
</code></pre>
<p>None of them find the input values. What am i missin... | jquery | [5] |
2,893,325 | 2,893,326 | Maintaing a map of buffered stream and closing in the end | <p>My applications does continuous disk i/o through 10 threads. The cpu profile is coming very high around 100%, i was planning to make it to 1 separate writer thread.</p>
<p>Also I was thinking if i can maintain a Cache of Buffered Writers and so do not have to continuously open the streams. Does anyone see a problem... | java | [1] |
3,708,864 | 3,708,865 | set image width with php? | <p>I am creating a custom blog with php. when the user is uploading an article I am having problem with the images in the post. some images's width are bigger than the main div in my blog (740). I want to use php to check the width of the images if it is bigger than 740 then re-size the image to 740.</p>
<pre><code>... | php | [2] |
2,683,364 | 2,683,365 | jQuery hover opacity IE8 | <p>This is for a thumbnail - a simple opacity set then hover function.</p>
<p>What am I missing? This is working in most browsers (including IE7) but in IE8 I get nothing.</p>
<pre><code><script type="text/javascript">
$(function() {
// set opacity on page load
$(".image-thumb").css("opacity... | jquery | [5] |
3,457,981 | 3,457,982 | Android: dynamically Creating a list of objects each with their own buttons and EditTexts | <p>I want to dynamically add rows to a linear layout where each row would have 2 buttons and 2 edittexts. I am not sure the best way to organize this. I had the idea to creating a class for each row with the buttons and edittexts in them but FindViewByID doesn't work that way. The other thought was to include an instan... | android | [4] |
339,060 | 339,061 | Failed to load libGL.so in android | <p>i am using unbuntu 12.04 with oracle jdk 7, when i am running Android emulator form eclipse, it's giving this error</p>
<pre><code>[2012-07-04 02:52:10 - Emulator] error libGL.so: cannot open shared object file: No such file or directory
[2012-07-04 02:52:10 - Emulator] Failed to load libGL.so
</code></pre>
<p>als... | android | [4] |
761,185 | 761,186 | How can a virtual directory path appear case sensitive? | <p>Hopefully I can explain completely providing real info</p>
<p>To start with then we have a LinkButton whose text is actually an image tag.</p>
<p>The image it links to is a Png and resides in a folder in the web directory. This is IIS V6 and win Server 2003.</p>
<p>The path is <a href="http://webaddress/Admin/Im... | asp.net | [9] |
3,386,900 | 3,386,901 | retainAll not printing the values | <p>hi i am trying to get common values from two string lists... List A has a values obtained by querying the Excel database and List B has a values obtained by querying the SQL database. i want to have common values from A and B. for that i used retainAll collection. but it is not printing the common values.instead its... | java | [1] |
5,792,436 | 5,792,437 | Overwrite app.config with the default one | <p>How can I overwrite the app.config file form the App Data folder with the default one by code?</p>
| c# | [0] |
616,491 | 616,492 | Is Java only way to write apps for Android? | <p>I've searching the Internet for the answer but I can only find answers either that are too old, are confusing or people not answering the question but rather telling to learn Java.</p>
<p>My basic questions are:</p>
<ol>
<li><p>Is Java the only way to write apps for Android?</p></li>
<li><p>This question will cont... | android | [4] |
5,227,971 | 5,227,972 | Object Behaviour | <p>Can anyone explain the behaviour of the below code. The output of the below code is string "str" and i's value is 100.</p>
<p>But why is it so? After setting object c1 = null, why isn't it null?</p>
<pre><code>public class Class1
{
public int i;
public Class1()
{
i = 10;
}
public s... | c# | [0] |
2,603,428 | 2,603,429 | Animation clipping image | <p>I want to get a animation clipping image effect but I don't know how. This don't work.</p>
<pre><code>#img {
background: url('i1.jpg');
width: 0;
height: 0;
}
<a href="#">link</a>
<div id="img"></div>
$(function(){
$('a').click(function(){
$('img').animate({
... | jquery | [5] |
2,896,222 | 2,896,223 | Python String Literals and Escape Sequence | <p>I have a string </p>
<p><strong>'"No, thanks, Mom," I said, "I don't know how long it will take."'</strong></p>
<p>I assign it to a variable foobar</p>
<pre><code>>>> foobar = """'"No, thanks, Mom," I said, "I don't know how long it will take."'"""
</code></pre>
<p>But when I print I get</p>
<pre><code... | python | [7] |
4,441,987 | 4,441,988 | disable buttons in aspx page | <p>I am trying to disable buttons in an aspx form. This works:</p>
<pre><code>btnSave.Attributes.Add(
"onclick",
"this.disabled=true;this.value='Saving...';needToConfirm=false;" +
ClientScript.GetPostBackEventReference(btnSave, "").ToString());
</code></pre>
<p>But there are two buttons on the form and I... | asp.net | [9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.