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
4,976,933
4,976,934
Helpful libraries for C++
<p>Everyone should know about <a href="http://www.boost.org/" rel="nofollow">boost</a>. What are other helpful libraries for C++? If you need to mention specifics (like libcurl, freeimage) please note what they are specific to (web protocol, image loading).</p>
c++
[6]
5,889,535
5,889,536
How to make data from a database accessible from other web applications
<p>I have a database from which I want to expose data.</p> <p>Ideally I would like to be able to just add a URL into some other web page and that URL would then call the correct datum using the web app I use to interact with the database.</p> <p>Would a web service be the best option? </p>
java
[1]
4,040,096
4,040,097
jQuery append after into an element before
<p>I am trying to move content to be after test2 but at the moment it's not working.</p> <pre><code>&lt;div id="test"&gt; &lt;div id="test2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="content"&gt;&lt;/div&gt; </code></pre> <p>I'm using the following jQuery:</p> <pre><code>$("#test2").after("#content"); </code><...
jquery
[5]
2,288,611
2,288,612
how to add fieldname as a variable in OCCI
<p>In the below C++ code, i am updating a field of emp table based on the search value. But this code is not working properly. I am getting output as aborted. </p> <pre><code>void UpdateData(string field_name,string updated_value,string search_value) { stmt-&gt;createStatement("UPDATE emp SET :1=:2 where search=:3")...
c++
[6]
1,060,415
1,060,416
php using files in the parent folder
<p>Is there any way to use a php file in the parent folder. I have a tree like this</p> <pre><code>\ - index.php - requirements.php \Learning Center - index.php </code></pre> <p>When in the root folder, I can call <code>./requirements.php</code>, but i cannot do this from inside the Learning Center folder. </p> <p>...
php
[2]
2,032,220
2,032,221
How to count online users on a website
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/568835/script-to-tell-me-who-and-how-many-users-are-online">script to tell me who, and how many users, are online</a><br> <a href="http://stackoverflow.com/questions/1822921/best-way-to-keep-track-of-current-onli...
php
[2]
2,749,308
2,749,309
finding the start and end index for a max sub array
<pre><code> public static void main(String[] args) { int arr[]= {0,-1,2,-3,5,9,-5,10}; int max_ending_here=0; int max_so_far=0; int start =0; int end=0; for(int i=0;i&lt; arr.length;i++) { max_ending_here=max_ending_here+arr[i]; if(ma...
java
[1]
519,688
519,689
jquery action on loading page
<p>I'm using a script which activates a light-box (popup). the popup decides whether the shopping basket has been filled correctly if it has then i wish it to close onload if not then the user has to click to acknowledged that something is wrong. I've got the click to close script working how could i use this script to...
jquery
[5]
2,637,104
2,637,105
Accessing Array Index OutSide The for Loop
<p>I have a problem in accessing the the value of <code>i</code> outside the for loop. At first I want to get 5 Names From User and after that wants to print all of them on the Screen using Arrays. Please Help.</p> <pre><code>public class Student { public static void main(String[] args) { Scanner input=n...
java
[1]
3,281,693
3,281,694
select content of div from certain offset
<p>I'd like to select all the contents of a division from a certain height, using the height as a sort of offset. I load data from a database, put it in a div, and then get the height of the div:</p> <pre><code>&lt;div id='gtheight' style='display:none;'&gt; &lt;!--content is returned from database here--&gt; &lt;/di...
javascript
[3]
2,809,709
2,809,710
What is a "wrapper" program?
<p>The place where I work has employees that use a third-party desktop program for their clients. This program saves data to a flat file. My colleague wants to write a Java program that uploads that flat file to a remote server, opens the desktop program when the flat file is downloaded from a Web site, and checks if...
java
[1]
5,776,478
5,776,479
How to extract separate bytes from a wav file?
<p>..and do some action, say, print an "a" the number of times as the number of bytes ??</p>
java
[1]
2,333,408
2,333,409
what's a common way to concat two dictionary given that no duplicate keys in two?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/294138/merging-dictionaries-in-c">Merging dictionaries in C#</a> </p> </blockquote> <p>My way is:</p> <pre><code>Dictionary&lt;string, int&gt; C =new[] { A, B }.SelectMany(x =&gt; x) .ToDict...
c#
[0]
1,432,811
1,432,812
Handling large datasets in charts quickely
<p>I have a large dataset(around 50000 points) which has be visualized in a line chart.The size of Canvas may vary according to the size of dataset. Massive amount of points makes the drawing too slow.It also results in cluttering and overlapping of points due to plotting of several points close to each other.So visual...
c#
[0]
1,275,592
1,275,593
What are the consequences of having a lot of packages in a Android Project App?
<p>I'm working on a Android project which six packages (which commanicate between them) with at least 5 classes in each of them.</p> <p>I'm trying to optimize my project in order to change my Application Structure and to make it as generic and reliable as possible. Thus, I'm trying to reduce the number of package.</p>...
android
[4]
5,661,503
5,661,504
Cloning a Java object
<p>I found <a href="http://stackoverflow.com/questions/869033/how-do-i-copy-an-object-in-java">this answer</a> about cloning java objects. However, with the approach in the accepted answer there, is the cloned object is totally a new instance? I mean not really a linked copy? </p> <p>I am asking this because the java ...
java
[1]
2,390,716
2,390,717
Which JavaScript libraries will handle popout windows (i.e. like Meebo or Gmail chat windows)?
<p>I could write this, but before I do, I wanted to check to see if there are existing solutions out there since it seems a lot of websites already do this, so I was wondering if there was a quick way to do this.</p> <p>Also, I am talking about "popout" windows, not "popup" windows. All JavaScript libraries support "...
javascript
[3]
3,269,071
3,269,072
Writing a simple array program in python
<p>I have a simple problem and the statement goes like this:</p> <p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... I want to create the numbers as above:</p> <p>The code that I am tryin...
python
[7]
700,094
700,095
python class definition
<p>some time i see some classes defined as subclass of object class, as </p> <pre><code>class my_class(object): pass </code></pre> <p>how is if different from the simple definition as </p> <pre><code>class my_class(): pass </code></pre>
python
[7]
3,609,320
3,609,321
How to get permission to use unlink()?
<p>I make a site and it has this feature to upload a file and that file is uploaded to a server</p> <p>Im just a newbie to php I download xampp and I run this site that i made in my local machine. My site is like this you upload a file then that file will be uploaded to a server, but when i tried unlink() because whe...
php
[2]
3,543,468
3,543,469
How to format Time and String value in Java's String formatter
<p>Using Java String.format() how do I format a string to result in "Time - userId" (ie. 3:02 pm - joe user).</p> <p>I have worked several iterations, and I think it is the space between the minutes and the am/pm that is throwing me off. My last iteration is </p> <pre><code>String.format("%1$tl:%1$tM %1$tp - %2s", n...
java
[1]
3,797,831
3,797,832
Trasferring binary files through PHP
<p>[if you can find a better title for this question, please fix]</p> <p>I got an unlimited shared hosting plan [unlimited storage+bandwidth] where i wanna create a virtual online mp3 library. But the problem is the restriction from the hosting provider is </p> <h1>at most 40% of bandwidth can be mp3 or image files</...
php
[2]
441,088
441,089
How to get the list request from android to asp.net webservice?
<p>i have one webservice,use one webmethod,In android developer pass the request in List Example:</p> <pre><code>Itemid Itemname Date 1 aaaa 12/4/2013 2 bbbb 11/4/2013 3 cccc 10/4/2013 </code></pre> <p>How to get this request in webservice?..and how to receive this request? Advance thanks....
asp.net
[9]
2,582,024
2,582,025
One-of-a-kind objects
<p>I want to create a one-of-a-kind object for certain properties:</p> <pre><code>import java.util.HashMap; public class SourceLanguage { private final String name; private static HashMap&lt;String,SourceLanguage&gt; existing; private SourceLanguage(String name){ this.name = name; } pub...
java
[1]
2,815,757
2,815,758
remove an overlay in map
<p>I am showing current location using a red marker and some other set of location using a blue marker. After an operation, I have to remove some of the locations indicated using blue marker. Rest should be shown in the map itself. How will I do it?</p>
android
[4]
2,344,528
2,344,529
loading Tabbar controller from view controller
<p>I am working with a project in which I have to have a login page and after successful login we should have a tabbar view( I am using tabbar controller) when I try to load the tabbar controller using the following code.Nothing works out.</p> <p>LoginSuccess *viewController = [[LoginSuccess alloc] initWithNibName:@"L...
iphone
[8]
4,864,410
4,864,411
jQuery : button click event must fire on click, but happens on pageload. how to fix?
<p>I have a fiddle here - <a href="http://jsfiddle.net/hhimanshu/SDr3F/2/" rel="nofollow">http://jsfiddle.net/hhimanshu/SDr3F/2/</a> </p> <ul> <li>The left pane is already available</li> <li>I need that when I click on "search", the input box should show up with focus(an alert for time being) </li> </ul> <p><strong...
jquery
[5]
5,993,449
5,993,450
error while importing Tkinter in python
<p>I get the following error while importing Tkinter:</p> <pre><code>Python 2.7.1 (r271:86832, Jun 11 2011, 11:34:27) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import Tkinter Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;modul...
python
[7]
3,098,231
3,098,232
Format string as currency
<p>I have <code>string</code> variable that contain price. For example, <code>10000</code>. I want use a space for thousand separator.<br> e.g. display <code>10000</code> as <code>10 000</code>, <code>150000</code> as <code>150 000</code><br> How can I do this? </p>
c#
[0]
3,748,982
3,748,983
Using a href can we call a function from a file using javascript or jquery..?
<p>I want to call a function from a file using href. Below is my javascript code:</p> <pre><code> function createtable() { function displaytable(argument) { var tr=document.createElement('tr'); for (var i=0; i &lt; argument.length; i++) { var td=document.createElement('td'); if (i == 0) { ...
javascript
[3]
5,023,980
5,023,981
take specific data from a list in php
<p>I have a string like this: </p> <pre><code> house1- a normal house house2-an office house3-a scholl </code></pre> <p>There are about 2000 lines. I want to get only house1,house2,house3 etc. from that it and put it in another file. Like:</p> <pre><code> house1 house2 house3 </code></pre> <p>I underst...
php
[2]
3,264,024
3,264,025
MotionEvent.Action_UP fails
<p>I am writing a simple code on ontouchevent..the code is</p> <pre><code>class MyTouchListener implements View.OnTouchListener{ @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub if(event.getAction()==MotionEvent.ACTION_DOWN) ...
android
[4]
5,559,515
5,559,516
List structure for c++ game
<p>I'm making a very very basic game in C++ to gain some experience in the language and I have hit a bit of a brick wall in terms of progress.</p> <p>My problem is, while I was designing a class for the player's weapons, I realized I required a list, as I will only have a certain number of weapons throughout the game....
c++
[6]
1,056,244
1,056,245
can i get low or high wifi connectivity in android
<p>can i get low or high wifi connectivity. I mean can i measure the signal level from 1 to 5.(assume only one network). i used calculatesignallevel. but it either returns 0 or 1. kindly, help me out</p>
android
[4]
6,000,842
6,000,843
Writing files with php
<p>I have written a php script to generate files of random text. Everything works fine but I can only generate about 200 at a time. After that, the script just stops incrementing and I have to go and adjust the start and stopping points in the loop and then rerun it. This would be fine if I only wanted a few hundred, t...
php
[2]
1,607,419
1,607,420
Difference between Python Generators vs Iterators
<p>What is the difference between iterators and generators? Some examples for when you would use each case would be helpful.</p>
python
[7]
72,716
72,717
How to check whether an application can be uninstalled?
<p>I use the <strong>PackageManager</strong> to get the list of installed Android applications. But some stock applications cannot be uninstalled from the device. How do I check for those programmatically?</p> <pre><code>Intent i = new Intent(Intent.ACTION_MAIN, null); i.addCategory(Intent.CATEGORY_LAUNCHER); PackageM...
android
[4]
3,912,714
3,912,715
Non-urgent Android layout id attribute quirk
<p>I'm working on a couple of apps at the moment while I try to learn my way around the Android SDK. I had a bit of trouble recently with my layouts where I was defining, for example, an EditText element as such...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://sche...
android
[4]
83,610
83,611
the operation could not be completed
<p>I am getting "The Operation Could not be Completed" error while adding the ajax control from tool box to the design page .</p> <p>How to solve this problem . Can anybody help me in this .</p> <p>Thanks in advance</p>
asp.net
[9]
3,771,148
3,771,149
AppendTo, does it change the DOM?
<p>I have two list boxes and some JQuery function that does the following:</p> <pre><code> $(document).ready(function () { //If you want to move selected item from fromListBox to toListBox $("#AddButton").click(function () { $("#fromListBox option:selected").appendTo("#toListBox"); }); }); </code></...
jquery
[5]
3,849,271
3,849,272
None Type issues in Python 2.6
<p>I'm doing a script where I get some values from a Database but sometimes this value can be None, but when I assign it to a variable and try to compare it I get this error:</p> <pre><code>TypeError: 'NoneType' object is unsubscriptable </code></pre> <p>I've already tried this:</p> <pre><code>if sgSlate[ 'sg_client...
python
[7]
1,711,085
1,711,086
Save previous preferences/choices using PHP
<p>This is my first question here, probably a very simple one but I can't really find how to do it.</p> <p>When I tried to google it, I only came across cookies and sessions, but I don't know how to use them, and was hoping there was a more simple way. I only started with PHP today.</p> <p>On the following page I wan...
php
[2]
4,120,091
4,120,092
C#,ASP.NET: Formatting a GRIDVIEW row Based on Content
<p>Greetings Gurus. I have a gridview who's rows I need to higlight if the 'Status' field is null. The code below throws an exception. I'm getting a "Non-invocable member 'System.Web.UI.WebControls.GridViewRow.DataItem' cannot be used like a method". I think I'm really close but I don't know where to turn next.</p> <p...
asp.net
[9]
5,707,633
5,707,634
How can i reach frame title inside Handler
<p>I can't reach my title inside Handler.</p> <p>Example of my code:</p> <pre><code>public Frame extends JFrame { public Frame() { super("Frame 1"); . . . </code></pre> <p>There needs to be a button in my GUI and whenever you click it, it needs to change the title from Frame 1 to Frame 2...
java
[1]
5,671,486
5,671,487
Data binding on combo box
<p>I am adding items to a combo box as given below:</p> <pre><code> readonly Dictionary&lt;string, string&gt; _persons = new Dictionary&lt;string, string&gt;(); .... //&lt;no123, Adam&gt;, &lt;no234, Jason&gt; etc.. foreach (string key in _persons.Keys) { //Adding person code cmbPaidBy.It...
c#
[0]
3,302,438
3,302,439
Altitude value in iphone 3GS
<p>I am using CLLocation to get altitude values. It is working fine with iphone4. But it takes long time to get the value in iphone 3GS (more than 5 min). I checked it using wi-fi on and off. In both cases, the output is same. Please help.</p>
iphone
[8]
5,656,875
5,656,876
Remove precision from divide
<p>well basically if I write something like this -</p> <pre><code>float a = 0; a = (float) 1/5; a += (float) 1/9; a += (float) 1/100; </code></pre> <p>It will automatically decrase precision to 2 digits after comma, but I need to have 5 digits after comma, is it available to create, so it displays 5 digits? With setp...
c++
[6]
5,129,527
5,129,528
Add image view to sub class in Android?
<p>In my sub class I am trying to add an image View:</p> <pre><code>ImageView image = new ImageView(this); </code></pre> <p>But it breaks the app. I think it is because of the 'this' param.</p> <p>Does my class need to extend something? At the minute it extends Activity.</p>
android
[4]
5,555,356
5,555,357
Monty Python References in the Python Language/ Community
<p>Its quite well known that Python gained its name from the BBC show Monty Python's Flying Circus, but I just recently realized that the ide that is usually packaged with it, Idle, is also a reference (it became obvious when I found out about the Eric ide). I'm sure that there's other ones too. Is anyone aware of any...
python
[7]
5,490,674
5,490,675
Read temperature of a 1-wire device connected to a HA7E
<p>I am trying to read the temperature of a 1-wire device by issuing ascii commands to the 1-wire adapter. The problem is the ser.write('W0144') requires a carriage return but the code isn't sending it for some reason. The command ser.read(32) returns A69000001CFD7E328 when it should return 44 (from HA7E ascii command...
python
[7]
2,956,695
2,956,696
Unable to set background for a surface view in android
<p>I am streaming video from a http url.i have a surface view for this purpose which u can see below</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fi...
android
[4]
936,876
936,877
Checking querystring for a not null value using JS
<p>Is it possible to check a querystring for a not null value using javascript? Can you show me an example on how to do this?</p> <p>Like the IF clause of this snippet:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["someParameter"])) ...
javascript
[3]
5,860,286
5,860,287
Enumeration methods
<p>Enumeration interface has method hashMoreElements is used with refrence variable (Enumv), how can they be used since they are not implemented ? I meant it is an interface method so how can it be called - Enumv.hasMoreElements() it does not have a implementation .</p> <pre><code>Vector v = new Vector(); //v contains...
java
[1]
5,845,682
5,845,683
Why the List is not updated and why the var w is all the time null?
<p>In the button 8 click event i did:</p> <pre><code> private void button8_Click(object sender, EventArgs e) { if (buttonLockMode == true) { trackBar1.Enabled = true; button8.ForeColor = Color.Red; button8.Enabled = false; ...
c#
[0]
1,388,511
1,388,512
How do you walk through the directories using python?
<p>I have a folder called notes, naturally they will be categorized into folders, and within those folders there will also be sub-folders for sub categories. Now my problem is I have a function that walks through 3 levels of sub directories:</p> <pre><code>def obtainFiles(path): list_of_files = {} for elem...
python
[7]
5,468,693
5,468,694
Removing the values using JQuery
<p>I need to remove some values from a hidden and text input box using JQuery, but somehow this is not working</p> <p>Example:</p> <pre><code>&lt;input type="hidden" value="abc" name="ht1" id="ht1" /&gt; &lt;input type="text" name="t1" id="t1" /&gt; </code></pre> <p>I use the following JQuery code to remove the valu...
jquery
[5]
4,137,384
4,137,385
Read and write bytes from a file (c++)
<p>I think I probably have to use an fstream object but i'm not sure how. Essentially I want to read in a file into a byte buffer, modify it, then rewrite these bytes to a file. So I just need to know how to do byte i/o. Thanks</p>
c++
[6]
2,913,112
2,913,113
Basic ImageButton onClick event not firing - surely something simple?
<p>I'm trying to get a simple onClick to fire from an ImageButton - it seems like a simple enough task, but I'm obviously missing something here.</p> <p>Here is my java file:</p> <pre><code>package com.jlbeard.android.testapp; import android.app.Activity; import android.os.Bundle; import android.view.View; im...
android
[4]
5,342,856
5,342,857
How to loop through the index of a list in python?
<p>I'm trying to write to a file, with the first line being [0] in the list, 2nd line being [1], etc.</p> <p>Here's a quick example</p> <pre><code>crimefile = open('C:\states.csv', 'r') b = crimefile.read() l = b.splitlines() print l[1] states = open('c:\states.txt', 'w') states.write('"abc"' + " " + '%s' '\n' %l[0+...
python
[7]
1,085,585
1,085,586
The following code not working in android?
<pre><code>details.replaceAll("null", " "); </code></pre> <p>In the above code i am getting the String details from the database and it may get values of the form : <strong>null,null,null,null</strong>.</p> <p>In order to remove all the "null" from the string i am using the above code, but it is not working.</p> <p>...
android
[4]
5,707,779
5,707,780
beginner: python subprocess.call with hundreds of args
<p>Disclaimer: I am a beginner in python but have Drupal programming experience.</p> <p>I have this:</p> <pre><code>f = ['/path/1.jpg', '/path/2.jpg', '/path/3.jpg'] #less than 1500 files </code></pre> <p>and I need to do this</p> <pre><code>call(['c:/program files/ABBYY FineReader 10/finereader.exe'] + f) </code><...
python
[7]
5,389,948
5,389,949
Java executes "if" block when condition is demonstrably false
<p><img src="http://i.stack.imgur.com/qGJtM.png" alt="Screen shot of my problem."></p> <p>This pretty much says it all. <code>paneNum</code> is 0. Test for <code>paneNum &lt; 0</code> is apparently <code>true</code> since the instruction pointer is inside the if-block, and the function returns <code>false</code>.</p> ...
java
[1]
5,217,398
5,217,399
JQuery can I display the result then have it fade away?
<p>Is there a way I can display the result and then have it fade away after about 10 seconds or something using JQuery?</p> <p>Here is the code.</p> <pre><code>function stop(){ $.ajax({ type: "GET", url: "http://update.php", data: "do=getSTOP", cache: false, async: false, ...
jquery
[5]
2,204,795
2,204,796
C++ program that reads from file and performs bitwise operations
<p>I'm not asking for code I'm asking for help. yes it is for a project for class.</p> <p>Program reads a .txt file that contains something like this,</p> <ul> <li>NOT 10100110</li> <li>AND 00111101</li> </ul> <p>Program needs to read the operator and perform a function according to that operator to alter the byte. ...
c++
[6]
1,123,398
1,123,399
Comparing two objects .
<p>If i have a complex object, what is the best practice pattern to write code to compare 2 instances to see if they are the same</p>
c#
[0]
5,834,927
5,834,928
Can we run flash file from java through pure java code?
<p>I have a requirement to run flash file from java application so that it can be used any where as a runnable jar file. Also this should be in pure Java (for example should not have to use a Windows dll)</p> <p>I tried to do the same and only thing I found on net is through JFlashPlayer which is platform dependent as...
java
[1]
5,118,420
5,118,421
Is empty enum ( enum{}; ) portable?
<pre><code>class Test { enum{}; ... }; </code></pre> <p>Is this empty enum definition portable? Compiles in gcc and and msvc.</p>
c++
[6]
5,862,115
5,862,116
Conversion to special characters (example from "&aelig;" to "æ")
<p>I want to save files which will have name with danish characters, for example "Helloæ".</p> <p>The string which saves the filename has this value: <code>Hello&amp;aelig;</code></p> <p>How to make it convert <code>&amp;aelig;</code> to <code>æ</code> ? This question isn't just about the "æ" characters, but for all ...
c#
[0]
3,349,507
3,349,508
how to connect backgroud thread if i am lunching my GUI thread again in Android
<p>i have 2,3 parallel running background process in my application. when i exit from the application how to connect my GUI thread with background processes again. i am using Async task for my background process since i have to update my progress bar on GUI. </p>
android
[4]
4,827,509
4,827,510
Direct parameter Vs passing a class
<p>Assume that there is a class with 3 attributes.</p> <p>Employee</p> <ol> <li>Name</li> <li>Age</li> <li>Sal</li> </ol> <p>I have a webmethod, <code>GetInfo</code>.</p> <p>Does it make any difference with regard to performance for passing direct param vs. direct classs?</p> <pre><code>GetInfo(Employee emp) // Th...
c#
[0]
4,651,541
4,651,542
Android Java, bitmap from resources
<p>I have my images in my res/drawable folder, there's no problem about that. The thing is, i'd like to be able to do something like this:</p> <pre><code>Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.*img[contar]*); </code></pre> <p>In other words eclipse doesn't let me do this <code>img[co...
android
[4]
1,530,847
1,530,848
Python: How to define a function that gets a list of strings OR a string
<p>Let's say I want to add a list of strings or just one to a DB:</p> <pre><code>names = ['Alice', 'Bob', 'Zoe'] </code></pre> <p>and I want that <code>add_to_db</code> will accept both cases</p> <pre><code>add_to_db(names) add_to_db('John') </code></pre> <p>Is this the correct way to go:</p> <pre><code>def add_to...
python
[7]
5,099,553
5,099,554
How to get comma seperated values from the string in php
<p>I have a string <code>$employee="Mr vinay HS,engineer,Bangalore";</code>. i want to store Mr vinay H S in <code>$name</code> ,engineer in <code>$job</code> and Bangalore in <code>$location</code>. how to do this </p>
php
[2]
1,667,921
1,667,922
How do i get count of an unknown attribute in a JSON object without a loop
<p>eg. </p> <pre><code>var myObject = { 'item_123': { 'id': 1, 'name': 'Some name' }, 'item_789': { 'id': 2, 'name': 'Another name' } }; </code></pre> <p>The number part of the item attribute/object is not known before hand since they are unique ids and are auto genera...
javascript
[3]
3,001,517
3,001,518
Comparing Java Beans with BeanComparator
<p>I am trying to compare 2 beans of the same class and determine what part of the beans (if any) do not match. This may include beans with internally nested beans of another class, but for the most part the classes will be matching. Basically I want to derive the first class from the database and compare it with a new...
java
[1]
5,584,798
5,584,799
why the javascript code doesn't work?
<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;test&lt;/title&gt; &lt;sc...
javascript
[3]
2,382,634
2,382,635
How to use multiple listviews in a single activity on android?
<p>I have 9 listviews which should come under single activity. All the lists may/maynot display at a time on the screen (all at a time is nice)</p>
android
[4]
4,228,059
4,228,060
Legally avoiding popup blocking
<p>What is causing some browsers to see my code as unsolicited?</p> <p>I have a web site devoted to helping people with interactive sessions. It starts with the user clicking [Begin] so this is a consented action. This should (1) open a popup while (2) redirecting the first page to a end page as below : </p> <pre><co...
javascript
[3]
3,101,610
3,101,611
How can I read a file that is in use by another process?
<p>I need to read a file that is in use by another process. How can I achieve that in C#?</p> <p>Thanks!</p>
c#
[0]
1,953,349
1,953,350
Logview in Imshow
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/13478460/logarithmic-yscale-in-imshow">Logarithmic yscale in imshow</a> </p> </blockquote> <p>In my imshow view, I want the logarithmic scale in the <code>y</code>. the answers like <code>yscale('log')</code> is...
python
[7]
1,580,225
1,580,226
Is it possible to undefine a javascript method?
<p>Specifically I am needing to unset a function in mootools for one page that is conflicting with a FB.ui. But I don't want to do anything drastic such as permanently remove that function as it would break the rest of the site.</p>
javascript
[3]
2,877,403
2,877,404
TextView highlighting text doubts
<p>I am doing a bible application ,i have completed the displaying of verses in textview.I became struck when i tap a verse i shouldn't highlighted.I didn't know how to do this.I provide a image url to show that i want exactly like this. Thanks in advance</p> <p><img src="http://i.stack.imgur.com/YCzUl.jpg" alt=".imag...
iphone
[8]
1,318,445
1,318,446
Use more than one font to drawstring
<p>I want to use drawString to print a sentance but some parts of it has to be bold. What is the best way to do this? Yes, I have considered using two drawString. But is there a intelligent way of using two drawStrings if we have to.</p> <p>We cannot make any assumtion about the length of the sentance. However it is p...
c#
[0]
1,492,232
1,492,233
jQuery .delegate() not working on load and changeData events
<p>Can someone enlighten me on the jQuery delegate, what events are handled and what aren't. The follow code doesn't work</p> <pre><code>$("#browser").delegate( ".photo", { "load": function(e) { alert("photo loaded"); } }); </code></pre> <p>but the following code work</p> <pre><code>$(".photo").load(...
jquery
[5]
2,701,195
2,701,196
Best method for storing mysql passwords?
<p>What do you use? What are the benefits of using it?</p> <p>Gimme the lowdown on all the techniques, pros and cons all the tutorials don't tell you about.</p>
php
[2]
1,027,803
1,027,804
how to add items to resource file (resx) on run time?
<p>i have some global resource files that store my dictionary for app.<br> when a key is not in the resource file i return the key.</p> <pre><code>public Object MyGetGlobalResourceObject(string classKey, string resourceKey) { try { if (GetGlobalResourceObject(classKey, resourceKey) == n...
asp.net
[9]
4,558,725
4,558,726
Duplicate symbol Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
<p>ld: duplicate symbol _teapot_vertices in /Users/iphone/Library/Developer/Xcode/DerivedData/ImageTargets-cbbgriyhgpamtidfvkqsbglovpup/Build/Intermediates/ImageTargets.build/Debug-iphoneos/ImageTargets.build/Objects-normal/armv6/CC3ModelSampleFactory.o and /Users/iphone/Library/Developer/Xcode/DerivedData/ImageTargets...
iphone
[8]
1,201,499
1,201,500
How the code execute immediately without hit the button?
<p>I made a very simple Ajax test code snippet:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src='main.js'&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button id='get-content'&gt;Click&lt;/button&gt; &lt;p&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&g...
javascript
[3]
5,520,694
5,520,695
Android - ResolveInfo set preferredOrder of application
<p>The preferredOrder is a property of ResolveInfo class.</p> <p>How can I set the preferredOrder of the application, so that it can be accessed with the List of ResolveInfo collection while retrieving them from PackageManager object? Is there any tag or attribute in manifest of application where this can be set?</p> ...
android
[4]
5,459,017
5,459,018
How To Merge 3 lists into one dictionary(with unique elements)
<h3>Code Written In Python</h3> <blockquote> <p><code># Following Are The 3 Lists</code><br> <code>sections = ['A', 'B', 'A', 'A', 'B']</code><br> <code>students = ['Jack', 'Jim', 'Jack', 'Leena', 'Jim']</code><br> <code>subjects = ['Maths', 'Biology', 'Chemistry', 'English', 'Physics']</code></p> <p><cod...
python
[7]
1,677,068
1,677,069
Need to fetch all span values in a div as an array or string?
<p><strong>I need to fetch all span values in a div into array or string</strong></p> <pre> var tag_text_arr=$("#div_id span").each(function(){ return $(this).text(); }); </pre> <p>Actually i need to fetch all span values inside div and want to create a string like this </p> <p>span1_val|span2_val|span3_...
jquery
[5]
4,633,140
4,633,141
salted md5 password generated with spring different from salt md5 password generated in php
<p>I am using username as a salt for spring security however when I tried to do the similar case in php it generates a different hashed password. The following is my php code:</p> <pre><code>&lt;?php $un=$_POST['username']; $pw=$_POST['password']; $salt ='weiren'; $passw='enjoyit'; $pass=md5($passw....
php
[2]
2,040,301
2,040,302
dynamic binding gives lesser execution time than static binding
<p>Consider the following code:</p> <pre><code> import java.io.*; import java.util.*; class parent{ private static int static_count; final void static_display(){ for(int i=0; i&lt; 1000000; i++){ Object obj = new Object(); } System.out.println("Static method called...
java
[1]
3,454,069
3,454,070
JQuery cycle plugin - buttons
<p>Please Delete!! Dont really need it. All good after rechecked options</p> <pre><code>function validate_email_address($email = FALSE) { return (preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $email))? TRUE : FALSE; </code></pre> <p>}</p>
jquery
[5]
2,712,409
2,712,410
Memory leaking issue iPhone
<p>Anyone have a idea about solve memory leak issues</p> <p>i have found one memory related issue NSAutoreleaseNoPool(): Object 0x3588aea0 of class NSCFString autoreleased with no pool in place - just leaking</p> <p>can anyone have a idea about how can i solve..</p> <p>Thnak you</p>
iphone
[8]
2,505,717
2,505,718
how to start Android example project from command-line?
<p>I dislike using Eclipse and wish to start an example Android project from the command-line, how can i do this? Is there a way to use "android create project" command to automatically pull in example code from the SDK? A similar method to the following perhaps?</p> <pre><code>android create project --package com.exa...
android
[4]
2,139,559
2,139,560
DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
<p>I m running server on Linux console which written in C and creating client in android. i have not getting any error on DDMS but following Debug message come </p> <pre><code>11-12 20:38:06.787: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol </code></pr...
android
[4]
4,681,957
4,681,958
Jquery comparing background color
<p>I am using:</p> <pre><code>var element = $(this).parents("tr:first"); if (element.css("background-color")=="black)") element.animate({ backgroundColor: "white" }, 1000); else element.animate({ backgroundColor: "black" }, 1000); </code></pre> <p>To change background color, but comparision seems to fail, I ...
jquery
[5]
327,675
327,676
how to generate sound program for capctha in php
<p>I am making API like recapctha.I am hanging to make coding for sounde system for this API.</p> <p>What is the concept behind to make this code? Id it possible to make this is javascript ?</p>
php
[2]
1,656,059
1,656,060
what is NSParameterAssert?
<p>what is NSParameterAssert?can anyone explain with example?</p>
iphone
[8]