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
5,024,786
5,024,787
in `while`, why i cannot declare variable in the condition just like we do in`for`?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1581364/why-cant-we-define-a-variable-inside-a-while-loop">why can&#39;t we define a variable inside a while loop?</a> </p> </blockquote> <p>I would like to simplify the following code:</p> <pre><code>string li...
c#
[0]
1,727,121
1,727,122
How to make list view as multiselectable
<p>In screen layout as I declared my list view as</p> <pre><code> &lt;ListView android:id="@id/android:list" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00FF00" android:layout_weight="1" android...
android
[4]
83,966
83,967
Expression value
<p>I have these declarations: </p> <pre><code>var a; var b = 1; var c = 2; var d = a || b, c; </code></pre> <p><code>d</code> is 1 , so what is the meaning of the <code>,c</code> in the expression?</p>
javascript
[3]
1,701,346
1,701,347
How do I add the 'Add To Favourites' Feature into a Tab Bar App?
<p>I'm just wondering what code I would use to add a 'Add To Favourites' feature into my app?</p> <p>Any help would be awesome!</p>
iphone
[8]
769,160
769,161
Reason for using intermediate variable insteading of just returning result of expression?
<p>This is a very basic question. I'm learning Javascript, and I'm fairly new to programming in general. In a lot of tutorials, I've seen something like this:</p> <pre><code>function add(a,b) { var sum = a+b; return sum; } </code></pre> <p>Now, for such a simple calculation, it seems to me that there's no rea...
javascript
[3]
5,898
5,899
A solution to remove the duplicates?
<p>My code is below. Basically, I've got a CSV file and a text file "input.txt". I'm trying to create a Python application which will take the input from "input.txt" and search through the CSV file for a match and if a match is found, then it should return the first column of the CSV file.</p> <pre><code>import csv cs...
python
[7]
4,101,321
4,101,322
activity is restart when screen is rotate
<p>I wonder why android:configChanges="orientation" could not work for android version 4.0.3. When the screen is rotate the activity restart.</p> <p>Please kindly help on this matter.</p> <p>Rgds, Virak</p>
android
[4]
4,129,399
4,129,400
SelectedIndices Changed Listbox
<p>Is there some event I can use to tell when the <code>SelectedIndices</code> property changes for a listbox? I want to deselect items in a listbox based on a certain property value of the item. I've hooked up an event that works for when a <code>SelectedIndex</code> is changed, but not sure how to do it for when the ...
c#
[0]
4,647,293
4,647,294
How Suggest Struct Of DAT File in C#
<p>I want to find structure of .dat files in C# to create reports. thank you.</p>
c#
[0]
4,694,064
4,694,065
Is it possiple to programmatically change proxy setting in android
<p>i am trying to make a simple proxy changer application in android. So i want to know that, Is it possible to programmatically use or change proxy setting in android, like we change proxy settings in windows Internet Explorer.</p>
android
[4]
5,787,084
5,787,085
Variable content is different upon content-type
<p>Upon transfering my site from one server to another, some functions started behaving differently.</p> <p>The problem lies in building my rss feed. My feed are composed of database posts containing html, and to show them correctly in the feed I then need to change the picture paths to full domain paths, instead of j...
php
[2]
1,030,520
1,030,521
Is there a way of programatically restarting an Android application
<p>I have an application that is distributed into a series of apps. I would like to provide users with a method of clearing their user data. To do this I would like each app to clear it's user data. I have this part working correctly.</p> <p>My question is, once I have cleared the user data, is there a way of restarti...
android
[4]
4,875,387
4,875,388
Is it possible to create objects of Enum types in java?
<p>I found this type of code in a repository during my project work. That repository works well fine... but when i am trying to understand the code through an independent test run... giving error!!!</p> <pre><code>public enum Fruits { static { APPLE= new Fruits( "APPLE", 0 ); BANANA = new Fruits( "...
java
[1]
2,975,945
2,975,946
for in loop in javascript
<p>i am trying to understand following fragment of javascript code</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;p&gt;Click the button to loop through the properties of an object named "person".&lt;/p&gt; &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt; &lt;p id="demo"&gt;&lt;/p&gt; ...
javascript
[3]
3,743,600
3,743,601
If statement shorthand into and String
<p>Hi I wanna know how to write this in Javascript :</p> <pre><code>var object { baseUrl: "js" &lt;?php if (DEBUG_MODE) echo '/raw'; ?&gt;" } </code></pre>
javascript
[3]
555,380
555,381
Getting a process's ram usage
<p>I have been having some trouble figuring out how exactly I get a process's ram usage. (How much ram it is currently consuming, not how much is reserved, or its max or min)</p> <p>Lets say I have a process running in the back ground, Java.exe, it is allowed to use 1024mb of ram, how can I tell how much ram it is cur...
c#
[0]
1,167,980
1,167,981
I am having an "Illegal start of expression" error with user imput
<p>I am trying to get user input, however I am getting <code>illegal start of expression</code> at:</p> <pre><code>public static String askTheUser() throws IOException </code></pre> <p>Complete code:</p> <p>Edit: I have made most of the changes you guys suggested so now I have this:</p> <pre><code>import java.io.B...
java
[1]
2,904,778
2,904,779
Usecases for method hiding using new
<p>This is more or less an exact duplicate of <a href="http://stackoverflow.com/questions/3117838/why-do-we-need-the-new-keyword-and-why-is-the-default-behavior-to-hide-and-not-ov">this post</a>, but as I cannot edit it, I started this. Feel free to move something over and close this one.</p> <p>Using method hiding wi...
c#
[0]
2,833,329
2,833,330
Redirecting back after login in PHP
<p>I have a scenario like this. When the admin receive a mail from client about orders with a URL link to PHP form page, which only can accessed by admin login. If administrator is not logged in, the url will be redirected to the login page. After the administrator logged in successfully I need to redirect him to the U...
php
[2]
5,245,414
5,245,415
Problem with .load() in jquery
<p>Ok, I'll put my code:</p> <pre><code>$("#html_contenido").load("../../jsp/comun/contenedor_operativa.html" ,function(){ $("#html_publicidad_reservar").load("../../html/pub/publicidad_reserva/publicidad_reservar_fr.html", function(){ alert($("#html_publicidad_reservar").html()); }); }); alert($("#ht...
jquery
[5]
3,358,963
3,358,964
how to give divider in Dailog box
<p>how to give a divider in a dailog box, my xml is as follows</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="400dp" &gt; &lt;ImageView android:id="@+id/imageVi...
android
[4]
2,823,811
2,823,812
Drag and Drop between Multiple Lists and Sortable
<p>Wondering if people could please point me to a plugin/website that is jQuery, which will do what this Dojo example does, i.e:</p> <p><a href="http://dojocampus.org/explorer/#Dojo_Drag%20And%20Drop_Lists" rel="nofollow">http://dojocampus.org/explorer/#Dojo_Drag%20And%20Drop_Lists</a></p> <p>I am wanting something s...
jquery
[5]
2,663,783
2,663,784
How to use command prompts to compile code?
<p>Alright, I've been spoiled enough already by IDEs, and I want to learn how to use the prompt to compile code.</p> <p>Where can I find good learning material, me being completely oblivious to the matter? To be more specific, I'd like to know how to use C#'s csc.exe fully, though I hope that the knowledge will be app...
c#
[0]
216,575
216,576
How to add alert dialog onKeyDown?
<p>I have this code on my application </p> <pre><code>@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { Intent a = new Intent(this,a_stages.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); return true; ...
android
[4]
5,625,178
5,625,179
How to track directory opening
<p>I'm not sure if the question's title makes sense, and I'm sorry if it doesn't; I didn't really know what to title it.. Anyway, is there a way to make your program track the viewing of a folder?</p> <p><strong>What I'm trying to achieve:</strong> Windows 7 Home Premium doesn't allow encryption. So, I made a folder i...
c#
[0]
5,921,947
5,921,948
android ListView selected item
<p>how can i select an item (Text) from an ListVIew?</p> <p>ps:I am new on Android Development</p>
android
[4]
95,905
95,906
Naming php files: what do 'class.php' and 'html.php' extension mean?
<p>Just curious, I've noticed that some php files have extension 'class.php' or 'html.php'. What is the reason for a code file to have such extensions?</p> <p>Thank you in advance!!</p>
php
[2]
907,386
907,387
Convert date into minutes in JavaScript
<p>I want to compare two dates as which is bigger in those dates.</p> <pre><code>var date1 = 2011-9-2; var date1 = 2011-17-06; </code></pre> <p>Can anybody say how can I do this?</p>
javascript
[3]
5,468,197
5,468,198
jquery, Any short version to change top position relatively
<p>I want to add css top position relatively. if its top position is 30px, I want to add its position +30, so its result is 60px. </p> <p>so I have to do this like this,</p> <pre><code>$("#btn").css("top", $("#btn").css("top")+30); </code></pre> <p>is there any shorter way or effecient way to do this.</p>
jquery
[5]
825,995
825,996
PHP - assigning values in a function argument - good practice?
<p>Setting variable values inside a function call - I don't see this a lot, is this considered good practice?</p> <pre><code>function myUpdate($status){ ... } myUpdate($status = 'live'); </code></pre> <p>I personally like it because it's more descriptive. I see it more frequently the other way around, ie., assig...
php
[2]
2,059,600
2,059,601
in javascript, how do you sort a subset of an array?
<p>I have an array and would like to sort all but the last n elements.</p> <p>For example, if the array is 10 elements long, would like elements 0 through 7 to be sorted while elements 8-9 are left in place.</p>
javascript
[3]
4,219,836
4,219,837
How To wake screen in android
<p>Hi i am making an Alarm Application. When Alarm Time Comes i Am showing user a Dialog. But the problem is i want to acquire the wake lock when dialog appears. just like when an sms received the screen just wakes.</p> <p>i have try this one but is not working</p> <pre><code>public class Alarm extends Activity{ ...
android
[4]
1,857,393
1,857,394
Not working in move_uploaded_file for For Loop
<pre><code>for($i=0;$i&lt;count($sentto1);$i++) { $sel="insert into newmessage set sendto='".$sentto1[$i]."', sendfrom='".$almemailid."', subject='".$subject."', message='".$color."', attac='".$fi...
php
[2]
1,203,656
1,203,657
C++ while(cin >> x){} vs. while(true) {cin >>x;}
<p>Please consider this C++ code for creation and traversing a linked list (number of nodes to be decided by user, not programmer)</p> <pre><code>#include &lt;iostream&gt; using namespace std; class Node { public: int data; Node* next; Node(int d, Node* j): data(d),next(j) {cout &lt;&lt; "Constructor\n";} }; int ...
c++
[6]
256,309
256,310
Can someone please explain this struct?
<p>Can someone please explain what the meaning of this code? I know somehow the first two bytes represent the underlying id, the next byte represents exchange id etc but I am wondering how exactly does the :16, :8 work. Any references will be helpful and I couldn't really find any documentation on this. Thanks</p> <pr...
c++
[6]
1,459,724
1,459,725
Sending data back to the Main Activity in android
<p>I have two activities. Main activity and child activity. When I press a button, the child activity is launched Now I have no problem. I want to send some data back to the main screen. I used The Bundle class but it is not working. It throw some run time exception Is there any solution? Anyone knows the answer pleas...
android
[4]
1,897,228
1,897,229
UIImage imageNamed
<p>I'm trying to use a url as a <code>UIImage</code> in the OpenFlow API.</p> <pre><code>NSString *imageUrl = [[[newsEntries objectAtIndex:0] objectForKey: @"still"] retain]; NSURL *url2 = [NSURL URLWithString:imageUrl]; NSData *photoData = [NSData dataWithContentsOfURL:url2]; UIImage *imageUI = [UIImage imageWithData...
iphone
[8]
4,342,202
4,342,203
jQuery: running setInterval only when a given ID is present
<p>In jQuery, I would like to execute this code:</p> <pre><code>setInterval((function() { return alert('hello'); }), 3000); </code></pre> <p>but only if the DOM contains a certain element, such as</p> <pre><code>&lt;div id="say_hello"&gt;Say hello&lt;/div&gt; </code></pre> <p>This must be really basic, but I cann...
jquery
[5]
3,936,421
3,936,422
How could I Separate characters and numbers from an input and store as separate variables php
<p>How could I Separate characters and numbers from an input and store as separate variables php for example my input string is as <code>$str="abc567"</code> and i need to separate it as <code>$str1="abc"</code> and <code>$str2="567"</code>.</p>
php
[2]
4,389,837
4,389,838
Function works only with hard coded values
<p>This is the code I am working on:</p> <pre><code>if(connection.doDatabaseRead(findSQL)) { ResultSet retRES = connection.getResultSet(); int i = 0; // did we find anything while( retRES.next() ) { //read result from query suiteNum.add(retRES.getString(i))...
java
[1]
1,508,759
1,508,760
how to Disable views behind relative layout popup - android
<p>I have a relative layout popup which shows on a button click. I have some other views on the same screen, and the popup covers them. But when I click on the popup , the controls/views behind are getting clicked. How to disable this? </p> <p>( One solution I have is to get all the views and <code>setClickable = fals...
android
[4]
6,027,433
6,027,434
ASP.NET mp3 player
<p>I'm looking for a simple mp3 control, my project is an ASP.NET web site (VS2008/C#), I've searched a lot but there was no luck, how can I give my users a small mp3 player control which enables them to pause/stop/change music? I want it to be usable in all major browsers, and of course no Silverlight as SL is still n...
asp.net
[9]
3,459,313
3,459,314
Instantiate an object on request or on load using the delegator design pattern
<p>Just looking for varying opinions and reasoning on this:</p> <p>I want to maintain separate database tables for the delegated class should I:</p> <p>A) Store the ID of the delegated objects record and initiate it on request like so ...</p> <pre><code>class Book { private $Name; private $Color_ID; pu...
php
[2]
3,119,812
3,119,813
How to set wildcard in $_SERVER['REMOTE_ADDR'] possible?
<p>is it possible to set $_SERVER['REMOTE_ADDR'] to a wildcard, so that anyone on the network can see this?</p> <pre><code>&lt;?php if($_SERVER['REMOTE_ADDR'] == "112.200.150.212"){ ?&gt; &lt;a href="http://www.tinycounter.com" target="_blank" title="free hit counter"&gt;&lt;img bord...
php
[2]
4,310,639
4,310,640
To assign the value of a JavaScript variable into Java variable
<p>I have encountered a situation where I have to assign the value of a JavaScript variable into Java variable. Please suggest me a way to do it.</p> <p>P.S: Assigning value of Java variable into JavaScript is something like this:</p> <p>&lt; Script>&lt; %</p> <p>String str = "abcd";</p> <p>%> var x = &lt;%= a %>; ...
javascript
[3]
2,004,328
2,004,329
Any idea about the android project
<p>I have covered the basics in android on the topics below: List, Menus, Intents Persistent Storage Broadcasting,Notifications and Services Locations and Maps Telephony and Messaging. Widgets</p> <p>Now, I have to develop a simple project within two weeks as part of my course. I just want to get some suggestions rega...
android
[4]
3,293,805
3,293,806
How to display image captured using Camera in Android
<p>HI, <BR> I am writing an Android application where I need to display Image Captured through Camera. I am using Android 2.1 I tested in emulator. I am trying to capture the image , but how to display the captured Image on Screen. <br> Can anyone help me in sorting out this issue.</p> <p><br> Thanks in Advance.</p>
android
[4]
1,767,047
1,767,048
tracking the column and adding in arraylist
<p>I have a table in a database named table1 which has the following structure , it contains three different columns </p> <pre><code>id status aaa -- ------- ----- 11 true 12567 22 true 76432 33 null 98734 44 true 65783 </code></pre> <p>Now I am getting all the rows in an object S form thr...
java
[1]
5,954,897
5,954,898
Is it possible to recover deleted message/contacts stored on Android device
<p>I'm about to do a project regarding on this title.</p> <p>Can you guys steer me on right direction? Thanks.</p>
android
[4]
5,152,117
5,152,118
Flatten an iterable of iterables
<p>How can I write a function which returns every value nested in any iterable?</p> <p>Here's an example of what I'm trying to accomplish:</p> <pre><code>for i in function([1, 2, [3, 4, (5, 6, 7), 8, 9], 10]): print(i, end=' ') </code></pre> <p>Would print:</p> <pre><code>1 2 3 4 5 6 7 8 9 10 </code></pre>
python
[7]
4,636,853
4,636,854
Can't use draw9patch on ubuntu 10.10
<p>Iam trying to run draw9patch tool from android sdk(ver.10), and it gives me exception with error trace like this:</p> <pre><code>sh ./draw9patch Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) at java.awt.Window.&...
android
[4]
5,037,635
5,037,636
How to get attribute from a <link tag in pure javascript?
<pre><code>&lt;link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.blogger.com/rsd.g?blogID=7487871339000666216" /&gt; </code></pre> <p>How can I get the href attribute of this link tag without using any javascript library?</p> <p>Right now I'm using the code below to achieve this but I want to...
javascript
[3]
5,244,829
5,244,830
Unset multple intems in array
<p>Is there a PHP built-in function to unset multiple array items by key?</p> <p>That would be a native equivalent of:</p> <pre><code>foreach($badElements as $k) { unset($allElements[$k]); } </code></pre> <p>or, even better:</p> <pre><code>$keys = array_keys($badElements); foreach($keys as $k) { unset($allE...
php
[2]
556,109
556,110
Readfile issue PHP
<p>I am trying to force a download using php headers and the readfile function, here is my code:</p> <pre><code>if(file_exists($file_url)){header('Content-Type: '.$ftype); header('Content-Transfer-Encoding: binary'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-reval...
php
[2]
4,029,272
4,029,273
GET in a For Loop does just one execution
<p>Am trying to make a get request from javascript, with a function called geturl. So if i prepare my querys and add it in to an array, and looping throw that executes just one request. how can do that without a for loop? perhaps doing something with the array? </p> <pre><code>for (var i=0; i&lt;urls.length; i++) ...
javascript
[3]
2,249,691
2,249,692
url name for asp.net application
<pre><code> protected void Button_Click(object sender, CommandEventArgs e) { Response.Redirect("PageName.aspx?name=" + e.CommandArgument.ToString()); } </code></pre> <p>for example this code gnertates a page like </p> <p>www.mypage/PageName.aspx?name=12 </p> <p>is the database the id num...
asp.net
[9]
3,345,318
3,345,319
gremlins in my c++ method
<p>I've traced a bug down to a function which should be returning float values between 20 and 100 or so, but is sometimes (1 time in 10) returning values much much higher than that. The problem exists when I have an expression in the last line of the method, like this:</p> <pre><code>return snap(baseNumber, targets) ...
c++
[6]
4,441,134
4,441,135
invalid conversion from 'const char*' to 'std::basic_ostream<char>::char_type {aka char}'
<p>Can't get around this problem</p> <pre><code>ofstream out; out.open("o"); string a[5][5]; //fill array with letters from 'in.get(ch)'...and then i've tryed: //1 out.put(a[row[0]][col[1]].c_str()); //=&gt;invalid conversion from 'const char*' to 'std::basic_ostream&lt;char&gt;::char_type {aka char}' //2: out.put(con...
c++
[6]
1,523,932
1,523,933
Acting on cloned() jQuery element
<p>I have cloned some pagination using jQuery's <em>clone()</em> method. When I am attempting to show the current page number (<em>addClass('active')</em>) the behaviour is only occuring on the cloned version of the element. Can anybody help? </p> <pre><code>$(document).ready(function() { $('table.paginated').each(fu...
jquery
[5]
1,621,597
1,621,598
replace last seven characters of string
<p>I have a string and I want to replace the last 7 charators of the string with "#". For example I have "MerryChristmasu87yujh7" I want to replace "87yujh7" with seven "#######". So, the final string will be "MerryChristmasu#######".</p> <p>I have tried the follow code but it returns "MerryChristmasu#######1". It doe...
php
[2]
3,588,344
3,588,345
game programming for iphone
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/493324/what-resources-do-you-recommend-for-game-programming-on-the-iphone">What resources do you recommend for game programming on the iPhone?</a> </p> </blockquote> <p>i want to know how many engine are avail...
iphone
[8]
685,606
685,607
Perform Action Simultaneously when touchdown the UIButton
<p>HI... I have a UIButton with some action when i touch down the button the action performed simultaneously.</p> <p>Any one know plz answer this..</p>
iphone
[8]
5,156,964
5,156,965
jquery: change the value of `select1` onchange of `select2` IF $('#select2').val() < $('#select1').val()
<p>i've asked the first question about selects <a href="http://stackoverflow.com/questions/2934974/change-selects-value-onchange-of-another-select">here</a>, i thought, that when i resieve an answer, i would solve and the second part of my problem, but there was a short way to solve first problem, so i have to ask a qu...
jquery
[5]
4,070,707
4,070,708
requestRouteToHost IP argument
<p>For checking internet access on device I use requestRouteToHost function, but it's second argument has integer type - what i has to put in it? Is it int-view of IP like [1] function makes? I think there is more simple way by using default android functions. Can somebody tell me?</p> <p>[1] --></p> <pre><code>publi...
android
[4]
4,799,372
4,799,373
Java script calculator
<p>I am trying to make a simple calculator wher a person would in put two values and then when clicking a button an alert box would give the result. But it is not working.</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;scrip...
javascript
[3]
2,873,011
2,873,012
What are the possible reasons for NoClassDefFoundError when querying Environment?
<p>This is the offending line of code:</p> <p><code>String state = Environment.getExternalStorageState();</code></p> <p>Why does it throw NoClassDefFoundError in some rare cases (never on my development device, but on some users' devices)?</p> <p>The target systems are Android 3.1 and higher, I don't know which syst...
android
[4]
577,330
577,331
How to set jsse.enableSNIExtension to false when running Java programs?
<p>I am trying to set the Java system property <code>jsse.enableSNIExtension</code> to <code>false</code>, but when I try running this <code>java</code> just outputs help information:</p> <pre><code>java -Djsse.enableSNIExtension=false </code></pre> <p>What am I doing wrong?</p>
java
[1]
5,994,327
5,994,328
SITE_ROOT = URL + Variable?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7563220/site-root-variable">SITE_ROOT = Variable?</a> </p> </blockquote> <p>How can I get this:</p> <pre><code>define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'] . SITE_BASE); </code></pre> <p>to look something li...
php
[2]
4,262,547
4,262,548
Python 2.7: How to check if a deque is empty?
<p>Is try-catch the only method to do that?</p>
python
[7]
4,590,494
4,590,495
The Fastest Sorting function
<p>In C++ I need to sort the arrays that I had written with a fast speed as possible, My Question is What is the Best and the Fastest sorting function to use? Or Just Make One with MY self?</p>
c++
[6]
5,085,971
5,085,972
TextWatch in ArrayAdapter
<p>I have an ArrayAdapter and I'm using TextWatcher for control change in some TextView, but I have a problem. I dont know how to selected editable view after change. I tried to add a OnClickListener and have some profit, but to all works well I need first of all click on View and when on TextView</p> <pre><code>ViewH...
android
[4]
4,660,047
4,660,048
Sound Pool Permissions
<p>I am playing audio through my app using the sound pool, do I need to ask for certain app permissions?</p> <p>If I do, which ones do I need?</p> <p>Thanks for your help!</p>
android
[4]
1,043,766
1,043,767
Object reference not set to an instance of an object
<p>I create next button but doesent work. The error says: Object reference not set to an instance of an object. Please help</p> <pre><code>private void nextbutton_Click(object sender, EventArgs e) { if (counter&lt;dt.Rows.Count - 1) { counter++; cbSifra.Text = dt.Rows[count...
c#
[0]
1,254,442
1,254,443
Scrolling past header view in a ListView?
<p>I have a typical listview, it has one headerview. I want to set the y scroll value so the headerview is initially hidden to the user. My attempts have brought odd results. I know the exact height of the headerview (40dip), so I figured I should be able to just immediately set the scroll-y pos to that height and be g...
android
[4]
5,407,956
5,407,957
how saving latitude and longitude in mobile directory?
<p>User can fix the current location using GPS and save it in the location database in the form of Latitude and longitude. These saved coordinates can later be used to view the preferred location in the geographical map application. These location coordinates can be used to find the exact point of the saved location by...
android
[4]
5,007,420
5,007,421
perfomance of ConcurrentQueue vs Queue + lock
<p>I have to implement one-consumer one-producer standart algorithm. I can implement it using <code>Queue</code> and couple of <code>lock</code> statements easily. Or I can just use <code>ConcurrentQueue</code>. What is better?</p> <p>If <code>Queue + lock</code> is used then i can optimize "multiple addition/retrival...
c#
[0]
2,040,016
2,040,017
Changing text color onclick
<p>I'm new to JavaScript. I've developed a page using JavaScript in such a way that when I select a color it is applied to the whole page as a background. </p> <p>I want to develop a page where I can change only the text color. It should get changed (from red to green or something like that), but the page shouldn't g...
javascript
[3]
1,371,318
1,371,319
Image Url to binary
<p>please anyone help me to convert an image url to binary format and converted binary to image url..Iam using java ...please reply </p>
java
[1]
47,521
47,522
basic php login script failing
<p>am creating a simple php login script and testing it in firefox before uploading the server but to my suprise it fails each time.<br> //index.php</p> <pre><code>&lt;form name="form1" method="post" action="checklogin.php"&gt; username&lt;input name="myusername" type="text" id="myusername"&gt; password&lt;inp...
php
[2]
3,355,075
3,355,076
php user registration form problem
<pre><code> &lt;?php $yourname=$_POST["yourname"]; $email=$_POST["email"]; $password=$_POST["password"]; $country=$_POST["country"]; include('includes/config.php'); $result = mysql_query(" INSERT INTO `ban`.`users` (`userid`, `email`, `password`, `yourname`, `country`) VALUES (NULL, '$email', '$pas...
php
[2]
1,942,588
1,942,589
IEnumerable Or Enumerable for Enumerating composite objects
<p>Hello I need some help with the following:</p> <p>I have a ListView control with many ListViewItems, and each ListViewItem's tag property references a domain object like Customer etc.</p> <p>when retrieving the collection of selected listviewItems, I would like to pass an <code>IEnumerable&lt;Customer&gt;</code> i...
c#
[0]
3,958,966
3,958,967
how to find the total no.of inbound and outbound links of a website using php?
<p>how to find the total no.of inbound and outbound links of a website using php?</p>
php
[2]
2,770,410
2,770,411
read a multiline string in python
<p>I need to parse a string and read a particular substring from it. The string I need to parse is as follows :</p> <pre><code>domain ( (device (console (xxxxxx) (XXXXXX) ) ) ) domain ( (device (vfb (xxxxxx) (locatio...
python
[7]
3,906,137
3,906,138
PHP remove all characters before specific string
<p>I need to remove all characters from any string before the occurrence of this inside the string:</p> <p>"www/audio"</p> <p>Not sure how I can do this.</p>
php
[2]
3,139,710
3,139,711
Strange behavior with java strings
<p>I have two string variables ticker and detail. I'm trying to print out the two strings in one line. It just wouldn't work. I've tried so many different ways of doing this. To exclude the possibility of an uninitialized string I tried printing them out in different lines ... this works.</p> <p>This example works ......
java
[1]
5,400,785
5,400,786
Can a method with an unknown number of arguments call another method with an unknown number of arguments?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2126778/php-how-to-pass-func-get-args-values-to-another-function-as-list-of-arguments">PHP, how to pass func-get-args values to another function as list of arguments?</a> </p> </blockquote> <p>I have a method in...
php
[2]
1,451,690
1,451,691
Object Oriented Programming accessing variable values, How to?
<p>I am a learner, I have a class <strong>db</strong> to help me connect and fetch results in mySQL.</p> <pre><code>$set = $db-&gt;get_row("SELECT * FROM users"); echo $set-&gt;name; </code></pre> <p>this way i use echo results outside a class.</p> <p>Now i have created another class name <strong>user</strong> and i...
php
[2]
4,764,225
4,764,226
javascript: architecting a collectable card game
<p>I'm trying to learn how to program a (virtual) Trading Card Game game (similar to Magic the Gathering) in Javascript. I've read a little about MVC architecture and controllers, but it's all over my head (I don't have any formal CS education) and I'm wondering if anyone has any good links or tips about how I might le...
javascript
[3]
2,425,531
2,425,532
Java - waiting to initialize an activity after all threads are completed
<p>I have few threads that performs an actvity in parallel. I would have to proceed with the subsequent actvity only after all the threads are completed. Is there a way to achieve this?</p>
java
[1]
626,120
626,121
Exporting data from PHP to Excel format
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3968973/how-can-i-write-data-into-an-excel-using-php">How can i write data into an excel using PHP</a> </p> </blockquote> <p>I got a real problem here...</p> <p>I tried to export my data through an excel file b...
php
[2]
5,112,857
5,112,858
How to split the values in C#
<p>Is the code is correct for splitting the values.</p> <pre><code>string[] splitValue = value.Split(String.Chr[151]); </code></pre> <p>Thanks in advance</p>
c#
[0]
3,614,449
3,614,450
Muting the microphone android
<p>I am trying to toggle the microphone of Android mobile. App. freezes if I run the mute and unmute in a loop, With a delay of say 500ms. Is there a specific reason mobile behaves this way? (Motorola Droid is not even able to mute the phone) however all other mobiles are able to do it. </p> <p>This runs in a loop for...
android
[4]
1,012,581
1,012,582
Singleton class only has static fields and methods but has many instances in the memory
<p>In our project, we often use a utility class and its static methods to load some icons. This utility class is <strong>singleton</strong>. </p> <p>But in the running environment, we find 314 instances of this class, under which circumstances does that occur?</p>
java
[1]
4,116,833
4,116,834
Load dynamic Image in tableHeaderView
<p>I want to add a dynamic image in the UITableView's tableHeaderView part.</p> <p>For that i am writing following code :</p> <pre><code>UIImageView *myImageView = [[UIImageView alloc]initWithFrame: CGRectMake(0.0f, 0.0f, ...
iphone
[8]
5,709,655
5,709,656
Read the next word in a file in python
<p>I am looking for some words in a file in python. After I find the file I need to read the next two words from the file. I've looked for some solution but I could not find reading just the next words. </p> <pre><code># offsetFile - file pointer # searchTerms - list of words for line in offsetFile: for word in s...
python
[7]
490,733
490,734
Is there any reason to do boolean casting with !! instead of Boolean() in JavaScript?
<p>I am aware of Boolean(), String() and Number() casting, and the <code>'' + ...</code>, <code>!!...</code> and <code>+...</code> casting approaches.</p> <p>I am wondering if there is any reason to <strong>not</strong> use the function constructors?</p>
javascript
[3]
108,458
108,459
Disable all form elements but one
<p>I use the following to disable all form elements within a table row:</p> <pre><code>$(".chkbx").change(function(){ var $this = $(this); if ($this.is(":checked")) { $this.closest("tr").find(":input").attr("disabled", false); } else { $this.closest("tr").find(":input").attr("disabled", tr...
jquery
[5]
4,141,173
4,141,174
Reading from file (by bit) and then writing again to file
<p>i can't figure out about working with I/O.</p> <p>I am using this code to read from file:</p> <pre><code>if (file.length() &gt; Integer.MAX_VALUE) { throw new IllegalArgumentException("File is too large: " + file.length()); } int len = (int) file.length(); System.out.println("failo dydis yra = "+len); FileInp...
java
[1]
394,941
394,942
PHP variable with minus in
<p>I'm modifying a script where I want to get some server stats, where I've put my server key as one of the variables. I fear that the variable can't have minus within them. Is that true?</p> <p>See line 3.</p> <pre><code>// Convert lists to JSON $postdata=array(); $postdata['id']="534f7035-cef8-48aa-b233-8d44a0956e6...
php
[2]
643,343
643,344
Conditional compilation in Java: will compiler omit "always false" blocks from class?
<p>Below is a snippet of my code:</p> <pre><code>class A { private boolean debug = false; // Called when server boots up. public void init (property) { debug = property.getBoolean ("debug_var"); // read debug from a config file. } // some other function public void foo () { if (d...
java
[1]