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
1,534,419
1,534,420
Declaring object of interface instead of implementation class
<p>I found this code which creates an object of the implementation class and assigning it to the interface class variable:</p> <pre><code>Myinterface obj=new MyImplementationClass(); </code></pre> <p>Why dont we just use</p> <pre><code> MyImplementationClass obj=new MyImplementationClass(); </code></pre> <p>?</p>
c#
[0]
4,154,016
4,154,017
How to hide table rows which have their checkboxes
<p>I have these table rows that have checkboxes:</p> <pre><code>@foreach (var item in Model) { &lt;tr&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.InvoiceNumber) &lt;/td&gt; &lt;td&gt; @Html.DisplayFor(modelItem...
jquery
[5]
3,414,414
3,414,415
Droid - won't rotate image captured from camera? (Camera.Parameters)
<p>Posted this on the android dev forum, wondering if anyone here has seen this.</p> <p>I'm using this camera code to ask the camera to rotate the captured image data:</p> <pre><code>Camera.Parameters params = camera.getParameters(); params.set("rotation", 90); camera.setParameters(params); </code></pre> <p>this see...
android
[4]
4,003,034
4,003,035
Count from 0 to 100 in 7 seconds while doing an jQuery.animate() for a progress bar
<p>I've a simple progress bar that has to go from 0 to 100% width in 7 seconds. I've no problem handling operations, it just need to be 7 seconds long.</p> <p>The code is actually so simple:</p> <pre><code>$('.progress-bar').animate({width:'100%'}, 7000); </code></pre> <p>The width of the progress is 0% so just I ne...
jquery
[5]
3,227,642
3,227,643
Combining string values from an array
<p>I have created a loop that takes an int, turns it into a character array, and displays values based on the characters in the array. How can I print the values on the same line? In other words, instead of:</p> <blockquote> <p>value</p> <p>value</p> <p>value</p> </blockquote> <p>I need:</p> <blockquote>...
java
[1]
1,488,048
1,488,049
Javascript Validation for- "From Date" should not be prior 13 months from "To Date"
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12054405/from-date-will-not-be-accept-earlier-than-13-months-in-javascript">From Date will not be accept earlier than 13 months in javascript</a> </p> </blockquote> <p>I Am trying to form a “From Date” will not ...
javascript
[3]
5,971,444
5,971,445
Simple php echo issue in html
<p>I'm playing around with creating iphone webpages with html5 and using php, in my code below when I run it for some reason the php part instead of echoing the variable it doesn't print anything to the screen, any ideas? thanks</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" c...
php
[2]
2,257,470
2,257,471
Which data structure is appropriate for storing paths of file system?
<p>by using the parent path, i need to traverse and store all the folders and files paths that lie within that parent path. so which data structure should be applied here? </p>
java
[1]
5,862,680
5,862,681
Python - Hashlib MD5 differs between linux/windows
<p>I have a python app in which I am creating packages in windows to be used and later compared in a linux python app. I am creating an md5 for a file in windows to be checked later in linux. The problem is that the same code on the same file gives different Md5 hash results in each environment. Below is the method ...
python
[7]
5,175,952
5,175,953
Is the Main method must needed in a Java program?
<p>Is the main method needed to write a java program?</p> <p>This is my code:</p> <pre><code>package example; public class HelloWorld { public HelloWorld() { } public String getHelloWorld() { return "Hello From Java!"; } } </code></pre> <p>It shows an error at compilation:</p> <pre><cod...
java
[1]
2,372,204
2,372,205
Help with Java Calendar -- it is giving some strange output
<p>I'm newish to Java and am trying to do somethings with dates. First I started using the Date class, which I found out was mostly deprecated so I switched over to Calendar. </p> <p>Now I am getting weird values. for example the Month value for December is 0, not 12. And on those Calendars where it is giving me 0...
java
[1]
5,629,526
5,629,527
Handle unknown number of undefined objects for logging
<p>Trying to reproduce something that in C# you would do something like this: </p> <pre><code> string FormatString(params object[] args) { return string.Format(CultureInfo.InvariantCulture, args); } </code></pre> <p>And in Obj-c it would look like this:</p> <pre><code>#include &lt;stdarg.h&gt; void logObject...
c++
[6]
428,947
428,948
How to get a click event in an iframe trigger an alert in parent frame
<p>I have several embedded <code>iframes</code> on my page and I'm looking for a click event inside the <code>ifram</code>e to trigger an alert on the parent frame. (both iframe &amp; parent frame are same domain).</p> <p>iFrame HTML element (the iframe has a class of <code>class="iframe1"</code>:</p> <pre><code>&lt;...
jquery
[5]
3,674,353
3,674,354
Need better way to add HTML below each photo
<p>I'm adding a title and description after each photo in an unordered list (li), and using a combination of jQuery/JSON, the flickr API and a lightbox. Everything is working, but I know one piece of my code is wrong:</p> <pre><code>.add( $("&lt;p&gt;" + item.title + "&lt;/p&gt;&lt;p&gt;" + item.description._cont...
jquery
[5]
2,774,057
2,774,058
Javascript objects and syntax
<p>I have an array called gallery_list:</p> <pre><code>var gallery_list = ["profile.cfm", "explore.cfm", "list.cfm", "lesson.cfm", "class.cfm", "deploy_to_class.cfm"]; </code></pre> <p>When I write the following, it works:</p> <pre><code>$.fancybox([ { 'href' : gallery_list[0], 'type' : 'ifra...
javascript
[3]
5,690,485
5,690,486
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required
<p>I have a Problem, when i m sending a mail through this code then error is occured that "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. "</p> <p>and my code is :</p> <pre><code>protected void ImageButton1_Click(object sender,...
c#
[0]
3,415,332
3,415,333
getclass() vs .class
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2467970/whats-the-difference-between-calling-myclass-class-and-myclass-getclass">What’s the difference between calling MyClass.class and MyClass.getClass()</a> </p> </blockquote> <p>Wanting to have a <code>Class...
java
[1]
4,359,174
4,359,175
store image and audio file in android internal storage
<p>how to store image and audio files in android internal storage</p> <p>and how to retrieve back to display image imageview </p> <p>Thanks in advance</p> <p>Aswan </p>
android
[4]
179,492
179,493
Android: Daily Reminder
<p>I'm creating an Android app where in the user can set the daily reminder, and at the designated time, the phone's alarm goes off and an activity is launched.</p> <p>App uses the latest version of the SDK and the emulator. How do I get started with this? </p> <p>Thanks, Sri</p>
android
[4]
2,208,647
2,208,648
how to truncate an double datatype value variable
<pre><code>public class Score { public double marks { get; set; } } </code></pre> <p>now in my code </p> <pre><code>List&lt;Level1&gt; Obj= new List&lt;Level1&gt;(); Score Object= new Score(); l1.marks=94.345454; Obj.Add(Object) </code></pre> <p><strong>// now whiling adding the object to list i need to...
c#
[0]
3,294,733
3,294,734
Are const fields converted to static fields at compile time?
<p>Why can I call <code>TheFakeStaticClass.FooConst</code> , like it's static, when it's not declared static?</p> <p>Are const fields converted to static fields at compile time? (I understand that you can't change a <code>const</code> and hence you only need "one instance". I've used many const's before like <code>Ma...
c#
[0]
1,983,393
1,983,394
Less Verbose Way to Check Membership of Multiple Items in List/String?
<p>I have code that checks if an attribute of a class as well as a predetermined string are in a string or a list, like this: </p> <pre><code>if (self.name in event and 'AL' in event) or (self.name in event and 'FH' in event) </code></pre> <p>I'm wondering if there is a more elegant way to combine these so I don't ha...
python
[7]
4,100,876
4,100,877
Help with understanding list function
<p>When I type the following into the interpreter I get the desired output behavior:</p> <pre><code>&gt;&gt;&gt; x = (7, 2, 1, 1, 6, 2, 1, 2, 1, 2, 2, 6) &gt;&gt;&gt; y = list(x) &gt;&gt;&gt; y [7, 2, 1, 1, 6, 2, 1, 2, 1, 2, 2, 6] </code></pre> <p>Above, I simply converted a tuple to a list. However, when I run the f...
python
[7]
5,889,386
5,889,387
Keyboard polling
<p>I'm looking for a nice solution for non-blocking poll of the keyboard for Unix systems. If any keystroke happens, I want to capture it.</p> <p>Some solution are presented in <a href="http://stackoverflow.com/questions/292095/polling-the-keyboard-in-python">Polling the keyboard in python</a>, but are there any other...
python
[7]
4,176,118
4,176,119
Enable Flight mode with out disabling the wifi and bluetooth in android
<p>I want to enable Flight mode but if i enable flight mode i cant able to use bluetooth , wifi. my purpose is to restrict only the receiving call and sms related things.</p> <p>I tried the following, but its not working;</p> <pre><code>Settings.System.putString(getContentResolver(), Settings.System.AIRPL...
android
[4]
5,292,089
5,292,090
How to get the value of variable in jQuery?
<p>I'm using the following code to get the value of variable "one" in jQuery</p> <pre><code>var one=1; $('td:nth-child(one)') </code></pre> <p>But "one" is taken as a string not as a variable. How to get the value of the variable?</p>
jquery
[5]
4,879,052
4,879,053
How to save data in an android app
<p>I recently coded an Android app. It's just a simple app that allows you to keep score of a basketball game with a few simple counter intervals. I'm extremely new to coding, and I just had one quick question. I'm getting demand to add a save feature, so you can save your scores and them load them back up. Currentl...
android
[4]
2,415,514
2,415,515
How to organize a Javascript UI?
<p>I need good examples and best practices on program architecture.</p> <p>I'm trying to build a JS UI for an app that works with Google.Maps. In the 1st draft, user should be able to draw geometric shapes on the map in a way similar to G.M. Then the shapes are sent through AJAX and the response is displayed.</p> <p>...
javascript
[3]
3,653,754
3,653,755
Template strings python 2.5 error
<pre><code>#!/usr/bin/python from string import Template s = Template('$x, go home $x') s.substitute(x='lee') print s </code></pre> <p>error i get is </p> <pre><code>&lt;string.Template object at 0x81abdcc&gt; </code></pre> <p>desired results i am looking for is : lee, go home lee </p>
python
[7]
4,724,279
4,724,280
Are objects stored on the stack?
<p>Since objects are constructed via a hidden function, as opposed to primitive types, it makes perfect sense scoping variables for performance in C++, whereas in C99 it doesn't.</p> <p>My question is: are the objects stored on the stack <em>anyway</em>?</p>
c++
[6]
4,267,604
4,267,605
How to use appdelegate variable in view
<p>i declared a variable <code>NSString productname</code> in appdelegate and assigned value <code>appdelegate.productname = name</code> from a view.Then i tried to get this value from another <code>view.lbl.text=appdelegate.productname</code>. Is this is wrong?</p>
iphone
[8]
871,346
871,347
Get attribute values as array from selection of elements using jQuery
<p>I have the following using jQuery:</p> <pre><code>var x = $('.boxes &gt; input:checked'); </code></pre> <p>From x I am trying to retrieve an array of id values and have been unable to work out how to do this.</p> <p>Something like:</p> <pre><code>var y = x[id]; // y becomes an array like ['1', '2', '3'] assuming...
jquery
[5]
4,756,371
4,756,372
Settings for SMTP while sending mail in background
<p>iphone× 117661</p> <p>In this statement Smtpout.servername.net,</p> <p>what would be the exact entries?I am pretty much confused.I am using gmail.Please clarify.....</p> <p>//the guts of the message.</p> <pre><code>SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init]; testMsg.fromEmail = @"youremail@email.com...
iphone
[8]
3,254,122
3,254,123
email functionality is not working fine
<p>I have used the <code>MFMailComposeViewController</code> for sending the email in my code. I have also used the reachability code to check the internet connection. Internet connection is working fine. Whenever I used to send a mail from my code I got the message that email has been sent. But I didn't get any mail. T...
iphone
[8]
5,303,980
5,303,981
is using constants for language file a good idea from the performance point of view?
<p>im trying to implement a language file. im tossing between gettext and constants. i noticed that several OS projects use constants. are there any performance dissadvantages to using many constants?</p>
php
[2]
1,564,933
1,564,934
Issue with more multiple functions in one onClick
<p>I have two function and I need to execut in one <code>onClick</code>. The first one is to confirm the submit, if the user press <code>yes</code> it should execute the second function. It is not working with me. Any help please.</p> <p>below my code:</p> <pre><code>&lt;Script&gt; function checkSubmit(){ if(confir...
javascript
[3]
2,585,411
2,585,412
PHP: What is an efficient way to sort two arrays, which each contain objects with datetime properties?
<p>Anyone know the best way to sort an array by date? I would set the date as the array key but I don't want to overwrite anything with the same date. Thx in advance!</p>
php
[2]
1,338,122
1,338,123
How to use number of activities in a single activities
<p>Actually i want to use more than one activity at the same time but as i know if i switch to another activities the older one stops.But in some cases i want to use two or three activities concurrently. So please help me out..</p>
android
[4]
2,049,261
2,049,262
who to connect two android emulators runnnig on same machine?
<p>i would like some help on sending some data between two emulators.they all speak about port forwarding but i cant make it work .the emulators have the id 5554 and 5556.and i know the listening port of each emulator.</p> <p>what to write in order to sent message between the two emuators??</p>
android
[4]
253,751
253,752
Android InstrumentationTestCase getFilesDir() returns null
<p>I am using <code>InstrumentationTestCase</code> to unit test a component of my application.</p> <p>The component persists data to the internal storage and uses <code>Context::fileList();</code> to retrieve the persisted files.</p> <p>I experience the following problem: Using this method in the app (on the device) ...
android
[4]
5,080,803
5,080,804
Compile Qt UI file?
<p>How do you compile the UI files to generate the Headers? Is there another way then having the Qt project mirror the visual studio project and compiling with Qt to get them? I guess I could have a bat file or something that does it. What needs to be run to generate the header files from the UI?</p>
c++
[6]
4,649,742
4,649,743
c# BluetoothListener file receiving
<p>I am unable to receive/read the data from "BluetoothListener". I am sending PNG file from mobile via bluetooth and trying to receive the file from PC(Bluetooth dongle). Below is the code that I am using</p> <p>Sample 1:</p> <pre><code> void listening() { try { Guid Rffcomm = Bluet...
c#
[0]
87,457
87,458
debugging does not stop at break point
<p>in my project i insert break point in my c# file the debugger check the whole file gives output but it doesnot stop at the break point and as aresult i could not check the error in it plz if anybody know the answer mail me at jagdeepgupta813@gmail.com</p>
asp.net
[9]
1,169,726
1,169,727
Remove specific box with jquery
<p>When you click Add a box. It adds a box with a deletlistbtn. Right now it removes all boxes with the same name/class/var. But i want the button to only delete the box/list its in. Can anyone tell me wich code i should use to accomplish that?</p> <p>Right now i use this code;</p> <pre><code> $('.deletelistbtn').li...
jquery
[5]
5,286,334
5,286,335
Android 2.1 switch loop JRE 1.7
<p>Hello how to use switch loop in my android project ? I want to use Android 2.1</p> <p>I need JRE 1.7, but I want to use Android 2.1</p> <p>I use loop like this:</p> <pre><code>switch ((CHAR[Math.abs(intGen.nextInt()%2)])) { case "+": result = random2 + random3; break; case "-": res...
android
[4]
3,122,122
3,122,123
Generating Sentences Using Python
<p>I need to generate sentences using python. I have the words I need intact but can't figure out how to make it so only correct sentences come out after I run it. </p> <p>Here's my code </p> <pre><code>import random def S(): print DP(), VP() def DP(): detPhrase = D() + ' ' + N() return detPhrase def V...
python
[7]
1,999,918
1,999,919
Why is the C++ scope resolution operator ::?
<p>This is one of the few questions I didn't find an answer to in Design and Evolution of C++ by Stroustroup. Why is the C++ scope resolution operator ::, as opposed to just :?</p> <p>I'm guessing it's because : is already used to indicate the start of an initialization list in a constructor. Does anyone else agree,...
c++
[6]
5,134,666
5,134,667
onPrepareOptionsMenu android app
<p>I am trying to use the onPrepareOptionsMenu and when I press the menu, it does nothing!! Where am I going wrong?</p> <p>Also, am I using the finish (); command right? When the user presses exit(menuX) I want them to exit the application completely, not the activity.</p> <p>Thanks! :)</p> <pre><code>public boolean...
android
[4]
202,749
202,750
How to pass a dynamic number of arguments to a function?
<p>I have a dictionary that could have a varying number of keys. The value of the keys is a list of numbers. I want to compare each of these lists and get the list that is the maximum of all of the items in the list.</p> <p>built in max() function will give me the maximum of all the items if I passed it in the way bel...
python
[7]
3,688,652
3,688,653
Android as a commercial game platform
<p>I'm currently developing a small non-commercial game for Android which is based on OpenGL ES. Except for some minor issues (slow as crap emulator being the biggest) I've really enjoyed it so far and would love to continue developing for it. The question is: What are your thoughts on the future of Android as an envir...
android
[4]
271,119
271,120
How to open new application from my application in android?
<p>How to open new application from my app in android? </p> <p>I have the list of installed applications and i am showing them in the listview now i want to open that application based on the list item click how can i do this?</p>
android
[4]
3,987,785
3,987,786
passing boolean condition as parameter
<p>I have these</p> <pre><code>def MsgBox1_YesChosen(sender,e): if e.Key != "A": function0() else: function1() function2() function3() def MsgBox1_NoChosen(sender,e): if e.Key == "A": function0() else: function1() function2() function3() </code></pre...
python
[7]
5,571,170
5,571,171
jQuery if each has value then
<p>How would I be able to write it so that if the span says Newbie then its one color and if the span says Club Staff then it has another color?</p> <pre><code>&lt;span class="usertitle"&gt;Newbie&lt;/span&gt; &lt;span class="usertitle"&gt;Club Staff&lt;/span&gt;​ </code></pre>
jquery
[5]
3,405,167
3,405,168
How does Function Scope works in JavaScript?
<p>How does the Function Scope in JavaScript work?</p>
javascript
[3]
1,499,979
1,499,980
Change text inside anchor tag on toggle?
<p>I have the following:</p> <p><img src="http://i.stack.imgur.com/rxTow.png" alt="enter image description here"></p> <p>So right now I'm toggling <code>ul.children</code> like this:</p> <pre><code>$('a.expand-cat-item').on('click', function() { $(this).closest('li.cat-item').find('ul.children').toggle('slow'); })...
jquery
[5]
4,498,059
4,498,060
In eclipse-Android 4.2-Unable to build: the file dx.jar was not loaded from the SDK folder
<p>I have updated Android 4.2 SDK using SDK Manager and ADT 21.0.0.v201210310015-519525 in Eclipse(Indigo).</p> <p>I have created a New project,build and try to run this. I got error as </p> <p>[2012-11-15 11:38:19 - MyApp] Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!</p> <p>Ho...
android
[4]
265,400
265,401
Javascript : difference two ways declare variable in a function
<p>I want to create an object. And, in almost code I have read, they often use this style:</p> <pre><code>function student(_id, _name, _year){ this.id = _id; this.name = _name; this.year = _year; } </code></pre> <p>But, I don't know what the difference with below code :</p> <pre><code>function student (_id,...
javascript
[3]
1,155,061
1,155,062
Print PHP string in new lines
<p>Anything wrong with this code? I want it to print the name and address - each on a separate line, but it all comes up in one line.</p> <p>Here's the code</p> <pre><code>&lt;?php $myname = $_POST['myname']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $address3 = $_POST['address...
php
[2]
3,644,800
3,644,801
Solution For Date Format In Parameterizes Sql Query In 'DD/MM/YYYY' Format
<p>I have asked this question in many sites and my question remain unanswered. Some people advise me to use datetimepicker against maskedtextbox.</p> <p>It is true that datetimepicker solved the all kind date related problem, whereas masked textbox return a string and that's why it's create a datetime conversion probl...
c#
[0]
141,589
141,590
Find a pair of string at integer and subtract, java
<p>I have a string which contains a value:</p> <pre><code>12345 5 54321 4 98765 10 </code></pre> <p>The first value is a number, the second value is a count. The string value is obtained by this code:</p> <pre><code>for(ClusterListBean bean : clusterList) { line += bean.getMSISDN()+"\t"+bean.getRewardCo...
java
[1]
439,460
439,461
What is the best way to implement auto refresh of contents in an activity?
<p>My activity contains data retrieved from internet. I want the activity to automatically refresh its content every 5 minute. What is the best way to implement it? Should I use java's Timer and TimerTask?</p> <p>Thanks.</p>
android
[4]
5,374,408
5,374,409
Best protocol to communicate with backend (for iPhone apps)
<p>We have a project to develop a backend system for items management. User can list item, search, view....etc</p> <p>We need to develop an iphone app. for this backend, currently we are in the design phase of the API(s) and we are wondering which protocol best to use. The most important API is Search; this API must s...
iphone
[8]
3,534,609
3,534,610
What are the fields in the contacts table in android?
<p>I would also like to know the RawContacts and Data table structure? Please help.</p>
android
[4]
3,605,745
3,605,746
Need to create a pannable viewport within a page
<p>I'm creating a custom map / diagram using jQuery / HTML / CSS. It is large, about 3000 x 3000 pixels of content overall. Because of this, I want to be able to restrict the viewable area to only 700x400 pixels or so, and let users pan within the div (by clicking and dragging) to move around the map and see the parts ...
jquery
[5]
4,305,300
4,305,301
what is the difference betweeen int *a and int *&a
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11376085/strange-type-in-c">Strange type in c++</a> </p> </blockquote> <p>What is difference between int* a and int*&amp; z?</p> <p>they output the same memory address.</p> <pre><code>int test(int * a, int *&a...
c++
[6]
486,505
486,506
How can I stop an ASP.NET website from loading depending on a certain condition?
<p>How can i stop asp.net website?<br> I want check some condition and after that if something's wrong then stop website from loading.</p>
asp.net
[9]
3,466,360
3,466,361
C# How to reduce repeat code?
<p>I've largely self taught myself C# code, I took a class in college that didnt help much...sure learned how to follow a book. So i've created tools here and there learning by example online. Stackoverflow is my favorite site for that, usually the community is helpful...</p> <p>Anyway my question is this, im creating...
c#
[0]
4,477,294
4,477,295
Do you need to set an explicit reference to a new'd object in a using block?
<p>"using" blocks are often written like this:</p> <pre><code>using (new Foo()) { ... } </code></pre> <p>rather than like this:</p> <pre><code>using (var f = new Foo()) { ... } </code></pre> <p>In the first case, where no explicit reference to the new Foo object is set, is there any danger that the object could be ...
c#
[0]
3,508,836
3,508,837
Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3275749/im-getting-a-nullpointerexception-when-i-use-action-image-capture-to-take-a-pict">I&#39;m getting a NullPointerException when I use ACTION_IMAGE_CAPTURE to take a picture</a> </p> </blockquote> <p>I have...
android
[4]
4,309,219
4,309,220
How to get the keys with highest values in a php array
<p>I have this array...</p> <pre><code>Array ( [1168] =&gt; 46 [6973] =&gt; 27 [4585] =&gt; 24 [1224] =&gt; 23 [2010] =&gt; 20 [7514] =&gt; 19 [1167] =&gt; 17 [8349] =&gt; 7 [2476] =&gt; 7 [5313] =&gt; 7 [1208] =&gt; 2 ) </code></pre> <p>And I need to get three keys (as values) with the highest values in the previous...
php
[2]
4,399,634
4,399,635
Could not validate drop down list of content page using java script in asp.net
<p>i am using drop down list in content page , so i want to validate drop down list for selectedIndex!=0 ;</p> <p>Thanks in advance N Mahesh Goud</p>
asp.net
[9]
1,027,146
1,027,147
ASP.NET make image visible on Button Click
<p>I have a simple ASP.NET page with an image control and a button control. When someone clicks the button, I want the image to be shown, then the button can continue processing whatever it has to do, at the end of it's process it will hide the image again.</p> <p>Is this possible? I've seen conflicting answers. I'...
asp.net
[9]
5,521,409
5,521,410
How do I write Java code that will press the Shift, Home and End keyboard buttons?
<p>All I can find on google is code to add listeners and events to wait for buttons to be pressed.</p> <p>I am trying to make it so that the code actually presses the buttons.</p> <p>I know that KeyModifier.SHIFT and Key.HOME exist but I don't know how to use them or if they are the right keywords.</p> <p>Any help w...
java
[1]
3,640,719
3,640,720
Does PHP support asynchronous calls?
<p>I am planning to build a web application and am going to host it. Since hosting cost less for php and it being similar to .net i am planning to go for php. </p> <p>I am basically a .net guy. But have no issues in learning php if it is similar to .net. Please give in your opinoins in doing so. Also please tell me if...
php
[2]
5,365,300
5,365,301
Calling a variable from another class, issues with scope
<p>Ok I've narrowed down my problem but can't come up with a fix.</p> <p>I want the first class to be able to reference variables from the second class.</p> <pre><code>class TheFirstClass{ public function __construct(){ include 'SecondClass.php'; $SecondClass = new SecondClass; echo($Secon...
php
[2]
3,489,891
3,489,892
How can I add new columns and rows to a database?
<p>How can I create more columns and add data to them?</p> <p>So far I can add like so:</p> <pre><code>private static final String INSERT="insert into "+ TABLE_NAME +"(name,address)values(?,?)"; </code></pre>
android
[4]
2,861,158
2,861,159
value from HTML textbox to Javascript var
<p>Hi want to store what user input into the textbox into my javascript var to be passed to my external PHP page, </p> <p>I can pass the variable if i just define a value like mySite= 22 but not from what user enters into the text box.</p> <p>Please help me to get access to the texbox.value</p> <pre><code> &lt;form...
javascript
[3]
2,257,328
2,257,329
Getting the first element in string/list
<p>OK, I have file with this data:</p> <pre><code>data = """4,sons,hey,what,Z,U 3,dogs,watch,who,U,H 2,times,did,1,won,G""" </code></pre> <p>I'm wondering, How can I extract the first element from this data?</p> <p>In this case first place is number so I tried:</p> <pre><code>filter(str.isdig...
python
[7]
2,891,311
2,891,312
Broadcast when the system is about to turn the CPU off
<p>Is there any possibility to be notified when the system is about to go to sleep to preserve the battery on Android?</p> <p>There is for example:</p> <p><a href="http://developer.android.com/reference/android/content/Intent.html#ACTION_SCREEN_OFF" rel="nofollow">Intent.ACTION_SCREEN_OFF</a></p> <p>However, is ther...
android
[4]
3,372,888
3,372,889
publishProgress from inside a function in doInBackground?
<p>I use an AsyncTask to perform a long process.</p> <p>I don't want to place my long process code directly inside doInBackground. Instaid my long process code is located in another class that I call in doInBackground.</p> <p>I would like to be able to call publishProgress from inside the longProcess function. In C++...
android
[4]
1,428,732
1,428,733
Searching starting-method, if Android starts my proc
<p>I have created an app with a service running as a background-thread of my app. From time to time Andrdoid kills some apps, due to low memory. One of these apps, which has been killed, was my application:</p> <blockquote> <blockquote> <p>07-29 14:48:35.140 I/ActivityManager( 145): Process test.myApp (pid 4847...
android
[4]
4,984,343
4,984,344
Real rime database connectivity in Android
<p>Please help me out. I want the code for connecting the real time database, example the one which is used in the stock market application, with my android application.</p>
android
[4]
1,770,733
1,770,734
Can we add variables and properties in interfaces in C#.NET?
<p>I want to know that how to add variables (i.e. with which access specifier) in interfaces and also can we write property in interfaces in C#.net?</p>
c#
[0]
4,015,104
4,015,105
in hibernate4.1.9 buildsessionfactory method is deprecated so why serviceRegistry is paased to buildsessionFactory
<p>in hibernate4.1.9 buildsessionfactory method is deprecated so why serviceRegistry is passed to buildsessionFactory</p>
java
[1]
255,539
255,540
How to animate label in jQuery?
<p>I want to move my <code>label</code> from the top to the bottom and vice versa in jQuery. I am using the following code:</p> <pre><code>$("#LabelId").animate({ top: "-=30px", width: "100%" }, 2500,"slow"); &lt;label id="LabelId"&gt;Label&lt;/label&gt; </code></pre> <p>But it's giving me an error while processing....
jquery
[5]
2,127,698
2,127,699
How to replace multiple words in a single string in Java?
<p>I'm writing a program that will replace multiple words in a single string. I'm using this code but it is replacing word but giving result in two different lines. I want multiple words replaced and output in one single line.</p> <pre><code>import java.util.*; public class ReplaceString { public static void mai...
java
[1]
275,660
275,661
When __repr__() is called?
<p><code>print OBJECT</code> calls <code>OBJECT.__str__()</code>, then when <code>OBJECT.__repr__()</code> is called? I see that <code>print OBJECT</code> calls <code>OBJECT.__repr__()</code> when <code>OBJECT.__str__()</code> doesn't exist, but I expect that's not the only way to call <code>__repr__()</code>.</p>
python
[7]
1,043,499
1,043,500
Highilight a button after pushing javascript
<p>I'm trying to make simple image gallery with html/css and a bit of javascript.It's all up and working, but one function.</p> <p><img src="http://i.stack.imgur.com/P9Njw.png" alt="gallery-sorting-images"></p> <p>I want that when I open the index.html 'All' would be already highlighted by my custom style and if push...
javascript
[3]
3,093,347
3,093,348
how to display suggestions from the web
<p>I overwite the SearchRecentSuggestionsProvider to make the custom suggestions for my search, but now I need to return the suggestion data from the server instead of the local provider, how to solve it?</p>
android
[4]
2,333,427
2,333,428
How to order these lines for a highscore table in Python
<p>I have the following in a text file:</p> <pre><code>('bob', '10') ('Ben', '10') ('Ben', '9') ('Ben', '8') ('Ben', '2') ('Ben', '6') ('Ben', '5') ('Ben', '5') ('Ben', '3') ('Ben', '2') </code></pre> <p>I would like to reorder it so that it is ordered by numbers going down, so that I can print them off in a high sco...
python
[7]
1,054,288
1,054,289
Problem in using Ionic.Zip namspace
<p>I am using Ionic.zip to zip up the files.</p> <p>You consider there are 2 files in c:\img\a.txt and b.txt. When zip up these files as following </p> <pre><code>using (ZipFile zip = new ZipFile()) { zip.AddItem(@"F:\imp\a.txt"); zip.AddItem(@"F:\imp\b.txt"); zip.AddItem(@"F:\imp\lookup.ini"); zip.Ad...
c#
[0]
2,072,281
2,072,282
pass parameters from a javascript function (in a HTML form)
<p>I would like to know whether it is possible to pass parameters from a javascript function (in a HTML form). Your help would be highly appreciated. </p>
javascript
[3]
159,637
159,638
Image, video and audio storage best practice on iPhone
<p>I'm creating an application that lets users take photo's and make movies and store these on to the device. Later on the users can take a look at the media items they created in a custom gallery within the app.</p> <p>My question is: where will I store all this media. I'm seeing 3 options here:</p> <ul> <li>Store t...
iphone
[8]
478,056
478,057
expected a class or namespace
<p>I am getting a compile time for an enum in C++ , the error says Expected a class or namespace</p> <pre><code> mf.setStatus(MediaFile::SyncStatus::Synced); </code></pre> <p>The enum is defined like this</p> <pre><code> class MediaFile { public: enum SyncStatus { New = 0, Remove = 5, ...
c++
[6]
4,330,320
4,330,321
C# How to get the number of the method calls?
<p>In Java - basing on the Aspects - we can get the number of the function calls, e.g.:</p> <pre><code>SomeClass sc = new SomeClass(); sc.m1(); sc.m1(); int no = sc.getNumberOfCalls("m1"); System.out.println(no); //2 </code></pre> <p>How to do it in C# ?</p>
c#
[0]
1,307,053
1,307,054
Android create Insert statemnet at runtime
<p>I have fileds list &amp; values list.I want to insert records using DBAdapter.I tried from this link <a href="http://mfarhan133.wordpress.com/2010/10/24/database-crud-tutorial-for-android/" rel="nofollow">http://mfarhan133.wordpress.com/2010/10/24/database-crud-tutorial-for-android/</a></p> <pre><code> DBAdapter d...
android
[4]
5,134,589
5,134,590
How to make resource files in the bin folder of an ASP.NET deployed along with the assemblies?
<p>My ASP.NET application depends on a .NET assembly, which in turn expects a certain resource file to be found beside it. I.e. this how it loads this resource file:</p> <pre><code>var folder = Path.GetDirectoryName(typeof(T).Assembly.Location); var file = typeof(T).FullName + ".xaml"; var source = Path.Combine(folder...
asp.net
[9]
4,027,837
4,027,838
Get every element values from class selector
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1258676/get-attribute-values-as-array-from-selection-of-elements-using-jquery">Get attribute values as array from selection of elements using jQuery</a> </p> </blockquote> <p>I am trying to get the id from the l...
jquery
[5]
3,549,669
3,549,670
jQuery: What event gets triggered when a jQuery animation or ajax call is finished?
<p>For example, i want to do know if $('#seomDiv').load(...); is completed in real time. I'm referring to the ajax .load() function.</p> <p>Any idea?</p> <p>EDIT: hmmmmm... I'm guessing something with setInterval()!</p> <p>EDIT #2: I'm wondering if the completiong of the event can be somehow detected in real time f...
jquery
[5]
286,579
286,580
Continue Execution Only After .each() Completes
<p>I am looking for a way to call a function only after <code>.each()</code> finishes its execution. In the example below, how to make sure that <code>postPreparation()</code> runs <em>immediately after</em> <code>$('.element').each()</code> completes?</p> <pre><code>$('.element').each(function() { /** * 'prepar...
jquery
[5]