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,910,013
5,910,014
jquery + populate selectbox with numbers
<p>i want to populate selectbox dynamically with the count available from total number of text boxes,</p> <p>i.e.</p> <p>if i have text 2 textboxes then the selectbox should like</p> <blockquote> <pre><code>&lt;select&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; ...
jquery
[5]
2,398,916
2,398,917
How do you get hold of an Android Context for a Junit test from a Java Project?
<p>I need to access and Android context for a JUnit Test.</p> <p>I have tried using MockContext and extending the AndroidTestCase but each time I get an error saying (stub!)</p>
android
[4]
2,166,899
2,166,900
Submit tag-based form when hitting enter
<p>I have a tag-based search form (just like the tag-based text boxes you see on Facebook or S/O where you enter a word and press the corresponding delimiter key on the keyboard)</p> <p>On my website, you type a word in the text field, and press enter to 'confirm' or 'accept' that keyword, which enables you to enter a...
jquery
[5]
1,152,849
1,152,850
Looping through specific array elements
<p>I have a table and each row contains, among other things, 5 columns which may or may not contain an image file name. Let's say I've retrieved that row and put it into an assoc array. I want to loop through and echo those image file names (cols may or may not all be populated) into html tags, but only if that column ...
php
[2]
4,000,958
4,000,959
instance failure error in asp.net web site
<p>I have a website included login module.when i hosted the website in iis there is an error</p> <pre><code>Server Error in "/" Application. system.invalid operation Exception: Instance Failure </code></pre> <p>My ConnectionString is like this</p> <pre><code>&lt;add name="MyConnectionstring" Connectionstring="Data ...
asp.net
[9]
3,680,565
3,680,566
How to refresh a particular div after closing a modal window?
<p>I have a modal window which closes when i add an item. The parent page will refresh once the modal window is closed. But i don't want the whole window to get closed, but i want a particular div to get refreshed. is there any javascript way to do it ?</p>
javascript
[3]
999,827
999,828
iPhone: UIImage imageNamed doesn't show the image
<p><img src="http://i.stack.imgur.com/jbEHl.png" alt="enter image description here"></p> <p>Hi,</p> <p>I am trying to use the attached image in an UITableView cell. Images are in application bundle. Except this image and few images, other images are showing fine in the cell. I couldn't find whats the reason to not sh...
iphone
[8]
311,095
311,096
How to detect if internet connection break while fetching data from internet
<p>I am working on an app which connects to internet to fetch data from server. When I first start network operation then I always check for network connectivity. But how can I manage my app if internet connection broken while fetching data from internet.</p>
android
[4]
282,238
282,239
A basic Rock, Paper or Scissors program
<p>Updated code:</p> <pre><code> #RockPS import random Choices=['R','P','S'] UserScore=0 CpuScore=0 Games=0 while Games&lt;6: UserChoice=input('Rock, paper or scissors? (Type R, P or S respectively)') if UserChoice in Choices: Games+=1 CpuChoice = random.choice(Choices) if UserChoice == 'S' and ...
python
[7]
2,365,339
2,365,340
Operações antes e depois chamada de métodos
<p>Estou querendo que todos os métodos invocados realizem uma operação inicial e final quando invocados. Como poderia fazer isso? Marcio</p>
python
[7]
3,692,698
3,692,699
php.ini to affect all sub-folders
<p>I need to add a php.ini in a specific folder in my server to set <code>allow_url_fopen = true</code> for a website. The website has its root folder an plenty of sub-folders that also have many sub-folders.</p> <p>If I place the php.ini in the root of the website, it seems to only affect that folder (I've run phpcon...
php
[2]
4,627,382
4,627,383
Why does the backing store of an array bind to the smallest type?
<p>In C# it is legal to write</p> <pre><code>Animal[] a = new Giraffe[4]; //with obvious relationships </code></pre> <p>Because arrays are covariant. However, this is a breaking relationship. It's a runtime exception to then apply a different type of Animal to this array because the backing store is a <code>Giraffe...
c#
[0]
1,791,888
1,791,889
Property 'length' not found on object of type 'id'
<pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *topLevelO...
iphone
[8]
4,449,130
4,449,131
Creating an "alert" mechanism
<p>Looking for a bit of help/advice on solving a particular problem. I've got a small-ish Silverlight application (C#, .Net 4), and I'd like to add the facility to display "alerts" to the user based on certain data meeting certain criteria. The alerts need to be displayed to the user somewhere on the page, and be displ...
c#
[0]
1,340,612
1,340,613
check textfield value, if equal to given value then action if not then do nothing
<p>What I want is when the textfield <strong>#ItemAddress</strong> on focus, check another textfield #<strong>CAT_Custom_279176</strong> and if the value of which carried equals "<strong>SG</strong>", then clear the value of textfield #<strong>CAT_Custom_269379</strong> and #<strong>CAT_Custom_248591</strong>; if value...
jquery
[5]
4,058,778
4,058,779
Stop .load from loading
<p>I have a file which loads content from another file on document.ready and I have a link which loads different content into the same container. I want to stop .load on document ready when hyperlink is being clicked?</p>
jquery
[5]
3,441,915
3,441,916
Why doesn't this javascript code work?
<pre><code>function myFunction(messager) { this.message = messager; } new myFunction("Hello"); document.write(myFunction.message); </code></pre>
javascript
[3]
4,991,885
4,991,886
Jquery file format
<p>HI.</p> <p>I have multiple webpages. So I have a common external js file. And I have added this js file to every page. I have multiple check boxes in every page. And I have written the click event in the external, common js file. But I wonder how the js file should be? Currently I have written like this.</p> <pre...
jquery
[5]
2,708,814
2,708,815
how to check if my text has copyright symbol
<pre><code>&lt;ul class="scDetailLinks"&gt; &lt;li&gt; &lt;h3&gt; ONSTAR®&lt;/h3&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>how to check if h3 has the copyright symbol using jquery or javascript</p>
jquery
[5]
1,902,865
1,902,866
Android Preventing Double Click On A Button
<p>What is the best way to prevent double clicks on a button in Android? </p>
android
[4]
5,857,271
5,857,272
ClearInterval() and SetInterval()
<p>So in my javascript code, there is a part where if the user clicks on the checkbox I need to change the time delay used by <code>setInterval()</code>. At the moment, I used the <code>onchange</code> handler on the checkbox. Whenever the checkbox is changed, I call <code>clearInterval()</code> and <code>setInterval()...
javascript
[3]
2,062,250
2,062,251
dbf file how to load a java resultset
<p>I have the following scenario in a Java desktop app; I can upload a file as a dbf resultset with a query (sql), I have implemented a JFileChooser in which I get the file path for then use it in reading.</p> <p>thanks</p> <p>regards</p>
java
[1]
3,234,053
3,234,054
Video Player Restrictions
<p>I am working on redoing a website for a client that has produced a film and put it online for free. Within the video player he would like it set up so that when someone clicks to watch the film on his website and window pops up that requires the user to sign up for his e-mail list before it will allow the user to vi...
jquery
[5]
5,976,347
5,976,348
How to upload an image from iPhone into ASP.Net web server
<p>i want to upload images from my iPhone into asp.net web server. Iam new to iPhone developemnt. Please help...</p>
iphone
[8]
3,777,292
3,777,293
How to convert a List<String> list to csv string
<p>I have a <code>List</code> of <em>Strings</em>. Is there a <em>Java</em> convenience method to convert this <code>List</code> to a <em>CSV</em> <code>String</code>? So "test1, test2, test3" is the result of a conversion of a List 3 String elements which contains "test1" "test2" "test3"</p> <p>I could write the meth...
java
[1]
1,442,746
1,442,747
java instance variable and method having same name
<p>In java can an instance variable and a method have the same name without any instability or conflict?</p> <p>I want to make sure if I can get away with compiling it, that it wont cause any error down the road.</p>
java
[1]
4,630,187
4,630,188
Java method to print prime numbers from specific range
<p>I'm trying to make a method to copy all prime numbers from a specific range (provided by a constructor (int lowerBound, int upperBound) using these methods , can't seem to have much success. Can anyone help?</p> <p>public class PrimesEnumerator {</p> <pre><code>int upperBound; int lowerBound; int count = 0; boolea...
java
[1]
5,956,104
5,956,105
How do you safely wrap a JS string variable in double quote chars?
<p>Obviously when you're creating an actual string literal yourself, you backslash escape the double quote characters yourself. </p> <pre><code>var foo = "baz\"bat"; </code></pre> <p>Just as you would with the handful of other control characters, like linebreaks and backslashes. </p> <pre><code>var bar = "baz\\ba...
javascript
[3]
1,371,118
1,371,119
Android app too heavy
<p>can we delete android.jar from the signed apk file as explained by the author here - </p> <p><a href="http://michaelpardo.com/2010/04/one-way-to-reduce-your-apk-file-size/" rel="nofollow">http://michaelpardo.com/2010/04/one-way-to-reduce-your-apk-file-size/</a></p> <p>I want to be sure before trying. I have some 4...
android
[4]
540,991
540,992
connect to oracle XE using c# 2010 express
<p>Just startted with c#. not sure the express version supports connection to oracle or not. if it does, could anyone let me know the steps to do it?</p> <p>Thanks guys.</p>
c#
[0]
4,051,016
4,051,017
jquery elements, declared as variables
<p>I would like to know the best practices when declaring jquery dom elements as variables. Any difference between</p> <pre><code>var div = $('div'); </code></pre> <p>and</p> <pre><code>var $div = $('div'); </code></pre> <p>besides better readability? Thanks</p>
jquery
[5]
2,089,035
2,089,036
How do I get the referrer's domain/host name using javascript?
<p>I know I can get the host name of the current page, by simply doing:</p> <pre><code>var myhostname = location.hostname; </code></pre> <p>But how do I get the host name of the referrer? I can get the referrer by</p> <pre><code>var referrer = document.referrer; </code></pre> <p>but unfortunately there's no <code>d...
javascript
[3]
1,630,305
1,630,306
Is there an alternate/better way to do this simple logic in java?
<p>I have a method, say method1(), that takes a while to run. During it's execution, if there is another call to method1(), it should be ignored. I have, roughly, something like this</p> <pre><code> boolean mFlag = false; void method1() { if(!mFlag) { mFlag=true; // d...
java
[1]
3,875,876
3,875,877
If no arguments are provided in the function, how do I test to see if it is left blank?
<pre><code>&lt;?php /* Copyright Date --------------------------*/ function copyright_date($creation_year) { $current_year = date('Y'); if ($creation_year == $current_year || $creation_year == '') { echo $current_year; } else { echo $creation_year . '-' . $current_year; } } ?&gt; ...
php
[2]
3,285,037
3,285,038
copying and fading HTML over to another spot on the page on hover
<p>I am trying to copy the HTML from the title and description spans within each li into the info div below. Preferably appending h2 tags around the title whilst fading it in. If another li is hovered the current selection should fade out and the new one fade in...</p> <p>HTML</p> <pre><code> &lt;li&gt; &...
jquery
[5]
3,706,914
3,706,915
Understanding instance and class variable python
<p>Let's suppose I have 2 classes in different scenario.</p> <p><strong>Scenario 1</strong></p> <pre><code>class MyClass(): temp = 5 </code></pre> <p><strong>Scenario 2</strong></p> <pre><code>class MyClass(): temp = 5 def myfunc(self): print self.temp </code></pre> <p>Now when will variable...
python
[7]
2,012,513
2,012,514
Uploading images to iphone withou resizing
<p>I want to create application that does something with users images that he can import from his computer. Problem is I need those images in original size. When I try to copy them through iTunes sync, they are resized to 640x480 or something and this is unacceptable for me :( Is there some setting in iTunes or iPhone ...
iphone
[8]
1,287,623
1,287,624
Placement new issue
<p>In this <a href="http://stackoverflow.com/questions/3873625/i-need-c-array-class-template-which-is-fixed-size-stack-based-and-doesnt-req/3873706#3873706">http://stackoverflow.com/questions/3873625/i-need-c-array-class-template-which-is-fixed-size-stack-based-and-doesnt-req/3873706#3873706</a> answer I posted a piece...
c++
[6]
3,290,943
3,290,944
Customised Incoming call screen
<p>I am trying to add few views to the incoming call screen with required functionality. Is it possible to do overide the exis android OS call screen? Is there any way to achieve this as stand alone application.?</p> <p>Thanks in advance.</p>
android
[4]
2,712,942
2,712,943
load from a file object Enum
<p>I would load from a file a string and put in in a object enum.</p> <p>I create into a class this:</p> <pre><code>public Passenger{ private String pass_name; public enum State{ b,c,d; }; .... State reser; public Passenger(String n,State r) pass_name=n; reser=r; } </code></pre> <p>in another file I...
java
[1]
1,858,796
1,858,797
Add files to the app on the run
<p>I was wondering if I could add the files to the app resources from an external url. As in suppose I see a url which has a nice image. Can I download that from the website and add it as a resource and use it locally for later use ? I am sure there is way But Need some guidance on how to approach the problem and The s...
iphone
[8]
1,806,131
1,806,132
c#, hand held device
<p>I am currently working on NET 2.0. I need to develop a web page that can be called from desktop and also a hand held device(It has Windows CE on it). I've never tried anything like this before. Ideally, the requirement is to call my web page on the hand held device and produce the page on it. The page needs to perfo...
c#
[0]
2,607,590
2,607,591
How can we add ASP.NET Machine account in windows server 2003
<p>I wand to download the files in Windows server 2003. For that the ASP.Net application needs access control to the directory. I searched the ASP.NET Account. But I cannot find. How Can i find or add? Any one please help</p> <p>IF I try to add the ASPNET account using User Accounts panel. I cannot open the localuser...
asp.net
[9]
683,234
683,235
Data transaction between PHP and client - which way?
<p>I'll going to keep my question short. Which way sounds more professional?</p> <p>This?</p> <pre><code>PHP: echo '&lt;li&gt;Link 1&lt;/li&gt;'; echo '&lt;li&gt;Link 2&lt;/li&gt;'; echo '&lt;li&gt;Link 3&lt;/li&gt;'; jQuery: for each &lt;li&gt;, add hover effect </code></pre> <p>or this?</p> <pre><code>PHP: echo ...
php
[2]
2,817,580
2,817,581
server event of dropdown is not fired
<p>I have a dropdownlist, in the client side, i have it's on change event. If validation is passed, it's selected inded changed event should be fired(server side). My side, the server event is not getting fired. Autopostback is also set is true.</p> <p>Any suggestion ?</p>
asp.net
[9]
3,024,722
3,024,723
Updating the launcher icon at run-time
<p>Is it possible to update the launcher icon dynamically? Currently it seems that it can only be set statically at build time using the android:icon attribute in the AndroidManifest.xml file. For example, to display a unique icon based on the device's location?</p> <p>Is this something that can be achieved using ali...
android
[4]
1,688,116
1,688,117
Jquery code works in firefox but not IE
<p>I have the following event binded to many hyperlinks with the class "riskInformationButton". It works fine in firefox but not in IE. </p> <pre><code>$(".riskInformationButton").bind("click", function(e){ if (e.stopPropagation) e.stopPropagation( ); else e.cancelBubble = true; var toggler = $(this)....
jquery
[5]
190,651
190,652
jquery best way to remove all classes and all ids from div, ul, li, span, a
<p>What is the best way to remove all classes and all ids from all div, ul, li, span, a within a div with id="remove"?</p>
jquery
[5]
2,231,213
2,231,214
How to convert int to 24bit string?
<p>for read I use:</p> <pre><code>def UI24(t): result = 0 for i in xrange(3): result = (result &lt;&lt; 8); byte = unpack('&gt;b',t[i-1]) result += byte; return result </code></pre> <p>and for write ?</p>
python
[7]
1,170,840
1,170,841
Open URL and login
<p>I have been given as task for reconsiling online reports with excel reports, making sure that the data in the two always match. I am doing it manual right now and thinking of automating it using C#. </p> <p>Reading the excel files should not be difficult.<br> However, for opening the online reports I have to open ...
c#
[0]
5,401,043
5,401,044
changing the background color of menu
<p>Hello i have the following xml for menu i want to set the background color black like over <a href="http://android.ankara-gtug.org/guide/topics/ui/menus.html" rel="nofollow">here</a> . The other thing i want to set if the buttons are increased they should remain in one row instead of moving to next row . Thanks </p>...
android
[4]
3,682,346
3,682,347
How could I get all applications that were installed by user?
<p>How could I get all applications that were installed by user?</p> <p>I want to develop an app that can present all applications that were installed by user, but</p> <p>I don't understand how to get them.</p> <p>use <code>getExternalStorageDirectory()</code>?</p> <p>or is there have other method? </p>
android
[4]
1,657,343
1,657,344
Clean way to make a php login script on a site with includes?
<p>Basically I have an index.php file with navigation in form of includes <em>only</em>.</p> <hr> <ul> <li><p>My script can check whether a user exists by checking a database.</p></li> <li><p>It can also log you in if the check was successful.</p></li> </ul> <p>My problem is <strong>redirects</strong>! Do I really h...
php
[2]
4,545,309
4,545,310
C++ and initialize const variable
<p>I want to create class Test with const int variable with name "a". After that I need create constructor where variable "a" get value =10. I Create class test and in test.h I create <code>const int a;</code> in class Test.h and in test.cpp I have something like that:</p> <pre><code>#include "stdafx.h" #include "Test...
c++
[6]
4,591,317
4,591,318
Keeping your main form class short best practice
<p>I have a main form at present it has a tab control and 3 data grids (DevExpress xtragrid's). Along with the normal buttons combo boxes... I would say 2/3 rds of the methods in the main form are related to customizing the grids or their relevant event handlers to handle data input. This is making the main forms code ...
c#
[0]
2,410,687
2,410,688
Any way to keep track of the last 5 data points in python
<p>So I have an array that holds several numbers. As my script runs, more and more numbers are appended to this array. However, I am not interested in all the numbers but just want to keep track of the last 5 numbers.</p> <p>Currently, I just store all the numbers in the array. However, this array gets really big and ...
python
[7]
2,983,588
2,983,589
Javascript attach event to class name
<p>If I have 10 items, with the class name <code>keyword</code>:</p> <pre><code>&lt;div class="keyword"&gt;&lt;/div&gt; </code></pre> <p>How can I attach an event, for example <code>click</code>, on this element.</p> <p>I tried the following, but with no luck: (no alert comes up)</p> <pre><code>document.getElements...
javascript
[3]
2,560,598
2,560,599
Passing variables values
<p>here is the simple script:</p> <pre><code>function parentFunc() { var x = 15; process(x); } parentFunc(); function process(x) { alert(x); }​ </code></pre> <p>Now when the page loads, <code>parentFunc()</code> is being executed which calls <code>process()</code> function along with sending the paramte...
javascript
[3]
3,270,443
3,270,444
Unexpected tag T_ECHO in inline if
<p>I have something like this in one of my views</p> <pre><code>&lt;li &lt;?php $isCurrent ? echo 'class="current"' : ''?&gt; &gt; &lt;a href="SOME_LINK" class="SOME_CLASS"&gt;SOME_TEXT&lt;/a&gt; &lt;/li&gt; </code></pre> <p>This causes a syntax error, unexpected T_ECHO. Changing <code>echo</code> for <code>print...
php
[2]
873,468
873,469
add dynamic lib in iphone application
<p>How do I add dynamic libraries in iphone xcode? I want to add the lib: "libcrypto.dylib" ( in /usr/lib ). Please guide me.</p>
iphone
[8]
3,384,253
3,384,254
Object reference variable
<pre><code>String myString="Plz_help"; </code></pre> <p>i came to know that 'myString' is not an object but a object reference variable which stores the base address of the actual object.So 'myString' should return an address when i execute </p> <pre><code>System.out.println(myString); </code></pre> <p>but it i...
java
[1]
5,737,548
5,737,549
Convert List<int> to delimited string list
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1334072/most-elegant-way-to-return-a-string-from-listint">most elegant way to return a string from List&lt;int&gt;</a> </p> </blockquote> <p>I'm not sure the easiest way to do this. I simply want to add a ; bet...
c#
[0]
4,527,687
4,527,688
Get the current field name
<p>I called below function on body and what i want is when i press anything in textbox it will alert me the name of the textbox and i want to check name and than execute something .Checking name is working great in FF and not in IE.Thanks </p> <pre><code>&lt;body bgcolor="#F2F2F2" OnKeyPress="return getFieldName(event...
javascript
[3]
210,640
210,641
Save HTML Form data into a File using JavaScript
<p>I'm trying to write a code to extract some form data from a HTML file and save them in a file using Javascript.</p> <p>Example: Name, Password and email should be stored in a file (text or XML) so that i can use it later.</p> <p>How can i do it? i'm new to JavaScript !!! </p> <p>Thanks in advance!</p>
javascript
[3]
1,127,437
1,127,438
PagerTitleStrip overlaps with actual content
<p>I am using A custom viewpager with a PagerTitleStrip, both supported by the android compatibility package. As recommended I use it like this:</p> <pre><code> &lt;snok.stubefrie.DayPager android:id="@+id/viewpager" android:layout_width="fill_parent" android:layout_height="wrap_content" android:lay...
android
[4]
2,045,702
2,045,703
How to make list items wrap content?
<p>I have the following list view:</p> <pre><code>&lt;ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="false" /&gt; </code></pre> <p>The problem here is that if the list item contains a lot of text, not all of it ...
android
[4]
462,021
462,022
encode html in php and decode in javascript
<p>I have some html code I want to store in a database. I need a way to encode it in php so all the special characters don't break the db INSERT (the html can include all sorts of spec chars) and then a way to unencode that at the other end in javascript once i've passed it via JSON so that the html is rendered correct...
php
[2]
1,224,506
1,224,507
How to remove <br /> tags and more from a string?
<p>I need to strip all <code>&lt;br /&gt;</code> and all 'quotes' (<code>"</code>) and all 'ands' (<code>&amp;</code>) and replace them with a space only ...</p> <p>How can I do this? (in PHP)</p> <p>I have tried this for the <code>&lt;br /&gt;</code>:</p> <pre><code> $description = preg_replace('&lt;br /&gt;', ''...
php
[2]
4,866,145
4,866,146
How to solve java.lang.NullPointerException
<p>I am getting the <code>java.lang.NullPointerException</code> on the <code>cars.add(car);</code> line and I am really unsure how to solve it, I have read some of the other threads relating to this error, but the answer still seems to have eluded me. </p> <pre><code>public class RentalCompany { private ArrayList...
java
[1]
596,060
596,061
What should be the format string to print "0x0" with swprintf()?
<p>I tried with <code>swprintf(buff, 4, L"%#03x", value)</code>, but when <code>value = 0</code>, I get <code>000</code> instead of <code>0x0</code>. </p>
c++
[6]
2,554,177
2,554,178
how to get Updated location & Disable GPS after getting it in android?
<p>friends,</p> <p>i am using following code to get GPS location </p> <p>it is causing two problems</p> <p>1) when my location is changed / I move my phone from one area to another I dont get updated gps location(latitude/longitude)</p> <p>2) after getting gps location my gps of phone is enabled how to disable it?<...
android
[4]
3,177,800
3,177,801
How can this be made to do fewer calculations? It is very inefficient with large numbers
<pre><code>num = input () fact = 0 while fact != num: fact = fact + 1 rem = num % fact if rem == 0: print fact </code></pre>
python
[7]
4,007,035
4,007,036
Change ImageView image inside onClick event
<p>I have an ImageView working as a button in my program. I need it to be an ImageView since I want just the image to be shown, not the borders.</p> <p>This button is a lamp, if the data in database says it's visible, the lamp must be "on", when you click the button, it will check the data from bank and change it to "...
android
[4]
1,504,491
1,504,492
System.data.datarow
<pre><code> [WebMethod] public List&lt; string&gt; HelloWorld(string prefixText) { SqlConnection con = new SqlConnection("Database=bluedd;Server=(local);Integrated Security=SSPI"); con.Open(); SqlCommand cmd = new SqlCommand("select user_master.first_name from user_master where fi...
asp.net
[9]
673,398
673,399
Reading file's content and writing to console
<p>I have a program which reads contents from a file and prints it on the screen. But program prints every other line i.e., skips every other line. package InputOutput;</p> <pre><code>import java.io.*; public class CharacterFileReaderAndFileWriter{ private BufferedReader br = null; private PrintWriter pw = ...
java
[1]
1,447,160
1,447,161
How do i get text from one activity and put it on a button in another activity.
<p>I want to know how I can get the text from an edittext in Activity B and put that text on the button of Activity A. I want to make it so that when i press the "enter" button on activity b it will get the text of the edittext and replace the text of a button in activity A. I think its something like this </p> <pre><...
android
[4]
4,657,298
4,657,299
How to pass function as param to a class's local var
<p>How to pass function to a class as param then assign it to local class's var!</p> <p>This is my scenario, can this be solved?</p> <pre class="lang-php prettyprint-override"><code>&lt;?php class a { protected $var; function __construct($fun) { echo $fun('world'); // This is working perfect $this-&gt;va...
php
[2]
5,871,807
5,871,808
Ideal way to encrypt user passwords
<p>I initially used MD5 when i first started out coding to hash user passwords.</p> <pre><code> $password1 = md5($password); </code></pre> <p>After reading countless of pages with different opinions, what shall i be using? <code>crypt</code>,<code>SHA1</code>,<code>SHA256</code>... here is an example of how i revise...
php
[2]
4,710,064
4,710,065
Reading integers from a file separated by space in java
<p>Input file containing integers will be like this:</p> <pre><code> 5 2 3 5 2 4 23 4 5 6 4 </code></pre> <p>So how would I read the first line, separate it by space and add these numbers to Arraylist1. Then read the second line, separate it by space and add the numbers to ArrayList2 and so on. (So Arraylist...
java
[1]
1,151,832
1,151,833
ASP.NET: Static Class in App_Code
<p>If a static class is put in App_Code, does that imply only <strong>one instance</strong> will be created, shared by different http requests?</p> <p>Or each request still brings one request?</p> <p>Thanks.</p>
asp.net
[9]
4,425,051
4,425,052
Looking for beginner Python project ideas to learn the language
<p>I've read through "Python for Dummies" and I'm ready to take the next step. I hear that practicing coding with the goal of creating something is the best way to learn. I'm a beginner in Python, and I'm looking for project ideas that I should attempt.</p> <p>I'm looking to learn web app programming, so any project t...
python
[7]
584,581
584,582
Covering a div with an image
<p>I'm writing a memory game, like <a href="http://www.mathsisfun.com/games/memory/index.html" rel="nofollow">concentration</a>. Using jQuery, how do I cover over the square but not lose the contents that are inside the div?</p>
jquery
[5]
83,723
83,724
Storing button inside of php variable
<p>I have following code:</p> <pre><code>$boxId = 1; $explainationBox='&lt;input type="button" id="&lt;?php echo $boxId; ?&gt;" value="send" onmousedown="javascript:callthis(&lt;?php echo $buttonId; ?&gt;);" class="button" /&gt;'; echo $explainationBox; </code></pre> <p>I am trying to save these val...
php
[2]
2,916,919
2,916,920
android_listview
<p>I want to open a new activity when an item is clicked in listview. How to do this.? Here is the code :</p> <pre><code>package com.example.c_progams; </code></pre> <p>public class Second_listview extends ListActivity{</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-ge...
android
[4]
722,130
722,131
fast binary data conversion in Python
<p>What is the fastest method for converting a binary data string to a numeric value in Python?</p> <p>I am using <code>struct.unpack_from()</code>, but am hitting a performance limit. </p> <p>Context: an incoming stream is mixed binary and ASCII data. The ASCII data conversion is done in C though ctypes. Implemen...
python
[7]
4,025,142
4,025,143
PHP Proxy for getting other domain content
<p>Can I write a PHP file (index.php) that when someone point it browser to</p> <p><a href="http://www.domain.org/some?params=a&amp;b=1" rel="nofollow">http://www.domain.org/some?params=a&amp;b=1</a></p> <p>it returns the content of</p> <p><a href="http://www.OTHERdomain.org/some?params=a&amp;b=1" rel="nofollow">htt...
php
[2]
2,604,885
2,604,886
ANDROID. Emulate Hardware Keys with an IME. Doesn't work with Dialog and Spinner
<p>I have understand that the only way to inject KeyEvents in the Android System is to implement an Input Method.</p> <p>I have created my IME with the purpose to control from remote the device.</p> <p>I emulate the hardware keys using the method <pre><code>private void keyDownUp(int keyEventCode) { getCurre...
android
[4]
1,252,163
1,252,164
Styling textView externally
<p>I have number of text views which have the same attributes only the text changes... I believe there must be an easier way of defining them externally like style.xml or something? </p> <pre><code> &lt;TextView android:layout_width="250px" android:layout_height="100px" ...
android
[4]
2,313,375
2,313,376
How do I parse a text file in Objective-C?
<p>I need to parse a text file, one line at a time. Also, is there EOF in Objective-C?</p>
iphone
[8]
632,010
632,011
How do I modify gitstats to only utilize a specified file extension for it's statistics?
<p>The website of the statistics generator in question is:</p> <pre><code>http://gitstats.sourceforge.net/ </code></pre> <p>Its git repository can be cloned from:</p> <pre><code>git clone git://repo.or.cz/gitstats.git </code></pre> <p>What I want to do is something like:</p> <pre><code>./gitstatus --ext=".py" /inp...
python
[7]
507,596
507,597
Load image from a stored png
<p>How does one load or fetch an image that was saved to disk?</p> <p>I wrote the image to the documents filepath using NSData and a PNG representation. How does one get this image back? UIImage.</p>
iphone
[8]
1,171,788
1,171,789
Passing a reference of a data collection into a click handler's callback function
<p>Here's how my code is structured at the time being:</p> <pre><code>$.post('includes/getPeople.php', {char: character}, function(data) { var peopleData = data.people; //generation of HTML markup... $("#peopleTable a.nameLink").live("click", function(e) { var index = $(this).attr("title"); console.log(peopleDa...
jquery
[5]
5,230,787
5,230,788
Java Socket exception
<p>I am trying to write a simple client server program in Java :- Running both server and client code on the same machine...but while running getting an error :- </p> <pre>java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSo...
java
[1]
2,418,523
2,418,524
How to call back from a function to a listener in android?
<p>OK, I have a login class like the snippet below</p> <pre><code>public class LoginClass { public void login() { login.authorize(username,password); //run activity specific code here } </code></pre> <p>}</p> <p>This class is quite generic, but depending on which activity calls LoginCla...
android
[4]
3,390,892
3,390,893
Custom listview drawing
<p>I am trying to draw an overlay above my ListView. So i went with the most obvious approach and put my custom drawing code beneath super.onDraw(canvas) in my ListView subclass.</p> <p>To my surprise the list was rendered above my custom drawing. I know this can easily be done by wrapping the ListView in a FrameLayou...
android
[4]
556,429
556,430
Modify constructor parameter values before calling base class constructor
<p>I have following class hierarchy:</p> <pre><code>class Base { // This class cannot be modified public: Base(int a, int b, int c) { if ( a == 100 &amp;&amp; b == 200 &amp;&amp; c &lt; 100 ) // whatever condition throw "Error!"; } }; class Derived : public Base { // this class can be modified public...
c++
[6]
3,312,742
3,312,743
if isset not set - php
<pre><code>if(isset($_POST['text1']) &amp;&amp; isset($_POST['text2'])) { echo "xxxxxx"; echo "yyyyyyyyyy"; } else { ?&gt; &lt;form&gt; &lt;/form&gt; &lt;?php } ?&gt; </code></pre> <p>When isset is not set I want the form shown and when submitted form not shown, using PHP. This code when ! isset is activated...
php
[2]
644,624
644,625
Android - access microphone from web browser
<p>Is the a way to access a microphone from web browser?</p> <p>I want to create a web site where i want to record a user.</p> <p>Workarounds and suggestions will be very appreciated! :)</p>
android
[4]
4,086,386
4,086,387
what happens in syntax of splobjectstorage?
<p>The below is example2 from php.net's splobjectstorage documentation. The lines using $s[$o1] and $s[$o2] is syntax I'm not familiar with and haven't seen yet for objects (still learning)</p> <p>Is this a standard way of fetching properties from an object that would work with any class I've created?</p> <p>Is this ...
php
[2]
2,807,181
2,807,182
extract GET parameters from a user inputed url with javascript
<p>I am looking to use javascript to extract the GET parameters from a user inputed url.</p> <p>For example is a user enters a url say:</p> <p><a href="http://www.youtube.com/watch?v=ee925OTFBCA" rel="nofollow">http://www.youtube.com/watch?v=ee925OTFBCA</a></p> <p>I could get the v parameter</p> <p>'ee925OTFBCA' as...
javascript
[3]