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
349,132
349,133
Why doesn't `index = index++` increment `index`?
<p>** Dup: <a href="http://stackoverflow.com/questions/226002/whats-the-difference-between-x-x-vs-x">http://stackoverflow.com/questions/226002/whats-the-difference-between-x-x-vs-x</a> **</p> <p>So, even though I know you would never actually do this in code, I'm still curious:</p> <pre><code>public static void main(String[] args) { int index = 0; System.out.println(index); // 0 index++; System.out.println(index); // 1 index = index++; System.out.println(index); // 1 System.out.println(index++); // 1 System.out.println(index); // 2 } </code></pre> <p>Note that the 3rd <code>sysout</code> is still <code>1</code>. In my mind the line <code>index = index++;</code> means "set index to index, then increment index by 1" in the same way <code>System.out.println(index++);</code> means "pass index to the println method then increment index by 1".</p> <p>This is not the case however. Can anyone explain what's going on?</p>
java
[1]
194,928
194,929
$_Post problems
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4065978/what-is-this-notice-referring-to">what is this notice referring to </a> </p> </blockquote> <p>can i get an answer in plain English please i am new at this .. the better it is explained the fewer times i will need to repost</p> <pre><code>Notice: Undefined index: username in C:\wamp\www\espn.com\login.php on line 16 Notice: Undefined index: password in C:\wamp\www\espn.com\login.php on line 17 1&lt;?php 2 3//Database Information 4 5 $dbhost = "localhost"; 6 $dbname = "users"; 7 $dbuser = "root"; 8 $dbpass = "*****"; 9 10 //Connect to database 11 12 mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); 13 mysql_select_db($dbname) or die(mysql_error()); 14 15 session_start(); ****16 $username = $_POST['username']; 17 $password = md5($_POST['password']);**** 18 19 $query = sprintf('SELECT * FROM users WHERE username="%s" AND password="%s"', 20 ($username), ($password)); 21 22 $result = mysql_query($query); 23 if (mysql_num_rows($result) != 0) { $error = "Bad Login"; include "login.html"; } else { $_SESSION['username'] = "$username" ; include "memberspage.php"; } </code></pre>
php
[2]
3,993,941
3,993,942
Date field change event with the calendar control
<p>When I bind the change event to a date field (using jQuery), it works fine if I type something in the field; as soon as I leave the field my event handler fires. The problem is that if the date is changed using the graphical calendar widget control, the event does not fire. Does anyone have a suggestion for how I can make this work? Thanks</p>
jquery
[5]
3,108,194
3,108,195
What makes sets faster than lists in python?
<p>The python wiki says: "Membership testing with sets and dictionaries is much faster, O(1), than searching sequences, O(n). When testing "a in b", b should be a set or dictionary instead of a list or tuple."</p> <p>I've been using sets in place of lists whenever speed is important in my code, but lately I've been wondering why sets are so much faster than lists. Could anyone explain, or point me to a source that would explain, what exactly is going on behind the scenes in python to make sets faster?</p>
python
[7]
1,300,256
1,300,257
Change a td after cloning the element in jQuery
<p>I would like to change the first TD in the <code>&lt;tr&gt;</code> element I am cloning.</p> <p>Im cloning and inserting after the last <code>.deals_options</code> tr element</p> <pre><code> var $orig = $('.deals_options:first'); for (var i = 0; i &lt; Math.abs(amount - selectCount); i++) { $orig.clone().insertAfter('.deals_options:last'); } </code></pre> <p>Works fine, but now inside this tr element <code>.deals_options</code>, I would like to add html inside the first <code>&lt;td&gt;</code>.</p> <p>How can i insert text in the first td, in the cloned element i am inserting?</p>
jquery
[5]
2,369,614
2,369,615
how to allow CORS /Access-Control-Allow-Origin
<p>sorry for the stupid question, but how to I allow "Access-Control-Allow-Origin?"</p> <p>I want page A (the page I am getting content from) to allow page B(where I need content pulled into) access. It's weird they are both on the same server one is a wordpress page and one is static.. not sure where the code is supposed to go to make this happen. </p>
jquery
[5]
1,802,227
1,802,228
present a modal view from a modal view currently presented
<p>I need to implement kind of a chain of modal view, in which a modal view is called from a modal view currently presented. I believe I have implemented everything right, but it crashes.</p> <p>Is it a feasible idea?</p> <p>this is how I'm calling the second modal view from the first modal view</p> <pre><code>hofButton = [[UIButton alloc] init]; hofButton.frame = CGRectMake(700.0, 450.0, 300.0, 200.0); [hofButton addTarget:self action:@selector(showHOF:) forControlEvents:UIControlEventTouchUpInside]; -(void)showHof{ modalHallOfFame = [[hallOfFame alloc] init]; modalHallOfFame.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:modalHallOfFame animated:YES]; } </code></pre>
iphone
[8]
1,173,411
1,173,412
toArray(new MyObject[size]) vs iterating over list and filling the array
<p>which one of the following methodologies is safe from performance hits, assume that the size of List is large (may be 1,000 objects).</p> <p><strong>i)</strong></p> <pre><code>List&lt;String&gt; myList = new ArrayList&lt;String&gt;(); for(int i=0; i &lt;=10; i++){ myList.add(""+i); } String[] array = myList.toArray(new String[myList.size()]); myArrayMethod(array); // this method returns the array - it modifies the content but not size of array. myListMethod(myList); // this method processes the list. </code></pre> <p><strong>ii)</strong></p> <pre><code>List&lt;String&gt; myList = new ArrayList&lt;String&gt;(); for(int i=0; i &lt;=10; i++){ myList.add(""+i); } String[] array = new String[myList.size()]; int i = 0; for(String str : myList){ array[i] = myList.get(i); i++; } myArrayMethod(array); // this method returns the array - it modifies the content but not size of array. myListMethod(myList); // this method processes the list. </code></pre>
java
[1]
2,061,083
2,061,084
how to find the position of an item in a listview?
<p>I delete an item in a listview so that it does not appear! I know the name of the element (like if I have a list of fruits: apple is the target) I want to delete the "apple". To do this I use the <code>lv.remove(position)</code> where lv is ListView, how do I find the position knowing only the name "Apple" and NO (xy) of the listview?</p>
android
[4]
5,537,746
5,537,747
javascript multiple keys pressed at once
<p>I'm trying to develop a javascript game engine and I've came across this problem:</p> <p>When I press <strong>space</strong> the character jumps. When I press the right arrow the character moves right.</p> <p>The thing is that when I keep pressing right then I press space the character jumps then it stops moving.</p> <p>I use the <strong>keydown</strong> function to get the key pressed, how can I check if there're multiple keys pressed down?</p>
javascript
[3]
1,599,658
1,599,659
How to avoid false clicks activate unnecessarily function mouseup
<p>What solution can I find to prevent unnecessarily clicks activate function mouseup. here <a href="http://jsfiddle.net/centerwow/c6ABa/6/" rel="nofollow">jsfiddle </a></p>
jquery
[5]
5,262,925
5,262,926
Sorting positions in Java
<p>I don't know how to put the question forth but i think an example might go a long way in clearing up the question....so here it is:</p> <p>Say i have an array of strings: "Bob" "Alan" "Conrad" "Alice" "Alex".</p> <p>After sorting alphabetically the array will become:"Alan" "Alex" "Alice" "Bob" "Conrad".</p> <p>So we know in this case that the sorted element starting from "B" will be positioned after position number 3.</p> <p>Now my question is,is there an inbuilt function in java/android which will let me know after the sorting where one group ends and the other starts (At which position the string transitions from "A" to "B")? </p> <p><strong>EDIT</strong>: Or maybe even two different functions used in conjunction</p>
java
[1]
4,626,590
4,626,591
how to find a reference datatype
<p>public static void Refer(ref int a,ref int b)<br /> in this how do i find that these variables are reference variable programatically ..how do i find their type </p>
c#
[0]
4,173,792
4,173,793
How to copy or duplicate an array of arrays
<p>I'm trying to make a function that duplicates an array of arrays. I tried blah.slice(0); but it only copies the references. I need to make a duplicate that leaves the original intact. </p> <p>I found this prototype method at <a href="http://my.opera.com/GreyWyvern/blog/show.dml/1725165" rel="nofollow">http://my.opera.com/GreyWyvern/blog/show.dml/1725165</a></p> <pre><code>Object.prototype.clone = function() { var newObj = (this instanceof Array) ? [] : {}; for (i in this) { if (i == 'clone') continue; if (this[i] &amp;&amp; typeof this[i] == "object") { newObj[i] = this[i].clone(); } else newObj[i] = this[i] } return newObj; }; </code></pre> <p>It works, but messes up a jQuery plugin I'm using - so I need to turn it onto a function... and recursion isn't my strongest. </p> <p>Your help would be appreciated!</p> <p>Cheers,</p>
javascript
[3]
3,511,447
3,511,448
how to obtain MD5 from debug.keystore on live server in Android
<p>I am working on on application that works on the principal of one Google Map Api key for all. Basically I'd like to have one key on my server to be used multiple times on multiple applications.</p> <p>Is this possible? I have scoured the web but all seem to point to local server. Could anyone please let me now if this can be done?</p> <p>Thanks in advance.</p>
android
[4]
5,335,865
5,335,866
Java value object comparison methods
<p>I'm new to Java and trying to learn.</p> <p>Java doesn't have operator overloading, so when coding a value object I understand that you need to compare objects with an overridden 'equals' method instead of the == operator, but I have yet to read about the other methods you need to override. What about the equivalent methods for the other common operators: >, &lt;, >=, and &lt;=. Do these methods need to be overridden, or do I have to create them if I need them. If I have to create these methods, there must be some standard naming convention for them ('gt', 'lt', 'gte', 'lte'). What is it?</p>
java
[1]
978,602
978,603
Printing binary values in Java
<p>Why the output of a java program is 8 and 9 while we try to print 010 and 011 respectively?</p> <p>What is the reason?</p>
java
[1]
1,762,639
1,762,640
jquery on(live function)
<p>Why this code is not working?</p> <pre><code>$("div.class ul li").on("click","a",function(){ alert("A"); }); </code></pre> <p>But this works fine...</p> <pre><code>$("body").on("click","div.class ul li a",function(){ alert("A"); }); </code></pre>
jquery
[5]
1,836,338
1,836,339
Access Local files in iphone Programmatically
<p>How can an application access local files (documents etc.) present in the iphone? </p>
iphone
[8]
2,015,512
2,015,513
Getting error while installing application
<p>I have made an application. I have used google API target 4.0 but when I run the activity ,instead of getting install it gives me error. I have also kill the server and then start it but still I am getting same error.</p> <pre><code>installation error: install_failed_missing_shared_library </code></pre>
android
[4]
1,408,677
1,408,678
ANR handling, show messagebox
<p>Is it possible for a class to listen to events which is triggered when ANR? My goal is to show the user a custom dialog, where the <code>stacktrace</code> is displayed with a button that allows the user to post the stacktrace to support. Do not care about the dialog, I can do this myself, I'm just interested in ANR handling(libraries or eventhandling) </p> <p>Thanks! </p>
android
[4]
328,912
328,913
Jquery Submit form and POST certain values to another script
<p>I have a payment button on a page that submits info to a payment processor and on the same page there is a form with some custom fields that updates a contact info when u submit it.</p> <p>Im using a jquery script that submits the payment button and at the same time POSTS the values of the form to the updatecontact php script.</p> <p>But its not working, its not posting the values to the updatecontact php script.</p> <p>Please take a look at the code below to see if u can discover what am i doing wrong.</p> <p><a href="http://jsfiddle.net/QunPb/1/" rel="nofollow">http://jsfiddle.net/QunPb/1/</a></p> <p>The URL where the code is: <a href="http://ofertasclaras.com/envio.php" rel="nofollow">http://ofertasclaras.com/envio.php</a></p>
jquery
[5]
4,954,719
4,954,720
iPhone - Transparent status bar does not resize subviews
<p>I have two viewcontrollers in my app, one of them shows an opaque status bar (default) while the other shows a black translucent status bar.</p> <p>When I come from the first view controller to the other, in viewWillDisappear of controller1, I specify this</p> <pre><code>[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES]; </code></pre> <p>The autoresizing mask of controller2 is set as follows</p> <pre><code>self.view.autoresizesSubviews = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; </code></pre> <p>But even then, when controller2's view appears, the view begins from right below the status bar. I see a white space below the status bar. When the status bar is hidden after 3 seconds, the view adjusts and covers the white space. When the view is again tapped to show the status bar, the view shifts down to leave white space below the status bar.</p> <p>Can someone please let me know how to resolve this.</p> <p>Thanks.</p> <p><strong>More Info</strong></p> <p>This is only a problem with 3.x. With 2.2.1 the same code works fine and the view starts from behind the status bar.</p> <p>Adding images to show what I mean <img src="http://img64.imageshack.us/img64/4008/withstatus.png" alt="alt text"></p> <p><img src="http://img63.imageshack.us/img63/6281/withoutstatus.png" alt="alt text"></p>
iphone
[8]
4,832,679
4,832,680
Store files in FTP server
<p>I would like to store a series of files into ftp server using java... I tried this..but I want to store a series of files</p> <pre><code>try { client.connect("ftp.domain.com"); client.login("admin", "secret"); // // Create an InputStream of the file to be uploaded // String filename = "Touch.dat"; fis = new FileInputStream(filename); // // Store file to server // client.storeFile(filename, fis); client.logout(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (fis != null) { fis.close(); } client.disconnect(); } catch (IOException e) { e.printStackTrace(); } } </code></pre>
java
[1]
4,210,556
4,210,557
Trouble in stopping broadcast reciever
<p>I am doing an app which will speak the caller name.It is having a main Activity and two broadcast receivers for monitoring incoming calls and SMS. from that receivers it starts an service for speak out the caller name. </p> <p>The Problem i am facing with this is</p> <pre><code> I want to start ans stop this broadcast receivers from the UI.i mean with the help of two buttons. </code></pre> <p>Is it possible,If yes how can i do it.</p>
android
[4]
456,877
456,878
Remove spam url in text
<p>Input:</p> <blockquote> <p>dsfdsf www. cnn .com dksfj kdsfjkdjfdf www.google.com dkfjkdjfk w w w . ya hoo .co mdfdd</p> </blockquote> <p>Output:</p> <blockquote> <p>dsfdsf dksfj kdsfjkdjfdf dkfjkdjfk mdfdd</p> </blockquote> <p>How do I write a function that does this in C#?</p>
c#
[0]
2,310,234
2,310,235
ASP.Net, How to solve this error
<h2>`Server Error in '/' Application.</h2> <p>Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. </p> <p>Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.</p> <p>Source Error: </p> <pre><code>Line 29: &lt;/connectionStrings&gt; Line 30: &lt;system.web&gt; **Line 31: &lt;sessionState timeout="20"&gt;&lt;/sessionState&gt;** Line 32: &lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/&gt; Line 33: &lt;!-- </code></pre> <p>Source File: D:\SILINDIA\WEBSITE\web.config Line: 31 </p>
asp.net
[9]
1,055,275
1,055,276
get url and add to href in jQuery or JS
<p>on a page i have a link </p> <pre><code>&lt;a href="/_l/R/Contact.aspx" id="ctl00_SPLinkbutton1"&gt;&lt;span class="ms-splinkbutton-text"&gt;Contact&lt;/span&gt;&lt;/a&gt; </code></pre> <p>I would like to get the current url of the page i'm on and add it to the href. </p> <p>So if I am on <code>http://mysite.com</code> when I click the link contact above I would go to the page <code>http://mysite.com/_l/R/Contact.aspx?source=http://mysite.com</code>.</p> <p>Any ideas on how to achieve that in jQuery or JS?</p>
jquery
[5]
5,046,505
5,046,506
How to display the contents of a directory
<p>I need to write a recursive algorithm to display the contents of a directory in a computer's file system but I am very new to Java. Does anyone have any code or a good tutorial on how to access a directory in a file system with Java??</p>
java
[1]
2,849,694
2,849,695
Use PHP to track links
<p>I have various links in my website that point to a specific form.</p> <p>Whenever someone fills out the form, I want to be able to know what link led them to the form.</p> <p>I want to do this without having to create an individual line of PHP code for every link I create in the. Instead, I want to have some PHP code that picks up something from that link, and maybe inserts it into a hidden text box that gets its value or text from something that I tag in the link.</p> <p>For example:</p> <ol> <li>User clicks a link.</li> <li>That link directs them to a form.</li> <li>The link carries an identification that activates PHP code</li> <li>When I recieve the form, I know what link was clicked to get to that form.</li> </ol> <p>I want it to work with links in emails I send out as well.</p>
php
[2]
875,773
875,774
redirect to new page when i click on Cancel button in C# (webpart)
<pre><code>// Cancel button tc = new TableCell(); btnCancel = new Button(); btnCancel.Text = "Cancel"; btnCancel.Click += new EventHandler (btnCanel_Click ) ; tc.Controls.Add(btnCancel); tr.Controls.Add(tc); t.Controls.Add(tr); // Empty table cell tr = new TableRow(); tc = new TableCell(); tr.Controls.Add(tc); this.Controls.Add(t); } protected void btnCanel_Click(object sender, EventArgs e) { } </code></pre> <p>What i am tring to do is . when i click on Cancel button it redirect me to "Example.aspx". i am create a webpart using C#</p>
c#
[0]
4,826,308
4,826,309
Removing Logging from Production Code in Android?
<p>What is the best way to remove logging from production android application. It appears that proguard does not do this completely, strings still get written, so I was wondering what is best solution to remove the logging from production code?</p>
android
[4]
2,803,736
2,803,737
Dynamically generated radiobutton by jQuery cannot be selected in IE6
<p>I need to dynamically generate radio or checkbox by jQuery.<br /> I use the following code: </p> <pre><code>var type = "radio"; // maybe checkbox $('&lt;input type="'+ type +'"&gt;').attr({ name: "ename", value: "1" }) </code></pre> <p>However, the radio generated cannot be selected in IE6(other browsers are fine). What should I do?</p> <p>marcc's answer solves my problem.</p>
jquery
[5]
5,716,601
5,716,602
PHP If Shorthand Question
<p>Hey all. I have a question regarding PHP's If shorthand. Is it possible with PHP's If shorthand to first include a file and then create a class from that file?</p> <p>Here's what I mean:</p> <pre><code>$object = ($userpresent) ? include file; new firstclass : include different file; new otherclass; </code></pre> <p>I know the above is incorrect. But is there a way to do this with shorthand?</p> <p>Thanks</p>
php
[2]
292,248
292,249
iPhone, APNS usage
<p>I have a question about APNS...</p> <p>my iPhone lost, I know deviceToken, I have push some message to my iPhone, I want know if the iPhone OS was restore or reset, your know, all app will be removed includes my app, </p> <p>if so, whether the push message will be send to my iPhone ????</p> <p>sorry I have no other iPhone to test now. just urgent question, or maybe have other good idea to touch the holder of my iPhone .</p> <p>thanks for you time give me some help on this .</p> <p>Thanks again.</p>
iphone
[8]
1,541,496
1,541,497
jQuery Convert a div's text into vertical
<p>Lets say i got this div</p> <pre><code>&lt;div&gt; Convert This into a vertical Text &lt;/div&gt; </code></pre> <p>While searching for a way in which i can convert this text into a vertical text.</p> <p>I found out something like this :</p> <pre><code>$('div').html($('div').text().replace(/(.)/g,"$1&lt;br /&gt;")); </code></pre> <p>This works.<br /> But is there a better way of doing this ?</p>
jquery
[5]
4,468,077
4,468,078
What does an extra 0 in front of an int value mean?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/44569/octal-number-literals-when-why-ever">Octal number literals: when? why? ever?</a> </p> </blockquote> <p>Hello everyone,</p> <p>Inspiring from a obfuscated piece of code, I have a small question regarding to assign value to an integer:</p> <pre><code>#include &lt;iostream&gt; #include &lt;cstdio&gt; int main() { int i = 0101; std::cout &lt;&lt; i &lt;&lt; "\n"; } </code></pre> <p>And the output was 65, and I have no idea where 65 came from? Any idea?</p> <p>Thanks,<br> Chan</p>
c++
[6]
1,287,173
1,287,174
Search String line-by-line backwards Bottom to Top
<p>I have a file with the following contents. I would like to search string "13030115..." i.e. value before "#". But search should be performed backwards i.e. Bottom to Top. How can I do this in PHP ?</p> <pre><code>1303011581#user: textMsg 1303011582#user: textMsg 1303011583#user: textMsg 1303011584#user: textMsg 1303011585#user: textMsg 1303011586#user: textMsg </code></pre>
php
[2]
3,470,698
3,470,699
Eclipse support for previous APIs
<p>I have formatted my system and have installed "Eclipse - Juno". I have done all the Java path settings and SDK settings as well. But the eclipse shows the minimum target API level is 17 and Android version is 4.2. How do i get it to support API levels from 8 ?</p> <p>How do i get the previous level SDKs? Can i use the SDK Manager to install them?</p>
android
[4]
3,275,605
3,275,606
Duplicate functionality of Android's built-in SMS app (image in-line with text)
<p>I'd like to make an app that duplicates the functionality of Android's SMS app. Specifically, I need it to do this:</p> <ol> <li>Have an EditText box that the user can key in text to.</li> <li>Display an option image in said box.</li> <li>Be able to interact with image, including selecting it to view/delete and backspacing to delete image.</li> </ol> <p>I know how to embed an image into an EditText using both the setCompoundDrawables and using SpannableString. The problem is that neither of them allow me to interact with the image, other than deleting it --- but even this is odd, because text I type ends up being "eaten" by the 60x60 dp image unless I first hit the enter key to line feed.</p> <p>Is there a more proper way to do this?</p>
android
[4]
1,981,464
1,981,465
In Python, is there a good "magic method" to represent object similarity?
<p>I want instances of my custom class to be able to compare themselves to one another for similarity. This is different than the <code>__cmp__</code> method, which is used for determining the sorting order of objects.</p> <p>Is there an magic method that makes sense for this? Is there any standard syntax for doing this?</p> <p>How I imagine this could look:</p> <pre><code>&gt;&gt;&gt; x = CustomClass("abc") &gt;&gt;&gt; y = CustomClass("abd") &gt;&gt;&gt; z = CustomClass("xyz") &gt;&gt;&gt; x.__&lt;???&gt;__(y) 0.75 &gt;&gt;&gt; x &lt;?&gt; y 0.75 &gt;&gt;&gt; x.__&lt;???&gt;__(z) 0.0 &gt;&gt;&gt; x &lt;?&gt; z 0.0 </code></pre> <p>Where <code>&lt;???&gt;</code> is the magic method name and <code>&lt;?&gt;</code> is the operator.</p>
python
[7]
2,768,290
2,768,291
comma syntax javascript
<p>Can someone help me understand what the next line means? What is - </p> <pre><code>elem,.style.height = ( pos /100) * h + "px"; </code></pre> <p>There's a comma right after elem.</p> <pre><code>function slideDown( elem ){ // elem.style.height = '0px'; show(elem); var h = fullHeight(elem); for (var i = 0 ; i &lt;= 100; i+= 5){ (function(){ var pos = i; setTimeout(function(){ elem,.style.height = ( pos /100) * h + "px"; }, (pos + 1) * 10 ); })(); } } </code></pre>
javascript
[3]
5,473,566
5,473,567
firewall problem in android
<p>Hi Friends<br> reason of <strong>Kerio WinRoute firewall</strong> install in server i cant start internet in android. i want to develop one application in which i get data from internet. my problem is connection with internet. when i run project this kind of error accure. <code>06-29 10:37:28.207: WARN/System.err(384): java.io.FileNotFoundException: /mnt/sdcard/top-30-android-games.jpg</code> (<strong>Permission denied</strong>) in this project, retrieve file from website,all code are working good but i think this is problem of internet access. <br> can anyone help me </p>
android
[4]
60,424
60,425
Get size of input in console
<p>How would you get the size input string to console or size of valid characters in buffer?</p> <pre><code>char buffer[100]; cin &gt;&gt; buffer; </code></pre> <p>I'm looking to put the '\0' where the input ends.</p>
c++
[6]
2,899,167
2,899,168
How to deactivate the touchscreen of android device?
<p>Hi i want to deactivate the touch screen of my android device for some application. Anyone plz help me.......</p> <p>Thanx in adv</p>
android
[4]
5,009,362
5,009,363
Register PhoneListener in android
<p>How do I register PhoneStateListener with the TelephonyManager via <code>listen()</code> in android programmatically?</p>
android
[4]
1,724,588
1,724,589
Marque Scrolling text in UILabel
<p>I want to set the text in Scroll label at center, can any one help me regarding this</p>
iphone
[8]
1,467,889
1,467,890
Beaglebone Android Speaker issues
<p>I recently created an app that is basically a midi controller. You press a button and it outputs a sound. The app works fine on eclipse and works perfectly fine. We flashed jellybean onto a Beaglebone LCD3 cape touchscreen and downloaded the app onto the beaglebone. It loads and you can click the buttons but no sound is outputted. Even if I connect a speaker, nothing is outputting. Thank you in advance for your time.</p> <pre><code>final MediaPlayer ButtonSound1 = MediaPlayer.create(MainActivity.this, R.raw.button_sound); final MediaPlayer ButtonSound2 = MediaPlayer.create(MainActivity.this, R.raw.airplane); final MediaPlayer ButtonSound3 = MediaPlayer.create(MainActivity.this, R.raw.chainsaw); final MediaPlayer ButtonSound4 = MediaPlayer.create(MainActivity.this, R.raw.midnight); final MediaPlayer ButtonSound5 = MediaPlayer.create(MainActivity.this, R.raw.jungle); final MediaPlayer ButtonSound6 = MediaPlayer.create(MainActivity.this, R.raw.river); final MediaPlayer ButtonSound7 = MediaPlayer.create(MainActivity.this, R.raw.jingle_bell); final MediaPlayer ButtonSound8 = MediaPlayer.create(MainActivity.this, R.raw.crunch); final MediaPlayer ButtonSound9 = MediaPlayer.create(MainActivity.this, R.raw.bomb); derp = (Button) findViewById(R.id.button1); derp2= (Button) findViewById(R.id.button2); derp3= (Button) findViewById(R.id.button3); derp4= (Button) findViewById(R.id.button4); derp5= (Button) findViewById(R.id.button5); derp6= (Button) findViewById(R.id.button6); derp7= (Button) findViewById(R.id.button7); derp8= (Button) findViewById(R.id.button8); derp9= (Button) findViewById(R.id.button9); derp.setOnClickListener (new View.OnClickListener() { @Override public void onClick(View v) { ButtonSound1.start(); } }); </code></pre>
android
[4]
3,077,924
3,077,925
Dataset Select Statement? In Asp.net
<p>In web application, I fetch the data from back end and the data is now availbale in dataset. I have 5 columns in that dataset, but i need only one column, so how can i get only one column out of 5 columns. I use dataview but it is not getting.</p> <pre><code> DataView dv = ds.Tables[0].DefaultView; dv.RowFilter= "empid"; </code></pre> <p>but i am not getting. can you helpme</p>
asp.net
[9]
3,221,980
3,221,981
Do we ever need to use Iterators on ArrayList?
<p>Yesterday, when I was answering to question <a href="http://stackoverflow.com/q/15822810/2236253">getting ConcurrentModificationException error while using iterator and remove</a> I added a notice that</p> <blockquote> <p>It's not a good idea to use iterators when you have ArrayLists.</p> </blockquote> <p>You do not need to deeply understand that question to answer on that one.</p> <p>There, I got two comments that I'm wrong.</p> <p>My arguments:</p> <ol> <li><p>The code is much less readable with iterators.</p></li> <li><p>There is a possibility to raise ConcurrentModificationException that is hard to debug.</p></li> </ol> <p>Can you please explain?</p> <p>Question: Do we ever need to use Iterators on ArrayList?</p> <p><strong>UPD</strong></p> <p>This is about explicitly using Iterator.</p>
java
[1]
5,966,172
5,966,173
converting a simple list to a dictionary (in python)
<p>I'm learning python. I have a list of simple entries and I want to convert it in a dictionary where the first element of list is the key of the second element, the third is the key of the fourth, and so on. How can I do it?</p> <pre><code>list = ['first_key', 'first_value', 'second_key', 'second_value'] </code></pre> <p>Thanks in advance!</p>
python
[7]
242,557
242,558
jQuery DataTable - delete cookies
<p>I have code:</p> <pre><code>function DataTable() { $('#displayData').dataTable( { "bProcessing": true, "bServerSide": true, "bStateSave": true, "bSort": false, "bFilter": false, "aoColumns": [ { "mDataProp": "name" } ], "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) { oSettings.jqXHR = req.query('GET', url, aoData, function(responseServer, status, xhr) { json = responseServer.dataListCustomer; fnCallback( json ); //HERE }, function(jqXHR, textStatus, errorThrown) { return showError(exception); }); } } ); } </code></pre> <p>Where is HERE I want delete cookies which dataTable saved, how can I do that?</p>
jquery
[5]
3,970,408
3,970,409
How to select text by tag name in element?
<p>I need to select title which is in <code>div</code> wrapped by <code>h2</code>, so i do something like this <code>this.getElementsByTagName('h2')</code> where this is current div in which is h2 - it returns current <code>h2</code> element, but when i trying to get <code>innerHTML</code> or <code>innerText</code> it return null. What am I doing wrong?</p>
javascript
[3]
5,201,393
5,201,394
Create User using Membership.CreateUser
<p>I used the following to create new users using SqlMembershipProvider. While trying to create new users using CreateUserWizard, it throws exception 'The username is already in use' even though there is no any user exists and also new row is creating successfully with this username and password in my table.</p> <pre><code>MembershipUser newUser = Membership.CreateUser(createWizard.UserName, createWizard.Password); </code></pre> <p>If i hard code the value of username and password no exception occurs. </p> <p>Can any one tell me the reason why it throws the exception when using CreateWizard?</p>
asp.net
[9]
4,019,594
4,019,595
Can someone please help me find the regex if an input string is a valid xml string?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/86292/how-to-check-for-valid-xml-in-string-input-before-calling-loadxml">How to check for valid xml in string input before calling .LoadXml()</a> </p> </blockquote> <p>In a program I am implementing, user can input a string. I have to identify that if it is a valid xml then I have to treat it differently. Is there a regex that can find if a given string is a valid xml?</p>
c#
[0]
1,820,088
1,820,089
shoutcast client on android
<p>I am trying to implement a shoutcast client on android, but simply parsing a .pls and supplying the stream link to the android mediaplayer does not work. Can anyone please suggest a way I can go about this? If I have to implement something like a proxy server and buffer the stream data manually, can someone please describe what needs to be done? Thanks, vamsi</p>
android
[4]
3,624,576
3,624,577
C++ does std::string::erase reallocate and...?
<p>First question, does <code>std::string::erase</code> reallocate?</p> <p>Second question, are there any faster method to quickly erase certain words or phrase from a <code>std::string</code>? The length of the string is usually around 300K.</p>
c++
[6]
1,704,346
1,704,347
Is this javascript encoding properly written?
<p>I have tried some tips I was given on regards URL encoding but I have no success so far. First, I was given this format, </p> <pre><code>var url = "http://www.polyvore.com/cgi/add?title=" + encodeURIComponent(%%GLOBAL_ProductName%%) + "&amp;url=" + encodeURIComponent("http://lilaboutique.co.uk/products/" + encodeURIComponent(%%GLOBAL_ProductName%%) + "&amp;imgurl=" + encodeURIComponent(%%GLOBAL_ThumbImageURL%%) + "&amp;desc=" + encodeURIComponent(%%GLOBAL_ProductDesc%%) + "&amp;price=" + encodeURIComponent(%%GLOBAL_ProductPrice%%)); </code></pre> <p>which never got to be passed to the href dunno for what reason. Then I played with it some more, </p> <pre><code>var url = "http://www.polyvore.com/cgi/add?title=encodeURIComponent(%%GLOBAL_ProductName%%)&amp;url=http://lilaboutique.co.uk/products/encodeURIComponent(%%GLOBAL_ProductName%%)&amp;imgurl=encodeURIComponent(%%GLOBAL_ThumbImageURL%%)&amp;desc=encodeURIComponent(%%GLOBAL_ProductDesc%%)&amp;price=encodeURIComponent(%%GLOBAL_ProductPrice%%)"; </code></pre> <p>this time the url was passed but the values were mixed between the appropriate and other fields displaying the encoding function itself. </p> <p>Any help clarifying my mistakes is greatly appreciated. I would like to encode just price and description, seems to be the fields giving problems. </p> <p>A regular link does render without problems</p> <pre><code>var url = "www.google.com"; var myAnchor = document.getElementById('myAnchor'); myAnchor.href = url; </code></pre> <p>Thanks for any help</p>
javascript
[3]
2,389,676
2,389,677
jquery How to select the 1st cell of each table row
<p>I have a table like this:</p> <pre><code>&lt;table id="myTable"&gt; &lt;tr&gt;&lt;td&gt;1sta&lt;/td&gt;&lt;td&gt;2nd&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1stb&lt;/td&gt;&lt;td&gt;2nd&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1stc&lt;/td&gt;&lt;td&gt;2nd&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1std&lt;/td&gt;&lt;td&gt;2nd&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; </code></pre> <p>Using jQuery How do I select the 1st <code>&lt;td&gt;</code> element in each row of "myTable"?</p>
jquery
[5]
2,224,305
2,224,306
Radio buttons in python 3 and tkinter
<p>I have made a program in Python 3 and Tkinter, which is using radio buttons. Now, how can I make that some of the radio buttons are already checked?</p>
python
[7]
5,460,569
5,460,570
Problem with rotation
<p>Hey guys im having a bit of a problem with my iPhone app where i have told my viewcontrollers to disallow rotation (via shouldAutorotateToInterfaceOrientation:) and that works. However for some reason now my statusbar ontop of the window does animate.</p> <p>The whole application is placed in a UINavigationViewController maybe thats usefull as extra information, so how do i solve this ?.</p>
iphone
[8]
2,754,900
2,754,901
Programmatically open a text file in a web browser
<p>I am using C# and I wanna know how to programmatically open a txt file, but not in notepad which you can do by</p> <pre><code> System.Diagnostics.Process.Start(@"C:\\textfile.txt"); </code></pre> <p>I want to open up a text file, except in a browser. How can this be achieved?</p>
c#
[0]
647,831
647,832
iPhone app submission process
<p>I heard that iPhone apps must also run on iPad without modifications, at iPhone resolution , and at 2X iPhone 3GS resolution to submit the app to App store. Is that information correction. Do I need to support for iPad(with 2X of iPhone)?</p> <p>On What things app store mainly concentrate when we submit the application?</p> <p>Thanks in advance.</p> <p>Regards, Malleswar </p>
iphone
[8]
2,653,069
2,653,070
Server side validation
<p>I am having an issue with the requiredfieldvalidator control not working on an ASP.net page. I have completed the attributes of that field properly, but when I test it, the postback is allowed to happen even if the field in question is blank. </p> <p>So I want to do server side validation instead. What is the best way to do that? In the event that caused the postback? Also, if I find out the field is blank, how do I get the user back to the screen with all other values they placed on other fields intact and a message saying "This field cannot be blank".</p> <p>EDIT:</p> <p>This is the code:</p> <pre><code>&lt;asp:TextBox ID="fName" TabIndex="1" runat="server" Width="221px" CausesValidation="True"&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID="FNameRequiredFieldValidator" runat="server" ControlToValidate="fName" InitialValue="" ErrorMessage="Filter Name cannot be blank." ToolTip="Filter Name cannot be blank."&gt;*&lt;/asp:RequiredFieldValidator&gt; </code></pre>
asp.net
[9]
1,638,319
1,638,320
How to convert char* to std::vector?
<p>I have a char* variable:</p> <pre><code>// char* buffer; // ... fread (buffer, 1, lSize, pFile); // ... </code></pre> <p>How can I convert it to std::vector? Casting will get me an error.</p>
c++
[6]
1,618,924
1,618,925
Elapsed time since function last call
<p>I am trying to write a method that will return the amount of time that has passed since the method was last called, it looks like this:</p> <pre><code>package JGame.Util; import java.util.Date; public class Util{ protected static Long lastTime = null; public static long getLastTime(){ long time = new Date().getTime(); if(Util.lastTime == null){ Util.lastTime = time; return 0; } long ftime = time - Util.lastTime; Util.lastTime = time; return ftime; } } </code></pre> <p>I am then calling the method like this, within a key press event:</p> <pre><code>long lastTime = Util.getLastTime(); if(lastTime &gt; 1000){ return; } System.out.println(lastTime); </code></pre> <p>The problem I am having, is that when the key is pressed down it prints out <code>lastTime</code>, but it should only be printed out once every second.</p> <p>here is the output:</p> <pre><code>122 6 7 13 9 7 10 9 10 </code></pre> <p>While holding down the key, I was expecting all to be very close to 1 second intervals. but the numbers are not even close.</p>
java
[1]
5,903,433
5,903,434
reading CSV through JAVA
<p>Can anyone tell whats the best way of reading a CSV file. The file I am trying to read is nearly 23 MB so it's a taking a lot of time to read the lines through buffered reader:</p> <pre><code>BufferedReader CSVFile = new BufferedReader(new FileReader("HostSystems.csv")); String dataRow = CSVFile.readLine(); while (dataRow != null){ String[] dataArray = dataRow.split(","); for (String item:dataArray) { System.out.print(item + "\t"); } System.out.println(); // Print the data line. dataRow = CSVFile.readLine(); } </code></pre> <p>Is there another efficient way?</p>
java
[1]
2,241,858
2,241,859
Win Form Tab Control Page header layout
<p>Simple question I hope.... I have a Win Form with a Tab Control and 12 tabs. When I added the eight table (and higher), the scroll bar in the tab header appears and you have to scroll with that control to view the extra tabs. How can you change the layout so that the tabs all show, without the scroll bar? Is it possible to have them appear "stacked" or "Multiline"?</p>
c#
[0]
3,013,398
3,013,399
how to control for loop
<p>this is my code......initially alltextboxes is showing...if i click the next or prev button it works properly....but i want only two textboxes per each click so initialy should show two text box ..........how i get it........how to solve......</p> <p>see for full code:http://jsfiddle.net/sankarss/gAVZ8/22/</p> <pre><code>function starts(values) { maximum=values; var form = document.forms[0]; var container = $("#sankar"); container.empty(); for (var i = 0; i &lt; maximum; i++) container.append('&lt;fieldset style="width: 250px; height: 80px;"&gt;&lt;legend&gt;Files of ' +(i + 1) + ' / ' + maximum + '&lt;/legend&gt;&lt;input type="text" name="name' + i + '" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type="text" name="topic' + i + '" /&gt;&lt;/fieldset&gt;'); goto(form, 0); } </code></pre>
javascript
[3]
5,684,596
5,684,597
Java eclipse can't disabled new menu options
<p>I use eclipse, I have aproblem that when I click on the file -> new menu, all the options are greyed. I am clicking on my current project. But I guess this problem happened after deleting a project from the file system not from the eclipse (possibly not sure). How can I solve the problem ? </p> <p><strong>EDIT:</strong> The message I get: </p> <blockquote> <p>No Applicable items</p> </blockquote>
java
[1]
1,002,779
1,002,780
Javascript testing whether or not a variable is set
<p>Generally, I test whether or not a variable is set with something like this: </p> <pre><code>if (variable !== '') { do something... } </code></pre> <p>I know there are other methods for testing variables like <code>typeof</code> but I don't see any advantage - is this an appropriate way to test whether or not a variable is set? Are there problems with it that I should be aware of ?</p>
javascript
[3]
1,300,082
1,300,083
How can I use setString procedure properly?
<p>I have the following situation...</p> <p>I use CallableStatement from java.sql package. When I use setDate function prior to executing stored procedure, I get an error:</p> <blockquote> <p>Cannot find symbol symbol: method setDate(int, java.util.Date) location: interface java.sql.CallableStatement"</p> </blockquote> <p>Here's the sample code:</p> <pre><code>Connection con = null; CallableStatement proc_stmt = null; Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); con = DriverManager.getConnection("jdbc:sqlserver://servername;databaseName=DBName", "UNAME", "PASS"); proc_stmt = con.prepareCall("{ call InsertSomething(?, ?) }"); proc_stmt.setString(1, "A00999999"); proc_stmt.setDate(2, new Date()); proc_stmt.executeQuery(); proc_stmt.close(); con.close(); </code></pre> <p>I even tried this using Calendar class with appropriate functions, but the effect was the same.</p>
java
[1]
3,939,878
3,939,879
retrieve framestate with jquery
<p>ok so i collect the variable below through javascript.</p> <pre><code>var frameState = $(this).attr('id'); </code></pre> <p>I have radio box that chooses no mats or one mat. When a box is chosen it reloads the page I want to put the variable framestate in the url: Sidenote - the code might not look great here but it all works I just don't know how to append the variable to the url after a radio choice is chosen. </p> <pre><code> &lt;tr&gt; &lt;td&gt; No Mats: &lt;input type="radio" name="mattes-radio" align="middle"&lt;?php if($_GET['mattes'] == 0){ echo 'checked="checked"';} ?&gt; id="mattes-radio-0"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; Single Mat: &lt;input type="radio" name="mattes-radio" &lt;?php if($_GET['mattes'] == 1){ echo 'checked="checked"';} ?&gt; id="mattes-radio-1"&gt; &lt;/td&gt; &lt;/tr&gt; $('#mattes-radio-0').click(function() { window.location = 'index-custom.php?mattes=0'; }); $('#mattes-radio-1').click(function() { window.location = 'index-custom.php?mattes=1'; </code></pre>
jquery
[5]
4,317,272
4,317,273
Voodoo Code In Python
<p>I was going through Zed Shaw's Learn Python The Hard Way and something in Chapter 15 struck me. In the extra credit exercises he asks us to delete the latter part of the code [everything after print txt.read() ] and then execute it, but the interpreter behaves as if nothing has happened. Yes, I saved the file and when I modified it by adding print statements then the changes still showed up, but the same voodoo code was executed. Why?</p> <p>What's going on over here?</p> <pre><code>from sys import argv script, filename = argv txt = open(filename) print "Here's your file %r:" % filename print txt.read() print "I'll also ask you to type it again:" file_again = raw_input("&gt; ") txt_again = open(file_again) print txt_again.read() </code></pre>
python
[7]
3,828,721
3,828,722
issuing things to shell and forgetting about it in php
<p>how do you issue commands to the shell and then forget it's output and such? for example:</p> <pre><code>&lt;?php echo `sleep 2;echo hi`; echo "foo"; ?&gt; </code></pre> <p>the result for this is hifoo. i would want a result that gives me foohi. why? i want the command issued to the shell simply issued and forgotten, i am confused about why PHP will wait for the result. is such a result possible?</p> <p>(the idea behind this is setting up the correct number of selenium grid RC instances programatically. currently, it will stop after the first process is opened)</p>
php
[2]
18,623
18,624
How can I create a pyramid from using php?
<p>I need to create a pyramid using asterisks. I specify a value which becomes the base of the pyramid. The base contains as much asterisks as the value specified and the pyramid must skip its rows by 1..Here I am facing a problem when I specify an even number of base..</p> <p>The pyramid must looke like the one below.</p> <pre><code> * *** ***** ******* ********* ********** </code></pre> <p>I am getting </p> <pre><code>####* ###*** ##***** ###***** ####***** ********** </code></pre> <p>I want to replace the # by some blank space and I am getting the bug that the number of asterisks in the 4th row has decreased.. How do I fix these two bugs ?</p> <pre><code>function create_pyramid($limit){ if ($limit &gt; 0){ for ($row =0;$row&lt;=$limit;$row++){ if (($row % 2 == 0) &amp;&amp; ($row != $limit)){ continue;} $rows = ""; for ($col =0;$col&lt;$row;$col++){ $rows= $rows.'*'; } $pattern = "%'#".((($limit - $row)/2)+$row)."s\n"; printf ($pattern,$rows); print '&lt;br /&gt;'; } } else{ print "Invalid data"; } } create_pyramid(10); </code></pre>
php
[2]
5,334,345
5,334,346
Detect touch on bitmap
<p>Greets, </p> <p>Does anyone how I go about detecting when a user presses on a bitmap which is inside a canvas?</p> <p>Thanks</p>
android
[4]
5,965,452
5,965,453
what is the best Serializable replacement for "Set" and "Collection" interfaces?
<p>I have to serialize Collection and Set interfaces. Which are the best Serializable replacements for those interfaces on Java?</p>
java
[1]
4,888,934
4,888,935
java 1.4 projects compatible with Java 7?
<p>Is the java 1.4 projects compatible with Java 7?</p> <p>any known issue from anybody. In my case, when I use a class which was compiled using 1.4 (javap -verbose, major version:48) with Java6 it works fine. But the same class with Java 7 code resulting in null pointer</p> <p>any ideas appreciated</p> <p>Thanks</p>
java
[1]
5,133,390
5,133,391
how to extract page name from complex URL
<p>let's say we have this:</p> <p><code>http://www.domainname.com/somepage.php?c=innerContent</code></p> <p>How to retrieve with jQuery only the page name: <code>somepage.php</code></p> <p>thx</p>
javascript
[3]
5,684,925
5,684,926
Displaying non-English (specifically Hindi) characters on android device
<p>I am new to android development. I have some hindi text which is not getting displayed on the virtual device. The text is properly displayed in eclipse, and the files are utf-8 encoded.</p> <p>E.g. I have this resource file:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;string name="hello"&gt;Hello World, Jain_aartisActivity!&lt;/string&gt; &lt;string name="app_name"&gt;जैन आरती संग्रेह&lt;/string&gt; &lt;/resources&gt; </code></pre> <p>But the AVD is unable to display the app_name. It just displays a small rectangle for each hindi character.</p> <p>Any help?</p>
android
[4]
518,596
518,597
What does --enable-profiling option do when compiling Python?
<p>I'm buildinng my own Python-2.6 in linux. There's an option in configure for enabling C-level code profiling. I've never used that before; so just out of curiousity, what does that option do? what is it for?</p>
python
[7]
2,838,113
2,838,114
Validation for integer number
<p>I have created one form.In that form,it put one textbox.That text box should take only integer not character or float.So I applied validation like this.Does it right?</p> <pre><code>var a = document.getElementById('textbox1').value; var b = /^\d+$/; If (a.search(b) == -1) { alert(Must be Interger); return false; } </code></pre>
javascript
[3]
5,434,438
5,434,439
.NET - define a new control instance's properties in short way?
<p>In general, if we have to create new control instance, we will do the following:</p> <pre><code>Literal ltl= new Literal(); ltl.ID = "ltlControl1"; ltl.Text = "SomeText"; PlaceHolder.Controls.Add(ltl); </code></pre> <p>But is it possible define the properties like that to shorten the syntax?</p> <pre><code>Literal ltl= new Literal( ID = "ltlControl1", Text = "SomeText"); </code></pre>
c#
[0]
1,268,783
1,268,784
how can i display images using grid
<p>How to display images in a grid in asp.net .These images are stored in a folder in project directory(Images).I want to show these images in grid and show images description from database .Description should show just under the image.please help</p>
asp.net
[9]
4,481,340
4,481,341
UIImageView EXC_BAD_ACCESS
<p>---- MyEventSelectorCell.h</p> <pre><code>@interface MyEventSelectorCell : UITableViewCell { IBOutlet UIImageView* eventImage; } @property(nonatomic, retain) IBOutlet UIImageView* anImage; </code></pre> <p>----- MyEventSelectorCell.m</p> <pre><code>-(id) dealloc { [anImage release];// &lt; -- If I comment this out, It starts leaking, but program runs fine... } </code></pre> <p>---- MyTableViewController.h</p> <pre><code>@MyTableViewController: UIViewController&lt;UITableViewDelegate&gt; { IBOutlet MyEventSelectorCell* tmpCell; } @property(nonatomic, retain) IBOutlet MyEventSelectorCell* tmpCell; </code></pre> <p>---- MyTableViewController.m</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ... [[NSBundle mainBundle] loadNibNamed:@"MyEventSelectorCell" owner:self options:nil]; tmpCell.anImage.image = [UIImage imageNamed: @"someimage.png"]; ... } </code></pre> <p>EXC_BAD_ACCESS happens after I release anImage when setting the UIImageView .image property to imageNamed above...</p>
iphone
[8]
5,924,495
5,924,496
Is it possible to change values in windows service - in ini file or xml?
<p>I have Windows service, that have Timer.</p> <p>I want the option to change the Timer speed value.</p> <p>how I can do it ? with ini file ? or xml file ?</p> <p>Is it possible ? if yes, can I get sample code ?</p> <p>thank's in advance</p>
c#
[0]
1,562,744
1,562,745
jQuery Optimize link "href" selection
<p>I'm changing the class of "a" tag according to "href" file type. It works fine. Here's the code:</p> <pre><code> $('#divComment a[href$=".pdf"]').removeClass().addClass("pdf"); $('#divComment a[href$=".doc"]').removeClass().addClass("word"); $('#divComment a[href$=".docx"]').removeClass().addClass("word"); $('#divComment a[href$=".zip"]').removeClass().addClass("zip"); $('#divComment a[href$=".jpg"]').removeClass().addClass("image"); $('#divComment a[href$=".xls"]').removeClass().addClass("excel"); $('#divComment a[href$=".xlsx"]').removeClass().addClass("excel"); </code></pre> <p>How do I optimize this code?</p>
jquery
[5]
4,340,423
4,340,424
Cloning: what's the fastest alternative to JSON.parse(JSON.stringify(x))?
<p>What's the fastest alternative to </p> <pre><code>JSON.parse(JSON.stringify(x)) </code></pre> <p>There must be a nicer/built-in way to perform a deep clone on objects/arrays, but I haven't found it yet.</p> <p>Any ideas?</p>
javascript
[3]
3,936,756
3,936,757
Check where request came from
<p>on the site when an image is required the link is like this</p> <pre><code>&lt;img src="getimage.php?id=&lt;?php echo $name ?&gt;" " width="280px" height="70px"&gt; </code></pre> <p>Then on getimage.php it gets the id and from that finds the right picture and displays it.</p> <pre><code>$id = $_GET['id']; </code></pre> <p>This works perfectly. How would I find out where the request came from. So on which page this line below was on </p> <pre><code>&lt;img src="getimage.php?id=&lt;?php echo $name ?&gt;" "width="280px" height="70px"&gt; </code></pre> <p>So ultimately I can know if the image requested is for index.php or about.php etc</p> <p>Thanks</p>
php
[2]
474,155
474,156
Should I separate my javascript code files based on line count?
<p>I custom coded a dynamic database linked (through asp.net) photo gallery in javascript which manages about 300 images. There is no redundant code, but it is about 500 lines long. Should I be splitting it into different .js files, or is the one .js file with 500 lines okay? Is there a best practice for ensuring that javascript files stay under a certain amount of lines of code?</p>
javascript
[3]
1,481,836
1,481,837
How can I download files from my Android app?
<p>I have an app, which needs to download some files from server and use them. </p> <ol> <li>How can I download them? Techniques and samples are welcome.</li> <li>Where can I store these files, so that my app might use them in the future?</li> </ol>
android
[4]
5,236,091
5,236,092
when we use JavaScriptSerializer deserializer?
<p>can u explain this with example.</p>
c#
[0]
1,050,117
1,050,118
Why wouldn't Android applications compile from source?
<p>I am trying to compile the default projects that come with Android; however, it doesn't seem to be working at all. Most of the classes and libs seem to be missing.</p>
android
[4]
2,298,835
2,298,836
How to dynamically create dictionaries whose name are taken from the contents of a directory in python?
<p>I have a directories with filenames. I want for each of the files to create a dictionary.I do this:</p> <pre><code>files=glob.glob(*) for f in files: f={} </code></pre> <p>but i don't get the result that i want. I.e: in my directory i have aaa bbb ccc. After the execution of my program i want to have 3 dictionaries. The first aaa={} t second one bbb={} and the 3rd one ccc={}.</p>
python
[7]
2,918,683
2,918,684
loop trough list of elements and update hidden field seperated by vertical line and comma
<p>Dear wise mans. Here is the problem</p> <p>I can have a unlimited set of list items and form fields (limited) in li:</p> <pre><code> &lt;li id="apr1"&gt; &lt;textarea class="thisistext"&gt;blablabla&lt;/textarea&gt; &lt;input class="imgid" type="hidden" value="450"&gt; &lt;input class="order" type="hidden" value="1"&gt; &lt;/li&gt; &lt;li id="apr2"&gt; &lt;textarea class="thisistext"&gt;bimbimbim&lt;/textarea&gt; &lt;input class="imgid" type="hidden" value="455"&gt; &lt;input class="order" type="hidden" value="2"&gt; &lt;/li&gt; etc </code></pre> <p>What I want is, write the contents of of all field in hidden field for update to database: The format should be values from field seperated by comma and groups seperated by vertical line | </p> <p>"imgid,order,thisistext|imgid,order,thisistext|etc... "</p> <pre><code>&lt;input id="thedatafield" value="450,1,blablabla|455,2,bimbimbim| etc..."&gt; </code></pre> <p>How would you accomplish this? Probalby, the .serialize() would help, but the important part is textarea, which can be in pure html format.</p>
jquery
[5]
4,889,355
4,889,356
redirect to unique page
<p>when I log in...i want to it to find my new $_SESSION variable and then reload into that page with all the selected data. But instead of <a href="http://www.theqlick.com/findFriends/lesson.php?username=noahtheteacher" rel="nofollow">http://www.theqlick.com/findFriends/lesson.php?username=noahtheteacher</a></p> <p>I get this instead: <a href="http://theqlick.com/findFriends/lesson.php?username=%3C?%20echo%20noahtheteacher;%20?%3E" rel="nofollow">http://theqlick.com/findFriends/lesson.php?username=%3C?%20echo%20noahtheteacher;%20?%3E</a></p> <p>Why is that? It isn't loading the correct page either...my code is below</p> <p>The top of the page:</p> <pre><code> $new_user = $_SESSION['user_login']; if (!isset($_SESSION["user_login"])) { echo ""; } else { echo "&lt;meta http-equiv=\"refresh\" content=\"0; url=lesson.php?username=&lt;? echo $new_user; ?&gt;\"&gt;"; } </code></pre> <p>The login actual html code:</p> <pre><code> &lt;h2&gt;If your a teacher, login below ...&lt;/h2&gt; &lt;form action="lessons_login.php" method="post" name="form1" id="form1"&gt; &lt;input type="text" size="40" name="user_login" id="user_login" class="auto-clear" title="Username ..." /&gt;&lt;p /&gt; &lt;input type="text" size="40" name="password_login" id="password_login" value="Password ..." /&gt;&lt;p /&gt; &lt;input type="submit" name="button" id="button" value="Login to your account"&gt; &lt;/form&gt; &lt;/div&gt; </code></pre>
php
[2]
1,589,864
1,589,865
keep my android app minimized once app is opened once forever
<p>I am developing an android app which i wanted to remain minimised once the app is opened by the user one time until the device reboots. I read that android home button by default minimises the app but it seems my app gets closed once i clicked home button. if i open my app again,it is showing from login page. i wanted it to open the page which the user is last viewing. </p> <p>android minimum and target version is 3 and 15 respectively. can anyone let me know how it can be done to serve the mentioned purpose?</p> <p>Thanks in advance dudes!</p>
android
[4]
748,802
748,803
What is Activator.CreateInstance?
<p>What is Activator.CreateInstance? How can I use it? Can I have an example please?</p>
c#
[0]
5,595,749
5,595,750
NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil
<p>I have a 4465 characters String which contains Url links along with some junk.Here the problem is i am not able to separate all the URL links By using the following code from Junk :</p> <p>NSDataDetector *linkDetector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil]; NSArray *matches = [linkDetector matchesInString:string options:0 range:NSMakeRange(0, [string length])];</p> <p>I received final urlString with 83 characters,But it is not the full URL string.</p> <p>Actual Characters in URL String is 117. Please suggest me is there any alternative way than this to separate URLs from Junk.</p>
iphone
[8]