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,596,787
2,596,788
Javascript Shorthand for getElementById
<p>Is there any shorthand for the JavaScript document.getElementById? Or is there any way I can define one? It gets repetitive retyping that <strong>over</strong> and <strong>over</strong>.</p>
javascript
[3]
5,916,228
5,916,229
Get class of selected radio in a button group
<p>How to hide a div if the selected radio of a radio button group has a class other than "red"?</p> <pre><code>&lt;form&gt; &lt;input class="blue" name="model" value="XTC_01" type="radio"&gt; &lt;input class="red" name="model" value="XTC_02" type="radio"&gt; &lt;input class="red" name="model" value="XTC_03" t...
jquery
[5]
5,137,847
5,137,848
How to always run some piece of code in android regardless of which activity or service run first in android?
<p>I would like to run a piece of code every time any activity or service is started. In this piece of code, I might do things such as set the default uncaught exception handler and manage log levels.</p> <p>The problem is that I have an activity which starts with the user clicking the application icon. I have anoth...
android
[4]
4,548,727
4,548,728
Embedded excel user control in C#
<p>I have a user control (in c#) with an embedded excel worksheet and other gridcontrols. I have this user control in a form. I need to print the form but I found that embedded excel worksheet is not supported in DevExpress Xtrareport. I can print the excel worksheet separately but I need to print the whole form not ju...
c#
[0]
3,637,916
3,637,917
Rvalues vs temporaries
<p>Somebody generalized the statement "Temporaries are <code>rvalues</code>". I said "no" and gave him the following example</p> <pre><code> double k=3; double&amp; foo() { return k; } int main() { foo()=3; //foo() creates a temporary which is an lvalue } </code></pre> <p>Is my interpretation correc...
c++
[6]
504,601
504,602
How to show multiple callouts on single pin
<p>I want to know if it is possible to show multiple callouts(annotations) by selecting just a single pin.if yes then how?</p>
iphone
[8]
4,030,474
4,030,475
Problem with using javascript to insert <input> tags in html
<p>I am trying to take text that is in an array (one word per value) and insert it into html. All the code is here: <a href="http://jsfiddle.net/chromedude/r6wVq/3/" rel="nofollow">http://jsfiddle.net/chromedude/r6wVq/3/</a>.</p> <p>Update: My question is what am I doing wrong? It does not do anything which is weird.<...
javascript
[3]
4,948,511
4,948,512
Is this a website integrated with this iPhone app?
<p>First of all I'm totally not advertising for this app or for this team. I came a cross to their apps and I noticed that all their apps are using the same interface.</p> <p>But what wondered me are these inside the apps are a special design websites inside their apps or what? because I'm interested how did they make...
iphone
[8]
5,705,053
5,705,054
Forced to pass by value
<p>I just ported my code (originally written in msvc) to Code::Blocks (running GNU GCC) and I'm having a few problems in compiling my code.</p> <p>The compiler is giving me an error when I try to pass a variable as an argument.</p> <p>For example,</p> <pre><code>void foo(int a, int b, int c){...} //Works on calling ...
c++
[6]
4,462,437
4,462,438
How to clear Activity Stack on Button Click in Android
<p>I have a question that I have a logout button in my App on which we have called an App login Screen but at this point when user press the Back Button of Android Phone, he entered in the App again without Authentication, which is not desirable. I want when we click on Logout button All previous Activity Stack being c...
android
[4]
1,405,748
1,405,749
How does this work? type = type || 'any';
<p>Can anyone explain me how this expression works?</p> <pre><code>type = type || 'any'; </code></pre> <p>Does it mean that if type is undefined use 'any'?</p>
javascript
[3]
3,760,202
3,760,203
Android secure communications: JSSE or Apache Http?
<p>After having all kinds of problems taking my functioning JSSE-based HttpsURLConnection implementation using a custom truststore on Windows to Android I have come across a number of issues that I cannot get answers to: (the Android app still does not work)</p> <ol> <li><p>Does Android 4.0 still only support the BKS ...
android
[4]
3,745,048
3,745,049
android: how to modify starStyle
<p>I'm doing a "favorite" view in my android app.</p> <p>In favorite.xml I have:</p> <pre><code> android:id="@+id/star" android:layout_height="wrap_content" android:layout_width="wrap_content" android:visibility="visible" style="?android:attr/starStyle" android:padding="10sp" </code></pre> <...
android
[4]
2,827,774
2,827,775
Make my java application shut down if it stops working
<p>Is there a way to make my java application shut down there is an error? e.g. if I have a nullpointerexception, can I just make it completely close out?</p>
java
[1]
5,392,748
5,392,749
handling error in gridview
<p>I had gridview whch bind datasource and I add edit command to gridview to update data and when updating errors apeared so I want to handle these error in label in row_updated event without asp error</p>
asp.net
[9]
3,300,308
3,300,309
Max execution time of 30 sec in http.php
<p>i am using http class and it stuck at setting up cookies on the line where it says fuction setcookies.</p> <p>this is my code</p> <pre><code>require_once ('../http.php'); $http=new http_class; $http-&gt;user_agent="Mozilla/5.0 (Intel Mac OS X) Gecko/20070515 Firefox/2.0.0.4"; $error=$http-&gt;GetRequestArguments($...
php
[2]
4,113,054
4,113,055
hide layouts when softkeyaboard is open
<p>I want to know is there any way to hide layouts when soft keyboard is open ,</p> <p>think I have a 3 layouts that fill the the screen , I want when I open soft keyboard , soft keyboard be over of screen , and layouts do not fill to match keyboard </p> <p>is it possible </p> <p>Also I do not want to set then Gone ...
android
[4]
5,370,325
5,370,326
Java Deflater always returning 0 issue
<p>So I have a input stream from which I read a smaller fixed-size buffer which I'm trying to Deflate inside a Runnable class.</p> <pre><code>randomClass implements Runnable { public void run() { ... byte[] output = new Byte[FIXED]; Deflater deflater = new Deflater(); deflater.setIn...
java
[1]
5,610,082
5,610,083
What's the difference between `HTMLElement` and `Element`?
<p>What's the difference between <code>HTMLElement</code> and <code>Element</code> ?</p> <p><code>document.createElement("div") instanceof Element</code> gives true</p> <p><code>document.createElement("div") instanceof HTMLElement</code> gives true</p> <p><code>HTMLElement === Element</code> gives false</p>
javascript
[3]
5,757,249
5,757,250
Grab htmls results from a php statement?
<p>I was wonder if there was a way to take the html results that was created from a php script and take that html code generated and put it inside another php script?</p> <p>The problem I'm having is that I'm working inside a huge php script and I always have errors when I'm working inside it. I want to make additions...
php
[2]
1,494,295
1,494,296
How to refer to the target value of list/dictionary comprehension in condition clause?
<p>In the following examples,</p> <pre><code>[f(a) for a in range(10) if f(a) &lt; 50] {k: f(a) for k in range(10) if f(a) &lt; 50} </code></pre> <p>Is it possible to eliminate the repeated <code>f(a)</code>, without introducing a wrapping list/dictionary comprehension?</p>
python
[7]
2,274,852
2,274,853
Ext.Ajax.request failure() does not work?
<p>This is my implementation class.</p> <pre><code> @Override public void loginPage(String uid, String Passwd) throws Exception { Connection connection = persister.getConnection(); Statement statement = connection.createStatement(); String sql = "select mailid,password from accoun...
javascript
[3]
5,411,879
5,411,880
How to get access to hostfile on different machines(WIndows,linux etc) using Java
<p>Hi I am trying to parse host files kept at different locations on different machines. Plz help me in getting access to host files assuming i can have all types of machines(Windows,linux,mac etc). I want a complete method in java that parses hostfile irrepective of the underlying system.</p> <p>Till now i was hardco...
java
[1]
1,408,308
1,408,309
Searching Access Database based on Textbox choice
<pre><code>private void btnSearchDB_Click(object sender, EventArgs e) { OleDbConnection accessConnect = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\ECM\ECM\ECM\ECM.mdb"); DataTable dt = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM ECMe...
c#
[0]
3,211,326
3,211,327
each implementation in the underscore.js library
<p>Question about the implementation of the "each" function I found in the underscore.js source code (source below). </p> <p>First, could someone explain what the line "else if (obj.length === +obj.length) " is checking for.</p> <p>Second, could someone explain why hasOwnProperty.call(obj, key) is used, as opposed t...
javascript
[3]
3,968,146
3,968,147
Child Page Activity not Started after inflating ChildView
<p>I am new to Android. </p> <p>I want to do iPhone like <code>SplitView</code> in Android. I did it using <code>LayoutInflater</code>.</p> <p>The view is coming in my child <code>LinearLayout</code> but the activity of that view is not started.</p> <p>So it just render the view it is not starting activity of that <...
android
[4]
26,101
26,102
How to get all files from folders and subfolders with full path using scandir
<p>I am looking for a solution how to get all files from folders and subfolders with full path using scandir?</p> <p>I wrote this so far:</p> <pre><code>function listFolderFiles($dir){ $ffs = scandir($dir); $i = 0; $list = array(); foreach ( $ffs as $ff ){ if ( $ff != '.' &amp;&amp; $ff != '.....
php
[2]
2,866,807
2,866,808
Understanding the scope of a typedef in two structs (functors)
<p>If I <code>typedef</code> some type within a struct (functor), is the scope of the <code>typedef</code> local to the struct? </p> <p>Consider the following example where I have typdef'ed foo to be an <code>int</code> and a <code>double</code> in the two separate functors. Is this example correct? </p> <pre><code>t...
c++
[6]
165,640
165,641
Android - get the activity result when the calling activity finished
<p>is there a way to get result from activity to one activity before the calling activity becuse the calling activity have noHistory attribute and the back button passing me to the one before?! </p> <p>thanks for the help!</p>
android
[4]
3,262,610
3,262,611
CompositeControl design time GUI creation
<p>I don't know if this is a right question, but i need to understand how it works. </p> <p>I want to create CompositeControl with design time support, the GUI of the design time support is rendered CreateChildControls().</p> <p>My question is: When i drop this control on aspx page, what is actually happening in the...
asp.net
[9]
2,915,528
2,915,529
how to delete first line in a txt file
<p>i am new in c#.</p> <p>I want to delete the first line in the txt file .</p>
c#
[0]
686,069
686,070
How to send secure variable from one page to another in php
<p>I want to send a variable to a page, so that data is displayed from database using that variable. I cannot use session variable because i have many pages each with different value for the variable. For example I have four pages, A,B,C,D. When a user visits A, it will redirect to a master page with a variable from A,...
php
[2]
5,780,408
5,780,409
Run code when Android app is closed/sent to background
<p>I have an Android application which sends some data to a webservice. I need to send this data as soon as the application is closed or sent to background.. But how do I accomplish this?</p> <p>My current solution is to run it on the OnPause() on my home activity, but I need this to run no matter which activity the u...
android
[4]
788,643
788,644
Generate calling graph for C++ code
<p>I'm trying to generate calling graph with wish to find out all the possible execution paths that hitting a particular function (so that I don't have to figure out all the paths manually, as there are many paths that leading to this function). For instance:</p> <p>path 1: A -> B -> C -> D<br> path 2: A -> B -> X -> ...
c++
[6]
1,619,158
1,619,159
saving the file content in the memory
<p>I have a fairly large pickled (dict) file in binary format that takes few seconds to load every time I look up a score from it. I was wondering if it's possible to load the file just once in the memory and look up from it until I'm logged out of the program. Also, if there's any other way around to speed up my searc...
python
[7]
5,196,796
5,196,797
Specialization of 'template<class _Tp> struct std::less' in different namespace
<p>I am specializing the 'less' (predicate) for a data type.</p> <p>The code looks like this:</p> <pre><code>template&lt;&gt; struct std::less&lt;DateTimeKey&gt; { bool operator()(const DateTimeKey&amp; k1, const DateTimeKey&amp; k2) const { // Some code ... } } </code></pre> <p>When compiling (g++ 4....
c++
[6]
5,475,777
5,475,778
Saving array of remote images in server
<p>So, I have this code, but didn't worked</p> <pre><code>&lt;? foreach($itemlist as $item) { $imagepic = $item['mainpictureurl']; for($k=0;$k&lt;count($imagepic);$k++){ echo $imagepic++; echo "&lt;br&gt;"; $isok=copy($imagepic[$k] , $_SERVER . dirname(__FILE__).'/test/item_...
php
[2]
2,173,533
2,173,534
Global variables in Python
<p>Hi I tried the following example (i <strong>don't</strong> have <code>im</code> in the global) and found that the program actually runs and outputs 10. </p> <p>Is Python dynamic scoped? </p> <pre><code>def useGlobal(): def inSide(): print 'inside', print b b = 5 print im inSide() i...
python
[7]
5,941,034
5,941,035
assistance with using the £ symbol in php echo
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3716178/encoding-issue-pound-symbol-appearing-as-symbol">Encoding issue: &#163; pound symbol appearing as &lt;?&gt; symbol</a> </p> </blockquote> <p>I am doing some basic echo statements and when i use echo "£" ...
php
[2]
1,107,513
1,107,514
Insert html table row to a specific location with jquery
<p>I have a HTML table that contains price information. The table is sorted be price Ascending. I'm looking to update the table with a new price item. I'm pretty sure jquery should be able to solve this issue. Here is my starting table:</p> <pre><code>&lt;table id='priceTable'&gt; &lt;tr id="25607"&gt; &lt;td&gt;...
jquery
[5]
1,514,910
1,514,911
What does the ./ (dot slash) operator represent in Python?
<p>I am trying to port a piece of code from Python to PHP. I've come across a line that I don't understand the notation for.</p> <pre><code>secLat = 1./cos(lat) </code></pre> <p>What does the ./ operator do in this context?</p>
python
[7]
3,424,639
3,424,640
Android Layout Highlight?
<p>How to Highlight the Layout in Android?</p>
android
[4]
5,044,414
5,044,415
how can i post the value of this dynamic textbox to php script
<p>i make a dynamic textbox through javascript now i want to post the data of all dynamically generated textboxes to php script and then insert into a table. how can i do this...</p> <pre><code> &lt;head> &lt;title>Dynamic Form&lt/title> &lt;script language="javascript"> function changeIt() { var i = 1; my_div.innerHT...
php
[2]
392,779
392,780
Searching for strings in files along with using os.walk
<p>I have written a Python Script to find out lines containing a particular script from each of the files within a directory. It works fine if i make this script run in the directory having those files. </p> <pre><code>#!/usr/bin/env python import os def searchthis(location, searchterm): for fname in os.listdir(...
python
[7]
2,437,996
2,437,997
Tell me the detail of virtual table in C++
<p>Can anybody tell me about the virtual table concept?</p>
c++
[6]
1,129,884
1,129,885
Settings option on click of Menu button - Launcher
<p>I am successfully making a launcher, but i need to add another settings option. When i click on the menu button it will show. When you click on it, it goes to an activity.</p> <p>For example. In the default launcher, when you hit menu on a home screen you can add, or set a wallpaper, ect. When you click on wallpape...
android
[4]
1,396,468
1,396,469
grid view rows at once
<p>i have a grid view where each row has a check box so for all those roes which are checked i want to save in data base how can i achieve this?</p> <p>do i need to perform separate database operation for each datarow or i can send all row to database at once do i need to write some special query?</p> <p>or i can ha...
asp.net
[9]
2,729,477
2,729,478
Using Parent Directories in Manifest.in
<p>I know MANIFEST.in recognizes relative paths. However, can I use relative paths that point to directories outside of the project?</p> <p>For example:</p> <pre><code>/home /random_dir /python_project MANIFEST.in setup.py /packages </code></pre> <p>And then inside MANIFEST.in</p> <p...
python
[7]
3,571,413
3,571,414
What does this PHP (function/construct?) do, and where can I find more documentation on it?
<p>Simple question. Here is this code.</p> <pre><code> $r = rand(0,1); $c = ($r==0)? rand(65,90) : rand(97,122); $inputpass .= chr($c); </code></pre> <p>I understand what it does in the <strong>end</strong> result, but I'd like a better explanation on how it works, so I can use it myself. Sorry if this is ...
php
[2]
731,342
731,343
if statement executing when condition is false
<p>I'm tinkering with a projecteuler problem and I encountered the following really odd behaviour. And I can't for the life of me figure out whats going on. </p> <p><img src="http://i.imgur.com/0Ds4I.png" alt="Screenshot"></p> <p>As the screenshot shows. The condition evaluates to false, and the if-statment executed ...
c++
[6]
3,074,056
3,074,057
How I can access Database running in UNIX OS using ASP.NET
<p>I'm new in ASP.NET Programming .. I want to build a simple program which communicates Informix-Database running on HP-UNIX server. I have the following information:</p> <p>DB Name Server IP Username Password</p> <p>I want to know how I can establish a connection through my ASP program?</p> <p>Thank you for your h...
asp.net
[9]
2,010,340
2,010,341
Javascript Scrolling Image edge detection
<p>Currently I am experimenting with a little Image Zoom/Scroller script that I am trying to create, and yes I know there are plugins out there that do this but I am developing this for a lightweight version and for learning to. The main problem I have now is, that I am not sure how to constrain my image scrolling to o...
javascript
[3]
505,346
505,347
Pass on variable to set in C#
<p>I want a pass several variables to a function to and set them to something else instead of reading from them. I am planning to use this in a scenario where i can create a object, and add it to a execution queue. Would a pointer be right for this?</p> <p>I am aware my question has a poor explanation, but I don't kno...
c#
[0]
4,127,875
4,127,876
Using AccessKey in asp.net
<p>I am confused. Should I use AccessKey to create a shortcut or use plain javascript to create shortcuts on the buttons on my asp.net page. What's the difference in the two approaches?</p>
asp.net
[9]
1,014,353
1,014,354
I am reading file but while reading,it is reading last character one time extra?
<p>I am trying to read file by following code</p> <pre><code>void main() { int i=0; ifstream fout1 ("Aj.txt",ios::binary); if (fout1.is_open()) { while(fout1) { i++; fout1.get(ch1); cout&lt;&lt;ch1; } cout&lt;&lt;i; fout1.close(); } else ...
c++
[6]
741,472
741,473
What does Layout Inflater in Android do?
<p>What is the use of <a href="http://developer.android.com/reference/android/view/LayoutInflater.html"><code>LayoutInflater</code></a> in Android?</p>
android
[4]
1,225,689
1,225,690
c++ how to prevent function parameter evaluation
<p>Is it possible to prevent function parameter evaluation? As I don't want to evaluate the function parameter in some situation.</p> <p>E.g. To log a debug message,</p> <pre><code>void log(int severity, ...); </code></pre> <p>I want to log a message</p> <pre><code>log(DEBUG, "%s", getErrorMsg().c_str()); </code></...
c++
[6]
1,776,473
1,776,474
how to get the sound fade in functionality in alarm application using media player in android
<p>Hi i am new to android. I am developing a application with alarm functionality. Here i need to provide the sound fade in functionality. I am using media player to invoke the ringtone for alarm. here is my code for playing alarm sound</p> <pre><code> try { if(mp==null){ System...
android
[4]
1,700,776
1,700,777
Passing array by value
<p>Is it possible to pass an array by value to a C++ function?</p> <p>If it is, how would I do that?</p>
c++
[6]
1,965,872
1,965,873
Android Login page design
<p>I am android "beginner". I want to create login page design (using user name password ) reterive data from the sqllite database? Can you help me?For Example like G mail etc</p>
android
[4]
1,122,614
1,122,615
FORCE limit the value of a column
<p>How do you force a limit total? Is this correct syntax? or am I missing something cause it's exceeding total number from my calculation.</p> <pre><code> switch (ddlVal) { case RequestTypes["Sick"]: case RequestTypes["Late"]: case RequestTypes["Jury Duty"]: tbEffectiveDate.disabled = false; ddlTotalHoursEf...
javascript
[3]
154,873
154,874
Refactor my data reader to work with multiple tables
<p>How can I improve this method so that it works with multiple tables? </p> <pre><code> public void ExecuteStoredProcedure(string StoredProcedureName) { using (var connection = new SqlConnection(provider.ConnectionString)) { using (var command = new SqlCommand(StoredProcedureName, conne...
c#
[0]
2,958,818
2,958,819
jQuery plugin: certain code should be called only once
<p>I am trying to write a jQuery plugin. For simplicity let's say that my code is</p> <pre><code>$.fn.myplugin = function() { return this.each(function() { $('a.mypluginToken').live('click', function(){}) } } </code></pre> <p>As per above code every single time $('a').myplugin is called, a binding is done for...
jquery
[5]
3,795,327
3,795,328
How do I print the binary representation of the first character in a string
<p>i want to retrieve the binary values of the data in the file. so i have written the following the code:</p> <pre><code>while ((fileData = br.readLine()) != null) { byte b[] = fileData.getBytes("UTF-8"); BigInteger bi = new BigInteger(b); String s = bi.toString(2); System.out.println("Original message in bin...
java
[1]
672,649
672,650
Simple javascript form reset when certain text boxes are clicked
<p>Morning all...thicky, newbie Rich here!</p> <p>I have a very simple set up, three different search options for finding product information i.e. a cascading drop down list, a product search text box and a radio button list.</p> <p>Ideally, I do not want the form to get cluttered with information or have to use a 'c...
javascript
[3]
5,530,178
5,530,179
button click method doesn't work as it's visibility changes
<p>I have a picturebox(called pic_Image) and 2 buttons(called btn_AddImage &amp; btn_RemoveImage). I want to make the buttons visible as user moves the mouse on the pic_Image and make them invisibe as mouse leaves the pic_Image. this is the code for making visible:</p> <pre><code>private void pic_Image_MouseMove(objec...
c#
[0]
1,714,448
1,714,449
how to display elements in an array of arrays in java
<p>Following is the code i tried</p> <pre><code>import java.lang.String.*; import java.io.*; public class Main { public static void main(String[] args) { String [][] array1 = new String[][] { {"One"}, {"One", "Two", "Three"}, {"One"," Four"," Five"}, {"One"," Four", "Six"," Seven"}, {"Seven", "Eig...
java
[1]
4,017,089
4,017,090
Can we use multiple forms in a web page?
<p>So far, all the web pages I met contain at most 1 <code>&lt;form&gt;</code> tag. Why not multiple ones? I can not think of reasons why multiple forms can't coexist within the same web page.</p> <p>Also, to be speicific to ASP.NET - why all the server controls are placed within the <code>&lt;form&gt;</code> tag? Why...
asp.net
[9]
3,102,346
3,102,347
suitable datastructure to store the parsed data from webservice
<p>I am developing an iphone app that utilizes webservice. Which is the most suitable datastructure that can be used to store the data as the XML obtained from the webservice is parsed ...?</p>
iphone
[8]
4,432,987
4,432,988
In python, how do I get the same behavior as when __name__ == '__main__':
<p>What is the best way to get this block of code to run when I import main.py rather than run it? </p> <pre><code>#main.py if __name__ == '__main__': #Do something interesting. #Do something to have the interesting code run after importing the file. import main.py main.__main__() # wrong of course. </code></...
python
[7]
3,470,685
3,470,686
wrong output code
<p>The following code gives the wrong binary output: The input is a HEX number and the output should be a binary number.</p> <p>It always outputs:</p> <pre><code>0 0 0 0 </code></pre> <p>How can I change it so it outputs the right binary number?</p> <pre><code>#include &lt;iostream&gt; using namespace ...
c++
[6]
3,864,694
3,864,695
How can i make a function that finds an object in a set?
<p>I'm making a program that generates a maze and then uses bredth first search to find a way in the maze. My function that checks if an element is present in a container-class now uses the vector like this (where coordinatePath is a typedef for vector) :</p> <pre><code>bool Labyrinth::inVisited(const Coordinate &amp;...
c++
[6]
3,049,686
3,049,687
Got hit by an UnsupportedOperationException
<p>I have the following code:</p> <pre><code> private static ArrayAdapter&lt;String&gt; adapter; private static List&lt;Chapter&gt; chapters; public void update(Book book) { adapter.clear(); if (chapters != null) { chapters.clear(); } chapters = DataBaseConnector...
android
[4]
894,405
894,406
Sorting arrays: second last
<pre><code>ksort ($votes); foreach ($votes as $total =&gt; $contestant){ $ordervotes[]= $contestant; } echo "&lt;li&gt; And the winner is: {$ordervotes[4]}&lt;/li&gt;"; echo "&lt;li&gt; And the loser is: {$ordervotes[0]}&lt;/li&gt;"; echo "&lt;li&gt; {$ordervotes[1]} ca...
php
[2]
3,866,574
3,866,575
stopping variables from resetting on self call
<p>In the following PHP code, I'm trying to generate a random number if its not already and store it in a variable called <code>$number</code>, also I'm taking user input and storing it in <code>$userInput</code>.</p> <p>Every time the submit button is pressed , the same page is called again using <code>$_SERVER['PHP_...
php
[2]
511,137
511,138
Need to display name in a toast
<pre><code>protected final Dialog onCreateDialog(final int id) { Dialog dialog = null; switch(id) { case DIALOG_ID: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Certificate saved successfully. Would you like to add another certificate?") .setCancel...
android
[4]
5,324,735
5,324,736
Datatables table tool design change?
<p>I am using datatables table tool plugin for exporting to csv file..the button usually shown on the top of the datatables...but i want to show below the table how to do that?</p>
jquery
[5]
1,859,551
1,859,552
jQuery Delay and Queue not always running after window.onhashchange
<p>This code seems to work perfectly:</p> <pre><code>window.onhashchange = function(){ if (!window.location.href.match('#pop')) { //alert('go back last'); $('#main').removeClass('hidden'); $('.pop').removeClass('pop-ready'); $('.pop').addClass('pop-hidden'); } /* navigate b...
jquery
[5]
5,769,262
5,769,263
How to use onSaveInstanceState with a lot of data and objects
<p>When my application became sophisticated and main activity started holding in memory a lot of data (loaded and parsed from files in response to user actions) I have (mistakenly) switched from <code>onSaveInstanceState</code> to <code>onRetainNonConfigurationInstance</code> without noticing that <code>onRetainNonConf...
android
[4]
1,352,716
1,352,717
How to dismiss the iPhone number pad?
<p>Is there any simple method other than the one seen in</p> <p><a href="http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key" rel="nofollow">http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key</a></p> <p>to dismiss a Number pad in iPh...
iphone
[8]
3,631,155
3,631,156
ASP.Net connection keep alive for long running server-side task
<p>I have an ASP.Net C# web application, running on IIS, that I'm supporting which involves generation of word documents. Some of these word documents take a very long time (i.e. upwards of 20-30 minutes) to generate. What I notice while testing on my dev server is that the server closes the connection long before th...
asp.net
[9]
1,384,858
1,384,859
Need every permutation of capitalized letters in php
<p>I want to build an array in php that contains every possible capitalization permutation of a word. so it would be (pseudocode)</p> <pre><code>function permutate($word){ for ($i=0; $i&lt;count($word); $i++){ ...confused here... array_push($myArray, $newWord) } return $myArray; } </code></pre> <p>So...
php
[2]
1,547,308
1,547,309
how to raise event if method was not called in last 5 seconds?
<p>Sorry about that probably too simple question but I do not know how to implement this. If certain method was not called for certain ammount of time I need to raise an event (when I receive this event I will try troubleshoot problem. This is kind of connetion problem and I need to be notified about it to try to solve...
c#
[0]
2,974,447
2,974,448
How can I stream rmvb files from Desktop to my android phone
<p>Is there a way for me to stream RMVB files from my Desktop to my android phone? I have both phone and desktop on the same Wifi network, I just want to know how can I stream from desktop to my android phone?</p> <p>Thank you.</p>
android
[4]
1,603,528
1,603,529
How to send form values to external url and to email id at the same time using php
<p>I like to know how to send the form details to an external url as well as to email id. I had an experience in programming to the form details to email id, but one of my client is asking to redirect the copy of form details to the url as like this <code>http://someipaddress/XDKRT/SalLeadEntWeb.ASP</code> , my website...
php
[2]
4,740,766
4,740,767
Where to get Android Video tutorials?
<p>Hi I am new in android programming, in fact I am new in programming and want to learn quickly, my question is how and where to get free android video tutorials? I also have lynda tutorials but is there anything else?</p>
android
[4]
1,358,908
1,358,909
Displaying Photos in a ListView, how to get adapter to preload before users can see the list?
<p>I need to display a number of photos in a list view which are pulled from urls in a list view. Unfortunately there is some variance in the download time. The actual downloading is being done in the adapter for the ListView. these downloads are runOnUIThread. (Yes, i know this is horrible design). So whats happe...
android
[4]
2,111,483
2,111,484
Expandable ListView
<p>How we can create Expandable ListView with group icon on Right.have any one implement it...</p>
android
[4]
4,863,670
4,863,671
Android - How to delivery result to any activity?
<p>suppose that you have 3 Activities (A, B and C) and Activity A starts B, and B starts C. </p> <p>I need that activity C delivery result to Activity A, because activity B is finished when starts activity C.</p> <p>This code do not works:</p> <pre><code>public class ActivityA extends Activity { @Override pr...
android
[4]
420,223
420,224
Red exclamation mark over the project in eclipse
<p>I am trying to run a project but there is a red exclamation mark over the project name. When checked in Problems, its throwing an error "project is missing required library". The library is pointed to android.jar located in some path. When checked in package explorer, I found the android.jar in Android 2.3.1 folder ...
android
[4]
191,446
191,447
Exclude numbers starting with a certain three digits in C#
<p>I am currently building a C# application that is generating a random 9 digit number each run through. I am looking for a way to exclude numbers starting with "666". How would I go about writing a statement to exclude numbers starting with certain digits. </p> <p>Here's the code snippet just in case it helps.</p> <...
c#
[0]
475,347
475,348
how do you pass a parameter to a function when it is called by reference?
<p>I've created a global variable to pass informatin to a method that is called via a method reference</p> <pre><code>d_g.onerror=i_bm_err_fix; </code></pre> <p>I tried passing it the variable like this(below) but it did not work.</p> <pre><code>d_g.onerror=i_bm_err_fix(d_g); </code></pre> <p>All I'm trying to do i...
javascript
[3]
5,163,563
5,163,564
System.IO.FileStream is super slow on huge files
<p>I have a piece of code that needs to be able to modify a few bytes towards the end of a file. The problem is that the files are huge. Up to 100+ Gb.</p> <p>I need the operation to be as fast as possible but after hours of Googeling, it looks like .Net is rather limited here???</p> <p>I have mostly been trying usin...
c#
[0]
2,190,680
2,190,681
How to pass optional parameters to a method in C++?
<p>How to pass optional parameters to a method in C++ ? Any code snippet...</p>
c++
[6]
2,318,697
2,318,698
java print out a double array
<p>i have an array with some double value inside:</p> <pre><code>private double speed[] = {50, 80, 120, 70.3}; public void printSpeed() { for(int i = 0; i&lt;=speed.length-1; i++ ) { System.out.println(speed[i]); } } output 50.0 80.0 12.0 70.3 wanted output 50 80 12 70.3 </code></pre> <p>How to do...
java
[1]
44,995
44,996
cpp unit set up and teardown functions
<p>can any one tell me how and when setup and teardown functions are called in cppunit. Thanks</p>
c++
[6]
4,880,365
4,880,366
fetching the label text from database in C#
<pre><code> private void button5_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Data Source=MAZI-PC\\PROJECTACC;Initial Catalog=programDB;Integrated Security=True"); SqlCommand cmd = new SqlCommand("select label_sh from label_text where label_form='2' and lab...
c#
[0]
4,813,190
4,813,191
php session_destroy browser remembering username and password
<p>I am using the php authentication method for digest authentication as shown on the <a href="http://php.net/manual/en/features.http-auth.php" rel="nofollow">php manual</a>. All is working well except for the logout part.</p> <p>I am using <code>session_destroy()</code> to try and log my users out, which it does. How...
php
[2]
2,382,674
2,382,675
C# log base 10 and rounding up to nearest power of 10?
<p>if i have a number between 100 and 1000 i want to get the value 3 because 10^3 = 1000. Likewise, if i had a number between 10 and 100 i would want to get the value 2, because 10^2 is 100.</p> <p>Incase you're wondering, its to do with calculating a probability and i always need to divide through by 10^value, to kee...
c#
[0]
4,418,091
4,418,092
Error: "an object reference is required for the non-static field, method or property..."
<p>Im creating an application on C#. Its function is to evualuate if a given is prime and if the same swapped number is prime as well. When I build my solution on Visual Studio, it says that "an object reference is required for the non-static field, method or property...". Im having this problem with the "volteado" an...
c#
[0]