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
5,757,038
5,757,039
Android Market - Number of Installs
<p>What if somebody installs one app and from the market and then removes it and then installs it again, then will the number of installs still increase?</p>
android
[4]
4,216,910
4,216,911
JavaScript syntax
<p>I keep finding some JavaScript that looks like the example below. Can someone explain this as I have not seen JavaScript written like this before.</p> <p>What is "SomethingHere" and the colon represent? I'm used to seeing function myFunction() but not what is shown below.</p> <pre><code> SomethingHere: function ...
javascript
[3]
5,311,492
5,311,493
Removing URL Extensions
<p>Looking to remove .php from my URL's</p> <p>For example;</p> <p><a href="http://www.websitesbylewis.co.uk/about.php" rel="nofollow">http://www.websitesbylewis.co.uk/about.php</a></p> <p>to</p> <p><a href="http://www.websitesbylewis.co.uk/about" rel="nofollow">http://www.websitesbylewis.co.uk/about</a></p> <p>Th...
php
[2]
3,167,362
3,167,363
class forward declaration fails
<p>I have 2 header files and a source file,</p> <p>food.h:</p> <pre><code>#ifndef _FOOD_H #define _FOOD_H struct food { char name[10]; }; #endif </code></pre> <p>dog.h:</p> <pre><code>#ifndef _DOG_H #define _DOG_H class food; //forward declaration class Dog { public: Dog(food f); private: food _f;...
c++
[6]
2,910,949
2,910,950
Datagridview information load very slow with multiple records
<p>I have a DataGridView where I show some information on the Web, everything works fine when I have few records but the problem is when the DataGridView tries to load more than 300 records or so, because the page takes a long time loading information.</p> <p>The question is there a way to optimize such queries with a...
asp.net
[9]
1,326,478
1,326,479
How to use ajax Nobot control in Asp.net mvc
<p>I have no idea how to use Ajax Nobot control in Asp.net MVC.Please help me.</p> <p>Regards, Tejveer</p>
asp.net
[9]
2,101,977
2,101,978
Know when network connectivity returns
<p>I have an application that tries to be a good samaritan, basically when any services starts that needs to interact with the network. I am checking to see if the device has connectivity:</p> <p><strong>hasConnectivity Method</strong></p> <pre><code>private boolean hasConnectivity() { NetworkInfo info = mConnec...
android
[4]
698,182
698,183
Change input values from select list.
<p>I have two text input boxes that will need to be populated from the same selection list but each text box may have different values. What happens is that the code I have written allows you to click and change on value but when you try to do change the second value it changes both values rather than just the second v...
jquery
[5]
4,154,296
4,154,297
TabHost , TabSpec - onclick implementation
<p>i am working with TabHost , TabSpec .i want to do some actions(like onClick) when TabSpec is clicked. has anyone tried this i am able to go to another activity with "home.setIndicator("Home")...." is it possible</p>
android
[4]
2,748,071
2,748,072
javascript storing global variables in DOM
<p>I have a fairly large script that contains about 60 global variables. I'm thinking about using the namespace pattern to encapsulate my script and have only one global variable that references one object.</p> <p>Even though this pattern is considered best practice, I'm also thinking about an alternative: storing the...
javascript
[3]
2,527,068
2,527,069
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
<p>Getting this error and I'm pretty sure it's in the operator&lt;&lt; function. Both prints are public.</p> <pre><code>void CRational::print() const { print(cout); } void CRational::print(ostream &amp; sout) const { if(m_denominator == 1) cout &lt;&lt; m_numerator; else cout &lt;&lt; m_nu...
c++
[6]
698,597
698,598
Easily scale android application for smaller screen sizes
<p>Right now I have an application I built that is built for android 10.1 inch screens (tablet) and I would like to to be able to be scaled so that it work on the kindle fire (7 inch screen). What would the easiest way to do this be?</p> <p>Edit: So I've taken the advise that the majority of the people in this tread h...
android
[4]
1,898,028
1,898,029
How to check package class method in android through cmd?
<p>How to check package class method in android through cmd</p> <p>just like this type </p> <pre><code>C:\herong&gt;javap java.lang.String | find "byte" public java.lang.String(byte[], int, int, int); public java.lang.String(byte[], int); public java.lang.String(byte[], int, int, java.lang.String) th...
android
[4]
4,665,134
4,665,135
Android Inject event to browser
<p>I have developed an application in Android (Android1), which performs user action to my app installed on another Android over the LAN (Android2). The scope of action is completely inside my webview application. Now from my application installed on Android2 I open a browser , I want to know is there any event that ...
android
[4]
1,776,408
1,776,409
Directory.CreateDirectory strange behaviour
<p>I have a windows service which runs a separate thread with a function which may do</p> <pre><code>if (!Directory.Exists(TempUpdateDir)) { DirectoryInfo di = Directory.CreateDirectory(TempUpdateDir); di.Refresh(); EventLog.WriteEntry("Downloader", string.Format("DEBUG: Try...
c#
[0]
1,653,061
1,653,062
How to split a string based on every third character regardless of what the character is in c#
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/105770/net-string-format-to-add-commas-in-thousands-place-for-a-number">.NET String.Format() to add commas in thousands place for a number</a> </p> </blockquote> <p>I am trying to add commas to a number for the ...
c#
[0]
1,964,975
1,964,976
Problem with input in c++
<p>I have a very basic question i want to take integer input in certain range from user. if the user gives some string or char instead of integer. then my program goes to infinite loop.</p> <p>my code is some what like that</p> <pre><code>cin &gt;&gt; intInput; while(intInput &gt; 4 || intInput &lt; 1 ){ cout &l...
c++
[6]
5,236,144
5,236,145
doc file created in iPhone documents encoding issue
<p>I'm trying to write a MSword file in document directory by the following code:</p> <pre><code>NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES); NSString* path; NSString* gradeDoc = [self fetchCommentsDesc]; NSString* str = [self.objStudent.strName stringByAppendingFo...
iphone
[8]
2,922,998
2,922,999
Create array with all unique combinations
<p>Can't figure out how to create an array with all matches. I suppose I need a recursive function for this. </p> <p>I like to get all values from the JSON below and create an array with all value combinations. There may be more or less models (Name4) and more or less values. Any help?</p> <pre><code>var models = [ ...
javascript
[3]
4,567,511
4,567,512
Why is this code generating extra commas?
<p>I am using javascript </p> <pre><code>function chkout_pp(i) { var myarray = new Array(); var li = 1; myarray[0] = "" for(j = 1; j &lt; 13; j++) { if ($('#chkpp'+j).is(':checked') == true) { myarray[li] = $('#chkpp'+j).val()+"&lt;br&gt;"; li++; } } ...
javascript
[3]
1,916,233
1,916,234
how to assigning values for child window?
<pre><code>var selwindow = window.open('child1.html','_blank','resizable=yes,width='+(screen.width-500)+',height='+(screen.height-500)+''); selwindow.document.selectform.childText.value=document.getElementById('pdetails1').value; </code></pre> <p>I am using this code to assign a value for textbox in the child window. ...
javascript
[3]
3,302,020
3,302,021
How to format number to a currency format using String.localeFormat() using jquery?
<p>Number <code>56675.456</code></p> <p>I want to format this number with Format : <code>{0:$###.##}</code></p> <p>using <code>String.localeFormat()</code> in JQuery</p> <p>Expected Result: <code>$56675.46</code></p>
jquery
[5]
3,802,806
3,802,807
How to change the value of the Button using jquery
<pre><code>&lt;input type="button" id="badd" value="Add"/&gt; </code></pre> <p>I have one more button on the page called Edit when I click on Edit button I need to Change the Add Button value to SAVE...using jquery..</p> <p>thanks</p>
jquery
[5]
102,782
102,783
declaring more than 10 objects
<p>as we know we can declare an array like this </p> <pre><code>for (int i=0;i&lt;array.length;i++) { d[i]=new array();} </code></pre> <p>What about an object I want to declare more than 10 objects and I think it's not efficient to write a declare statements for 10 times !!like this </p> <pre><code>car c1 = new ca...
javascript
[3]
1,082,229
1,082,230
my live() method goes crazy
<p>first some code:</p> <p>I have many elements like that:</p> <pre><code>&lt;section class="item&gt; &lt;div class="caption"&gt; &lt;/div&gt; &lt;/section&gt; </code></pre> <p>the "caption" is hidden, when you go on the "item" the "caption" came in.</p> <p>I did this before with hover() and worked fine, ...
jquery
[5]
3,433,879
3,433,880
Creditcard payment in android using creditcard interface
<p>I want to make a credit card payment in android.</p> <p>I used credit card interface from this link:</p> <p><a href="http://www.innerfence.com/apps/credit-card-terminal/developer-api" rel="nofollow">http://www.innerfence.com/apps/credit-card-terminal/developer-api</a></p> <p>But when I try to run, clicking charge...
android
[4]
3,142,317
3,142,318
jquery 2 plugins breaking each other... which, and why?
<p>I am new to jQuery and am using 2 plugins together.</p> <p><a href="http://www.drewgreenwell.com/projects/metrojs" rel="nofollow">http://www.drewgreenwell.com/projects/metrojs</a> ^ For a flip effect when the page loads and mouseover flip effect.</p> <p>And rcarousel, which I can't post a link to because I'm new.<...
jquery
[5]
2,665,759
2,665,760
How to c# function using javascript
<p>I have input HTML button(Not ASP.NET Button) click event in c#</p> <p>Is there any way i can call c# function using javascript</p> <p>Thank you very much....</p>
javascript
[3]
3,967,356
3,967,357
How to add a select all button to a custom Listview
<p>I have a custom listView in my app I would like to implement my select all button I have created.</p> <p>My ListView looks like.</p> <p>[(Image)(Text)(CheckBox)]</p> <p>I have looked at some similar questions, the most common answer was with the user of the <code>notifyDataSetChanged ()</code> method, iv'e tried ...
android
[4]
2,523,745
2,523,746
How to Call an activity method from a BroadcastReceiver?
<p>I am currently developing an app, I need to call an activity method from BroadcastReceiver.</p> <p>My app is to when the user getting a call Broadcast receiver find that and send a message to that particular number. </p> <p>I am able to get that no, but I want to send a message to that number, for this sending sms...
android
[4]
5,796,636
5,796,637
PHP $_POST array for unchecked checkboxes
<p>If I have a form with two checkboxes that have have the same array as name attribute </p> <blockquote> <p>name="1_1[]"</p> </blockquote> <p>and neither of those checkboxes is ticked, is there any way I can know they were present in the form? These fields are not being sent through the $_POST array if they are un...
php
[2]
3,157,300
3,157,301
PHP code with alternating row color
<p>Hello Im new in programing. I want to create a table using the alternate row color. But dont know how to do it. Here is my code. Please help me!</p> <pre><code>while ($row = mysqli_fetch_assoc($result)) { echo '&lt;tr&gt;'; echo '&lt;td&gt;' . $row['a.ServiceID'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $ro...
php
[2]
5,961,957
5,961,958
Why does this compile
<p>I have trouble understanding what the following code <em>means</em> (and partly, why it even compiles).</p> <p>We have the following snippet:</p> <pre><code>if (true) return; { ... // Unreachable code detected } </code></pre> <p>Why does this even compile? </p> <p><strong>Am I correct in thinking that the co...
c#
[0]
860,973
860,974
How to add subitems in a ListView
<p>I'm trying to add subItems in my ListView. My listView should be organized with emails for items and their institution for the subitems, but with the following code I just added items, how can I add my subitems on it? I've tried so many things but it doesn't work.</p> <pre><code> List&lt;Login&gt; listEmail...
android
[4]
886,680
886,681
Assigning NSArray Issues on Simulator Versus Device
<pre><code> NSArray *favoriteSharers=[NSArray arrayWithObjects:@"SHKMail", @"SHKTWitter", @"SHKFacebook", nil]; </code></pre> <p>On Simulator, I step through the code and favoriteSharers array contains three strings of SHKMail, SHKTWitter, and SHKFAcebook.</p> <p>However, on device, after I step through thi...
iphone
[8]
3,529,173
3,529,174
How do I set the defaults (Language & Keyboard) for an Android AVD (SDK 2.1 & 2.2)
<p>I recently upgraded to Android SDK 2.1 and 2.2 but the AVD always displays with Chinese and Japanese characters active. I can go to Settings to uncheck these options but it's becoming a pain. How can I set the Language &amp; Keyboard defaults to avoid this hassle?</p> <p>Thanks ...</p>
android
[4]
5,302,326
5,302,327
How to detect if an attribute contains a certain value in jQuery?
<p>I have elements with various values for an attribute (ids="32, 56, 21"). How can I get the elements that contain 21?</p>
jquery
[5]
2,133,067
2,133,068
Count for datetime object
<p>I'm trying to iterate over DateTime properties on objects in a List collection... </p> <p>Ex. a tree view that lists the a Name with all its Courses underneath works fine:</p> <pre><code> // Sorting on name with the courses beneath it: // *list* is a List&lt;ClsStandholder&gt;; private void ShowNameWith...
c#
[0]
5,455,740
5,455,741
Pass arguments to console.log as first class arguments via proxy function
<p><code>console.log</code> takes an unspecified number of arguments and dumps their content in a single line.</p> <p>Is there a way I can write a function that passes arguments passed to it directly to <code>console.log</code> to maintain that behaviour? For example:</p> <pre><code>function log(){ if(console){ ...
javascript
[3]
1,198,003
1,198,004
get username from Webservice
<p>How can i get the username from the webservice my Webservice is configured under Enterprise sign on authentication.</p> <p>I am using the below code for webapplication Re<code>quest.ServerVariables("HTTP_CT_REMOTE_USER")</code> and i need a equavelent for webservices</p> <pre><code>Context.Request.ServerVariables[...
c#
[0]
3,506,676
3,506,677
Why does jQuery use the prototype property for plugins?
<p>One assigns a plugin to the jQuery prototype property. What's the point of doing this when one doesn't use 'new' with jQuery? There's only ever one instance of jQuery isn't there? So couldn't plugins be assigned directly to the singleton jQuery object?</p>
jquery
[5]
3,688,938
3,688,939
Fixed - Adding parameter to link, then redirect results in amp; in $_GET
<p>// Edit FIXED: I fixed it by moving the code to the HTML head, removing it from the Smart html template file. Seems smarty messed it up in some way. Thx for your help :] // Edit</p> <p>How do I correctly add a parameter to a link with jquery? I've now read various threads here about that, but I can't get it to work...
jquery
[5]
5,577,144
5,577,145
Show or hide content based on the date with jQuery?
<p>I want to have some content on my page (some images) change based on the date. With jQuery, how would this be possible?</p> <p>Basically, I am leaving on vacation and my client needs something to change while I'm unavailable.</p> <p>I've been able to do it with ColdFusion for another client, but I don't know how t...
jquery
[5]
2,534,986
2,534,987
Android AlarmManager effect immediately, why?
<p>I'm learning to use AlarmManager in Android. I was looking for example in google and I found <a href="http://stackoverflow.com/questions/4459058/alarm-manager-example">stackoverflow.com</a> I have a class </p> <pre><code>public class Alarm extends BroadcastReceiver { @Override public void onReceive(C...
android
[4]
1,024,110
1,024,111
Database documentation
<p>Can anyone suggest me the format of how to make and analyse database documentation.</p>
asp.net
[9]
4,870,318
4,870,319
Upload image and mp3 in same form, but mp3 did not get uploaded
<p>i'm trying upload image and mp3 in the same form but image is uploaded and mp3 is not. this is my form</p> <pre><code> &lt;form action="upload.php" enctype="multipart/form-data" method="post"&gt; &lt;p&gt; Please select image&lt;br&gt; &lt;input type="file" name="image" size="40"&gt; &lt;/p&gt; &lt;p&gt; Ple...
php
[2]
481,145
481,146
Learning Java the "right way": any book that goes over DI, loosely coupling, writing testable code?
<p>I'm comfing from the .net world, and want a book that goes over the 'right' way of coding.</p> <p>Things like dependancy injection, loosely coupling of objects, how to layout your web application properly, unit-testing etc.</p>
java
[1]
5,232,081
5,232,082
How to call a python function from an another file
<p>I have this class in my parser.py file</p> <pre><code>class HostInfo(object): def __init__(self, host_id): self.osclass = [] self.osmatch = [] self.osfingerprint = [] self.portused = [] self.ports = [] self.extraports = [] self.tcpsequence = {} self.hostnames = [] self.tcptsseque...
python
[7]
3,143,387
3,143,388
Getting error in starting Emulator
<p>When I run my application, I am getting an error. The error is:</p> <blockquote> <p>invalid command-line parameter: sw\android-sdk-windows\tools/emulator-arm.exe. Hint: use '@foo' to launch a virtual device named 'foo'. Please use -help for more information</p> </blockquote> <p>What can I do to fix this?</...
android
[4]
48,695
48,696
Python split list at zeros
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/13633901/remove-leading-and-trailing-zeros-from-multidimensional-list-in-python">Remove leading and trailing zeros from multidimensional list in Python</a> </p> </blockquote> <p>if I have a list such as:</p> <p...
python
[7]
3,877,739
3,877,740
Change div text if Select contains option with specific text
<p>I have a CMS that multiple people administer. We enable/disable some of our shipping methods depending on the time of year. I want to setup our checkout page to display a different message in our pickup info TD if someone enables the "Text Reserv. Pick-up" shipping option, but leave it as the default if not.</p> <p...
jquery
[5]
5,614,054
5,614,055
Does jQuery or a jQuery plugin have a function that does what this function does?
<p>I would like to know if jQuery or a jQuery plugin has a function that does what the following function does:</p> <pre><code>function $array(a /* an ARRAY */, f /* a function */) { var $res = $(); for (var i = 0; i &lt; a.length; ++i) /* Notice: The result of evaluating f(a[i]) * sha...
jquery
[5]
1,906,083
1,906,084
Python won't print after smtplib.SMTP
<p>I was trying to write a python sendmail class, I like to print sent mail info, but after smtplib.SMTP it won't print anything, even an error, here is my code: </p> <p>main.py:</p> <pre><code>import MailServer from Mailler import Mailler mail_server = MailServer.Server() mailler = Mailler( mail_server ) mailler.se...
python
[7]
4,605,465
4,605,466
When did C# get explicit interface implementation?
<p>When did C# get explicit interface implementation? Was this in version 1 or was it added later?</p>
c#
[0]
11,039
11,040
How to avoid .prev().prev().prev() OR how to look up an item with a class before the current one
<p>I looked up the whole jQuery Docs, but i doesn't found anything: Is it possible to search an element before the current one with a specific class? I thought this will work, but it doesn't:</p> <pre><code>$(this).prev('.bar'); </code></pre> <p><a href="http://jsfiddle.net/Ejh5G/" rel="nofollow">http://jsfiddle.net/...
jquery
[5]
2,419,487
2,419,488
I am looking for an example of DataColumnsWithJoins usage?
<p>I am looking for an example of <a href="http://d.android.com/reference/android/provider/ContactsContract.DataColumnsWithJoins.html" rel="nofollow">DataColumnsWithJoins</a> usage? Do you know any?</p>
android
[4]
2,600,756
2,600,757
jQuery Slide Panel on Mouseover
<p>How can I make this sliding panel example to slide down on mouseover and slide back in on mouseout instead of using the click function?</p> <p>See the example here: <a href="http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html" rel="nofollow">http://www.webdesignerwall.com/demo/jquery/simple-slide-pan...
jquery
[5]
2,913,787
2,913,788
error in using BtnSubmit.Attributes("onclick") in asp.net
<p>can anybody tell me what is problem in</p> <p>BtnSubmit.Attributes("onclick") = string.Format("document.getElementById(\'{0}\').value= document.getElementById(\'{1}\').value;", this.HiddenField1.ClientID, this.FileUpload1.ClientID);</p> <p>it is giving me error 'Non invocable memberusing System.Web.UI.WebControls....
asp.net
[9]
5,655,426
5,655,427
Readonly toolbar item - valid or invalid - iPhone Human Interface Guideline?
<p>The toolbar of our iPhone app contains an icon to indicate online/offline status. Since the icon is just an indication of online/offline status, it is readonly or say 'not-clickable'.</p> <p>My question is - Does an item in toolbar has to perform some action or can it be readonly icon ? </p> <p>Will it create any ...
iphone
[8]
4,743,369
4,743,370
override $(element) expression to achieve the same functionality as $(element).length
<p>Is it possible what I have mentioned in the title?</p> <p>I would like to use this for checking existence of an element like so:</p> <pre><code>if($('#item')){...} </code></pre> <p>Any ideas?</p> <p>That's the code where I use it:</p> <pre><code>if($('#auto_redirect_in_3_s').length)//I "wished" $('#auto_redirec...
jquery
[5]
57,555
57,556
Javascript function making the Iframe display in the whole browser after an action in iframe
<p>I display an IFrame in a div in a webpage.Inside the IFrame I have a hyperlink. On click of this link, a JS function will be invoked and all the check boxes present in that page will be unchecked.</p> <p>The thing is when I click the Link named 'Clear All', all the check boxes are getting cleared but the DIV contai...
javascript
[3]
1,467,999
1,468,000
Problem in getting the expected output by starting an activity from another activity
<p>I have developed a simple application in which i have called an activity from another activity using Intent.It works fine.. but what is the problem is, When i made changes in the called activity it doesn't reflected in the output. I don't know how to solve this problem... please help me....</p>
android
[4]
208,907
208,908
jquery - $.map - returning element not appending properly
<p>using $.map function i am looping a object and appending the element i make. but my case, i am getting the console info properly, but finally returning object only appending, what is the issue in my code?</p> <p>my code :</p> <pre><code> $('body').append( $.map(val.fields, function (val, i) { var element; ...
jquery
[5]
4,505,633
4,505,634
File.separator vs Slash in Paths
<p>What is the difference between using <code>File.separator</code> and a normal <code>/</code> in a Java Path-String?</p> <p>In contrast to double backslash <code>\\</code> platform independence seems not to be the reason, since both versions work under Windows and Unix (please correct me if I am wrong here).</p> <p...
java
[1]
5,358,621
5,358,622
Converting from list of tuples to list of lists of tuples
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python">How do you split a list into evenly sized chunks in Python?</a> </p> </blockquote> <p>I have list of tuples, each tuple has two items (the amoun...
python
[7]
4,066,724
4,066,725
print the first sentence of each paragraph in Java
<p>I have a text file and wish to print the <strong><em>first</em></strong> sentence of each paragraph. Paragraphs are separated by a line break, i.e. "\n".</p> <p>From the BreakIterator, I thought I could use the getLineInstance() for this but it seems it is iterator over each word:</p> <pre><code>public String[] e...
java
[1]
1,403,069
1,403,070
Setting the path of an image view
<p>I have an ImageView in my android application, and I have a picture on my desktop. I would like to relate this imageView to the path of the desktop image, so that when I run my application the image is shown . Can any one help me with the code? Thanks !</p>
android
[4]
4,880,183
4,880,184
Validate zip and display error with onBlur event
<p>Check if zip is 5 digit number, if not then display 'zip is invalid'. I want to use onBlur event to trigger the display. But it's not working. </p> <pre><code>&lt;script&gt; $(function(){ function valid_zip() { var pat=/^[0-9]{5}$/; if ( !pat.test( $('#zip').val() ) ) {$('#zip').after('&lt;p&gt;zip...
jquery
[5]
4,878,613
4,878,614
Refresh Activity using onResume()
<p>I have a Flashlight Activity. Normally it works fine but When I go to any other activity, it stop working!</p> <p>So I want to refresh the code when I back to the Flashlight Activity.</p> <p>I think refreshing using <code>onResume()</code> would help me best, But how to do it?</p> <pre><code>public class FlashLig...
android
[4]
5,957,453
5,957,454
not giving sum of the row
<p>I am getting undefined as the resulting sum of the row.</p> <pre><code>var myArray = new Array(3); for (var i = 0; i &lt; 3; i++) { myArray[i] = new Array(3); for (var j = 0; j &lt; 3; j++) { myArray[i][j]=prompt("element"," "); } } for(i=0;i&lt;4;i++) { sum=0; for(j=0;j&lt;4;j++) ...
javascript
[3]
836,748
836,749
Weird javascript output
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/850341/workarounds-for-javascript-parseint-octal-bug">Workarounds for JavaScript parseInt octal bug</a> </p> </blockquote> <p>I was learning the parseInt() function of javascript and was just trying out, and out...
javascript
[3]
1,606,112
1,606,113
Multiple widgets: Launching configuration activity on widget click
<p>following scenario: I have 3 of the same widgets on my home screen. If one gets clicked, the widget configuration activity gets launched. </p> <p>This was implemented by following code:</p> <pre><code>Intent intent = new Intent(context, WidgetConfigurator.class); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID...
android
[4]
3,548,154
3,548,155
Does ASP.net use MVP pattern through code-behind code?
<p>I read somewhere on the internet that ASP.net automatically implements MVP pattern with its code-behind page technique. Can anybody tell me why it is considered as implementing MVP pattern when I cannot see any Presenter class?</p>
asp.net
[9]
5,294,049
5,294,050
How can I erase a printed output line?
<p>What code would I have to add, replacing the comment, to print 1 &amp; 3 only?</p> <pre><code>main() { cout&lt;&lt;" 1 "&lt;&lt;endl; cout&lt;&lt;" 2 "&lt;&lt;endl; /* Code here to remove above " 2" line on output screen */ cout&lt;&lt;" 3 "&lt;&lt;endl; } expected output: 1 3 </code></pre> <p>...
c++
[6]
1,606,772
1,606,773
Why is the listdir() function part of os module and not os.path?
<p><code>os.path</code> module seems to be the default module for all path related functions. Yet, the <code>listdir()</code> function is part of the <code>os</code> module and not <code>os.path</code> module, even though it accepts a path as its input. Why has this design decision been made ?</p>
python
[7]
5,127,717
5,127,718
Python path help
<p>how can i run my program using test files on my desktop without typing in the specific pathname. I just want to be able to type the file name and continue on with my program. Since i want to be able to send it to a friend and not needing for him to change the path rather just read the exact same file that he has on ...
python
[7]
5,841,938
5,841,939
Write values while runnig program
<p>i want to write some data to a .txt file.</p> <pre><code> public void writeToFile(String filename) { try { //Construct the BufferedWriter object bufferedWriter = new BufferedWriter(new FileWriter(filename)); //Start writing to the output stream bufferedWriter.write("first ...
java
[1]
5,304,199
5,304,200
Speed up web UI development in Java by redeploying only UI code?
<p>I'm really pissed when I'm developing UI and have to redeploy the whole application to see my changes which can take up to a minute. Most of the time when starting up is spent in starting up the service and dao layer(=hibernate). I already have the application divided into multiple modules and the UI code is one sep...
java
[1]
4,474,120
4,474,121
Initializing final variables in Java
<p>I have a class with lots of final members which can be instantiated using one of two constructors. The constructors share some code, which is stored in a third constructor.</p> <pre><code>// SubTypeOne and SubTypeTwo both extend SuperType public class MyClass { private final SomeType one; private final Sup...
java
[1]
4,763,274
4,763,275
How to rollback actions through javaScript?
<p>I am having a JSP page where the user will be displayed with a table consisting rows. If the user wishes, he may add a new row and press the save button, which will insert the data into the table, which is done through JavaScript.</p> <p>My request is that, user adds a new row and enters the details in that. If he ...
javascript
[3]
2,827,068
2,827,069
pass starting variables to php
<p>i am trying to have it so that when a page opens, it shows the current month and year in a div named display. there are 3 links, previous...reset...next. One click I want to reload the content in the display div with the appropriate data...being next month...last month..etc.</p> <p>I have the reset link working but...
jquery
[5]
2,896,046
2,896,047
Force default reevaluation on function call
<p>AFAIK, Python evaluates the defaults of a function only once, at declaration time. So calling the following function <code>printRandom</code></p> <pre><code>import random def printRandom(randomNumber = random.randint(0, 10)): print randomNumber </code></pre> <p>will print the <em>same</em> number each time cal...
python
[7]
3,298,524
3,298,525
move up/down in jquery
<p>I Have 5 spans i am trying to move them up/down (swap positions) in jquery</p> <pre><code>&lt;a href="#" id="up"&gt;Up!&lt;/a&gt; &lt;a href="#" id="down"&gt;Down!&lt;/a&gt; &lt;span id='1'&gt;Test1&lt;/span&gt;&lt;br&gt; &lt;span id='2'&gt;Test2&lt;/span&gt;&lt;br&gt; &lt;span id='3'&gt;Test3&lt;/span&gt;&lt;br&...
jquery
[5]
1,173,222
1,173,223
How to create menu item & subitem using jquery in asp.net?
<p>How to create menu item &amp; subitem using jquery in asp.net?</p>
asp.net
[9]
5,166,282
5,166,283
Form content changes identifier using jquery?
<p>Is there is any jquery plugin or utility which identify the changes happen in form / document. ?</p> <p>i.e. Preious content and after contents</p> <p>Please help</p>
jquery
[5]
3,188,343
3,188,344
Which one is best scenario to parse data from server (net) in android
<p>In my app i have to parse data from server.I have seen in some sites,some of examples using <code>AsyncTask</code>, some of examples using some callback methods,some of examples using threads and handlers.</p> <p>which one is best to parse data from server.</p>
android
[4]
4,331,761
4,331,762
find specific index position in string in php?
<p>can someone help me finding the position of the in string?</p> <pre><code>$data="e0ab71ab9ed24e627a24e7d65367936393cb3b39db9a9e84d65cd7a9254a4665"; </code></pre> <p>here data contain length 64.</p> <p>just I need if string index position is 30 break the line and print next line remaining numbers.</p>
php
[2]
444,872
444,873
jQuery - Can I combine object reference with other selectors?
<p>Occasionally I pass an 'object' to jQuery rather than an id or other selectors. For example</p> <pre><code>&lt;input type="text" onclick="doit(this)" /&gt; &lt;script type="text/javascript"&gt; function doit(e) { var a = $(e).val(); } </code></pre> <p>It is useful when ids are not convenient such as long list...
jquery
[5]
4,360,946
4,360,947
How to get screen DPI
<p>I'm trying to get the screen's dpi but so far it isn't working. I tried:</p> <pre><code> DisplayMetrics dm = new DisplayMetrics(); mainContext.getWindowManager().getDefaultDisplay().getMetrics(dm); SCREEN_DPI = dm.densityDpi; </code></pre> <p>But both on Samsung Galaxy Tab 10.1 and on Samsung Galaxy S I...
android
[4]
2,306,995
2,306,996
In C# what is perception?
<p>In one of the job interview some one asked me, In C# what is perception? And i don't know what he mean to say until now. Can some one brief it ?</p>
c#
[0]
3,801,689
3,801,690
Filling array with integer values
<p>I have the following code:</p> <pre><code>public static &lt;T extends Comparable&lt;T&gt;&gt; T[] getRandomPermutationOfIntegers(int size) { T[] data = (T[])new Comparable[size]; for (int i = 0; i &lt; size; i++) { data[i] = i; } // shuffle the array for (int i = 0; i &lt; s...
java
[1]
3,263,433
3,263,434
how to get checked value from radiobutton represented as variable?
<p>I would like to get checked value of some radiubutton. That is not a problem when you using expression:</p> <pre><code> $("input[name='radioname']:checked").val(); </code></pre> <p>but I have a situation when I need to use DOM object from variable as below:</p> <pre><code>var obj = $("[name=myradio1]"); </code></...
jquery
[5]
5,895,726
5,895,727
"#orderedlist > li" selector
<p>I'm studying jQuery with <a href="http://docs.jquery.com/Tutorials%3AGetting%5FStarted%5Fwith%5FjQuery" rel="nofollow">this</a> tutorial, but one of examples doesn't work.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; a.test { font-weight: bold; background: #fc0 } &lt;/style...
jquery
[5]
2,524,176
2,524,177
What does the << operator do in C++?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10588748/what-is-the-operator-in-c">What is the “&lt;&lt;” operator in C++?</a> </p> </blockquote> <p>In a piece of code I am looking at, the following takes place:</p> <pre><code>... (header[4] &lt;&lt; 8) + h...
c++
[6]
2,074,708
2,074,709
Creating a copy of the object for multiple comparison is a good practice?
<p>Suppose multiple comparations are required at once:</p> <pre><code>enum usermode { active, standingby, inactive, dead, // many other modes.... }; class A { public: usermode mode; }; </code></pre> <p>function inherited pointer to class A (ptr points to A)</p> <p>Method A:</p> <pre><code>if...
c++
[6]
4,178,489
4,178,490
Caching in dll for asp.net site?
<p>I have a .NET DLL on my site. I'd like to use Cache() like you can on ASP.net websites, but it's just a class library project.</p> <p>I'm guessing I'm missing a reference but I don't know what it is.</p>
asp.net
[9]
1,522,052
1,522,053
How do I create a resource dll
<p>How do I create a resource dll ? The dll will be having a set of .png files. In a way these .png files should be exposed from the dll. My application would need to refer this dll to get a .png file. </p>
c++
[6]
4,577,940
4,577,941
"No data received" error when I have a mysql query in while loop
<p>I have this PHP code:</p> <pre><code>&lt;?php include_once("connect_to_mysql.php"); $max=300; while($max--) { sleep(1); doMyThings(); } ?&gt; </code></pre> <p>it is supposed to repeat a mysql query 300 times with gap of 1 second between each. But the problem is after a minute o...
php
[2]
199,326
199,327
How do we create a custom drop down list in android which is different than spinner? Please help me with the code
<p>The drop down list should have a fixed predefined name unlike spinner. When its elements are clicked, they should pass an Intent to go to their corresponding activity. Hoping for a good code. Thank You.</p>
android
[4]
3,546,194
3,546,195
How do I add an onclick function to all matched elements
<p>This function only works once, when I click an anchor element again, nothign happens. I thought the selector would apply the .click function to all matched elements? </p> <pre><code> $('#welcome-nav li a').click(function (e) { // prevent anchor from firing e.preventDefault(); var chosenElement = $(th...
jquery
[5]