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
3,198,316
3,198,317
What does this Javascript do?
<p>What is this line doing:</p> <pre><code> var tfun = new Function("_", "at" , "with(_) {return (" + text + ");}" ); </code></pre> <p>What is the <code>_</code>, <code>at</code>, and <code>with(_)</code>?</p> <p>I've read this: <a href="http://www.permadi.com/tutorial/jsFunc/index.html" rel="nofollow">http://www.p...
javascript
[3]
4,197,896
4,197,897
While clicking the view it automatically selects the first Radiobutton in android
<p>I have a view with <code>TextView</code> and <code>RadioButton</code>, if I click TextView first option in radio button gets selected automatically. I had also specified <code>android:focusableInTouchMode="false"</code> in layout and I'm using <code>Android 2.2.1</code> Versions. Any solution to this problem??</p> ...
android
[4]
1,882,730
1,882,731
How to get info about all running activities in android?
<p>all</p> <p>i am abserving one thing in android.</p> <p>If any thing happened in frontend of android.</p> <p>you get info by watching the log cat.</p> <p>For example if u open camera,in logcat it display the camera event is opened.</p> <p>like thet every thing you get by watching log cat.</p> <p>ok fine, is the...
android
[4]
4,609,354
4,609,355
how String object is allocate memory without having new keyword or constructor?
<p>In C# if we want to create a variable of type <code>string</code> we can use:</p> <pre><code>string str="samplestring"; // this will allocate the space to hold the string </code></pre> <p>In C#, <code>string</code> is a class type, so if we want to create an object, normally we have to use the <code>new</code> key...
c#
[0]
3,411,504
3,411,505
Android Threading
<p>Hey, So im newish to android and Im lost because although my code uses AsyncTask for it's heavy lifting I am still getting a ANR error when I run my one class. So here is the relevant peices of my code:</p> <pre><code>package com.cody.color; import android.app.Activity; import android.os.Bundle; public class Pla...
android
[4]
4,297,626
4,297,627
How to send encoded Base64 image string to server using JSON object
<p>I am new in android . i have send image to server using Json format as a string.</p> <p>so i have Encoded image string i.e base64 string.</p> <pre><code> Json j = new JSonObject(); String Image_string = Base64.ToEncodedString(bytearray, Base64.Default); j.put("image_file_content",Image_string); </code></pre> ...
android
[4]
4,444,405
4,444,406
Is it possible to Improve this Jquery code?
<p>I am currently doing this:</p> <pre><code>var currFilterList = ""; $('.prod-filters input[type=checkbox]:checked').each(function() { currFilterList += $(this).attr('data-groupid')+','; }); </code></pre> <p>I was thinking it could be cool to do something like:</p> <pre><code>var currFilterList = $(blahblah).each(...
jquery
[5]
3,818,021
3,818,022
PHP crashing on occasion - APC error?
<p>Any thoughts on this? We've had this happen twice recently. Basically, every page throws a fatal error, fixed by an apache restart. Here's what's in the log, repeated over and over.</p> <p>[Tue Apr 13 15:18:12 2010] [error] [client 10.0.0.2] PHP Fatal error: Internal Zend error - Missing class information for ...
php
[2]
546,757
546,758
What characters should be allowed in a URL and How do I make sure / get rid of unwanted characters?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4223980/the-ultimate-clean-secure-function">The ultimate clean/secure function</a> </p> </blockquote> <p>I am looking for some solution to make sure my $_GET incoming data only has what is needed and not some ot...
php
[2]
506,564
506,565
Re-read what the method is suppose to be, do my code look about right?
<p>I just re-read what the method is supposed to do:</p> <ul> <li>Add the give Picture at the end and the method insert it at the position given by the "where" parameter value. Value should between 0 - nPictsInAlbum</li> <li>When it is 0, the Picture is inserted at the beginning and the other Pictures are shifted righ...
java
[1]
3,631,623
3,631,624
Get an instance of activity that starts another from intent
<p>Is there a way to get an instance of the activity that has called the currently running activity from the intent object that has been passed to it? eg. if A has called B, I would like to retrieve A's instance from the intent in B's onCreate method. As Activity is not Serializable i am not able to pass the instance i...
android
[4]
3,304,838
3,304,839
How can I test whether this Javascript object has any properties?
<p>I have some code that adds properties to an object like this:</p> <pre><code>var MyObject = new Object(); if (....) { MyObject.prop1 = .... ; } if (....) { MyObject.prop2 = .... ; } if (....) { MyObject.prop3 = .... ; } </code></pre> <p>After going through all these if statements, I want to test and see whether <...
javascript
[3]
5,389,075
5,389,076
Showing val as html inside of a div in real time
<p>I'm using the following in order to have on screen display of each value of a checkbox that's selected with great results when it's displayed inside a textbox. I'd like to change it so that I can show a real time display in a div as html instead of a textbox.</p> <p>A <a href="http://jsbin.com/ujuse" rel="nofollow"...
jquery
[5]
4,061,294
4,061,295
JQuery throw if more than an element is returned by a selector
<p>In jQuery is there a way to throw/return no elements if jQuery selector returns more than one DOM element? I know you can wrap every call with a simple check, but I'd like to use an existing method if any.</p>
jquery
[5]
4,837,693
4,837,694
Writing wrapper for 3 different classes which 3 different unordered_map and related functions of each class
<p>I have 3 different classes .Each having a different boost::unordered_map and associated functions . In the Ist classs, unordered_map has key as long int and returns pointer to struct tm. And i have function like <code>tm * Maketime(long int)</code> .</p> <p>In the second class, map takes key as Struct tm and value ...
c++
[6]
305,976
305,977
jQuery search/replace all body text problems
<p>I am doing a complex language translation in <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow">jQuery</a>. I am copying some of the methods used in the jQuery/Google translate, but using our own XML files for getting original English and translated languages.</p> <p>I am able to easily read English and o...
jquery
[5]
1,009,053
1,009,054
Redirect The User After Login
<p>I have a page that only allow the user accessing the page after login. Say that this page is </p> <blockquote> <p><a href="http://www.example.com/secret/data/important.php?id=23&amp;pin=2if24scrtw2323" rel="nofollow">http://www.example.com/secret/data/important.php?id=23&amp;pin=2if24scrtw2323</a>.</p> </blockquo...
php
[2]
516,791
516,792
c# previous week date
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/658353/calculate-previous-weeks-start-and-end-date">Calculate previous week&#39;s start and end date</a> </p> </blockquote> <p>I need to get the previous week start date in c# for eg. today is Jan 9th. previous ...
c#
[0]
936,167
936,168
Call a functor in Python
<p>Should be easy, but somehow I don't get it. I want to apply a given function. Background is copy a class and applying a given method on the newly created copy. </p> <p><strong>Major Edit. Sorry for that.</strong></p> <pre><code> import copy class A: def foo(self,funcName): print 'foo' ...
python
[7]
3,070,935
3,070,936
Element's Value is Null - I am not representing this correctly, I think
<p>Here's my code - I am getting an error in my firebug console that document.getElementById('deletebutton').value is null.</p> <p>EDIT: To explain what I want - I want code to execute if one of two submit buttons is pressed - this is code to determine whether it was the delete button that was pressed (if not, it shou...
javascript
[3]
5,539,697
5,539,698
PHP files not loading properly
<p>I have a PHP file consisting of the following structure:</p> <pre><code>&lt;html&gt;... headers, scripts &amp; styling ... some html here &lt;?php if($_GET['v'] == 1) { ?&gt; ... html code here ... &lt;?php } else { ?&gt; ... html code here ... &lt;?php } ?&gt; &lt;/html&gt; </code></pre> <p>So...
php
[2]
2,821,291
2,821,292
Reverse iterate over a std::vector with forward iterators
<p>If I have a function which takes a <code>std::vector&lt;T&gt;::const_iterator</code> called begin and a <code>std::vector&lt;T&gt;::const_iterator</code> called end, is it possible for me to iterate over it in a backwards direction?</p> <p><strong>UPDATE</strong></p> <p>I can't change the function signature, which...
c++
[6]
4,733,396
4,733,397
How can i save captured image in SD card in Android?
<p>i am making an custom camera application so camera is open in activity view but i don't know how to save captured image in sdcard ? i have used flowing code to open camera in activity view captured photo</p> <pre><code>ublic class Camera_preview extends Activity implements SurfaceHolder.Callback,Camera.PictureCallb...
android
[4]
3,842,273
3,842,274
Panel Enabled property not propagated
<p>I am working on an ASP .Net web application in my company.<br> The application contains a composite user control made up of a checkbox, several panels and other controls. </p> <p>One panel contains severals child controls and especially a custom server control.<br> The custom server control inherits from TextBox. ...
asp.net
[9]
5,795,736
5,795,737
How do I run JavaScript in a console like environment?
<p>I'm trying to follow the the examples here</p> <p><a href="http://eloquentjavascript.net/chapter2.html" rel="nofollow">http://eloquentjavascript.net/chapter2.html</a></p> <p>and</p> <pre><code>print('blah'); </code></pre> <p>Keeps trying to send to a physical printer when run in a browser. I just want console o...
javascript
[3]
2,768,373
2,768,374
Loop through all inputs in a div with a certain class
<pre><code>&lt;script language="javascript" type="text/javascript" src="jquery-1.6.js"&gt;&lt;/script&gt; &lt;script&gt; $('.disabledForm').each(function(i, div) { alert('in here'); $(div).find('input').each(function(j, element){ $(element).attr('disabled','disabled'); }); }); &lt;/script&...
jquery
[5]
2,939,775
2,939,776
Do browsers today really not hide javascript?
<p>(This is not a duplicate of <a href="http://stackoverflow.com/questions/822872/do-web-sites-really-need-to-cater-for-browsers-that-dont-have-javascript-enabled">this question</a>).</p> <p>Are there any browsers today that, if they do not support javascript tags, fail to hide it? E.g., Firefox with adblock will not ...
javascript
[3]
1,975,886
1,975,887
How to create a new variable from the contents of another variable in python?
<p>May it's very simple question, but I'm stuck here. I have variable val as <code>val="mandy"</code>, now i want to create a list whose name is the content of val. i.e. "mandy". so how to define <code>mandy=[]</code> in python. It's like "$$" equivalent of PHP.</p>
python
[7]
4,572,936
4,572,937
Button click doesn't call function even when button attribute OnClick is set to that function
<p>I have an aspx page with two buttons, one of the buttons has an OnClick attribute to a function that should be run when clicked. When the other button is clicked there is an if statement checking if the page is a postback, if it is then I run some statements that need to be run when that button is clicked. That po...
asp.net
[9]
3,834,229
3,834,230
Delete row table using jQuery
<p>Suppose I have a table like this</p> <pre><code>id name address action -------------------------------------- s1 n1 a1 delete s2 n2 a2 delete </code></pre> <p>Delete is a link for example <code>&lt;a href="http://localhost/student/delete/1"&gt;</code>. In the real case I delete the student us...
jquery
[5]
4,906,902
4,906,903
Looking for a simple example of informal protocols in Objective C, to understand how informal protocol works actually
<p>I am looking for a simple example, which shows how informal protocols works!</p>
iphone
[8]
1,045,926
1,045,927
Run android application with instrumentation turned on
<p>I have created a customised version of android.app.Instrumentation and have modified my AndroidManifest.xml to use it. </p> <p>However when I run the application from eclipse it does not seem to load my instrumentation object (am logging and settings global (I know horrible, just for now I swear!) variables that I ...
android
[4]
767,028
767,029
Asp.net variables values
<p>I am using ASP.net in my project. </p> <p>I Declare a Variable btn_clik, tot at the beginning of Class. </p> <pre><code> public partial class Table : System.Web.UI.Page { public int btn_click = 1, tot = 0; </code></pre> <p>I have two button, Up And Down. When I click Up button btn_click variable want ...
asp.net
[9]
3,804,524
3,804,525
How to handle 3D gmailQuote style design in my web application
<p>i am sending mails to otherdomains using my own server .in my domain the reply messesages design is looking good.</p> <p>but when i got reply from gmails why design is not coming properly in my application. i debug my application in that i saw <code>&lt;div class="3D gmailQuote"&gt;</code> when got reply from gma...
asp.net
[9]
1,175,853
1,175,854
Checked exceptions and File.exists() in Java
<p>I have primarily a C# background (and am very much a newbie) so forgive me if my assumptions based on this are the problem.</p> <p>Simply put, one of the features in a piece of software I'm working on (in Java) has the user input a file name. What I intend to do is have the program loop and append a string to the e...
java
[1]
3,733,779
3,733,780
deleted NSHTTPCookie returns if app is terminated
<p>After using some code to delete all of the cookies:</p> <pre><code>NSHTTPCookie *cookie; NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (cookie in [storage cookies]) { [storage deleteCookie:cookie]; } </code></pre> <p>if you continue to use the app for a perio...
iphone
[8]
5,028,112
5,028,113
ajax jquery - track changes to table
<p>Im updating a particular table with ajax using jquery every 5 seconds. I wish to highlight in yellow, any row that has been freshly inserted or changed. How do I keep track of what has changed ? Can this be done in jquery ? (My backend is django/python)</p>
jquery
[5]
5,764,794
5,764,795
What are alternatives for these controls in iPhone
<p><strong>What are alternatives for these controls in iPhone</strong> </p> <ul> <li>Radio Button</li> <li>Check Box</li> <li>Drop Down</li> <li>x raise to Power y in UILabel</li> <li>Hyperlink</li> </ul> <p>Suggestion and answers will be appreciated, thanks.</p>
iphone
[8]
1,566,543
1,566,544
How to do Text Animations using Android SDK?
<p>So i have a code developed where when some button from the app is pressed it should get displayed in the Textview with some Animation(to add some fun). Is it possible to have text animations in Textview or should i use Canvas or SurfaceView for drawing this aplhabets with animation? </p> <p>Any help in this regard...
android
[4]
3,287,038
3,287,039
How to print the string "\n"
<p>I want to print the actual following string: <code>\n</code> , but everything I tried just reads it in takes it as a new line operator.. how do I just print the following: <code>\n</code> ?</p>
python
[7]
4,742,030
4,742,031
java program to retreive page source from google search automatically
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2085454/search-word-in-google-and-want-to-find-hits-of-each-word-using-java-program">search word in google and want to find hits of each word using java program</a> </p> </blockquote> <p>hi friends, I want to w...
java
[1]
5,782,768
5,782,769
Problem with document.getElementById
<p>This works : </p> <pre><code> alert(document.getElementById("Container").nodeName);</code></pre> <p>But this doesnt : </p> <pre><code> var CurParent = document.getElementById("Container"); alert(CurParent.nodeName);</code></pre> <p>I am using IE7. Why ? </p>
javascript
[3]
3,516,374
3,516,375
Jquery creating option elements in a for loop?
<p>I have my <code>select</code> dropdown initially being created using <code>php</code> like so:</p> <pre><code> &lt;select id="cupcake-amt" name="amt"&gt; &lt;?php for($i=0; $i&lt;50; $i++) : ?&gt; &lt;option value="&lt;?php echo $i; ?&gt;"&gt;&lt;?php echo $i; ?&gt;&lt;/option&gt; &lt;...
jquery
[5]
3,070,926
3,070,927
Getting text from a Listview
<p>I have a ListView that gets filled from a cursor (using rawQuery) that I need to get the text of the selected item from on click.</p> <pre><code>protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); Intent mViewChaptersIntent = new Intent(this...
android
[4]
4,842,106
4,842,107
create a new object from existing object
<p>I have a method called xyz which returns an object.</p> <pre><code>private XYZ xyz() { return abc; } </code></pre> <p>I want to use this method in 2 different places but I want to call the method only once.</p> <p>I mean for the first time I am calling the method to get the object.</p> <pre><code> XYZ aaa...
java
[1]
5,110,637
5,110,638
C++ download html file or get file contents
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1129194/download-a-url-in-c">Download a URL in C++</a> </p> </blockquote> <p>I want to either download/save a HTML file contents located on a remote server to local folder.</p> <p>I just need the function if th...
c++
[6]
2,675,334
2,675,335
Android: How should I structure my Activity if I need to get an item and title from a remote db?
<p>I am curious what is the best way to design an activity that simply makes a remote call and gets an item_name and item_description and needs to display that to the screen.</p> <p>I was thinking about doing a hack of a ListView, but it seems that it isn't really intended for that.</p> <p>What I really need is to be...
android
[4]
3,245,592
3,245,593
Validation in android
<p>I need allow the user to Enter only number and period in android through code</p> <p>please help me</p> <pre><code> InputFilter filter = new InputFilter() { public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { System.out.println("s...
android
[4]
3,662,216
3,662,217
Using on instead of live to hide a div with a specific id on link click
<p>I am trying to hide a div with an id <code>#op-four</code> using <code>on</code> instead of <code>live</code></p> <pre><code>$("#one").on("click", function() { $("#op-four").hide(); });​ </code></pre> <p>fiddle <a href="http://jsfiddle.net/ythSA/" rel="nofollow">http://jsfiddle.net/ythSA/</a> but it wont work<...
jquery
[5]
659,475
659,476
About the Jquery Append Function
<p>Let's assume you have a table and the following Jquery code</p> <pre><code>var rows = $('#ttable').find('tbody &gt; tr').get(); $('#ttable tbody').append(rows[1]); </code></pre> <p>Right the rows object gets all the "tr". The second line, will append row[1] to the table body, so you should get it in the end of the...
jquery
[5]
2,618,447
2,618,448
AM/PM in asp.net
<p>I need time with AM/PM format in asp.net MVC3 application and I am using the following statement:</p> <pre><code>@Model.ReportDate.ToString("hh:mm tt") </code></pre> <p>but it is returning 6:45 instead of 6:45 PM. How to fix this ?</p>
asp.net
[9]
4,060,697
4,060,698
Concatenate a string and a list
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12633024/python-concatenate-string-list">Python concatenate string &amp; list</a> </p> </blockquote> <p>Is it possible to concatenate a string and a list?</p> <p>The following code causes the error: <code>TypeE...
python
[7]
2,501,167
2,501,168
Would it be a bad idea to extend Context? Android
<p>Context: "This is an abstract class whose implementation is provided by the Android system"</p> <p>I was thinking of deriving it to include some handy methods, but I'm not sure what to make of the above line. Any thoughts?</p>
android
[4]
2,655,829
2,655,830
C++ : Aliases in function argument
<p>I have an issue with the use of aliases in function arguments. Here is my problem.</p> <p>Let's consider this function definition</p> <pre><code>void thisIsSparta(int&amp; number){ ... } </code></pre> <p>at call time, it works perfectly well with the following code :</p> <pre><code>int king = 1; thisIsSparta...
c++
[6]
1,487,995
1,487,996
C# Decimal for loop incremental .05
<p>I'm trying to do a for loop that increments .05 that stops at max int.</p> <pre><code>int maxValue = 1; Decimal maxDec = Convert.ToDecimal(maxValue); for (int i = 0; i &lt; maxDec + 1; i+0.1M) { var val = i.ToString(); } </code></pre> <p>so i'm trying to get 0.05, 0.10 ect up to 1.</p>
c#
[0]
3,282,131
3,282,132
Convert date format in PHP (without SQL)
<p>How to convert date from <code>yyyy:mm:dd</code> to <code>yyyy-m-dd</code> and <code>yyyy:mm:dd</code> (without leading zero for the month) to <code>yyyy-m-dd</code> (with leading zero to month)?</p>
php
[2]
2,535,587
2,535,588
How can I get the value of the selected item in an unordered list with $_POST?
<p>How can I get the value of the selected item in an unordered list with $_POST? I just want to show the selected item on the next page.</p> <pre><code>&lt;form id="categories" name="categories" action="register.php" method="post"&gt; &lt;ul class="list" name="categories"&gt; &lt;li&gt;&lt;a href="#"&gt;D...
php
[2]
3,491,897
3,491,898
How to display data in tabular format in android?
<p>I am new to android,now i am working on some database sample programs. Now i have a problem in displaying the data retrived from database in a tabular format.If anyone know the answer please help me with the source code.</p>
android
[4]
1,779,243
1,779,244
Special characters in PHP ldap bind
<p>Hi I am using Ldap bind for login but on my ldap server some users have special characters in cn, The ldap bind is not working when a string(not password) have special characters I tried url encode, converted special characters to utf8 format but issue remains same.</p> <p>Any Help is appreciated </p>
php
[2]
4,792,984
4,792,985
Print object values in toString
<p>I wants to override toString() method to show name of user but Name is the inner class of User class so how can I print it.</p> <pre><code>public class User { public static class Name { private String _first, _last; public String getFirst() { return _first; } public String getLast(...
java
[1]
4,767,270
4,767,271
Variable assignment and functions - this should work right?
<p>I am trying to take a variable from <code>$_POST</code>, run <code>mysql_real_escape_string</code> and a custom function, <code>html2text</code> on it. This should work, right? Or do I need to separate it on separate lines?</p> <pre><code>$orgname = mysql_real_escape_string(html2txt($orgname)) = $_POST['orgname']; ...
php
[2]
2,452,392
2,452,393
Is object[0] sort of a default key for an object in JavaScript?
<p>Here's a small JavaScript snippet:</p> <pre><code> var re_words = /\w+/g; var words; while (words = re_words.exec(' here are a few (sic!) words ')) { alert(words); } </code></pre> <p>The loop alerts the words found in the input string, which is what I expected, because all the JavaScript tutorials tel...
javascript
[3]
20,522
20,523
get website in python
<p>Can some one help me to do my homework?</p> <p>I want to write the project in python.</p> <p>Project: search for "Hello World" on bing.com and get all the sites from all the result pages and save them into "site.txt"</p>
python
[7]
5,231,135
5,231,136
Exception specification when overriding a virtual function?
<p>If a class inherits from another and overrides a virtual function, how must the exception-specification for the derived (overridden) function be related to the base function?</p> <p>Is that is must be at least as restrictive? right? or others?</p>
c++
[6]
530,571
530,572
need some advices when making a streaming application
<p>I'm developing an app on android that can play videos streamed from a server (my PC) likes youtube. I'm new to this and I need some advices to get a right approach. First, my app on android should have the ability to seek to a position that have been played. So, in the server side (my PC), what streaming server shou...
android
[4]
5,604,662
5,604,663
how to iterate from a specific point in a sequence (Python)
<p><strong>[Edit]</strong></p> <p>From the feedback/answers I have received, I gather there is some confusion regarding the original question. Consequently, I have reduced the problem to its most rudimentary form</p> <p>Here are the relevant facts of the problem:</p> <ol> <li>I have a sorted sequence: <strong>S</str...
python
[7]
1,803,795
1,803,796
How to get properties of a class in an array
<p>I have a student class with the following structure:</p> <pre><code> public sealed class Student { public string Name {get;set;} public string RollNo {get;set;} public string standard {get;set;} public bool IsScholarshipped {get;set;} public List&lt;string&gt; MobNumber {ge...
c#
[0]
5,370,981
5,370,982
How to install ndk in linux?
<p>Step1: I extracted Android NDK to a separate directory. Step2: Created a directory called project in it. Step3: Where should I create the application.mk file and what should it contents be? And, then how do I proceed to build it?</p> <p>Error I get is this:</p> <pre><code>android-ndk-r7c/project$ .././build/tool...
android
[4]
2,596,804
2,596,805
Manually add ":animated" selector to jQuery objects
<p>I have a function that animates dom elements with CSS3 if available. Now i often use the <code>:animeted</code> jQuery selector. How do i make my CSS3 Animated elements respond to <code>:animeted</code> selector also?</p> <p>When a DOM Object is animated with jQuery it gets <code>"fxqueue":"inprogress"</code> in th...
jquery
[5]
1,335,902
1,335,903
How to call method with parameter of type vector<int>::iterator& in C++?
<p>I have a method to find number in range of iterator like below. I want it has reference parameter and return reference of iterator.</p> <pre><code>// find number in range of begin and end, if number found return reference of iterator, throw exception otherwise vector&lt;int&gt;::iterator &amp;find_int(vector&lt;int...
c++
[6]
4,774,409
4,774,410
compare file with 20 other files to count the number of matches
<p>i have 20 files i want to compare it with master.txt file one by one if there are any match the program gives me the total number of matches between two files i try with the below code:</p> <pre><code>using System; using System.IO; using System.Collections.Generic; using System.Linq; namespace ConsoleApplication...
c#
[0]
1,104,973
1,104,974
How to handle objects with length of one and greater than one in a method without redunancy
<p>I'm writing my own JavaScript bind method (for practice) and am having trouble letting go of the need to handle single objects vs multiple objects differently in this method, solely because I need to loop through objects with a length greater than one. (see obj vs obj[i] below)</p> <p><strong>Is there any way I can...
javascript
[3]
3,970,631
3,970,632
I don't know the meaning of one character in a Python code
<p>I wonder what is the signification of the ';' sign in the instructions</p> <pre><code>if l&amp;lt;p: if t&amp;gt;0: if int(num)&amp;gt;=int(lst): </code></pre> <p>in the code of this question: <a href="http://stackoverflow.com/questions/4747666/optimizing-python-code">Optimizing python code</a></p> <p>Maybe an er...
python
[7]
1,456,895
1,456,896
Python sys.exit() help?
<p>I am working in Python and am trying to have a line of code execute and after it executes I am calling <code>sys.exit()</code> to have the script itself "exit." However, it seems that <code>sys.exit()</code> is executing before the line of code above it executes. Below is the code I am trying to implement:</p> <pre...
python
[7]
346,079
346,080
Largest and smallest number in an array
<p>This works perfectly...but when I use <code>foreach</code> instead of <code>for</code> this doesn't works. I can't understand <code>for</code> and <code>foreach</code> are same.</p> <pre><code>namespace ConsoleApplication2 { class Program { static void Main(string[] args) { int[]...
c#
[0]
335,403
335,404
Opening a .rtx file in the Java application environment?
<p>I have created a notepad application which is in a <code>jar</code> file, using Java.</p> <p>Using this I created a text file and saved it with the file extension <code>.rtx</code>.</p> <p>Now I want to right-click <code>file.rtx</code> in Windows, or any other platform, and in the popup I want to show my notepad ...
java
[1]
3,501,341
3,501,342
HttpHandler for a specific port
<p>I have a web application built on ASP.NET MVC framework which requires a service payment module. For the given service payment provider, I have to create a module that listens to a specific port (different from 80) at a specific url. What is the best way to achieve this? Should I create a separate Http Server applic...
asp.net
[9]
1,776,728
1,776,729
int? maxResults what does the ? means in this statement
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2699373/c-sharp-basic-question-what-is">C# - Basic question: What is ‘?’?</a> </p> </blockquote> <p>I have found this statement in a function arguments.</p> <pre><code>public static SyndicationFeed GetDataFeed(...
c#
[0]
4,536,078
4,536,079
Limit the text field characters to 50 - cannot find function slice in Object 0
<p>I am using this to limit the characters in the Text Field. </p> <pre><code>textField.value = textField.value.slice(0,50); textField.value = textField.value.replace(/[^0-9]+/, ""); </code></pre> <p>I am getting an error, cannot find function slice in Object 0.</p>
javascript
[3]
5,379,889
5,379,890
How to add a view programmatically to an xml layout in android?
<p>Hiiii there, I have an xml layout and when a button is clicked I need to add a TableLayout view to that xml layout. I know how to do this with simple stuff like text views but tables would seem to be a lot harder to define programmatically, Im not quite sure what inflating is but is that what I should be using? Than...
android
[4]
5,735,967
5,735,968
How does this program work
<p>This is my first C++ program. It prints the number of words in the input.</p> <p>My first question, how does it go into the loop and add to the count? is it every time i type the space character? if so, how does it know I'm trying to count words?</p> <pre><code>using namespace std; int main() { int count; ...
c++
[6]
4,124,278
4,124,279
Deck of Cards: How do I make it so I randomly draw a card only once?
<p>I am trying to simulate a deck of cards but I don't know how to make it so it randomly chooses a card but only once. I keep getting doubles of cards.</p> <pre><code>#include &lt;iostream&gt; #include &lt;cstdlib&gt; //for rand and srand #include &lt;cstdio&gt; #include &lt;string&gt; using namespace std; string s...
c++
[6]
3,518,638
3,518,639
select all siblings with width of
<p>how can I select all siblings with the width of a defined value?</p> <p>IE:</p> <pre><code>$(this).siblings(all with width of 400px).dosomething(); </code></pre> <p>thank you</p> <p>d.</p>
jquery
[5]
1,642,375
1,642,376
One generic event name or multiple descriptive event name
<p>Would you do:</p> <pre><code>this.btSomeButton.Click += btSomeButton_OnClick; private void btSomeButton_OnClick(object sender, EventArgs e) { this.DoFunc1(); this.DoFunc2(); } </code></pre> <p>Or:</p> <pre><code>this.btSomeButton.Click += DoFunc1; this.btSomeButton.Click += DoDunc2; </code></pre> <p>Are...
c#
[0]
243,811
243,812
How to determine the max file upload limit in php
<p>How can the file upload size allowed by php settings be determined withing a php script?</p>
php
[2]
4,537,009
4,537,010
DropDownList DataValue as object
<pre><code>DataTextField="Name" DataValueField="ID_ListGroupParIzm" </code></pre> <p>???? DataValueField2="ID_Point"</p> <p>is it real to load 2 values from sqlDataSource in one DropDown list ? Get structure object from sqlDataSource ?</p> <p>I can see only one way - making a new table to combine ID_Point and ID...
asp.net
[9]
2,840,094
2,840,095
Excel sheet using pear
<p>I am Generating excel sheet using pear in PHP.My question is how can i set uniform height for my All rows in my worksheet...??Any idea.</p> <p>Thanks in Advance.....</p>
php
[2]
1,738,840
1,738,841
Build a string of HEX and strings. How?
<p>It turns out building the following string in python...</p> <pre><code># global variables cr = '\x0d' # segment terminator lf = '\x0a' # data element separator rs = '\x1e' # record separator sp = '\x20' # white space a = 'hello' b = 'world' output = a + rs + b </code></pre> <p>...is not the same as it may be in ...
c#
[0]
2,206,464
2,206,465
How to conduct a good tech workshop
<p>I am currently trying to organize a small workshop for several people to generate interest in android. I intend to conduct a hands-on workshop, taking everyone through various components and features by building an app.</p> <p>One way I can think to do this is to write an app before hand, share it with everyone and...
android
[4]
4,578,798
4,578,799
Regarding binding array to gridview
<p>Hi I have created session array :</p> <pre><code> int[] a = (int[])Session["values"]; </code></pre> <p>Now i have to bind this value to my gridview. I have one column (boundfield in my gridview) in gridview. I used code to bind array to gridview as follows, but its giving last value only as i want all the values t...
asp.net
[9]
629,165
629,166
jquery mask output
<p>I have a jquery masked textbox which has a mask:</p> <pre><code>$("#txthtml").mask("99/99/9999"); </code></pre> <p>When I check the output, it has the '/' in its value. Is there an easy way to get only what the user entered and nothing else? So if text box read <code>01/01/1990</code> I want <code>01011990</code> ...
jquery
[5]
4,182,522
4,182,523
how to read a txt file containing matrix form of data into 2d array of same dimensions as in the file using java
<p>here is my code:</p> <pre><code>import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class csvimport5 { public static void main(String[] args) throws IOException { double [][] data = new double [87][2]; ...
java
[1]
2,830,063
2,830,064
PHP Remove URL from string
<p>If I have a string that contains a url (for examples sake, we'll call it $url) such as;</p> <pre><code>$url = "Here is a funny site http://www.tunyurl.com/34934"; </code></pre> <p>How do i remove the URL from the string? Difficulty is, urls might also show up without the http://, such as ;</p> <pre><code>$url = "...
php
[2]
2,739,558
2,739,559
Problem in animation of UIImageView?
<p>i want to make an animation of UIImageView using CGAffineTransformScale and along with it animation that uiimageview should changing it origin also. so that i written following method,</p> <p>-(void)imageDidMoving {</p> <pre><code>imageV = [[UIImageView alloc] init]; imageV.frame = CGRectMake(0, 0, 768, 1024); ima...
iphone
[8]
4,966,244
4,966,245
How to read the body of the message in the mail retrieve from gmail by using pop3 in c #?
<p>This is code:</p> <pre><code>protected void Button9_Click(object sender, EventArgs e) </code></pre> <p>{ try { // create an instance of TcpClient</p> <pre><code> TcpClient tcpclient = new TcpClient(); // HOST NAME POP SERVER and gmail uses port number 995 for POP tcpclient.Connect("pop....
c#
[0]
322,534
322,535
jQuery select parent a of an image
<p>I am trying to select the anchor tag and add a target attribute. When it is wrapped in a image with the class size-thumbnail. Anyone know why this wont work? </p> <pre><code>&lt;a href="example"&gt;&lt;img class="size-thumbnail" src="example"&gt;&lt;/a&gt; </code></pre> <p>jquery</p> <pre><code>$('.size-thumbnai...
jquery
[5]
1,342,787
1,342,788
how to disable form submit and check the form
<p>I have the following code. I need to see how many checkboxes have been checked in my form and if there are 4 or less submit the form and if there are more display an error and don't submit.</p> <pre><code>function SetHiddenFieldValue() { var checks = document.getElementById('toppings').getElementsByTagName('in...
javascript
[3]
531,647
531,648
How to restart the program? (Restart button in game)
<p>I am making a game and when you loose there is a <code>Play Again</code> button. I'd like to when you hit that have the game totally start over. It may seem like a basic question but it's within a class and it's not at the end of the program so it can't just be one big while to go back to the top. Any ideas?</p>
java
[1]
420,178
420,179
Is there a reason why this.form.target='_top' does not work and target="_top" works when placed as a form attribute?
<p>Akin to the problem faced by the author at <a href="http://cfyves.com/2011/05/05/need-form-submission-to-break-out-of-an-iframe/" rel="nofollow">http://cfyves.com/2011/05/05/need-form-submission-to-break-out-of-an-iframe/</a>, I attempted to break out of a submitted iframe however it would only work if I include the...
javascript
[3]
1,270,614
1,270,615
Remove what is after @ into an email?
<p>Let's say I have some email: <strong>some_email@yahoo.com</strong>.</p> <p>Firstly I would want to remove everything that is after <strong>@</strong>. </p> <p>And last remove anything inside what's left from the previous action what matches the special characters allowed in an email address format ( anything like ...
php
[2]