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 |
|---|---|---|---|---|---|
1,666,511 | 1,666,512 | Saving a file to the external temp dir from R.raw.some_file.m4a | <p>I need to be able to save a file to the external storgage temp dir. The file I am saving though is the R.raw directory of my app. </p>
<p>I have used this example here.
<a href="http://stackoverflow.com/questions/6979521/move-raw-file-to-sd-card-in-android">Move Raw file to SD card in Android</a></p>
<p>The issue... | android | [4] |
5,518,848 | 5,518,849 | Increasing the scope of object from local scope | <p>I want to create an object using a method but I want it (object+reference) to live even after the method ends. Example of code:</p>
<pre><code>public class start{
public static void main (String [] Args){
public void createObject(){
object1 createdObject = new object1();
}
createObject();
createdObject.... | java | [1] |
5,769,207 | 5,769,208 | Get html file Java | <h3>Duplicate:</h3>
<blockquote>
<p><a href="http://stackoverflow.com/questions/238547/how-do-you-programmatically-download-a-webpage-in-java">How do you Programmatically Download a Webpage in Java?</a></p>
<p><a href="http://stackoverflow.com/questions/31462/how-to-fetch-html-in-java">How to fetch html in Java... | java | [1] |
2,161,609 | 2,161,610 | C# - threadPool.SetMaxThreads returning false | <p>Wondering if you can help!</p>
<p>My understanding of SetMaxThreads() in C# was that it can not be set to less than the number of processors.</p>
<p>But in my code I am unable to set the number to less than 8, I have no idea why this is.</p>
<p>If I set it to lower it returns false!</p>
<p>(Running an Intel Core... | c# | [0] |
8,867 | 8,868 | Php shopping cart | <p>When we write a shopping cart, should we save cart info in the database with session id or should we save only session variables? Why?</p>
| php | [2] |
3,225,906 | 3,225,907 | displaying photo? | <p>I was trying to do this in an alert box only to find out that I can't now. I cannot manage to get this to display at all. Instead of the variable I get <code>[object HTMLImageElement]</code>. I am missing something but what is it? </p>
<pre><code>function joePic(){
var joe_fat = new Image;
joe_fat.src = "p... | javascript | [3] |
5,101,074 | 5,101,075 | What happens if sdk's are missing - (advert aggregation) | <p>There are some mobile advertising aggregators (mopub for example) that insist on apps including the sdk's (which, correct me if I'm wrong, means jar files) of each separate ad network that they are aggregating.</p>
<p>One thing that has always bothered me is what would happen if I forgot to include one of the jar's... | android | [4] |
1,991,602 | 1,991,603 | Is it possible to take a table layout with images for a photo gallery and re-code to be a ul? | <p>I have a table layout with the following code</p>
<pre><code><table cellspacing="0" class="photogalleryTable">
<tbody>
<tr>
<td class="photogalleryItem"><a title="" href="/images/varsity_basketball/alexdefending.jpg" rel="lightbox[12828]" onclick="myLightbox.start(this);return false;">... | jquery | [5] |
327,429 | 327,430 | i don't know the error in my program>>>>> java | <pre><code> public class Assign2Shape
{
private String nameOfShape;
public void setNameOfShape(String theNameOfShape)
{
nameOfShape = theNameOfShape;
}
public String getNameOfShape()
{
return nameOfShape;
}
public Assign2Shape()
{
nameOfShape = "n... | java | [1] |
291,001 | 291,002 | Android UI elements for messaging i.e like Google Talk | <p>Are there specific UI elements for messaging within android apps? For example the elements used in the Google Talk app. </p>
<p>Thanks</p>
| android | [4] |
2,781,002 | 2,781,003 | integer part of the root withot using functions | <p>The calculation of the integer part of the square root of a number can be done by trial and error, starting from 1, by executing the square until the result is less than or equal to the starting value of which is calculated by the root.</p>
<p>The following program returns the integer part of the root</p>
<pre><co... | python | [7] |
4,177,189 | 4,177,190 | Java issue with var-args and boxing | <p>I have a question related to the following code snippet:</p>
<pre><code> class VarArgsTricky {
static void wide_vararg(long... x) {
System.out.println("long...");
}
static void wide_vararg(Integer... x) {
System.out.println("Integer...");
}
public static void main(String[] a... | java | [1] |
412,394 | 412,395 | Need help with my first python script | <p>So I've read a few books on python but I'm still really in the dark about how python works over tcp/ip etc. I've been trying to randomly read different modules that supposedly have support for this kind of thing but it's all incomprehensible jargon to me.</p>
<p>Here's what I'm trying to do:
HOST program, when it r... | python | [7] |
1,262,200 | 1,262,201 | Pass variable to a class which extends another one | <p>I'm using tFPDF class.</p>
<p>I'm extending this class using this code to get custom Header and Footer</p>
<pre><code>class PDF extends tFPDF{
function Header(){
$this->Image('../../images/logo-admin.png',10,6,30);
$this->SetFont('DejaVu','',13);
$this->Cell(247,10,$produto,0,... | php | [2] |
2,990,219 | 2,990,220 | to find the angle for cosine! vector products | <p>I am looking for an answer to find an angle-alpha for cosine. </p>
<pre><code>cos(alpha)=RT(vector).R(vector)/(modulus)RT(vector).(modulus)R(vector)
</code></pre>
<p>then I should need to find the angle alpha.</p>
<pre><code>public double dot1(double[] vectorA, double[] vectorB){
double[] vecPro;
... | java | [1] |
3,078,809 | 3,078,810 | open() function python default directory | <p>I'm new and I have no idea where the default directory for the <code>open()</code> function is.</p>
<p>For example <code>open('whereisthisdirectory.txt','r')</code></p>
<p>Can someone advise me? I've tried googling it (and looking on stackoverflow) and even putting a random txt file in so many folders but I still ... | python | [7] |
4,904,960 | 4,904,961 | Folder check in javascript | <p>How to check whether a folder exists or not using Javascript?</p>
<p>Thanks,
Karthick</p>
| javascript | [3] |
154,076 | 154,077 | Is it possible to create a struct type based on file contents? | <p>Is it possible in C++ to create a struct type based on file contents?</p>
<pre>
STRUCT_NAME
int var1;
int var2;
string v3;
STRUCT NAME *pointer;
</pre>
<p>The first line would be the name of the struct, the other lines would be the variables</p>
| c++ | [6] |
5,792,226 | 5,792,227 | PregMach with php GET method | <p>I have a page test.php in which I have a list of names:</p>
<pre><code>name1='992345'
name2='332345'
name3='558645'
name4='434544'
</code></pre>
<p>In another page <code>test1.php?id=name2</code> and the result should be:</p>
<blockquote>
<p>332345</p>
</blockquote>
<p>I've tried this PHP code:</p>
<pre><code... | php | [2] |
2,017,116 | 2,017,117 | How to avoid call-time pass-by-reference deprecated error in PHP? | <p>I'm trying to <strong>reduce the warnings</strong> that are sent to my apache server log.</p>
<p>One warning is:</p>
<blockquote>
<p>Call-time pass-by-reference has been deprecated.</p>
</blockquote>
<p>It is <strong>hard for me to imagine</strong> why this was deprecated since it is such a useful programming f... | php | [2] |
951,351 | 951,352 | If option selected do this or this on form | <p>I have the following options:</p>
<pre><code><li><label for="r1"><input type="radio" name="post_category" id="r1" value="12" checked="checked" /> Share an Article</label></li>
<li><label for="r4"><input type="radio" name="post_category... | php | [2] |
5,481,725 | 5,481,726 | Why include when you can require in PHP? | <p>What is the point of attempting to <code>include</code> or <code>include_once</code> a library in PHP if you often have to use <code>require</code> or <code>require_once</code> instead (as they're usually critically important)?</p>
| php | [2] |
993,068 | 993,069 | Javascript: Hijack Copy? | <p>I was just reading the Times online and I wanted to copy a bit of text from the article and IM it to a friend, but I noticed when I did so, it automatically appended the link back to the article in what I had copied. </p>
<p>This is not a feature of my IM client, so I assume this happened because of some javascrip... | javascript | [3] |
2,114,914 | 2,114,915 | function template overloading | <p>Can anybody summarize the idea of function template overloading? What matters, template parameter or function parameter? What about the return value?</p>
<p>For example, given a function template </p>
<pre><code>template<typename X, typename Y> void func(X x, Y y) {};
</code></pre>
<p>what's the overloaded... | c++ | [6] |
1,356,984 | 1,356,985 | How can I map an integer value to a string more easily in PHP? | <p>How can I re-factor the following code to make it more concise and more maintainable? </p>
<pre><code>if ($row['vocation'] == 1) $vocation = "sorcerer";
if ($row['vocation'] == 2) $vocation = "druid";
if ($row['vocation'] == 3) $vocation = "paladin";
if ($row['vocation'] == 4) $vocation = "knight";
if ($row[... | php | [2] |
2,515,080 | 2,515,081 | Display a number from array in PHP | <p>Hello I would like to have a code that displays randomly from an array a number and displays it.
For example this code</p>
<pre><code><?php
$firstquarter = array(1 => 'January', 'February', 'March');
print_r($firstquarter);
?>
</code></pre>
<p>will return</p>
<pre><code>Array
(
[1] => January
... | php | [2] |
2,759,865 | 2,759,866 | How to minimize application to tray by using command line argument | <p>How can i minimize application to system tray by using command line argument.</p>
<p>eg:when i open my application using command line like this.
c:\myfile.exe totray</p>
<p>i writed some code for that but it never worked.</p>
<pre><code>static void Main(string[] args)
{
Application.EnableVisua... | c# | [0] |
5,315,731 | 5,315,732 | Why are parentheses used when declaring a textview | <p>I'm fairly new to android. I've got experience with c# and java but I can't figure this out.</p>
<p>I know how to use it. I've written a couple apps already. It's probably really simple but I don't understand this. Why is (TextView) in parentheses.</p>
<p>I've searched the sdk documentation and afaik it doesn'... | android | [4] |
2,578,149 | 2,578,150 | Can i use activities for all my layouts for any application? | <p>I am beginner in android application development.
If i am using n number of layouts in my project and i need to change layouts with the user interaction.
Should i use different activities for different layouts or can i use setContentView to switch layouts.
Which one will be effecient?</p>
| android | [4] |
2,842,764 | 2,842,765 | Customising context menus in Android | <p>Is there a way to change the look and feel of a context menu?<br>
I want to add my own background, list item seperator and maybe the selector as well.
I want to change it in famework so that i will get the customised menu every where i will use it.</p>
<p>Can someone point me in the right direction? As far as I cou... | android | [4] |
251,522 | 251,523 | Implement (or use) a lock screen | <p>Is there a way I can use the android default lock screen (SDK)? OR should I implement my own? If I implement my own Any pointers how to do that?</p>
<p>I basically want to unlock the screen using the keypad and If I use certain pattern then I can receive calls from X only and if I use a different pattern then I can... | android | [4] |
1,013,132 | 1,013,133 | Java: having files containing only general methods? | <p>I was wondering if there was a way to have methods separated from the main and class files (like how in c you can have .c & .h with just methods that you can import into projects).</p>
<p>Specifically I have a 'logical exclusive or' function that I want to use across several classes and I thought it would be go... | java | [1] |
4,732,418 | 4,732,419 | Select table row and check checkbox using JQuery | <p>I have a table and I want to select the rows that satisfy my criteria and check their respective checkbox. Let's say I want to get the rows with date <code>2013-03-21</code>. How can I do this using JQuery?</p>
<pre><code><table>
<tr>
<td>
Record1
</td>
<td>
... | jquery | [5] |
3,860,553 | 3,860,554 | manual gridview paging | <p>i'm am pulling 10 out of 100 records back from the database and placing into gridview (no datasource objects here). </p>
<p>how do i enable paging that comes with the gridview? I know the total records is 100 can I use that somehow to activate the paging?</p>
<p>I know I can do this easily with DataSource objects ... | asp.net | [9] |
2,202,666 | 2,202,667 | access to google with python | <p>how i can access to google !!</p>
<p>i had try that code</p>
<pre><code>urllib.urlopen('http://www.google.com')
</code></pre>
<p>but it's show message <code>prove you are human</code> or some think like dat</p>
<p>some people say try user agent !! i dunno !</p>
| python | [7] |
4,989,321 | 4,989,322 | Compare dictionary values and key in python | <p>I have a dictionary <code>item</code>. It has strings as keys and the values are lists e.g.:</p>
<pre><code>item['title'] = [u'python']
item['image'] = [u'/link/to/image']
item['link'] = [u'link to article']
</code></pre>
<p>I want to check if any value is 0 in length, but link or image may be empty, so I did the ... | python | [7] |
1,713,662 | 1,713,663 | how to create a timer and background service who make call to a get location()(langitude and longitude ) after every 5 min | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7592569/how-to-fetch-the-current-location-in-every-1-min-of-interval">How to fetch the Current Location in Every 1 min of Interval?</a> </p>
</blockquote>
<p>iam creted on working location class and another sen... | android | [4] |
958,631 | 958,632 | target to a div without reloading the page in javascript | <p>i wrote a web page that included some stuff. There, i need to create a input text box after clicking on a button, but it will be at the bottom due to existing stuff and i can't see the input box as it is in the out of visible area.there i'v to scroll down to find that.I tried with focus method , it focuses to the i... | javascript | [3] |
186,810 | 186,811 | javascript - find number in string | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1183903/regex-using-javascript-to-return-just-numbers">Regex using javascript to return just numbers.</a> </p>
</blockquote>
<p>How do I get the humber from a string like this?</p>
<pre><code>blabla-33434
</cod... | javascript | [3] |
196,275 | 196,276 | Builtin Function to Convert from Byte to Hex String | <p>This is a question similar to <a href="http://stackoverflow.com/questions/2294153/a-builtin-function-to-convert-byte-to-string">this one here</a>.</p>
<p>Is there a built-in method that converts an array of byte to hex string? More specifically, I'm looking for a built in function for </p>
<pre><code> /// <s... | c# | [0] |
5,705,730 | 5,705,731 | My loop for class? lost | <blockquote>
<p>Simulate a cash register as it totals a user's purchases. The program should execute for an unspecified number of items for a single user. The program should prompt the user for the quantity and unit cost of each item. The user should indicate the end of purchases by entering a negative quantity. The ... | python | [7] |
1,873,291 | 1,873,292 | Twilio : Response application link not working | <p>I am unsing Twilio Rest Api for SMS functionality. My SMS is send sucessfully problem is when user response to SMS, I have to capture that response in my application and send confirmation email to user</p>
<p>I am unable to capture response from application URL.Please give me some idea.</p>
<p>Thanks in advance</p... | php | [2] |
5,025,234 | 5,025,235 | Timer not stopped when i click back button in android | <p>I am using the countdown timer but when i click back button the timer continues.Can any body tell me how can i stop when i click my phone back button not my application back button.</p>
<p>Sorry for my English.</p>
<p>Thanks in advance. </p>
| android | [4] |
235,990 | 235,991 | C# speed of File.AppendAllText | <p>I fetch data from a database and use <code>File.AppendAllText</code> to write each database row into one file totalling 8000 files. This whole process repeats in a loop(of queries) and it seems to be taking forever. Is there a better way to go about doing this? Does it make sense to store all the file handlers?</p>
| c# | [0] |
5,685,385 | 5,685,386 | Using CoreData with different instances of same viewcontroller with different data | <p>I am developing an app which is based on UITabBarController, one of the tab(Follow) shows the user's(The user who is using the app currently) followings and followers details in a UITableview. The data is different for different users and is downloaded from the server based on the UserId sent from the client and sto... | iphone | [8] |
5,300,695 | 5,300,696 | Call function dynamically, regardless of being instance method or static? | <p>I need to be able to call a method without having to know whether or not it is static.</p>
<p>For example, this doesn't work and I would like it to:</p>
<pre><code>class Groups {
public function fetchAll($arg1, $arg2){
return $this->otherFunction();
}
public static function alsoFetchAll($arg... | php | [2] |
2,665,637 | 2,665,638 | Google Adsense clash with SSL certificate | <p>When I add the below AdSense script to my SSL secure page it shows crossed red mark when browsed using chrome. When I remove this adsense script my SSL works great and perfect. Confused why the SSL does not accept even if I use https secure external link</p>
<pre><code><script type="text/javascript"
src="htt... | jquery | [5] |
3,142,876 | 3,142,877 | Long click on rectangle | <p>I created a view with rectangles which are clickable using the method onTouchEvent (using ACTION_DOWN motion). I want to enable a long click on the rectangle which open a dialog, and I tried to do it using ACTION_UP, but then the dialog is presented only after I release the finger. How can I do it in the same way th... | android | [4] |
1,078,678 | 1,078,679 | jQuery("body").css("margin") does not return a value in Chrome | <pre><code>jQuery("body").css("margin")
</code></pre>
<p>Does not return the margin value in Chrome, I just get <code>""</code> back. The value in the user agent stylesheet is <code>8px</code>. What am I doing wrong? Is this a bug?</p>
| jquery | [5] |
192,255 | 192,256 | multiple submit buttons from multiple custom controls messing up the postback in asp.net | <p>I currently have a scenario where i am including two custom controls into a page, where each custom control has a submit button. The submit button works as long as only one control is added to the page, but once the second control is loaded both of the submit buttons stop working, the control never goes to the submi... | asp.net | [9] |
360,081 | 360,082 | Fetching all (javascript) global variables in a page | <p>Is there a way to retriev the name/value of all global variables on a page?</p>
<p>I would like to write a javascript function to do the following:</p>
<ol>
<li>Find all global variables prefixed with 'xxx_' and stick them in an array (for e.g.)</li>
<li>build a query string using the name value pairs as follows:
... | javascript | [3] |
957,982 | 957,983 | Return value as 'customvariablename' | <p>I am attempting to crawl through a file and insert "../../" at the beginning of every image path. Unfortunately though, the script is timing out, and since it only took a few seconds to run before this was added something tells me it is not doing what I think it should be. This is how I'm doing it:</p>
<pre><code... | php | [2] |
3,921,396 | 3,921,397 | return non duplicates numbers in array from method | <p>I am trying to remove duplicate numbers using method and return non-duplicate numbers, actually I am stuck in method right now.
this is my code :</p>
<pre><code>import javax.swing.JOptionPane;
public class duplicateRemover{
public static void main(String[] args) {
int[] array = new int[5];
for (int i=... | java | [1] |
4,688,268 | 4,688,269 | Get rowid from listview for deleting the row in the database | <p>I am using Custom Adapter to populate a listview which is reading from the database.Here when i do a longpress on a listitem,i want to delete the item from the listview and the database.How to get the rowid to delete that item from the database.</p>
<p>Thanks.</p>
| android | [4] |
4,200,025 | 4,200,026 | Can parentheses take arbitrary identifiers as arguments? C++ | <p>For example, is</p>
<pre><code>(const int)* someInt;
</code></pre>
<p>valid code?</p>
<p>If so, is that statement different than</p>
<pre><code>const int* someInt;
</code></pre>
<p>?</p>
| c++ | [6] |
1,057,798 | 1,057,799 | Is there anything wrong with throwing exceptions in the try block? | <p>Is it a good design practice to code a <code>try-catch</code> block as follows? That is, use a <code>throw</code> in the try block and then catch it in the catch block.</p>
<pre><code>try
{
if (someCondition){
throw new Exception("Go the the associated catch block!");
}
}
catch(Exception ex)
{
... | c# | [0] |
649,012 | 649,013 | Load module with variable path in python 2.6? | <p>My dev environment is python 2.6, so the importlib.import_module() syntax is not available to me. I'm trying to load a module with a path that is set by a variable; is this even possible in 2.6?</p>
<p>The background is that I'm polling a number of devices from different vendors, so in various directories I have wr... | python | [7] |
2,901,059 | 2,901,060 | Lazy Loading in UITableview Sections IPhone | <p>I have "n" Arrays with Images and I want to display images correspondingly in "n" sections of tableview using lazy loading concept.I know how to display one array images in table containing one section.Can anyone Help me???
Thanks in Advance</p>
| iphone | [8] |
1,213,125 | 1,213,126 | Replace a pattern in python | <p>How to replace the pattern in the string with</p>
<pre><code> decoded_str=" Name(++info++)Age(++info++)Adress of the emp(++info++)"
The first pattern "(++info++)" needs to replaced with (++info a++)
The second pattern "(++info++)" needs to replaced with (++info b++)
The third pattern "(++info++)" needs to r... | python | [7] |
4,420,270 | 4,420,271 | how can I give command line arguments in java and validate it | <p>I am trying to code for 2 command line arguments where the first one is 'u' or 'l', nothing else and second a dna sequence(a,c,g,t) between 10 -20 letters, using regular expression to validate both arguments and trying to print sequence in uppercase if arg. is u and in lowercase if arg is l.the problem is i am not ... | java | [1] |
5,994,831 | 5,994,832 | Disable Uninstall button in android manageapplication | <p>How to disable the Uninstall button in android management applications ?</p>
<p>If i once install the app in mobile device, if any end user want to uninstall that app, then he not able to uninstall it.</p>
| android | [4] |
240,857 | 240,858 | PHP, Creating a folder when I run file_put_contents() | <p>I have uploaded a lot of images from the website, and need to organize files in a better way.
Therefore, I decide to create a folder by months.</p>
<pre><code>$month = date('Yd')
file_put_contents("upload/promotions/".$month."/".$image, $contents_data);
</code></pre>
<p>after I tried this one, I get error result.... | php | [2] |
1,911,687 | 1,911,688 | Play any video file using asp.net in IE and mozila | <p>i have used "embed" tag for Flv file, Flash Player for "swf" file and "object tag for other files...
everything working fine with IE but in Mozilla only swf files working properly..
can anybody suggest me right way to play video of any type in IE and Mozilla both</p>
| asp.net | [9] |
1,199,569 | 1,199,570 | How to remove empty paragraph tags from string? | <p>I ran into a slight coding problem with WordPress template. This is the code I use in template:</p>
<pre><code><?php echo teaser(40); ?>
</code></pre>
<p>In my functions, I use this to strip tags and get content from allowed tags only.</p>
<pre><code><?php
function teaser($limit) {
$content = explode... | php | [2] |
5,736,283 | 5,736,284 | C# control flow | <p>I made a number which asks for 2 numbers with C# and responds with the corresponding message for the case. how come it doesnt work for the second number ?
Regardless what I enter for the second number , I am getting the message "your number is in the range 0-10".</p>
<pre><code>using System;
using System.Collect... | c# | [0] |
5,106,662 | 5,106,663 | I want to dynamic change dialog's list item's textcolor. But list.getChildAt() confused me very much! Can you help me? | <p>I got that it seems the list.getchildAt() method return not null only when the list has shown once. If the list has not shown before, I call List.getChildAt() will return null. How can I do it, I want before the dialog's list shown before to change the list item's textcolor?</p>
| android | [4] |
1,841,092 | 1,841,093 | Php how to use Explode in a sentence | <p>I am thinking a way to do this. I want to get some text in a sentence.</p>
<p>This is a sample of $item_title in database:</p>
<p><strong>cat1 + sub1 of cat1 + test 1 of sub1 of cat1</strong></p>
<p>All i want to do is get the sentence starting from first ' + '</p>
<p>In this case i want to have:</p>
<p><stron... | php | [2] |
2,526,607 | 2,526,608 | Strange Behaviour w/ JavaScript workers | <p>I created a JavaScript worker. When I visit the page in the browser it tries to print the page. Strange right? You can see the page in action here:</p>
<p><a href="http://galesupport.com/fb/workers.php" rel="nofollow">http://galesupport.com/fb/workers.php</a></p>
<p>Can someone please explain this to me? Thanks :)... | javascript | [3] |
5,653,905 | 5,653,906 | validation on weight in asp.net? | <p>can i get validation on weight which can take decimal values and also integer.
suppose if i enter 60 it has to accept and if i enter 60.50 it has to accept (60.1..etc)
but not characters. Thank you. </p>
| asp.net | [9] |
4,014,699 | 4,014,700 | I used heredoc syntax to cover my string. But It displays error. Below is my code: | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2305869/heredoc-interfering-with-code-indentation">HEREDOC interfering with code indentation</a> </p>
</blockquote>
<pre><code><?php
$my_string = <<<TO
Everything in this rather unne... | php | [2] |
4,000,469 | 4,000,470 | files upload using java | <p>java code which handles files upload file from location in the system and to save that file to a specific location in the same system</p>
| java | [1] |
4,334,652 | 4,334,653 | Get value of final field of a static class using reflection | <p>I have following class structure:</p>
<pre><code> private static class MyStaticClass {
public final String name;
public final String photoUri;
private MyStaticClass(String pName, String pPhotoUri) {
this.name = pName;
this.photoUri = pPhotoUri;
... | java | [1] |
1,605,341 | 1,605,342 | Changing formatting string from % to alternate character? | <p>In python 2.6, is there a way to specify an alternate character other than % for string formatting operations? Or is the % char hardcoded in the python interpreter?</p>
<p>For example, to generate a string that looks like this:</p>
<pre><code>param1%02param2%03param3...
</code></pre>
<p>I currently have to do thi... | python | [7] |
4,950,520 | 4,950,521 | Is it possible to modify the Contacts using URI and cursorLoader instead of ContentResolver() insert() , delete() modfiy() etc | <p>I am new to Android development and trying to add an activity that would let me manipulate the contacts without going to the contacts app. </p>
<p>I used a cursorLoader() to access the the Contacts and displayed it in a listView.
Now I want to insert, delete or edit a new contact . </p>
<p>My question is do I have... | android | [4] |
1,862,610 | 1,862,611 | Question on updating/inserting a datatable in a dataset | <p>I need to open a connection to SQL database and read a subset of a table and either update a record if exists or insert if not found. Having truoble updating</p>
<pre><code> SqlConnection conn = new SqlConnection(ConnectionStrings.PgenIntranet.SqlClientConnectionString);
SqlDataAdapter i... | c# | [0] |
3,916,528 | 3,916,529 | Returning a Random Number Type Problem | <p>I'm trying to return a random number from a method but apparently the implicit type is not correct. It says "Cannot implicitly convert type 'Randomize.RandomNumber' to 'int'"</p>
<p>RandomNumber.cs:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Text;
namespace Randomizer
{
class ... | c# | [0] |
741,324 | 741,325 | How to detect orientation change in layout in Android? | <p>I just implemented the orientation change feature. </p>
<p>When the layout changes from portrait to landscape (or vice versa), how can I detect when the orientation change event finished.</p>
<p>I tried to use <code>OrientationEventListener</code>, but it seems not a good idea.</p>
<p>I just want to be notified o... | android | [4] |
4,402,903 | 4,402,904 | accessing variable outside for loop in c#? | <p>Here i need to access the variable <code>delval</code> outside the for loop as in the code below </p>
<pre><code>cmd_mail.Parameters.Add("@deleteusers", SqlDbType.NVarChar).Value = delval;
</code></pre>
<p>..How to do this.. </p>
<p>Here is my code</p>
<pre><code> for (int i = 0; i <= NoOfUsers - 1; i++) {... | c# | [0] |
3,780,231 | 3,780,232 | A newbie's try for a Q on SO | <p>I have a little newbie's hitch.</p>
<p>I have got something like this:</p>
<pre><code>// Assign Device ID
if ($line == "IMEI 358998018395510\r\n"){
$device_id = 1;
}elseif($line == "IMEI 352924028650492\r\n"){
$device_id2 = 3;
}
........
........
if (fwrite($outFile,$device_id or device_id2. ",". $date.",".$... | php | [2] |
217,129 | 217,130 | where to look if app crashes on startup | <p>I am a beginner to android. in java and other programming languages we get error in the console. how to find the same as if there is no error in the code and app crashes on start up. </p>
| android | [4] |
5,126,721 | 5,126,722 | Regarding binding array to gridview | <p>Hi
I have created session array :</p>
<pre><code> int[] a = (int[])Session["values"];
</code></pre>
<p>Now i have to bind this value to my gridview. I have one column (boundfield in my gridview) in gridview.
I used code to bind array to gridview as follows, but its giving last value only as i want all the values t... | asp.net | [9] |
589,155 | 589,156 | can not access e-mail attachment | <p>I used the code below to get the email attachment file url.</p>
<pre><code>NSURL *url=(NSURL*)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
</code></pre>
<p>but </p>
<pre><code>bool b=[[NSFileManager defaultManager] fileExists:[url absoluteString];
</code></pre>
<p>always returns NO, which means ... | iphone | [8] |
36,173 | 36,174 | modify checkbox using javascript | <p>I had declared 5 checkboxes with name and id attribute in a html:</p>
<pre><code><input type="checkbox" name="category" value="One" id=11>One<br/>
<input type="checkbox" name="category" value="Two" id=12>Two<br/>
<input type="checkbox" name="category" value="Three" id=13>Three<br/... | javascript | [3] |
3,982,671 | 3,982,672 | How to get word from CurrentInputConnection in android? | <p>I am working on custom InputConnection in android. Everything is working fine, but i want to get characters between cursor's current position and start position of particular word.</p>
<p>Is there any suggestion? how can i do that?</p>
<p>Thanks..</p>
| android | [4] |
2,233,004 | 2,233,005 | Preg match problem | <p>I try to "validate" a date field. I only want to allow, numeric chars and - character.</p>
<pre><code> $born_date=$_POST['date'];
$goodchars = array("1","2","3","4","5","6","7","8","9","0","-");
$char_re_good = '/['.preg_quote(join('', $goodchars), '/').']/';
if (!(preg_match($char_re_good, $born_date))) {... | php | [2] |
3,096,191 | 3,096,192 | howto split a int into its single numbers? | <p>how can i split a int in c++ to its single numbers, e.g.:
23 to 2 and 3 ??</p>
| c++ | [6] |
2,133,952 | 2,133,953 | jQuery: how to add buttons that can in turn add more buttons | <p>I am writing a script that allows users to add friends on a form. I need to be able to have them add a friend, click an add button button next to the input, add another friend, click the add button next to that input and so on. I am trying to do that with jQuery, but am stuck. I achieved this, but my script adds ... | jquery | [5] |
1,501,713 | 1,501,714 | Why didn't my Application crash after it used more memory than VM budget? | <p>I was running my app on Nexus S, the per-app memory limit on which is 32M bytes.</p>
<p>I ran the command to check the memory usage of the app:</p>
<p>adb -d shell dumpsys meminfo com.mycomp.myapp</p>
<pre><code>Applications Memory Usage (kB):
Uptime: 1128469 Realtime: 1128466
** MEMINFO in pid 841 [com.mycomp.m... | android | [4] |
3,675,023 | 3,675,024 | Error when I am redirecting page | <p>I am getting an error <strong>"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."</strong>
When i am redirecting my page from one to another.
I am using this code.</p>
<pre><code>try
{
Session["objtwitter"] = obj_UserDetSumit;
Response.Redirec... | asp.net | [9] |
5,491,326 | 5,491,327 | problem in array $_POST | <p>i have this code it can go to <code>if(array_key_exists('p',$_POST))</code> but can't go to <code>if(isset($_POST['p'][$i]) && $_POST['p'][$i]==$row[0])</code></p>
<p>i tried to <code>echo $_POST['p'][0]</code> in <code>if(array_key_exists('p',$_POST))</code> but it tells me 0 is undefined</p>
<p>i don't k... | php | [2] |
3,210,081 | 3,210,082 | Can one have different colored text sentences in the same list view item in Android? | <p>For example, look at this sentence:</p>
<blockquote>
<p>"I have to get on at A4 junction, And Getoff at B2 junction".</p>
</blockquote>
<p>Here I want to change the color of </p>
<blockquote>
<p>"get on at A4 junction"</p>
</blockquote>
<p>to blue in and </p>
<blockquote>
<p>"getOff at B2 junction"</p>
</... | android | [4] |
1,136,756 | 1,136,757 | DataTable RowGrouping Not Grouping Error | <p>I am using DataTable 1.9 and the RowGrouping pluging. The IQueryable collection being binded to the datatable is not sorted or grouped before the databinding event. When I used the following code</p>
<pre><code> var oResultGrid = $("[id$='gvReportData']");
if (fixEmptyDataRow(oResultGrid)) {
... | asp.net | [9] |
3,242,339 | 3,242,340 | Get Value from local .resx file | <p>How can i get value from local .resx file in asp.net?</p>
| asp.net | [9] |
787,738 | 787,739 | How to extend array or object prototype for a specific javascript object? | <p>Say I have the following:</p>
<pre><code>function Myobj = {
name: "Julia",
birthdate: "xxxx",
genres: [],
movies: [{title: "movie1", rating: 5, genre: "Horror"}, {title: "movie2", rating 3, genre: "Comedy"},{title: "movie3", rating 3, genre: "Comedy"}, {title: "movie4", rating 3, genre: "Comedy"}, {titl... | javascript | [3] |
1,678,102 | 1,678,103 | Android (min 2.1): load images from name string | <p>I want to be able to load images dynamically from res/drawable. I don't how many files there will be, but I do know they will be named by convention as "image_N", where N is sequential integer. It is possible that new images will be uploaded while the app is running.</p>
<p>My code is basically</p>
<pre><code>Re... | android | [4] |
3,389,703 | 3,389,704 | jQuery getting ID | <p>I'm trying to get the image SRC using this: <code>var SRCNow = $('#'+ID+'.item').attr("src");</code></p>
<p>on this:</p>
<pre><code><a id='17' href='#' name='item' class='tilelink'><img title='17' id='17' style='background:red'; class='item' src='line_tile/t17.png' /></a>
</code></pre>
<p>So whe... | jquery | [5] |
1,830,403 | 1,830,404 | Android Powerdown device after 10 minutes inactive | <p>I need for my app to shutdown the device if there is 10 minutes or more of inactivity. So what is best way to detect and shutdown after 10 minutes? Thanks</p>
| android | [4] |
3,044,731 | 3,044,732 | how to immediately run a function while an element.innerHTML change? | <p>First,I planed to set an element's <strong>innerHTML</strong> a <code>getter</code> and <code>setter</code><br>
But I found it wouldn't work,I know why it wouldn't,but is there a way to accomplish this task?<br>
Thanks </p>
| javascript | [3] |
4,911,289 | 4,911,290 | const_cast for vector with object | <p>I understand that const_cast to remove constness of objects is bad, </p>
<p>I have the following use case, </p>
<pre><code>//note I cannot remove constness in the foo function
foo(const std::vector<Object> & objectVec) {
...
int size = (int) objectVec.size();
std::vector<Object> tempObjec... | c++ | [6] |
105,849 | 105,850 | Java: library to calculate the mean? | <p>Is there a function in Jave to calculate the mean ?</p>
<p>I've tried by myself but I'm afraid that sum has too high value: 5 642 782 840</p>
<p>Can a integer be 5 642 782 840 in Java ? I don't think so...</p>
<pre><code>for (int i = 0; i < timeValues.length; i++) {
sum = sum + Integer.parse... | java | [1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.