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
2,488,391
2,488,392
Length of a char array
<p>I have the code like this:</p> <pre><code>#include &lt;iostream.h&gt; #include &lt;fstream.h&gt; void main() { char dir[25], output[10],temp[10]; cout&lt;&lt;"Enter file: "; cin.getline(dir,25); //like C:\input.txt ifstream input(dir,ios::in); input.getline(output,'\eof'); int num ...
c++
[6]
4,805,666
4,805,667
Adding time to date format in java
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5165428/how-to-set-time-to-a-date-object-in-java">How to set time to a date object in java</a> </p> </blockquote> <p>I Have Date like 2008-12-10 00:00:00.000 and the Time is as 13:47.</p> <p>I want to Add both ...
java
[1]
4,687,701
4,687,702
Correct syntax to preserve javascript context with prototyping
<p>So I know that I can fix the scope of my module class below using <code>bind</code> as in <a href="http://stackoverflow.com/a/1441692/148998">this answer</a>.</p> <p>The only thing is that I use a slightly diffrerent syntax for my module and I am not quite sure how to apply it? </p> <p>My question is then, how do ...
javascript
[3]
4,521,259
4,521,260
Grid view using arraylist in android
<p>How to show the gridview data's using array list</p>
android
[4]
4,042,053
4,042,054
Extract a Byte C++
<p>I have </p> <pre><code>int chop (char* input, unsigned int length) { for (int chopper = 0; chopper &lt; = length; chopper++) { //how to pass 1byte this input to another function //Will this for loop help? } } </code></pre> <p>How do I extract one byte of from this input for my further processing? Thank yo...
c++
[6]
5,971,312
5,971,313
Android How Much space is free on the SD card?
<p>What is an effective way to determine how much free space is on the SD card?</p>
android
[4]
6,004,646
6,004,647
reference a method from a class by using a variable
<p>I know how in Java, a class is referenced like <code>com.google.googlemaps.exampleClass.exampleMethod()</code>. Is it possible to interchange the first parts of the referenece (in this case, the <code>com.google.googlemaps</code>) using a variable (<code>Class c</code>)?</p> <p><strong>EDIT</strong> Ok, after some ...
java
[1]
2,904,858
2,904,859
How to skip Enter key in RichTextBox
<p>I have to implement transparent textbox (my case is text box with gradient background). The easiest implementation was transparent RichTextBox which I have found on <a href="http://www.experts-exchange.com/Programming/Languages/Regular_Expressions/Q_23508382.html" rel="nofollow">http://www.experts-exchange.com/Progr...
c#
[0]
3,794,602
3,794,603
concatenate char * to string
<p>I have a function which is expecting a string, I was wanting to concatenate const char * to a string to be returned.</p> <p>Here is example code to help illustrate this scenario:</p> <pre><code>void TMain::SomeMethod(std::vector&lt;std::string&gt;* p) { p-&gt;push_back(TAnotherClass::Cchar1 + "/" + TAnotherClass...
c++
[6]
4,906,414
4,906,415
How to Get element of Iframe?
<p>i want to automate page using web browser automation.</p> <p>In the there is only an iframe at runtime value comes to that iframe.</p> <p>when i try get the value of i frame it returns only the iframe not whole page html,</p> <p>I want to click a href of i frame.</p> <p>Please help me to solve this problem I am ...
c#
[0]
4,427,225
4,427,226
Error generic array creation
<pre><code>public class TwoBridge implements Piece{ private HashSet&lt;Hexagon&gt;[] permutations; public TwoBridge(){ permutations = new HashSet&lt;Hexagon&gt;[6]; </code></pre> <p>Hi, I'm trying to create an array of Sets of hexagons (hexagons being a class i created).</p> <p>However I get this err...
java
[1]
4,038,334
4,038,335
Ctr+s event on clicking a hyperlink
<p>I have a hyperlink, when i click this link Ctr+s event should be fired which results in prompting to save the webpage. How can i call Ctr+s event when clicking a link I needs this in javascript or jquery</p>
javascript
[3]
2,847,101
2,847,102
How to get the substrings in a string by using regular expressions
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11100379/retrieving-the-substring-based-on-condition-from-a-string-in-iphone">retrieving the substring based on condition from a string in iphone</a><br> <a href="http://stackoverflow.com/questions/11102005/identi...
iphone
[8]
3,434,329
3,434,330
Loop not incrementing ASP.NET VB
<pre><code>'Add items to db' Function recordOrder() Dim objDT As System.Data.DataTable Dim objDR As System.Data.DataRow objDT = Session("Cart") Dim intCounter As Integer Dim con2 As New System.Data.OleDb.OleDbConnection Dim myPath2 As String myPath2 = Server.MapPath("faraxday.mdb") con2...
asp.net
[9]
2,201,257
2,201,258
I have an application running on Android SDK API 16 but not on any else version. What could be the possible reasons?
<p>Please someone explain the possible reasons and solutions.</p>
android
[4]
2,176,034
2,176,035
JQuery selectmenu how to style some options differently
<p>Probably a simple one guys but I'm really struggling with it. Would really appreciate some help or advice if anyone can offer it, thanks.</p> <p>I'm using JQuery selectmenu and all I would like to do is set a different style for any OPTION that has a particular class. The class is "outofstock", so my code is as fol...
jquery
[5]
5,556,741
5,556,742
float 0 returns as empty string in php
<p>could anyone explain why float 0 is empty? The code below will show "weird"</p> <pre><code>$empty = (float)"0"; if($empty == "") echo "weird"; </code></pre> <p>On the other hand if i were to the code below, it will never show "weird".</p> <pre><code>$empty = (float)"0.01"; if($empty == "") echo "weird"; </cod...
php
[2]
495,030
495,031
Using conditionals inside a loop
<p>I am trying to achieve a check with the <code>if...else</code> statement that only squares the odd numbers between 100 and 150, otherwise the number is just printed.</p> <p>How can I revise my <code>if</code> statement to achieve this please? An educated guess is that an operator or combination of operators are use...
javascript
[3]
533,686
533,687
c# HtmlAgility Pack - Unable to get image src
<p>This is the code I have. I am trying to learn how to get all the img src from a URL. But, the <strong>imgs</strong> variable in my below code is always null. What am I doing wrong, please?</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using Sys...
c#
[0]
958,796
958,797
Can a class Extend or Override himself?
<p>Suppose we have a class. We create an object from the class and when we do the class Extends himself base on the object initialization value..</p> <p>For example:</p> <pre><code>$objectType1 = new Types(1); $objectType1-&gt;Activate(); // It calls an activation function for type 1 $objectType2 = new Types(2); $ob...
php
[2]
1,654,033
1,654,034
What does var x = x || {} ;
<p>what does the following code do in java script:</p> <pre><code>var x = x || {}; </code></pre>
javascript
[3]
4,994,890
4,994,891
Image.onload doesnt work at all for IE
<pre><code>var icon1 = new Image(); var wid1; var hei1; icon1.src = resource; // resource is Image URL here icon1.onload = function () { wid1 = icon1.width; hei1 = icon1.height; var rati = wid1 / hei1; }; </code></pre> <p>This code is to calculate the ratio of width and height to further ...
javascript
[3]
3,740,664
3,740,665
Two way sync adapter in Android
<p>I have gone through a number of links and after spending a huge amount of time over this, someone can please let me know the simplest approach to implement the Sync Adapter in Android which is 2 way. I mean the changes made on the remote database get reflected on the Android Device and the changes from the device sh...
android
[4]
1,833,256
1,833,257
Pattern matching in dictionary using python
<p>In the following dictionary,can the elements be sorted according the last prefix in the key</p> <pre><code>opt_dict=( {'option1':1, 'nonoption2':1, 'nonoption3':12, 'option4':6, 'nonoption5':5, 'option6':1, 'option7':1, }) for key,val in opt_dict.items(): if "answer" in key: //match keys la...
python
[7]
2,942,800
2,942,801
how to know if file is still open for writing
<p><br> i have a function that writes to a file , how can i using another script check if the file is being used for writing or it is closed ?</p> <p><strong>Edit :</strong> this file might be opened for writing by other script/application/system ... </p> <p>thank you .</p>
php
[2]
5,313,452
5,313,453
How do I pass the selected item's ID from a ListView to an AlertDialog in Android?
<p>Here's the scenario: I have a ListActivity, and long-pressing on an item brings up a context menu. One item in the context menu is "delete", and that brings up a confirmation box (and AlertDialog). When the user presses OK in the confirmation dialog, I need to know the ID of the item that was originally selected, so...
android
[4]
1,991,494
1,991,495
Run Hierarchy Viewer on W7(doesn't work)
<p>I am working on Android. I try inside a terminal execute java -jar hierarchyviewer.java </p> <p>And I have this error</p> <p>11:46:48 E/adb: Failed to get the adb version: Cannot run program "adb": CreateP rocess error=2, the system cannot find the file specified</p> <p>I can run the hierarchyviewer.jar from /too...
android
[4]
3,621,615
3,621,616
Android-Video View in Fullscreen
<p>I am trying to make this VideoView to appear in full screen mode:</p> <pre><code>public class ViewVideo extends Activity { private String filename; private static final int INSERT_ID = Menu.FIRST; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
android
[4]
2,587,601
2,587,602
how do i use string replace to remove a carrage return from a string
<p>Hi how do I use string replace to remove a carrage return from a string</p> <p>here is the string:</p> <pre><code>{ $content = '&lt;p&gt;some random text &lt;a href= "http://url.co.uk/link/"&gt;link text&lt;/a&gt; some more random text.&lt;/p&gt;'} </code></pre> <p>and here is the sring replace command</p> <pre...
php
[2]
981,029
981,030
How to make short codes? php
<p>I want to make short codes, like a wordpress...</p> <p>Sample:</p> <blockquote> <p>[CODE]</p> </blockquote> <p>will be replaced to</p> <blockquote> <p>code();</p> </blockquote>
php
[2]
923,196
923,197
Can I assign a static class to a variable?
<p>My question is whether I can assign a static class to another variable (and of what type would that be) ?</p> <p>Say I have</p> <pre><code>public static class AClassWithALongNameIDontWantTotType{ public static bool methodA() { stuff } } </code></pre> <p>and then I have </p> <pre><code>class B{ } </code></pr...
c#
[0]
4,240,991
4,240,992
jquery selector to select a tags inside every li in the ul block
<p>Here is an image which shows my ul block</p> <p><img src="http://i.stack.imgur.com/8bOxR.jpg" alt="enter image description here"></p> <p>every li is identical to the expanded li shown. How do I select all of these a tags within this ul ?</p> <p>I tried using something like </p> <pre><code> $('ul:has(li) &gt; a')...
jquery
[5]
3,516,197
3,516,198
traverse dom to find $(.more) of div that contains class .disable
<p>I have this dom tree: </p> <pre><code>&lt;li class="badge_listtwo"&gt; &lt;div class="badge_spacetwo"&gt; &lt;p class="badge_title"&gt;$badge_title&lt;/p&gt; &lt;div class="badge_button"&gt; &lt;img src="badgeImages/sample.png" /&gt; &lt;a href="#" id="$badge_id" class="m...
jquery
[5]
1,100,878
1,100,879
change the value of the button of the button clicked
<p>On inserting the new <code>&lt;li&gt;</code>, I have to set the value of the button clicked to Delete. How can I do that? </p> <p>With the actual code, it`s working only once, and on adding other list, the button no more has the the value 'Delete'. </p> <pre><code>$("#mylist :button").click( function() { v...
jquery
[5]
1,770,560
1,770,561
Trying to create a text file log using java
<p>I'm new to programming and trying to create a log file. The code I have written works at sending the message and the time to a text file . But every time I send another message it just records over the previous. I want to have a list of messages and times just not the latest one.</p> <pre><code>public void run () {...
java
[1]
2,906,336
2,906,337
How to know if the current browser is loaded with C# code
<p>I am working with the Image generation of a browser, but doing so i am taking a snapshot of the browser from the code, in windows form. But if the browser is not loaded in the specific time (suppose 15 seconds) then a blank snapshot occur. Anyone help me with this .</p>
c#
[0]
65,261
65,262
Rounding issue in Java
<p>I'm trying to do a quick 2 vars equation solver using Cramer's rule but for some reason java keeps on rounding my answers so i don't get the right answer.</p> <p>the basic rule for getting single answer is </p> <pre><code>((a11*a22)-(a12*a21))!=0) </code></pre> <p>and the solution should be</p> <pre><code>doubl...
java
[1]
4,095,267
4,095,268
Python always thinks my string is the highest possible number
<pre><code>if month == 1 or 10: month1 = 0 if month == 2 or 3 or 11: month1 = 3 if month == 4 or 7: month1 = 6 if month == 5: month1 = 1 if month == 6: month1 = 4 if month == 8: month1 = 2 if month == 9 or 12: month1 = 5 </code></pre> <p>This code <em>always</em> returns month1 5. I'm quite...
python
[7]
176,259
176,260
Is "overflow" a historical term, or does physical overflowing really still happen?
<p>I believe that during arithmetic overflow (in the context of an integer variable being assigned a value too large for it to hold), bits beyond the end of the variable could be overwritten.</p> <p>But in the following C++11 program does this really still hold? I don't know whether it's UB, or disallowed, or implemen...
c++
[6]
2,339,886
2,339,887
Jquery Menu Request
<p>I want a jquery menu like this link </p> <p>the menu in link is in Flash format</p> <p><a href="http://www.atid1.com/default/" rel="nofollow">Flash Menu</a></p> <p>when i hover on parent menu with mouse all sub menus will open</p> <hr> <p>I think now this is the correct answer</p> <pre><code>&lt;div class="hov...
jquery
[5]
1,019,029
1,019,030
Need to upload a file using HttpPost in android
<pre><code>I would like to upload a name.txt file without ussing MultiEntitiy "importing a large file" as my file is small in size... I have written the following code but unable to upload a file.. thanks for your concern... URL url = new URL(strUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection...
android
[4]
644,530
644,531
jquery "html" function returns weird behaviour
<p>i used jquery "html" function:</p> <pre><code>$('#color .updateMoney').html('1'); </code></pre> <p>to replace a certain string but instead it replace the content with an anchor wrapping like this:</p> <pre><code>&lt;a xmlns="http://www.w3.org/1999/xhtml"&gt;1&lt;/a&gt; </code></pre> <p>Why is that so?</p>
jquery
[5]
4,394,029
4,394,030
Camera Preview Issue?
<p>In my Application the camera preview is working properly in both in potrait and in landscape mode .No crashes are occuring.but the users are complainting that the crashes are occuring when they are using the same. what is the problem with this? please anyone help me to solve this issue</p>
android
[4]
5,986,928
5,986,929
interchangeable derived class method from base class c++
<p>i am pretty sure this is a simple question for a long time c++ user, this should be a pattern or the problem should be solved in any other way but given i am Python developer and a total novice with c++ i don't know how it's usually done.</p> <p>Suppose that i have a class where i want to store a pointer to an obje...
c++
[6]
4,920,969
4,920,970
Counting online users using asp.net
<p>I'm to create a website for which I need to count the online users and show it on the home page all the time. I'm not interested to apply ready-to-use modules for it. Here is what I have already done:</p> <p>Adding a Global.asax file to my project</p> <p>Writing the following code snippet in the Global.asax file:<...
asp.net
[9]
1,174,193
1,174,194
Animation to the last element added to a ListView
<p>I have this codesnippet which initialize a ListView from a <code>SQLite</code> database</p> <pre><code> public void RefreshCaseList() { lastTenCases = db.getAllCases(7); if (lastTenCases.size() &gt; 0) error.setText(""); lastCases.setAnimation((Animation)AnimationUtils.loadAni...
android
[4]
1,798,434
1,798,435
Is it a good idea to put a conversion operator in an iterator to convert it to pointer?
<p>I saw the following code today:</p> <pre><code>options.push_back(&amp;*i); </code></pre> <p>Where <code>i</code> is an iterator and the container <code>options</code> stores pointers to the type of <code>*i</code>. The resulting <code>&amp;*i</code> is a bit ugly and I started to wonder:</p> <blockquote> <p>Is ...
c++
[6]
1,239,497
1,239,498
GridView, RowDataBound event executing twice for each row
<p>I have a GridView that is using an SQLDataSource to bind to a database.</p> <p>For some reason my RowDataBound event on the GridView is executing twice.</p> <p>Why is this happening?</p>
asp.net
[9]
2,684,493
2,684,494
Is there any library to track call time and sms time in android?
<p>I want to a software to calculate call time and sms time usage in Android, anyone has idea about any build-in library which handle such things ????</p> <p>any way I can extract call logs in Android???</p>
android
[4]
2,470,047
2,470,048
Iphone TabBar Application
<p>I start to develop app in tab bar application template..</p> <p>Here my first page is login page after loagin it go to home page and all navigation will happen..</p> <p>Here i don't want tab bar only in login page.How to doo this?</p> <p>Thanks..... </p>
iphone
[8]
5,555,520
5,555,521
Lint and old API level warning
<p>I compile against Android 4.2 (API 17), in my Manifest I have:</p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/&gt; </code></pre> <p>In code I use:</p> <pre><code>String first = sdf.format(new Date(context.getPackageManager().getPackageInfo(context.getPackageName(), 0).firstI...
android
[4]
1,669,273
1,669,274
show latitude and longitude both from GPS and cellular network together
<p>Is it possible to show latitude and longitude both from GPS and cellular network together. I am using Eclipse.</p>
android
[4]
4,787,857
4,787,858
Best way to send "messages" from PHP to Java on the same workstation
<p>What is the best way to send "messages" from PHP script to Java program in <strong>real time</strong>. PHP script and Java programs are both working at the same work station with OS Windows. Maybe some kind of client/server? The main feature is <strong>real time</strong>; that's why I don't want to use files.</p> <...
java
[1]
1,467,829
1,467,830
How can we find the jdk path in the system drives(like C,D etc) using java program?
<p>Hi can anyone tell me "<strong>How can we find the jdk path in the system drives(like C,D etc) which is currently used by user using java program?</strong>"</p>
java
[1]
2,200,147
2,200,148
linked list in c/c++
<p>I am going to multiply two polynomial that user must enter.</p> <p>in the first step (getting info from user) I got this error:</p> <pre><code>Unhandled exception at 0x00a315cb in linked polinomials.exe: 0xC0000005: Access violation writing location 0x00000000. </code></pre> <p>I got this error after that I wan...
c++
[6]
5,981,330
5,981,331
C++ Simple GUI for Windows, Linux and Mac
<p>I am looking for a simple gui for C++ program.It will be you used for a simple project &amp; must be in file without dll and stuff like that.And must run on Windows,Linux and Mac.</p> <p>Excuse my English.I am doing my best.</p>
c++
[6]
4,479,224
4,479,225
read through first N lines of a file in python
<p>Typically, when reading a file, I use the for line n fileobject: construct. Is there a simple way to just loop over the first N (or some arbitrary subset) of lines in a file, so that I don't have to read in the entire file?</p>
python
[7]
4,203,216
4,203,217
How to compare two dates in php and echo newer one?
<p><strong>How to compare two dates in php and echo newer one?</strong></p> <p>My dates are in the following format: <code>date("F j, Y, g:i a");</code> which give us <code>August 12, 2011, 9:45 am</code>.</p> <p>My dates are as follow:</p> <ul> <li>date 1 <code>$created</code></li> <li>date 2 <code>$updated</code> ...
php
[2]
1,873,269
1,873,270
concatenation output problem (toString Array) - java
<p>I am trying to display the output as "1(10) 2(23) 3(29)" but instead getting output as "1 2 3 (10)(23)(29)". I would be grateful if someone could have a look the code and possible help me. I don't want to use arraylist.</p> <p>the code this </p> <pre><code>// int[] Groups = {10, 23, 29}; in the constructor public...
java
[1]
1,304,324
1,304,325
Initialize ref. field with ref. parameter: Is a copy made?
<p>I am wondering if a copy is made in the following situation, or if both references will point to the same object. Consider an class with a single const ref field which is initialized from const ref parameter:</p> <pre><code>class Foo { public: Foo(const vector&lt;double&gt;&amp; the_doubles) : my_doubles(the_dou...
c++
[6]
4,067,758
4,067,759
can i pass a string between two javascript files
<p>Is it possible to pass a string from one .js to another .js file. For Example main.html contains javascript. I need to pass a string from main.html to another html file that loads a javascript file during run time. Is it possible?</p>
javascript
[3]
5,989,868
5,989,869
Android apps on phones and tablets
<p>I'm developing a project that needs to work on both tabs and smart phones with different screen sizes, but I'm not sure how to achieve that. Should I use different codes for different devices or I need to deal with the drawable folder with h/l/m/xhdpi or there is another way to do that ? </p>
android
[4]
5,192,776
5,192,777
how to detect button pressed and released in iphone
<p>how to detect a button is pressed and released because i want to perform two actions </p> <p>first is auto increment when a button is pressed and hold a... and to stop the auto increment when a button is released .......</p> <p>please tell me what button actions are to be used to do this ....</p> <p>i tried with ...
iphone
[8]
4,925,925
4,925,926
Infinite loop while reading stdio.h
<p>why does the following program gets stuck in an infinite loop??</p> <pre><code>int main() { string fname = "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include\\stdio.h"; char line[985]; ifstream file(fname.c_str()); if(file == NULL) { cout&lt;&lt;"unable to open"; exit...
c++
[6]
623,751
623,752
Convert ushort to string
<p>I have a ushort that consists of two bytes.</p> <p>15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0</p> <p>Y = bits 10-0, twos complement mantissa integer.</p> <p>N = bits 15-11, twos complement integer.</p> <p>X = Y * 2^N</p> <p>I need to ouput X as a string.</p> <p>This is what I have tried:</p> <pre><code> private...
c#
[0]
4,650,374
4,650,375
Is Eval my only option?
<p>I'm wondering if Eval() is the only option I really have for calling scripts on my server and also executing the javascript on those files.</p> <p>I see every where about security issue with Eval and people don't recommend it - so is there any safe way to request files with javascript and execute that JS ?</p>
javascript
[3]
2,960,812
2,960,813
Python method/function arguments starting with asterisk and dual asterisk
<p>I am not able understand where does these type of functions are used and how differently these arguments work from the normal arguments. I have encountered them many time but never got chance to understand them properly.</p> <p>Ex:</p> <pre><code>def method(self, *links, **locks): #some foo #some bar r...
python
[7]
1,983,058
1,983,059
Simple way to do dynamic but square layout
<p>I'm using a GridView to display a bunch of views which are essentially LinearLayouts. I want the LinearLayouts to all be square, but I also want them to be dynamically sized--that is, there are two columns and I want the LinearLayouts to stretch depending on the size of the screen but remain square. Is there a way t...
android
[4]
3,827,973
3,827,974
Problems with dynamic array creation using pointers
<p>I'm trying to create a 2d dynamic array using the values of an array of <code>int</code> as my pointers. I don't know how to put this in words exactly, so here is the code. Maybe you'll understand what I'm trying to do if you see it.</p> <pre><code>#include "stdafx.h" #include &lt;iostream&gt; using namespace std;...
c++
[6]
1,038,357
1,038,358
How to tell Jquery about Appended form row
<p>Hi I've got a form that can have a row of items added via ajax. But when this row is added, the new inputs can't receive focus.</p> <p>In trying to work this out, i discovered they do receive focus if an alert is triggered during the bind function.</p> <p>I have looked around for answers, but i just can't get it ...
jquery
[5]
3,425,194
3,425,195
Print true values separately
<pre><code>a = 'abcdef' ,'ijklmno' , 'pqrst' b = 'ijklmno' , 'zxy' c = b in a print c </code></pre> <p>output :</p> <pre><code> True , False </code></pre> <p>How to print the value of true separately . i'e 'ijklmno' is true so i want to print it seperately</p>
python
[7]
3,875,824
3,875,825
stop camera click sound programmatically in android
<p>I am using android's default camera to click images from within my app. I want to stop the click sound that it does on clicking an image. Is there a way to stop that click sound programtically?</p> <p>Thanks.</p>
android
[4]
5,629,589
5,629,590
Referencing a parameter in a function directly
<p>I'm trying to edit a piece of code written by a development company, which uses the following construct a lot:</p> <pre><code>$dbcol = grabdata($strSqlB,'','','','','','',2); </code></pre> <p>Is there really not an easier way to do this? The code is completely unreadable. </p> <p>I would have thought that the fol...
php
[2]
3,858,143
3,858,144
not working function with no errors
<p>I've implemented a function to display an avl tree after inserting nodes into it like this</p> <pre><code>template&lt;class nodetype&gt; void AVLtree&lt;nodetype&gt;::display() const { display(Proot); } template&lt;class nodetype&gt; void AVLtree&lt;nodetype&gt;::display(Node&lt;nodetype&gt; * ptr) const { if(pt...
c++
[6]
2,753,760
2,753,761
run time error running the stack which could be due to array size
<p>I created a class that runs a stack. However when I run the main class it gives a runtime error. The class runs like a stack but when the numbers entered go over the stack size its supposed to call a method that copies the array add more size to the stack.</p> <p>Exception in thread "main" java.lang.ArrayIndexOutO...
java
[1]
4,050,395
4,050,396
Hide application icon
<p>I am doing an Android application. I want to hide the application icon in the emulator and I want to start my application by pressing some numbers, for instance 456#. Is there a way to do this?</p>
android
[4]
5,097,044
5,097,045
Python method parameter list
<p>in a method definition why would someone set the formal parameter <code>amount</code> equal to the constant <code>PERMANENCE_INC</code> in the formal parameter list?</p> <pre><code>def increasePermanence(self, amount=PERMANENCE_INC): """ Increases the permanence of this synapse. """ self.permanence = min(...
python
[7]
890,092
890,093
Python. figuring out how to input a correct phone number
<p>So I'm new to python and I'm writing a program that accepts a phone number in the format XXX-XXX-XXXX and changes any letters to their corresponding numbers. I need to check the entry and make sure it's in the correct format, and if its not, allow it to be reentered. I'm having a hard time getting it to prompt me ...
python
[7]
932,193
932,194
Reading standard output from process, always empty
<p>Running this code:</p> <pre><code>Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.FileName = "tool.exe"; p.Start(); p.WaitForExit(); </code></pre> <p>Makes tool.exe run, and output some content on standard output. However, if I try to capture the content using:</p> <pre><code>Process p...
c#
[0]
3,357,294
3,357,295
Android ScreenSize
<p>Per the android multiple screen design<br> "As you design your UI for different screen sizes, you'll discover that each design requires a minimum amount of space. So, each generalized screen size above has an associated minimum resolution that's defined by the system. These minimum sizes are in "dp" units—the same u...
android
[4]
1,948,137
1,948,138
How to copy a xml file from res/raw folder to sd card of android?
<p>I want to copy a xml file from res/raw folder to the sd card. This question is actually specific to the ODK Collect. But any help would be appreciated. I have looked at <a href="http://stackoverflow.com/questions/3851712/android-how-to-create-a-directory-on-the-sd-card-and-copy-files-from-res-raw-to">Android: How to...
android
[4]
140,650
140,651
how can show error or warning in the page
<p>I have a site in a server.</p> <p>Because of settings, no error or warning is displaying in the page</p> <p>How can i change the setting, using .htaccess file</p>
php
[2]
516,641
516,642
How to minimize duplication code in Android without creating Objects
<p>I have multiple activities in which I want to use same code in those activity. I finished it with having same bunch of code in each activity. How can minimize this redundant code. For doing this I dont want to create object and use it's methods for removing redundancy...</p> <p>Plz help... Thank U....</p>
android
[4]
5,498,929
5,498,930
Why data show one row.I want show all row.Please helpme
<pre><code> Connection conn = null; String url = "jdbc:jtds:sqlserver://192.168.1.11:1433/"; String dbName = "koh;Instance=MSSQLSERVER;"; String userName = "bit"; String password = "1234"; String driver = "net.sourceforge.jtds.jdbc.Driver"; try { Class.forName(driver).newInstance(); ...
android
[4]
695,299
695,300
javax.naming.InitialContext is a restricted class. Please see the Google App Engine developer's guide for more details
<p>Whenever I tried to run my Google App Engine project(using JSF 2 and Apache MyFaces), got following error:</p> <p><strong>java.lang.NoClassDefFoundError: javax.naming.InitialContext is a restricted class. Please see the Google App Engine developer's guide for more details.</strong></p> <p>Any solution?</p>
java
[1]
523,894
523,895
jQuery .each() this and element
<p>Inside a .each() callback, is there any difference between <code>this</code> and the second argument of the callback function?</p> <p>For example, in the following code:</p> <pre><code>$("example").each( function(index, element) { // body }); </code></pre> <p>is there any difference between <code>this</code> ...
jquery
[5]
2,968,938
2,968,939
always returns nil in iPhone
<p>I am trying to apply Mike Chen's answer <a href="http://stackoverflow.com/questions/1325897/how-can-i-take-a-photo-frequently-with-iphone/1328176#1328176">here</a>, using SDK 3.0. In delegate.m file I implement;</p> <pre><code>[viewController.view addSubview:[[objc_getClass("PLCameraController") sharedInstance] pre...
iphone
[8]
5,490,793
5,490,794
os.path.isfile does not work as expected
<p>I am trying to scan my harddrive for jpg and mp3 files. </p> <p>I have written the following script which works if I pass it a directory with file in the root but does not return anything if I pass it the root directory. </p> <p>I am new to Python so would love some help.</p> <pre><code>def findfiles(dirname,fi...
python
[7]
1,768,985
1,768,986
How to run a method at XX:XX:XX time?
<p>HI</p> <p>I want to run a method in my program evry X hours, how to do that ? Im googling and there is nothing :/</p>
java
[1]
5,691,733
5,691,734
error in running recursion
<p>if running function returns server misconfiguration error</p> <pre><code> function build_path($cid) { $result = array(); $DB = new MySQLTable; $DB-&gt;TblName = 'shop_categories'; $where['cat_id']['='] = $DB-&gt;CleanQuest($cid); $res = $DB-&gt;Select('cat_id,cat_name,...
php
[2]
593,537
593,538
copy() & getcwd() works locally, not online
<p>This line of code works for me locally:</p> <pre><code>$copythumb = copy($externalsource, getcwd().'\\img\\covers\\'.$id.'thumb.jpg'); if (!$copythumb) {echo 'Couldn\'t add thumbnail';} </code></pre> <p>But when I upload it to my server I just get "Couldn't add thumbnail" and it's not copied. I've tried to chang...
php
[2]
2,624,881
2,624,882
jquery - JSON to <table>
<p>I have Json of the form</p> <pre><code>[{"id":39,"data":1},{"id":40,"data":2}] </code></pre> <p>It does not parse properly with <code>jQuery.parseJSON()</code></p> <p>I need to take this data and create a html <code>table</code>. I was thinking of creating the HTML dynamically in the js. </p> <p>A. How can I...
jquery
[5]
5,109,719
5,109,720
Cache ? Or Not?
<p>I have an ajax application, it will call the webmethod in the Bussiness Server (WebGarden) and the webmethod will create file or delete file or getfiles from the File Server (RAID 1) </p> <p>My Problem is that if I do the following</p> <ol> <li>Directory.GetFiles(...)</li> <li>CreateFile(or DeleteFile)</li> <li>D...
c#
[0]
2,494,829
2,494,830
how to shorten a string by certain number of characters?
<p>Is there a php function that can chop let's say 10 chars of the end of a string without calling strlen ? So I can avoid unnecessary repeating of variable names. </p> <p>all I know is <code>substr($str,0,strlen($str)-10);</code></p>
php
[2]
2,384,871
2,384,872
Select dropdown and auto check the checkbox if the selected value of dropdown is not empty
<p>When people selected the dropdown and then the checkbox will be auto checked if the selected value of dropdown is not empty. But I met "sel[i] is undefined" error.</p> <p>Javascript part:</p> <pre><code>var chk = document.getElementsByTagName("input"); var sel = document.getElementsByTagName("select"); for (v...
javascript
[3]
1,020,021
1,020,022
How to debug when an app is launched with URL Scheme from Safari
<p>I want to test my app for my app launched with a URL scheme from Safari, how can that be done?</p>
iphone
[8]
1,802,609
1,802,610
Simultaneously toggling 2 divs in 1 container + 2 in another container
<p>I'm not sure how to search for this: on a gallery page I want to be able to toggle the image between its original size and 2x by clicking on it <strong>but also</strong> by clicking a zoom button in another container which changes state (indicating you can either zoom in or out in concordance with the image div curr...
jquery
[5]
4,309,856
4,309,857
appending html string with .append() does not work?
<p>I am rather new to jquery, so please bear with me. I have created an HTML page containing a number of hooks to which I want to append new elements. Appending a string works as expected:</p> <pre><code>$(theParentNode).append ("blurb1"); </code></pre> <p>But appending HTML does not:</p> <pre><code>$(theParentNod...
jquery
[5]
4,282,995
4,282,996
download a site and upload to other server
<p>I built a website on www.weebly.com with their tools Now I wanna to host it on another server.It allows export of site as a zip format so I downloaded my site in zip format but the pages are not opening as original.Slide show photo gallery and others are not working.I do not have much knowledge of java. please provi...
javascript
[3]
2,625,017
2,625,018
Accessing IMEI # From Web Application
<p>Is there any possibility that can i get the IMEI # Of Mobile from a web application. Suppose a request comes from a mobile then i can get the imei # from that request ?</p>
asp.net
[9]