Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
5,215,495
5,215,496
Initialize a static member ( an array) in C++
<p>I intended to create a class which only have static members and static functions. One of the member variable is an array. Would it be possible to initialize it without using constructors? I am having lots of linking errors right now...</p> <pre><code>Class A{ public: static char a[128]; static void do_somethin...
c++
[6]
5,675,652
5,675,653
Why code stops working after this function?
<p>I have some other functions and a html page call after this simple function, but they dont run after this. </p> <pre><code>function page($name){ $content =&lt;&lt;&lt;eol &lt;?php PAGE CONTENT ?&gt; eol; $file = "./search/$name.php"; $open = fopen($file, "w"); fwrite($open, $content); fclose($open); } </code...
php
[2]
2,787,273
2,787,274
jquery on to replace live?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/9864476/jquery-on-vs-live">jquery: on vs live</a> </p> </blockquote> <p>I have code that works just fine using <code>$('thing').live("mousemove", function(e) {</code> and <code>$('thing').live({mouseenter:functi...
jquery
[5]
4,482,473
4,482,474
converting -1 to unsigned types
<p>Consider the following code to set all bits of <strong>x</strong></p> <pre><code>unsigned int x = -1; </code></pre> <p>Is this portable ? It seems to work on at least Visual Studio 2005-2010 </p>
c++
[6]
3,424,517
3,424,518
Embedded PDF's in a DROID App?
<p>What is the best way to integrate a PDF document into my droid app?</p> <p>I am attempting to recreate the same functionality we provide on our website in our mobile app.</p> <p>I have 2 options of delivering the PDF to the device but the route I choose depends on the best way to implement this functionality on th...
android
[4]
2,962,134
2,962,135
What part of the Javascript do i edit?
<p>I found this great tutorial <a href="http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/" rel="nofollow">http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/</a></p> <p>Its easy to follow but i am getting stuck with the JS because i want to have more than one image on the page. </p> <p...
javascript
[3]
2,338,187
2,338,188
use microphone to receive an inaudible tone?
<p>I am doing a project. I want to use the speaker of computer to generate an inaudible tone and microphone on smartphone to receive this tone. </p> <p>1.what software that can generate the inaudible tone (18- 20 Khz) through the speaker in PC ?</p> <p>2.A code android to receive and analyse some features (frequency,...
android
[4]
1,194,376
1,194,377
Site not displaying but rather downloading
<p>I am working on a site and just published it to the client's domain, but when I try to access the root or subpages, they download to my computer rather than displaying as the pages. Could it be the fact php is not installed (the server is managed by my client so I don't know if PHP is installed)?</p>
php
[2]
4,706,226
4,706,227
php issue with syntax
<p>i have this problem with the syntax here but i don't know what it is..</p> <p>could you please help me out? it must be in the url... I guess there might be any error in the way i'm expressing it, because when i use a plain URL it works..</p> <p>Thanks!</p> <pre><code>$url='http://testext.i-movo.com/api/receivesms...
php
[2]
4,663,047
4,663,048
Is there a Heap in java?
<p>I am porting c++ library to java and I need a heap data structure. Is there a standard implementation or I will need to do it myself?</p> <p>Thanks</p>
java
[1]
4,600,143
4,600,144
NameError: name 'getResultFromDatabase' is not defined
<p>I'm getting this error:</p> <pre><code>NameError: name 'getResultFromDatabase' is not defined </code></pre> <p>Here is my code:</p> <pre><code>import pymongo from itertools import groupby from pymongo import Connection data = getResultFromDatabase() connection = Connection('localhost', 27017) db = connection.s...
python
[7]
1,290,689
1,290,690
what is the main purpose of post() method of View
<p>what is the main purpose of the post method which are associated with views such as imageview,textview etc. </p> <pre><code>new View(Context).post(runnable) </code></pre> <p>An example will be appreciated :)</p>
android
[4]
511,241
511,242
running tcpdump from android application
<p>I want to develop an android application that will be able to launch tcpdump. Can any one give me any suggestion regarding this issue? </p> <p>thanks kaisar</p>
android
[4]
3,996,199
3,996,200
i have some problem with left join JPQL
<p>there is something wrong with ths way i use left join, and i dont understand what am i doing wrong.</p> <p>can you see it?</p> <pre><code>select distinct r.globalRuleId, r.ruleId, sv.validFrom, pm.moduleId, nvl(min(rai.failedOnRegistr...
java
[1]
4,743,037
4,743,038
How to make a custom drawn UITableViewCell resize properly?
<p>For performance reasons, I draw the strings for my UITableViewCell in a custom view that overrides its drawRect method to draw strings directly in the view rectangle using NSString:drawInRect. This is similar to Apple's TableViewSuite Example 5-CustomTableViewCell.</p> <p>However, when I invoke setEditing on the ce...
iphone
[8]
1,791,620
1,791,621
iPhone programing
<p>I'm beginner for iPhone. I want to learn iPhone programming without UI. Can you help me?</p>
iphone
[8]
1,441,406
1,441,407
How to check whether a control gets a focus or not in android
<p>I have a question that How to check whether the widget having a focus or not. Actually I have a form in which there is a DOB edit text, a user navigates all the edit text boxes with Next action on keyboard and I want when user navigates to DOB field from any of the control then a Calendar Dialog automatically appear...
android
[4]
3,021,128
3,021,129
How to use method stringWithContentsOfFile:encoding:error
<p>I don't know how to use this method. </p> <p>I want to get the data in an rtf file as a NSString, however I can not.</p> <p>Here is part of my code.</p> <pre><code>NSString *filePath = @"path of the file"; NSString *ImagePath = [[[NSString alloc] init] autorelease]; imagePath = [NSString stringWithContentsOfFil...
iphone
[8]
2,708,140
2,708,141
why is header() function displaying A sql error
<pre><code>&lt;?php include_once( 'mysqlconnect.php' ); $id=$_POST['id']; //8 header("location:settings_pay_roll.allowance.general.view.php?id='$id'"); ?&gt; </code></pre> <p>output:</p> <blockquote> <p>You have an error in your SQL syntax; check the manual that corresponds to your //MySQL server version for the...
php
[2]
4,579,281
4,579,282
Code giving SEG FAULT only when the class is being derived!
<p> I am unable to find out the bug in the below code which i had written[Not for any purpose though]. </p> <p> <pre> <code> #include &lt iostream &gt #include &lt cstdlib &gt using namespace std; class Base{ public: Base(){cout &lt&lt "Base class constructor" &lt&lt endl;} void funv() {}; ~...
c++
[6]
2,624,409
2,624,410
Method to delete files in c#
<p>I have this simple method of deleting list of files. But for some cases it fails to delete the file unless i give it Sleep for some seconds. This is visible especially when i merge Word Documents using Interop and then right after executing merging i try to delete the files it fails to do so for some of them (as i g...
c#
[0]
4,856,767
4,856,768
Group and then sort a list using java comparator
<p>i have a list that contains product items and when it was purchased. is it possible to use comparator java to first sort this list out by the product description, and then sort it by date purchased as well?</p> <p>So far i can use it sort out the list in order of dates or description or another field but i want to ...
java
[1]
2,415,406
2,415,407
Sort table rows based on their Class Names
<p>I want to rearrange table rows based on their Class names.<br> Below is my HTML code. </p> <pre><code>&lt;table&gt; &lt;tr class="a4"&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;tr class="a6"&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt; &lt;tr class="a1"&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt; &lt;tr class="a2"&gt;&lt;td&...
jquery
[5]
1,510,683
1,510,684
Using An Array in Javascript
<p>So I have an assignment in which I have to Write a function named "addEmUp" declared this way:</p> <pre><code>function addEmUp() { // Your code goes here. }; </code></pre> <p>addEmUp returns the total of the numbers in an array. The name of the array is LASVEGAS and the array has 3 values in it.</p> <p>The...
javascript
[3]
687,199
687,200
java.lang.Object.equals() what was the intention?
<p>What do you think the primary motive for putting the <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals%28java.lang.Object%29" rel="nofollow"><code>equals</code></a> method in <code>java.lang.Object</code> is? Most of the implementations that we override it with are domain-centric, i.e. ...
java
[1]
2,632,268
2,632,269
How to find the version of a File on windows through Java program?
<p>I want to design a function in Java which will have prototype like this.</p> <pre><code>public String FindVersion(String FullPath) { } </code></pre> <p>where FullPath can be: <code>C:\tmp\readme.txt</code> or <code>C:\windows\system32\xcopy.exe</code> or like <code>C:\windows\system3</code></p>
java
[1]
4,803,935
4,803,936
Deduction of SQL Server 2005 connection through layers using C#
<p>I would be very thankful to you if you would help me creating a connection to SQL Server 2005 using C# through layers. </p> <p>I have created different main classes of BLL, DAL, WebService etc. but I tried a lot but in vain. There is problem of reference and some other technical errors. </p> <p>Pls help me making ...
c#
[0]
4,532,324
4,532,325
set() runtime in python
<p>Just wondering what the run time of lookup for set() is? O(1) or O(n)?</p> <p>if I have </p> <p>x = set() whats the runtime of</p> <p>if "a" in x: print a in set!</p>
python
[7]
5,397,686
5,397,687
convert javascript to jQuery to disable text boxes on option selection
<p>I am currently using javascript to disable a text box if my "remote_server" option is set to no. Here is my existing code</p> <p><strong>HTML</strong></p> <pre><code>&lt;select name="remote_server" class="required"&gt; &lt;option&gt;&lt;/option&gt; &lt;option value="1" &lt;?php if($remote=="1") echo 'sele...
jquery
[5]
4,770,699
4,770,700
Getting parse error but I can't see anythting wrong in the line
<p>Here is my code: </p> <pre><code>if($_POST['format'] == "csv") { Line 174 -&gt; $objWriter = new PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV'); $objWriter-&gt;save($FNAME); } else { $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); $objWriter-&gt;save($FNAME); } </code>...
php
[2]
235,575
235,576
tips for practicing android development
<p>I just completed my Lynda Android App Development tutoiral. I got all the basics covered. But now I have no idea what shoud I code to get into habit and learn more techniques. Some one please suggest some programs or apps that I should code to get into the practice. </p>
android
[4]
2,889,072
2,889,073
What does string::npos mean
<p>What does the statement <code>string::npos</code> mean here</p> <pre><code>found=str.find(str2); if (found!=string::npos) cout &lt;&lt; "first 'needle' found at: " &lt;&lt; int(found) &lt;&lt; endl; </code></pre>
c++
[6]
999,497
999,498
Did back key destroy an activity?
<p>I have an activity defined as below:</p> <pre><code> &lt;activity android:name="com.example.ui.HomeActivity" android:alwaysRetainTaskState="true"/&gt; </code></pre> <p>A strange thing is that, when running on emulator, and the back key is pressed, the activity was destroyed (I saw onDestroy() called in ...
android
[4]
2,570,520
2,570,521
Nexus S not showing up on DDMS
<p>I am using Windows 7/64 bit HP laptop...</p> <p>Installed Java 32 bit as well as java 64 bit. Installed Android environment. Installed Google Version 4 driver from Android AVD and SDK Manager.</p> <p>Windows autmoatically installed the nexus driver and it shows up in my computer->manage->device manager->Storage->...
android
[4]
4,092,935
4,092,936
how to get data from an Android Activity?
<p>I need Activity A to retrieve the string value from a textview in Activity B. The catch is I don't want Activity B to send the data, I just want Activity A to reach out and grab the data from B. I understand about Bundles and Intents, but the problem I'm having is that every time Activity B is accessed, it sends the...
android
[4]
2,804,306
2,804,307
override and overload perspective
<ul> <li>Overloading - same method with different signatures in the same class.<br/></li> <li>Overriding - same method signature different implementations in subclass <br/></li> </ul> <p>If i have an overloaded method in the parent class does the child class overload or override this particular method? </p>
java
[1]
6,020,970
6,020,971
Change focus of activities in android
<p>I am using a dialog themed activity in android to show a popup from a application context. The dialog has a transparent theme, but the issue is that I want the underlying activity to have focus and not the popup though the popup must be visble. How do I achieve this in android?</p>
android
[4]
4,843,780
4,843,781
dynamically input year based on date range
<p>I have an application that is good from September 1st of the current year, and ends January 15th of the following year.</p> <p>What I need to do is enter the current year into the database when they submit their application. </p> <p>If the user completes the application between Sept 1, 2012 and January 15, 2013 - ...
php
[2]
1,525,850
1,525,851
add value to user control throw databinding after page_load?
<p>Have a Repeater in a updatepanel with a user control inside.</p> <pre><code>&lt;asp:Repeater id="repQuestionElement" runat="server" OnItemCommand="repQuestionElement_ItemCommand" OnItemDataBound="repQuestionElement_ItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;uc1:elements ID="Elements1" ...
asp.net
[9]
1,609,740
1,609,741
How to auto login when I run the Android Application
<p>Assume that I have login to system using PHP + MySQL, then, after I exit the apps, I run the apps again, no need to login again and auto login, Please help to solve the problem.</p>
android
[4]
5,887,326
5,887,327
Install and uninstall windows service via command prompt "C#"
<p>i want install and uninstall win service via command prompt "C#"</p> <p>following code is not working please help me</p> <pre><code>string strInstallUtilPath ="C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\"; string strInstallService = " InstallUtil.exe \"D:\\TestUser\\ServiceForPatch\\TestService\\bin\\Debug...
c#
[0]
2,024,953
2,024,954
Problem embedding a cgi within PHP using system
<p>Hi I am using php system to embed a cgi-script like this</p> <pre><code>&lt;?php echo system('./cgi-bin/rebol-include.cgi'); ?&gt; </code></pre> <p>Problem is my cgi-script writes</p> <pre><code>print "content-type: text/html^/" </code></pre> <p>so that PHP will show up </p> <pre><code>"content-type: text/html"...
php
[2]
1,463,640
1,463,641
iPhone SDK: Navigation is causing crash
<p>My app is crashing when I navigate two view controllers in my application. For example, if I do this sequence:</p> <p>RootController ViewControllerA<br> ViewControllerB ViewControllerA</p> <p>My app crashes.</p> <p>It crashes when I pressed the back button in ViewControllerB. So, It seems like it is with two or ...
iphone
[8]
3,851,900
3,851,901
What Visual C++ setting/option/flag is the counterpart of -ansi -pedantic in g++
<p>I have a C++ codebase, and I am porting from Visual Studio to g++, which should I set in Visual Studio so that build errors in gcc are reduced? With g++ this is achieved by -ansi -pedantic.</p>
c++
[6]
1,221,401
1,221,402
Marquee tag in Jquery
<p>hi I want to implement marquee tag in my web from using jquery. in my web from i have text box ,button and div for display the marquee.my requirement is i want to display the textbox text to marquee as sliding after click on button this is my code</p> <pre><code>&lt;script type="text/javascript"&gt; $(document)...
jquery
[5]
47,652
47,653
JQuery: How to do validation on blur of a text box?
<p>I have a textbox with ID "name", I want to do validation when the text box get onblur function. The below code doesn't work. What's wrong with me?</p> <pre><code> $(function() { $('name').validate({ rules:{ "name": {required: true, minlength: 5 } } }); $('name').blur(function(){ $('name').v...
jquery
[5]
91,146
91,147
jQuery attribute doesn't change
<p>As I'm a newbie to jQuery I'm having a little problem. I have two divs with product images, below them I have a couple of "color selectors" to let the customer look at what colors that's available. When the user hovers one of the "links" I have a new div showing with a color in it. Bla bla... The problem I'm having ...
jquery
[5]
1,559,217
1,559,218
Parsing Ambiguous Dates in Java
<p>Is there any way in Java to guess the date format when it is not explicitly defined?</p> <p>For example a user types in 11Mar09 or 11-09-2009 or 11/09/2009 or 11-09 what is the best way of parsing this to a Date object without either a bunch of try catch or raising an error?</p>
java
[1]
3,062,985
3,062,986
Summing columns of a txt file in java
<p>I have a text file that reads:</p> <p>1 2 3 4 5</p> <p>6 7 8 9 1</p> <p>8 3 9 7 1</p> <p>9 3 4 8 2</p> <p>8 7 1 6 5</p> <p>where each number is separated by a tab.</p> <p>My question is, is there a simple way to sum the columns of numbers using java? I want it to sum 1+6+8+9+8, 2+7+3+3+7, etc. I am reading th...
java
[1]
2,109,940
2,109,941
get current device location after specific interval
<p>I want to capture current location (latitude and longitude) of android device after specific interval (say 30 mins).. My class (or service ?? not sure what to use ) will start listening to <code>LocationManagerListener</code> when device booting completed. What is the best way of implementing this? how we can make u...
android
[4]
2,704,582
2,704,583
Like layout-sw600dp,alternative for drawable
<p>My question is straight forward and simple, Like there is layout-sw600dp,values-sw600dp, for layout and values respectively, what is there for drawable folder in relative to size of screen.</p> <p>I read in various document that if we want to use any screen more than or equal to 7 inches we can use layout-sw600dp f...
android
[4]
4,917,014
4,917,015
python: what's the point of adding`__dict__` to `__slots__`
<p>The whole point of <code>__slots__</code> is to save space. </p> <p>But I saw people add <code>__dict__</code> to it so that new attributes can be added. Isn't this defeating the goal of <code>__slots__</code>? </p>
python
[7]
1,218,802
1,218,803
Subtle List<string> Manipulation
<p>I have two <code>List&lt;string&gt;</code> (<code>listOfFullPaths</code> containg full database paths for e.g. "C:\MyDir\SomeDir\SomeDatabase.mdf") and some other <code>List&lt;string&gt;</code> containing <em>some</em> of the names of the databases (only) ('listOfDatabases'). So each might include</p> <pre><code>L...
c#
[0]
2,450,291
2,450,292
Python class method decorator w/ self arguments?
<p>How do I pass a class field to a decorator on a class method as an argument? What I want to do is something like:</p> <pre><code>class Client(object): def __init__(self, url): self.url = url @check_authorization("some_attr", self.url) def get(self): do_work() </code></pre> <p>It compl...
python
[7]
5,397,193
5,397,194
Session management for same server having different domains by not setting different sessions
<p>I have two folders in same server , one is for development(ponting to dev.mysite.com) and other for live site (ponting to 'mysite.com'). But if some one logged in development his session will be generated and at the same time if he enter into live site he automatically loged in since session is already set in develo...
php
[2]
2,341,463
2,341,464
How does Python handle globals?
<p>I've come across some very odd handling of global variables in Python. I was hoping someone can explain and justify these surprises!</p> <p>A) This code prints 10 as expected:</p> <pre><code>def func(): print(a) a = 10 func() </code></pre> <p>B) This code throws an exception about referencing a too early:</p> ...
python
[7]
4,475,914
4,475,915
Reducing PDF File Size - Adobe SDK C#
<p>What i am wondering, is if there is a way to use the function from the Adobe Acrobat Pro Software "Document >> Reduce File Size" programatically in C# using the Adobe SDK ? I already have it so i can retrieve adobe documents/pages i just need to apply this method from the software. If this is possible or you know ho...
c#
[0]
3,870,577
3,870,578
How can I check if a string ends in is or are valid? using regex
<p>I do a check to see if my strings contain the words "is valid". But how using regex can I check "is valid" or "are valid"?</p> <pre><code>@"Which (of the following )?(is valid) (?&lt;result&gt;.*?)[?:]" </code></pre>
c#
[0]
4,647,180
4,647,181
Unable to remove element on click
<p>I have a page where I appendTo a div on page load. After a user can dismiss this div by clicking another element.</p> <pre><code>var overlay = jQuery('&lt;div id="start"&gt;111111111&lt;/div&gt;'); overlay.appendTo(document.body); $("#go").click(function() { $(document).remove("#start"); }); </code></pre> <p>...
jquery
[5]
4,663,126
4,663,127
Iterate and add Class to Each Paragraph
<p>I'm trying to add a class "ignore" to the first P and a class "style" for the last P for each block.</p> <pre><code>&lt;div class="tiles_large"&gt; &lt;span class="spacer"&gt;&amp;nbsp;&lt;/span&gt; &lt;p&gt;image here&lt;/p&gt; &lt;span class="spacer"&gt;&amp;nbsp;&lt;/span&gt; &lt;h4&gt;head...
jquery
[5]
1,877,254
1,877,255
Two C# questions; how can I reinterpret cast a float to an int? Does C# have a non-static conversion operator or user-defined assignment operator so that the conversion takes place on 'this'?
<p>1. How can I reinterpret cast a float to a int (or a double to a long)?</p> <pre><code>float f = 2.0f; int i = (int)f; // causes conversion </code></pre> <p>I only want to copy the bit-pattern from f to i. How can this be done?</p> <p>2. The implicit and explicit operators in C# uses one intermediate object becau...
c#
[0]
5,551,235
5,551,236
Android: any-screen capture without ROOT and constant USB connection
<p>I'm trying to make an app that takes a video capture of the screen by taking individual snapshots. I've been looking into taking the snapshot without root, and seems that most solutions use ddmlib and require the device to be constantly connected via USB. </p> <p>The only solution that doesn't require root and a co...
android
[4]
1,421,704
1,421,705
The handler in click button keeps adding everytime I refresh my page
<p>I use jquery to bind a click event in my link element and binding a handler. But every time I refresh the page the registration of the handler in my link element keeps adding. Like for example, in a new load page, only one handler registered in the click but when I click the link again, it it will add another handle...
jquery
[5]
2,468,355
2,468,356
Why does playing a .wav using AVAudioPlayer hang my iPhone simulator?
<p>I'm trying to get a simple button to play a sound:</p> <pre><code>-(IBAction)myButton:(id)sender { NSString *audioFilePath = [[NSBundle mainBundle] pathForResource:@"whistle" ofType:@"wav"]; AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:audioFilePath] error...
iphone
[8]
5,837,185
5,837,186
expandable list not looking properly in 2.1 QVGA
<p>i have developed an application for 1.5 and above which uses expandable list ,but when i test it on 2.1 QVGA emulator expandable list dosent look proper . Also i have tried running sample Expandablelist1 ,but it also has same issue. so can anyone tell me is this issue with emulator only? if yes how to resolve it?</p...
android
[4]
4,549,037
4,549,038
Use of undefined constant DB_SERVER - assumed 'DB_SERVER'
<p>I have the following php code : </p> <pre><code>$db_host = "localhost"; $db_user = "root"; $db_pass = ""; $db_name = "photos"; define(DB_SERVER,$db_host); define(DB_USER,$db_user); define(DB_PASS,$db_pass); define(DB_NAME,$db_name); </code></pre> <p>I am defining <code>DB_SERVER</code> and all the other ones as y...
php
[2]
2,917,182
2,917,183
Problems with mousewheel in jQuery
<p>I have the following code in the head-section:</p> <pre><code>&lt;script type='text/javascript' src='/js/jquery.mousewheel.min.js'&gt;&lt;/script&gt; jQuery(function($) { $('#box').bind('mousewheel', function(event, delta) { var dir = delta &gt; 0 ? 'Up' : 'Down', vel = Math.abs(delta); ...
jquery
[5]
3,436,390
3,436,391
Getting a CC copy of user invite Emails
<p>The code below works great. It allows a user to send a recommendation for my site to a list of friends via email. </p> <p>For each person that gets the email below, I would like to get an email with that person's email, and the name of the person that sent them the message. If my email address was john@site.com,...
php
[2]
2,300,263
2,300,264
What is the difference between x = function(a, b, c){} and function x(a, b, c){}?
<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>Is there any difference between these tw...
javascript
[3]
5,700,516
5,700,517
Strings memory model
<p>What I read about strings is when a string object is created in Java it is immutable. For example:</p> <pre><code>String s=new String(); s="abc"; s="xyz"; </code></pre> <p>Does the <code>String s</code> no longer point to <code>"abc"</code>?</p> <p>And another thing: what is size of s; Is the <code>String</code>...
java
[1]
2,673,518
2,673,519
Advertisements in Android
<p>I have a publisher account registered in US and I am deploying my application from that account. I have an admob account registered in India. Can I give ads to my app with both being registered with different details. This is my first app I am going to deploy Please help me.</p>
android
[4]
4,107,690
4,107,691
Listview in Listview
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5244797/listview-setadapter-raising-nullpointer-exception">Listview.setadapter raising nullpointer exception.</a> </p> </blockquote> <p>Hi, How to create a listview in a listview. I have a tabbar application. Th...
android
[4]
32,540
32,541
Can an IPhone app be developed on a PC?
<p>I do not have access to a MacOS box. Everything I've found while researching iPhone development leads me to believe that you have to have one to develop for the iPhone. I have a Windows 7 development box running Visual Studio 2010 with IIS 6.0 in the background. I need to develop an App. Can I create an icon-on-t...
iphone
[8]
3,530,686
3,530,687
On button click make div visible if check box checked is true Using jquery
<p>I have 32 checkboxes (checkbox1,checkbox2,checkbox3.... checkbox32) and 32 div(div1,div2,div3.....div32) and one asp:Button.</p> <p>On button click I need to make div1 visble if checkbox1 checked true and div2 visble if checkbox2 checked true and div3 visble if checkbox3 checked true and so on using JQuery..</p> ...
jquery
[5]
2,949,172
2,949,173
What problems might arise when sharing an int between two threads?
<p>Two threads accesses a shared int, x. What problems can arise from instruction reordering etc.</p> <p>Thread 1:</p> <pre><code>x = 1; </code></pre> <p>Thread 2:</p> <pre><code>obj.f(x); </code></pre> <p>What would change if x is declarared volatile?<br> What would change if Thread 1 and Thread 2 runs on differe...
c++
[6]
2,254,237
2,254,238
Android Html.fromHtml takes too long
<p>What do I do if <code>tv.setText(Html.fromHtml(text));</code> takes too long, and hangs the UI? If I can do it with a thread, can you provide an example?</p>
android
[4]
241,453
241,454
What's the diff between Cache and Application?
<p>I just noticed a "Cache" object, when would you use the Cache object to store state data nd when would you use the Application object?</p>
asp.net
[9]
4,207,699
4,207,700
how to request for camera for an application?
<p>I have made an application which is always using the front camera. My application is running and i want to use camera for some other application. How can i request for camera to release for other application?</p>
android
[4]
5,985,674
5,985,675
How to obfuscate an Android library (.jar file) from eclipse
<p>Hi I need to create a create a obfuscated jar. I want to distribute it client so want my code to be obfuscated .</p>
android
[4]
4,442,477
4,442,478
Replace Button Text during .click() Function
<p>I have a hidden Textbox. If I click a button, the content of a div appears. If I click the Buutton again, the content disappears (.slideToggle()): I would like to replace the text of my button, if the content of the div is visible and change it back, if the button gets clicked again and the content of the DIV, bett...
jquery
[5]
2,989,339
2,989,340
Script printing Blob works on one hosting site, not on another
<p>I've a script that prints images (Blobs from mysql DB). It works fine on Godaddy but when I move it to a UK hosting company it fails to print the image - prints the alt text instead (everything else works fine). GD is PHP 5.3 and the UK company is PHP 5.2. Both mysql DBs are 5. I have checked that the scripts are th...
php
[2]
2,310,021
2,310,022
java : convert float to String and String to float
<p>How could I convert from float to string or string to float?</p> <p>In my case I need to make the assertion between 2 values string (value that I have got from table) and float value that I have calculated.</p> <pre><code>String valueFromTable = "25"; Float valueCalculated =25.0; </code></pre> <p>I tried from flo...
java
[1]
1,067,903
1,067,904
Mainting the state of array across the entire app using singleton pattern
<pre><code>function MySingletonClass(arg) { this.arr = []; if ( arguments.callee._singletonInstance ) return arguments.callee._singletonInstance; arguments.callee._singletonInstance = this; this.Foo = function() { this.arr.push(arg); // ... } } var a = new MySingletonClass() var b = MyS...
javascript
[3]
3,929,164
3,929,165
How To Generate (Somewhat) Secure Passwords in PHP?
<p>I'm trying to come up with a function that can generate random passwords, that must meet the following requirements:</p> <ul> <li>Between 8 &amp; 14 characters</li> <li>Contain a least one of the following: lowercase letter, uppercase letter, punctuation, and number</li> </ul> <p>what would be the best way about g...
php
[2]
1,682,829
1,682,830
How to change color of the toggle button?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11253512/change-on-color-of-a-switch">Change &ldquo;on&rdquo; color of a Switch</a> </p> </blockquote> <p>I need to have a toggle button change color when it changes state from Green(true) to Red(false).how can ...
android
[4]
817,015
817,016
Byte[] Array to String
<p>I want to output a Byte[] array to a string so I can send it along a HTTPRequest. Can it be done? And will the server pick up the data and create a file from it? Or does some special encoding need to be done?</p> <p>The file is an image. At the moment I have: </p> <pre><code>Byte[] fBuff = File.ReadAllBytes("C:/pi...
c#
[0]
658,250
658,251
Show numerals only on clicking edit text and also able to accept decimal point(.)
<p>For an edittext i used wt.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL); But the virtual keyboard that comes up on clicking that field is not showing integers only. It is showing normal querty keypad only. But when i used like this wt.setRawInputType(Configuration.KEYBOARD_12KEY); the keypad is showing as desi...
android
[4]
2,674,068
2,674,069
find current element in repeater
<p>How can i get current MainNavigationMenu hyprelink in code behind and check if is current menu clicked then i will change him default CSS.</p> <p>I try with this code but is always null</p> <pre><code>HyperLink mainNavigationMenu = siteMapAsBulletedList.FindControl("MainNavigationMenu") as HyperLink; </code></pre>...
c#
[0]
3,057,671
3,057,672
Android. Record calls, disable mic. Acer Ferrari
<p>My app needs to record calls. It works fine on many devices, but not on Acer Ferrari Liquid E. If my app is running, then interlocutor on other side of wire does not hear me (if I set mic on/off manually, then he hear me). So, as workaround for Ferrari, I want to try set on/off mic programmaticaly.</p> <pre><code>(...
android
[4]
3,426,444
3,426,445
jquery accessing label of input
<p>I have some HTML like this:</p> <pre><code>&lt;input type="radio" class="MyRadio" name="TheName"&gt; &lt;label for="TheLabel"&gt;the text&lt;/label&gt; </code></pre> <p>How do I change the label's text?</p> <p>Tried </p> <pre><code>$('#TheLabel').text('My New Text'); </code></pre> <p>It doesn't work. What's the...
jquery
[5]
1,636,025
1,636,026
How to update contact number using Android
<p>I am learning android. I am trying to upadate contact number programmatically. Could anyone help me please how can I do that.</p> <p>My effort is:</p> <pre><code>String lNumber = pCur.getString( pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); ContentValues values = new ContentValues(); Ur...
android
[4]
5,816,711
5,816,712
spliting java string based on bunch of non alpha characters
<p>I have a string some thing like <code>my+*%name===is+jhon!#and&amp;*^I$stay===in^&amp;$#@US</code>. I want output as </p> <pre><code>s[0]="my" s[1]="+*%" s[2]="name" s[3]="===" s[4]="is" s[5]="+" s[6]="jhon" s[7]="!#" s[8]="and" s[9]="&amp;*^" s[10]="I" s[11]="$" s[12]="stay" s[13]="===" </code></pre> ...
java
[1]
4,067,229
4,067,230
Is there another way to create an object with a classname returned by a method?
<p>I have this method : </p> <pre><code>public function getInstance() { $classname = $this-&gt;getFullyQualifiedClassName(); return new $classname(); } </code></pre> <p>Is there a way to write this without the <code>$classname</code> variable, which gets used only once?</p>
php
[2]
3,237,296
3,237,297
Why is UIApplicationWillChangeStatusBarFrameNotification not sent when the status bar changes height?
<p>I've been trying to listen for changes in the status bar height – such as when the in-call status bar is shown or hidden, or the same with the internet tethering status bar – by listening for the UIApplicationWillChangeStatusBarFrameNotification notification to be sent.</p> <p>Fairly straightforward code here...</p...
iphone
[8]
3,710,919
3,710,920
Not Adding Contents to New Line while writing to a file in Append Mode
<pre><code> &lt;?php if(isset($_POST['submit'])){ $file="get.php"; $open = fopen($file, "a+"); //open the file, (get.php). fwrite($open, "Name: " .$_POST['user'] . "/n"); //print / write the name. fwrite($open, "Colour: ". $_POST['color'] . "/n"); //print / write the colour. fclose($open); ...
php
[2]
1,251,583
1,251,584
starting text to speech engine from a service?
<p>i have a service from where i am trying to start a TextToSpeech engine ,but it seems that it's not working , so is it possible to start tts from a service?</p> <p>here's what i've tried:</p> <pre><code>package com.example.TextSpeaker; import java.util.Locale; import android.app.Service; import android.content.Int...
android
[4]
2,330,548
2,330,549
Using adapters for non-list views
<p>I am using a SimpleCursorAdapter to populate a ListView with items from my database. When a user clicks on an item it takes them to the detail Activity for that item. What is the best practice for displaying that page; just write a display function that grabs all the TextViews I want to set the text for and populate...
android
[4]
3,014,126
3,014,127
form is submitimg even I am using return false
<p>form is submitimg even I am calling return false my code</p> <pre><code>$(document).ready(function() { $('.submit').click(function() { $('.hour').each(function() { var $hours = $(this).val(); if ($hours == "") { alert(" Active Time is required"); ...
jquery
[5]
2,763,646
2,763,647
Move cursor to end of EditText?
<p>I'm replacing some text in an EditText, then I want to move the cursor to the end of the current text input. It kind of seems to work - when I start typing again, the cursor seems to be at the end of the EditText, but it doesn't flash / blink anymore. I have to touch the EditText again for the cursor to start blinki...
android
[4]
1,551,074
1,551,075
Regarding to save previous record in asp.net
<p>Hi I have one label for question, radiobuttonlist for their answers, next button to move next question &amp; previous button. I am displaying one question per page after clicking next button next question appears, but when i click previous button previous question appears. But i want previous question with earlier ...
asp.net
[9]