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 |
|---|---|---|---|---|---|
1,856,418 | 1,856,419 | Regarding putting break with an case | <p>I was going through a code of switch conditional statement </p>
<pre><code>char c1=65;
switch(c1){
case 'A':
System.out.println("one");
default:
System.out.println("two");
case 'b':
System.out.println("three");
}
</code></pre>
<p>While the outcome was 'one two three' but while debugging I found ... | java | [1] |
693,456 | 693,457 | Count items for each list on the page | <p>I have a page with multiple lists. Each list has a different amount of list items.
I want to show a less/more link after every third list item and I would like to hide the less/more link if my list has less than 3 items in it.</p>
<p>This is what I've got so far:</p>
<pre><code> var n = $('ol.checkboxes').child... | jquery | [5] |
203,028 | 203,029 | Why is `x && return` invalid? | <p>I know that you can do this:</p>
<pre><code>function first(a){
a && console.log("true");
}
</code></pre>
<p>which is the same as:</p>
<pre><code>function first(a){
if(a){
console.log("true");
}
}
</code></pre>
<p>However, when I tried this:</p>
<pre><code>function first(a){
a &am... | javascript | [3] |
1,475,001 | 1,475,002 | call javascript function from jquery | <p>I inherited some javascript code. One of them is a function chg(x) which reloads the page after a drop down list's value has been changed.</p>
<p>How do I use jquery to change the drop down list's value and call chg(x) when the value is changed ? </p>
| javascript | [3] |
1,965,732 | 1,965,733 | High priority Android services | <p>I'm looking into implementing an over-Bluetooth video streaming service for Android.</p>
<p>How can I ensure that:</p>
<ul>
<li>the service runs with a high priority? I'd like to minimize latency.</li>
<li>the service is low of the list of things to be killed when memory is tight?</li>
</ul>
| android | [4] |
4,559,736 | 4,559,737 | showing and hiding elements within a container | <p>I'm building a car parts assembly application and still working on the ideas.</p>
<p>The car parts are aligned above the certain field that represents the car image (main stage).
When the user clicks on the appropriate part, it glows on the big car image.</p>
<p>Now, I would like to make this possible by showing t... | jquery | [5] |
4,345,257 | 4,345,258 | How to pass variables in QueryString with asp.net? | <p>I'm trying to pass a variable that would represent the state of a jquery-ui accordion to the URL so I can keep the focus its current tab. I'm just unsure on how to do this since I return to a view after the POST.</p>
| asp.net | [9] |
2,706,067 | 2,706,068 | How to ring the phone(Or make some sound) | <p>I am developing an app which requires the phone to ring or make some sound when user click on some button or a particular event occur.
What will be the code for that.
I tried to find it and found some code to ring the phone with notifications.
But I dont want that.
I just need to ring the phone when user clicks a ... | android | [4] |
3,996,552 | 3,996,553 | Is android assets folder a real folder in the file system | <p>After an APK is installed, does the assets folder get unpacked to a physical folder on the file system or does it stay in the APK? If it is unpacked, where does it go?</p>
| android | [4] |
2,617,536 | 2,617,537 | How to access a data member and a member function from a member function of another class? | <p>if i write a class-</p>
<pre><code>class A
{
int x;
void show()
{
cout<<a;
}
};
int main()
{
A a;
a.show();
a.x;
}
</code></pre>
<p>But If another class B is ther then how the member function of A accessed inside member function of class B-</p>
<pre><code>class B
{
int y... | c++ | [6] |
2,669,460 | 2,669,461 | Functions and the OR operator | <p>Is there in PHP a shorthand for:</p>
<pre><code>function a() {...}
function b() {...}
$c = a();
$c = ($c) ? $c : b();
</code></pre>
<p>In javascript you can simply do:</p>
<pre><code>$c = a() || b();
</code></pre>
<p>but in PHP, if you do this, <code>$c</code> will be a <code>boolean</code> (which is normal, bu... | php | [2] |
867,213 | 867,214 | Deleted nib still displayed when controller is pushed | <p>I have an application with a UINavcontroller under a tab bar controller. To create the navigation model I want, I push a container UIView object onto the stack to manage additional views(Thanks Frank). When I created the container class, an associated nib file was created along with it. I at first used that nib f... | iphone | [8] |
3,029,528 | 3,029,529 | Detect type of object in ArrayList | <p>I'm attempting to make a class that will convert ArrayLists of objects into ArrayLists of other objects. i.e.</p>
<pre><code>ArrayList<Foo> convert(ArrayList<Bar> input){
//conversion logic
}
ArrayList<Bar> convert(ArrayList<Foo> input){
//conversion logic
}
</code></pre>
<p>Unfo... | java | [1] |
5,625,648 | 5,625,649 | Casting from list of lists of strings to list of lists of ints in python | <p>I'm reading some numbers from a data source that represent xy coordinates that I'll be using for a TSP-esque problem. I'm new to python, so I'm trying to make the most of lists. After reading and parsing through the data, I'm left with a list of string lists that looks like this:</p>
<blockquote>
<p>[['565.0', ... | python | [7] |
3,807,079 | 3,807,080 | JQuery SSN Mask | <p>How do I mask SSN in a Textbox and only show the last 4 digits of SSN when I load up a page using JQuery?</p>
| jquery | [5] |
4,722,964 | 4,722,965 | jQuery - Targeting specific ID's | <p>I have the following code:</p>
<pre><code><script type="text/javascript" language="javascript">
$(document).ready(function() {
$("input:checkbox").click(function(){
var group = "input:checkbox[name='"+$(this).attr("name")+"']";
$(group).attr("checked",false);
$(this).attr("checked",true);
});
});
... | jquery | [5] |
1,603,586 | 1,603,587 | Switch view in MSDN | <p>I happend to visit below URL where they have implemented the different type of view of the same page. </p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms733082%28classic%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms733082%28classic%29.aspx</a></p>
<ol>
<li>Is there any new feature in A... | asp.net | [9] |
4,905,191 | 4,905,192 | disable button until it hasnt selected file yet | <p>im trying to do this but i dont know why is it not working. can you help this what's wrong with this code, its not working at all. i want to disable the submit button when the user has not select a file.</p>
<pre><code><html>
<meta charset="utf-8">
<head>
<form action="#" method="post">... | jquery | [5] |
5,456,832 | 5,456,833 | How to create delay startup application in c#? | <p>I'm creating some desktop application using WPF(C# .net). I want to create it as computer startup application. I can do it add shortcut link to startup folder.</p>
<p>My question is, I want to do startup this application after one minute in computer start.How to do this one?</p>
| c# | [0] |
2,988,759 | 2,988,760 | How can I split a 1-dimensional array to multiple arrays? | <p>This is my question please give me some hint or idea on how am I going to split 1 dimensional array to multidimensional array if it see a special character e.g - or /?</p>
<p>Example data:</p>
<pre><code>input:
array1 [] = { "name1-name2", "box1-box2" }
output:
array2 [][]= { {"name1"}, {"name2"}, {"box1"}, {"box2... | java | [1] |
2,056,487 | 2,056,488 | retrieve data from sql to datagrid view | <p>this code wont run it supposed to fill the datagridview some data but all i got was the rows of how many data was retrieve but no values on each cells</p>
<pre><code> public void refDGV()
{
con.OpenConnections();
SqlCommand cmd = new SqlCommand();
SqlConnection cn = new SqlConnection... | c# | [0] |
4,630,938 | 4,630,939 | array of void pointer | <p>I'm trying to use strtok to break up a string and push into a stack. could be integers or '+' or '-' signs. i have traced the problem to the push function, and void ** a is a void pointer to array.</p>
<p>It prints out garbage value when i did the <code>cout << getVP(a) << " " ;</code></p>
<p>my getVP... | c++ | [6] |
5,357,310 | 5,357,311 | Publish and Suscribe arq in javascript | <p>i'm thinking about implement an arquitecture P&S in javascript, i want to recibe messages from many servers (cross origin) its msgs dispatch an event, and i want to catch this event in different components from my page, my question is, is possible to catch an event with a Object other than Document Object?</p>
| javascript | [3] |
2,269,422 | 2,269,423 | Jquery: How do I unhide a specific div, depending on what option is selected in a select widget? | <p>I'm trying to find the best way to display text corresponding to specific options in a select widget. I'm thinking I can just populate multiple divs with text, each div corresponding to an option in a select widget and initially setting them them with "display: none". Then with Jquery I would unset a specific div to... | jquery | [5] |
1,330,858 | 1,330,859 | How to check if an Object is a Collection Type in Java? | <p>By using java reflection, we can easily know if an object is an array. What's the easiest way to tell if an object is a collection(Set,List,Map,Vector...)?</p>
| java | [1] |
143,637 | 143,638 | What is ParcelFileDescriptor in android | <p>I read this <a href="http://developer.android.com/reference/android/os/ParcelFileDescriptor.html" rel="nofollow">http://developer.android.com/reference/android/os/ParcelFileDescriptor.html</a></p>
<p>but I got know idea from it. What it is? and What can it do?</p>
<p>Can anyone explain me.</p>
| android | [4] |
1,805,716 | 1,805,717 | Could android:targetSdkVersion=8 be causing problems? | <p>My Android application uses minSdkVersion=3 and targetSdkVersion=8. I used 8 because that is the highest level of API the application was tested on; however, it was written for level 3 and does not use any features beyond that level (except one for level 4 using reflection). Could using targetSdkVersion=8 be causi... | android | [4] |
5,561,407 | 5,561,408 | Issue with complex fonts displaying too large | <p>I have this issue with complex fonts showing in DIVs the wrong way. Once the page loads, the texts pends out of the box... and if I zoom in and out, everything shows the right way. </p>
<p>Is there any way to trigger this zoom in and out (ctrl++ and ctrl+-) automatically in every page load? </p>
<p>I was thinking ... | jquery | [5] |
1,144,889 | 1,144,890 | jquery checkboxes checked only | <p>I have a bunch of checkboxes tha start with CheckRR_</p>
<p>I like to loop only for ones that starts with "CheckRR_" and are checked. How would I do this?</p>
<p>I have the following so far:</p>
<pre><code>$('input[name^="CheckRRR_"]').filter(":visible").each(function () { ....
</code></pre>
<p>This works for o... | jquery | [5] |
3,199,135 | 3,199,136 | Displaying array as tree structure in php | <p>Hello i have an array </p>
<pre><code>Array
(
[0] => dir0|file0.txt
[1] => dir0|file1.txt
[2] => dir1|file2.txt
[3] => dir1|filea.txt
[4] => dir2|fileb.txt
)
</code></pre>
<p>This need to be displayed as a tree like</p>
<pre><code>dir0
file0.txt
file1.txt
dir1
file2.txt
... | php | [2] |
4,843,951 | 4,843,952 | Can I avoid reflection in this case? | <p>Let's say I have these class hierarchy :</p>
<pre><code>public abstract class Parent {
}
public class A : Parent {
public void Update() { }
}
public class B : Parent {
public void Update() { }
}
public class C : Parent {
public void Update() { }
public void Update(bool force) { }
}
</code></pre>... | c# | [0] |
707,646 | 707,647 | screen shots for app store submission | <ol>
<li>Do I have to submit both portrait and landscape screenshots? </li>
<li>Is it fine for my app to only support portrait mode?</li>
</ol>
| iphone | [8] |
43,613 | 43,614 | How hide C++ source code from customer | <p>I wish to send some components to my customers. The reasons I want to deliver source code are:</p>
<p>1) My class is templatized. Customer might use any template argument, so I can't pre-compile and send .o file.</p>
<p>2) The customer might use different compiler versions for gcc than mine. So I want him to do co... | c++ | [6] |
622,123 | 622,124 | Why can't I reference a static member from an inner class in C#? | <p>I have a static class </p>
<pre><code>namespace MyNameSpace{
public static class MyStaticClass {
public static string myStaticMember = "";
}
}
</code></pre>
<p>I can reference myStaticMember in another class like this:</p>
<pre><code>string varString = MyStaticClass.myStaticMember;
</code></pre... | c# | [0] |
3,668,833 | 3,668,834 | How to make C# debugging treeview | <p>I am trying to make treeview same like if we debug some code line, we got treeview information for such line so I want to make exact same C# debugging treeview.</p>
<p>Please if any one suggest me what datatype suits in C# to make treeview same like debugging treeview in it.</p>
<p>Thanks.</p>
| c# | [0] |
3,026,379 | 3,026,380 | How to access method in Python script via url | <p>I am currently learning python and eant to know how to access a script via url.</p>
<p>I know you can access php like:
mypage.com/index.php?method=multiply</p>
<p>So would the python be?:
mypage.com/index.py?method=multiply</p>
| python | [7] |
2,110,807 | 2,110,808 | set Timeout and for in loop | <pre><code>function createDivs(){
var styleHash = {};
vertical=0;
horizontal=0;
var h;
var aDiv
var colour;
var groupStyle;
for(key in elHash){
h=elArr[0][zIndex[key]]/elHash[key];
colour = randomColor();
setLocation(h,elHash[key]);
var container = document.getElementById('container');
... | javascript | [3] |
4,108,814 | 4,108,815 | How to call a python file using python script | <p>I have python file .py and I wanted to run through python script.</p>
| python | [7] |
4,807,931 | 4,807,932 | Execute a string and retrieve result | <p>I have this string in a XML File :</p>
<pre><code>DateTime.ParseExact("21/06/1980", "dd/MM/yyyy",
System.Globalization.CultureInfo.GetCultureInfo("fr-fr"))
</code></pre>
<p>I would like read the xml, execute this string and retrieve the result.</p>
<p>Do you have any ideas for executing and ... | c# | [0] |
537,728 | 537,729 | fetch only url links from google search result in C# | <p>I am doing the job of fetching only links from the google search result.</p>
<p>We enter the keyword such as "google", google shows the result pages, but I want to only fetch the URL links from the search result.</p>
<p>any help would be appreciated.</p>
<p>thanks</p>
| c# | [0] |
5,751,798 | 5,751,799 | C# WebBrowserDocumentCompletedEventHandler inside of foreach loop | <p>How do I cause the documentCompleted event to actually wait for completion inside a foreach loop.</p>
<p>The StaticStringclass.URLList is a list of websites, so just like www.google.com,www.aol.com.</p>
<p>Any advise is awesome.</p>
<p>StaticStringClass.holderList = new Queue();</p>
<pre><code> StaticStri... | c# | [0] |
1,779,621 | 1,779,622 | http headers in asp.net | <p>What is HTTP headers in asp.net. How do they work? I want to use them to cache in output cache for varybyheader.</p>
| asp.net | [9] |
826,791 | 826,792 | Implementing Touch Event on a custom object android | <p>I am trying to write a simple program using Surface View. I have an Object called ball which is drawn on the Surface and keeps moving around. I want to enable the Touch Event on the Object. The objective is stop the ball moving for a few secs when I touch it. I am not sure how to go about adding setOnTouchListener t... | android | [4] |
424,860 | 424,861 | Get the first 13 bit from short | <p>I have byte array</p>
<pre><code>byte[] PixelData = {255,235};
</code></pre>
<p>I want to convert it to short and before that I want to get the first 13 bit before the conversion because when I convert using the following code improper values return </p>
<pre><code>short val1 = 0;
val1 = BitConverter.ToInt16(Pixe... | c# | [0] |
2,297,323 | 2,297,324 | How to get object property from each object in an array? | <p>Assuming I have an array of objects in PHP, something like:</p>
<pre><code>Array (
[0] => stdClass Object (
[id] => 1
[name] => Title One
)
[1] => stdClass Object (
[id] => 2
[name] => Title Two
)
[2] => stdClass O... | php | [2] |
4,961,476 | 4,961,477 | Write Excel Cell Comment using Python on Linux? | <p>I am using <code>Python</code> in a Linux (Ubuntu) environment.</p>
<p>How do I go about writing a <strong>comment</strong> into a cell in an <code>Excel</code> file (say,<code>MyFile.xls</code>)?</p>
<p>I know that it is possible to write <strong>values</strong>. Yet, how do I go about writing a comment?</p>
| python | [7] |
2,209,510 | 2,209,511 | How to check if mobile network is enabled/disabled | <p>I would like to know if the mobile network is enabled or disabled.</p>
<p>My application is designed to help the user when he receives a phone call, and to do this I need Internet access. Thus, I would like to display an information box when the user access the application for the first time if Wi-Fi has a sleep po... | android | [4] |
5,841,027 | 5,841,028 | Can one combine android resource strings into new strings? | <p>Android allows to create aliases of resource strings like:</p>
<pre><code><resources>
<string name="foo">somestring</string>
<string name="bar">@string/foo</string>
</resources>
</code></pre>
<p>by which the resource "bar" becomes an alias for the resource named "foo".</p>
<p... | android | [4] |
5,328,825 | 5,328,826 | How to change variables in Python | <p>I am trying to change a variable further down the program. I have a global variable declared at the start of the program and I want to change the variable in different functions down the program. I can do this by declaring the variable inside the function again but I would like to know is there a better way of doing... | python | [7] |
881,590 | 881,591 | scandir not working properly php | <p>Does any one know how to scan directory recursively in php ?</p>
<pre><code>$fileslist = array();
function readRecursive($dirname) {
global $fileslist;
$dir = scandir($dirname);
foreach ($dir as $f) {
if($f != "." && $f != ".." && $f != ".DS_Store") {
if(is_dir($dirname.DI... | php | [2] |
3,669,724 | 3,669,725 | setting a string's char' by index | <p>I have an ArrayList of strings, and I want to randomly change a string's (random) char' by index.</p>
<p>ArrayListName.get(i).charAt(j) </p>
<p>exists. What's the equiv' for a setter?</p>
| java | [1] |
4,210,588 | 4,210,589 | switching columns of a 2d array | <p>so my problem is that i cannot get the elements of a 2d array to switch like i would be able to do in a single variable array. Instead of switching the elements they are just being continuously rewritten... </p>
<pre><code>for (int column = 0; column < m[0].length; column++) {
shufcol = (int)(Math.random()*4... | java | [1] |
55,774 | 55,775 | Unions of fixed size structures for use in safe context | <p>I'm working with packets that I can receive or send as a Byte array,
that has a fixed structure. So I'm trying to create an effective
union as follows:</p>
<pre><code>using System; // etc..
namespace WindowsApplication1
{
public partial class Main : Form
{
public const int PktMaxSize = 124;
... | c# | [0] |
275,442 | 275,443 | Suppose i created three or four object of a class study then memory will be created seperatly or not? | <p>Here </p>
<pre><code>class study
{
some data member;
some member function;
};
main()
{
study s1, s2, s3;
}
</code></pre>
<p>It will create three object of class study then memory created seperatly for seperate object or not in c++</p>
| c++ | [6] |
3,327,502 | 3,327,503 | Passing another div element as arguement to jquery plugin | <p>I'm basically trying to do a dropdown jquery plugin.</p>
<h2>HTML</h2>
<pre><code><script type='text/javascript' src='script.js'></script>
<div id="clickDiv">Click Me</div>
<div id="nav">
<span>settings</br></span>
<span>Preferences</br></span&... | jquery | [5] |
2,061,341 | 2,061,342 | VSShell Isolated, "open with" opens TextEditor unnecessary | <p>Sorry for my poor English.</p>
<p>I'm developing a Visual Studio Shell Isolated application and I have created my extension ".proj". I have associated this extension using Setup project because I want to open proj files with "open with" command. When I use this option, file is processed by my VS package and additio... | c# | [0] |
5,326,032 | 5,326,033 | UIImage *rightIcon = [UIImage imageNamed:@"fb.jpg"]; | <pre><code>UIImage *rightIcon = [UIImage imageNamed:@"fb.jpg"];
UIBarButtonItem *btnFB = [[UIBarButtonItem alloc] initWithImage:rightIcon
style:UIBarButtonItemStylePlain
target:self
... | iphone | [8] |
4,978,581 | 4,978,582 | How to access Variable in parent class using parent:: method | <p>I have Protected Variable UserId in Parent Class.i Am going to extend the variable in my child class as shown below</p>
<pre><code>class Main
{
protected $UserId = "151";
protected static $UserName = "Madhavan";
protected function SampleMethod()
{
print "This is Sample Method";
}
}
... | php | [2] |
5,577,746 | 5,577,747 | BitmapFactory.decodeFile Question in Android | <p>I used the BitmapFactory.decodeFile method to decode an image file in Android.</p>
<p>About the output bitmap, what is the property of the Bitmap.Config ? </p>
<p>(ALPHA_8 , ARGB_4444, ARGB_8888 or RGB_565 ?)</p>
<p>Thanks </p>
| android | [4] |
447,279 | 447,280 | How to protect javascript function? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript">How can I obfuscate JavaScript?</a> </p>
</blockquote>
<p>Is there any way to protect my js file or javascript function from user to view?</p>
| javascript | [3] |
5,984,926 | 5,984,927 | Php variable with operation in declaration of a drop down box | <p>How can I put a variable with operation in the declaration of a drop down box?
I have a drop down box with the months and when user selects March, the result of the code below is 2+1. I get this is handled as string function but I don't know how to make php handle it as it would result in 3.</p>
<pre><code>echo "&l... | php | [2] |
2,165,121 | 2,165,122 | http_build_query but replace & with ; in PHP? | <p><code>http_build_query($array)</code> will convert array to the format of <code>a=1&b=2</code>,</p>
<p>But how to make it convert to the format of <code>a=1;b=2</code>?</p>
<p>Is there a native function there?</p>
| php | [2] |
1,231,033 | 1,231,034 | getcwd help needed | <p>I am using following code to upload images to pic directory...</p>
<pre><code>move_uploaded_file($_FILES['pic']['tmp_name'], getcwd() . '/templates/images/pics/' . $pic_name . $ext);
echo getcwd(); //returns C:\wamp\www\sapp\Admin
</code></pre>
<p>so simply it uploads images inside templates of Admin folder, not ... | php | [2] |
4,247,711 | 4,247,712 | Python 2D Array access with Points (x,y) | <p>Good Evening mates,</p>
<p>I'm new to python programming, and I was just wondering if you can access a 2D array in python using Points/Coordinate?</p>
<p>Example you have a point:
<strong>point</strong> = (1,2)</p>
<p>and you have a matrix, then you access a certain part of the matrix using a coordinate</p>
<p>M... | python | [7] |
5,083,763 | 5,083,764 | Logistic Regression in Java | <p>We need to do a logistic regression in Java. We used this code in Python <a href="http://blog.smellthedata.com/2009/06/python-logistic-regression-with-l2.html" rel="nofollow">http://blog.smellthedata.com/2009/06/python-logistic-regression-with-l2.html</a> and basically want the same thing in Java. I was directed t... | java | [1] |
3,000,197 | 3,000,198 | How to echo only the input values mailed | <p>I have a 60 input field questionnaire. Once the client fills it out it is mailed to me. Not all fields are required, but I want to echo all input fields that the user submits. I can echo all variables, but some are empty and leave a space. I want to only echo the variables that have a value.</p>
| php | [2] |
2,984,141 | 2,984,142 | Jquery not working with code here | <p>what am I missing here?</p>
<p>i hava a file html as below:</p>
<pre><code><a href="javascript:void(0);" title="Show and Hide" id="_showhide">
<span id="textsh">hide</span>
<div id="contentsShowHide" style="display:none;">
Contents here
<div>
</code></pre>
<p>and ... | jquery | [5] |
99,258 | 99,259 | Edittext "lag" android | <p>The first time i focus an edittext view i notice a lag of one or two seconds before i can write anything in the textbox.</p>
<p>I notice this behavior even on an app without any code more than what's nessecary to initialize the application.</p>
<p>What am i doing wrong?</p>
| android | [4] |
4,376,713 | 4,376,714 | Is it possible to check if an audio existes in audo library using MPMediaItemPropertyPersistentID? | <p>I hope to add audio from audio library to a MPMediaItemCollection.
I hope I can store the MPMediaItemCollection<br>
So I write the MPMediaItemPropertyPersistentID to an array.
When I need to reload and replay the audio MPMediaItemCollection,
I check if the audio's MPMediaItemPropertyPersistentID existes in current a... | iphone | [8] |
2,874,097 | 2,874,098 | How to add views in relative layout programatically | <p>I already have a <code>relative_layout.xml</code> and it contains sub layouts. Now I've to add layout into in to one of the sub relative layout insite that <code>relative_layout.xml</code>. Could you please tell me how to achieve it programatically?</p>
| android | [4] |
5,619,361 | 5,619,362 | Optimized Logic to find high score | <p>Basically this is related to a squash application where we have 2 scores. One is from winner point of view and another from loser point of view.</p>
<p>eg.
Score1: 11-5,11-5,11-5 (Winner point of view)
Score2: 5-11, 5-11,5-11 (Loser point of view)</p>
<p>Now in my logic i want to find which is the winner scor... | php | [2] |
1,347,078 | 1,347,079 | Http header User-Agent | <p>I am trying to get list of browsers from the User-Agent strings in HTTP header. In many of the strings, the browser info is the second entry in the string, like the following:</p>
<pre><code>(compatible;.MSIE.8.0;.Windows.NT.5.1;.Trident/4.0)
</code></pre>
<p>But in some of the strings, there is either no browser ... | python | [7] |
2,565,326 | 2,565,327 | dynamically adding removeCaller function in js | <p>why doesn't my javascript function work?</p>
<pre><code>function removeCaller(param) {
this.parentNode.removeChid(this);
}
caller = document.getElementById("a");
param = document.getElementById("b");
caller.removeCaller(param);
</code></pre>
| javascript | [3] |
4,160,409 | 4,160,410 | Error: cannot declare variable 'c' to be of abstract type 'circle' | <p>Does anyone know what i am doing wrong and explain to me why it wouldnt let me declare anything as a circle?
main</p>
<pre><code>int main(void){
...
circle c;
...
}
</code></pre>
<p>circle.h</p>
<pre><code>#include <string>
#include <iostream>
using namespace std;
class circle : public shape {
... | c++ | [6] |
3,862,836 | 3,862,837 | javascript, dynamic id for table:how to recognize? | <p>In my application i use a framework that generates a table with the id of the cells at Run-Time in ascending order.
So that i have "ElementX1X1" for row1 and column1, "ElementX1X2" for row1 and column2 etcetc...
The HTML structure generated will be:</p>
<pre><code><tr>
<td class="my_msg" align="left">
&... | javascript | [3] |
5,495,785 | 5,495,786 | Code about waveform creation ...help-- | <p>Does anybody could explain to me , the meaning of these code statements?</p>
<pre><code>1) List<Byte> audioBytes;
List<Line2D.Double> lines;
</code></pre>
<p>what's Line2D.Double? What these "< ..>" stand for?</p>
<p>Also:</p>
<pre><code>2) public void resetWaveform() {
audi... | java | [1] |
5,467,012 | 5,467,013 | Copied python egg no longer works | <p>I needed to make a change to a 3rd party library, so I edited the files in the egg (which is not zipped). The egg lives in site-packages in a virtualenv. Everything works fine on my dev machine, but when I copied the egg to another machine, the module can longer be found to import.</p>
<p>I'm sure I went about this... | python | [7] |
3,682,396 | 3,682,397 | Is there any limit for shared memory(shmop) block system id (PHP) | <p>i am creating an app that must check(count) users'(write-intensive) requests.</p>
<p>'shmop_open(MY_INT_USER_ID, ... )' returns a system ID for shared access but i am not sure about this, is there any limitation for shmop system IDs on 64-bit OS? Or does this cause problems, such as collisions?</p>
| php | [2] |
2,258,020 | 2,258,021 | Changing activity? | <p>I am in my fourth activity and I want to come back to the first activity directly (without closing the second and third activity).
How to change to the activity directly?</p>
| android | [4] |
5,846,896 | 5,846,897 | Unable to find the cause of syntax error | <p>I am new to Java and written simple code:</p>
<pre><code>1 package Rndom;
2 class Clmm{
3
4 }
5 public class Clkk {
6
7 Clmm klm;
8 klm = new Clmm();
9
10 }
</code></pre>
<p>Eclipse shows the error:</p>
<pre><code>syntax error on token ";" , , expected on line 7
</code></pre>
<p>I am trying to find why ... | java | [1] |
5,306,455 | 5,306,456 | Python: detecting install location of python tools | <p>Python's installation comes with some handy tools, located under
$YOUR_PYTHON/Tools/Scripts. Is there a platform-independent way to find out where on a system they are located? I want to use ftpmirror.py as part of a shell script.</p>
| python | [7] |
5,150,413 | 5,150,414 | Looping Nested Loops | <p>I have an array that looks like this except with over 40 more </p>
<pre><code>Array
(
[0] => stdClass Object
(
[id] => 1
[name] => name
[cost] => 20
[firstname] =>
(
[0] => first 1
... | php | [2] |
1,543,340 | 1,543,341 | jquery .html function remove part of a text within a div | <p>in <a href="http://stackoverflow.com/questions/6263632/jquery-remove-text-partially">my question</a> one suggested to do:</p>
<pre><code>$(".entry").html(function(i, htm){
return htm.split("-")[0];
});
</code></pre>
<p>To remove <strong>Approuved - Expire May 18 th 2012</strong> but this remove <br>Source: Supe... | jquery | [5] |
807,764 | 807,765 | ASP.NET Previous Page | <p>I have page and I am displaying the same page for n number of times and binding Various Data.</p>
<p>There is a back button on the page, When I click on it it should just take the page where it should diplay the previous data in the controls.</p>
<p>I tried Server.Transfer, Response.Redirect(), But they are taking... | asp.net | [9] |
3,673,968 | 3,673,969 | Properly display Unicode symbols in my string | <p>From webservice iam getting string like this. how to remove unicode symbols and display my string properly.</p>
<p>from : "you don\u2019t have to:"</p>
<p>need to convert like - "you don't have to:"</p>
| iphone | [8] |
4,916,236 | 4,916,237 | android custom toast duration | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2220560/can-an-android-toast-be-longer-than-toast-length-long">Can an Android Toast be longer than “Toast.LENGTH_LONG”?</a> </p>
</blockquote>
<p>Is it possible to make a Toast with custom duration (... | android | [4] |
5,677,951 | 5,677,952 | How to enable a PHP function (file_put_contents) that is disabled by default? | <p>The file_put_contents() function is disabled for some reason on my server. How do I enable it? And how do I enable/disable PHP functions in general?</p>
| php | [2] |
2,854,924 | 2,854,925 | When is it useful to have custom construct/destroy methods in allocators? | <p>Custom allocators, and specifically the ability to customise the <code>allocate/deallocate</code> methods are very useful - allowing for control over the low-level memory allocation strategies used in certain performance critical areas. <a href="http://drdobbs.com/cpp/184406243" rel="nofollow">Pooled allocators</a> ... | c++ | [6] |
5,236,349 | 5,236,350 | System Commands - Java | <p>I'm trying to make a little java program that executes a system command but I can't seem to figure it out </p>
<p>The question is how does one execute a system command using java?</p>
<p>UPDATE: I read the documentation & tried some examples & I still can't figure it out. Why can't it be simple like in C.<... | java | [1] |
3,516,945 | 3,516,946 | Usage of [0] with visual effects in jquery | <p>Why selecting via [0] in jquery does not work with visual effects??</p>
<pre><code>$("p")[0].slideUp(); /* it does not work*/
$("p").eq(0).slideUp(); /* it works */
</code></pre>
<p>As mentioned, I know there are some other ways to select the first p, but I am eager to know why the above mentioned code is not work... | jquery | [5] |
5,932,038 | 5,932,039 | What type is `ios::hex` in? | <p>I always see <code>ios::hex</code> or <code>ios::basefield</code>. What type are they in? a class? a variable?</p>
<p>I am trying to find the answer in books, but there are not.</p>
<p>Thanks.</p>
| c++ | [6] |
667,413 | 667,414 | How to create an array in javascript using attributes set in the request object? | <p>I need to creata an array in javascript, elements for the array should come from server side.</p>
<p>For this what i did was,
In servlet,</p>
<pre><code>String[] valuesArray = {"val1","val2","val3"};
request.setAttribute("valuesArray",valuesArray);
</code></pre>
<p>In Jsp/javaScript:
<code>var arrayObj = new Arr... | javascript | [3] |
4,174,785 | 4,174,786 | Fixed background image, that doesn't move when new views are loaded | <p>I have an iPhone app with a navigation controller. Views slide in from the right. I want a background picture that is fixed, so that it doesn't slide with the views pushed on the nav controller. Is that possible?
Thanks!</p>
| iphone | [8] |
455,544 | 455,545 | which UIButton event can act as a mouse over event like in flash | <p>i would like to create a UIButton it will zoom in when mouse over it,can anyone tell me which event can do this</p>
| iphone | [8] |
2,971,273 | 2,971,274 | Android logs printed in both debug and release mode | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2018263/android-logging">Android logging</a> </p>
</blockquote>
<p>In Android is there a way to disable logs/stacktrace being printed when the application is code signed and is in release mode. Is there any dire... | android | [4] |
1,801,347 | 1,801,348 | Make undefined variable an error in php | <p>I have the following code snippet: </p>
<pre><code><?php
ini_set('display_errors', '1');
error_reporting(E_ALL | E_NOTICE);
print $bla;
print 7;
?>
</code></pre>
<p>which prints out a warning that <code>bla</code> is undefined, but continues afterwards. I want php to throw an error and stop code execution wh... | php | [2] |
4,699,260 | 4,699,261 | iPhone tab bar Item image resolution? | <p>what is the resolution of the image for tab bar item?
and also please provide some other usefull information regarding that tab item image.</p>
<p>Thanks in advance.</p>
| iphone | [8] |
1,372,809 | 1,372,810 | Name of C# program behavior with circular-like assignment | <p>The code below compiles, but I don't understand the behavior of keeping the 1 element array instead of assigning the two element array. Is there a name for this behavior so that I could search for more information about it? I realize that this code isn't sensible because the 2 byte array could be assigned in the cal... | c# | [0] |
4,327,002 | 4,327,003 | How to kill the main thread, from another thread (in Java) by RESTful web services call? | <p>Say, I have a Java application running, and I have provided RESTful web services call (via Java Jersey). First, am I right that every invocation of a HTTP RESTful request (or servlet request) runs on a different thread from the main thread? And if so, if I provide a RESTful call to kill the app, how can it reach the... | java | [1] |
3,263,726 | 3,263,727 | '->' and '.' used on a reference to an object? | <p>I'm working on a code base and I came across something that kinda stumped me, or at least made me think twice for a bit.</p>
<p>I have a parameter to a function passed by reference like so: </p>
<pre><code>const PathTile &refTile
</code></pre>
<p>at one point in the function a member function of the <code>pat... | c++ | [6] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.