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
2,468,738
2,468,739
Jquery returns NaN,any idea?
<p>HTML code: </p> <pre><code>&lt;form id="hostadd" action="addmoney.php?taskid=12" method="post" onSubmit="return false"&gt; &lt;input type="hidden" name="mode" value="" /&gt; current unit price:$ &lt;input id="unitprice" name="unitprice" type="text" size="5" maxlength="6" value= 0.50 /&gt;&amp;nbsp Shortfall:&lt;...
jquery
[5]
3,924,620
3,924,621
Strings between quotation marks in C++
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7459939/what-do-single-quotes-do-in-c-when-used-on-multiple-characters">What do single quotes do in C++ when used on multiple characters?</a> </p> </blockquote> <p>The following code compiles in C++:</p> <pre><...
c++
[6]
1,502,173
1,502,174
Right Justifying output stream in C++
<p>I'm working in C++. I'm given a 10 digit string (char array) that may or may not have 3 dashes in it (making it up to 13 characters). Is there a built in way with the stream to right justify it?</p> <p>How would I go about printing to the stream right justified? Is there a built in function/way to do this, or do...
c++
[6]
1,822,103
1,822,104
Reading label Id
<p>I'm having a table in which i'm creating a label dynamically.</p> <pre><code>'&lt;td&gt;' + '&lt;label for="Name" id = ' + value + '&gt;' + text + '&lt;/label&gt;&lt;/td&gt;' </code></pre> <p>I want to retrieve the id of the label and I`m doing the following which is not working: How can I get the Id of the label?...
jquery
[5]
5,689,927
5,689,928
Can't clear a .log file, "permission denied"
<p>I have a little problem. I have a skype resolver but my Debug file does get bigger and bigger.</p> <p>How can i clear this? I have this with PHP:</p> <pre><code> &lt;?php $fp = fopen("skype/debug-20130331-0951.log",'w+'); if(!$fp) echo 'not Open'; while(!feof($fp)) { fputs($fp,' ',999); ...
php
[2]
2,071,910
2,071,911
jQuery .html() does not work with hidden divs?
<p>function <code>.html()</code> works when the item is displayed. but when I add <code>style="display:none"</code>, then html() function returns nothing. Is there workaround of this problem? thanks?</p>
jquery
[5]
2,818,105
2,818,106
findViewById not working for an include?
<p>I have an include like:</p> <pre><code>&lt;include android:id="@+id/placeHolder" layout="@layout/test" /&gt; </code></pre> <p>The include layout looks like (test.xml):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/androi...
android
[4]
5,727,584
5,727,585
Better Way to Code Hidden Div Toggle in JQuery?
<p>I've finally found a way to get this to work but the code it a bit long winded and I'm sure there is a better way of doing it. This is does what I want but I want to extend this to work on 10 or so divs and the code would be ridiculous if I used this method. I've tried playing around with the .each() method but it j...
jquery
[5]
5,899,277
5,899,278
C++ -- which constructor of string is call when we use string(0)?
<p>Given the following code,</p> <pre><code>class A { public: A() : str(0) {} private: string str; }; </code></pre> <p>Based on this <a href="http://www.cplusplus.com/reference/string/string/string/" rel="nofollow">http://www.cplusplus.com/reference/string/string/string/</a></p> <pre><code>string ( ); string ( c...
c++
[6]
1,005,608
1,005,609
Weird JavaScript Code
<pre><code>for (var i=a.length-1;i&gt;0;i--) { if (i!=a.indexOf(a.charAt(i))) { a=a.substring(0,i)+a.substring(i+1); } } </code></pre> <p>I found this in a web app I'm auditing, it just baffles me why it's there. I can't seem to see a case where <code>i!=a.indexOf(a.charAt(i))</code> would be false.</p...
javascript
[3]
2,073,417
2,073,418
Android custom SharedPreferences implementation to persist to database?
<p>I am attempting to use a custom implementation of the <code>SharedPreferences</code> interface to persist an application's preferences to a database (instead of the default XML). </p> <p>Why? I'd like to use the convenience of <code>PreferenceActivity</code> to construct the UI but this app will be used on multiple...
android
[4]
4,687,338
4,687,339
Javascript returning strange value
<p>I was testing a function out to see what happens when it's parameters are <code>null</code> and decided to put an else statement with it. To my surprise, it did not log the parameters that I have passed, it's logging something else entirely. Maybe someone can shed some light on this, here's the code:</p> <pre><co...
javascript
[3]
5,068,582
5,068,583
php display image
<p>I am not able to display image using this code. Could any one help me in correcting?</p> <pre><code>&lt;?php include("connect.php"); $sql="select * from profile where userid=3"; $row=mysql_query($sql); header("Content-type: image/jpeg"); echo $row['image']; ?&gt; </code></pre>
php
[2]
5,736,769
5,736,770
How can I differentiate an android Activity from a SubActivity programatically?
<p>How can I differentiate an android Activity from a SubActivity programatically? Is there any api for that?</p>
android
[4]
2,112,555
2,112,556
How do I get my generic class to require its parameters to extend/implement multiple classes?
<p>I'm looking for the correct syntax for the following:</p> <pre><code>public class Foobar&lt;K extends SomeJavaAPIClass and implements Cloneable&gt;{ </code></pre> <p>So that I can have Foobars of 'K', where K is a generic subclass of SomeJavaAPIClass and where K has it's own clone() method </p> <p>I've tried <cod...
java
[1]
1,494,595
1,494,596
Why cannot parse a DateTime?
<p>I'm trying to parse a DateTime which I read from a file, the format of the date is:</p> <p><code>19/10/2005 12:00:00 a.m.</code></p> <p>and the code I'm using is:</p> <pre><code>string Fecha = dbRow["FECHA"].ToString().Trim(); DateTime fechamov; if (!DateTime.TryParseExact(Fecha, "dd/MM/yyyy HH:mm:ss tt", Culture...
c#
[0]
2,314,092
2,314,093
Error while adding minutes to a js date object?
<pre><code>var d=ed; d.setMinutes(d.getMinutes() + 30); </code></pre> <p><code>ed</code> has my date,but this is giving me error like </p> <pre><code>Object doesn't support this property or method </code></pre> <p>wat might be the problem???</p>
javascript
[3]
5,386,520
5,386,521
Looking for stats on popularity of JavaScript libraries
<p>Does anyone know if there's a site that tracks the popularity of the big/various JavaScript libraries?</p>
javascript
[3]
1,702,998
1,702,999
Returning a memory locations of a five element array
<p>I was having issue when returning five strings of data from an array to a output .dat file. Just curious why would this happen am I referencing something somewhere wrong? I was using fstream to return the data to the .dat file and I can see the correct data passed(in the dropdown) when I use breakpoints. I had th...
c++
[6]
4,959,511
4,959,512
python and assigning variable values in if statements
<p>I'm somewhat of a beginner in python and I swear I got a very similar program to what I'm doing right now to work. But, for some reason, I can't make it work. I was able to pinpoint my problem and created a fake program to play around with it. Here is what the program:</p> <pre><code>global heading global heading2 ...
python
[7]
2,943,884
2,943,885
omit object type in the signature of an abstract method
<p>I have a Model abstract class and i want to have an abstract method to set the id of the model instances. I'd like for the implementation to define what object they would like to use for the id object though. In the following example the getId() works fine but i can't override the setId() method because the signatur...
java
[1]
1,481,109
1,481,110
Online php script runner
<p>I want to develop an online PHP script runner. I don't know how get started with it. Any basic ideas will be appreciated. Thanks.</p>
php
[2]
5,994,922
5,994,923
Creating a function in JS
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname">Javascript: var functionName = function() {} vs function functionName() {}</a> </p> </blockquote> <p>I am curious to which is best pratice wh...
javascript
[3]
4,733,715
4,733,716
populate collection with each()
<p>I am trying to populate a collection using an each. I can get the element in one string, and I can get an alert to fire on each iteration. I just cant put the two together.</p> <p>Here is my list:</p> <p>4/27/2011 5:42:54 PM<br> 4/27/2011 5:43:00 PM<br> 4/27/2011 5:46:53 PM<br> 4/28/2011 2:10:40 PM </p> <p>Her...
jquery
[5]
2,337,239
2,337,240
.sln file contains information in xml or in code (like vb)?
<p>I am reading <strong>Developing Web Applications with .net frame work 4.0</strong> book (70-515). In that I found one sentence that at page number 21 <strong>A solution file is an XML file that contains information...</strong> After I read this sentence I opened the .sln file in note pad. But strangely I didn't find...
asp.net
[9]
836,728
836,729
Can i change the Font size and Font Type of NavigationItem's Title?
<p>i have used This code: self.navigationItem.title=@"My Name is ABC"; i want to change the font size as well as font Type's also so how can i change both with this code?</p>
iphone
[8]
4,359,783
4,359,784
non-static variable cannot this be referenced from a static context error
<pre><code>public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter expression: "); String exp = input.nextLine().trim(); ExpressionTree exptree = new ExpressionTree1(); //new instance of ExpressionTree TreeNode root = new TreeNode(); root = exptree.parseOutsideExpres...
java
[1]
1,866,457
1,866,458
Is it possible to combine the functions easier?
<p>I need to combine some functions (modify 1st function), but I can't do it this way (it works, but is bad for me):</p> <pre><code>var a = function(){alert('a');}; var b = function(){alert('b');}; var c = a; a = function(){c(); b();}; a(); </code></pre> <p>Then I try to do this:</p> <pre><code>var a = function(){al...
javascript
[3]
1,326,672
1,326,673
PHP: direct call another PHP web applications without going through the usual HTTP call
<p>I have two PHP web applications. All of the apps are located on the same computer. Each application will run independently.</p> <p>Now, can I do a direct API call from one PHP app to another? I don't want to go through either the webservice, or the usual HTTP call that involves HTML response. I want to call app A f...
php
[2]
4,605,470
4,605,471
Three20 framework in iphone sdk
<p>I want to know how to use the three20 frame work in my project,i want to create a image gallery for my app.Please give a correct method of adding three20 to my project.</p>
iphone
[8]
3,428,058
3,428,059
Fetching data from another website with php
<p>I need to fetch data from this web page <a href="http://www.cba.am/en/sitepages/default.aspx" rel="nofollow">central bank of armenia</a></p> <p>In my html form user must insert the price of his supply. He/she selects the currency (USD, EUR or AMD) and types its value. After that I need to convert inserted price to...
php
[2]
1,820,814
1,820,815
How to reference 2 ArrayAdapters separately
<p>I've been working on understanding ArrayAdapters for the past 2 days, but can't seem to get them down entirely.</p> <p>The following code is functional as is.</p> <pre><code> private void initAdapter(ArrayList&lt;String&gt; aL) { for (String s : aL) { aL.add(s); } setListAdapter(new Array...
android
[4]
147,420
147,421
Get parent directory of parent directory
<p>I have a string relating to a location on a network and I need to get the directory that is 2 up from this location.</p> <p>The string could be in the format:</p> <pre><code>string networkDir = "\\\\networkLocation\\staff\\users\\username"; </code></pre> <p>In which case I would need the <code>staff</code> folder...
c#
[0]
1,586,026
1,586,027
How can I pass parameters to a module pattern to override default values [private properties] in JavaScript?
<p>I was reading this article <a href="http://www.klauskomenda.com/code/javascript-programming-patterns/#revealing" rel="nofollow">http://www.klauskomenda.com/code/javascript-programming-patterns/#revealing</a> and was wondering if I can pass parameters to override the private properties.</p> <pre><code>// revealing m...
javascript
[3]
1,086,948
1,086,949
assign block of html with variable to another variable
<p>What i need is :</p> <pre><code>$myVar = '&lt;a class="thumbnail" href="$url"&gt;$text&lt;span&gt;&lt;img src="$url" /&gt;&lt;br /&gt;$text&lt;/span&gt;&lt;/a&gt;'; </code></pre> <p>This code does not work certainly. It does not return an error because I put single quote ''</p> <p>BUT the <code>$url</code> and <c...
php
[2]
3,123,228
3,123,229
New iPhone Dev policy...how does Apple enforce this?
<p>Apple doesn't want anyone to create iPhone apps outside of the Xcode/Objective-C environment. How can they actually enforce this?</p> <p>If the non Xcode IDE, for example Unity, compiles to an iPhone executable, how will Apple know which dev environment you used to create the app? Can they have Xcode compile some...
iphone
[8]
4,157,471
4,157,472
Programatically Dial a Phone number and pass DTMF using the iPhone SDK
<p>How do you programatically do the following from the iPhone SDK</p> <p>1) Programatically Dial a Phone Number through the iPhone SDK</p> <p>2) Bypass the <strong>dial / cancel</strong> prompt that the iPhone brings up</p> <p>3) Send additional DTMF after the number is dialed just like how you would program pauses...
iphone
[8]
414,972
414,973
wait for webrequest to finish
<p>hi this function downloads an image from source and adds it to a zip file. the problem is sometimes the image comes out all messed up(1/3 is downloaded, the rest is empty space) as if the download isn't finish. how can i make sure the download is finished before i move on? thank you.</p> <p>edit: i have timeout the...
asp.net
[9]
3,610,946
3,610,947
Copy a property-decorated member to a new class
<p>I am trying to copy all the methods and attributes from a class to an instance of another class. Unfortunately I am having issues with properties. Here's an example:</p> <pre><code>class ToAdd(object): @property def foo(self): return 'foo!' class Base(object): pass b = Base() for item, val in ...
python
[7]
1,694,366
1,694,367
Using python for software automation
<p>My biggest difficulty is finding a tool that I can develop test python.</p> <p>What could I use?</p>
python
[7]
2,801,016
2,801,017
Using a variable outside of function in Python
<p>A really simple question, and I'm sure I knew it but must have forgotten</p> <p>When running this code:</p> <pre><code>x = 0 def run_5(): print "5 minutes later" x += 5 print x, "minutes since start" run_5() print x </code></pre> <p>I get x isn't defined. How can I have x used in the function and eff...
python
[7]
3,460,584
3,460,585
Android: Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView that was originally added here
<p>I am receiving the above error when launching my application in version 3.1 in my tablet</p> <p>It works fine from 2.1 to 2.3 on phones</p> <p>The code it complains about is as follows:</p> <pre><code>@Override protected void onCreate() { // Other logic here // .... showDialog(Constants.INTROD...
android
[4]
2,601,068
2,601,069
how to get text from edit text which is in scroll view?
<p>Hi am adding edit text field dynamically to the scroll view and then am adding a text into the edit text and then i want to get back data into string array...for that i wrote a following code please suggest me how to get the data from edit text..`for(int i=0;i <pre><code> value=(EditText)row.findViewById...
android
[4]
2,087,070
2,087,071
Is it possible to run "pm create-user Name" command programmatically?
<p>I am able to create the multiple user profile on Jellybean using "pm create-user Name" terminal command on Emulator, but I want to know is there any way so I can run the same command programmatically. I don’t want to open the terminal. </p>
android
[4]
5,137,123
5,137,124
Write image in drawable using android 2.1
<p>I have a bitmap object. I want to overwrite a .png image under drawable folder with the bitmap object content. I need a sample code to do this. Thanks in advance</p>
android
[4]
3,903,124
3,903,125
Calling keyevent from mouse
<p>I need to emulate a key press with click on a link. The keyboard shortcut <kbd>CTRL</kbd>+<kbd>+</kbd> must be called with a click on a link, or a similar function.</p>
javascript
[3]
760,922
760,923
How do I make the first letter of a string uppercase?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1026069/capitalize-first-letter-of-string-in-javascript">Capitalize first letter of string in javascript</a> </p> </blockquote> <p>How do I make the first letter of a string uppercase?</p>
javascript
[3]
3,519,607
3,519,608
Display vertical pages for UITextView in UIScrollView
<p>How i can display vertical pages for <code>UITextView</code> in <code>UIScrollview</code></p> <pre><code>self.textView = [[[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 410)]autorelease]; self.textView.textColor = [UIColor blackColor]; self.textView.font = [UIFont fontWithName:@"Georgia-Bold" siz...
iphone
[8]
3,420,390
3,420,391
camera application with odd images
<p>I have created a camera app which once opens simply captures an image every x minutes and sends the images to a web server. All is working well but I have noticed on the web site some odd images coming through every now and again! Has anyone hae any ideas as to whats happening?<br><br><a href="http://i.stack.imgur.c...
android
[4]
5,934,244
5,934,245
How do I use preg replace to remove this?
<p>I have a string <code>$test='23487°';</code></p> <p>How can I remove all the instances of the little circle that appears in the string using preg replace? </p> <p>What to I enter for the regex to remove it?</p> <p>EDIT - as Pekka says, str_replace is better I am now using that. But the little circle is still not...
php
[2]
2,980,534
2,980,535
Should I use the ReSharper rules for naming?
<p>I have a fairly small and new MVC application I am working on. I just installed the Trial edition of ReSharper and its suggesting a few (many) name changes. </p> <p>In particular it's suggesting method name changes from <code>getStorageAccount</code> to <code>GetStorageAccount</code>, local variable name changes fr...
c#
[0]
419,140
419,141
Clone of table header doesn't inherit width when table is bigger than the window
<p>I am using this script to make my table headers stick to the top of the page when scrolling through the table: <a href="http://cmcqueen1975.bitbucket.org/htmlFloatingTableHeader/tables.html" rel="nofollow">http://cmcqueen1975.bitbucket.org/htmlFloatingTableHeader/tables.html</a></p> <p>The problem is, when the tabl...
jquery
[5]
2,702,975
2,702,976
how can i run this program when clicking the button in java?
<pre><code>import javax.swing.*; public class Client extends JPanel { public static void main( String[] args) { clients application; if (args.length == 0) application = new clients(""); else application = new clients(args[0]); application.setDefaultClo...
java
[1]
4,838,692
4,838,693
c# Exception handling
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5457967/c-exception-handling">c# Exception handling</a> </p> </blockquote> <p>Hi,</p> <p>Greetings!</p> <p>I am getting an error in my c# windows application as creation or updation fails system.exception only...
c#
[0]
5,148,100
5,148,101
Unit Testing-Method-ASP.NET-Help?
<p>Hi I have a simple method, where It takes a string as parameter <strong>(domainname//firstname.lastname)</strong> and takes out (<strong>domainname//</strong>) and returns string as just firstname.lastname.</p> <p>I need to unit test for the following case.</p> <ol> <li>check for single slash (domainname/firstname...
asp.net
[9]
5,603,505
5,603,506
truncate string with escaped forien charasters
<p>I have the following function to truncate text:</p> <pre><code> /** * Removes HTML tags, crops to 255 symbols * * @param string $unformatted */ public function formatShortDescr($unformatted) { if(strlen($unformatted)&lt;1) return; $long_text = strip_tags(trim($unformatted));...
php
[2]
2,570,311
2,570,312
How to return an object of type "Object" without causing a type mismatch
<p>How can I return type <code>Object</code> from a method to an unknown type without causing a type mismatch?</p>
java
[1]
4,697,632
4,697,633
FourSqaure API PushConsole
<p>While I am trying to send test push i am getting below response</p> <p><strong>Push Response</strong> Push sent!</p> <p><strong>Response:</strong> Your Server returned: 500 Internal Server Error</p> <p>And my code to receive push notification is as below</p> <pre><code>namespace FourSquareService { [WebServi...
asp.net
[9]
3,236,802
3,236,803
Android -- Layout ellipsize with right-aligned view
<p>How can I achieve this as Text1 gets longer?</p> <p>|[Text1] [Text2]<strong><em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>___</strong>|</p> <p>|[Text1 Text1 Text1] [Text2]<strong><em>_</em>___</strong>|</p> <p>|[Text1 Text1 Text1 Tex...][Text2]|</p> <p>Text2 should always be on the right of Text1, but when Text1...
android
[4]
4,519,238
4,519,239
jQuery: How to store data for non-existent elements?
<p>What is a good approach of storing data for dom elements that do not exist yet, but when created they obtain that data. </p>
jquery
[5]
1,090,097
1,090,098
Java Style / Best Practice - passing fields to methods vs accessing directly
<p>In Java, given the following class:</p> <pre><code>public class MyClass { private final Dependency dependency; public MyClass(Dependency dependency) { this.dependency = dependency; } public void doWork() { // validate dependency... } </code></pre> <p>The doWork method needs to i...
java
[1]
2,155,128
2,155,129
How to solve all in one query?
<p>In my search module I am using SQLite database. Sometimes I'm searching more than two values. So I am using <code>AND</code> condition and sometimes searching only one value. These two cases I need to implement in a single query. Please help me.</p> <p>This is the query:</p> <pre><code>Cursor dbcur = myDB.rawQuery...
android
[4]
2,466,236
2,466,237
Executing parallel code on code::block
<p>how can I configure Code::block to execute parallel code for me using MPI</p>
c++
[6]
3,890,789
3,890,790
problem with a palindrome method
<p>Hi i am trying to write a palindrome method but am getting the wrong results</p> <pre><code>public static boolean isPalindrome(String input){ int b=input.length(); int []array=new int[b]; for(int i=0;i&lt;array.length;i++){ array[i]=Integer.parseInt(input);} for(int i=0;i&lt;(array.len...
java
[1]
774,110
774,111
C++ Selection for Array
<p>I'm trying to teach myself C++ through a book I picked up. One of the exercises is to get an user-inputted array of colours as string objects. Then they say to implement a selection sort on the user-inputted colours using relational operators. I have already started on what I think is the right track, but I have hit...
c++
[6]
455,131
455,132
Using Simple HTML Dom Parser to Get hyphenated Attribute
<p>There is a similar question to this on StackOverflow. But, My question is a little different.</p> <p>I have selected the image with the required class whose image I want. Earlier, I used</p> <p><code>element-&gt;src</code> </p> <p>to get the value of src attribute, but now the site has replaced it with 'data-src'...
php
[2]
4,007,532
4,007,533
Reading a big file cost too much memory in Python 2.7
<p>I used .readline() to parse file line by line, because I need to find out the start position to extract data into a list, and the end point to pause extracting, then repeat until the end of file. My file to read is formatted like this:</p> <pre> blabla... useless.... ... /sign/ data block(e.g. 10 cols x 1000 rows) ...
python
[7]
4,823,158
4,823,159
javascript get element by name
<p>Ok i have this little cute code as a expirement:</p> <pre><code>function validate() { var acc = document.getElementsByName('acc').value; var pass = document.getElementsByName('pass').value; alert (acc); } </code></pre> <p>and this html part</p> <pre><code>&lt;table border="0" cellpadding="2" cellspacing="0" vali...
javascript
[3]
2,782,269
2,782,270
Android:Is it possible to communicate with input method without a normal textview like edittext?
<p>If I popup input method with togglesoftinput,my view's onCreateInputConnection was not called, and i can not communicate with input method.</p> <p>And then i try to attach the input method to my view:</p> <pre><code>public boolean showSoftInput(View view, int flags,ResultReceiver resultReceiver) { checkFocus();...
android
[4]
1,662,794
1,662,795
How to make PHP header location redirect use PHP generated URL
<p>This is fairly simple but I cant work it out.</p> <p>I'm building a wordpress site, and I want a redirect on my 404 page using PHP instead of javascript.</p> <pre><code>&lt;?php header("Location: www.myblogurl.com"); ?&gt; </code></pre> <p>And I use this in my wordrpess websites to get the URL of my blog...</p> ...
php
[2]
2,282,747
2,282,748
Javascript - return false error
<p>I have a form validation function that loops through the form elements checking for empty fields - code below:</p> <pre><code>function formValidate(ourform){ var formelems = document.getElementById(ourform).elements; for (var i=0; i&lt;formelems.length; i++){ if(formelems[i].value == "") { alert("Empty Fi...
javascript
[3]
2,372,379
2,372,380
save data for bookmark
<p>I need some suggestion on the right approach to use for saving some bookmark data for my book-like android app I am making. Is using ShardPreference object the best way or what are other alternativs? I just need to save the page number and title in the bookmark.</p>
android
[4]
2,759,383
2,759,384
shorter way of echoing a variable in php?
<p>In the last two days, ive run across code that has php echo'd variables displayed like this</p> <pre><code>&lt;?=$selected?&gt; </code></pre> <p>What exactly is going on and why? What is this called?</p>
php
[2]
1,228,733
1,228,734
Jquery json full calendar
<p>I need help getting Full Calendar working with the day view. I've got it working for Month and week but not for day. I'm getting data in a dynamic JSON feed from java.</p> <p>I am getting following JSON feed: <code>"title":"trftdtdt","start":"2011,12,15,21,0","end":"2011,12,15,21,30","allDay":"‌​false","eventNeed...
jquery
[5]
898,649
898,650
How to set ExpandableListView child as not enabled
<p>Is there a way to set a child on an <a href="http://developer.android.com/reference/android/widget/ExpandableListView.html" rel="nofollow">ExpandableListView</a> as not enabled? I have a header in the children group and I don't want it to be highlighted when clicked. Not an actual header, just a child with a differe...
android
[4]
3,738,578
3,738,579
attaching data to <td> elements
<p>I'm building a web interface to edit values in large tables (2600 x 2600). Because the table is so big, I only load a part of the table into the browser, and the user has the ability to see a small window of the table by specifying xmin, xmax, ymin and ymax values. What is the best way to attach x,y coordinates to e...
jquery
[5]
4,469,202
4,469,203
Why doesn't this generic interface stack work?
<p>I have a bunch of generic interfaces and classes</p> <pre><code>public interface IElement { // omited } class Element implements IElement { // omited } public interface IElementList&lt;E extends IElement&gt; extends Iterable { public Iterator&lt;E&gt; iterator(); } class ElementList implements IElementList&l...
java
[1]
4,589,629
4,589,630
Refactoring in jQuery (following DRY principles)
<pre><code>$dltDiv.click(function(){ $seatdiv.css("background-color","#42de18"); $ticketRowDiv.hide(); price = price-15.50; $('#price h1').html('$'+price); }); $seatdiv.click(function(){ $seatdiv.css("...
jquery
[5]
3,260,254
3,260,255
Assignment in conditionals
<p>I've seen a lot this kind of code recently :</p> <pre><code>if ($foo = $bar-&gt;getFoo()) { baz($foo); } </code></pre> <p>Is this considered good or bad practice ?</p> <p>For example, Netbeans IDE give a notice if you use this kind of code :</p> <blockquote> <p>Possible accidental assignment, assignments...
php
[2]
1,523,232
1,523,233
Fatal error: Call to a member function diff() on a non-object when the object exists?
<p>Trying to get the difference between two DateTime objects. With the below code, I can echo out the <code>$endSub</code> variable and get a string like <code>2012-5-26T00:00:00-04:00</code> which is exactly what I need. However, I get the error in the title if I do not <code>exit()</code> the code on the <code>$int...
php
[2]
125,631
125,632
Setting camera intent to not add in EXIF data
<pre><code> Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //Using a File so it overwrites previous camera shot File pictureFile = new File(cameraImagePath); camera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(pictureFile)); startActivityForResult(camera, TAKE_PICTURE...
android
[4]
5,205,693
5,205,694
Is this C++ code defining main or running main?
<p>I'm reading Stroustrup's Programming: Principles and Practice and came across this code:</p> <pre><code>int main() try { // our program return 0; //0 indicates success } catch (exception&amp; e) { cerr &lt;&lt; "error: " &lt;&lt;e.what() &lt;&lt;'\n'; keep_window_open(); return 1; // 1 indicates...
c++
[6]
1,460,098
1,460,099
Can I open 2 cameras on android phone
<p>Is it possible for me to open both front and back Camera in my android application? Or I can either open front or back?</p> <p>Can I have 2 preview surface? one from front, one from back?</p> <p>Thank you.</p>
android
[4]
2,741,286
2,741,287
Change rawtext to a variable name?
<p>Is there a way I could possible change raw text to a variable name in a echo. For instance settings a variable <code>$number</code> to <code>number1</code>, and then when it echoes to use <code>$number1?</code> </p> <p>To clarify, say we have a variable named <code>$number = "number1";</code> in it, and when we ech...
php
[2]
4,651,187
4,651,188
JQuery select between
<p>I have a JQuery "collection" of li objects (result of applying .filter())...</p> <p>The collection is named <code>results</code> ... Because of javascript pagination i am trying to find an efficient way to make elements visible from index x up to index y... This test didnt work </p> <pre><code>results.find(":lt(...
jquery
[5]
1,974,049
1,974,050
native heap size increasing whenever application is launched
<p>Native heap size of my application keeps increasing and finally crashes. </p> <p>I have a couple of list views in my application and it is being populated from the database. In the lisview, there are images and I have soft references to the bitmap image that is being loaded into the listview.</p> <p>I also have op...
android
[4]
506,502
506,503
Location of Android Phone via Sim card
<p>I want a offline location of android phone and want to save in local db, can i do via sim card? will i be able do with Network provide but without internet ? if yes find provide me the way to do in Android Any help will be appropriated thanks.</p>
android
[4]
2,117,102
2,117,103
How to be able to write to a textbox side-by-side names of the items which are find inside Listbox in C#?
<p>How to be able to write to a textbox side-by-side names of the items which are find inside Listbox in C#?</p> <p>Regards,</p>
c#
[0]
4,070,990
4,070,991
Search for file in directory with multiple directories
<p>Here's my goal. I want to be able to pass a parent directory and a filename to a method that searches for that specific file in the directory and any sub-directories. Below is the code I have been working with but can not get it to do exactly what I want. It will find the file I specify but will not return anything....
java
[1]
4,534,041
4,534,042
$_SESSION variable not updating every iteration
<p>So I have this piece of code that is executed each iteration. The iterations are not ordinary loops but part of a series of ajax request iterations. The first ajax request determines a filename that is assigned to e.g $_SESSION['filename'] and then this variable is pushed into and array etc. Now the problem occurs w...
php
[2]
195,006
195,007
List loop cannot be accessed
<p>I have a new list which have at least 5 objects. I am trying to copy the elements of the new list to the old one. The problem here is that loop never accessed.</p> <pre><code>foreach (JobPosition Position in JobPositionsListNew) { JobPositionsList.Add( new JobPosition( Position.SetGetPositio...
c#
[0]
1,284,243
1,284,244
How do i calculate the height of toolbars, address bars and other navigation tools in pixels?
<p>Basically i need to know how many pixels the y axis is from the top left of the screen until i reach the actual web window. Does anyone have any ideas...?</p>
javascript
[3]
4,558,113
4,558,114
IOS 4.3 app not running in lower version
<p>Application created using 4.3 is not running in lower version.... Here am also set deployment target to lower version..</p> <p>Why its not running in lower version?</p> <p>Where should i learn functionality of all ios versions and also i want to know possibility of running 4.3 app in lower version.</p>
iphone
[8]
3,208,814
3,208,815
How to wake a phone without pressing power button
<p>Anybody know that how to wake a phone with any action but without pressing power button or any hard-key and in android programmatically..</p> <p>Thanks in advance</p>
android
[4]
962,082
962,083
strtotime - a second before midnight
<p>I attempted this:</p> <pre><code>$date_string = strtotime('6 Mar, 2011 23:59:59'); </code></pre> <p>But I think PHP can't interpret that for some reason as it returned empty. I tried this:</p> <pre><code>$date_string = strtotime('6 Mar, 2011 midnight'); </code></pre> <p>The above worked but I need it to be a sec...
php
[2]
1,041,052
1,041,053
if file exists php
<p>I use following code to delete old image from ftp...</p> <pre><code>unlink(getcwd() . '/images/' . $row['pic']); </code></pre> <p>But it throws errors in case there is not image, so i have tried using file_exists() but that didn't work too, so how can i check if there is an image before trying to delete. thanks.</...
php
[2]
3,311,402
3,311,403
What is Convert.ToInt32 and Convert.Uint 16?
<p>I am a new developer with C#, which don't understand convert string to integer.</p> <p>What are</p> <ul> <li><code>Convert.ToInt16</code></li> <li><code>Convert.ToInt32</code></li> <li><code>Convert.ToInt64</code></li> <li><code>Convert.Uint16</code></li> <li><code>Convert.Uint32</code></li> <li><code>Convert.Uint...
c#
[0]
933,832
933,833
Get frequency count of elements in an array
<p>Hi I have a list of values. I want to get another list with the amount of times every values in that list occurs. This is fairly easy, but I also need to have the values which are not present in the original list, to be present in the frequency list, but then with value 0. For example:</p> <pre><code>I = [0,1,1,2,2...
python
[7]
2,788,381
2,788,382
Installing Big Integer libraries for C++?
<p>I try to install <a href="https://mattmccutchen.net/bigint/" rel="nofollow">https://mattmccutchen.net/bigint/</a> and even when I include all the .hh files, using BigIntegers throws undefined reference errors.</p> <pre><code>[Linker error] undefined reference to `BigInteger::BigInteger(int)' [Linker error] undefine...
c++
[6]
1,689,270
1,689,271
ajax modal pop up not working in Firefox
<p>hi i have ajax modal pop up and it is working perfectly in IE but the same control is not working in firefox. below is my code</p> <p> ...
asp.net
[9]