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
83,042
83,043
php mktime AMPM value wrong
<p>I'm trying to get the next minute value in php by doing the following.</p> <pre><code>$one_minute_later = mktime(date("g"), date("i")+1, date("s"), date("n"), date("j"), date("Y")); $send_month = date("n", $one_minute_later); // Numeric representation of a month, without leading zeros $send_day = date("j", $one_m...
php
[2]
2,129,688
2,129,689
Customized Toast or something else?
<p>Sorry for my bad english. I need help.</p> <p><a href="http://habrastorage.org/storage2/605/02c/601/60502c60140c90bcd61829a1cdee9af8.png" rel="nofollow">image with view component</a></p> <p>What is the element with "Drag apps to your ..." text on Adroid emulator? Customized Toast or ... what?</p>
android
[4]
2,066,326
2,066,327
How can you delete running characters at the end of a string?
<p>Say I had parsed a large number like <code>130,233,320,000,000,000</code> into <code>130,233,320,,,</code> how could I recursively delete the substring of running commas to get the output like <code>130,233,320</code></p> <p>A recursive algorithm seems easy like:</p> <pre><code>public String parseEnd(String s) { ...
java
[1]
2,407,870
2,407,871
Google map application
<p>I am trying to do a google map related application.While doing that application i got some problems.This is my xml file</p> <pre><code> &lt; LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;com.google.android...
android
[4]
1,817,064
1,817,065
PHP header in a loop
<p>Is it possible to "call" a PHP script in a loop like this ?</p> <pre><code>... while (...) { ... header("Location:myscript.php"); ... } ... </code></pre>
php
[2]
1,897,060
1,897,061
Confusing Javascript class declaration
<p>I have some third-party Javascript that has statements like this:</p> <pre><code>FOO = function() { ...functions() ... return { hash } }(); </code></pre> <p>It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?</p>
javascript
[3]
4,291,900
4,291,901
Alignment in android
<p>I am new to android, currently designing a User Home Page. please let me know how to align UI controls like - Button , EditText, etc to left/right/center in Linear and List Layout. button code eg. </p>
android
[4]
5,331,335
5,331,336
Downloading Android source
<p>I am following the instructions mentioned at: <a href="http://source.android.com/source/downloading.html" rel="nofollow">http://source.android.com/source/downloading.html</a> to download the source code (master and not a specific branch) on Ubuntu 11.10 but the download is stuck at 99% (240/242) for more than 4 hour...
android
[4]
1,567,889
1,567,890
iPhone : Wait for users to complete or dismiss view in AppDelegate
<p>I'm in the process of adding a method that changes core application settings and as a result needs to be initiated very early in the code execution, this will only be displayed during the development phases of the application.</p> <p>I've created a view that allows the users to set / change the required settings an...
iphone
[8]
240,960
240,961
When to use the Value keyword in C#
<p>I am using a <a href="http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx" rel="nofollow">custom serializer</a> in c# in order to serialize/deserialize an object with a dictionary. However during the deserialization the dictionary object was not being set correctly. See code:</p> <pre><code>public Dicti...
c#
[0]
125,568
125,569
Android How to display 1 out of 54 card images in a ImageView
<p>I'm trying to figure out the best way to display 1 of 54 bitmaps in a <code>ImageView</code> . I figured I could load in a bitmap from the assets. But I can't figure out how to size it. When it loads it from the <code>XML</code> file, it chooses 1 of 3 different bitmaps, each a different size. </p> <p>I can't fi...
android
[4]
141,681
141,682
What's wrong with my memcpy?
<p>I have written a function to implement memcpy</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;iostream&gt; char *memcpy(char *dest,char *src,int n){ char *ch=dest; while (n--) *ch++=*src++; return dest; } int main(){ char *src="geo...
c++
[6]
5,693,095
5,693,096
How to calculate the sum of values in a list PHP
<p>I have a variable list.</p> <pre><code>echo $variable; // shows 1 5 7 8 </code></pre> <ol> <li>How can I calculate the sum of these numbers?</li> <li>How can I convert this list into an array?</li> </ol>
php
[2]
1,986,974
1,986,975
php call to undefined function (beginner on classes)
<p>I have 2 files index.php and class_lib.php.</p> <p>Here is index.php</p> <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-Ty...
php
[2]
2,760,746
2,760,747
Can Python test the membership of multiple values in a list?
<p>I want to test if two or more values have membership on a list, but I'm getting an unexpected result:</p> <pre><code>&gt;&gt;&gt; 'a','b' in ['b', 'a', 'foo', 'bar'] ('a', True) </code></pre> <p>So, Can Python test the membership of multiple values at once in a list? What does that result mean?</p>
python
[7]
484,267
484,268
Reusing functionality in Javascript
<p>I created a page on which there's a red square that can be moved by a mouse. I would like to find out how I can reuse Javascript to have more than 1 square. In the following fiddle <a href="http://jsfiddle.net/sbel/utM5k/" rel="nofollow">http://jsfiddle.net/sbel/utM5k/</a> I show that in HTML on top I include the ...
javascript
[3]
5,657,561
5,657,562
jquery, need similar functionality of disable for select optoins
<p>I am using coding like this:</p> <pre><code> \$(this).attr("disabled", 'disabled'); \$(this).removeAttr("disabled"); </code></pre> <p>This would only disable the option. I want to have the same accessibility and coding but I would prefer to make it invisible on the drop down menu instead...
jquery
[5]
5,211,386
5,211,387
Can I register external JS files on a page via Javascript?
<p>In my CMS I add modules to the page via Javascript, these modules may include external JS files which get registered on page load into a collaborated external file. </p> <p>When the modules are added via JS these scripts are therefore not registered until the page is reloaded. </p> <p>Is there a way for me to regi...
javascript
[3]
5,228,802
5,228,803
Unpredictable Output in C++
<p>Here is a sample of source code</p> <pre><code>#include &lt;iostream.h&gt; #include &lt;conio.h&gt; #include &lt;math.h&gt; int main() { int i=2,a; a= pow(10,i); int b=0; b+=a; cout&lt;&lt;b; getch(); } </code></pre> <p>The ouput I expect is <code>100</code> as it is clear. But the compile...
c++
[6]
1,319,781
1,319,782
State_pressed change color of a view
<p>I have this <code>selector</code> xml file which is applied to a <code>RelativeLayout</code> as a background element:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_pressed="true"&gt; &lt;shap...
android
[4]
1,734,724
1,734,725
How-To Read Address Book (Wab) Files With C#
<p>How-To Read/Extract addresses from Outlook Address Book (Wab) Files With C#</p>
c#
[0]
5,849,304
5,849,305
How can the wikipedia api hide their source code?
<p>I have a wiki api site: <a href="http://en.wikipedia.org/w/api.php" rel="nofollow">http://en.wikipedia.org/w/api.php</a></p> <p>when I save the api.php, I can't see any post or get method behind that.... but I try to write a simple php program.... like this</p> <p>test.php:</p> <pre><code>&lt;?php echo("testing")...
php
[2]
3,472,072
3,472,073
Add one week to Date()
<p>How do I add 1 week to a date function with separate date variables. The date needs to be separate so I can insert it into another form. If I cant do it as separate variables can i separate them afterwards?</p> <p>So:</p> <pre><code>$year = date("Y"); $month = date("m"); $day = date("d"); echo 'Current Date' . $ye...
php
[2]
4,489,648
4,489,649
Recommend Some Beginner's Books For Programming In Python
<p>I have no programming background, none at all. I don't know C/C++, Java, PHP, JS... absolutely none. But I am starting out like this: <code>Linux &gt; Python &gt; Shell Scripting &gt; PHP</code>. Does this look good?</p> <p>Okay, since I am basically starting with Python in programming, I would need the most basic,...
python
[7]
2,943,121
2,943,122
Changing the path of getClass().getResourceAsStream(PATH) in runtime
<p>Is it possible to change the PATH of the Java code <code>getClass().getResourceAsStream(PATH)</code> in runtime? I would like to have an edit box so that the user can specify i.e <a href="http://site.com/image.png" rel="nofollow">http://site.com/image.png</a> for the PATH.</p>
java
[1]
5,321,554
5,321,555
Serializing to JSON in jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/191881/serializing-to-json-in-jquery">Serializing to JSON in jQuery</a> </p> </blockquote> <p>I know how to serialize an object to JSON in ASP.NET Ajax, but I'm trying to do things on the client in a less Micros...
jquery
[5]
927,477
927,478
Access a file within a folder with spaces in the name in PHP
<p>I would like to open a file inside a folder in PHP. The problem is that the folder that contains the file may have spaces in the name. The code I use to open the file (and doesn't work) is the following:</p> <pre><code>$myFile = "path/to the/file.txt"; $myFile = str_replace(' ', '\ ', $myFile); $fh = fopen($myFile,...
php
[2]
1,268,584
1,268,585
PHP readfile() adding extra bytes to downloaded file
<p>I am trying to troubleshoot an issue I am having with downloading a "zip" file from a php script. It seems that when I download the file using the following code, the downloaded file has an extra 0A09 appended to the beginning of the file, causing winzip to throw a corruption error.</p> <pre><code>&lt;?php $pagePe...
php
[2]
5,239,460
5,239,461
how to reload the selected tab jquery
<p>how to reload the selected tab actually i having problem in reloading part. when i add my data i'll successfully saved in datatable but in id field in database it shows proper id but when i add the detail its not shows id in datatable.</p> <p>(before refresh the summary tab) here is example it shows something like ...
jquery
[5]
3,015,658
3,015,659
Intercept the fetching of properties / methods of a javascript object
<p>How/Can I intercept a request to get a method/property on an javascript object and return a custom value instead.</p> <p>For example,</p> <pre><code>var obj = { // This "get" method is where I want to replace the call to get a property of an object. get : function(propertyName) { if (propertyName =...
javascript
[3]
2,904,895
2,904,896
Make javascript that redirects after opening a popup
<p>I have the following constantcontact form they provided, After they click on submit, it opens a constant contact page. However I would like that it redirect also to a page after they click on submit</p> <pre><code>&lt;form name="ccoptin" action="http://visitor.r20.constantcontact.com/d.jsp" target="_blank" method="...
javascript
[3]
5,758,492
5,758,493
iPhone replacement control for three radio buttons - opinions?
<p>I have a scenario where we need to present the user with a question that has three possible answers. Yes/No/Don't know. Normally on a web form I would use three radio buttons for this. What - in your opinions - would be the best solution for an iPhone native app...</p> <p>I looked at the segmented control but it do...
iphone
[8]
3,786,795
3,786,796
How is a SyncAdapter triggered by the system?
<p>I have an application which uses a SyncAdapter to make a REST call to remote server, then use a Content Provider to persist the updates to the local SQLLite DB. </p> <p>I can trigger the call by going the Accounts &amp; Sync, then selecting my adapter, and using the Resync button to trigger the call</p> <p>How doe...
android
[4]
2,556,015
2,556,016
I cant figure out how to set my random number between 1 and 100
<p>I just want to make a basic counter and for some reason I cant figure out how to draw a random number between 1 and 100? Can someone please explain what I have to do to draw a random number between 1 and 100.</p> <p>This is what I could come up with until now:</p> <pre><code>int value; private int count = 1; Ran...
android
[4]
4,506,219
4,506,220
How to change page location at run time
<p>I have portal where lot of master page and all related page in root.</p> <p>When user register his self then it will create a folder and copy all related file into the folder.</p> <p>root master page and page url</p> <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="Layoutmaster.master.cs" I...
asp.net
[9]
2,969,591
2,969,592
Loading an outbuffer to a string in javascript?
<p>How to load the output buffer into a string using javascript ?</p> <p>for example in php</p> <pre><code>&lt;?php ob_start(); ?&gt; hello world ! &lt;?php $string = ob_get_contents(); ?&gt; </code></pre>
javascript
[3]
775,252
775,253
PHP SQL Query ERROR in a select statement
<pre><code>$id = $_POST['idn']; $con=mysqli_connect("localhost","root","xyz","patient"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $query = "SELECT count(*) FROM record WHERE ID='$id'"; $count = mysql_result(mysql_query($query),0); if($count &gt; '0') { id exist } els...
php
[2]
1,335,039
1,335,040
compare dates with time in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/492994/compare-dates-with-javascript">Compare dates with JavaScript</a> </p> </blockquote> <p>I want to find which one is greater from 2 dates with time that is in the following format in javascript</p> <p>date...
javascript
[3]
3,571,880
3,571,881
Jquery intersect selector
<p>I'm sure the answer exists on SO somewhere, but I'm at a loss for what terminology to search for. So apologies if this is a duplicate.</p> <p>Is there an easy way in jQuery/JS of selecting the elements that "intersect" from the following HTML?</p> <pre><code>&lt;div id="first"&gt; &lt;div id="source-AAA"/&gt; ...
jquery
[5]
2,092,722
2,092,723
Looking for relevant hobby projects for getting started with C#
<p>I am an experienced software developer in other less common technologies, and now need to ramp up C# skills with VS2010. As an experienced developer, I understand the syntax and language of C# quite quickly. </p> <p>However, developing windows and web applications with C# is somewhat foreign to me. Can someone plea...
c#
[0]
3,661,725
3,661,726
Current date should add 12 hours more in android
<p>In my application i want to add 12 hours with the current date and time,then i have to show it in this format "yyyy-MM-dd HH:mm:ss". I wrote the code but unable to add 12 hours. How can i do? please help. </p> <p>My code is :</p> <pre><code>Calendar cal = Calendar.getInstance(); Date date = cal.getTime...
android
[4]
5,094,341
5,094,342
C#: Selecting particular index values from a list
<p>I am looking for a way to search a list that returns me an bunch of indexes based on a search i make on that list. For ex i have a comma separated string list as follows:</p> <pre><code>Blue, 3 Red, 3 Blue, 1 Blue, 9 Red, 5 </code></pre> <p>I want to make a search that returns me indexes of all elements EXCEPT any...
c#
[0]
4,911,623
4,911,624
get/set Accessors the correct scope
<p>i created a class called ProfileHelper, and I can't seem to get my get/set accessors correct; instead, I'm getting red lines on both get and set. Here is the code I am trying to use:</p> <pre><code>public static String UserName(string columnName) { get { using (SqlConnection cn = new SqlConnection...
c#
[0]
3,309,785
3,309,786
Addition of textarea (int) values
<p>I'm facing a little problem with my jQuery / Javascript code.</p> <p>I have several values on a page, like :</p> <pre><code>checkbox EXAMPLE EXAMPLE 150 checkbox EXAMPLE EXAMPLE 300 checkbox EXAMPLE EXAMPLE 300 </code></pre> <p>I have this little code, which basically just add the numerical values (150, 300, 300)...
jquery
[5]
2,219,648
2,219,649
Which is Faster and better, Switch Case or if else if?
<p>Which is the better and fastest methods : if or switch ?</p> <pre><code>if(x==1){ echo "hi"; }else (x==2){ echo "bye"; } switch(x){ case 1 ... break; default; } </code></pre>
php
[2]
1,472,607
1,472,608
Passing different number of arguments into function
<p>I have a function:</p> <pre><code>def save(self, text, *index): file.write(text + '\nResults:\n') if index == (): index = (range(len(self.drinkList))) for x in index: for y in self.drinkList[x].ing: file.write('min: ' + str(y.min) + ' max: ' + str(y.max) + ' value: ' + str(y.perc) +...
python
[7]
4,131,703
4,131,704
Why is return value of queue:front() valid after queue::pop()
<p>I am new to C++ and ran into following <em>supposedly</em> bug, but somehow my program just works.. Here is the code</p> <pre><code>#include&lt;iostream&gt; #include&lt;queue&gt; #include &lt;string&gt; int main() { string s ("cat"); queue&lt;string&gt; _queue; _queue.push(s); string &amp; s1 = _queue.front(...
c++
[6]
2,226,108
2,226,109
How to integrtate skype in android app?
<p>Am developing and android app and i want to integrate skype in my application can you please help me?</p> <p>thanks in advance</p>
android
[4]
2,547,765
2,547,766
how to count application successfull launches programmatically android?
<p>I want to count my application launches and after some launches i need to request user to give feed back.So how to count launches?</p>
android
[4]
950,865
950,866
Library used to make CCleaner
<p>What kind of library has been used to make CCleaner?</p>
c++
[6]
5,612,930
5,612,931
Insert each array into separate divs
<p>I just need some advise before i start this. Basically I have an array of data of books from mysql - ID,Name,genre,ratings they are print out in an array like this</p> <pre><code>Array ( [book] =&gt; Array ( [0] =&gt; 1 [1] =&gt; book one [2] =&gt; horror [3] =&gt; 8.9 ) ) Array ( [book] =&gt; Array ( [0] =&gt; 2 ...
php
[2]
2,648,055
2,648,056
How to persist data in a broadcast receiver
<p>I have a simple broadcast receiver which receives some data which I would like to store for the application to use on next launch. It is just a few strings so simplicity is the goal. Normally I'd just write to to a file or sharedPreferences but not being an activity that seems incorrect.</p> <p>Thoughts?</p> <p>--...
android
[4]
5,200,588
5,200,589
C# Array of Controls
<p>Basically I have 3 arrays of different types:</p> <pre><code>control = new Control[2] { txtRecordDelimeter, txtFieldDelimeter }; name = new string[2] { "Record Delimiter", "Field Delimiter" }; exists = new bool[2] { false, false }; </code></pre> <p>...essentially I would like to create a loop that checks whether t...
c#
[0]
274,645
274,646
Determining if a set of points are inside or outside a square
<p>I have two of these:</p> <pre><code>bool isPointOnShape(int a, int b) { } bool isPointInShape(int a, int b) { } </code></pre> <p>Say I have a square, first point (bottom left corner) is x,y (0,0) second point (top left) is (0,2), third is (2,2) and fourth is (0,2).</p> <p>The Points on shape would be (0,1) (1,...
c++
[6]
4,515,231
4,515,232
How to count how many inputs collect this function?
<p>How to count how many inputs collect this function and if is not 4 then displays alert with some information?</p> <pre><code> $('#dialog').on('show', function () { $('form#form_save_account input:visible').each(function(idx, $input) { $('#dialog .bank-data .' + $input.name + ' .value').text($in...
jquery
[5]
36,456
36,457
How to export to excel jquery grid data using jquery
<p>Can any one help me out how to export the jquery grid data to excel?</p> <p>i have inserted one button call export?</p> <pre><code>$("#Export").click(function(){ I am little confuse what should I write? }); </code></pre> <p>thanks</p>
jquery
[5]
2,186,719
2,186,720
sms forwarding without accessing the main mobile
<p>Is there any way , to get someones text-messages forwarded to my phone number without physically accessing the first phone or main phone ? Is there any script in php that could do this?</p>
php
[2]
1,606,295
1,606,296
Displaying my 2D array code
<p>Requirements:</p> <p>1.How to display the stored data for each individual month without having to copy and paste code several times for the DisplayMonthData() method?</p> <p>2.Is my code for summing up all the values for each month correct in DisplayMonthData()?</p> <p>Thanks in advance.</p> <pre><code> sta...
java
[1]
1,629,712
1,629,713
Using commons-beanutils throws ClassNotFoundException on org.apache.commons.logging.LogFactory
<p>I have same code</p> <pre><code>import org.apache.commons.beanutils.PropertyUtils; public class Reflection { private double []masElement = {3,5,2,5}; public double getValue(int i){ if (masElement.length&gt;i){ return masElement[i]; } return 0; } public void setValue(int i, int valu...
java
[1]
1,914,754
1,914,755
How can I find all tables cells which only contain a non breaking space with jQuery?
<p>I need to only find the cells in the table which contain <code>&amp;nbsp;</code> using jQuery. </p> <pre><code> &lt;table&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;Something&lt;/td&gt; &lt;td&gt;something else&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt...
jquery
[5]
583,704
583,705
Weakly typed language type conversion of meaning where, why use. For example JavaScript
<p>Weakly typed language type conversion is not necessary, can directly use it, why type conversion.</p>
javascript
[3]
5,626,126
5,626,127
Pythonic way to "flatten" object hierarchy to nested dicts?
<p>I need to "flatten" objects into nested dicts of the object's properties. The objects I want to do this with are generally just containers for basic types or other objects which act in a similar way. For example:</p> <pre><code>class foo(object): bar = None baz = None class spam(object): eggs = [] x =...
python
[7]
1,103,307
1,103,308
Creating Remote database in Android
<p>This is my first post in stackoverflow. I am beginner in Android app development and trying to make an app with Signup screen with username and email-id.</p> <p>1.I want to store these details at some remote database so that user can also login from "other" android device and thus SQlite can't be used for the purpo...
android
[4]
4,617,440
4,617,441
I'm trying to creating a Queue class, but keep getting an error seemingly to do with generics. Why am I getting this error?
<p>I have a LinkedList class, which serves as the base for a Queue class, which serves as the base for a PrintQueue class.</p> <p>Here's my PrintQueue class:</p> <pre><code>public class PrintQueue&lt;T&gt; { private Queue&lt;T&gt; queue; public PrintQueue() { queue = new Queue&lt;T&gt;(); } ...
java
[1]
3,356,164
3,356,165
Resize event not getting called or probably some other issue
<p>I am trying to have jQuery append a Wide.css stylesheet to the page whenever the browser window is over 1360px and remove the file whenever it is less then that.</p> <p>Currently, the main stylesheet only has wrapper defined with gray background and 900px width and the other, Wide.css, has background red and wrappe...
jquery
[5]
4,491,226
4,491,227
contextmenu for particular line in a multi-line view listview
<p>I have a listview with each item in the list having 2 lines .I want to create a context menu for it such that the header of the context menu should be the text in the first line of the selected item.How to achieve this.Here the name "dfsflk" was hardcoded.I want the program to identify the selected item and display...
android
[4]
4,041,473
4,041,474
slideDown behaviour on hover with inner divs being absolute
<p>Here is something that I can't figure it out.</p> <p>Here is a simple example: <a href="http://jsfiddle.net/MrkMZ/" rel="nofollow">http://jsfiddle.net/MrkMZ/</a></p> <p>HTML:</p> <pre><code>&lt;div id="box"&gt; &lt;div id="top"&gt;&lt;a href="#"&gt;top text&lt;/a&gt;&lt;/div&gt; &lt;div id="bottom"&gt;&lt...
jquery
[5]
5,199,059
5,199,060
How to declare a generic type Multi-Dimensional array in java
<p>I want to store an array of 100 int elements in rows ie 1 row of 100 int datatypes.And every single element contains an array of 100 objects.How to do this in java or android. </p>
java
[1]
3,884,726
3,884,727
Best UI element for displaying results of XML parsing
<p>i am a student and also new to iphone SDK.i want to do xml parsing which has image URL and Data,it is a XML file about news.i have to show it .can i use table view or navigation controller? which is the best way?i have to show images and titles in first page.when i click it,it shows other page to show full news with...
iphone
[8]
415,531
415,532
Not getting Logs in logcat
<p>In my application after a particular Activity the logcat stops working with the following Error message. <strong>Segmentation fault logcat -v long</strong></p> <p>After that i have to start the Emulator again then only it shows the logs.</p> <p>Can anyone pls help?</p>
android
[4]
3,094,599
3,094,600
Python Getting date online?
<p>How can I get the current date, month &amp; year online using Python? Thanks!</p> <p>EDIT-By this I mean, rather than getting it from the computer's date-visit a website &amp; get it, so it doesn't rely on the computer.</p>
python
[7]
4,238,213
4,238,214
Images not displaying in gridview for API Level 17
<p>I am displaying images from a <code>php server</code> to <code>gridview</code>. The images are displaying on devices when the API level is below <code>10</code> but I want to display the images on devices from API level <code>8</code> to <code>17</code></p> <p>My code is </p> <pre><code>try { myFileUrl = new U...
android
[4]
604,189
604,190
Deleting An item from a List Box from a Database
<p>Hi Im trying to delete an item from the listbox which the user selects here you can find my code and a screenshot tnx.</p> <p>Code:</p> <pre><code>public void deleteEvent(ListBox list_event) { int i = list_event.SelectedIndex; ds.Tables["tblEvents"].Rows[i].Delete(); da.Update(ds.Tables["tblEvents"]);...
c#
[0]
5,182,389
5,182,390
Imports in python are static, any solution?
<p>foo.py :</p> <pre><code>i = 10 def fi(): global i i = 99 </code></pre> <p>bar.py :</p> <pre><code>import foo from foo import i print i, foo.i foo.fi() print i, foo.i </code></pre> <p>This is problematic. Why does <code>i</code> not change when <code>foo.i</code> changes?</p>
python
[7]
5,833,371
5,833,372
Wifi reports as "enabled" even though it's not
<p>I'm not sure if this is a Galaxy Tab specific issue or if I'm not utilizing some relevant method of the WifiManager library, but my application correctly reports that the Wifi is disabled at launch, but then as soon as I enable it, it deems itself as enabled, even though it's still in the process of connecting.</p> ...
android
[4]
5,676,045
5,676,046
Why is isNaN(null) == false in JS?
<p>This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing?</p> <pre><code>if (isNaN(null)) { alert("null is not a number"); } else { alert("i think null is a number"); } </code></pre> <p>I'm using Firefox 3. Is that a browser bug?</p> <p>Other test...
javascript
[3]
3,509,923
3,509,924
How to execute commands in Command Prompt using c#
<p>I want to execute these steps in CMD using c#</p> <p>1 - CD C:\MySQL\MySQL Server 5.0\bin</p> <p>2 - mysqldump -uroot -ppassword sample> d:\Test\222.sql</p> <p>On manually doing this, i will get file named "222.sql"</p> <p>I am using the below code to do it, but missing something.. Nothing Happens</p> <pre><cod...
c#
[0]
2,552,065
2,552,066
Count the number of '8's Problem in Java
<p>Im stuck with the below problem.</p> <p><strong>Problem Statement:</strong></p> <p>Given a non-negative int n, return the count of the occurrences of 8 as a digit, except that an 8 with another 8 immediately to its left counts double, so 8818 yields 4.</p> <p>Note: mod (%) by 10 yields the rightmost digit (126 % ...
java
[1]
5,484,186
5,484,187
Can I generate an array based on url path?
<p>I have a path like:</p> <p>/blog/2/post/45/comment/24</p> <p>Can I have an array depends on what I have on url, like :</p> <pre><code>$arr = array('blog'=&gt;'2','post'=&gt;'45','comment'=&gt;'24'); </code></pre> <p>But it should depend on variable passed:</p> <pre><code>/blog/2 should produce $arr = array('blo...
php
[2]
3,522,121
3,522,122
A NullPointerException in the code
<p>When I am trying to execute the code below, in the project it gives an error <code>manual array copy to collection</code>. On the other hand, when I execute the project in the JSP using NetBeans, it is showing <code>NPE</code> at a <code>for-loop</code>. Any idea?</p> <pre><code>ArrayList courseNames=new ArrayList(...
java
[1]
4,343,781
4,343,782
Format and echo datetime string received from MySQL?
<p>how would I format a datetime string received from MySQL? For example, when I do </p> <pre><code>echo $info['start_datetime'] </code></pre> <p>I get <em>2012-03-18 21:00:00</em>, but I would like to Turn it into Sunday, March 18, 2012. I looked at the php documentation where it showed the different formats, but no...
php
[2]
5,852,319
5,852,320
In Javascript, how to conditionally add a member to an object?
<p>I would like to create an object with a member added conditionally. The simple approach is:</p> <pre><code>var a = {}; if (someCondition) a.b = 5; </code></pre> <p>Now, I would like to write a more idiomatic code. I am trying:</p> <pre><code>a = { b: (someCondition? 5 : undefined) }; </code></pre> <p>But...
javascript
[3]
3,361,690
3,361,691
Omission of form tag and security concerns. Advice please
<p>I want to use straight JQuery to submit a form and omit the form tag all together. If I do this, are there any security issues that I need to be concerned with?</p> <p>Apart from the user not being able to use the site if his javascript is turned off, should I be concerned?</p>
jquery
[5]
2,865,639
2,865,640
Scope variable inside if
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2049330/c-sharp-variable-scoping">C# Variable Scoping</a> </p> </blockquote> <p>I thought I may declare two variables with the same name if in different scope: </p> <pre><code>namespace IfScope { class Demo...
c#
[0]
342,241
342,242
JavaScript: scroll position (Webkit engine)
<p>I'm currently trying to use JavaScript to find out how far down the page the user has scrolled; for Firefox 8.0, the keyword is <em>pageYOffset</em>.</p> <p>To say things mechanically:</p> <ol> <li><p>The <strong>page</strong> has a certain height. In Firefox, the useful object is <em>document.documentElement.scro...
javascript
[3]
5,998,095
5,998,096
What is the best way to reuse pages from one website in another?
<p>I'm developing a new ASP .NET website which is effectively a subset of the pages in another site we've just released. Two or three of the pages will need minor tweaks but nothing significant.</p> <p>The obvious answer is to simply copy all of the code and markup files into the new project, make the aforementioned t...
asp.net
[9]
189,226
189,227
How to change the icon color on a android osm mapview
<p>How to change the icon color on a osm map view in android</p>
android
[4]
1,245,854
1,245,855
javascript date reference or value
<p>I'm storing a date in a global variable called <code>MyDate</code>. If I write this:</p> <pre><code>var TheDate = MyDate; for (var i = 5; i &gt; 0; i--) { TheDate = TheDate - i; } </code></pre> <p>Am I just changing <code>TheDate</code> or am I also changing <code>MyDate</code>?</p> <p>Thanks.</p>
javascript
[3]
2,700,267
2,700,268
Getting a list of all subdirectories in the current directory
<p>Is there a way to return a list of all the subdirectories in the current directory in python?</p> <p>I know you can do this with files, but I need to get the list of directories instead.</p>
python
[7]
123,338
123,339
Copy constructor invocation for member objects
<p>C++ says that to create a copy constructor for a class that uses composition, the compiler recursively calls the copy constructors for all the member objects. I tried that same thing in the below code:</p> <pre><code>class A { public: A(){cout&lt;&lt;"A constructor called"&lt;&lt;endl;} A(const A&amp;){cout...
c++
[6]
3,060,180
3,060,181
How to debug uninitialized variables in VC++
<p>How to debug uninitialized variables in release mode in C++.</p>
c++
[6]
1,888,554
1,888,555
Hiding a class from outside when use is only for inside an API in C++
<p>In languages like Java, you can declare a class without a modifier so it will only be visible inside the same package. I need to do something similar in C++. I am trying to create an API that will be a library to be used in other applications. After asking <a href="http://programmers.stackexchange.com/questions/1...
c++
[6]
2,965,072
2,965,073
Why doesn't JavaScript let you call methods on numbers directly?
<p>In Ruby, you can do this:</p> <pre><code>3.times { print "Ho! " } # =&gt; Ho! Ho! Ho! </code></pre> <p>I tried to do it in JavaScript:</p> <pre><code>Number.prototype.times = function(fn) { for (var i = 0; i &lt; this; i++) { fn(); } } </code></pre> <p>This works:</p> <pre><code>(3).times(functi...
javascript
[3]
4,477,778
4,477,779
Common method for comparing any two Java objects
<p>I want to compare two Java objects <strong>without overriding equals method</strong>. Since I need to override equals method in n number of Classes I have, I am in need of a common utility method where we can compare two Java objects.</p> <p>Something <em>like</em>:</p> <pre><code>A a1,a2; B b1,b2; C c1,c2; ----- ...
java
[1]
4,724,055
4,724,056
How to define class-specific << operator in C++
<p>Given a class such as:</p> <pre><code>class Person { private: char *name; public: Person() { name = new char[20]; } ~Person() { delete [] name; } } </code></pre> <p>I want to print to print the name from an instance of this, using a statement like the following:</p> <p...
c++
[6]
417,770
417,771
Memory leakage on event handling
<p>I've been reading about memory leakages lately and haven't yet wrapped my head around all of it and have some questions regarding my own style of writing. Specifically, I'm not really sure if the way I handle events might be a source of leaking. Consider the following code </p> <pre><code>function Wrapper(text) { ...
javascript
[3]
4,754,690
4,754,691
PHP condition for matching exact characters string
<p>I have the following code which makes sure the text entered in the "captcha" text box is at least 3 characters long or else an error is received. How do i set it so the text entered has to be "abcd" or else an error occurs?</p> <pre><code> if(strlen($_POST['captcha']) &lt; 3) { $error_message .= 'Please ensure...
php
[2]
5,615,335
5,615,336
Java code understanding
<p>Hi I am a bit new to programming and recently I have been given a piece of code that I must understand of a monopoly game written in Java.</p> <p>I have never tried to understand someone else's code so naturally I don't even know where to start. </p> <p>My boss asked me after I understand the code and it's functio...
java
[1]
4,538,891
4,538,892
What is a benefit of having source code for ICS?
<p>People are so happy the source code of Ice Cream Sandwich became available for syncing. Why is that cool?</p>
android
[4]
2,108,831
2,108,832
ASP.NET Forms Parameters on Links
<p>Ok, let me start this with I am more of an MVC person. I have a result set that I am trying to add paging. All I really want is a previous and next button on my page which are Link controls. I need these controls to post back to the same page, but have a query parm like page=4. How do I add these links? I see t...
asp.net
[9]