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,057,589
5,057,590
Can any one explain Retain cycle with example code(Objective C) ? and How can we remove retain Cycle ?(with code)
<p>Can any one explain Retain cycle with example code(Objective C) ? and How can we remove retain Cycle ?(with code or diagram). I know about it theoretically but i never come across such kind of program ? I am very curious to see, how retain cycle solved (with code or diagram) ? </p>
iphone
[8]
5,381,291
5,381,292
How can I reduce power usage in a location-based Android application?
<p>How can I reduce the power usage in my application? What code can I use to implement this?</p>
android
[4]
1,203,065
1,203,066
How do I prevent visitors from opening a page outside iframe
<p>i need to prevent visitors from opening a page outside iframe</p> <p>for example </p> <p>when write on browser :</p> <pre><code>www.sss.com/index.php </code></pre> <p>will be open </p> <p>but when write </p> <pre><code>www.sss.com/add_news.php </code></pre> <p>i need to redirect to home page</p>
php
[2]
215,107
215,108
split file sentences into words
<p>can anyone help me please?</p> <p>I'm trying to split the <code>sentences[]</code> into <code>words[]</code>. But it shows <code>Syntax error on token "j", delete this token</code>... </p> <p>My code is:</p> <pre><code>try { int j; String paragraph = sample.readFileString(f); String[] sentences = par...
java
[1]
5,526,793
5,526,794
How can I multiply numbers in a list (after removing duplicates)?
<p>I'm using Python 3.2.3 IDLE. I see some people using the reduce commmand but for some reason I don't have it. Like the code doesn't come up in purple and it recognizes reduce as a variable.</p> <p>Here's part of my code:</p> <pre><code>numbers = [10, 11, 11] numbertotal = (set(numbers)) #removes duplicates in my l...
python
[7]
2,939,968
2,939,969
Set with custom function object comparator c++
<p>I have a file, on it's first line is the english alphabet, in a random order, after that, names. I should sort the names according to the alphabet given. My class looks something like this:</p> <pre><code>class MyCompare(){ private: static map&lt;char, int&gt; order; public: MyCompare(string alphabe...
c++
[6]
4,834,324
4,834,325
does google policy allow to share app?
<p>Does google policy allow us to share other installed app in android device ?</p> <p>Think we have a app manager, can I make a toolfor user to send\share app ?</p> <p>thanks </p>
android
[4]
3,999,286
3,999,287
call script after element is fully visible
<p>I'm using this script bellow for load hidden div, inside another:</p> <pre><code>$(document).ready(function(){ $(function() { $('#menu a').click(function(e) { e.preventDefault(); $('#menu a').removeClass("selected"); $(this).addClass("selected"); var h = $...
jquery
[5]
4,647,284
4,647,285
Broadcastreceiver not listening even after app launches maually in ICS
<p>My application displays music metadata if music is playing in the background. In ICS device, even after launching app manually, the broadcast receiver is not registered. It works fine for the versions below. I added a portion of my code below, do I want to add any intent action in the manifext file? </p> <pre><code...
android
[4]
3,639,959
3,639,960
intro to lambda/anonymous functions
<p>I have this function from a plugin (from a previous post)</p> <pre><code>// This method implements the test condition for // finding the ResolutionInfo. private static bool IsResolutionInfo(ImageResource res) { return res.ID == (int)ResourceIDs.ResolutionInfo; } </code></pre> <p>And the line thats calling this ...
c#
[0]
5,720,899
5,720,900
alaw ulaw convertion
<p>How can I convert a wav file to an rtp file? Can someone help me? I am working in c# 2008</p>
c#
[0]
4,726,023
4,726,024
wordpress featured image
<p>I'm new to Wordpress and I'm trying to create a new theme for it. I've downloaded the latest version (3.2.1) and installed it successfuly. But when I install my wordpress theme (to start to add the PHP) and try to create a new post, what happens is that the Set Featured Image box disappears and it only shows again w...
php
[2]
2,359,528
2,359,529
Python define dynamic functions
<p>I have functions like this:</p> <pre><code>def activate_field_1(): print 1 def activate_field_2(): print 2 def activate_field_3(): print 3 </code></pre> <p>How do I define <code>activate_field_[x]</code> for <code>x=1:10</code>, without typing out each one of them? I'd much rather pass a parameter, of c...
python
[7]
1,109,184
1,109,185
mime type of image and video taken on android phone
<p>If i use android phone to capture image and video whether it is the default camera app or other android camera app, is it safe to assume the image mime type will be 'jpg'? and video mime type be 'mp4 or 3gp'?</p> <p>Thank you.</p>
android
[4]
423,779
423,780
Opening the sharepoint modal dialog from asp.net code behind? Sharepoint 2010
<p>Is it possible to open the sharepoint 2010 javascript modal dialog from asp.net code behind? I have tried..</p> <pre><code> System.Web.HttpContext.Current.Response.Write("&lt;script type=\"text/javascript\"&gt;"); System.Web.HttpContext.Current.Response.Write("var options ="); System.Web.Http...
asp.net
[9]
746,730
746,731
Python ignores SIGINT in multithreaded programs - how to fix that?
<p>I have Python 2.6 on MacOS X and a multithread operation. Following test code works fine and shuts down app on Ctrl-C:</p> <pre><code>import threading, time, os, sys, signal def SigIntHandler( signum, frame ) : sys.exit( 0 ) signal.signal( signal.SIGINT, SigIntHandler ) class WorkThread( threading.Thread ) : de...
python
[7]
4,284,912
4,284,913
How to edit an appended div
<p>I have a button which creates form elements on click . </p> <p></p> <p>My <code>addelement</code> function looks like this</p> <pre><code>function addElement(){ to = document.getElementById('top'); newId = document.createElement('div'); id = 'my'+this.num; newId.setAttribute('id', id ); newId....
javascript
[3]
2,070,624
2,070,625
Is there a way to get a view into a python array.array()?
<p>I'm generating many largish 'random' files (~500MB) in which the contents are the output of repeated calls to <code>random.randint(...)</code>. I'd like to preallocate a large buffer, write longs to that buffer, and periodically flush that buffer to disk. I am currently using <code>array.array()</code> but I can't s...
python
[7]
1,035,489
1,035,490
EKEvent not added in iphone calendar(calendar event)
<p>I am using EKEvent and EKEventStore to add a calendar event in iphone calendar application.It worked fine Except two cases.</p> <p>Case 1: When start date and time should be same as end date and time means it is not added in iphone calendar.</p> <p>Case 2:When start date is greater than the end date means it is no...
iphone
[8]
3,039,043
3,039,044
What is acceptable memory usage for a PHP page?
<p>I'm building a webpage that queries a MySQL database and (currently) produces a text-only list of the findings. The queries to complete a single record are similar to:</p> <ul> <li>movie (title, description, etc) <ul> <li>actors in the movie (name, gender)</li> <li>related movies</li> </ul></li> </ul> <p>Out of cu...
php
[2]
218,612
218,613
How can i autogenerate class diagrams and sequence diagrams?
<p>Can anybody tell me how can i autogenerate class diagrams and sequence diagrams from my classes in php? I am using CodeIgniter.</p> <p>Thanks in advance :)</p>
php
[2]
5,644,104
5,644,105
On PopupWindowClose, mainpage redirect
<p>I'm working on the following scenario:</p> <ul> <li><p>A button got clicked in main page.</p></li> <li><p>popupWindow show up.</p></li> <li><p>A button got clicked in popupwindow.</p></li> <li><p>The popupwindow would be closed and the mainpage redirect.</p></li> </ul> <p>How to do that?</p>
asp.net
[9]
4,309,802
4,309,803
How to limit speed with BMW JSDK on 116i?
<p>I'm experimenting with the BMW Java SDK on the new BMW 116i Innovation Package. Basic things like turning the lights on and off, starting and stopping the motor work fine. What I'm trying to do now is that to write a carlet which would limit the speed to the maximum configured in the driver profile. Driver identity ...
java
[1]
5,839,887
5,839,888
Search all .pdf file present in the Android device
<p>How to search all .pdf and .doc file present in the Android device through programmatic way?</p>
android
[4]
380,168
380,169
Fast way to check if a server is accessible over the network in C#
<p>I've got a project where I'm hitting a bunch of custom Windows Performance Counters on multiple servers and aggregating them into a database. If a server is down, I want to skip it, and just continue on with my day.</p> <p>Currently I'm checking to see if a server is live by doing a <code>DirectoryInfo</code> on a...
c#
[0]
4,060,578
4,060,579
In Java, how do I ensure a dummy class is never used?
<p>I am working on a project in which, to resolve a versioning issue, I am creating many classes which will never be tested and must not ever be used - they just need to be there to keep the compiler happy. I'd like to make sure they are never used. This morning I had the idea of throwing an exception in a static ini...
java
[1]
2,193,696
2,193,697
Jquery - Key Press event not triggering
<p>Can anyone tell me why the event is not triggering ?</p> <pre><code>$(document).keydown(function(e){ if (e.keyCode == 37) { var thumbHolder = $("#thumbholder"); thumbHolder.scrollLeft(thumbHolder.scrollLeft() - 300); } }); </code></pre>
jquery
[5]
357,980
357,981
Error while running the project in android(eclipse)
<p>sir while i am running our project on android it gives an error then i start my emmulator again but still it shows an error:</p> <p>[2010-12-23 12:45:25 - helloandroid.project] ActivityManager: Warning: Activity not started, its current task has been brought to the front.</p> <p>kindy help to solve this problem</p...
android
[4]
1,597,907
1,597,908
not understood the answer of this code snippet(java)
<pre><code>class C{ static int f1(int i) { System.out.print(i + ","); return 0; } public static void main (String[] args) { int i = 0; i = i++ + f1(i); System.out.print(i); } } </code></pre> <p>how come the answer is 1,0. Please explain.</p>
java
[1]
5,181,752
5,181,753
How do I trim a string in javascript?
<p>How do I trim a string in javascript?</p>
javascript
[3]
72,201
72,202
See action bar across all activities - Android
<p>In my main activity I have my action bar. How can this stay visible even if I launch a new activity?</p> <p>Does the new activity have to extend my main activity for this to work?</p>
android
[4]
1,934,395
1,934,396
drop down list using javascript
<p>I want to add Drop down using <code>javascript</code></p>
javascript
[3]
3,977,612
3,977,613
PHP: If $_GET then bold it
<pre><code>echo '&lt;a href="?view=new&amp;days=2"&gt;2&lt;/a&gt; • &lt;a href="?view=new&amp;days=4"&gt;4&lt;/a&gt; • &lt;a href="?view=new&amp;days=7"&gt;7&lt;/a&gt; • &lt;a href="?view=new&amp;days=14"&gt;14&lt;/a&gt; • &lt;a href="?view=new&amp;days=30"&gt;30&lt;/a&gt; days'; </code></pre> <p>I have this as a "sub...
php
[2]
1,254,298
1,254,299
how to test my 2.1 android application on 2.2 device?
<p>i have made an android application using android 2.1. i want to test how my application will behave on a device with android 2.2 and 2.3. How do i test it in eclipse. i do not have any real devices to test my application. In eclipse, if i make an emulator with 2.2 , it does not list up in my application run configr...
android
[4]
4,223,388
4,223,389
Delete all files and folders after connecting to FTP
<p>I want to connect through FTP to an address and then delete all contents. Currently I am using this code:</p> <pre><code>from ftplib import FTP import shutil import os ftp = FTP('xxx.xxx.xxx.xxx') ftp.login("admin", "admin") for ftpfile in ftp.nlst(): if os.path.isdir(ftpfile)== True: shutil.rmtree(ft...
python
[7]
3,681,935
3,681,936
Increment a value in MySQL with PHP/MySQL?
<p>I have a posting system. When the user posts, I want the postcount row in the table to increase by one. I have researched on Google and I have only found this.</p> <pre><code>mysql_query("UPDATE users SET postcount=postcount+1 WHERE username = '$username'"); </code></pre> <p>I have also tried it with spaces </p> ...
php
[2]
2,409,688
2,409,689
How to retrieve http or https in URI
<p>I need to do something based on either http or https. For example:</p> <pre><code>$https = strpos($_SERVER['REQUEST_URI'], 'https') !== false; if ($https) { ?&gt; &lt;script type="text/javascript"&gt; var a = 'a'; &lt;/script&gt; &lt;?php } else { ?&gt; &lt;script type="text/javascript"&gt; var ...
php
[2]
2,758,006
2,758,007
python adding new line at the end of each line
<p>how can I preserve the file structure after substitution.</p> <pre><code># -*- coding: cp1252 -*- import os import os.path import sys import fileinput path="C:\\Search_replace" # insert the path to the directory of interest #os.path.exists(path) #raise SystemExit Abspath=os.path.abspath(path) print(Abspath) dir...
python
[7]
2,501,054
2,501,055
Get amount of function arguments OUTSITE in php
<p>I need to know, how much arguments a function accepts (including optional args). w/o calling that function and w/o getting errors. Like I can check with <code>is_callable</code> before I call a function in order to not get php error.<br> For example, in javascript every function have a <code>length</code> property:<...
php
[2]
2,328,694
2,328,695
Use StartActivityForResult() to take photos, but parent Activity is re-created after finish taking photos, why?
<p>I use <code>Intent it = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);</code> to take photos by call up camera. And after finish that, the parent Activity is re-created, and a value which I used to keep the path of the picture is initialed to be null.</p> <p>Why does this happen?</p>
android
[4]
1,707,888
1,707,889
Cannot call extended method on JQuery object
<p>I have HTML something like the following:</p> <pre><code>&lt;div id="quoteContainer"&gt; &lt;div class="quote prototype"&gt;&lt;/div&gt; &lt;div class="quote live q0"&gt;&lt;/div&gt; &lt;div class="quote live q1"&gt;&lt;/div&gt; &lt;div class="quote live q2"&gt;&lt;/div&gt; &lt;div class="qu...
jquery
[5]
4,653,698
4,653,699
Activity remains on screen Android
<p>I have a service that is listening to some events. When that event happens, it shows a screen by startActivity(intent)</p> <p>When the user finishes doing something on that screen, the code calls finish() but instead of 'closing' the complete application, it shows the main/launcher activity.</p> <p>I mean, whats t...
android
[4]
1,942,067
1,942,068
Help with Android MonthDisplayHelper
<p>How exactly do we use Android's MonthDisplayHelper? Ive been searching for possible widgets/views that would help me simplify my work as I would need to create a calendar. but it is just so hard. at least for me. So i saw this MonthDisplayHelper. from its members, i think i know what it can do..but what i don't get...
android
[4]
2,027,700
2,027,701
Post variables to another PHP file
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6192822/to-convert-a-data-obtained-through-url-to-post-variables">To convert a data obtained through URL to post variables</a> </p> </blockquote> <p>I receive some values in $_GET array, I would like to <strong>...
php
[2]
4,604,823
4,604,824
How does setRequestProperty method work?
<p>For example: </p> <p><code>connection.setRequestProperty("Range","bytes=" + downloaded+ "-");</code> </p> <p>How this code works?</p>
java
[1]
4,030,351
4,030,352
How to make our own HOME-SCREEN & take only one button/icon on Home Screen in Android?
<p>I just want to make my own HOME-SCREEN in android. I also want to call that HOME-SCREEN from my <code>Activity</code>. How to achieve it? I just want to put one button on that HOME-SCREEN.</p> <p>So, please tell me the exact solution. I have read this content from <a href="http://developer.android.com/resources/s...
android
[4]
642,706
642,707
Accessing a Collection
<p>I'm trying to make a class where you can access a collection in it and get an item using a string index, (I hope this makes sense), basically I would like to know either what this is called or how to do it?</p> <p>here is an example of what I mean;</p> <pre><code>string blah = SomeClass.Items["Item1"].ToString(); ...
c#
[0]
4,765,162
4,765,163
how to clear heap?
<p>I am working on a camera application. For first time if I capture image its working fine but if I take a picture again its throwing a error</p> <blockquote> <p>ERROR/dalvikvm-heap(2398): 10077696-byte external allocation too large for this process." VM won't let us allocate 10077696 bytes" and finally"05-02 05:35...
android
[4]
322,271
322,272
moving the cursor position in a text-box
<p>I am developing a web application using asp.net. There is a text box(not Rich text-box) which contains a HTML source file, and a list-box which lists out the errors in that file. When a particular error message in the list-box is selected, the cursor point should point out that particular error position in the text ...
asp.net
[9]
1,977,018
1,977,019
How to make "drawable" files accessible through the code
<pre><code>public static Bitmap loadBitmap(Context context, String filename){ AssetManager assets = context.getResources().getAssets(); InputStream buf = null; try { buf = new BufferedInputStream((assets.open("drawable/black_circle.png"))); } catch (IOException e) { ...
android
[4]
1,917,327
1,917,328
how to play a video from SD card on android mobile
<p>Im unable to insert a video on my SD card in my mobile ...and how to play this video in my device... please help me thanks in advance</p>
android
[4]
5,188,047
5,188,048
Using generics in a business object and collection
<p>I have a base object abstract class and a base object collection class for some business objects to inherit from. I'm trying to figure out how to pass the base object type to the collection class (and other methods). I've been able to solve this by wrapping the class in an interface but i'm wondering if there is ano...
c#
[0]
2,357,556
2,357,557
c++ Performance Of And Operator With Example
<p>I was wondering if the &amp;&amp; operator works in a cascading manor. Compare the following implementations of a rectangle collision check.</p> <pre><code>inline bool RectInRect(RECT one,RECT two){ if(one.left &lt; two.right) if(one.right &gt; two.left) if(one.top &lt; two.bottom) if(one.bottom &gt...
c++
[6]
1,495,532
1,495,533
appending arrays into session variable php
<p>Im trying to add additional arrays into my session variable such as...</p> <pre><code>$_SESSION[cart] .= array($_POST[name],$_POST[price],$_POST[quantity]); </code></pre> <p>All i get when i do this 3 times and <code>var_dump</code> is <code>string(15) "ArrayArrayArray"</code></p>
php
[2]
2,714,356
2,714,357
url shortener modification
<p>Im working with a php url shortener and my problem is that it only creates the MAX number of shortening codes up to 2 characters (eg domain.com/XX). I want it to go up to 5 characters (eg domain.com/XXXXX)</p> <p>I believe i found the relevant code, but im not sure how to change it to allow for this modification</p...
php
[2]
5,914,952
5,914,953
Passing arguments forward to another javascript function
<p>I've tried the following with no success:</p> <pre><code>function a(args){ b(arguments); } function b(args){ // arguments are lost? } a(1,2,3); </code></pre> <p>In function a, I can use the arguments keyword to access an array of arguments, in function b these are lost. Is there a way of passing argument...
javascript
[3]
2,809,586
2,809,587
Python: split a list based on a condition?
<p>What's the best way, both aesthetically and from a performance perspective, to split a list of items into multiple lists based on a conditional? The equivalent of:</p> <pre><code>good = [x for x in mylist if x in goodvals] bad = [x for x in mylist if x not in goodvals] </code></pre> <p>is there a more elegant way...
python
[7]
1,822,778
1,822,779
What is Difference between Property and Variable in C#
<p>I have a confusion about understanding Property and Variables</p> <pre><code>public class ABC() { public int A; public int B { get; set; } } </code></pre> <p>What is the exact difference between in A and B.</p> <p>Thanks.</p>
c#
[0]
5,031,871
5,031,872
Asynchronous for cycle in JavaScript
<p>How could I do this...? Do you have any ideas? Thank you.</p> <pre><code>for ( /* ... */ ) { someFunction(param1, praram2, function(result) { // Okay, for cycle could continue }) } alert("For cycle ended"); </code></pre>
javascript
[3]
3,665,912
3,665,913
how to make a list of lists in to dictionary of tuples
<p>I had <strong>list of lists</strong> for example</p> <pre><code>res = [[None,'A','B'],[19980228, 'd1', 't1'],[19980302, 'd2', 't2'],[19980303, 'd3', 't3']] </code></pre> <p>Now i need to frame the above result as <strong>dictionary of list of tuples</strong> like</p> <pre><code>{'A': [(19980228, 'd1'), (19980302,...
python
[7]
322,090
322,091
PHP key value pairs vs. arrays
<p>I'm trying to pass key values pairs within PHP:</p> <pre><code>// "initialize" private $variables; // append $this-&gt;variables[] = array ( $key = $value) // parse foreach ( $variables as $key =&gt; $value ) { //.. } </code></pre> <p>But it seems that new arrays are added instead of appending the key/value, no...
php
[2]
1,293,404
1,293,405
Problem using ContactsContract.Data when query
<p>I am learning android developing. Well, my appwidget failed at this line:</p> <pre><code>Cursor cursor = context.getContentResolver().query(Contacts.CONTENT_URI, new String[] {Contacts.DISPLAY_NAME}, Contacts.STARRED + "=0", null, null); </code></pre> <p>May I know why? Thanks.</p> ...
android
[4]
2,363,485
2,363,486
Click event for dynamically created link buttons not firing?
<p>This is application i am doing in c# web application<br> I am creating link buttons dynamically as below.</p> <pre><code>for (int i = 0; i &lt; ds.Tables[0].Rows.Count; i++) { LinkButton ln = new LinkButton(); ln.Text = ds.Tables[0].Rows[i].ItemArray[0].ToStrin...
c#
[0]
4,765,419
4,765,420
How to create a php page which can accept file?
<p>i want to upload a file to my server from some application. How can i code my php page which will accept this file?</p>
php
[2]
1,059,497
1,059,498
Multiple rootviewcontrollers in the sam iphone app?
<p>is it possible to make use of 2 rootviewcontrollers in a app?if it is possible how to push and pop between rootviewcontroller's? is the function pushviewcontroller:secondrootviewcontroller valid?</p>
iphone
[8]
1,886,170
1,886,171
Turn off a Android Service when the user is not on the their home screen!
<p>I need to turn a App / Widget Service off when a user isn't on their homescreen and on / update when they are. Is that possible?</p>
android
[4]
5,137,739
5,137,740
How to make the code execute when the limit is actually reached
<p>I have this set of code that adds a <code>display:none</code> css class to a certain element on my page. Though this works, I need the code to apply the style to the element upon the 15<sup>th</sup> input value being shown. Right now it applies the style after the input has been created and the button is clicked aga...
javascript
[3]
348,506
348,507
Copying two array into one larger array?
<p>I have the following question:</p> <blockquote> <p>Write a program with a function named "merge" that copies the data integers of one array into a larger sized array, and then copies the data integers of the second array into the larger array just after the contents of the first array</p> </blockquote> <p>There ...
c++
[6]
5,131,749
5,131,750
In Javascript, why is [1, 2] == [1, 2] or ({a : 1}) == ({a : 1}) false?
<p>The following is done in Firebug:</p> <pre><code>&gt;&gt;&gt; [1, 2] == [1, 2] false &gt;&gt;&gt; ({a : 1}) == ({a : 1}) false </code></pre> <p>I thought Javscript has some rule that says, if an Object or Array has the same references to the same elements, then they are equal?</p> <p>But even if I say</p> <pre>...
javascript
[3]
3,812,005
3,812,006
generating list of small ascii strings
<p>I want to create a generator class, in java, to produce the next smallest unique ascii string, where the resultant string must begin with an a-Z, and each subsequent letter can be a-Z or 0-9.</p> <p>The strings are being used to minify variables in a javascript file.</p> <p>Any suggestions on a tool out there whic...
java
[1]
141,757
141,758
C# Textbox validation should only accept integer values, but allows letters as well
<pre><code>if (textBox1.Text != "") // this forces user to enter something { // next line is supposed to allow only 0-9 to be entered but should block all... // ...characters and should block a backspace and a decimal point from being entered.... // ...but it is also allowing characters to be typed in textBox1 ...
c#
[0]
3,226,110
3,226,111
text box - setting the precision
<p>i want to restrict the numbers to be entered on the text box to five precision</p> <p>eg: 1234.52342 -1234.52342</p> <p>how i can restrict while entering the numbers on the text box</p>
c#
[0]
5,228,153
5,228,154
Email separation
<p>How do I split a string with multiple separators in JavaScript? I'm trying to split on both commas and spaces but, AFAIK, js's split function only supports one separator.</p>
javascript
[3]
4,782,059
4,782,060
How can I hide tabs while scrolling down a ListView then show them again if the user scrolls up?
<p>I want to make the tabs of a tabhost fade up if the user is scrolling down a listview</p> <p>I have the following code but it does not work</p> <pre><code>ListView ls = (ListView) findViewById(R.id.list); ls.setOnScrollListener(new OnScrollListener() { public void onScrollStateChanged(AbsListVi...
android
[4]
4,939,933
4,939,934
C# waiting one second in running program
<pre><code>dataGridView1.Rows[x1].Cells[y1].Style.BackColor = System.Drawing.Color.Red; System.Threading.Thread.Sleep(1000); </code></pre> <p>İ will waiting about one seconds to printing my grids cells with this code.But it isn't waiting what can i do ?</p>
c#
[0]
47,702
47,703
Application in c2dm server
<p>Has any one implemented C2dm succefullly, then please send the code, how to get registration_id form c2dm server for our application.</p> <p>thanks in advance.</p>
android
[4]
350,781
350,782
How to get only time from time picker in android?
<p>I am creating a scheduler for my app in which i want to set time from time picker.Problem i am facing is that i am getting time with date.Here is the code please suggest how to do this .</p> <pre><code>TimePickerDialog.OnTimeSetListener t = new TimePickerDialog.OnTimeSetListener() { public void onTimeSet(TimePicker...
android
[4]
4,578,666
4,578,667
Java parsing String to Date returns wrong Date
<p>I got the common problem that I want to parse a String to a Date.</p> <p>The String looks like this <code>15.06.11 13:38:33 UTC</code>. But the result is <code>15.38.0011 13:38:33 UTC</code> when formatted with the same formatter used to parse the String to Date. TimeInMillis returns a negative value <code>-6181897...
java
[1]
3,852,924
3,852,925
Get <data android:scheme> attribute value from list of installed apps on android
<p>On android I get the list of all installed apps. After that I want to launch any app using implicit intent. I need to know the value of data android:scheme attribute. For eg In android.manifest if an app has </p> <pre><code>&lt;data android:scheme="abc" /&gt; </code></pre> <p>I need to extract the string "abc" fro...
android
[4]
1,753,793
1,753,794
jQuery automate multiple scripts for multiple divs
<p>in jQuery I always encounter alot of double work. I mean, I write the same thing for different divs.</p> <p>I have the following code:</p> <pre><code>var about = $('#about').offset().top - parseFloat($('#about').css('margin-top').replace(/auto/, 0)); var education = $('#education').offset().top - parseFloat($('#ed...
jquery
[5]
384,515
384,516
Image loads too slow with header()
<p>I am using a php file which also loads an image. I am using header("location url") to load the image.</p> <p>My problem is that the image is loading very slowly. If I load it normally, it is much faster.</p> <p>If I use JavaScript and put the code in the header to load the image, the image loads fast, but then I ...
php
[2]
534,701
534,702
Best practice architecture for Android app
<p>I'm pretty new to Android development, but have basic knowledge of Java (comming from Python). I'm working on a simple app that will list 10 WebViews side by side, but I'm having some trouble finding the proper way to build the layout and activities. </p> <p>I have - for example - an arraylist with the uri's I want...
android
[4]
1,539,710
1,539,711
Slide down only one instance when multiple ones have same class
<p>I need to have numerous elements with the SAME class, and content inside them that shows on click, but right now since all of them have the same class, all of them open at once. </p> <p>How can I make it so that only the clicked one opens up and not others?</p> <p>My HTML:</p> <pre><code>&lt;div class="product"&g...
jquery
[5]
4,306,785
4,306,786
java: what's the most efficient way to remove all blank space from a StringBuilder
<p>I implement it by the following code, but I don't know whether there's a more efficient way to remove all blank spaces from a StringBuilder</p> <pre><code>private static StringBuilder removeBlankSpace(StringBuilder sb){ for(int i=0;i&lt;sb.length();++i){ if(Character.isWhitespace(sb.charAt(i))){ ...
java
[1]
1,487,569
1,487,570
C++: How does string vectors' random access time work?
<p>I know a simple int vector have O(1) random access time, since it is easy to compute the position of the xth element, given all elements have the same size.</p> <p>Now whats up with a string vector?</p> <p>Since the string lengths vary, it can't have O(1) random access time, can it? If it can, what is the logic be...
c++
[6]
1,646,793
1,646,794
PHP concat a word to mysql query
<p>I have a query</p> <pre><code>"select * from test"; </code></pre> <p>I have to add UNION after test</p> <pre><code>"select * from test union" </code></pre> <p>It is not concat.</p> <p>How do I add union to the query?</p> <p><strong>update</strong></p> <pre><code>select * from x where id = "2" union select * f...
php
[2]
3,334,932
3,334,933
python library that is the inverse of urllib?
<p>urllib fetches data from urls right? is there a python library that can do the reverse of that and send data to urls instead (for example, to a site you are managing)? and if so, is that library compatible with apache?</p> <p>thanks.</p>
python
[7]
2,012,192
2,012,193
webpage title
<p>In My Website I have main urls such as </p> <p>h**p://www.sy-stu.com/stu/music.php</p> <p>The Title of the page is Syrian Students ... Music Center</p> <p>But when i get into the subpages such as</p> <p>h**p://www.sy-stu.com/stu/music.php?module=MusicServer&amp;page=browse&amp;ViewType=Albums&amp;Artistid=305</p...
php
[2]
2,330,358
2,330,359
Applying static methods to data stored in a subclass
<p>I'm working on a class to access information about a class library stored in a Jar file and run actions customized for each class library. It contains methods to load localized strings, etc. from the Jar file.</p> <pre><code>public class CodeBundle { public static String str(String id) { ... } ...
java
[1]
3,421,472
3,421,473
Java equivalent of C++ output stream overloading
<p>I'm moving into Java from a C++ background and I'm currently getting to grips with the notion of not overloading operators, as is the Java way. I'm currently trying to figure out how to handle a situation where, if I were writing in C++, I would overload <code>operator&lt;&lt;</code> for my class and call it a day.<...
java
[1]
388,917
388,918
Android Device phone call ability
<p>How can I tell whether a given device has the ability to make phone calls?</p> <p>For example, my Galaxy Tablet cannot, its not a phone. I want to detect that before doing a call to isIntentAvailable(context, Intent.ACTION_DIAL) I've tried checking the isIntentAvailable for this, but that doesn't seem to be the w...
android
[4]
1,888,367
1,888,368
How to retrieve the specific value from Dictionary(key,value) in c#
<p>This is my method:</p> <pre><code>/// &lt;summary&gt; /// Uses Dictionary(Key,Value) where key is the property and value is the field name. /// Matches the dictionary of mandatory fields with object properties /// and checks whether the current object has values in it or /// not. /// &lt;/summary&gt; /// &lt;param ...
c#
[0]
3,453,369
3,453,370
How to attach other supporting setup file into my application during making setup file?
<p>i want to attach .net frame work setup file into my setup file and more other so that my application will run in other PC? what is the solution for this ?</p>
c#
[0]
3,471,827
3,471,828
How to execute specified task at the specified time
<p>I am new to C# but java has method to execute specified task at the specified time so using c# how it doing</p> <pre><code>Timer t=new Timer(); TimerTask task1 =new TimerTask() t.schedule(task1, 3000); </code></pre>
c#
[0]
2,351,926
2,351,927
How to get the number of args of a built-in function in Python?
<p>I need to programmatically get the number of arguments that a function requires. With functions declared in modules this is trivial:</p> <pre><code>myfunc.func_code.co_argcount </code></pre> <p>But built-in functions don't have the <code>func_code</code> attribute. Is there another way to do this? Otherwise I can'...
python
[7]
3,928,647
3,928,648
Why .first() won't work here?
<p>In the following code, I'm trying to get the value of the first div under "latest", but I keep getting "undefined". I'm expecting the value 5705. This should have worked, right? How do I set this right?</p> <pre><code>var auto_refresh = setInterval(function() { console.log($('.latest').first().attr('lastValue')...
jquery
[5]
977,478
977,479
Change property of a Jquery object?
<p>I'm using a Facebook-like autocomplete jquery library found at:</p> <p><a href="http://otisbean.com/dropbox/jquery.tokeninput.js" rel="nofollow">http://otisbean.com/dropbox/jquery.tokeninput.js</a></p> <p>In my own html code, I have the following which works fine</p> <pre><code>&lt;script type="text/javascript" l...
jquery
[5]
2,293,333
2,293,334
Error while loading shared libraries
<p>I am a C++ beginner. I have a c++ project that i built using the existing make files. I have a library that I linked from /usr/local/lib. Build is successful but when I run it, its complaining about the library that I linked form /usr/local/lib. If I copy that library to /lib64 and run my program, everything is fine...
c++
[6]
878,266
878,267
Getting iPhone location data into an array
<p>I'm wanting to get an iPhones location data, primarily the city and state, returned in an array. Suggestions?</p>
iphone
[8]
5,623,338
5,623,339
When will Android have a public Calendar API?
<p>Is someone from Google able to advise when the Android SDK is likely to include a public API for reading/writing event data to the user's calendar?</p> <p>Searching the forums I see that this is a much desired feature by many developers but I haven't seen any indication as to when (or even if) this need will be add...
android
[4]