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
3,620,218
3,620,219
jQuery: keeping references to jQuery object during application runtime
<p>I've got a question about treating references to jQuery objects.</p> <p>Let suppose in my app I have a DOM element DIV with ID=some_widget, it is supposed to live during all the application runtime and be used quite often in the code.</p> <p>1) So if I keep a reference to it in a global var during application runt...
jquery
[5]
4,234,730
4,234,731
How do I specify the string method count?
<p>I am trying to implement a function that takes a string as a parameter, and whether or not the string contains the letter 'ion' at the end determines the output. </p> <p>For example, if I input the string 'accordionist', I should then get the output of 'accordionist' because although it contains 'ion', it is not at...
python
[7]
3,995,273
3,995,274
Instantiating class from string wont really work in php
<p>Ive just started learning namespaces. If I do this:</p> <pre><code>$a = new Devices\Desktop(); </code></pre> <p>this works. But I have dynamic class names, so I have to do it from a variable.</p> <pre><code>$a = 'Devices\Desktop'; $a = new $a(); </code></pre> <p>this is not working, although its the same. The cl...
php
[2]
4,487,762
4,487,763
How to cancel an alarm in android?
<p>I am trying to cancel all alarms other an intent</p> <p>i am sending stuff in using <code>new gofile(this).setSilent(mRowId, mCalendar);</code></p> <p>that then goes to gofile</p> <pre><code> public class gofile { private Context goon private AlarmManager alarm; public gofile(Context goon){ mContext = co...
android
[4]
1,934,860
1,934,861
PHP list directories and remove .. and
<p>I created a script that list the directories in the current directory</p> <pre><code>&lt;?php $dir = getcwd(); if($handle = opendir($dir)){ while($file = readdir($handle)){ if(is_dir($file)){ echo "&lt;a href=\"$file\"&gt;$file&lt;/a&gt;&lt;br /&gt;"; } } ?&gt...
php
[2]
1,964,343
1,964,344
How can I obtain an array from the string "[1, 12, 2, 3, 4]"?
<p>In my JSP, a hidden variable value shows as following.</p> <pre><code>&lt;input type="hidden" name="" value="[1, 12, 2, 3, 4]" id="rollNumber"/&gt; </code></pre> <p>When I try to get hidden variable in javascript function by <code>document.getElementById</code> and put it in a array (<code>rollNo</code>) as follo...
javascript
[3]
5,319,707
5,319,708
to print local xml file through NSData?
<p>i want to take some xml data from local path,and to parse,but when i use following code NSLog returns(content) different texts which is differed from xml file, how can i get exact xml data to check ,it consists correct xml data or not? any help please? when i parse , it returns nothing..i have saved the file as .xml...
iphone
[8]
818,403
818,404
How should I instantiate this date in javascript?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4503504/format-date-in-javascript">Format Date in Javascript</a> </p> </blockquote> <p>I have this date:</p> <pre><code>var newDate = "/Date(1333609200000)/"; </code></pre> <p>And what I need to do to it is:</...
javascript
[3]
5,632,286
5,632,287
NSUserDefaults SBFormattedPhoneNumber doesn't work on iPhone OS4
<p>Does anybody know how to programmatically get my own phone number on iPhone OS4? My app currently does it and works fine (iPhone OS 3.x). But now, after upgrading my OS to 4 it stopped working.</p> <p>Tks.</p>
iphone
[8]
4,706,143
4,706,144
Image.width on IE browsers
<p>I have the following javascript (resizes images in blogspot blogs):</p> <pre><code> var imageTags = document.getElementsByTagName('img'); for(i = 0 ; i &lt; imageTags.length; i++){ if( imageTags[i].src.indexOf('/s400/', 0)&gt;-1 ) { if(imageTags[i].style.width=='400px' || imageTags[i].width==400) { ...
javascript
[3]
1,697,894
1,697,895
Run function 2 when function 1 completes
<p>I know similar questions have been asked and answered before but the truth is I just cant figure out what I need to do even after reading them.</p> <p>The code below is from a tutorial. It displays some text with a typewriter effect. That all works fine.</p> <p>I've added an <code>_</code> that moves along in fro...
jquery
[5]
131,525
131,526
What is the meaning of requestCode in startActivityForResult
<p>I'm wondering if I am understanding the concepts of requestCode correectly. <strong>What is this integer for and does it matter what integer I set it to in</strong>:</p> <pre><code>private static int CAMERA_REQUEST = ???; </code></pre> <p>Thank you</p>
android
[4]
4,078,999
4,079,000
Changing class attributes when radio button checked
<p>I have this code snippet</p> <pre><code>&lt;td width="143"&gt;&lt;b&gt;Monday&lt;/b&gt;&lt;/td&gt; &lt;td width="68" class="open select_open"&gt; &lt;span class="jqTransformRadioWrapper"&gt; &lt;a href="#" class="jqTransformRadio" rel="radio_m"&gt;&lt;/a&gt; &lt;input type="radio" name="radio_m" checked="...
jquery
[5]
1,398,015
1,398,016
How to convert only letters to uppercase from string php?
<p>I want to convert from :</p> <p><code>a12b89</code> to <code>A12B89</code>.</p> <p>I tried with strtoupper but it's not working. Is that function only if I have letters without numbers? Thanks.</p>
php
[2]
1,504,153
1,504,154
How to stop an editext being editable
<p>I have an editext which populates on the click of a button. </p> <p>The problem is when I load android the cursor is allowing this editext to be editable. </p> <p>I need the edittext not be editable and only update onclick. Is this possible?</p> <p>Thanks</p>
android
[4]
2,298,786
2,298,787
How to get the size of string array dynamically?
<p>How can I get the size of a string array dynamically? For example:</p> <pre><code>string names[5] = {"John","Smith","Noob"}; </code></pre> <p>And somehow I should get the size which is 2</p> <p>How can I do that? without using vectors or loop?</p>
c++
[6]
930,463
930,464
python object atributes and methods
<p>In python all data is object and any object should have attributes and methods. Does somebody know python object without any attributes and methods?</p> <pre><code>&gt;&gt;&gt; len(dir(1)) 64 </code></pre>
python
[7]
1,642,821
1,642,822
Having transition/ animated effect when making menu visible in action bar
<p>Currently, I have a menu in action bar, which I will make it visible during run-time.</p> <pre><code>public void setShareMenuVisible(final boolean visible) { this.runOnUiThread(new Runnable() { @Override public void run() { if (shareMenu != null) { shareMenu.setVisibl...
android
[4]
578,253
578,254
IntPtr to String and long?
<p>i use c#.net 2.</p> <p>I have this method here to get a string out of a IntPtr:</p> <pre><code> void* cfstring = __CFStringMakeConstantString(StringToCString(name)); IntPtr result = AMDeviceCopyValue_Int(device, unknown, cfstring); if (result != IntPtr.Zero) { byte length = Mars...
c#
[0]
2,142,811
2,142,812
php arrayObj insensitive to undegined index
<p>How to make <code>ArrayObj</code> in insensitive to undefined index, I sometimes need use undefined index example in logging</p> <pre><code>$this-&gt;log['some']['other']['info']++ </code></pre> <p>Here is my try:</p> <pre><code>class arrayInSensitive extends \arrayObject{ var $data = array(); public fu...
php
[2]
5,764,657
5,764,658
I need two functions to get CPU Load and Memory load In PHP
<p>HI I need a function to cpu load ( percentage ) and another function to get Memory load In PHP</p>
php
[2]
336,257
336,258
Javascript: sharing data between tabs
<p><strong>What is the best way to share data between open tabs in a browser?</strong></p> <p>As an example, Facebook panel: when you open a chat window in a tab, it's opened in other open tabs too.</p>
javascript
[3]
3,304,187
3,304,188
How to read image's compress data (pixel data) from container file on Android? Are there tutorials for these?
<ol> <li>File file = new File(fileName);</li> <li>Iterator iter = ImageIO.getImageReadersByFormatName("Reader"); </li> <li>ImageReader reader = (ImageReader) iter.next();</li> <li>ImageReadParam param= reader.getDefaultReadParam();</li> <li>ImageInputStream iis = ImageIO.createImageInputStream(myFile);</li> <li>reader....
android
[4]
5,900,177
5,900,178
Using The UIImagePickerController to select and upload a photo to server.
<p>I am using the <code>Picker</code> controller with <code>UIImagePickerControllerSourceTypePhotoLibrary</code>.</p> <p>In the delegate <code>didFinishPickingImage</code> is called, but when I click on the cancel button it doesn't enter:</p> <pre><code>(void)imagePickerControllerDidCancel:(UIImagePickerController *)...
iphone
[8]
1,223,746
1,223,747
How to get starting and stoping time of an application?
<p>I am new to android.</p> <p>I am implementing one application.</p> <p>Related to my app </p> <p>I want to get starting and stoping time of each application.</p> <p>If any one know the solution please help me,</p> <p>Thanks in advance.</p>
android
[4]
749,579
749,580
Defining a top-level no-op in C++?
<p>Is the following legal according to the C++ standard? (If the answer differs from standard to standard, I would like to know that, too.)</p> <pre><code>#define VERY_OLD_COMPILER 1 #ifdef VERY_OLD_COMPILER #define USING_NAMESPACE_STD enum { } #else #define USING_NAMESPACE_STD using namespace std #endif USING_NAME...
c++
[6]
2,633,232
2,633,233
WeakReference with ImageView?
<p>I'm not too familiar with WeakReference, wanted to see if my use of them is correct. Here's the skeleton of an image fetcher:</p> <pre><code>class Request { String url; WeakReference&lt;ImageView&gt; view; public Request(String url, ImageView iv) { this.url = url; this.view = new WeakRe...
android
[4]
702,200
702,201
How to exclude the my app screenshots showing recent apps
<p>As per security concern screenshots of my app screen should not be shown in recent apps. I have tried adding <code>android:excludeFromRecents="true"</code> in all activities on the manifest file. However, screenshots are shown in recent apps, can some help me to solve this issue?</p>
android
[4]
676,019
676,020
Can I let my hosting server download files for me?
<p>I'm using Bluehost web hosting service. I was thinking, can I make it into a personal cloud drive? Or better, can I let it download files for me so I don't need to wait in front of my computer to download it? Because sometimes when the connection is bad and the downloading speed is low from my apartment, it might be...
php
[2]
3,805,938
3,805,939
Is there any math utility method to calculate the following expression?
<p>Is there any math utility method to calculate the following expression? Basically, I need to find the largest integer less than or equal to x which can be divided by N evenly.</p> <pre><code> x - x % N; // N is an integer. </code></pre>
java
[1]
4,309,488
4,309,489
[python]how to get the size of a string before writing to a file
<p>for example:</p> <p>I get a string: str="please anwser my question", i want to write it to a file.</p> <p>but I need to know the size of the file before writing the string to the file. what function can i use to calculate the size of the string.</p>
python
[7]
5,470,124
5,470,125
How can I store a list of number inside a number in Python?
<p>I need to save a tuple of 4 numbers inside a column that only accepts numbers (int or floats)</p> <p>I have a list of 4 number like -0.0123445552, -29394.2393339, 0.299393333, 0.00002345556.</p> <p>How can I "store" all these numbers inside a number and be able to retrieve the original tuple in Python?</p> <p>Tha...
python
[7]
4,433,862
4,433,863
I have got this warning: non-varargs call of varargs method with inexact argument type for last parameter;
<p>this is my sample code where i am getting the warning.</p> <pre><code> try { Class aClass = Class.forName(impl); Method method = aClass.getMethod("getInstance", null); item = (PreferenceItem) method.invoke(null, null); } </code></pre> <p>warning: non-varargs call...
java
[1]
375,068
375,069
testing ocr for iphone but not working
<p>i am using ocr code but i am not getting any value while scanning value of cc and text are void means i cant see any output what i am doing wrong here??</p> <pre><code>- (NSString *) ocrImage: (UIImage *) uiImage { //code from http://robertcarlsen.net/2009/12/06/ocr-on-iphone-demo-1043 CGSize imageSize = [uiIm...
iphone
[8]
1,306,540
1,306,541
multiple Evals in one page
<p>I have a repeater in C#, which generates unique li tags with IDs and have some other elements.</p> <pre><code>&lt;li id="&lt;%# Eval("myID") %&gt;"&gt; &lt;a id="&lt;%# Eval("myID") %&gt;"&gt;&lt;/a&gt; &lt;/li&gt; </code></pre> <p>I get a markup error in VS, that 'Another object already exists with ID &lt;%# Ev...
c#
[0]
3,093,330
3,093,331
How to create a documentation of webpage?
<p>I have created 3 webpages.How to create a document of the page.What are the points that are important while making the document. Supoose page1,there are 7 function in my page1. Shall I write description of each function and it variable.Suppose there are if and else condition.How to write then?How to write table used...
asp.net
[9]
4,222,639
4,222,640
where to specify file name and path when logging exceptions in java?
<p>I'm new to java and trying to learn how to log an exception by example. I found the following example code here:</p> <p><a href="http://www.kodejava.org/examples/447.html" rel="nofollow">http://www.kodejava.org/examples/447.html</a></p> <p>However, I don't see where the filename for the log file is specified. When...
java
[1]
5,552,877
5,552,878
How do I deal with a forced close message on Android?
<p>I am having trouble debugging my app that causes a pop-up "Forced close" message every time I try to use my android app. How can I go around it ?</p>
android
[4]
1,857,099
1,857,100
accessing package info from Activity constructor
<p>I have a blank <strong>final</strong> field in my <strong>Activity</strong>.<br> The value is not known at compile time and must be initialized from within the constructor.</p> <p>To initialize the field, I access <strong>getPackageName()</strong> from within the constructor. Unfortunatelely this results in a <stro...
android
[4]
2,666,398
2,666,399
How to change the font size of text in UITextView dynamically in iPhone
<p>I have a fixed size UITextView say width and height of 150,150.</p> <p>The purpose is to display the thought of the day. Please note the size need to remain constant and I cant change it.</p> <p>Now The length of the thought string varies with respect to thought. What I want to do is change the size of font of the...
iphone
[8]
3,580,802
3,580,803
Android hierarchical preferences
<p>I'm writing a web service client and have the three obvious settings: url, username and password. For this the key value pairs in <a href="http://developer.android.com/reference/android/content/SharedPreferences.html" rel="nofollow">SharedPreferences</a> would be enough. But I hit a roadblock when I wanted to subscr...
android
[4]
5,553,796
5,553,797
Using Parcel to clone an object?
<p>I have a class which has implemented Parcelable. Can I do something like the following to create a new instance of a class?:</p> <pre><code>Foo foo = new Foo("a", "b", "c"); Parcel parcel = Parcel.obtain(); foo.writeToParcel(parcel, 0); Foo foo2 = Foo.CREATOR.createFromParcel(parcel); </code></pre> <p>I'd like fo...
android
[4]
3,224,254
3,224,255
Dictionary for the language of javascript
<p>Is there a dictionary for the language of javascript?</p> <p>Eg if I want to lookup what "catch" is/means/does in javascript.</p> <p>And also to get a good overview of ALL the "words" of the language to see what "words" you have missed.</p>
javascript
[3]
4,959,091
4,959,092
How can i set a different image for each cell of my tableview
<p>How to set a different image for each cell of my table view. i want to do it through array of image names </p>
iphone
[8]
1,520,105
1,520,106
How to add a method to a class on the fly? (not reflection related)
<p>Is it possible to achieve something like this in Java? My idea was to add a method to a class using annonymous classes but this doesn't seem to work.</p> <pre><code>public class Abc { private ErrorsTable expectedErrorsTable = new ErrorsTable() { public ErrorsTable addError(String error) { th...
java
[1]
5,896,197
5,896,198
Android App using wifimanager in OnTouch event
<p>I have one class defined as</p> <pre><code>public class LearningMap extends Activity implements OnTouchListener </code></pre> <p>It is defined inside the <code>onTouch</code> method.</p> <p>I am tring to use wifimanager by calling:</p> <pre><code>myWifiManager.startScan(); </code></pre> <p>I defined </p> <pre>...
android
[4]
1,608,284
1,608,285
php.ini display_errors not respected OS X Server
<p>I am running an 10.6.8 OS X Server. It acts as a web server using the built in PHP and Apache. </p> <p>PHP is at 5.3.4 Apache is at 2.2.17</p> <p>I am trying to disable the reporting or errors to end users with a server wide setting.</p> <p>I have tried the following:</p> <p>in PHP.ini</p> <pre><code>error_rep...
php
[2]
5,813,190
5,813,191
php session_destroy browser remembering username and password
<p>I am using the php authentication method for digest authentication as shown on the <a href="http://php.net/manual/en/features.http-auth.php" rel="nofollow">php manual</a>. All is working well except for the logout part.</p> <p>I am using <code>session_destroy()</code> to try and log my users out, which it does. How...
php
[2]
6,002,910
6,002,911
Insufficient storage error
<p>I am getting an insufficient storage error in android. I have about 100MB of data in my res/raw folder.Is this the reason. PLease anyone give me a solution. I created another AVD 2 but its not working the error is still coming PLease help me Thanks in advance.</p>
android
[4]
590,336
590,337
Problem with KeyPress Javascript function
<p>I call a javascript function from a textbox by using OnKeyPress="clickSearchButton()"</p> <p>Here is my function:</p> <pre><code>function clickSearchButton() { var code = e.keyCode || e.which; var btnSearch = document.getElementById("TopSubBanner1_SearchSite1_btnSearchSite"); if(code == 13); { ...
javascript
[3]
1,772,069
1,772,070
const ints as Message IDs = Recompile Everything
<p>I'm hoping for confirmation of what I just told someone. We have a large software project that is divided out into several libraries (.so). The message definitions are all in one library with a set of .h files for the declarations. The message ids are in the .h as const int (see below). One uses the id to subscribe/...
c++
[6]
1,602,441
1,602,442
PHP if statement does not work
<p>I have written a code where a value is got from mysql and if it is 1 then row should be in red colour and if it is 0 the row should be in green colour. When I execute the code it always goes to the else statement.</p> <p>Code is as below:</p> <pre><code>while ($row = mysqli_fetch_array($result)) { $bprofit=$ro...
php
[2]
5,160,934
5,160,935
How to (correctly) report timezone using String.format %tz?
<p>If I execute:</p> <pre><code>System.out.println("Formatter: " + String.format("%1$tH:%1$tM:%1$tS %1$tz %1$tZ", now)); System.out.println("SimpleDF : " + new SimpleDateFormat("HH:mm:ss Z z").format(now)); </code></pre> <p>I expect the result to be the same. If I check the automatically adjust for daylight savings t...
java
[1]
399,985
399,986
Is there anythig incorrect when using placement new on global vars?
<p>I was playing with an idea where i can have variables in global scope but <a href="http://stackoverflow.com/questions/9344346/how-do-i-cancel-not-call-the-constructor-in-a-global-variable/9344459#comment11795868_9344459">not construct them</a>. Note that there IS a placement new being ran. However i'd like to know w...
c++
[6]
5,042,698
5,042,699
How to change default focus of cancel button on download popup of IE
<p>I doing Export to Excel and PDF functionality in my application. I want to change default focus of cancel button on popup to the <code>Save</code> button. </p> <p><img src="http://i.stack.imgur.com/fLIZE.png" alt="enter image description here"></p> <p>If anyone have idea about this please let me know.</p> <p>Than...
asp.net
[9]
3,322,997
3,322,998
Capturing image from Camera, it stores at sdcard/dcim folder
<p>I am capturing image by using camera in my app.</p> <p>1) it saves image at sdcard, with the name which i passed in intent.</p> <p>2) also saving the image at sdcard/dcim folder</p> <p>I do not want camera to save image at location mentioned in # 2. i am deleting image from the location in #1. and want to delete ...
android
[4]
2,923,064
2,923,065
static_cast in default argument value
<p>I would like to have a constructor with default argument static_cast like: </p> <pre><code>generate_word_spot(func_double_double_t&amp; cost_f = static_cast&lt;func_double_double_t&amp;&gt;(func_const_t(1))) : cost_f_(cost_f) {}; </code></pre> <p>where </p> <pre><code>class func_const_t : public func_...
c++
[6]
5,951,897
5,951,898
How to put variable in regular expression match?
<p>I have</p> <pre><code>var string1 = 'asdgghjajakhakhdsadsafdgawerwweadf'; var string2 = 'a'; string1.match("\/"+string2+"\/g").length; </code></pre> <p>So with this i want to find the appereance of <strong>a</strong>, but itn is not wirking, how i can put the variable wright ?</p>
javascript
[3]
989,297
989,298
Javascript error, not recognizing function... why?
<p>This is my code (in a firefox addon) </p> <pre><code>this.something_something = function (the_actual_url) { this.this_version = null; try { // Firefox 4 and later; Mozilla 2 and later Components.utils.import("resource://gre/modules/AddonManager.jsm"); AddonManager.getAddonByID("para...
javascript
[3]
4,467,355
4,467,356
JQuery Basic Usage
<p>How can I take data between some id's?</p> <p>Example:</p> <pre><code>$("selector").click(function() { $.each() // how can use function }) </code></pre> <p>we think there are already have a .json remote file</p> <pre><code>id:1,data:"hi" id:2,data :"how" id:3,data : "witch" </code></pre> <p>My Requirements...
jquery
[5]
3,260,950
3,260,951
PHP: Fetching lines from a text file
<p><strong>Edit:</strong> I've learned much since the posting of this question, and so I have rewritten it for anyone who similarly inquires.</p> <p>I'm attempting to load a specified number of lines from the end of a text file via a HTTP GET request, which will be sent to a PHP file. Can this be done with <code>file_...
php
[2]
4,440,617
4,440,618
PHP preg_match_all fails on long strings
<p>Here's my code:</p> <pre><code>$long = str_repeat('a very long string text', 100); // try changing 100 to 5000 $str = &lt;&lt;&lt;STR &lt;abc&gt;a short string text&lt;/abc&gt; &lt;abc&gt;$long&lt;/abc&gt; STR; preg_match_all('@&lt;abc&gt;([^&lt;&gt;]+)&lt;/abc&gt;@sU', $str, $matched); print_r($matched); </code...
php
[2]
2,086,143
2,086,144
Reading Bulk data from CSV and writring into another csv
<p>I had one csv file of 1 cr lines of data.From this file i have to read data from csv and using first field i need do check conditions with in my db and from that Db took one key and append all prevoius data and write to another csv .which ever i read from CSV i written code for this but it takes days of time to read...
java
[1]
330,415
330,416
table schema to datatable c#
<p>How do I read a schema into datatable in c#</p> <pre><code>&lt;header&gt; &lt;xs:schema id="header" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt; &lt;xs:element name="header" msdata:IsDataSet="true" msdata:MainDataTable="Table" msdata:UseCurrentLo...
c#
[0]
2,419,962
2,419,963
How to read the ms word file as html in phpge
<p>anybody can help me to solve this problem</p> <p>I am trying to read the ms word document(doc) as HTML and that should be display in my page as HTML.</p> <p>or</p> <p>is there any php library to view the doc file?</p>
php
[2]
1,943,387
1,943,388
extension method phone format with country code as parameter
<p>I'm writing an extension method called ToPhoneFormat that formats a string of digits to phone numbers.</p> <p>Is it possible to add a parameter to the method that would enable me to call it like this: MyPhoneString.ToPhoneFormat(international code)</p> <p>That way, I could write MyPhoneString.ToPhoneFormat(1); to ...
c#
[0]
1,069,599
1,069,600
Where can I download android sdk manually?
<p>I met some problem (I have to use socks proxy but only http proxy is used by the sdk manager) when downloading the sdk through "Android sdk manager". So i am wondering if it is possible to download the sdk manually from somewhere and then put them back in the sdk directory.</p>
android
[4]
4,661,978
4,661,979
How to read particular text from file in C#
<p>HI, I am in learning process of C# and trying to read file in my application.But i dont want to read complete file i simply want to read particular text from that file and want to display that text in textbox.... can any please help me in that i want to know the method i can use for reading particular text from file...
c#
[0]
2,453,810
2,453,811
Is using size() for the 2nd expression in a for construct always bad?
<p>In the following example should I expect that <code>values.size()</code> will be called every time around the loop? In which case it might make sense to introduce a temporary <code>vectorSize</code> variable. Or should a modern compiler be able to optimize the calls away by recognising that the vector size cannot ch...
c++
[6]
1,031,403
1,031,404
c++ Number of zeros in a factorial number
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1174505/counting-trailing-zeros-of-numbers-resulted-from-factorial">Counting trailing zeros of numbers resulted from factorial</a> </p> </blockquote> <p>It is given an integer "p". I have to find a number "n" fo...
c++
[6]
4,561,750
4,561,751
how to place one activity on another activity
<p>friend's, i have an task to set horizontal swipe tabs below the header,how can i set an activity on another activity.</p>
android
[4]
3,317,209
3,317,210
Best way to populate a <SELECT> box with TimeZones
<p>I need to display a timezone selector as a user control, which always seems easier than it really is. Internally, I store everything with a DateTimeZone Identifier, as that seems to be the smartest way to have the level of accuracy I need, as this project bridges real-world times as it is tied to terrestrial media....
php
[2]
3,127,874
3,127,875
how to save images to local drive & display images from local drive's folder in image controls
<p>I want to save &amp; display uploaded image and use file upload control images get uploaded &amp; save it successfully in my local d drive. But the problem is to display saved image in image control? please help me.</p> <pre><code>protected void btnSubmit_Click(object sender, EventArgs e) { string filename = ...
asp.net
[9]
4,105,287
4,105,288
making index with python
<p>the following is my question:</p> <pre><code>data = ['a1_1 00000001\n', 'a1_2 00000002\n', 'a1_3 00000003\n', 'b1_1 00000004\n', 'b1_2 00000005\n', 'b1_3 00000006'] candidate = ['a', 'b'] for i in candidate: for j in data: if i in j.split()[0]: print i, j.split()[1] a 00000001 a 0...
python
[7]
3,117,153
3,117,154
Screen capture in android
<p>I have successfully captured the screen with following code.</p> <pre><code>View v1 = relativeView.getRootView(); v1.setDrawingCacheEnabled(true); Bitmap bm = v1.getDrawingCache(); </code></pre> <p>But with this code whole screen is capturing. I want to capture only the components of a particular layout or area. I...
android
[4]
2,267,833
2,267,834
getting location from a background service, is this correct?
<p>I have a background service that is getting updates from the location manager every 5 minutes. When on locationChaged is called, I call a function in my activity to update the GeoPoint that holds my user location. This is working fine and does what I want. I am just unsure if it is better to use something like broad...
android
[4]
1,861,854
1,861,855
How to make a function repeat itself
<p>I have a python problem, I'm reading from XML and have two spread functions set up; one finds a location, than the other function finds a location inside the first one, and returns info. my problem is that i need this to continue down the page and find other occurrences of each. I'm not sure if thats a good explanat...
python
[7]
4,359,623
4,359,624
Null pointer expection
<pre><code>String graphNameUsed = graphName.getName(); if (graphType.equals("All") || graphType.equals("ALL")) graphNameUsed += "_ALL"; </code></pre> <p>If my String is null, then will it throw Null Pointer expection when i am checking whether it equals or not. To Avoid this expection, how should i...
java
[1]
4,900,577
4,900,578
jQuery selector for dynamically generated element
<p>I have the following html snippet:</p> <pre><code>&lt;div id="contentX"&gt;&lt;h1&gt;MyHeading1&lt;/h1&gt;&lt;/div&gt; </code></pre> <p>I could select with jQuery snippet syccessfully with the following:</p> <pre><code>console.log($('#contentX h1')); </code></pre> <p>The output is</p> <pre><code>[&lt;h1&gt;​MyH...
jquery
[5]
4,686,549
4,686,550
How to translate a button from its relative position to the bottom of the screen?
<p>I would like to translate a button from its relative position to the bottom of the screen.</p> <p>I am doing the TranslateAnimation using Java code.</p> <p>The following is the code snippet of what I've already did:</p> <pre><code>Display display = getWindowManager().getDefaultDisplay(); int screenHeight = displa...
android
[4]
1,639,201
1,639,202
Error when using mysqli_select_db and mysqli_connect
<p>Because mysql_* functions arn't gong to be supported anymore, i'm switching to mysqli_*. But, when I try to connect to my database, I get an error. Here is my code.</p> <pre><code>&lt;?php //ob //ob_start(); //session session_start(); //connect to database $error = "Could not connect to database"; mysqli_connect...
php
[2]
3,883,361
3,883,362
Is passing const reference to a temporary string object safe in C++?
<p>Consider function f</p> <pre><code>void f(const std::string&amp; s) { ... } </code></pre> <p>Is it safe to call f with a fixed string like the following:</p> <pre><code>f("abc"); </code></pre>
c++
[6]
5,896,526
5,896,527
android problem:Read file problem res/raw/img/img123.jpg
<p>I'm beginner of android. And I get a problem. Can I get the file under the folder I create in res/raw?</p> <p>For example: res/raw/img/img123.jpg </p> <p>Can I get the id or use the file img123.jpg?</p> <p>if yes,how can i do that?</p>
android
[4]
4,400,499
4,400,500
WebView Failed error in iPhone
<p>I am trying to load website in webview.But i am getting error. Please correct me where i am wrong </p> <p>URL : <a href="http://www.facebook.com/pages/Fresh-Caesar/144860502248864" rel="nofollow">http://www.facebook.com/pages/Fresh-Caesar/144860502248864</a> Error : The operation couldn’t be completed. (WebKitE...
iphone
[8]
3,159,437
3,159,438
unicode format error
<p>So, I just started mining twitter data using its python twitter api. And was about to plot the tweet stucture But I am getting this error</p> <pre><code> f.write('strict digraph {\n%s\n}' % (';\n'.join(dot),)) UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 108: ordinal n...
python
[7]
5,108,675
5,108,676
Adding two unsigned char variables and result is int
<p>There is code:</p> <pre><code>#include &lt;iostream&gt; int main(){ unsigned char a = 4, b = 255; int g = (unsigned char)a + (unsigned char)b; std::cout &lt;&lt; g &lt;&lt; std::endl; return 0; } </code></pre> <p>Result:</p> <pre><code>259 </code></pre> <p>Why the result is 259, not 3? If there are added...
c++
[6]
3,546,371
3,546,372
JavaScript aC undefined variable error
<p><a href="http://pastebin.com/YysAqpQ5" rel="nofollow">http://pastebin.com/YysAqpQ5</a></p> <p>I have this script and It's getting an aC variable undefined when it calls the aC.checkStreamUpdates function on line 447. In reference to the aC.newestUpdate variable I believe. I've added an alert just for testing purpos...
javascript
[3]
2,669,540
2,669,541
How to write OnClick="return Foo()" in jquery
<p>How do I write OnClick="return Foo()" in jquery to prevent the button from submitting while the function is not yet finished. TY</p>
jquery
[5]
4,492,574
4,492,575
how can i access alarm content provider
<p>i'm trying to access alarm provider to get all enabled alarm information.</p> <p>so i wrote this : </p> <pre><code>public static final Uri CONTENT_URI = Uri.parse("content://com.android.deskclock/alarm"); ContentResolver cr = getContentResolver(); Cursor c = null; c = cr.query( CONTENT...
android
[4]
1,191,637
1,191,638
I want to list all countries in my dropdownlist, where can i get that web service?
<p>I want to list all the countries in my dropdown list. where can i get all the names? from service right? How to do this?</p>
asp.net
[9]
890,336
890,337
Possible collision/conflict between 2 javascripts?
<p>Here is example <a href="http://jsfiddle.net/rigaconnect/gLCjy/14/" rel="nofollow">http://jsfiddle.net/rigaconnect/gLCjy/14/</a></p> <p>One javascript ensures copy-paste value from above input field. User presses and holds ctrl, then click on field below.</p> <pre><code>$(document).ready(function(){ $("input").on(...
javascript
[3]
930,166
930,167
Posting a request from one servlet to another
<p>I am writing a small module where in i need to post an xml string as a parmeter from one servlet to another servlet . The receiving servlet parses the xml and then sends the appropriate response.</p> <pre><code> mimetype = request.getParameter("uploadFile"); mimetype = mimetype.substring(mimetype.indexOf("."...
java
[1]
2,328,536
2,328,537
How to use com.android.calendar.DayView?
<p>I need a calender control in my application to show some "appointments" in a day view. As far as I see it, there are two ways: Write my own control which would be not that funny and to use <code>com.android.calendar</code>.</p> <p>Can anyone tell me how I can use <a href="http://www.google.com/codesearch/p?hl=en#b2...
android
[4]
5,514,510
5,514,511
div container fading out does not work
<p>I want that the content goes to 50% when I hover over the menu bar. For whatever reasons I don't get it done. I get it doen on a testing page where I just have 2 divs. As soon as I have more divs it does not work. Why not??? The page I am referring to is <a href="http://www.guntmarwolff.com/eigenschaftenv.php" rel=...
jquery
[5]
2,722,650
2,722,651
csv file parsing and uploading is not working on server side
<p>I have written following code to parse the csv file. Its working locally but on remote server its not working.</p> <pre><code>function uploadTrainees() { $csv = array(); $tmpName = $_FILES['csv']['tmp_name']; //echo $tmpName; $fp = fopen($tmpName,'r'); $fields = array('delegate_title', 'delegate...
php
[2]
3,020,828
3,020,829
Why does this python code have a syntax error?
<p>To practice python, I made a simple class for a tree structure in which each node can have infinite child nodes.</p> <pre><code>class Tree(): def __init__(self, children, val): self.children = children self.val = val def add(self, child): self.children.append(child) def remove(self, index): ...
python
[7]
1,524,215
1,524,216
Compress data sent to Webservice
<p>I am sending a XMLDocument to my webservice (.asmx) and when i check the file size of that xmldocumetn by xmldocument.outerxml.tostring().length it is coming around 433434 ( i dont know what does it represents...is it in bytes) So i want to compress this data from client and send it to webservice without saving the ...
c#
[0]
4,967,890
4,967,891
jquery show function, fades out the popup in some time
<p>The jquery popup I created using the jquery show function, fades away in few seconds which is not intended. I want the popup to stay...</p> <p>How can i tell jquery to do so?</p> <p>heres is my code,</p> <pre><code>jQuery(document).ready(function(){ jQuery('#popuup_div.popup_msg').hide(); $(a.xyz).click(function(...
jquery
[5]
4,888,588
4,888,589
IOS development: Strange effect during flip horizonal modal
<p> I've encountered a strange situation that during the flip transition(UIModalTransitionStyleFlipHorizontal) between views the iphone desktop appeared as the background. I can even see app and icons on my iphone when the view is flipping into another. </p> <p>Is it due to the improper management of memory or not cor...
iphone
[8]
4,888,752
4,888,753
Circular Dependency with forward declaration error
<p>In A.hpp file I have a structure, which has a pointer of B class</p> <pre><code>struct state { B *b; }; </code></pre> <p>In A.hpp file, I added a forward declaration and I included B.hpp file in A.cpp file</p> <pre><code>//A.hpp class B </code></pre> <p>In B.hpp file, a function uses the state, which declar...
c++
[6]