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
4,368,069
4,368,070
What is the best possible way to pass a Mulitline String as function argument?
<p>What will be the Best practice to pass Multiline String as a Javascript function's argument.</p>
javascript
[3]
1,877,136
1,877,137
How to add checkbox array to zip file for download from a form
<p>I am trying to get a foreach loop to give me the checkbox values (which have the file names for values) from my form, to be added to a zip file. </p> <pre><code>&lt;input type="checkbox" name="download[0]" value="Fact_Sheet_1.pdf" /&gt; &lt;input type="checkbox" name="download[1]" value="Fact_Sheet_2.pdf" /&gt; &lt...
php
[2]
5,254,300
5,254,301
Dumping a Java program into a file and restarting it
<p>I was just wondering if it's possible to dump a running Java program into a file, and later on restart it (same machine)</p> <p>It's sounds a bit weird, but who knows</p> <p>--- update -------</p> <p>Yes, this is the hibernate feature for a process instead of a full system. But google 'hibernate jvm process' and ...
java
[1]
395,239
395,240
Problem with Python's is None test?
<p>I like using the <em>is None</em> test for empty variables, it's very flexible, easy and useful. It seems to have stopped working now:</p> <pre><code>&gt;"" is None False &gt;[] is None False &gt;{} is None False </code></pre> <p>What's going on?</p> <p>I'm using Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40...
python
[7]
3,848,317
3,848,318
What is the difference between Function.prototype.call() and Function.prototype.bind()?
<p>I went throught the MDN documentation, but I didn't really understand the difference between call() and bind(). They both seem to do the same thing - change the context of <code>this</code> inside a function. So what really is the difference between them? And which should be used when?</p>
javascript
[3]
5,681,349
5,681,350
ASP.NET Encryption HEX Characters
<p>What can be done to this code to make the Encryption in HEX rather than ASCII?</p> <p>Encryption:</p> <pre><code>Public Function EncryptAES(ByVal sIn As String, ByVal sKey As String) As String Dim AES As New RijndaelManaged Dim ahashMD5 As New MD5CryptoServiceProvider() AES.Key = ahashMD5.ComputeHash(S...
asp.net
[9]
4,777,202
4,777,203
Error while publishing the web application
<p>I am a fresher in <code>vs 2010</code> and developed a web project. When I hosted directly the project its working fine. When I am trying to publish it not working and giving an error <strong>403</strong></p> <pre><code>Error 1 Web deployment task failed. (The metabase path 'http://localhost/webapp/login.aspx' ...
asp.net
[9]
5,104,535
5,104,536
How to configure IIS first time for any web app?
<p>I have a website made in ASP.NET .Currently is being opened directly with Visual Studio. Now i want this to be opened with localhost with IIS features enabled.</p> <p>I need steps to make this website totally IIS enabled</p>
asp.net
[9]
4,500,994
4,500,995
How to draw numbered text in a table layout?
<p>I want to draw a numbered circle inside my table layout like below. I have tried to draw circle with canvas, but unable to get the x,y and radius dynamically.</p> <p><img src="http://i.stack.imgur.com/4TFMu.jpg" alt="enter image description here"></p>
android
[4]
4,590,832
4,590,833
Use of Mocking in unit testing for ASP.NET MVC
<p>I'm developing a basic webapp and I'm using ASP.NET MVC, MOno and C# and MySQL for my database. I want to create a unit testing and use mocking. But I don't know how to setup or create a mock in unit testing. And what mocking framework should I use?</p> <p>Please advise.</p> <p>Many thanks.</p>
asp.net
[9]
642,015
642,016
How to call a shell script from python code?
<p>how to call a shell script from python code?</p>
python
[7]
5,347,224
5,347,225
iPhone SDK 4: weird compilation error, MPMoviePlayerController
<p>I have a viewController containing the following method:</p> <pre><code>- (IBAction) playMovie { NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"m4v"]]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotif...
iphone
[8]
2,273,161
2,273,162
Fading from one SPAN to another, ending on last, jQuery
<p>Greetings,</p> <p>I am trying to fade in text spans one after another, fading each out before the next is faded in, using jQuery.</p> <pre><code>&lt;p&gt;IN &lt;span class="fadeText"&gt;spiring&lt;/span&gt; &lt;span class="fadeText"&gt;nnovative&lt;/span&gt; &lt;span class="fadeText"&gt;genious&lt;/span&gt; &lt;/p...
jquery
[5]
3,678,056
3,678,057
Choose correct UIButton on dynamiclly created buttons without tags
<p>I am loading up a plist file and creating buttons based on this file. These buttons can change at any point during the application running (which will trigger an update of all the buttons etc).</p> <p>One set of buttons represents a list of categories. So I may have a house button, car button, etc. No matter wha...
iphone
[8]
1,694,207
1,694,208
python: is it possible to attach a console into a running process
<p>I just want to see the state of the process, is it possible to attach a console into the process, so I can invoke functions inside the process and see some of the global variables.</p> <p>It's better the process is running without being affected(of course performance can down a little bit)</p>
python
[7]
3,608,652
3,608,653
Why can't I load my Android 4.1 AVD?
<p>I'm a bit new to Android developing. I followed the tutorials to set up Eclipse and created a 4.1 AVD, but when I attempt to launch the emulator it stops working. It simply gives me the shiny "Android" boot screen indefinitely. What should I do? Thanks in advance!</p>
android
[4]
2,137,393
2,137,394
Use eval() with different local scope
<p>I would like to know how it is possible to call eval() with data from a different local scope.</p> <p>Something like:</p> <pre><code>function doSomething() { var y = 1; print_and_eval('y+1'); } function print_and_eval(data) { print(data); eval(data); } </code></pre> <p><strong>Edit:</strong> - It...
javascript
[3]
3,186,757
3,186,758
jQuery select next closest class
<p>I have a simple list of FAQ's </p> <pre><code>&lt;div class='qcontainer'&gt; &lt;p&gt;Q:&lt;/p&gt; &lt;div class='question'&gt;Question&lt;/div&gt; &lt;/div&gt; &lt;div class='acontainer'&gt; &lt;p&gt;A:&lt;/p&gt; &lt;div class='answer'&gt;&lt;p&gt;Answer&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;div c...
jquery
[5]
310,096
310,097
Recursive printing of a singly linked list homework
<p>I have an assignment in my java class that i need to recursively print out a linked list in reverse. I have looked online and found numerous examples of recursive methods that do this but take a node in as a parameter, and to my understanding i need to take in a linked list because i need to print the entire list ou...
java
[1]
3,557,323
3,557,324
how to get Confirmation and form submit or Abort in code behind.. here i used Code below
<p>if (chk > 0) { ClientScript.RegisterStartupScript(GetType(), "hwa", Confirm('Want to Save?');", true); </p> <p><strong>// I want Section Below this Line Restricted by Confirmation Ok or Cancel..</strong> </p> <p>string qry = "insert into userip values('" + TextBox2.Text + "'," + ddluid.Text + ")"; SqlCommand ...
asp.net
[9]
3,124,962
3,124,963
Return type vararg?
<p>I have a method like:</p> <pre><code>void foo(int x, Grok... groks); </code></pre> <p>There's no way to define a method that returns a type of varargs, right? Ideally I want an additional util method:</p> <pre><code>foo(25, new Grok(), new Grok(), generateMoreGroks()); public Grok... generateMoreGroks() { re...
java
[1]
2,669,850
2,669,851
How do I center a button between two other buttons?
<p>I am trying to get one line with three buttons on it. One far left one in the center and one far right. Ideally I would like the center button to take up all the space between the two side ones. Right now the center(menu) button just overlaps the left side(prev) button. Here is what I have now:</p> <pre><code>&...
android
[4]
1,397,525
1,397,526
bytes of a string in java?
<p>In java if i have a String <em>x</em> how can i calculate the number of bytes in that string?</p>
java
[1]
1,287,040
1,287,041
Button color should not change when I release the button in Android
<p> </p> <pre><code>&lt;item android:state_focused="true" &gt; &lt;shape&gt; &lt;gradient android:endColor="#FF9900" android:startColor="#FF9966" android:angle="270" /&gt; ...
android
[4]
2,863,516
2,863,517
python looking for a specific string pattern
<p>I would like to parse a string in python which is the off format</p> <p>"JXE 2000 This is a bug to fix blah " or of the format</p> <p>"JXE-2000: This is a bug to fix blah " and check if the string has JXE and a number.</p> <p>In the above example I will need to check if the string has JXE and 2000. I am new to ...
python
[7]
5,148,083
5,148,084
applicationWillTerminate works as long as I don't switch off the iPhone
<p>to save some variables of my apps I use:</p> <p>-(void)applicationWillTerminate:(UIApplication *)application {</p> <pre><code>NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setFloat: self.viewController.sLabel.contentOffset.y forKey:@"floatKey"]; [prefs setObject:self.viewController.newText...
iphone
[8]
5,722,625
5,722,626
implementation of command line arg passing in python, doesn't work
<p>I'm very new to python. I wish I could implement the command-line arg passing in python as my first python script. I have written this code:</p> <pre><code>def main(argv): try: opts, args = getopt.getopt(argv, "hb:b:f", ["help", "bucket=", "folder"]) except getopt.GetoptError: usage() ...
python
[7]
5,770,883
5,770,884
permutations of lists python
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/104420/how-to-generate-all-permutations-of-a-list-in-python">How to generate all permutations of a list in Python</a> </p> </blockquote> <p>I want to find all the permutations of a the elements in a list. but t...
python
[7]
5,559,454
5,559,455
setTimeout in javascript question
<p>I understand that the <code>setTimeout</code> function spawns a separate thread that waits for x milliseconds before executing the JS function</p> <pre><code>setTimeout(functionName, timeInms); </code></pre> <p>My question is if there's a way to tell it to run <em>after the JS on the page has completed executing?<...
javascript
[3]
192,212
192,213
Limit the number of items in an array
<p>I have an array that gets processed through a <code>foreach</code> loop.</p> <pre><code>foreach($images as $imageChoices) { Do stuff here } </code></pre> <p>How do I limit the loop to only process the first 4 items in the array?</p>
php
[2]
5,908,221
5,908,222
I am trying a simple Compare 2 text files and print the diff between the 2
<pre><code>import java.io.*; public class CheckingTwoFilesAndComparing implements Serializable { private static final long serialVersionUID = 1L; static String FILE_ONE = "/Users/abextra/myText1.txt"; static String FILE_TWO = "/Users/abextra/myText2.txt"; public static void main(String[] args) { try { ...
java
[1]
57,015
57,016
how to activate section Index Titles For Table View
<p>this is my first question here..</p> <p>I have a tableview setting with numberOfSectionsInTableView=6, which has also custom created cells. I am trying to use 'section index title' with some predefined titles . I have gone through sample code and following the same. I'm able to show section index title from my tabl...
iphone
[8]
2,754,131
2,754,132
iteration problem
<p>I have to iterate through a list <code>error.getGE.getList</code> returns me a arraylist of type GE a bean,how to iterate over this list ?</p>
java
[1]
744,397
744,398
whether cookie will maintain same jsessionid when we send different requests from portlet server to remote web application server?
<p>whether cookie will maintain same jsessionid when we send different requests from portlet server to remote web application server?</p>
java
[1]
3,093,747
3,093,748
Can't convert List<KeyValuePair<...,...>> to IEnumerable<object>?
<p>Getting an InvalidCastException when trying something like this :</p> <pre><code>IEnumerable&lt;object&gt; test = (IEnumerable&lt;object&gt;)new List&lt;KeyValuePair&lt;string, int&gt;&gt;(); </code></pre> <p>However, this did work:</p> <pre><code>IEnumerable&lt;object&gt; test = (IEnumerable&lt;object&gt;)new Li...
c#
[0]
407,259
407,260
Android ICS 4.0 OS
<p>I am a new Android developer starting out.</p> <p>I hope that someone from the androids developers team can answer this question: if I have a tablet with android ICS 4.0 OS, given that this OS is UNIX-based, can I install the Android Developer Kit and related platform+ packages on it, so that I might study developm...
android
[4]
4,979,896
4,979,897
PHP Assign a value to a var from IF statement variable
<p>I have something like this:</p> <pre><code>$msg = ''; $var1 = 'image'; $var2 = 'class'; $var3 = 'This '.$var1.' has this class assigned:'.$var2; if($E == 0) { $msg = $var3; } else { $var1 = 'no image'; $var2 = 'no class'; $msg = $var3; }; echo $msg; </code></pre> <p>I want to be ...
php
[2]
3,214,984
3,214,985
Setting select index
<p>I know I can select an option in a select box by doing </p> <pre><code>$('#selectBox :nth-child(4)').attr('selected', 'selected'); </code></pre> <p>But how can I do this through a returned jQuery object? e.g. something like</p> <pre><code>var box = $('#selectBox'); $(box :nth-child(4)').attr('selected', 'selecte...
jquery
[5]
9,470
9,471
Slowing speed of Viewpager controller in android
<p>Is there any way to slow the scroll speed with the viewpager adaptor in android?</p> <hr> <p>You know, I've been looking at this code. I can't figure out what I'm dong wrong.</p> <pre><code>try{ Field mScroller = mPager.getClass().getDeclaredField("mScroller"); mScroller.setAccessible(true); Scroll...
android
[4]
5,153
5,154
Is there a limit to how long an item is in an array in javascript?
<p>I am trying to figure out if I can store some strings in an array or if I need an object. Is there a limit to the number of characters allowed in an array item?</p>
javascript
[3]
6,020,136
6,020,137
How to make any Java method static at run time?
<p>I am wondering if there is any way to achieve the following.</p> <ol> <li>Find a method using reflection (done)</li> <li>Change the method access modifier to to public and static. (How?)</li> <li>execute this method without having any existing instance (How?)</li> </ol> <p>Does reflection has any option to do this...
java
[1]
533,338
533,339
Which is fastest in PHP?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1813673/php-string-concatenation-a-b-vs-a-b-performance">PHP String concatenation - &ldquo;$a $b&rdquo; vs $a . &ldquo; &rdquo; . $b - performance</a> </p> </blockquote> <pre><code>&lt;?php $url = 'http://ww...
php
[2]
3,353,955
3,353,956
Removing decimals from the TextBos while loading
<pre><code>obj[i]['Weight'] = parseFloat("0"); obj[i]['Height'] = parseFloat("0"); obj[i]['Temperature'] = parseFloat(0,10); </code></pre> <p>// This does not work... </p> <pre><code>obj[i]['Weight'] = parseInt(0,10); obj[i]['Height'] = parseInt(0,10); obj[i]['Temperature'] = parseInt(0,10); </code></pre> <p>// This...
javascript
[3]
3,299,138
3,299,139
Get the maximum value out of an complex class
<p>I have the following class:</p> <pre><code>class Seller { private string sellerName; private decimal price; } ~propreties for SellerName and Price goes here~ </code></pre> <p>I also have a list of sellers:</p> <pre><code>list&lt;Seller&gt; s = new list&lt;Seller&gt;(); </code></pre> <p>How can I get the ...
c#
[0]
4,818,146
4,818,147
.apk file upload error
<p>When i upload my .apk file it gives this error</p> <p>The certificate that signed this apk is not valid until the future. Create a new certificate.</p> <p>Thanks</p>
android
[4]
5,623,849
5,623,850
Time between client inputs in socket communication
<p>I have a simple socket server client communication in java where the clinet introduce a string and the server return the number of spaces from that string. I want to finish the communication if the client does'n introduce nothing for more than 10 seconds but i don't know how. Any idea please?</p>
java
[1]
791,514
791,515
Can I make a ListView item not selectable?
<p>I am implementing an endless ListView (like in the Twitter app). I want to make the last item not selecteble. So that if the penultimate item is selected and I scroll down with my trackball, nothing happens. I tried setting android:focusable="false" and android:cickable="false" but I didn't notice any chnage.</p>
android
[4]
5,509,900
5,509,901
What does Java compiler interprets by `(byte) + (char) - (int) + (long) - 1`?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7924961/weird-java-behavior-with-casts-to-primitive-types">Weird java behavior with casts to primitive types</a> </p> </blockquote> <p>Why does this code in Java,</p> <pre><code>int i = (byte) + (char) - (int) ...
java
[1]
5,209,999
5,210,000
How to add a scrollbar to jQuery tabs
<p><img src="http://i.stack.imgur.com/ehLuw.jpg" alt="alt text">Please visit <a href="http://210.94.200.250/ocw/view.php?id=1" rel="nofollow">my page</a>.</p> <p>And if you click other tabs, you'll see what my problem is. The tab DIV will go over the line of my wrapper. I tried to figure out if there's any option to a...
jquery
[5]
4,517,830
4,517,831
Learning Java - importing and packages basics
<p>I'm reading every tutorial I can find as well as a book, still trivial concetps leave me asking questions:</p> <ol> <li><p><code>CLASSPATH</code> is a variable registered with the JVM that tells java the root directory in which to start looking for classes/jars/etc?</p></li> <li><p><code>import</code> is similar to...
java
[1]
3,021,806
3,021,807
What is a Class Library in Java?
<p>What is a Class library in Java? Is it a collection of classes with in a package, or it is a package that has collection of classes?</p> <p>I'm bit confused. ^_^</p>
java
[1]
86,228
86,229
ValueError: invalid literal for int(): Screw plugg (91_10 -> untitled) in python
<p>i have</p> <pre><code>form = self.request.form partintid = int(form['item_01bom']) # value is 'Screw plugg (91_10 -&gt; untitled)' print partintid </code></pre> <p>i want to convert <code>'Screw plugg (91_10 -&gt; untitled)'</code> to int.</p> <p>but i get <code>ValueError: invalid literal for int(): Screw plu...
python
[7]
4,786,686
4,786,687
Displaying MessageBox when disabled menu item is clicked
<p>I want to display a message box when any person clicks on the menu item which is not enabled I have tried the following coding but it is not displaying the message box.</p> <p>Coding:</p> <pre><code>private void updateFineDetailsToolStripMenuItem_Click(object sender, EventArgs e) { if (updateFineDetailsToolStr...
c#
[0]
2,184,957
2,184,958
How to record video in iphone
<p>HI,</p> <p>I need to record video using iPhone. To do that i used UIImagePickerController. I have an iPhone 3G, with me. when i run my code to check if source type available it says device not supported. My OS is 3.2.1, where i am wrong, can some one tell me what i need to change. </p> <p>Also is there some other ...
iphone
[8]
5,051,527
5,051,528
Jquery sliding display built around moving a vertical stack of images
<p>How would I scroll a stack of images, horizontally, through a vertically aligned space? Imagine a layout like this:</p> <p>I have a viewable area, say a div, with a fixed size (50px wide by 300px tall) and overflow set to none to hide anything outside of it...</p> <p>That div has three images stacked vertically di...
jquery
[5]
3,479,423
3,479,424
jquery fadein for all images, should be simples?
<p>I thought this would be a simple things to do, but been searching about an hour...</p> <p>I'm trying to use jquery fadein for all images on a WP site.</p> <p>I've got as far as loading jquery</p> <p>but then all the things I find online are really complex, is there a simples .js I can load to apply fadein unila...
jquery
[5]
616,426
616,427
IndexOutOfBoundsException error
<pre><code>public void thisisnotworking() { Scanner input=new Scanner(System.in); String cardA; String cardB; System.out.print("Enter Card: "); cardA=input.nextLine(); System.out.print("Enter Card "); cardB=input.nextLine(); Card a = game.get(game.indexOf(cardA)); Card b = game.get(game.indexO...
java
[1]
2,375,972
2,375,973
Case insensitive string::find
<p>Is there exist a case insensitive find() method for std::string?</p>
c++
[6]
5,110,047
5,110,048
How to upload videos using youtube gdata api in android?
<p>I want to upload video from my application into YouTube, and then I want to get the ID of that uploaded video. I have heard that we have to use GDATA (YouTube API) for that, but I don't know how to do that. an anyone help me?</p>
android
[4]
5,838,090
5,838,091
How to Add and activate PPTP or L2TP VPN connection?
<p>i am developing the one SIP based application to make and receive a calls. In which i need to access a PPTP VPN connection because in some countries VOIP and SIP are blocked.If i use VPN connection then calls will not block even VOIP and SIP are blocked in that country. So how do i add a new PPTP VPN connection? </p...
android
[4]
4,973,329
4,973,330
Url splitting in php
<p>I have an url like this:</p> <blockquote> <p><a href="http://www.w3schools.com/PHP/func_string_str_split.asp" rel="nofollow">http://www.w3schools.com/PHP/func_string_str_split.asp</a></p> </blockquote> <p>I want to split that url to get the host part only. For that I am using </p> <pre><code>parse_url($url,P...
php
[2]
3,484,254
3,484,255
Strange width issue in Jquery
<p>while setting the same contents of the same label box, the width() values returned are different</p> <pre><code> $("#ArticleUrl").text("demo"); alert($("#ArticleUrl").width()); $("#ArticleUrl").text("demo"); alert($("#ArticleUrl").width()); </code></pre> <p>How do we avoid this?</p>
jquery
[5]
3,481,463
3,481,464
multidimensional arrays in javascript
<p>Sorry for the submitting the Question.</p>
javascript
[3]
2,331,532
2,331,533
android applications
<p>in my application i want to create a shortcut (a button), to another application but i want the user to be able to select which application he wants... So how do i access a list of all the installed applications and how do i create an intent to start any one of those applications ?</p>
android
[4]
4,192,059
4,192,060
How can we temporarily turn off the running website & give a message "This site is Temprorary unavailable"
<p>How can we temporary off the running website &amp; gives a message "This site is Temprorary unavailable", actully i want to gives a power to admin he can temporary on/Off the website... according to my need i dnt want to add web_offline.htm page. I simply do it by button control i.e. Active website &amp; Deactive we...
asp.net
[9]
4,622,061
4,622,062
Using LoaderManager without SimpleCursorAdapter
<p>I'm trying to update an app I wrote a year or so ago and upgrade all calls to deprecated code. In one place, I was using a SimpleCursorAdapter in a ListView, and I'd like to replace that with a proper LoaderManager, for several reasons.</p> <p>The problem is, that all the examples I've been able to find of using a ...
android
[4]
1,033,344
1,033,345
Filetype information
<p>I'm in the process of writing a python script, and I want to find out information about a file, such as for example a mime-type (or any useful depiction of what a file contains).</p> <p>I've heard about python-magic, but I'm really looking for <em>the</em> solution that will allow me to find this information, witho...
python
[7]
2,023,143
2,023,144
Alert firing on ready but action not working
<p>On page load I want a div to be hidden. I attached an alert that is appearing but its not hiding the div. </p> <p>Code:</p> <pre><code>$(function () { alert('test'); $('#hide').hide(); }); &lt;div id="hide"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Facebook&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a h...
jquery
[5]
1,338,245
1,338,246
Can't install python modules
<p>I have a problem with the following command: </p> <blockquote> <p>setup.py install. </p> </blockquote> <p>I know it should work, I have tried it on a laptop but I don't have access to it at the moment. I need to complete a homework so I tried the same on my PC. And when I type the same command into cmd it just ...
python
[7]
1,882,702
1,882,703
Android Development,Animation
<p>I'am trying to draw a cloud animation i have ok class to do all draw work but i can't achive to run it. here is my code(i'm new in this stuff),</p> <pre><code>public class SampleAnimationActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstance...
android
[4]
1,625,729
1,625,730
Subtract & get difference of two images(touchpaint) and get an integer value in Android
<p>I have a requirement where the user needs to draw something on a FingerPaint like application and submits. I need to check to what extent the image matches and take the difference of the user's image with the ACTUAL image. The difference should then return an integer value. Depending on that, the user gets a score. ...
android
[4]
3,198,761
3,198,762
BufferedReader - read line by line
<p>I have created a buffered reader like this:</p> <pre><code>this.inFile = new BufferedReader(new FileReader(fileName)); </code></pre> <p>And then, I read from it like this</p> <pre><code>while(System.currentTimeMillis() - lastRead &lt; someTreshold) { Thread.sleep(1) } lastRead += someTreshold; String line = i...
java
[1]
1,303,464
1,303,465
Python defining variable
<pre><code> def f(g, x): return g(x) + g(x-1); def square(x): return x*x; </code></pre> <p><code>f(square, n)</code> would the output just be <code>n^2+(n^2-1)</code>? Or would it be different? </p>
python
[7]
1,153,785
1,153,786
DomainName & Developing Time
<p>is there any way to develop a website by a domain name in win 7 (or even win2008)? I mean in develop time (in VS 2010) when I press F5 , I see my application under a real domain name like : [MyDomainName.com] instead of [localhost\ProjectName]</p> <p>Thank you very much for your feedbacks</p>
asp.net
[9]
3,357,007
3,357,008
Replacing the variables in a file read by php
<p>I have a small app I am working on that generates configuration files. Because it may be used to generate a few different variants of configurations, I gather the variable values from the user, and then read in a template configuration from a file. That file has the names of the variables in it (i.e. $ip_address) at...
php
[2]
4,711,588
4,711,589
Showing comments on same page, what is best tool to do that?
<p>I have a webpage on which people can comment about each topic. Problem is there are lets say 100 topics on the page. Each time user clicks on the topic he is redirected to new page. Where they can comment and start discussion. I want this to happen on same page. I thought about implementing colorbox, boxy and other ...
jquery
[5]
2,919,414
2,919,415
What's the difference between these two selectors?
<pre><code>$(this).parents('table:first &gt; tbody &gt; tr') </code></pre> <p>And</p> <pre><code>$(this).parents('table:first').children('tbody').children('tr') </code></pre>
jquery
[5]
2,522,123
2,522,124
How do include a javascript function in the animate queue?
<p>How do I include a Javascript function in the middle of the animate queue? For example I would like to call <code>alert()</code> in between these two jQuery functions to animate the height property:</p> <pre><code> $('#divContainer').animate({ height: "200px" }, 'slow').alert('alert goes here').animate({ height: "5...
jquery
[5]
3,685,644
3,685,645
Additions of tabbar and navigation bar controllers
<p>Hii...</p> <p>I have added the tabbar and navigation bar controller by using following code. But only on the first tab I have added table view and buttons but it is also displaying on others tab views. What is the problem with this code I am not able to come to know. please help me If anyone know.</p> <pre><code>-...
iphone
[8]
4,365,995
4,365,996
Unable to download Android 2.3.3 in Android SDK Manager
<p>I've tried to install Android 2.3.3 so I can then install OpenSense for HTC phones.</p> <p>When I start the procedure to download Android 2.3.3 in the Android SDK Manager I get the followin messages:</p> <blockquote> <p>Preparing to install archives Downloading SDK Platform Android 2.3.3, API 10, revision 2 </...
android
[4]
3,824,827
3,824,828
customErrors mode="Off" in web.config but still Server Error in '/' Application
<p>I deployed an asp.net website to a shared server..... </p> <p>I got the error </p> <p><code>Server Error in '/' Application.</code></p> <p><strong>Runtime Error</strong></p> <p><code>Description: An application error occurred on the server. The current custom error settings for this application prevent the detai...
asp.net
[9]
2,962,293
2,962,294
Read the first and last character of line in txt
<p>I wanna take lines that start with capital and end with dot.</p> <pre><code>function isCapital($string) { return preg_match('/^\\s*[A-Z]/', $string) &gt; 0; } foreach ($url as $file =&gt; $files) { $lines = file($files); foreach ($lines as $key =&gt; $line) { if (isCapital($line) &amp;&amp; (su...
php
[2]
239,702
239,703
Basic description on how to record video in iOs 4
<p>Hey guys i was curious if anybody could give me a very brief description of how to make an app record video in iOs 4. I know how to do all the media and whatnot using the os 3 method of using the UIImagePickerController but I do not know if that is still available in iOs4 and if not, could someone please give me a v...
iphone
[8]
1,569,139
1,569,140
Folderbrowserdialog browsing a remote pc
<p>I have a question regarding folderbrowser when i browse to a remote computer nothing is showing under that object.</p> <p>But if i use fileopen and browse to the same location it lists all the folders and files, is there some sort of authenication happening with the fileopen?</p> <p>If so how can i authenicate so ...
c#
[0]
1,573,897
1,573,898
PHP Blank Values Inserted In Database
<p>I'm using PHP and Mysql</p> <p>Here I have used simple form to insert the Name, Email, Phone Number.</p> <p>I have validated all the data's: (PHP code after submit...)</p> <pre><code>$error = array(); if(isset($_POST['Name']) &amp;&amp; $_POST['Name']=='') { $error[] = "Please enter the Name"; } if(isset($...
php
[2]
2,941,743
2,941,744
Emoji like Application
<p>I want to create Custom Keyboard application like Emoji app. I know how to enable emoji in the iphone but my question is from were the icons are coming and how i can add my own icons to emoji keyboard or i have to make my own keyboard separate.</p> <p>This all should work with all app like email, notes etc...</p> ...
iphone
[8]
1,846,076
1,846,077
How To Play Video File Using Asp.net Flash Video Control?
<p>Can u pls tell me How To play the Video File Using Flash Video Controller in asp.net. i'm Getting the Saved Video Path but it didn't play the video.</p>
asp.net
[9]
2,757,674
2,757,675
Encoding spaces with the javascript encodeURIComponent function
<p>Why does the javascript function encodeURIComponent encode spaces to the hex unicode value %20 insteady of +. Should uri parameters not spaces to +?</p>
javascript
[3]
4,935,687
4,935,688
how to change the UILabel value base don uiwebview action
<p>Iam developing one application.In that I want to change the value of <code>UILabel</code> if <code>UIWebview</code> finish loading.</p> <p>First in webview load the below html file</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=“content-type”content=“text/html;charset=utf-8″ /&gt; &lt...
iphone
[8]
2,880,297
2,880,298
Why does this particular JavaScript code work this way?
<pre><code>var my_obj = Object.create({}, { getFoo: { value: function() { return this.foo; } } }); my_obj.foo = 1; alert(my_obj.getFoo()); </code></pre> <p>Why is <code>getFoo</code> the function instead of <code>value</code>?</p>
javascript
[3]
2,089,055
2,089,056
Bluetooth save chat history in android
<p>is there any way to store bluetooth chat history device wise.if yes then please guide me.</p>
android
[4]
4,893,099
4,893,100
Syntax problem when checking for a file
<p>This piece of code has previously worked but I have C&amp;P it to a new place and for some reason, it now won't work!</p> <pre><code> &lt;? $user_image = '/images/users/' . $_SESSION['id'] . 'a.jpg'; if (file_exists(realpath(dirname(__FILE__) . $user_image))) { echo '&lt;...
php
[2]
5,744,973
5,744,974
Transferring variables between two classes
<p>I have 2 classes:</p> <pre><code>public class TouchImageView extends ImageView public class TouchImageViewActivity extends Activity </code></pre> <p>In my <code>TouchImageView</code> class I have touch listener that calculates where you have touched the image. What I need is to transfer the touch point to the <cod...
android
[4]
5,041,880
5,041,881
Why does a specific import sees other imports? Python 2.6
<p>I have two files. SysDump.py which does <code>from libApi import _SysDump</code> and in the other file libApi.py I have many classes and one of them is </p> <pre><code>class _SysDump(): import cPickle as _cPickle import math as _math from zipfile import ZipFile as _ZipFile import re as _re </code><...
python
[7]
5,295,046
5,295,047
I need to get some device values in Android
<p>I need to get the device name, version, display values (high, width, layout). After that, I need to create a <code>JSON</code> result. </p>
android
[4]
5,357,797
5,357,798
Why am I getting a DefferedDocumentImpl when trying to create a JDOM Document?
<p>Im trying to parse the input stream from a zipfile zip entry and trying to create a org.w3c.dom.Document but for some reason im getting a DefferedDocumentImpl back. Im also creating a new org.w3c.dom.Document and this is returning a DocumentImpl. Then using Xpath to select a single node but im getting this error "or...
java
[1]
4,568,716
4,568,717
Javascript - possible to remove element of an associative array
<p>Is it possible to remove an element of a Javascript associative array (i.e., set back to native undefined)?</p> <p>When I tried simply <code>alert(array['knownKey']); array['knownKey']=undefined; alert(array['knownKey']);</code> ... the second alert produced the literal undefined... whereas, the first alert returne...
javascript
[3]
2,103,163
2,103,164
Jquery cookie + google map api 3 latlng
<p>I have this javascript,</p> <pre><code> if ( $.cookie("latlng") ) { myLatlng = new google.maps.LatLng( $.cookie("latlng") ); //problem here?? } else { $.cookie("latlng", "0,0", { path: '/' }); myLatlng = new google.maps.LatLng(0,0); } </code></pre> <p>The cookie function is using <a href="https://...
javascript
[3]
4,855,785
4,855,786
AIDE Won't Build App Stuck on "Running AADT" Stage
<p>I've moved an app to mmy device so that AIDE can build it and so I can install but it is stuck at the AAPT stage. Any suggestions?</p>
android
[4]
3,177,571
3,177,572
send touch event from ADB to a device
<p>I am trying to send touch events to a device using ADB shell command, so that I can do some basic automation for UI tests. I have followed the discussion in some previous threads regarding this. </p> <p>I confirmed about getting the events and using sendevents,to send out 6 events for each touch ( xcoord, ycoord, 2...
android
[4]