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,239,954
5,239,955
PHP: Remove image from server
<p>as I you can upload profile avatar to your profile, I wish to remove the previous one the user had. </p> <p>So before the query, where it changes the column "avatar" with the newfile.jpg, i wish to grab the newfile.jpg, and remove it from the server.</p> <p>How can I remove an image from the server? A secure way</...
php
[2]
4,409,130
4,409,131
Remove object from list by identity
<p>In the following example a std::list stores objects of type Resource (by value, not pointing to). The Resource class does not provide a less than comparison nor equality operator. What is a good way to remove an object by identity (aka memory address). Can i avoid O(n) somehow? Is std::list the right container?</p> ...
c++
[6]
3,318,396
3,318,397
EditText focus lost
<p>In a custom ListView, there are two cols, one having TextView and other having EditText. For entering some preference, as the user clicks on the EditText, the software keyboard comes in focus and focus from the EditText is lost. How i can do this?</p>
android
[4]
4,583,146
4,583,147
How to add more options in Javascript dependent options?
<p>I want to add more dropdown options in this file:</p> <p><a href="http://parseven.com/java_ex.html" rel="nofollow">http://parseven.com/java_ex.html</a></p> <p>Now it has two and I want to make three more. Third option must be dependent on second option and so on. Please advise me. Thanks in advance.</p>
javascript
[3]
2,738,283
2,738,284
Java - Is there a way to call a variable using a variable as part of its name?
<p>This is what I'm doing,</p> <pre><code>for (i=0; i&lt;4; i++){ for (j=0; j&lt;7; j++){ someArray[1][i][j] = value1[i][j]; } } for (i=0; i&lt;4; i++){ for (j=0; j=0; j&lt;7; j++){ someArray[2][i][j] = value2[i][j]; } } </code></pre> <p>This is what I'd like to do</p> <pre><code>for ...
java
[1]
3,204,157
3,204,158
How to show No record found in GridView if binded datasource is List Collection
<p><br> I have a gridview in which dtasource binded is a List which returns class type. If no records in list, I want to display 'No records found' in GridView.</p> <pre><code>List&lt;Ticket&gt; ticketList = new List&lt;Ticket&gt;(); ticketList = _tktBusiness.ReadAll(_tkt); if (ticketList.Count &gt; 0) { gr...
asp.net
[9]
481,426
481,427
From Bluetooth headset I am getting unclear voice when it is audio call in Android
<p>In my Activity class I wrote the following code for start the <code>bluetoothsco</code> in android. After connected Bluetooth to my tablet I make a sip audio call once call is established voice is <code>In-voice/Out-voice</code> is working, but voice is really unusable to hearing from Bluetooth.</p> <pre><code>Audi...
android
[4]
5,832,320
5,832,321
C#: New line and tab characters in strings
<pre><code>StringBuilder sb = new StringBuilder(); sb.Append("Line 1"); //insert new line character //insert tab character sb.Append("Line 2"); using (StreamWriter sw = new StreamWriter("example.txt")) { sq.Write(sb.ToString()); } </code></pre> <p>How can insert a new line and tab character in this example? </p>
c#
[0]
4,514,376
4,514,377
DownloadFile throws Internal Server Error
<p>This code throws exception. How to fix it?</p> <pre><code>string uriString = "http://www.fileserve.com/login.php"; NameValueCollection postvals = new NameValueCollection(); postvals.Add("loginUserName", "aaaa"); postvals.Add("loginUserPassword", "xxxx"); postvals.Add("autoLogin", "on"); postvals.Add("loginFormSubm...
c#
[0]
1,422,073
1,422,074
Using conditions in different triggers
<p>I am having a lot of difficulties trying to find out more about how to type out a set of codes and reference it at other parts of the CS file.</p> <p>For example, I have a simple "switch statement" with a label. Instead of typing it out 2 or 3 times, I would like to just be able to call it. Below is a quick illustr...
c#
[0]
1,415,605
1,415,606
How do I set EOF on an istream without reading formatted input?
<p>I'm doing a read in on a file character by character using istream::get(). How do I end this function with something to check if there's nothing left to read in formatted in the file (eg. only whitespace) and set the corresponding flags (EOF, bad, etc)?</p>
c++
[6]
3,466,178
3,466,179
How to remain on the same page if error occured?
<p>The following code is simplified to illustrate my question. This is a page to capture data and it will will post the captured info and pass to another php page for processing. I'm trying to ensure the required fields are entered but it always go to the calling page regardless there is error. Can anyone help?</p> ...
php
[2]
4,784,595
4,784,596
path problem in java
<p>I am using net beans for developing my application in windows environment .. I have a xml file in XML folder (under web pages folder) . I am using the following code to read the xml file: </p> <pre><code>String path=new File("XML/TableNamesAndColumnNames.xml").getAbsolutePath(); </code></pre> <p>but it is giving n...
java
[1]
5,871,746
5,871,747
how does this php form work without defining variable?
<p>how does this php form work without defining $SCRIPT_NAME variable ?</p> <pre><code>&lt;form action="&lt;?php echo $SCRIPT_NAME ?&gt;" method="post"&gt; </code></pre>
php
[2]
3,015,380
3,015,381
Method taking two default parameters
<p>I have a method with the following definition:</p> <pre><code>void foo(int i = 0, bool flag = false) {} </code></pre> <p>I want to call foo() by passing only the second argument:</p> <pre><code>foo(true); </code></pre> <p>But like this it will always pass it to the first parameter (i).<br> Is there any other sol...
c++
[6]
3,112,287
3,112,288
iphone - stuff inside alertview
<p>I have a part on my app that I show the users, the files they have created and have stored inside the app's directory. I want to allow the users to rename the files. </p> <p>I am wondering of doing this:</p> <ol> <li>The user selects a file</li> <li>The user taps on the RENAME button.</li> <li>An alertview pops sh...
iphone
[8]
659,422
659,423
Calling OnPaintBackground
<p>I'm working on making the form's background to be transparent, so i tested the following code in some random project and it worked perfectly, but now when i applied it to a new project it hasn't been read during the load process as i tried to break point!! what am i doing wrong?</p> <pre><code>protected override vo...
c#
[0]
3,300,956
3,300,957
How to drag images around the screen
<p>Can anyone help me on how to code program for an image that can be drag around the screen? Can you give me a sample code for it. thanks a lot. And how can i make a game score for it. i will appreciate your response.</p>
android
[4]
4,030,626
4,030,627
Using Named Parameters in java Class
<p>I have a use case to use named and optional parameter.I tried to use named parameter as in a tutorial but it doesn't work</p> <p>My code is</p> <pre><code>public static void Main(String[] args) { System.out.println((CalculateBMI(weight= 123, height: 64)); } public static int CalculateBMI(int weight, in...
java
[1]
3,239,015
3,239,016
Is the bitmap recycling process asynchronous?
<p>I have method that returns <code>Drawable</code>, and if its <code>Bitmap</code> object is recycled then it reloads.</p> <pre><code>public Drawable getLogo() { if(logo == null || Util.isRecycled(logo)) //Util.isRecycled checks - is Drawable's bitmap recycled, if it had so logo = CacheController.getInsta...
android
[4]
1,744,078
1,744,079
new object in c++
<p>i'm new to c++ programming and i will be happy if you can help me. i tried to write this code:</p> <pre><code>bool RailwayLineList:: AddInTail(const RailwayLine&amp; data) { //there is no linked list to add the element if(this==NULL) return false; RailwayLineLink *newLink = new RailwayLineLink(...
c++
[6]
4,351,620
4,351,621
PHP PDO error successful no matter what
<p>I have a problem with my database! Here is my code:</p> <pre><code>&lt;?php $host = "/homes/49/jc192699/public_html/dbase"; $database = "EduPro.db"; $dbhandle = new PDO("sqlite:".$host.$database); if (!$dbhandle){ echo "Error connecting to database.\n"; } else{ echo "&lt;br&gt;"; echo "&lt;br&gt;"; echo "Database...
php
[2]
3,906,556
3,906,557
hide everything on site
<p>Is it possible to hide everything on site using jquery before it starts to be rendered ? I check query string and if something is as I expected I do postback and then want to render correct site content.</p>
jquery
[5]
4,625,208
4,625,209
java adding two int arrays with different lengths. why giving a result that is smaller than correct result?
<pre><code>public void add(int[]a1,int[]a2){ int atotal[] = new int[20]; int capacity3 = Math.max(a1.length, a2.length); for (int i = 0; i &lt; capacity3; i++) { int a3 = a1[i] + a2[i]; if (a3 &gt; 9) { atotal[i] = a3 % 10; atotal[i+1] += a3 /10; } ...
java
[1]
2,811,228
2,811,229
c# finding indexof and remove character atsign
<p>there is a String which contains some @ characters, i want to find " @ " in my string and remove them, but it also finds and removes these ones: "@"</p> <pre><code>int atsignPlace = str.IndexOf(" @ "); while (atsignPlace &gt;= 0) { str = str.Remove(atsignPlace,3); atsignPlace = str.IndexOf(" @ "); } </code>...
c#
[0]
4,397,924
4,397,925
Create a Dialog from AlarmManager?
<p>I have scheduled an alarm using the AlarmManager and it fires off a BroadcastReceiver. Inside the broadcast receiver I want to call an Activity and create a popup dialog. </p> <p>The important thing here is I want to see the background of wherever the user is and NOT bring my application to the front first. Take...
android
[4]
5,310,497
5,310,498
what is serialization, can't i do it for methods or varibales in a class
<p>Could some body explain me why we do serialization an what is profit of this ?</p> <p>can we put serialize word on method or not, like in the following program on complete class the serialization is done can i do it on a method or a variable</p> <pre><code>Serializable] public class StudentInfo { //Default Con...
asp.net
[9]
431,719
431,720
Incrementally updating a asp.net web site?
<p>Is there a good way to make incremental changes to an asp.net website without re-publishing the whole site?</p> <p>I'm moving an old website from classic asp to asp.net, and one of the things that used to happen on the site was individual pages being changed in isolation. The site is only on a single server, and ha...
asp.net
[9]
2,718,914
2,718,915
Set a layoutmargin on a dynamically created checkbox
<p>I'm writing a task manager app that downloads a list of tasks and subtasks from a server and creates a new checkbox for each item and adds it to a linear layout (called ll below). The problem I'm having is that I cannot set the "layout margin left" using java like I can with XML (this is for the subtasks to indent t...
android
[4]
1,766,901
1,766,902
VideoView audio only, no video?
<p>I have a Video view in my activity used to display a video stored in my res.raw folder like this:</p> <pre><code>MediaController controller=new MediaController(this); video.setMediaController(controller); String filePath="android.resource://" + getPackageName() + "/" + R.raw.video3; video.setVideoURI(Uri.parse(file...
android
[4]
1,689,084
1,689,085
How to call a web service on page load
<p>I am trying to call a web service on page load. Currently I call it on a button click and it works fine. But when I try to do the same on viewDidAppear, it doesn't happen. What i want to achieve is if username and password are saved then it should automatically load the next page. It is filling in the text boxes but...
iphone
[8]
4,353,222
4,353,223
How can I download and display first 200 or 250 characters from a web-page?
<p>I have a list of urls for which I want to display first 200 or 250 characters. Can I do it using jquery or should I download them on the server side [using PHP] and store them in database?</p> <p>I guess I will have to use fopen with limit of characters. **</p> <h1>Edit</h1> <p>First 200 characters of "body" excl...
php
[2]
5,367,836
5,367,837
AttributeError: StringIO instance has no attribute 'fileno'
<pre><code>def captureOutput(self, func, *args, **kwargs): pass sys.stdout.flush() sys.stderr.flush() (outfd, fn) = tempfile.mkstemp() fout = os.fdopen(outfd, 'r') os.unlink(fn) (errfd, fn) = tempfile.mkstemp() ferr = os.fdopen(errfd, 'r') os.unlink(fn) try: oldstdout = o...
python
[7]
302,342
302,343
jQuery & Enabled/Disabled Controls
<p>I took from somewhere the following <em>script</em> which clears all input controls in the 'mainFrm' form:</p> <pre><code>$(':text , textarea , #mainFrm').val(''); $('select option:nth-child(1) , #mainFrm').attr('selected', 'selected'); $(':checkbox , :radio , #mainFrm').removeAttr('checked'); </code></pre> <p>It ...
jquery
[5]
5,209,089
5,209,090
representation of a number as multiplication of its factors
<p>I want to represent a number as the product of its factors.The number of factors that are used to represent the number should be from 2 to number of prime factors of the same number(this i s the maximum possible number of factors for a number).</p> <p>for example taking the number 24:</p> <p>representation of the ...
python
[7]
537,209
537,210
page Preinit, Init, load
<p>I am having a doubt in page_init, page preinit, load. I need to know when we use this also where we need to call our objects in different stages of our life cycle.</p> <p>Please let me know how they will process for each events raised</p>
asp.net
[9]
2,752,599
2,752,600
How do i get started with Android?
<p>How should i get started with Android? From where do i get help and sample source code? Can a JSF application run on Android phones? I saw primefaces site and it has TouchFaces which are meant for Android phones. But i really don't know how should i get started with Android. Is it too tough? Does it take too much ti...
android
[4]
334,185
334,186
calculation of work time and lunch time of individual days - php/mysql
<p>example: </p> <p>if a user come office in morning, go to lunch, come office after lunch, and then go to home then how we can calculate work time and lunch time</p> <p>[ currently i have 'start time', 'end time' and total time including lunch time ]</p> <p>I need 'total time' excluding 'lunch time' order by indivi...
php
[2]
5,766,084
5,766,085
iphone private API
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3546046/check-for-private-api-usage-yourself">Check for private API “usage” yourself?</a> </p> </blockquote> <p>How to find that my iphone project having private API..?</p> <p>Thanks....</p>
iphone
[8]
581,393
581,394
Custom control with Multiple Controls with same ID issue?
<p>I have a very simple custom control ive defined below:</p> <pre><code>public class TestCtrl : WebControl { protected override void OnInit(EventArgs e) { var btn = new Button() { ID = "test", Text = "text"}; this.Controls.Add(btn); } } </code></pre> <p>However, when I wish to place multi...
asp.net
[9]
815,291
815,292
jQuery-How to improve this code
<p>I have one jQuery code and need some help from u guys to improve performance. HTML:</p> <pre><code> &lt;div class="mydiv"&gt; &lt;div class="indiv"&gt; &lt;span&gt; myspan &lt;/span&gt; &lt;a href="#"&gt; ...
jquery
[5]
4,846,008
4,846,009
Why Debugger is not working Properly in Microsoft visual web developer 2005 express edition
<p>Debugger is not working Properly in Microsoft visual web developer 2005 express edition. </p>
asp.net
[9]
3,874,589
3,874,590
How is this if statement interpreted?
<p>I saw the code below, which shocked everyone.</p> <p>How is this code executed?</p> <pre><code>if (!Test.IsXyz == true) { } </code></pre> <p>If IsXyz resolves to true but then to false with the ! operator, how is this code interpreted? Because the RHS states true. Would this be:</p> <p>1) False for LHS | True fo...
c#
[0]
5,100,284
5,100,285
Check if a string is all numbers and 10 chars long
<p>Just looking for a quick way using PHP to check if a string is all numbers and 10 numbers long.</p> <p>eg: </p> <p>4343434345 - this would be accepted (10 chars all digits)</p> <p>343434344 - this wouldn't (9 chars)</p> <p>sdfefsefsdf - this wouldn't.</p> <p>thanks</p>
php
[2]
4,453,966
4,453,967
identifiers in java with different versions?
<p>as we "No keyword should be used as an Identifier in java". But there will be some words like asser or enum or any other which have been added as keyword in version 1.4, 1.5 resp. So if any older version code is used to compile with new javac, what happens if that code contains these words as an identifier?</p>
java
[1]
3,881,248
3,881,249
Unify 2 bytes to Int
<p>I have a function that allows me to separate a INT value in 2 Bytes (e.g: INT "123123" results in E0F3; <code>highByte= 0xF3</code> and <code>lowByte=0xE0</code>)</p> <p>using this:</p> <pre><code>void int2bytes(unsigned char dest[2],int val){ int hByte=0; int lByte=0; hByte...
c++
[6]
4,228,369
4,228,370
Send bacup on dropbox
<p>I'm able to get files,zip,accountinfo from dropbox via api of dropbox,but i"m not put a file on dropbox. All code running on server. i'm using code : accontinfo code is: $accountInfo = $dropbox->accountInfo();</p> <p>getFile code is: $dropbox->getFile($path, $outFile);</p> <p>putFile code is : $dropbox->putFile('...
php
[2]
3,224,728
3,224,729
How to show current time in textbox in android
<p>In my application I need to show current date and time in a texview. The text view should be set with updated for every minute. I dont want to display seconds. Can any one please help me.</p>
android
[4]
917,469
917,470
Setters not working
<pre><code>public class Shape{ public int xPos = 10; public int yPos = 20; Shape(){ } public int getXpos(){ return xPos; } public void setXpos(int x){ this.xPos = x; } public int getYpos(){ return yPos; } public void setYpos(int y){ this...
java
[1]
3,835,233
3,835,234
How to display a welcome screen in android?
<p>Hi i want a screen which should appear for 2-3 screen with my logo and then should proceed to main program. how to implement this.</p>
android
[4]
987,539
987,540
JavaScript - Replace two characters with each other?
<p>I have a string and I want to replace every capital 'I' with small 'i', and every small 'i' with a capital 'I'. As you can see if I do this in two stages it just converts it, then converts it back to how it was before. So how would I do it all at once?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/...
javascript
[3]
163,242
163,243
Access the Apps available in iphone
<p>Hi i would like to access the apps which are available in iphone means downloaded apps and inbuild apps.But here issue is if i access any app which is available in iphone using [[UIapplication sharedapplication]openurl:[NSURl url urlwithstring:@"http://www.skype.com"]] like this i can able to access that iphone app ...
iphone
[8]
4,700,759
4,700,760
Android save and load firstrun state
<p>In my app when user clicks a button, a male or a female sound is played. I want this: if at first run a male sound was played then also at the other clicks/runs a male sound is played. So no female voice ever. If at first run a female sound was played then also at the other clicks/runs a female sound is played. I do...
android
[4]
2,959,924
2,959,925
How to prevent a user from using "view source" to look at my php code and copy it?
<p>How can I prevent a user from using "view source" to look at my php code and copy it?</p> <p>thanks</p>
php
[2]
6,005,389
6,005,390
ClassFormatError: Unknown constant tag in class XY
<p>I have a piece of code in which I try to load a class during runtime. The code is not all selfwritten so I have some problems understanding the error which always appers after compiling.</p> <p>Here the code:</p> <pre><code>private Class findClass(String s) throws ClassNotFoundException { URL u...
java
[1]
2,251,392
2,251,393
Increment an index that uses numbers and characters
<p>I have a string based code that can be either two or three characters in length and I am looking for some help in creating a function that will increment it.</p> <p>Each 'digit' of the code has a value of 0 to 9 and A to Z.</p> <p>some examples:</p> <p>the first code in the sequence is 000 </p> <p>009 - next cod...
c#
[0]
2,381,193
2,381,194
how can I play a sound using a phone call in android?
<p>I am making calls using my app , but now i need to something very funny with call means i need to play recording sounds so that other person on call can hear it . Is it possible in android ? Please help</p>
android
[4]
5,228,209
5,228,210
I want to split an activity into several classes. is it possible?
<p>I'm finishing an application, the thing is that I have a couple of layouts and all the code concentrated in an Activity. I have 5000 lines of codes and when I have to fix something is a pain in the ass to find what im looking for.</p> <p>as im really new in Android development, I can't find a way to split the code ...
android
[4]
3,242,520
3,242,521
Javascript datestring constructor changes timezone
<p>I have a string Date in this format: </p> <blockquote> <p>"2012-07-22T08:00:00Z" </p> </blockquote> <p>But when i try to create a date from that string: </p> <pre><code>new Date("2012-07-22T08:00:00Z"); </code></pre> <p>I get: </p> <blockquote> <p>Date {Sun Jul 22 2012 01:00:00 GMT-0700} </p> </block...
javascript
[3]
497,608
497,609
Python Datatype for a fixed-length FIFO
<p>I would like to know if there is a native datatype in Python that acts like a fixed-length FIFO buffer. For example, I want do create a length-5 FIFO buffer that is initialized with all zeros. Then, it might look like this:</p> <p>[0,0,0,0,0]</p> <p>Then, when I call the put function on the object, it will shift...
python
[7]
200,185
200,186
how to close an application in android
<p>Is there any proper way as suggested by google or android official documentation to close an application in android with out using any task killer tools .... </p> <p>I ask this question as a android use not as developer..... </p>
android
[4]
5,335,134
5,335,135
java constructor in super classes
<p>The following code is a testing program. Why i can't use A(int a), in this program?</p> <pre><code>public class A { int a; void meth(int b) { a+=b; } A(int a) { this.a=a; } } class B extends A { int a; void meh2(int b) { a+=b; } } </code></pre> <p>why can't ...
java
[1]
1,883,151
1,883,152
How to make an Android application work only for some trial period
<p>I have an application which should work only for 30 days or few days.</p> <p>It's just a simple application which has some audio files playing to corresponding to images displayed with some text displayed.</p>
android
[4]
1,157,215
1,157,216
Setting attribute using data from a for loop
<p>I have the following code</p> <pre><code>for(var i = 0; i &lt; data.length; i++) { var item = data[i]; $('.client-content').append("&lt;li&gt;"+"&lt;b&gt;"+i +"&lt;/b&gt;" + " : " +item[0] + " : " + item[1]+"&lt;a href='#' class='link-right'&gt;Edit&lt;/a&gt;" + "&lt;a href='#' class='link-right'&gt;D...
jquery
[5]
5,098,829
5,098,830
Website Development Problem CakePHP, WordPress or Start From Scratch?
<p>I'm in the process of starting a new web site that is something like stackoverflow but a little bit more different along with making the members profiles highly more customizable I was thinking of building it from scratch using PHP, but was thinking of using CakePHP, but then I thought WordPress sounded better but I...
php
[2]
5,042,972
5,042,973
Code check - Function to verify integers with optional return value
<p>I'm hoping someone could give me some input on how to improve this function. Its purpose is to evaluate whether a form input is a valid integer, and if not, either return a zero by default, or -1 if the second argument = true.</p> <p>EDIT: Here is an updated version of the function I'm using. It seems the two most ...
php
[2]
3,485,415
3,485,416
View PDF in a web page without Flash
<p>I am working on a website that need to embed weekly PDF file on a page.<br> We don't want to use Flash since website need to support cross browsers(like Android).<br> I have reviewed following topic but it doesn't meet my target since some browsers don't support HTML5.<br> <a href="http://stackoverflow.com/question...
javascript
[3]
1,329,211
1,329,212
How to test ajax post w\ jQuery
<p>I have the following function that opens jQuery UI's dialog warning about the delete of an entry. Everything works fine, except the POST with AJAX. I get response on "success" but I don't believe I am hitting the .php page that is supposed to execute the query. Am I missing anything here?</p> <pre><code>var $dialog...
jquery
[5]
5,196,064
5,196,065
C++ - Where do i start?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/525726/the-best-place-to-start-learning-c">The Best Place to Start Learning C++</a> </p> </blockquote> <p>Hi All, As a bit of a side project while I'm on my summer break from uni, I've decided to have a look at ...
c++
[6]
541,092
541,093
How to throw new Exception gracefully
<p>How can I throw exception gracefully?</p> <pre><code>public void Test() { if (error != 0) { string msg = "Error"; throw new Exception(msg); } // Other function ... } </code></pre> <p>I have also change the <code>throw new Exception(msg);</code> with logger</p> <pre><code>public void Test() { if (erro...
c#
[0]
1,988,095
1,988,096
Display as two Decimal
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8779659/convert-a-number-to-2-decimal-places-in-java">Convert a number to 2 decimal places in Java</a> </p> </blockquote> <p>I need to display a decimal number up to two digits in Java.</p> <p>For example:</p> ...
java
[1]
2,650,407
2,650,408
Python Tkinter program for Status Bar
<pre><code>from Tkinter import * class StatusBar(Frame): def __init__(self, master): Frame.__init__(self, master) self.label = Label(self, bd=1, relief=SUNKEN, anchor=W) self.label.pack(fill=X) def set(self, format, *args): self.label.config(text=format % args) ...
python
[7]
3,772,486
3,772,487
Launching a project downloaded from the android open source project in eclipse
<p>I'm just starting to developing for the android platform. I'm still in "reading lots of code" phase. I downloaded the source code from android's music player into eclipse, now I want to run it on the emulator but eclipse tells me that the "selection cannot be launched". Is there something missing? I used this tutori...
android
[4]
4,519,764
4,519,765
How to make UpdateProgress render as span not div or make this div display:inline?
<p>How to make UpdateProgress render as span not div or make this div display:inline ?</p>
asp.net
[9]
3,564,476
3,564,477
Check a string regardless of case structure
<p>I have this code that checks if a string is blue. I want it to approve it regardless of whether it's lower or upper case in any of the letters.</p> <pre><code>if( ($subcol !== 'blue') || ($subcol !== 'Blue') || ($subcol !== 'BLUE') ) { $form-&gt;setError($field, "* Colour not correct, use the hint"); } </cod...
php
[2]
3,431,084
3,431,085
import content from csv to mysql database
<p>There is a mysql database named: <code>example</code> which has a table named: <code>products</code> it have fields: <code>products_model</code> and <code>products_image</code>. the model field is unique.</p> <p>now i have a csv file named <code>data.csv</code>. which have two column products_model and <code>produc...
php
[2]
4,676,208
4,676,209
Android Gridview drag and drop example
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7146639/android-gridview-reorder-elements-via-drag-and-drop">Android GridView reorder elements via Drag and Drop</a> </p> </blockquote> <p>Can anyone give me some link from where I can learn Drag and Drop inside...
android
[4]
752,550
752,551
jQuery: how to apply same predefined behavior for new appended element?
<p>I have a click method for a class of div tags <code></p> <pre><code>&lt;div id="wrapper"&gt; &lt;div class="detail"&gt;abc&lt;/div&gt; &lt;div class="click"&gt;click here&lt;/div&gt; &lt;div ckass="click"&gt;click here&lt;/div&gt; &lt;/div&gt; &lt;script&gt; ${.click}.click(function(){ $(#wrapper).append("&lt;div ...
jquery
[5]
1,107,314
1,107,315
Errors in C# Namespace, expected class, and end-of file expected
<p>I'm getting 4 errors with the following code, can you tell me how to fix this?</p> <p>1- A namespace cannot directly contain members such as fields or methods 2- Expected class, delegate, enum, interface, or struct. 3- Type or namespace definition, or end-of-file expected</p> <p>The code is:</p> <pre><code>Licens...
c#
[0]
4,358,625
4,358,626
Return type from db methods
<p>What return type should one return from a method that is getting rows from the database. Should you keep the data in a dataset / datatable, should you create a collection of objects representing the data, or should you return an interface such as IList or IEnumerable, etc?</p> <p>I know the real answer is "it depe...
c#
[0]
2,660,942
2,660,943
php - regexp match string and digit
<p>I want to match this </p> <pre><code>{format i=34 ds=11 k=a /} $patern = "/\{format[a-z0-9=\s]?\/\}/i"; </code></pre> <p>but result is null</p> <p>In additional question:</p> <pre><code>string string {format mat=34/} string string string string string string string string string string {format mat=34/} string...
php
[2]
4,380,251
4,380,252
Why Android application is not visible in running application?
<p>I am facing quite different issue.I had developed Android application it works fine.But the problem is I am not able to see that application in Running application (i.e. Setting > Application > Manage Application > Running). It is visible in rest of all the tab's (i.e. Downloaded,All). I am facing this issue in HTC ...
android
[4]
2,521,166
2,521,167
how can i start a song when app is in background mode
<p>I want to stop all playbacks by playing a empty audio file when my app is in background I tried following code but I was not played.</p> <pre><code> -(void)stop{ [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; if(_viewController.checkIpod==0){ AVAudioPlayer *playerA = [[A...
iphone
[8]
977,251
977,252
Disclosure button for displaying more text in a table view
<p>So i have created a custom cell with IB and source files associated which is put in my table view. The cell in my table view display text which doesn't fit entirely. What i want is to add a disclosure button in my cells which when is touch up display the rest of the text of the cell in for example two lines or by ad...
iphone
[8]
2,416,744
2,416,745
When to use getparent()
<p>In my custom view I need to use the getParent method and set the visibility on some of it's child views depending on my custom view's state. The problem is that I want to instantiate the child views just once. Where is the best place to do this?</p> <p>Thanks a lot,</p> <p>Gratzi</p>
android
[4]
5,654,869
5,654,870
How to check the occurence of the SelectedIndexChange event of a dropdownlist
<p>How can we check whether the selectedIndexChange event of a dropdownlist is fired or not? Can we use a boolean varible or is there any predefined method to do that?</p>
asp.net
[9]
3,127,069
3,127,070
Opposite to jQuery .remove
<p>I have an input form I am trying to remove/add on a click function. </p> <p>Here is my code:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $("#1").click(function () { $("#1").hide(""); }); $("#1").click(function () { $("#twit...
jquery
[5]
1,495,280
1,495,281
mouseenter / mouseover events not working on newly created elements
<p>I have a search bar and I want to list results as user types the query. The list results Div is a dynamically created Div. So, I couldn't use the mouseenter and mouseover and even the hover events on the div's contents.</p> <pre><code>$("ul#list_results li").mouseover(function(){ console.log("hh"); }); </code></...
jquery
[5]
523,452
523,453
What is the fastest way to learn Android and quickly start developing apps?
<p>I am a recent computer science student and have intermediate knowledge of java. However I am good at PHP.</p> <p>Please suggest me a fastest way to learn Android and start developing apps immediately.</p>
android
[4]
2,331,137
2,331,138
Java Pass by value, Advantage or Disadvantage?
<p>Java is pass by value. What if I need a pass by reference. For example in the following code I need a pass by reference mechanism.</p> <pre><code>public class BinaryTree { public TreeNode root; public BinaryTree(){ root = null; } public TreeNode insert(TreeNode temp,int x){ if(temp...
java
[1]
5,054,344
5,054,345
How to bring a jQuery object into a function?
<p>I have this jQuery object which I need to pull into a function, is this possible? Please see the code snippet:</p> <pre><code> var input; jQuery('.upload').live('click', function() { input = jQuery(this).find(".image-path"); tb_show(title, 'media-upload.php?type=image&amp;amp;TB_iframe=true'); ...
jquery
[5]
1,523,763
1,523,764
How could this line possibly lead to a crash?
<p>Trouble code:</p> <pre><code>NSDictionary *contactNameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:item, @"contact", sortName, @"contactSortName", compositeName, @"compositeName", nil]; </code></pre> <p>Error:</p> <pre><code>Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FA...
iphone
[8]
432,226
432,227
checking text field value length
<p>I am trying to see if the text field length is at least a certain length. here is my code:</p> <pre><code>&lt;form name="form2" id="form2" onsubmit="return validate()"&gt; length 4: &lt;input type="text" name = "t" id="t" /&gt; &lt;input type="button" name="submit" value="submit" /&gt; &lt;/form&gt; &lt;script&gt...
javascript
[3]
1,740,979
1,740,980
Why overloaded operators that are members of classes can only have one parameter
<p>why cant i used an overloaded operator with 2 arguments as a member of a class like this:</p> <pre><code>myclass&amp; operator+(const otherclass&amp; cl, int value); </code></pre>
c++
[6]
2,162,109
2,162,110
C++ assignment operator associativity
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points">Undefined Behavior and Sequence Points</a> </p> </blockquote> <p>after the following c++ code, the array a contains: 0, 1, 2, 3, 4</p> <pre><code>int a[5] = {0,1...
c++
[6]
5,563,279
5,563,280
Getting the ID of the most recent DIV with Jquery
<p>I have a webpage that dynamically prepends new divs about once per minute.</p> <p>Here is what the HTML code basically looks like:</p> <pre><code>&lt;div id="container"&gt;&lt;/div&gt; &lt;div id="freshcontent"&gt; &lt;div id="501"&gt;Stuff 2:18pm&lt;/div&gt; &lt;div id="500"&gt;Stuff 2:12pm&lt;/div&gt; &lt;di...
jquery
[5]
4,587,675
4,587,676
Python unix timestamp conversion and timezone
<p>Hey all! Ive got timezone troubles.</p> <p>I have a time stamp of 2010-07-26 23:35:03 </p> <p>What I really want to do is subtract 15 minutes from that time.</p> <p>My method was going to be a simple conversion to unix time, subtract the seconds and convert back. Simple right?</p> <p>My problem is that python ad...
python
[7]
4,944,871
4,944,872
Find nearest airport using iOS
<p>I am writing an App that needs to find the closest international airports using the iPads GPS. Is there anyway of doing this easily?</p>
iphone
[8]
3,336,720
3,336,721
handling integer having large number of digits
<p>how to handle integers having say 25 digits in c++ solve the problems..</p>
c++
[6]
228,451
228,452
Compare dictionary values and key in python
<p>I have a dictionary <code>item</code>. It has strings as keys and the values are lists e.g.:</p> <pre><code>item['title'] = [u'python'] item['image'] = [u'/link/to/image'] item['link'] = [u'link to article'] </code></pre> <p>I want to check if any value is 0 in length, but link or image may be empty, so I did the ...
python
[7]