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 |
|---|---|---|---|---|---|
3,064,625 | 3,064,626 | Cloning objects of inner classes | <p>I have written a class A such as following</p>
<pre><code>class A <E> { // class A has objects of E
int x;
private B<T> next // a object of inner class
class B<T> {
// an inner class having objects of type T
T[] elements = (T[]) Object[x];
// has other stu... | java | [1] |
231,826 | 231,827 | Running multiple commands simultaneously from python | <p>I want to run three commands at the same time from python. The command format is query.pl -args</p>
<p>Currently I am doing </p>
<pre><code>os.system("query.pl -results '10000' -serverName 'server1' >> log1.txt")
os.system("query.pl -results '10000' -serverName 'server2' >> log2.txt")
os.system("quer... | python | [7] |
1,799,126 | 1,799,127 | How can I get the addition object for integers? | <p>Is there any way in Python to get the addition object (operator +) for integers in Python and store it somewhere? </p>
| python | [7] |
5,153,294 | 5,153,295 | Best approach avoid naming conflicts for javascript functions in separate .js files? | <p>Is there a preferred approach to isolating functions in a .js file from potential conflicts with other .js files on a page due to similar names?</p>
<p>For example if you have a function</p>
<pre><code>function AddTag(){}
</code></pre>
<p>in Core.js and then there is a </p>
<pre><code>function AddTag(){}
</code>... | javascript | [3] |
1,643,068 | 1,643,069 | Javascript JSON.parse or directly access | <p>When we can read a property directly from string:</p>
<pre><code>var data = {"id":1,"name":"abc","address":{"streetName":"cde","streetId":2}};
console.log(data.address.streetName); // cde
</code></pre>
<p>Why do people use <code>JSON.parse</code>:</p>
<pre><code>var obj = JSON.parse(data);
console.log(obj.address... | javascript | [3] |
5,784,006 | 5,784,007 | how can i change the image of Imageview[android] | <p>How can i change the image through Image view </p>
<p>plz help</p>
<p>thanks</p>
| android | [4] |
2,595,554 | 2,595,555 | match a list of words in a line using regex in python | <p>I am looking for an expression to match strings against a list of words like <code>["xxx", "yyy", "zzz"]</code>. The strings need to contain all three words but they do not need to be in the same order. </p>
<p>E.g., the following strings should be matched:</p>
<pre><code>'"yyy" string of words and than “zzz" stri... | python | [7] |
729,002 | 729,003 | how to get back to Activity from Activity called by startActivityForResult in the TabWidget? | <p>There is tabwidget as MainActivity with tab1 and tab2.
And, Activity1 is set to tab1as contentview, Activity2 is set to tab2.</p>
<p>User need to input information to use tab2 page.
So i want to call an Activity by startActivityForResult() . </p>
<p>My question is 'in this situation, how to get back to tab2 on tab... | android | [4] |
1,715,148 | 1,715,149 | PHP - Need help with some string functions | <p>I am trying to write a script to pull schedule data out of a database used at work.</p>
<p>The employees working times are stored daily as a string like this</p>
<pre><code>000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000000
</code></pre>
<p>Every character represents ... | php | [2] |
3,842,155 | 3,842,156 | python and %s | <p>What does %s mean in python? And does this bit of code translate to?</p>
<p>for instance... </p>
<pre><code> if len(sys.argv) < 2:
sys.exit('Usage: %s database-name' % sys.argv[0])
if not os.path.exists(sys.argv[1]):
sys.exit('ERROR: Database %s was not found!' % sys.argv[1])
</code></pre>
<p>Thank... | python | [7] |
3,354,117 | 3,354,118 | Determine HTML page that called a function in an external js file | <p>Is it possible to determine this at runtime?</p>
<p>contents of external.js:</p>
<pre><code>function x() {
//can i get the path/name of the html file that included this js file?
//which is test.html
}
</code></pre>
<p>contents of test.html</p>
<p>script src="external.js"</p>
| javascript | [3] |
2,933,236 | 2,933,237 | Is it possible to make a login programitically to twitter in android | <p>I want to make a login to twitter by myself programitically. Is it possible to make a login programitically to twitter by importing their jar files.</p>
<p>Please help me.</p>
<p>Thanks in advance .</p>
| android | [4] |
169,751 | 169,752 | Python - Print a string a certain number of times | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6293421/python-printing-multiple-times">Python, Printing multiple times,</a> </p>
</blockquote>
<p>I'd like to know how to print a string such as "String" 500 hundred times?</p>
| python | [7] |
3,304,402 | 3,304,403 | Apply fadein effect to tooltip? | <p>I have this code, which shows the tooltip within a box with the id of "tooltip-container" - currently it just pops in...how can I make it fade nicely and fade out on roll-off? </p>
<p>Current code:</p>
<pre><code>$(document).ready(function(){
$('.tippytrip').hover(function(){
var offset = $(this).offset();... | jquery | [5] |
1,687,105 | 1,687,106 | Returning the value that for statement prints | <p>I would like to return all the information as output that the for statement prints.</p>
<p>For instance:</p>
<pre><code>public static int countNumbers(int x) {
for (int i = 1; i <= x; i++) {
System.out.println(i);
}
return SOMETHING; // This something should be the values for statements pr... | java | [1] |
4,471,111 | 4,471,112 | Freezing Android APK version for older SDKs | <p>I understand how multiple APKs work on Google Play, but so far I've supported a single APK for V7 (2.1) and up. I'd like to start using Android 3.x-4.x+ features that could be more difficult to make backwards compatible, and I wouldn't mind not having to build in that growing compatibility library. But I still want ... | android | [4] |
5,053,714 | 5,053,715 | comma operator and comma seperator in c++ | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3128346/when-all-does-comma-operator-not-act-as-a-comma-operator">When all does comma operator not act as a comma operator?</a> </p>
</blockquote>
<p>when does comma(,) behave as operator and when does it behave... | c++ | [6] |
529,702 | 529,703 | Reducing similar commands | <p>How can I reduce the amount of similar commands into a loop?</p>
<p>Something like</p>
<pre>pictureBox7.BackColor = Color.FromArgb(187, 187, 187);
pictureBox9.BackColor = Color.FromArgb(187, 187, 187);
pictureBox10.BackColor = Color.FromArgb(187, 187, 187);
pictureBox11.BackColor = Color.FromArgb(187, 187, 187);
p... | c# | [0] |
1,098,303 | 1,098,304 | If module `example` contains both function `run` and submodule `run`, can I count on `from example import run` to always import the former? | <p>If I have a Python module implemented as a directory (i.e. package) that has both a top level function <code>run</code> and a submodule <code>run</code>, can I count on <code>from example import run</code> to always import the function? Based on my tests that is the case at least with Python 2.6 and Jython 2.5 on Li... | python | [7] |
1,373,985 | 1,373,986 | Table View Controller | <p>can u explain Table View Controller with sample code </p>
| iphone | [8] |
4,494,162 | 4,494,163 | regular expression sequence numbers 1 to 15 | <p>I need a way to use a regular expression to validate that numbers in a string are consecutive, from 0 to 9. For example:</p>
<ul>
<li>12345</li>
<li>1234567890</li>
<li>2345678</li>
<li>456789</li>
</ul>
<p>The maximum length of the string should be 5 characters.</p>
| javascript | [3] |
2,287,069 | 2,287,070 | Seeing the actual error behind ‘An unexpected error has occurred’ in Sharepoint 2010 | <p>In MOSS 2007, we could update the tag's callstack attribute to true and then customerrors mode to "Off" to see the actual error behind the 'An unexpected error has occurred' message. Does it apply on SharePoint 2010 as well ? I tried it but I get the following error:<BR><BR></p>
<p>Runtime Error
Description: An a... | asp.net | [9] |
523,781 | 523,782 | No new lines with custom text? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6756975/draw-multi-line-text-to-canvas">Draw multi-line text to Canvas</a> </p>
</blockquote>
<p>I'm trying to draw text to a canvas using a paint, and I've uploaded my own text tff file, and it works, but when ... | java | [1] |
4,428,081 | 4,428,082 | Android - Avoiding an activity to destroy, just stopping or pausing it when pushing the back button | <p>I would like to pausing or putting the application on background when pressing the back button, I don't want the application to go through the destroy state. Things are when I override onKeyDown and when I force to pause or stop the application by using onPause, I have some issuees with the wakelock and application ... | android | [4] |
284,220 | 284,221 | ImageView getting chopped off in relative layout, while performing transalate animation | <p>from many days i have stuck up in the following problem. </p>
<p>I am translating an imageView which is present in child relative layout from bottom to top. Translate animation is working fine, but the problem is "An imageView <code>android:id="@+id/img_weasel"</code> gets CHOPPED OFF" when it crosses its relative... | android | [4] |
386,618 | 386,619 | Is an UIApplication object, UIWindow object, UIView object or any UIView subclass an "Responder object"? | <p>Am I right with my understanding, that an UIApplication object, UIWindow object, UIView object or any UIView subclass is an "Responder object"?</p>
<p>Here they say:</p>
<blockquote>
<p>Responder objects in an application
include instances of UIApplication,
UIWindow, UIView, and all UIView
subclasses.</p>
... | iphone | [8] |
4,930,031 | 4,930,032 | audio pitch change in android | <p>I am developing a sound related application. I am trying to change the audio sound in to completely different like robot sound or make the audio echo. I tried with soundpool , but no any idea, anyone knows how to achieve that? i need only a basic idea to achieve this, please help. many thanks.</p>
| android | [4] |
1,107,345 | 1,107,346 | How to do multiline strings? | <p>I am wondering how can you do multi line strings without the concat sign(+)</p>
<p>I tried this</p>
<pre><code> string a = String.Format(@"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
{0}xxxxxxx", "GGG");
string b = @"zzzzzzzzzzz... | c# | [0] |
3,116,419 | 3,116,420 | Android title bar removal | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2445999/what-do-i-have-to-add-to-a-layout-to-hide-the-titlebar">What do I have to add to a layout to hide the titlebar?</a> </p>
</blockquote>
<p>How do I remove the title below the battery, time bar from showin... | android | [4] |
4,847,280 | 4,847,281 | store each value of foreach loop into string array | <p>how I need to store each values of a foreach loop into an string array.</p>
<pre><code>string [] elements = new string [3];
foreach(xmlnode anode in somecollection)
{
//here i need to set the string array for each element of SomeCollection.
}
</code></pre>
<p>thanks </p>
| c# | [0] |
4,738,170 | 4,738,171 | Putting a Background Image behind TabWidget | <p>I have a custom TabView, what I wanna do is to put a background image behind my Tabs. So the background image will behave like a frame for the Tabs. The tabs will stay in the middle of the background. With the code I have below, my TabWidget is just covering the background image.</p>
<p>How am I able to achieve tha... | android | [4] |
3,244,912 | 3,244,913 | How to impersonate a user for a short period to access a page/file? | <p>I'm using FormsAuthentication to allow users to login. However I have a Excel file that gets generated in memory by one of my pages, for example when they go to:</p>
<p><a href="http://www.mywebsite.com/report?date=050809" rel="nofollow">http://www.mywebsite.com/report?date=050809</a></p>
<p>This generates an Exce... | asp.net | [9] |
1,819,515 | 1,819,516 | Determine which browser is being used to visit my site | <p>Can someone tell me how I can determine (using JavaScript etc.) what browser is being used to visit my site?</p>
<p>I want to redirect to a different page based on these scenarios:</p>
<ul>
<li>Wheater the user is browsing using Safari on the iPhone.</li>
<li>Using IE on a desktop</li>
<li>Using IE on a WP7 mobile... | javascript | [3] |
5,641,491 | 5,641,492 | Py_Initialize and Py_finalize and MatPlotlib | <p>This is a known problem, but I want to ask the experts for the best way to solve it for me. </p>
<p>I have a project (Euler Math Toolbox), which runs Python as a script language. For this, a library module "python.dll" is loaded at run time, which is linked against "python27.lib". Then Py_Initialize is called. This... | python | [7] |
281,140 | 281,141 | calling a unix exectuable via a java enterprise application | <p>can a java application call a unix executable written in c++? basically i have written code in unix in c++ and shared the executable with a couple of companies. All is well save for this on e company that is using java under a linx platform. would it not be possible for them to just call my executable from their jav... | java | [1] |
2,607,288 | 2,607,289 | Set folder browser dialog start location | <p>Is there any way to set the initial directory of a folder browser dialog to a non-special folder? This is what I'm currently using<pre><code>fdbLocation.RootFolder = Environment.SpecialFolder.Desktop;</code></pre> but I want to use a path I have stored in a string something like this<pre><code>fdbLocation.RootFolde... | c# | [0] |
798,231 | 798,232 | how to fix 'T' is a 'type parameter' but is used like a 'variable' compile error | <p>I need to check if a generic type parameter <code>T</code> is <code>MyEntity</code> or a subclass of it.</p>
<p>Code below causes this compiler error:</p>
<pre><code>'T' is a 'type parameter' but is used like a 'variable'
</code></pre>
<p>how to fix?</p>
<pre><code>public class MyEntity { }
static void Test<... | c# | [0] |
1,476,750 | 1,476,751 | Android vs other mobiles | <p>1.How to upgrade latest version of android os on android phones?</p>
<p>2.Is it possible to upload android applications to other mobiles?</p>
<p>Thanks for ur precious time!..</p>
| android | [4] |
2,856,041 | 2,856,042 | Timeout in Dropdown selectindex changed event | <p>I have built one web application and in that i had bound drop down with 10K records and when i will change index then i will get page timeout error!!</p>
<p>can anyone suggest me the cause of this problem?</p>
| asp.net | [9] |
3,363,696 | 3,363,697 | What are Nullable Types in C#? | <pre><code> int? _fileControlNo = null;
public int? FileControlNo
{
get { return _fileControlNo; }
set { _fileControlNo = value; }
}
</code></pre>
<p>I'm getting a syntax error when I assign null values to the above properties.</p>
<pre><code>objDPRUtils.FileControlNo =sArrElements.Value(... | c# | [0] |
1,528,388 | 1,528,389 | Where can we use Object.clone() method in java? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2326758/how-to-properly-override-clone-method">How to properly override clone method?</a> </p>
</blockquote>
<p>Can anyone give me any example where we can use the same?</p>
| java | [1] |
1,103,408 | 1,103,409 | php - generate non linear urls | <blockquote>
<p><strong>Update:</strong></p>
<p>Ok.. I have read a lot of solutions...
Thank you so much everybody. I think I
will keep it simple and avoid the
encryption and just rely on two fields
matching in the database. I can keep
the id as it is (sequential) but add
for example a timestamp (wit... | php | [2] |
2,090,090 | 2,090,091 | Ellipsize works with hint, but not with text | <p>I have a custom edittext and I'm having some problems with the ellipisze.</p>
<p>My edittext is build programmatically and has the following attributes:</p>
<pre><code>setSingleline(true);
setInputType(InputType.TYPE_NULL);
setCursorVisible(false);
setEllipsize(TruncateAt.END);
setText(com.telecomIT.digicare.R.str... | android | [4] |
4,387,403 | 4,387,404 | Mongoose Embedded Webserver | <p>This code is taken from the example program in Mongoose embedded web server. </p>
<p>The event MG_NEW_REQUEST is called twice. Is this the expected behavior? Why would it process the same request twice? How would you prevent this from doing so?</p>
<pre><code>int i =0;
static void *callback(enum mg_event event,
... | c++ | [6] |
3,611,733 | 3,611,734 | javascript Array comparision to check weightage is 100 or not for same program | <p>i have 2 arrays as bellow</p>
<p>1)ProgramId(numeric)<br>
2)Weightage(numeric)<br>
How to check,for the same programid weather weightage of that programid is 100 or not ie </p>
<p><strong>ProgramId</strong><br>
2<br>
2<br>
3<br>
3<br>
2<br>
4<br>
<strong>Weightage</strong><br>
25<br>
25<br>
30<br>
70<br>
50<br>... | javascript | [3] |
2,361,102 | 2,361,103 | How to map between android.os.Build values to retail device names? | <p>My android application records logs of connected devices, with infos such as:</p>
<ul>
<li>android.os.Build.MANUFACTURER</li>
<li>android.os.Build.DEVICE</li>
<li>android.os.Build.MODEL</li>
<li>more...</li>
</ul>
<p>On top of that, I use <a href="http://code.google.com/p/acra/" rel="nofollow">ACRA</a> to log cras... | android | [4] |
4,355,742 | 4,355,743 | Input parameters in java | <p>I was wondering why do Java programs take parameters only in the form on Strings from the command line when they are run? I have <a href="http://stackoverflow.com/questions/10183611/using-int-instead-of-string-public-static-void-main-int-args">read</a> that if the parameters are declared as int, it still converts th... | java | [1] |
4,903,757 | 4,903,758 | Android MapView: animateTo doesnt work while map is panning | <p>The code below does the following:
When checking the "focus" checkbox, the map animates to the single overlay item in the map.
There is one problem:
When i drag the map so that the map is still moving when I check the checkbox, the checking has no visual effect.
Any ideas?</p>
<pre><code>List<Overlay> mapOver... | android | [4] |
4,577,183 | 4,577,184 | Checking the size of file before uploaing it | <p>Is there is any way to check file size before uploading it using javascript?</p>
| javascript | [3] |
1,021,845 | 1,021,846 | Just one PHP page won't run - it wants to download | <p>All PHP pages are all running just fine on my site, except for one for which Firefox says "You have chosen to open checkpage.php which is a PHP script" and then wants me to select an application with which to open it.</p>
<p>The site is running PHP Version 5.2.10 on Centos 5.5.</p>
<p>I'm using exactly the same co... | php | [2] |
4,593,662 | 4,593,663 | Generic Interface with property | <p>i have one interface </p>
<pre><code>/// <summary>
/// Summary description for IBindable
/// </summary>
public interface IBindable<T>
{
// Property declaration:
T Text
{
get;
set;
}
}
</code></pre>
<p>Now i want to implement this interface in my class </p>
<pre><c... | c# | [0] |
3,288,985 | 3,288,986 | Get the dynamic height of a clone object | <p>In jQuery, I would like to get the height of a clone object BEFORE it is appended to the body.</p>
<p>Note: I didn't specify the width and height in CSS (this is the requirement).</p>
<p>Is it possible?</p>
<pre><code><body>
<style>.square {}</style>
<script>
jQuery(function($) {
var... | jquery | [5] |
209,754 | 209,755 | Scrollview is bouncing back. Intersting issue | <p>I have a app where in once I tap on a textfield it slides on top of keyboard.</p>
<p>My scrollview is bouncing back when I scroll down my content. iPhone documentation says "by default, it “bounces” back when scrolling exceeds the bounds of the content." </p>
<p>Any clue how to get rid of this? Should I increase t... | iphone | [8] |
4,689,059 | 4,689,060 | jquery load data | <p>dumbest question ever... but I want to somehow fill 'gid' value in data load</p>
<pre><code>gid = 123;
from = 33;
to = 44;
$('#x').load('y', {'range['+gid+'][]' : [from , to]});
</code></pre>
<p>so I could get</p>
<pre><code>[range] => Array
(
[123] => Array
(
... | jquery | [5] |
3,408,270 | 3,408,271 | Using a button to open a link in a new tab/window in ASP.NET | <p>I’m trying to use a button click to open a page in a new tab/window. I’ve looked at solutions similar to <a href="http://stackoverflow.com/questions/6248702/redirecting-new-tab-on-button-click-response-redirect-in-asp-net-c-sharp">this</a>, but the answers given there are either to use a link or have it open in the... | asp.net | [9] |
4,665,335 | 4,665,336 | Doubts with destructor | <p>Suppose I have a class:</p>
<pre><code>class ClassX{
private:
int* p;
int i;
....
}
</code></pre>
<p>And somewhere I do:</p>
<pre><code>ClassX x;
.....
//and in a friend function or in a ClassX function
p = (int*) malloc (.....);
</code></pre>
<p>Then when <code>x</code> exit its scope a the de... | c++ | [6] |
2,162,871 | 2,162,872 | How do I extract the middle name from the full name? | <p>My program is supposed to extract the middle name of a full name. I have another method and I can't call it properly in my main method. The code is working if it is in the main method, but it doesn't work in the other method; I assume the problem is when calling the method. I am using Eclipse.</p>
<pre><code>import... | java | [1] |
46,048 | 46,049 | How to select a row with particular class name in JQuery | <p>I have a table as follows </p>
<pre><code><table>
<tr>
<td id="start">Starting Point<input type="button" value="start the test" onclick="get_the_next()" /></td>
</tr>
<tr>
<td>not the right class - skip me</td>
</tr>
<... | jquery | [5] |
4,543,895 | 4,543,896 | what is the difference between response.redirect and response status 301 redirects in asp? | <p>Our asp application is moving to new server and i want to implement a permenant url redirection. I am aware of following two approaches , i need to understand which one to user over other and when ?</p>
<p>Option 1:</p>
<pre><code><%@ Language=VBScript %><% Response.Redirect "http://www.example.com" %>... | asp.net | [9] |
4,410,156 | 4,410,157 | iterator for map - problem with searching | <p>hello i got an iterator running on a multimap ,my multimap includes two fields the first 1 is the key value which is a string Lastname and the second 1 is the data which is a pointer to an object called Employee.
in my program i need to be able to find an element inside my map using iterator (cause i am trying to fi... | c++ | [6] |
4,024,045 | 4,024,046 | What C# data store should I use? | <p>I am trying to create a test framework and not sure what is best to use to store test case names and data that will be provided in XML file. For example, I want to test printer functionality so it has constructor, open printer connection, send data to printer, close printer connection. So the XML would be:</p>
<p... | c# | [0] |
3,480,210 | 3,480,211 | Refresh NSTableView After Click - Not Refreshing | <p>I have an app with a UITableView, using both icons and disclosure buttons. I want to update the icon on a row with a "selected" icon, and update the previously-selected row with an "unselected" icon. I have the code in place, but when I click on the rows, it sets both rows to the "selected" state, even though via ... | iphone | [8] |
690,336 | 690,337 | Obscure JavaScript syntax | <p>...obscure to me, anyway. Can anyone tell me what this means? I have various bits of code that look like this:</p>
<pre><code>node[foo](bar, function() {
...do something to 'node'
});
</code></pre>
<p>'node' is a single DOM node. 'foo' and 'bar' are both strings, though the code sets 'bar' to a boolean occasio... | javascript | [3] |
3,133,731 | 3,133,732 | Change Default Contact Manager to My own | <p>I writing a contact manager for android and I want to know how can I change default contact manager to my own program?</p>
| android | [4] |
1,357,905 | 1,357,906 | Javascript multitouch lib | <p>I need to implement application for multitouch devices (mobile and desktop) with JavaScript. There will be ability to manipulate elements and multiple users should be able manipulate elements in same time. But all libs I tried don't allow to do this, and I unable to manipulate multiple elements simultaneously.
Could... | javascript | [3] |
4,337,764 | 4,337,765 | How to make unix timestamp to show time over 24 hours? | <p>I would like to show any give time in hours only.</p>
<p>Example:</p>
<p>Unix timestamp: 169200</p>
<p>Which is equal to 1 day and 23 hours...</p>
<p>But how can I convert this to hours so it shows 47:00:00 (47 hours)?</p>
<p>Thanks</p>
<p><strong>Edit</strong>: It must show minutes and seconds too ;)</p>
| php | [2] |
4,373,042 | 4,373,043 | should I detach action after attaching? | <p>I'm attaching action like that in constructor:</p>
<pre><code>model.DataArrived += new Action<List<ConsoleData>>(model_DataArrived);
</code></pre>
<p>Should I detach it in <code>OnDispose</code>? Is it ok to create a new instance like that?</p>
<pre><code>protected override void OnDispose()
{
... | c# | [0] |
5,766,051 | 5,766,052 | Can we write a program without a class in core Java? | <blockquote>
<p>Every Java program requires the
presence of at least one class.</p>
</blockquote>
<p>Is the above statement always true ?</p>
| java | [1] |
2,719,811 | 2,719,812 | Can i retrieve the current telephone number? | <p>I'm writing an app for android (2.1+) and I'd like to use the telephone number of the current phone.
Lots of googling brought me the following:</p>
<pre><code>String number=(TelephonyManager)getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE).getLine1Number();
</code></pre>
<p>That along with permi... | android | [4] |
3,274,442 | 3,274,443 | python logic error | <p>please help me figure out what is wrong with this code; the first function works fine
but the second one returns the wrong number. what the second variable is sup post to return is the remainder of minutes passed since midnight. </p>
<pre><code> def get_hours(s):
time=s/3600
return time
#The get_hour func... | python | [7] |
871,078 | 871,079 | Share text/image to QQ app | <p>My app needs to share text/image to QQ app (this app here <a href="https://itunes.apple.com/jp/app/qq-ri-ben-ban/id526025182" rel="nofollow">https://itunes.apple.com/jp/app/qq-ri-ben-ban/id526025182</a>, <a href="http://www.imqq.jp/sp/" rel="nofollow">http://www.imqq.jp/sp/</a>), please help me. I'm thinking about u... | iphone | [8] |
2,122,932 | 2,122,933 | Java Exception handling | <p>I would like to know what happens in java if a method call signature has a exception but there is no try catch block in the method
what happens when a exception happens at runtime.</p>
<pre><code>public void someMethod (Collection<file> files) throws Exception
for(File f : files) {
process(f);
}
</c... | java | [1] |
5,022,358 | 5,022,359 | PHP if function | <p>I am using php mail to send the data via email.</p>
<p>In my mail script I need to add an if script.</p>
<p>I need it to be :
If choice1 is empty then do not display the </p>
<pre><code>$message .= "<tr><td><strong>Choice1(main):</strong> </td><td>" . $_POST['choice1'] . "</... | php | [2] |
2,155,569 | 2,155,570 | Should I learn/become proficient in Javascript? | <p>I am a .NET webdev using ASP.NET, C# etc... I "learned" javascript in college 5+ years ago and can do basic jobs with it. But I wonder if it is useful to become proficient in it.</p>
<p>Why should I learn Javascript?
Is it more advantageous then learning JQuery or a different <a href="http://stackoverflow.com/quest... | javascript | [3] |
528,423 | 528,424 | Displaying activity with blur effect in Android Tabs | <p>I have a tab bar in my application, with third tab named About. When user clicks on this About tab, I want activity to be displayed with blur effect. More specifically, About activity should be on front, while previous tab should be displayed behind with blur effect. I did the following code in the about.java onCrea... | android | [4] |
316,847 | 316,848 | Javascript function aliasing without .apply | <p>I read <a href="http://stackoverflow.com/questions/1007340/javascript-function-aliasing-doesnt-seem-to-work">this</a>, and I understand it, but, is there a way to attach a function to always execute a function alias on a specific scope, without the user of the function alias have to use the sort of clunky .apply stu... | javascript | [3] |
1,328,531 | 1,328,532 | Page redirect query | <p>When my user enters their email and password into a form on login.php, the form action uses the below code to make sure they are a valid user, and that neither of the fields are blank. My problem is that even when valid email and password is used the user is directed back to the login.php page instead of the logged_... | php | [2] |
2,890,189 | 2,890,190 | Is this bad practice: getMyObject().method() | <p>Suppose I have a function which returns an object :</p>
<pre><code>getMyObject(){
//do stuff here
return object;
}
</code></pre>
<p>Is it bad practice to call a method (that doesn't return anything) on the function name itself:</p>
<pre><code>getMyObject().method();
</code></pre>
<p>instead of assigning a ... | javascript | [3] |
546,222 | 546,223 | opening a html page on the client from server side | <p>On the server I receive xml from a webservice, I use xslt transformation on this xml to create a htm page. Now I need to show this htm page to the user by opening it in a new browser window. How do I achieve such functionality? My website is written in ASP.NET.</p>
<p>I have tried using</p>
<p>Response.Write("");
... | asp.net | [9] |
4,059,317 | 4,059,318 | Using Interface variables | <p>I'm still trying to get a better understanding of Interfaces. I know about what they are and how to implement them in classes.</p>
<p>What I don't understand is when you create a variable that is of one of your Interface types:</p>
<pre><code>IMyInterface somevariable;
</code></pre>
<p>Why would you do this? I ... | c# | [0] |
2,747,532 | 2,747,533 | Why does casting a function to a function type that is identical except for return type fail? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/290038/is-the-return-type-part-of-the-function-signature">Is the return type part of the function signature?</a> </p>
</blockquote>
<p>Following up on a related but tangential question ( <a href="http://stackove... | c++ | [6] |
1,819,194 | 1,819,195 | How the Android system starts the main activity when the application launcher is clicked? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8515936/android-activity-life-cycle-difference-between-onpause-and-onstop">Android Activity Life Cycle - difference between onPause() and OnStop()</a> </p>
</blockquote>
<p>What happend when the application laun... | android | [4] |
3,586,972 | 3,586,973 | How can I sort an array returned from File.ReadAllLines on an alphabetical member? | <p>I am reading a .csv file and returning its lines in string array. One of the members is manufacturer, for which I have Toyota, Ford, etc.</p>
<p>I want to sort an array (Can be another collection) of the rows, by the value in manufacturer and alphabetical order.</p>
<p>So I'd have:</p>
<pre><code>28437 Ford Fiest... | c# | [0] |
1,801,777 | 1,801,778 | php - smtp server | <p>I am working on a project. For that i have downloaded smtp server on ubuntu. Could any one please tell me the command to check whether the smtp server install properly or not. because email is not getting generated.</p>
<p><strong>Below is the code for your reference</strong></p>
<pre><code><?php
ini_set('disp... | php | [2] |
3,349,256 | 3,349,257 | add new element at the beginning of a JSON | <p>I have this JSON:</p>
<pre><code>var myVar = {
"9":"Automotive & Industrial",
"1":"Books",
"7":"Clothing"
};
</code></pre>
<p>I want to add a new element at the beginning, I want to end up having this:</p>
<blockquote>
<pre><code>var myVar = {
"5":"Electronics",
"9":"Automotive & ... | javascript | [3] |
4,769,347 | 4,769,348 | Passing parameters in jQuery | <p>What i have is working, so I'm just asking if there's a more elegant way to do this. I have:</p>
<pre><code><form method="post" action="15Action.cfm">
<p><input id="A" name="A1"></p>
<p><input id="B" name="B1"></p>
<p><input id="C" name="C1"></p>
<inpu... | jquery | [5] |
3,689,224 | 3,689,225 | How to programmatically open "Access Point Names" screen in Android? | <p>How to open that page?
Wireless & Networks -> Mobile Networks -> Access Point Names</p>
<p>Please provide the sample code for this</p>
| android | [4] |
4,388,373 | 4,388,374 | How to identify that the given string ends with newline or not | <p>In java how to identify that the provided string ends with newline character or not?</p>
| java | [1] |
501,552 | 501,553 | MediaMetadataRetriever extractMetadata method returning null | <p>I am using MediaMetadataRetriever class to get metadata about a video but while getting the information about the height it is returning null and for width it is returning zero.
Here is my code:</p>
<pre><code>MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
String width = metaRetriever.extract... | android | [4] |
521,904 | 521,905 | javascript event | <p>I have an interesting question, i hope..I have a textarea in my form..when a user comes to enter values in it it displays some cached values in an autocomplete format..thats fine..I want to call an ajax function after the user selects such a cached value in it..so that the ajax call should pass this selected value..... | javascript | [3] |
5,434,476 | 5,434,477 | C++ interview question involving class pointers | <p>Lets say there is a base class pointer which is pointing to a base class object:</p>
<pre><code>baseclass *bptr;
bptr= new baseclass;
</code></pre>
<p>now if i do </p>
<pre><code>bptr= new derived;
</code></pre>
<p>what is the problem here?</p>
| c++ | [6] |
174,913 | 174,914 | how to remove the bluetooth module from android | <p>I have a device which runs android 4.1.
But the device does not have a bluetooth, so I want to remove bluetooth related items from the 4.1 platform (like sharing menu, setting items which contain "bluetooth ").</p>
<p>but it seems a miscellaneous work ( settings, filesharing , ).</p>
<p>Is there any method that c... | android | [4] |
1,976,447 | 1,976,448 | Accessing data from text box | <pre><code>function testTask06()
{
var cipherText = document.getElementById('cipherTextBox').value;
var indexCharacter = document.getElementById('indexCharacterTextBox').value;
document.getElementById('plainTextBox').value = (decryptMessage(cipherText, indexCharacter, plainArray, cipherArray));
}
</code></p... | javascript | [3] |
2,381,863 | 2,381,864 | In Python, what's the best way to get the closest integers for two dimensions? | <p>I have a list of 2 dimensional tuples, unsorted, and of <code>n</code> size. I want to find which tuple has the closest dimensions to X and Y. What's the best way to do this?</p>
<pre><code>target = (75, 75)
values = [
(38, 61),
(96, 36),
(36, 40),
(99, 83),
(74, 76),
]
</code></pre>
<p>Using t... | python | [7] |
2,391,919 | 2,391,920 | Android system / system context / replace classes | <p>Hi I'm engineer but more from a chip/assembler x86 level. I'm new to Android. Still figuring some general things out. I have written some apps, but have a general question. If I were to write an improved version of - let's say - TextView. Is it possible to make all app's on the system using this class, basically rep... | android | [4] |
3,096,063 | 3,096,064 | Declaring class object datatypes | <p>I have a class <code>Foo</code> which contains a datamember of type <code>Bar</code>. I can't make a generalized, "default" <code>Bar.__init__()</code> - the <code>Bar</code> object is passed into the <code>Foo.__init__()</code> method. </p>
<p>How do I tell Python that I want a datamember of this type? </p>
<pre>... | python | [7] |
2,952,889 | 2,952,890 | How to open a particular contact number's call history activity in android? | <p>I am developing an android application which shows call logs and messages in a tab view. I just want to show the particular contact number's default call history activity on clicking of a contact in my application. I know how to show the all call logs activity using intent, but didn't get any example or trick to sho... | android | [4] |
2,322,985 | 2,322,986 | Is it possible in c++ to forbid calling a certain function at compile time? | <p>I have 2 classes:</p>
<pre><code>class Entity {
void addChild(Entity* e);
};
class Control : public Entity {
};
</code></pre>
<p>What I want to do is to not allow adding a Control as a child of something that's not a Control. So, for example:</p>
<pre><code>Control c;
Entity e;
e.addChild(c); // This line wo... | c++ | [6] |
2,752,938 | 2,752,939 | How to make jQuery selector run faster or run it in chunks | <p>I have a simple jQeury code that runs on a web page that has more than 50,000 lists of people. On IE I get the message that a script is taking too long. I would like to get rid of that annoying popup in IE.</p>
<p>If I need to add 50,000 DOM elements then I could use timer to defer work in chunks. I am not sure if ... | jquery | [5] |
5,719,867 | 5,719,868 | Start fading object after it has passed X miliseconds along animation | <p>I have an object animating, which I would like to start fading out, after a certain period of time. In other words, as an object moves from the top to the bottom of the screen, at about 75% of the way it starts to fade out.</p>
<p>For example, my function is so far:</p>
<pre><code>function parachute_drop(drop_obje... | jquery | [5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.