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 |
|---|---|---|---|---|---|
318,632 | 318,633 | Broser back button | <p>How to resolve the issue- Browser back button appears when I directly hit the url of a specific page when IFRAME is used in that particular page.</p>
<p>Its appearing IE 8, IE9, IE 7. where as in mozilla its working fine. For example if I have code like below in one page of my website:</p>
<pre><code><iframe sr... | javascript | [3] |
5,466,299 | 5,466,300 | Highlight a text on PDF & save the higlighted document | <p>I want to highlight a text on PDF & save the document containing the highlighted text.</p>
<p>Is it technically feasible with existing Android API (till OS ver 3.0)?</p>
<p>Kindly provide your suggestions regarding the feasibility.</p>
| android | [4] |
143,372 | 143,373 | Kindly provide the source code to determine the last item in the ListView | <p>I am trying to implementing pagination in Android.
Currently I am displaying in ListView , a list of 10 items where the data for the list items exist in the database.</p>
<p>Each list item contains an thumbnail Image Url , a text data</p>
<p>I have the following requirement.
i> When the user scrolls to the 10 th... | android | [4] |
280,232 | 280,233 | How do I fix Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] with Ice Cream Sandwich VM image? | <p>I get an error, <code>Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]</code> when installing to the Google APIs version of the ARM EABI v7a system image, revision 1.</p>
<p>How do I fix it? Why is it there?</p>
| android | [4] |
839,983 | 839,984 | What's the main difference between stdlib.h and cstdlib in C++? | <p>I'm using EXIT_FAILURE macro, so I need to include stdlib.h or cstdlib. But I don't know what the difference is. Should I use cXXX style header file rather than XXX.h?</p>
<p>Thank you.</p>
| c++ | [6] |
2,212,864 | 2,212,865 | Customise Android Gallery | <p>The following requirement is there for my mobile application:</p>
<ol>
<li>The Android default Gallery is displayed which contains the list of photo album.</li>
<li>If the user selects a particular album , all the images with checkbox are displayed.</li>
</ol>
<p>I have already developed a source code which fetche... | android | [4] |
1,666,059 | 1,666,060 | How to concate array elements on value basis in php | <p>I have array like this :</p>
<pre><code>Array
(
[attribute] => Array
(
[0] => sku
[1] => sku
[2] => attribute_set_id
)
[value] => Array
(
[0] => 1, 2, 3
[1] => 3, 4
[2] => 4
)
)
... | php | [2] |
3,089,508 | 3,089,509 | When should one use .innerHTML and when document.write in JavaScript | <p>Is there a general rule, when one should use document.write to change the website content, and when to use .innerHTML?</p>
<p>So far my rules were:</p>
<p>1) Use document.write when ADDING new content</p>
<p>2) Use .innerHTML when CHANGING existing content</p>
<p>But I got confused, since someone told me that on... | javascript | [3] |
1,193,432 | 1,193,433 | forcing page download in php | <p>How do I force the browser to download the current page browsed to? a page with the header Content-type: text/plain for example using PHP?</p>
<p>If a user navigates to that page, a download box should appear (the browser download dialog with the usual "Save As"</p>
| php | [2] |
501,037 | 501,038 | Use jQuery to make element on page modal (not dialog) | <p>I'm fairly new to jQuery, so hopefully this isn't too tough. I'll try to stick to a simple example. </p>
<p>Let's assume I have a web page with a div on it (could be other elements such as img, span, etc). When the user hovers over that div, I'd like the div to remain unchanged, but have an overlay applied to every... | jquery | [5] |
2,664,816 | 2,664,817 | activate speakar of iphone programmitically | <p>i want to make a call and activate speaker of iphone programatically.</p>
<p>can any one tell me , how to activate and deactivate speaker mode of iphone through code.</p>
<p>Thanks in advance.....</p>
| iphone | [8] |
2,383,235 | 2,383,236 | How to remove $ from javascript variable? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4846978/remove-characters-from-a-string">Remove characters from a string</a> </p>
</blockquote>
<p>I have a variable <code>p</code> which I would like to remove the <code>$</code> from. This variable will be a n... | javascript | [3] |
3,114,057 | 3,114,058 | jquery ui button icon change dynamically | <pre><code>$("#slideshowadvanceconfig").button({
icons:{ primary: 'ui-icon-circle-arrow-e'} }).toggle(function () {
$(this).button("option", { icons: { primary: 'ui-icon-circle-arrow-s'} });
$(".settings").slideDown('slow'); },
function () { $(this).button("option", { icons: { primary: 'ui-icon-circle-arrow-e'} ... | jquery | [5] |
3,062,832 | 3,062,833 | PHP pathinfo gets fooled by url in quert string. Any workaround? | <p>I am working on a small function to take in a url and return a relative path based on where it resides itself.</p>
<p>If the url contains a path in the query string, <code>pathinfo</code> returns incorrect results. This is demonstrated by the code below:</p>
<pre><code>$p = 'http://localhost/demos/image_editor/dir... | php | [2] |
3,914,822 | 3,914,823 | eregi_replace depreciated im still lost | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8679656/deprecated-function-eregi-replace">Deprecated: Function eregi_replace()</a> </p>
</blockquote>
<p>i have an error that reads:</p>
<p>Deprecated: Function ereg_replace() is deprecated in /home/socia125/p... | php | [2] |
5,842,359 | 5,842,360 | Bluetooth socket only returns null. Android Bluetooth | <p>Iam trying to connect to a socket by using the <code>connect</code> method. Iam generating a String containing the UUID like this:</p>
<pre><code>MY_UUID = UUID.fromString("45341da0-c9c1-11e1-9b21-0800200c9a66");
</code></pre>
<p>Then constructing a <code>BluetoothSocket</code> like this: </p>
<pre><code>Bluetoot... | android | [4] |
3,983,434 | 3,983,435 | Calculate Array values using For-In Loop | <p>I have the following Javascript. I am trying to calculate the total of the myCosts array values using the 'for in; loop and then display them on the page. I think i am nearly there.</p>
<pre><code>function enterFood()
{
var myFoods = new Array()
var myCosts = new Array()
for (i = 1; i <= 5; i++)... | javascript | [3] |
4,547,812 | 4,547,813 | File listing problem through apache | <p>I want list files of a particular directory using php exec function. I have used this </p>
<pre><code>exec('ls /home/vikas/hft/a5/traders/sa/*.bin', $NameOfBinaries);
</code></pre>
<p>code for listing the bin files from <code>/home/vikas/hft/a5/traders/sa/</code> directory. It works fine when I run the script in C... | php | [2] |
1,105,052 | 1,105,053 | What changes must be made in an android app to run only on a specific phone model? | <p>For a android app what changes must be made to run on a specific phone model?</p>
| android | [4] |
743,628 | 743,629 | Can't change src in image with jquery | <p>I can't change the image with jquery: whats going on??</p>
<pre><code><!DOCTYPE HTML>
<HTML>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script text="text/javascript">
$('#caccia').attr('src', '2.png');
</script&... | jquery | [5] |
2,885,634 | 2,885,635 | Adding phone number to iphone contact - but NOT replacing! | <p>I am trying to replicate the behavior that the iphone that happens when you tap and hold on a phone number link in a text field you get a menu "create new contact" and "add to existing contact". I have this working except for one thing. In the "add to existing" apple implementation if there is already a home conta... | iphone | [8] |
2,743,541 | 2,743,542 | focus to text box | <p>I created a form with a label, textbox and a button. In the form load event I called the focus() function for the textbox. But when I run my code the cursor is not coming to textbox. I need the cursor to go to text box as soon as the form is loaded. How to do it?</p>
| c# | [0] |
5,015,690 | 5,015,691 | How to fill a DataTable with the result of a LINQ? | <p>I have a method that calls a stored procedure. It uses the employee number as a parameter to retrieve the data of a particular employee and then fills the data table with the result.</p>
<pre><code>protected DataTable CreateDT(string empNo)
{
DataTable dataTable = null;
try
... | c# | [0] |
2,402,168 | 2,402,169 | how to check value of undefined $_POST variable index? | <p>My question is that how can we check value in posted variables in $_POST without defining them as you can see in the code.</p>
<pre><code>if ($_SESSION["Admin"]=="" AND $_REQUEST[act]!="show_login" AND
$_REQUEST[act]!="chk_login" ) { #not logged in show_login();
return;
</code></pre>
<p>I am getting these e... | php | [2] |
5,425,835 | 5,425,836 | print preg_place unexpected error | <p>I have the following code:</p>
<pre><code>print "<a href='".preg_replace($replace, '-', $name."-pid-".$id.".html'>";
</code></pre>
<p>and receive the following error:</p>
<pre><code>Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\s.php on line 98
</code></pre>
| php | [2] |
3,988,787 | 3,988,788 | How to override toString() properly in Java? | <p>Sounds a little stupid, but I need help on my toString() method and it is very irking.
I tried looking up online because the toString is the one where it is screwing up and "not finding Kid constructor #2" even though it is there and I would even do something else and it doesn't work.
Ok that was a lot so here is m... | java | [1] |
3,651,568 | 3,651,569 | Sets module deprecated warning | <p>When I run my python script I get the following warning</p>
<pre><code>DeprecationWarning: the sets module is deprecated
</code></pre>
<p>How do I fix this?</p>
| python | [7] |
2,598,828 | 2,598,829 | Why should I fix E_NOTICE errors? | <p>As a developer, I work with E_NOTICE turned on. Recently though, I was asked why E_NOTICE errors should be fixed. The only reason that I could come up with was that it is best practice to correct those problems.</p>
<p>Does anyone else have any reasons to justify the extra time/cost spent to correct these problems?... | php | [2] |
5,900,971 | 5,900,972 | Removing an anchor tag surrounding selected images in jquery | <p>I have a piece of code that, when the page loads, checks through a series of images and sees whether their id contains the word video.</p>
<p>If it does, I want to be able to remove the anchor tag surrounding the image. However, teh way that I am currently doing this (through .remove()) removes the image as it is w... | jquery | [5] |
1,753,584 | 1,753,585 | What are the ranges of bands that Android provide in Equalizer class? | <p>By default there are 5 bands that android provide in its Equalizer class.
I wan to know what are the ranges of each band.</p>
<p>That is what is the starting & final range(Hz/KHz or any other unit) of each band.</p>
<p>Thanks in advance</p>
| android | [4] |
5,401,408 | 5,401,409 | Should you use return or else? Which of these is optimal? | <p>Which of these is more optimal? Does it matter which one you use?</p>
<pre><code>If (condition is true)
{
MessageBox.Show("bad data");
return;
}
//mode code here
</code></pre>
<p>or</p>
<pre><code>If (condition is true)
{
MessageBox.Show("bad data");
}
else
{
//mode code here
}
</code></pre>
| c# | [0] |
4,104,253 | 4,104,254 | Ant: not able to find tools.jar | <p>when I type Ant in command line..
I get following error.. </p>
<p>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed</p>
| java | [1] |
3,644,707 | 3,644,708 | Code needs to work for more possibilities | <p><strong>The Question</strong></p>
<pre><code>is_match:
(str, str) -> bool
</code></pre>
<p>The first parameter is a puzzle and the second is a view. Return True iff the view could be a view of the given puzzle.</p>
<p><strong>My Answer</strong></p>
<p>I came up with this:</p>
<pre><code>def is_match(puzzle, ... | python | [7] |
200,486 | 200,487 | Generating unique ID based on hardware/server | <p>Is it possible to generate a unique ID based on server hardware/OS? I want to generate license keys for my PHP web app based on customer server, just like Atlassian JIRA does.</p>
<p>Thanks for your help.</p>
| php | [2] |
1,695,124 | 1,695,125 | "The process cannot access the file 'D:\dup.jpg' because it is being used by another process." | <p>Can anyone guide me in this issue..</p>
<p>How can i avoid this exception in VC# -- </p>
<blockquote>
<p>"The process cannot access the file 'D:\dup.jpg' because it is being
used by another process."</p>
</blockquote>
<p>Have a solution from Adi which doesnt worked out at all..</p>
<p>Snippet of Code is here... | c# | [0] |
1,404,141 | 1,404,142 | Datatype for "NaN" in validation process | <p>Goal:<br>
Evaluate a specifik value in my validation code</p>
<p>Problem:<br>
The variable "currentValue" can retrieve a value named "NaN". And i don't know what kind of datatype that shall be applied in the my validation process. </p>
<p>Based on my previous test, NaN is neither a string or int or something simil... | jquery | [5] |
5,479,559 | 5,479,560 | Script Redirecting Even when valid | <p>This is a little script that supposed to redirect if someone came from a different page, but it's does not work.
It keeps redirecting to the form page.</p>
<p>Here's the code</p>
<pre><code><?php
define('FORM', 'form.html');
$referer = $_SERVER['HTTP_REFERER'];
// this keeps redirecting even when I came by s... | php | [2] |
1,454,431 | 1,454,432 | Close only target object | <p>I use this quick snippet with an image to close a <code>show</code>/<code>hide</code> <code>DIV</code>:</p>
<pre><code> $('a.close').click(function() {
$('#timeline-2010-1').hide();
$('#timeline-2010-2').hide();
return false;
});
</code></pre>
<p>The problem is that when I close one box all o... | jquery | [5] |
3,862,273 | 3,862,274 | How can I declare a variable outside of a block when the variable defines an anonymous class in C# | <p>I have the following code and it works good:</p>
<pre><code>var _data = (from qu in _que.GetAll(
u => u.company == "GE" )
select new {
qu.name,
qu.address
});
</code></pre>
<p>The signature of the GetALL method is </p>
<pre><code>ICollection<T> GetAll(Expression<Func<T, bool>> pre... | c# | [0] |
1,007,117 | 1,007,118 | Converting PHP strings to binary format and reconverting them when connecting to server | <p>I'm looking to code a php script that would connect to a server using binary protocol, send queries and receive data from it. I wondered how I can implement this in php? So far I have:</p>
<pre><code><?php
$fp = fsockopen("111.111.10.10", "2222", $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br... | php | [2] |
2,333,069 | 2,333,070 | network path not found error for local machine | <p>I am testing an application on my local machine to create a file. The network path I have set for testing to <code>\\127.0.0.1\NEWFILE\test1.txt</code>. I am getting "network path not found" error message. What could be the problem?</p>
<pre><code>filePath = @"\\127.0.0.1\NEWFILE\test1.txt";
File.WriteAllText(file... | c# | [0] |
4,310,885 | 4,310,886 | Issue with AspectJ properties | <p>When i am using maintainJ for reverse engineering with my application i am getting the following error.
Please assist us with fix</p>
<p>---- AspectJ Properties ---
AspectJ Compiler 1.6.11 built on Tuesday Mar 15, 2011 at 15:31:04 GMT
---- Dump Properties ---
Dump file: ajcore.20120507.210546.187.txt
Dump reason: j... | java | [1] |
5,386,914 | 5,386,915 | Android list view on click | <p>i have a list view with 15 items. when i click on any item i want to change the screen(Intent). how can i change the activity on item selected in android?
any tutorial or source code?</p>
<p>thanks in advance.</p>
| android | [4] |
483,910 | 483,911 | Hot to use the second parameter of lastIndexOf() method in javascript string object? | <pre><code>"This apple is my apple".lastIndexOf("apple"); // returns value of 17
"This apple is my apple".lastIndexOf("apple",12); // returns value of 5
"This apple is my apple".lastIndexOf("apple", 3); // returns value of -1, not found
</code></pre>
<p>Hi guys!</p>
<p>I understand the first two examples,but why the ... | javascript | [3] |
4,570,093 | 4,570,094 | error in the following code near throw IOException | <pre><code>import java.io.*;
import java.lang.*;
public class Propogate1
{
String reverse(String name)
{
if(name.length()==0)
throw IOException("name");
String reverseStr="";
for(int i=name.length()-1;i>0;--i)
{
reverseStr+=name.charAt(i);
}
return reverseStr;
}
public static void main(String[] args)throw... | java | [1] |
3,474,568 | 3,474,569 | JS: join()-ing an array of objects | <p>Say I have an array of objects that I want to be able to access as hashes sometimes (to change their values, eh?) and sometimes print. </p>
<pre><code>var test = { members : [] };
test.addMember = function(name, value) {
this.members[name] = { name : name, value : value };
this.members[name].toString =... | javascript | [3] |
531,182 | 531,183 | jqgrid error when deleting row | <p>I do some testing on jquery jqgrid but has problems :</p>
<pre><code>jQuery("#navgrid").jqGrid(
"navGrid",
"#pagernav",
{}, //options
{}, // edit options
{}, // add options
{
afterSubmit : function(response, postdata)
{
if(r... | javascript | [3] |
1,501,107 | 1,501,108 | Append Vs AppendChild JQuery | <p>included the sample code.</p>
<pre><code>function addTextNode(){
var newtext = document.createTextNode(" Some text added dynamically. ");
var para = document.getElementById("p1");
para.appendChild(newtext);
$("#p1").append("HI");
}
<div style="border: 1px solid red">
<p id="p1">Firs... | jquery | [5] |
893,314 | 893,315 | Generate gamma and normal distribution in Java? Has anyone done this before? | <p>Has anyone generated Gamma or truncated normal distribution in Java before? I don't think it is in the built-in package.</p>
<p>I have found this for Gamma:
blog.javia.org/docs/Gamma.java</p>
<p>I just tried these 3:</p>
<ol>
<li><p>SSJ from University of Montreal
<a href="http://www.iro.umontreal.ca/~simardr/... | java | [1] |
2,301,869 | 2,301,870 | No enclosing instance of type fbMain is accessible. Must qualify the allocation with an enclosing instance of type fbMain | <p>So in my class declared as "<strong>public class pcb</strong>", I have the following constructor: <strong>public pcb(int p, int a, int b).</strong></p>
<p>In <strong>public static void main(String[] args)</strong> I try to call the constructor in a for loop where I add a "pcb" into a different position in an array.... | java | [1] |
2,950,966 | 2,950,967 | How do I start from a specified value in an array? | <p>For example:</p>
<pre><code>String[] someArray = {null, "I want to start from here", "other element", "other element"};
for(int i = 1; i < someArray.length; i++)
{
System.out.println(someArray[i]);
}
</code></pre>
<p>Is there way to set the inital index of an array other than setting the first element to n... | java | [1] |
2,856,628 | 2,856,629 | How can I remove all empty values when I explode a string using PHP? | <p>I was wondering how can I remove all empty values when I explode a string using PHP for example, lets say a user enters <code>",jay,john,,,bill,glenn,,,"</code>?</p>
<p>Thanks in advance for the help.</p>
<p>Here is part of the code that explodes user submitted values.</p>
<pre><code>$tags = explode(",", $_POST['... | php | [2] |
3,739,141 | 3,739,142 | Diff'ing a mixed lists | <p>Forgive me if this is a stupid question, I've done my best to look this up with no success, and I am by no means a Python expert.</p>
<p>I was writing some stuff to "diff" two lists: basically, compare 2 lists and fill a third list with the common values, while removing them from the original two lists. So I wrot... | python | [7] |
4,749,995 | 4,749,996 | Asp.net Masterpage not working | <pre><code><%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="se... | asp.net | [9] |
1,978,463 | 1,978,464 | Regular expression for maximum digits excluding comma | <p>I have the below regular expression:</p>
<pre><code>ValidationExpression="[0-9]+(,[0-9]+)*"
</code></pre>
<p>It allows numbers in the format: 12,2345 or 231,23454</p>
<p>Now I want to include a condition that will on the whole allow only 7 digits max excluding
comma.
<strong>The below is the modified code</stro... | asp.net | [9] |
1,802,013 | 1,802,014 | Using OnClick Listener in Listview | <p>I want to be notified when an item in a listview has been clicked , I have a main activity that has a ListView , I want to be notified when an Item in a this list has been Clicked , I did not override main activity to ListActivity .</p>
| android | [4] |
4,170,820 | 4,170,821 | Block outgoing text | <p>How to design the BroadcastReceiver class that will block outgoing SMS.</p>
<p>abortBroadcast(); does not work. Any help will be appreciated. </p>
<pre><code>if ((actionType.equals(Intent.ACTION_SEND)))
{
setResultData(null); // I tried this and abortBroadcast(); as well
}
</code></pre>
| android | [4] |
2,195,897 | 2,195,898 | iphone application give up rights | <p>Is it possible to give up an iphone application rights to another person or company?</p>
<p>I mean, you make an application, you sell it for a while, and then you don't need it anymore and you give or sell it to another person or company to continue develope it.</p>
<p>And in this case, how persons who already bou... | iphone | [8] |
689,494 | 689,495 | Is a temporary value created in this code? | <p>Consider the following code:</p>
<pre><code>class B;
class A
{
public:
A() {}
A(B &b);
};
class B {};
A::A(B &b) {}
int main()
{
B b;
const A &refa = b;// does this line create a temporary value?
return 0;
}
</code></pre>
<p>My question is: does the code <code>const A &r... | c++ | [6] |
4,959,995 | 4,959,996 | Can I make a function in C# take an optional parameter or do I need to overload it? | <p>I have the following in an interface:</p>
<pre><code>string GetTopic(string rk);
</code></pre>
<p>and this function:</p>
<pre><code>public string GetTopic(string rk)
{
return string.Format("{0}.{1}.{2}",
rk.Substring(0, 2).TrimStart('0'),
rk.Substring(2, 2).TrimStart('0').PadLeft(1, '0'),
... | c# | [0] |
5,278,390 | 5,278,391 | How do I push root view controller? | <p>I want to push root view controller. Why doesn't this code work?</p>
<pre><code>RootController *rootController = [[RootController alloc]initWithStyle:UITableViewStylePlain];
[self.navigationController pushViewController:rootController animated:YES];
[rootController release];
</code></pre>
<p>I used ... | iphone | [8] |
1,143,482 | 1,143,483 | Partial gridview in asp.net? | <p>I am working with Gridview and one of columns takes long time load and makes the whole page to load slowly. I want to know if there is a way I can show everything (other controls and partial gridview) first except for the slow column, and load the gridview(or the column) later as soon as the data for the column is ... | asp.net | [9] |
4,010,798 | 4,010,799 | PHP array print statement | <p>Here is my code:</p>
<pre><code> if(is_file($userName.".txt")) {
$userDetails = explode(',', file_get_contents($userName.".txt"));
print($userDetails[0]);
if ($password == $userDetails[0]) {
print('Correct login');
} else {
print... | php | [2] |
4,129,984 | 4,129,985 | In Python 3.2 how would I dynamically open and compile a class from a specified file? | <p>Code is much more precise than English; Here's what I'd like to do:</p>
<pre><code>import sys
fileName = sys.argv[1]
className = sys.argv[2]
# open py file here and import the class
# ???
# Instantiante new object of type "className"
a = eval(className + "()") # I don't know if this is the way to do that.
# I "... | python | [7] |
2,876,357 | 2,876,358 | Swing Application Run In Web Browser | <p>I Have Create a One Swing Application and I Want To Run My Swing Application In To My Local Web Browser So Plz Tell Me How Can I Do This Because For Applet Program There Is No Any Longer Process For This.</p>
| java | [1] |
3,118,530 | 3,118,531 | why the js code can't control the css code? | <pre><code><script>
var divBgTop=0;
function initDivTop()
{
divBgTop=document.getElementById("divBg").style.pixelTop;
alert(divBgTop);
}
</script>
<style>
.divBgCss
{
position:absolute;
left:100px;
top:100px;
wid... | javascript | [3] |
107,167 | 107,168 | jQuery Div parent and child | <p>Right, lets say I have these repeated divs.</p>
<pre><code><div class="upcoming">
<div class="roll" style="display:none">Hidden</div>
</div>
<div class="upcoming">
<div class="roll" style="display:none">Hidden</div>
</div>
<div class="upcoming">
<div class="r... | jquery | [5] |
66,292 | 66,293 | Why does Python return negative list indexes? | <p>If I have this list with 10 elements:</p>
<pre><code>>>> l = [1,2,3,4,5,6,7,8,9,0]
</code></pre>
<p>Why will l[10] return an IndexError, but l[-1] returns 0?</p>
<pre><code>>>> l[10]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out o... | python | [7] |
2,265,556 | 2,265,557 | Unshorten the URL without downloading whole page in python | <p>I want to unshorten URLs to get the real address.In some cases there are more than one redirection. I have tried using urllib2 but it seems to be making GET requests which is consuming time and bandwidth. I want get only the headers so that I have the final URL without needing to get the whole body/data of that page... | python | [7] |
3,796,205 | 3,796,206 | Is it possible to make User defined DOM changes in runtime? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4255472/javascript-object-access-variable-property-name">javascript object, access variable property name?</a> </p>
</blockquote>
<p>I am messing around with JS, learning a stuff and I am wondering about somethi... | javascript | [3] |
4,454,062 | 4,454,063 | Adding existing project in c# | <p>I have add the existing project in my new project, but when I try to use the existing library, I see the following error:</p>
<blockquote>
<p>the type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)</p>
</blockquote>
<p>What would cause this?</p>
| c# | [0] |
5,961,271 | 5,961,272 | Python: Random item from list combining only two | <p>I'm making a slot machine program in Python and for some reason, the random selector wants to combine a known two elements.</p>
<pre><code> itmlist = random.choice(['banana', 'cherry', 'bar', 'seven', 'banana', 'cherry' 'banana', 'cherry', 'seven'])
print itmlist
</code></pre>
<p>It shows up as "cherrybanan... | python | [7] |
3,251,072 | 3,251,073 | catch & save outging sms to my app & the native app | <p>iv`e created an SMS app with a db that saves almost all of the messages.</p>
<p>the problem starts when i want to save (1) my app outgoing messages to the native SMS app - the mmssms.db & the (2) outging native SMS messages to my app db.</p>
<p>i searched all over and failed to find a proper example for that q... | android | [4] |
3,759,914 | 3,759,915 | Creating acronyms in Python | <p>In Python, how do I make an acronym of a given string?</p>
<p>Like, input string:</p>
<pre><code>'First Second Third'
</code></pre>
<p>Output:</p>
<pre><code>'FST'
</code></pre>
<p>I am trying something like:</p>
<pre><code>>>> for e in x:
print e[0]
</code></pre>
<p>But it is not working... ... | python | [7] |
1,466,871 | 1,466,872 | Why draw operation in android canvas are using float instead of int for (x,y)? | <p>Why draw operation in android canvas are using float instead of int for (x,y)?
For example:
<a href="http://developer.android.com/reference/android/graphics/Canvas.html#drawCircle(float" rel="nofollow">http://developer.android.com/reference/android/graphics/Canvas.html#drawCircle(float</a>, float, float, android.gra... | android | [4] |
5,564,918 | 5,564,919 | Custom UITableViewCell always black unless set to anything but clear | <p>My custom UITableViewCells always have a black background unless I set the background of the UITableView to clear.</p>
<p>However I want to set the background colour to another colour and as soon as I do the cells turn black (even though the background of the control does change)</p>
| iphone | [8] |
1,087,182 | 1,087,183 | how display view when cells select in a tableview | <p>i am new to iphone ,my question is in one view i placed a tableview and display some data on that view,i want to add another view(same view to all cell) when select cell(suppose select first cell view will display and newly add view is used to delet that cell information based on cell index)please tell me how to dis... | iphone | [8] |
2,317,740 | 2,317,741 | C++ and Eclipse project - how to work out what headers to include, and what class to forward declare | <p>I'm building a C++ project in Eclipse using a third party implementation of <code>gcc</code>. The makefile is auto-generated and the object rules are listed in alphabetical order ( I'm not sure if that's relevant ). </p>
<p>I can't seem to create the correct configuration of #include directives and forward declarat... | c++ | [6] |
1,897,423 | 1,897,424 | Android: What's the better practice, using a global string or intents with extra data? | <p>On a current Android project, I pass some data between a couple activities. I was just curious if there is a best practice on sending data between activities. I have a string that will be updated/appended based on the results of one activity, then used for a Facebook share two activities later. Should this string... | android | [4] |
127,740 | 127,741 | Is this there a defined behavior for this code that deletes a derived class through a base class pointer? | <p>Does this code result in defined behavior?</p>
<pre><code>class A {
int x;
};
class B {
short y;
};
class C {
double z;
};
class D : public A, public B, public C {
float bouncy;
};
void deleteB(B *b) {
delete b;
}
void is_it_defined() {
D *d = new D;
deleteB(d);
B *b = new D; //... | c++ | [6] |
4,464,213 | 4,464,214 | Creating Resource file in C# | <p>I am using the beolw code to create a resource file in C#.</p>
<pre><code>IResourceWriter writer = new ResourceWriter(@"C:\ABC\Try1.resources");
writer.AddResource(Name, Value);
writer.Close();
</code></pre>
<p>BUt when I am trying to open the resource file which is being created, its seems to be distorted. Normal... | c# | [0] |
5,369,106 | 5,369,107 | How can I invoke a javascript trhough a thread? | <p>I have a thread that runs querying a DB and returning some values. If this values satisfyes a condition, I want to raise a message box (javascript alert) for the client side.</p>
<p>In my system, users can post some tasks in DB, and the thread is going to constantly query the database to check if user has things to... | asp.net | [9] |
3,944,819 | 3,944,820 | count the the number of 1s in its binary representation -- shift right don't work? | <p>when asked the question to count the number of 1s in the binary representation , the first answer came to my mind is to shift the number right and count the least important bit</p>
<p>but there is a saying that when the number is negative , this method will cause infinite loop ?</p>
<p>I tried quickly with python<... | python | [7] |
2,860,706 | 2,860,707 | why do convert numbers to string in Javascript using tostring method? | <p>I was wondering why do people have to convert numbers to string. What are the practical uses for that kind of conversion?
Similarly why do developers use parseInt or parseFloat to convert a string to a number.
thanks </p>
| javascript | [3] |
5,719,529 | 5,719,530 | What is the correct usage of Alarmmanager and starting boot? | <pre><code> public class main extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
///////////Do something////////////////////////
showtext.startScan();
//SEt Alarm
Intent intent = new Intent(this, TextReceiver... | android | [4] |
2,392,149 | 2,392,150 | strange npe in jQuery method | <p>I have this jQuery method which <strong>works fine if I am on a page where there are elements found</strong> which have class <code>.singlePaneOfGlassBlock</code>.</p>
<pre><code>function replaceRightClickIcefacesMethod() {
//I only want this to run on IE for now, but the content
//is prepared to r... | jquery | [5] |
1,899,358 | 1,899,359 | jquery greater than/less than only looks at first number? | <p>I have a drag script where i'm dragging div.slider, i'm keeping track of the "left" value for div.slider, and having it fade out when it's greater than 68, but the problem is that it fades out when it gets to 6, not 68. If I change the number to 85, then it will fade out at 8, not 85. does anyone know why this is ha... | jquery | [5] |
5,078,166 | 5,078,167 | Determine where a function has been called with PHP | <p>do you guys know how can i determine from what file was a function called inside of that function?</p>
<p>I was thinking of using debug_backtrace .. but that does not look as an elegant way to do it, and they also enumarate other reasons in another question <a href="http://stackoverflow.com/questions/346703/php-deb... | php | [2] |
961,408 | 961,409 | C++: Comparing sets of points in a data file | <p>I have a data file consisting of three columns, x, y, and z (these are numbers). I'd like to do the following:</p>
<ol>
<li>Compare each (x, y) set in the data. </li>
<li>If two sets are equal, say (x1, y1) = (x2, y2),</li>
<li>Then, compare z1 and z2. And depending on the comparison, I'll write a condition and I w... | c++ | [6] |
3,037,495 | 3,037,496 | android: stack based activity back-key mechanism | <p>I have two activities, one is a list for item, the other one is the edit view for the item. When user clicks the item in the first view, the second edit view will show.</p>
<p>In android the stack based mechanism, if I do this the behavior is weird.</p>
<p>List view -> click -> edit view -> save -> list view -> cl... | android | [4] |
421,327 | 421,328 | android steganography | <p>I'm doing steganography on Android. My code is as follows:</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.src);
picw = mBitmap.getWidth();
pich = mBitmap.getHeight();
pix= ne... | android | [4] |
1,260,883 | 1,260,884 | Multiple players for an android game | <p>I am trying to make a game, very simple, kind of a game where you simply have to solve some questions.
Now I want to make it possible to make multiple players. One way is to make an sql table with players, and just put each score, for each question, for each player in it.
To know which player was last, I can save ... | android | [4] |
3,578,077 | 3,578,078 | How do you package multiple sets of native class files into a single jar? | <p>I have some external C code which has been built for multiple platforms(Windows, Linux, Mac), and want to package them all in a single .jar so that this .jar can be used as a library regardless of the platform.</p>
<p>This would allow me to pass a Java project around from computer to computer with the same single e... | java | [1] |
3,795,550 | 3,795,551 | unique object identifier in javascript | <p>I need to do some experiment and I need to know some kind of unique identifier for objects in javascript, so I can see if they are the same. I don't want to use equality operators, I need something like the id() function in python. </p>
<p>Does something like this exist ?</p>
| javascript | [3] |
297,538 | 297,539 | How to coordinate toast and dialog box? Toast partially covers loading dialog box. Can I resize toast? | <p>Here is exact situation. User signs in, and gets a Welcome Toast that lasts a few seconds AND they are switched to an account page where there is a loading dialog ... So its kind of ugly because the Toast is going on at the same time as the dialog. Actually it partially covers it. I want the user to see the Toast... | android | [4] |
1,538,110 | 1,538,111 | php - resize and save an image? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/747101/resize-a-picture-to-a-fixed-size">Resize a picture to a fixed size</a> </p>
</blockquote>
<p>I am using the following php code to resize (the width) and save an image, the code is working no error but the... | php | [2] |
5,424,944 | 5,424,945 | Map-summing items in a multidimensional array | <p>I have an array that looks roughly like this:</p>
<pre><code>[ (0.5, 0.6, 0.7), (0.1, 0.9, 0.8), (0.9, 1.0, 0.4),
...
(0.3, 0.8, 0.3), (0.2, 0.4, 0.9), (0.5, 0.5, 0.3) ]
</code></pre>
<p>What I need is a sum of [0][0], [0][1], [0][2], etc. as well as [1][0], [1][1], [1][2], etc. I need a way to get a sum of th... | python | [7] |
1,148,798 | 1,148,799 | What is the best way to handle multiple object dependencies in C++? | <p>I'm building a C++ application, and I've got several utility objects that all of my classes need to use. These are things like the logging object, the global state object, the DAL object, etc...</p>
<p>Up until this point, I've been passing all of these objects around as references into my class constructors. </p... | c++ | [6] |
4,342,421 | 4,342,422 | Warnings when file_get_content wrong url | <p>I have this code:</p>
<pre><code><?php
$url = "http://asdsfsfsfsfsdfad.com";
$file = file_get_contents($url);
if(preg_match("/<title>(.+)<\/title>/i",$file,$m))
print "$m[1]";
else
print "The page doesn't have a title tag";
?>
</code></pre>
<p>It works fine when the url is a proper url, ... | php | [2] |
3,086,177 | 3,086,178 | how to save highscore for each level | <p>I have 3 levels in the game and I want to store each levels highscore as they are played. User can go back to the level and can challenge their own highscore. Now how will I save the level highscore of the each level ?</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.