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
610,109
610,110
JQuery Trim as Text Enters field
<p>Hi I have some code..</p> <pre><code>$(document).ready(function() { $("#inputPageName").keyup(function () { var value = $(this).val(); $("#inputPageHandle").val(value); }).keyup(); }); </code></pre> <p>Basically I need to create a page handle in a hidden field so when the user type in t...
jquery
[5]
1,360,830
1,360,831
Defining NSString
<p>How can I define a NSString with name <code>media:thumbnail</code>, It's giving me an error.</p> <pre><code>error:bit-field 'media' has invalid type </code></pre>
iphone
[8]
1,540,748
1,540,749
doesn't know a type (casting)
<p>I want to add a variable in a message header so I used <code>unit8_t</code> to define them but when I want to read this variable I need to cast it in double I did: </p> <pre><code>hello.positionx = unit8_t (m_ipv4-&gt;GetObject&lt;MobilityModel&gt; ()-&gt;GetPosition ().x); hello.positiony = unit8_t (m_ipv4-&g...
c++
[6]
4,040,040
4,040,041
Is it possible to sort two lists(which reference each other) in the exact same way?
<p>Okay, this may not be the smartest idea but I was a bit curious if this is possible. Say I have two lists:</p> <pre><code>list1 = [3,2,4,1, 1] list2 = [three, two, four, one, one2] </code></pre> <p>If I run <code>list1.sort()</code>, it'll sort it to <code>[1,1,2,3,4]</code> but is there a way to get to keep list...
python
[7]
2,212,201
2,212,202
pear DB: very strange behaviour
<p>Consider the following code</p> <pre><code> $dsn = array('phptype' =&gt; 'mysql', 'username' =&gt; Config::DB_STORE_USERNAME, 'password' =&gt; Config::DB_STORE_PASSWORD, 'hostspec' =&gt; Config::DB_STORE_HOSTNAME, 'database' =&gt; Config::DB_STORE_NAME); echo '222222'; $d...
php
[2]
5,598,053
5,598,054
Creating date with numbers (new Date(2012, 03, ...) gives wrong month (+1)
<p>When creating a <code>new Date</code> object using numbers for the parts, the value I get back is exactly <strong>one month</strong> ahead of the value I put in for 'month'. </p> <pre><code>new Date(2012, 05, 17, 00, 00, 00) Sun Jun 17 2012 00:00:00 GMT+0800 (HKT) // june?! </code></pre> <p>However, a normal par...
javascript
[3]
2,834,176
2,834,177
Java IB API/ TWS get mulitple quotes/price of the company
<p>Am using java ib api / traders workstaion, now am getting current price for company using ticketprice, is there anyway to get multiple quotes</p>
java
[1]
2,574,251
2,574,252
Pass an object as parameter in PHP
<p>In Java, I can pass an object straight in parameter </p> <pre><code>public int foo (Bar bar) { ... call the methods from Bar class } </code></pre> <p>So how can I do same thing with PHP. Thanks This is my code:</p> <pre><code>class Photo { private $id, $name, $description; public function Photo($id, $...
php
[2]
2,673,261
2,673,262
Best practice for passing object
<p>I have a little simple question.</p> <p>Let's say I have a data object with about 10 properties, and I want to pass data from my object to a function. Most of the time I only need one of these values in the receiving function, and could just as well pass only that value (let's say an int). So what is the pros and c...
c#
[0]
516,981
516,982
OLE AUTOMATION WITH PHP or PHP-CLI?
<p>I read here <a href="http://www.daniweb.com/code/snippet217293.html#" rel="nofollow">http://www.daniweb.com/code/snippet217293.html#</a> it is possible.</p> <p>What should be activated in PHP.Ini or elsewhere to make this work ? Are there any examples with Excel ?</p>
php
[2]
5,988,556
5,988,557
jQuery animate .prepend
<p>Rather than simply dumping the HTML into the page I want it to be animated, how can I change the jQuery below to either animate or slide down as the HTML is inserted?</p> <pre><code>$('.button').click(function() { j('.tweets ul').prepend(j('.refreshMe ul').html()); }); </code></pre>
jquery
[5]
4,908,166
4,908,167
JavaScript: Return owner method from inside onclick function
<p>I am currently writing a custom dialog box script in JavaScript (to show dialog boxes with a choice of buttons, titles, etc.) thus mimicking C#'s MessageBox.Show() method. However, I'm having problems with correctly returning values from the function.</p> <p>For example, the Show() method I have created is static, ...
javascript
[3]
5,914,721
5,914,722
Possible to get user input without inserting a new line?
<p>I know I can stop print from writing a newline by adding a comma</p> <pre><code>print "Hello, world!", </code></pre> <p>But how do I stop <code>raw_input</code> from writing a newline?</p> <pre><code>print "Hello, ", name = raw_input() print ", how do you do?" </code></pre> <p>Result:</p> <blockquote> <p>Hell...
python
[7]
3,269,977
3,269,978
How to check url is valid or not for thousands of nodes together in very short time?
<p>I have a need of checking a particular url <code>"http://16.100.106.4/xmldata?item=all"</code> if it is working or not? Now thing is that, I use the below code if url does not work then connection timeout waits for about 20 seconds before giving exception. Now, I have to check the URL for around 20000 IPs and i can ...
java
[1]
2,776,509
2,776,510
How to use comparison and ' if not' in python?
<p>In one piece of my program I doubt if i use the comparison correctly. i want to make sure that ( u0 &lt;= u &lt; u0+step ) before do something. </p> <pre><code>if not (u0 &lt;= u) and (u &lt; u0+step): u0 = u0+ step # change the condition until it is satisfied else: do something. # condition is satisfied </...
python
[7]
3,005,895
3,005,896
iOS app for installing to remote device using UDID Build Error
<p>Hi I am not new to titanium but i am new in creating the ipa using the titanium.The problem is that when i provide the provisioning file to the titnaium it start to build but it gives the following error</p> <pre><code> ERROR] [DEBUG] While reading /Users/aadilf/Desktop/QLD Best Bets/build/iphone/build/Debug-iphone...
iphone
[8]
1,090,004
1,090,005
error with using include_once in php
<p>I have a file header where i have created variables for all the paths i need, like this:</p> <pre><code>$GLOBAL_stylePath = "http://localhost/pspace/css/"; </code></pre> <p>(if i shouldn't use http in the above, then how would it be? C://htdocs/xampp/pspace/css/ ???)</p> <pre><code>include_once "/classes/auth...
php
[2]
3,328,205
3,328,206
How to integrate Linkedin with my android application?
<p>i want to integrate linkedin with my android app. In this i want to do login with linkedin and to do post on my linked account.</p> <p>So can you help me how i can do it? Please reply ASAP.</p> <p>and also give steps to follow?</p>
android
[4]
4,017,057
4,017,058
How to select a particular value from a <select> element?
<p>I have come across <code>&lt;select&gt;</code> (drop down list) in HTML in the learning process. I learnt how to code a <code>&lt;select&gt;</code> drop down list.</p> <p>How can I perform a particular action (in my case I am performing a mathematical operation) when a value in the <code>&lt;select&gt;</code> is ch...
javascript
[3]
1,702,015
1,702,016
Can I play sound from this class into another class and control it from the other class
<p><a href="http://pastie.org/1887099" rel="nofollow">http://pastie.org/1887099</a></p> <p>I want to be able to control this sound from another class via a JButton from a different class.</p>
java
[1]
5,414,468
5,414,469
Playing flv android
<p>Can we play flv stream videos in Android without using WebView, it's too slow? I mean play .flv video directly from url. Any ideas? VideoView now work with the .flv link.</p>
android
[4]
5,058,229
5,058,230
how do I close all the activities in Android in one simple click
<p>I know that the mechanism of android about stacks work as a stack each one of them goes above each other, what i want is how to make it clear and exit the app with one single click. I google it and i found some long code instead of this should have been very easily and simple to do it.</p> <p>Thanx</p>
android
[4]
5,607,752
5,607,753
Python - passing a string as input to a command
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/967443/python-module-to-shellquote-unshellquote">Python module to shellquote/unshellquote?</a> </p> </blockquote> <p>I am trying to pass a string's value into a command as input, in Python for executing a bash c...
python
[7]
2,061,807
2,061,808
jQuery validation plugin: apply one rule on all required fields
<p>I am using jquery validation plugin for validation. I am using one javascript function for many forms so it is difficult to define rules for all fields for many forms.</p> <p>What is the code if I want to apply a rule "required=true" for all textfields those have a class "required".</p> <p>I am trying this but it ...
jquery
[5]
2,876,679
2,876,680
can I use a compatible action bar AND a fragment in the same activity?
<p>OK, I've been extending my activities to </p> <pre><code>extends ActionBarActivity </code></pre> <p>My main menu page </p> <pre><code>extends FragmentActivity </code></pre> <p>when I change it to extend ActionBarActivity so I can see my action bar title on the main menu, it throws up and gives me the "Error Infl...
android
[4]
5,345,345
5,345,346
Javascript Replace HTML Characters
<p>I am a total noob on Javascript. What I want is to have a search form, and the input to the form should change the url, then it will open a new tab with the new url.</p> <p>For example, when I enter 'production', the url will become <a href="http://production-test.com/test/" rel="nofollow">http://production-test.co...
javascript
[3]
403,871
403,872
why am I getting format exception in this code? It has one argument only
<pre><code>public override string ToString() { string val; if (blower) val = "Yes"; else val = "No"; return string.Format( "With Blower \t:\t {0} \n" + val); } </code></pre> <p>I am getting an exception in these lines:-</p> <pre><code> return strin...
c#
[0]
1,103,727
1,103,728
Can you capture end user's Java version when they run an applet?
<p>An applet developed outside our company just started failing for some users this week. Apparently it was because of the latest version of java (1.6u24) that auto updated. Is there a way to capture what version of java the user opened the applet with? </p>
java
[1]
187,107
187,108
Why does the Java compiler say my file was not found in the class path when I can clearly see it in the class path?
<p>I am using <code>java -classpath $CLASSPATH ...</code>, where <code>$CLASSPATH</code> has been set to <code>/file1path/file1:/file2path/file2</code> and so on. Despite this, Java complains that <code>file1</code> is not found. I tried to set <code>-Dfile1=file:///fullpath/file1</code>, but it still says it cannot ...
java
[1]
582,922
582,923
password strength checker in android
<p>How can we implement <strong><em>password strength checker</em></strong> in android.<br> Please Help</p>
android
[4]
759,285
759,286
Is it possible (or advisable) to use Activity as switched component of ActionBar's navigation tab or drop-down navigation
<p>I have 2 Activities. One of it is displaying line chart, another is displaying pie chart. I would like to embed both in a single launched Activity. User is allowed to perform single click, to switch between line chart and pie chart.</p> <p>I realize ActionBar's navigation tab, or drop-down navigation is the best ca...
android
[4]
3,524,439
3,524,440
Assign scroll animation to focus in jquery
<p>I have the following code which focuses on an input field which has a validation error. I would like to add some sort of animation with the scroll to the focused position (so if you click submit it "scrolls up to where the first input field is which failed validation).</p> <p>Any ideas?</p> <pre><code> if(validati...
jquery
[5]
2,979,566
2,979,567
how to set get_magic_quotes_gpc to Off
<p>How can I set get_magic_quotes_gpc to Off in php.ini ? I have tried to overwrite value to Off in php.ini. it is showing Off in file but when i echo, it returns 1 means On.</p> <p>any suggesion that can help me..</p> <p>I am using XAMPP server ...</p>
php
[2]
5,631,011
5,631,012
Java - Object properties does not differ
<pre><code>ClassName ref = new ClassName(); ref.setCredentials(Credentials); ref.setVal(value); ref.setUser(user); </code></pre> <p>Now when I create a new object of the same class reference, I still get the previous values I have set. Why is this so?</p> <pre><code>ClassName ref2 = new ClassName(); ref2.setVal(value...
java
[1]
3,826,175
3,826,176
Add html element 'h1' in html element 'a' with php
<p>I have the following html string in php</p> <pre><code>$html='&lt;div style="display:block; float:left; width:40px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;a href="http://cosa.gr/index.php?cPath=15" class="headerNavigation"&gt;text&lt;/a&gt;'; </code></pre> <p>and I need to add an 'h1' html element in the a element were the...
php
[2]
953,039
953,040
Why the size of a pointer is 4bytes in C++
<p>On the 32-bit machine, why the size of a pointer is 32-bit? Why not 16-bit or 64-bit? What's the cons and pros?</p>
c++
[6]
560,935
560,936
java Object inside a try {}
<p>Hy ... I have the following code :</p> <pre><code> try { Nrtrde record = new Nrtrde(); } catch (Exception e) { System.out.println(" ERROR\n"); e.printStackTrace(); } finally { Nrtrde record = new Nrtrde(); System.out.println(" OK\n"); } record.setSpecificationVersionNumber(specificationV...
java
[1]
4,092,209
4,092,210
android externel application
<p>Hi form the following site <a href="http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android-apps/2.1_r2/" rel="nofollow">http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android-apps/2.1_r2/</a><br> i can download the source code of all android app as...
android
[4]
848,678
848,679
Characters changed by the webserver
<p>I have this code in an .js file, if it is downloaded via ftp</p> <pre><code>texto=texto.replace(/á/g,"Waacute;"); texto=texto.replace(/é/g,"Weacute;"); texto=texto.replace(/í/g,"Wiacute;"); texto=texto.replace(/ó/g,"Woacute;"); texto=texto.replace(/ú/g,"Wuacute;"); </code></pre> <p>but when the web browser downloa...
javascript
[3]
2,452,967
2,452,968
Activity name in AndroidManifest.xml
<p>Is it required to start activity name with dot ('.') in manifest file.? for example activity ContactManager starts with '.'</p> <pre><code>&lt;activity android:name=".ContactManager" android:label="@string/app_name"&gt; </code></pre> <p>where as the activity ContactAdder is without dot</p> <pre><code>&lt;activ...
android
[4]
1,140,361
1,140,362
Accessing a property of a Javascript object with bracket notation
<p>I want to access the property values of...</p> <pre><code>var $o = {a:2, b:{c:6}}; </code></pre> <p>...via $o[<em>index</em>] notation.</p> <p>I'm using the newest Firebug console (I don't know whether it's using ECMAScript 5 Strict Mode), but when I use $o[0], $o[0].a or $o['0'], I get undefined and TypeError.</...
javascript
[3]
1,826,312
1,826,313
Reading a javascript script, why so many $ (dollar signs)?
<p>I am trying to decipher a .js script and I am finding it filled with $ throughout? Is there any reason to use this? I'm pretty new to JavaScript.</p>
javascript
[3]
2,216,360
2,216,361
How to ensure if atleast one checkbox is selected for multiselect jqury plugin
<p>I am using the jquery multiselect <a href="http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/" rel="nofollow">plugin</a>. Right now I am checking if the user has selected any checkbox or not with the below code.</p> <pre><code> function fntemp() { var values = $("select").val(); alert(values); if(!valu...
jquery
[5]
5,584,686
5,584,687
PHP split alternative?
<p>PHP is telling me that split is deprecated, what's the alternative method I should use?</p>
php
[2]
2,925,224
2,925,225
Setup a asp.net web development platform for free
<p>I need to set up a web developer plat form or c# working enviorment with MSSQL database. I saw some links, but its not updated with new Microsoft pages. So I couldn't find that . In fact I need to create database driven website.</p> <p>Please help me</p>
c#
[0]
341,725
341,726
java negator operator
<p>Hi i'm trying to use a negator operator in java to try and change a negative amount inputted by a user to the same number but just as a positive. Any tips on how to do this would be greatly appreciated. Thanks</p>
java
[1]
1,265,835
1,265,836
javascript shorten string without cutting words
<p>I'm not very good with string manipulation in javascript and i was wondering how you would go about shortening a string without cutting any word off. I know how to use substring but not indexof or anything really well.</p> <p>say i had the string text = "this is a long string i cant display" i want to trim it down ...
javascript
[3]
3,362,358
3,362,359
Android Google Map
<p>Is this possible in Android, when i will say a name of place google map pointer will zoom to that place. i.e. I want to search Map by voice if possible then how to do this? Though i have done so many apps in Google map, but din't try this before! Can any body help?</p>
android
[4]
2,735,774
2,735,775
javascript don't display the image placeholder if the image is not found
<p>Is there a way to not display the image placeholder if the image was not found? I've got images loaded by automatic feed, and for some items images are there, but for some there are not. So, if the image is not there, I would like to display placeholder.</p> <p>Thank you,</p> <p>H</p>
javascript
[3]
4,499,419
4,499,420
Self hosted jquery OR Google hosted jquery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2859612/should-i-use-a-hosted-version-of-jquery-which-one">Should I use a hosted version of JQuery? Which one?</a> </p> </blockquote> <p>I have been thinking of this for a while now because I am wondering if whi...
jquery
[5]
1,976,788
1,976,789
jQuery rotating through list items in a gallery, how to do this with muliple images on a page
<p>Hi I have tried the above here <a href="http://www.jsfiddle.net/b3Lf5/1/" rel="nofollow">http://www.jsfiddle.net/b3Lf5/1/</a> the trouble is I can not get it to work on my homepage. Also I would like to have this work but for multiple images rotating at different times (would look weird if they rotated at the same t...
jquery
[5]
1,627,119
1,627,120
How to Know if the incoming call is rejected or get missed
<p>I want to detect if call was Missed or it was rejected using Call State.</p> <pre><code>public void onCallStateChanged(int state, String incomingNumber) { super.onCallStateChanged(state, incomingNumber); switch (state) { case TelephonyManager.CALL_STATE_IDLE: //when Idle i.e no call ...
android
[4]
4,625,138
4,625,139
Transactions for C# objects?
<p>Just curious, is there any support for transactions on plain C# objects? Like</p> <pre><code>using (var transaction = new ObjectTransaction(obj)) { try { obj.Prop1 = value; obj.Prop2 = value; obj.Recalculate(); // may fire exception transaction.Commit(); // now obj is saved } except { ...
c#
[0]
5,444,636
5,444,637
How to kill an Android activity when leaving it so that it cannot be accessed from the back button?
<p>In an given Android activity, I would like to start a new activity for the user at some point. Once they leave the first activity and arrive at the second, the first activity is stale and I want to remove it completely so it can not be accessed again from the back button.</p> <p>How is the best way to accomplish th...
android
[4]
2,201,703
2,201,704
how compare two static function are equal or not in javascript
<p>how to compare two static functions in javascript equal or not equal?</p>
javascript
[3]
2,092,697
2,092,698
Python class function default variables are class objects?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1132941/least-astonishment-in-python-the-mutable-default-argument">&ldquo;Least Astonishment&rdquo; in Python: The Mutable Default Argument</a> </p> </blockquote> <p>I was writing some code this afternoon, and s...
python
[7]
972,787
972,788
Drop Down Select with ASP Get function
<p>I am using a GET function with asp query string. I am passing the select option as a variable in the query string, but it is not setting the default value. </p> <p>Here is the code:</p> <pre><code>&lt;% Dim email,name,location,comments email = CStr(Request("email")) name = CStr(Request("name")) lo...
asp.net
[9]
5,437,974
5,437,975
Jquery Carousel - Need A Script Hack to Customize
<p>I hope someone can help me out here. I am coding a site for a client using the carouFredsel. I am using this because it allows for variable widths with in the slideshow as seen here: <a href="http://2938.sandbox.i3dthemes.net/index-old.html" rel="nofollow">http://2938.sandbox.i3dthemes.net/index-old.html</a>. My pro...
jquery
[5]
3,530,549
3,530,550
parse error in eval() - eval()'d code
<p>Where is the problem in my eval code??? because Apache said:</p> <blockquote> <p>Parse error: syntax error, unexpected T_STRING in E:\xampp\htdocs\1php\mas_res\inc\mysql_class.php(120) : eval()'d code on line 1</p> </blockquote> <p>my code:</p> <pre><code> $type1 = "row"; $query1 = ...
php
[2]
2,925,439
2,925,440
Numbers in separate divs have default number if null
<p>I have a number i'm taking out of database, basically votes.</p> <p>So numbers are going to be separate.</p> <pre><code>For example [ ] = A div styled box. And $foo = 100 it will display like this: [ 1 ] [ 0 ] [ 0 ]. &lt;?php for($i=0; $i&lt;strlen($counter); $i++) { echo "&lt;div c...
php
[2]
2,263,857
2,263,858
Is document.location.protocol ever invalid?
<p>I want to construct URLs with the same scheme (presumably, "http:" or "https:") as the page that loaded the currently-running JavaScript. Modern browsers support simply omitting the scheme (for example, <code>src="//example.com/test.js"</code>), but this isn't fully cross-browser compatible. (I've read that IE 6 is ...
javascript
[3]
5,538,381
5,538,382
jQuery: How to select form elements for the current clicked button?
<p>I have a jsfiddle here - <a href="http://jsfiddle.net/9kKXX/3/" rel="nofollow">http://jsfiddle.net/9kKXX/3/</a> </p> <p><strong>Requirement</strong></p> <p>Every form has bunch of dynamic data like video id, title, views, that I want to send to backend depending on which button "New" clicked </p> <p>How can I d...
jquery
[5]
923,005
923,006
How to place the vertical line inbetween on cell
<p>How to place the vertical line inbetween on cell</p>
iphone
[8]
3,500,972
3,500,973
How to make a contact form send a confirmation email to the user?
<p>This is what i have so far..</p> <pre><code> $full_name = $_REQUEST['full_name'] ; $company = $_REQUEST['company'] ; $abn = $_REQUEST['abn'] ; $customer_number = $_REQUEST['customer_number'] ; $about = $_REQUEST['about'] ; $areacode = $_REQUEST['areacode'] ; $telephone = $_...
php
[2]
4,283,137
4,283,138
Global variable is NULL in class method
<p>My first line in my script I have:</p> <pre><code>$db = new db_class(); </code></pre> <p>This is just an example to start the db object. Then I have:</p> <pre><code>class main { function init() { $this-&gt;session_start(); } protected function session_start() { $sh = new session_hand...
php
[2]
1,822,870
1,822,871
Is there a difference between "addition" and "bitwise addition"?
<p>As a little project (nothing mission critical), I decided to try and write an implementation of GOST 28147-89 in C#. However, while reading through <a href="http://tools.ietf.org/html/rfc5830#section-3.2">RFC 5830</a> (an informational defining GOST 28147-89), I noticed this.</p> <blockquote> <p>(+) is a bitwise...
c#
[0]
1,468,336
1,468,337
Redirect to handling page
<p>On the masterpage I have menu items links that look like like:</p> <pre><code>&lt;ul&gt;&lt;li&gt;&lt;a href=type=article&amp;articleId=82&gt;Article 82&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; </code></pre> <p>When the link is clicked, I want to navigate to the right aspx page based on the QueryString 'type' (in this case...
asp.net
[9]
3,777,337
3,777,338
Close Android popup window with back press
<p>I have created a android application where I have created a popup screen. But when I am pressing the back button, popup is not getting closed. </p> <p>I have tried with onBackPressed(). It is not working.</p> <p>Can someone tell me what to do.</p> <p>Regards,</p> <p>Shankar</p>
android
[4]
2,197,385
2,197,386
checking if form data has been changed
<p>I have been trying the following C# code to check if form data has been changed before closing and saving but it seems that it always reports the form as being changed even when no changes were made.</p> <pre><code>//Declare a private variable private bool requiresSaving =false; //Declare an event private void...
c#
[0]
2,676,357
2,676,358
Android AccountManager API
<p>I'm struggling to understand the Android AccountManager API. As far as I got thinks working I can use the blockingGetAuthToken method and specify whether Android should provide a notification for user to allow or deny the request. Another possibility is to use getAuthToken and check if KEY_INTENT is returned. If tha...
android
[4]
217,424
217,425
Download excel files generated from sql Queries
<p>I have a code snippet like this one here below:</p> <pre><code>&lt;pre&gt; &lt;?php set_time_limit (0); $files = array('export_ird', 'export_earm',); foreach($files as $f){ include_once $f.".php"; echo "finished file $f\n"; flush(); } ?&gt; &lt;/pre&gt; </code></pre> <p>Now those two files names in the array are f...
php
[2]
3,789,194
3,789,195
Where is the source code of IEnumerator?
<p>I just download the .Net framework source code from <a href="http://referencesource.microsoft.com/netframework.aspx" rel="nofollow">http://referencesource.microsoft.com/netframework.aspx</a> It’s Net_4.msi. But after I installed it, I cannot find IEnumerator code file. I just wonder why Net_4.msi does not include al...
c#
[0]
2,655,229
2,655,230
How can I read a String into an inputStream in Java?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/782178/how-do-i-convert-a-string-to-an-inputstream-in-java">How do I convert a String to an InputStream in Java?</a> </p> </blockquote> <p>How can I read a String into an InputStream in Java ? </p> <p>I want to...
java
[1]
3,847,757
3,847,758
How does Stackoverflow hide the URL of the new share on facebook etc
<p>When you create a post , over in the Left hand side under the vote up and vote down, is a new share on twitter facebook and linkedin.</p> <p>How do they do that, is it just using javascript ?</p> <p>Or something far more clever than say:</p> <p>This : <a href="http://www.openjs.com/articles/ajax/target_url_hiding...
javascript
[3]
4,722,482
4,722,483
Change ListView Text Color in Simple ListView - Android
<p>I am using Simple Listview to display Email addresses from Contact List. Its working fine. Now I want to change the color of text displaying email address on each row as I am displaying background for Listview.</p> <p>Please give me your suggestions or any code. How can I change color?</p> <p>This is the code:</p>...
android
[4]
5,758,658
5,758,659
constructor inheriting self python
<p>I made a class which looks something like.</p> <pre><code>class NewInt: def __init__(self, x,y): self.holders = {"x":x,"y":y} </code></pre> <p>Now, I have a number say a dictionary. So everything is exactly same</p> <p>except its not NewInt but a dict.Somethng like</p> <pre><code> A {"x": 3,"y":4} </code>...
python
[7]
3,342,070
3,342,071
Assigning default argument values
<p>Using this script:</p> <pre><code>color = 'blue' def say_color(color): print 'The color is: ' + color say_color() </code></pre> <p>Here, I am trying to allow <code>say_color</code> to be processed without passing an argument, and the result being the default color (blue). However, if a color is specified, it...
python
[7]
408,290
408,291
How to pick contacts only from google contacts (not facebook etc) with phone numbers?
<p>I need to fix a bug in an old app of mine. Part of the bug is how I select contacts. Here is what I need:</p> <ol> <li>The contact must be from the 'normal' google contacts list, i.e. I don't want to get any contacts from facebook or similar.</li> <li>The contact must have at least one phone number.</li> <li>The co...
android
[4]
4,108,193
4,108,194
How to lowercase a string except for first character with C#
<p>How do convert a string to lowercase except for the first character? Can this be completed with LINQ?</p> <p>Thanks</p>
c#
[0]
5,560,938
5,560,939
Prepend a byte to a byte array
<p>I need to prepend the string "00" or byte 0x00 to the beginning of a byte array? I tried to do it with a for loop but when I convert it to hex it doesn't show up in the front.</p>
java
[1]
709,763
709,764
Change date format for jquery validation Engine future now
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/511439/custom-date-format-with-jquery-validation-plugin">Custom date format with jQuery validation plugin</a> </p> </blockquote> <p>How can I change the date format for the jQuery validation engine future now? <...
jquery
[5]
1,896,587
1,896,588
calling jquery from ajax page
<p>I'm having trouble using jQuery with child page</p> <p>parent.html loads child.html like so: ie user clicks </p> <pre><code>&lt;a href="#" id="n-email"&gt; </code></pre> <p>JQuery</p> <pre><code>$('a#n-email').click(function() { $.ajax({ type: "GET", url: "/scripts/contact.js", dataType: "script" ...
jquery
[5]
3,673,104
3,673,105
How do I get an int variable in javascript to input in a java method
<p>In the code below, I am trying to use the <code>var i</code> in the java method <code>option.value = &lt;% ppList.get(i).getId(); %&gt;</code> but it is not working out for me very well. </p> <p>here is the full js function:</p> <pre><code>function receiveAnswer(response) { var aSeats = document.getElementById("...
javascript
[3]
3,349,924
3,349,925
detect locked file
<p>Given a reference to a <code>File</code> instance, is it possible to (programatically) detect whether the corresponding file is locked, and if so, which process is holding the lock?</p> <p>I'm using Java 5, running on Windows.</p> <p>Thanks, Don</p>
java
[1]
893,561
893,562
Comparing two class types
<p>I am trying to compare two class types, but i keep getting an error.</p> <pre><code> if (mediaTitleCollection[i].GetType() == Catalog.FilmMedia) </code></pre> <p>I get following error: 'Catalog.FilmMedia' is a 'type' which is not valid in this context.</p> <p>I dont exactly see the problem hence the primary thing...
c#
[0]
216,304
216,305
set consisting of an emtpy set
<p>To get an empty set in python I use <code>{}</code> and it works.</p> <p>I need to use the empty set as an element in a set.</p> <p>But <code>{{}}</code> yields an error and <code>{set()}</code> too.</p> <p>Is there a way?</p>
python
[7]
4,311,534
4,311,535
pull everything from db and then compute stats?
<p>I am working on an auto trade website. On the page where Ad list gets displayed, I plan to display the number of Ad for different categories: for example, for location: I will display something like "Vancouver (50), Richmond (12), Surrey (20)". For vehicle make, the following will be shown "Honda (20), Ford(12), VW ...
asp.net
[9]
1,447,969
1,447,970
What Would You Consider Best Practice Workflow Tools For Web Application (PHP) Development?
<p>I'm really hoping somebody with more experience can edit the question as per my examples of answers:</p> <blockquote> <p>• using version control</p> <p>• test driven development</p> <p>• debugging code (xdebug for php)</p> <p>• use of UML diagrams</p> <p>• use of OOP for maintainable, reusab...
php
[2]
3,218,130
3,218,131
Java - Take a string from user and use KeyPress from the Robot object to type it out
<p>How would I go about doing this?</p> <p>I got a loop for it but don't know how to type it out..</p> <pre><code> //Start typing the given strings for( int i=0; i&lt;vString_size; i++ ) //Run through all the strings { string_size = vString.get(i).length(); for( int j=0; j&lt;string_size; j++ ) //...
java
[1]
1,005,570
1,005,571
sort an array of a class in C#
<p>In my program, I have a class like this:</p> <pre><code>Class Customer{ double Start; double Finish; double Wait; } </code></pre> <p>and I created an array of this class:</p> <pre><code>Customer[] customer = new Customer[300]; </code></pre> <p>How I can sort this array according to Start values Desc...
c#
[0]
4,303,034
4,303,035
Move Focus to Server Side Validator
<p>I have a page with multiple CustomValidators and I want the focus to be brought to the offending validator when there is an error. I know this is possible with client side validation, but is it possible with server side? </p> <p>Additionally, the CustomValidators are located in different parts of the page so I ca...
asp.net
[9]
4,074,344
4,074,345
How can i use Log.d to get what has passed to a variable in my activity, and where can i see the result?
<p>Its a noob question, but i'd searched quite a while but i didn't understand</p> <p>i really want to find what is the value that is passed to a variable..and where can i see the result?</p>
android
[4]
4,252,608
4,252,609
jquery removeattr not found execption
<p>I am using jquery-1.7.2.min.js</p> <p>TypeError: </p> <blockquote> <p>$("#TextBox1").removeattr is not a function [Break On This Error] $("#TextBox1").removeattr("disabled"); </p> </blockquote>
jquery
[5]
3,276,249
3,276,250
Passing value in java BEGINNER stuff
<p>i am having a little bit of trouble in my code i wish to take the value operation = flip in the last if statement and pass it to the top where operation = "" so that it is either + - or * is this even possible sorry for such a basic question but i am really stuck</p> <pre><code>JButton operand = (JButton) calculat...
java
[1]
3,974,759
3,974,760
comparing lists at a previous index
<p>I have got 2 lists for which I would like to compare to one index before :</p> <pre><code>for (min,max) in zip(csv_parse(2010)['min'],csv_parse(2010)['max']): </code></pre> <p>basically I would like something like this :</p> <p><strong>if min > min(back one increment) and max &lt; max (back on increment)</strong>...
python
[7]
389,043
389,044
android Howto "really" get the mime type of sd card files
<p>hi<br> Dont say this is a duplicate question because i have read them all for two days. And non of them really supply a useful answer.</p> <p>I have a number of different files in a folder on the sdcard. Want to open right app depending on apk, txt, mp3, avi, jpg or show a chooser dialog. Therefor i need the mime...
android
[4]
3,373,092
3,373,093
Read ringtone string assigned to Contact on iOS
<p>using iOS sdk 4.3</p> <p>In order to determine the phone numbers a contact has on iOS one can use the code below</p> <pre><code> ABMutableMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty); CFIndex i = ABMultiValueGetIndexForIdentifier (multi,identifier); phoneNumberLabel = (CFStr...
iphone
[8]
5,365,054
5,365,055
Extract commas from variable
<p>Hey there, I have this variable:</p> <pre><code>&lt;?php $blog_description = get_bloginfo('description'); ?&gt; $blog_description ='I am a text, I have commas, and periods. And I want the text without them'; </code></pre> <p>How can I extract the commas and periods from $blog_description? I want to use it as me...
php
[2]
1,371,843
1,371,844
How to get random elements from an array
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4550505/javascript-getting-random-value-from-an-array">JavaScript: Getting random value from an array</a> </p> </blockquote> <pre><code>var numbers = new Array('1','2','4','5','6','7','8','9','10'); </code></pre...
javascript
[3]
2,298,382
2,298,383
Javascript position two elements on top of each other
<p>I have two divs one above the other. The second on is absolutely positioned below it (an absolute div inside a relative div).</p> <p>I want to move the second div on top of the other div, so it appears in the middle.</p> <p>The procedure for this is to set the style.top of DIV2 to be the same as DIV1, this should ...
javascript
[3]