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,502,131 | 1,502,132 | AsynchTask crashes on return from doInBackground | <p>I have the following code:</p>
<pre><code>public class TestSynch extends Activity {
public static ArrayList<HashMap<String,String>> list;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Context ctx = this.getApplicatio... | android | [4] |
1,423,117 | 1,423,118 | Count number of lines in a method | <p>I have a .CPP file in which I have defined some methods. For the program execution I am calling these methods.
Now I would like to know how many lines from the specific method were executed in a program.</p>
<p>Is there any way I could programmatically get these information.</p>
| c++ | [6] |
1,546,689 | 1,546,690 | How to Get Contact name, number and emai ID from a list of contacts? | <p>I am new to android ,I need to get the details of my contacts, but the details include only 3 </p>
<ol>
<li><p>Contact name</p></li>
<li><p>contact number and </p></li>
<li><p>Email ID</p></li>
</ol>
<p>when I press a Button it will show these 3 details of my all contacts</p>
<p>I am using android Eclair version ... | android | [4] |
3,988,072 | 3,988,073 | automatically print c# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5566186/print-pdf-in-c-sharp">Print Pdf in C#</a> </p>
</blockquote>
<p>i have file</p>
<p><strong>c:\PathToFile\File.pdf</strong></p>
<p>how i can run automatically print on default printer, thanks all :)</p>... | c# | [0] |
3,164,379 | 3,164,380 | Why android:uiOptions="splitActionBarWhenNarrow" not working with device | <p>I am using <code>android:uiOptions="splitActionBarWhenNarrow"</code></p>
<p>to split the <code>Menu's</code> .it is working fine with emulator <code>4.03</code></p>
<p>but not with real device <code>4.03</code>.It is samsung tablet</p>
| android | [4] |
5,057,079 | 5,057,080 | how can i avoid running of more than one instance on same java project at the same time? | <p>i have a java project, works as a server. when an instance of this project running, i can run another instance.<br>
how can i avoid running of more than one instance on same java project at the same time?
(Stop the server when another instance is detected)</p>
| java | [1] |
5,600,750 | 5,600,751 | how to Initialize a Javascript Array with non-zero index | <p>I'm passing an array to a function and I'm curious if there is a quick way to use the json style array initializer to pass an anonymous array:</p>
<p>e.g.: </p>
<pre><code>myfunction([1,2,3,4]);
</code></pre>
<p>Is there some special syntax in javascript that would allow one to initialize the array with non-zero ... | javascript | [3] |
3,518,562 | 3,518,563 | Is there a better way to see if a file is being written to? | <p>We have a FreeBSD server with samba that employees copy image files on to, which then get uploaded to our web servers (this way they don't have to mess with ftp). Sometimes, if the upload script is running at the same time as files are being copied, it can upload an incomplete file. </p>
<p>We fixed this by getting... | php | [2] |
2,310,462 | 2,310,463 | Is there any compelling reason for me to un-static this method? | <p>I have this SaveCheckedStateToDB() function:</p>
<pre><code>public class oDaA_DBUtils {
// TOOD: Perhaps this should not be static, and I should force callers to instantiate the class first?
public static void SaveCheckedStateToDB(int AOptionSelected, String id, boolean AToggledOn)
{
//
}
}
<... | android | [4] |
3,140,433 | 3,140,434 | Revealing a UL on click in jQuery | <p>I have some problems and hoping you could help.</p>
<p>I have the following HTML code </p>
<pre><code><h4><a class="trigger">Click </a></h4>
<ul class="panel">
<li>List items bla bla bla </li>
<li>List items bla bla bla </li>
<li>List items bla bla bla &... | jquery | [5] |
995,689 | 995,690 | Avoiding inline JavaScript with dynamic content | <p>I read <a href="http://coding.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/" rel="nofollow">here</a> that you should avoid coding JavaScript inline (see item #1).</p>
<p>It sounds like a great idea; however, I'm not sure how to use js to select dynamic content without setting the id in the fun... | javascript | [3] |
1,230,960 | 1,230,961 | numberpad implemetation | <p>I am trying to implement a number pad like this </p>
<p><img src="http://getsetbro.com/img/android-number-input.png" alt="link">.</p>
<p>how can I have different font size for number and character.</p>
<p>Thank you</p>
| android | [4] |
5,419,753 | 5,419,754 | Do template parameters need to be forward declared or does the type definition to be known | <p>Basically I have this code, but GCC complains that the vector cannot
be constructed with an empty type. Has anybody encountered this problem
before? I should mention that Vertex3D is only used through pointers in
the file and so there should be no reason for the whole type to be
known by the compiler. I dont kno... | c++ | [6] |
4,961,025 | 4,961,026 | using javascript to dynamically create and delete clickable button with | <p>I have created a english to hindi transliteration webpage .
There are rules for mapping every hindi letter to its english equivalent.
If user presses 'd' , I want to suggest some nearby letters . It would be great if I am able to create & remove buttons (which have associated onclick action) using javascript.
... | javascript | [3] |
3,507,678 | 3,507,679 | How to resize array in C++? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/756906/can-you-resize-a-c-array-after-initialization">Can you resize a C++ array after initialization?</a> </p>
</blockquote>
<p>I need to do the equivalent of the following C# code in C++</p>
<pre><code>Array.... | c++ | [6] |
3,752,000 | 3,752,001 | Android SeekBar Minimum Value | <p>does anyone know how to define a SeekBar's minimum value? Is this done in the XML layout or do I need to define it programatically?</p>
<p>Basically I need to change my minimum value from 0 to 0.2</p>
| android | [4] |
5,551,969 | 5,551,970 | Is there an example of how to use a TouchDelegate in Android to increase the size of a view's click target? | <p>My understanding is that when you have a view that's too small to easily touch, you're supposed to use a TouchDelegate to increase the clickable region for that view.</p>
<p>However, searching for usage examples on Google turn up multiple people asking the question, but few answers.</p>
<p>Does anyone know the pro... | android | [4] |
5,367,863 | 5,367,864 | Drawing pixels on Canvas with BufferedImage not filling the whole Canvas | <p>I'm trying to draw pixels on a Canvas using a BufferedImage. In my Canvas constructor I am initializing the image and pixel array like so:</p>
<pre><code>public MyCanvas() {
Dimension size = new Dimension(WIDTH, HEIGHT);
setSize(size);
setPreferredSize(size);
setMinimumSize(size);
setMaximumSize... | java | [1] |
4,864,639 | 4,864,640 | Python - index out of range on large initialized list | <p>I'm a beginner at Python and I'm getting a strange out of bounds error.</p>
<p>The idea is that I need a cache initialized using:</p>
<pre><code>arr = [0]*1000000
</code></pre>
<p>then accessed in the same function by calling </p>
<pre><code>def func (i) :
k=1
a = i
arr = [0]*1000000
while (i>... | python | [7] |
2,390,633 | 2,390,634 | How to select Items with a where alt != "someString" | <p>I am selecting a group of checkboxes like so</p>
<pre><code>$(tbl).find('input[type=checkbox]').prop('checked', this.checked);
</code></pre>
<p>I want to EXCLUDE any checkboxes that have an alt="disabled" property and I can't get it to work, can anyone help.</p>
| jquery | [5] |
344,292 | 344,293 | How to include a javascript file in the HTML? | <p>I currently have my JS code in a element inside HTML and it works fine. As soon as I swap it with a with src="myjs.js" it stops working...why? So I need to addeventlisteners in HTML to the root? </p>
| javascript | [3] |
1,463,321 | 1,463,322 | get property name from generic list | <p>Environment: asp.net fx3.5</p>
<p>given</p>
<pre><code>public class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
}
</code></pre>
<p>i have a <code>List<Product></code> collection.</p>
<p>is there a way to get the pro... | c# | [0] |
2,674,702 | 2,674,703 | How to move a movie from Camera Roll to app's Documents folder? | <p>How can I copy/move a movie from Camera Roll to an app's own Documents folder?</p>
| iphone | [8] |
2,716,714 | 2,716,715 | Need help finding what is wrong with my code for a super simple $getJSON call | <p>I cant figure out why the this alert() part below is not working when I call it from $.getJSON???</p>
<pre><code>function parseInfo(data)
{
alert("getJSON worked");
}
</code></pre>
<p>Firebug says I connecting to the server with a 200 OK code</p>
<p> </p>
<pre><code><!DOCTYPE html>
<html... | jquery | [5] |
959,205 | 959,206 | animating a simple jquery function | <p>I have a simple jquery function that resizes a table when it is clicked.</p>
<pre><code> <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('.expand_table').live("click", function()
{
$('.expand_... | jquery | [5] |
5,065,688 | 5,065,689 | Comment code to explain "how" but does not explain "why"? | <p>When I was in a programming study course, I alway had a bad situation: Comment code to explain "how" but does not explain "why".</p>
<p>What I want to know is why re-run the code there is and why you chose to write it.</p>
<p>What can I do to fix this problem to improve my programming?</p>
| c# | [0] |
999,087 | 999,088 | == and is in python | <p>Its been a couple of days since I started learning python, at which point I stumbled across the <code>==</code> and <code>is</code>. Coming from a java background I assumed <code>==</code> does a comparison by object id and <code>is</code> by value, however doing </p>
<pre><code> >>> a = (1,2)
>>>... | python | [7] |
2,796,223 | 2,796,224 | What does the colon ( : ) mean in this javascript line? | <p>What does the ":" mean in the 3-6th lines below? </p>
<pre><code>function displayError(error) {
var errorTypes = {
0: "Unknown error",
1: "Permission denied",
2: "Position is not available",
3: "Request timeout"
};
var errorMessage = errorTypes[error.code];
if (error.... | javascript | [3] |
1,024,609 | 1,024,610 | String handle in C# | <p>I don't understand the use of "get" and "set" command, how to add a list of the accounts using the code below and someone give me some example to fix the error? Thanks! :(</p>
<pre><code> public class Account
{
public string UserName
{get rerurn textBox1.Test; // error
set UserName ... | c# | [0] |
706,118 | 706,119 | Iterating over list or single element in python | <p>I would like to iterate over the outputs of an unknown function. Unfortunately I do not know whether the function returns a single item or a tuple. This must be a standard problem and there must be a standard way of dealing with this -- what I have now is quite ugly. </p>
<pre><code>x = UnknownFunction()
if islist(... | python | [7] |
1,470,652 | 1,470,653 | Find Value in Array | <p>The following array is output from my db.</p>
<pre><code>$this->db->select('code')->from('table');
$array = $this->db->get()->result_array();
//Output:
Array ( [0] => Array ( [code] => ASDF123 ) [1] => Array ( [code] => ASDF124 ) )
</code></pre>
<p>How can I find if a variable is con... | php | [2] |
1,669,513 | 1,669,514 | Rename Files in a Directory | <p>I have 400 files in a directory (with <code>.png</code> extensions). They start with the name <code>005.png</code> and go up to <code>395.png</code>.</p>
<p>I want to rename them using <code>os.rename</code>:</p>
<pre><code>os.rename(006.png,005.png)
</code></pre>
<p>In other words, I want to shift all the number... | python | [7] |
4,550,490 | 4,550,491 | storing input from a seperate class | <p>I posted a question earlier for a homework assignment but I have a new question. I am new at this so I appreciate any help I can get and I'm not looking for code but more of an explanation of the steps I need to take to get to my answer.</p>
<p>I'm working on an address book. The user picks a menu 1, 2, or 3. I ha... | java | [1] |
3,823,225 | 3,823,226 | JQuery - $this is not defined | <p>Trying to get this code to work but the error I am getting in firebug is <code>$this is not defined</code> and I don't understand why</p>
<p>To explain the background about this code I have a list of spans with identical classes so when I click on particular span I need to send an ajax request and update that parti... | jquery | [5] |
5,369,472 | 5,369,473 | Is there such a thing as .charAt().contains()? | <p>Is there a way to to compare a single char in a string to another string? Here is an example:</p>
<pre><code>String a = "0123456789";
String b = "5 + 3 / 2";
if(b.charAt(0) == 'something in string a') {
// do something
}
</code></pre>
<p>or</p>
<pre><code>b.charAt(i).contains(a)
</code></pre>
| java | [1] |
2,859,139 | 2,859,140 | extract frames from a video file in android | <p>I am trying to extract frames from a video file in android. I have searched alot but couldn't find any clue about that. Is there any way we could do this? Could anyone please help me regarding this.</p>
| android | [4] |
1,834,001 | 1,834,002 | Filtering a set of items by data | <p>Say if've got a set of items with some data on them like this:</p>
<pre><code><li data-filtro="website, web app"><a href="trabajos.php?id=84"><img src="imgs/thumbs/item_tn_84.jpg" /></a></li>
<li data-filtro="website, banners"><a href="trabajos.php?id=131"><img src="imgs... | jquery | [5] |
2,534,631 | 2,534,632 | Find htdocs path, no matter where file is stored | <p>How can I find my htdocs directory.</p>
<p>When I execute the following command:</p>
<pre><code>echo dirname(__FILE__);
</code></pre>
<p>I get the following output:</p>
<pre><code>/var/www/myexample.com/htdocs/required/css
</code></pre>
<p>I want to find path till /htdocs, but I don't want to hard-code the thi... | php | [2] |
5,177,654 | 5,177,655 | Interviewstreet Triplet | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/13928575/interviewstreet-triplet-challenge">interviewstreet Triplet challenge</a> </p>
</blockquote>
<p>There is an integer array <code>d</code> which does not contain more than two elements of the same value. H... | java | [1] |
1,547,894 | 1,547,895 | JS listener for global var? | <p>I want to keep everything contained within a single function, and not make all the various variables global.</p>
<p>Is it possible to set up an event listener within the function main to watch a global var?</p>
<p>in this example call doTheStuff() when the index is altered? or might I be going about this the wrong... | javascript | [3] |
4,210,232 | 4,210,233 | How to inherit class name in PHP? | <p>How can I get the class name of the child class instead of the parent class? Both print <code>a</code>, but it should print <code>b</code> in the second <code>var_dump()</code>.</p>
<pre><code> <?php
class a
{
public $name;
public function __construct()
{
$this->na... | php | [2] |
4,020,692 | 4,020,693 | how to use JS to dynamically update innerHTML | <p>I have a drop down box, each option in it has 2 values. I want to dynamically update value in my HTML based on the selection. The value that has to be shown is derived from drop down box values. Here is my code, but nothing seems to be happening here. </p>
<pre><code><html>
<head><title></... | javascript | [3] |
3,658,340 | 3,658,341 | In what version of jquery the autocomplete feature is introduced? | <p>I am using jquery 1.2.6 for the whole site but I am having difficulties in implementing jquery . Can anyone tell me in what version of jquery the autocomplete feature is brought and is there any process to upgrade the jquery of a older version to a newer version. For ex: upgrading from 1.2.6 ro 1.8. Is there any pro... | jquery | [5] |
1,316,644 | 1,316,645 | Is it possible to use && and set a variable on same line? | <p>I'm using:</p>
<pre><code>MyTestFunction() && ExecuteMe();
</code></pre>
<p>for quick and easy conditional execution. I'd like to improve the code readability more in some places by creating:</p>
<ol>
<li><p>Single line guard statments I.E:</p>
<pre><code>MyTestFunction() && return;
//prevent ex... | javascript | [3] |
1,248,729 | 1,248,730 | How to calculate different between two date()? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php">How to calculate the difference between two dates using PHP?</a> </p>
</blockquote>
<p>I have two time in this format: <code>date("Y-m-d H:i:s"... | php | [2] |
3,236,001 | 3,236,002 | Android: Launch new instance of application activity from home screen widget | <p>I have an app widget on the home screen which includes a button that launches a basic settings Activity.</p>
<p>When the user presses the Back button, if the main application has some activities in it's stack, the back press takes you to the most recently viewed Activity in the app, rather than back to the homepage... | android | [4] |
1,481,304 | 1,481,305 | how to add uiview as a subview to existing view | <p>i want to add a uiview of smaller frame as subview to parental view but i am not getting the needed</p>
<p>uiview *view = [[uiview alloc] initwithFrame:something];
[self.view addsubview:view];</p>
<p>can anyone suggest me the answer</p>
| iphone | [8] |
5,850,699 | 5,850,700 | JavaScript variable to hold large numbers | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4288821/how-to-deal-with-big-numbers-in-javascript">How to deal with big numbers in javascript</a> </p>
</blockquote>
<p>Javascript does't hold numbers > 17 digits. is there any other way to put bigger number in... | javascript | [3] |
2,252,195 | 2,252,196 | Printing row of a list | <p>I'm trying to label rows and columns of my matrix.</p>
<p>I can create columns but I can't seem to properly create rows </p>
<p>Here's what I've done:</p>
<pre><code>matrix = [[1,0,1],[1,0,1],[1,0,1]]
row = 0
col = 0
dim = len(matrix)
for i in range(dim):
print "\t", "col",i,
for r in range(0,dim):
print... | python | [7] |
1,443,518 | 1,443,519 | How to add validation to a form | <p>I would like to validate a form so that it checks if the user is logged in...</p>
<p>I have got a form with method and action given below:</p>
<pre><code><form method=get action="index.php">
</code></pre>
<p>What I would like to do is that when I click on proceed to checkout, this form should validate if us... | php | [2] |
3,617,922 | 3,617,923 | Dropdownlist with suggestions that match what you type in a textbox | <p>I have a dropdown list, a textbox and a button. If I types a word in the textbox and click the button then the dropdown list should select the list item according to that word in the textbox.</p>
<p>For example: If I type 23 then the dropdown should lists the item starting 23.</p>
| jquery | [5] |
3,832,598 | 3,832,599 | PHP list and checkboxes | <p>I want to make a list with checkboxes next each item. For some reason I can print the list but the checkboxes aren't showing up.</p>
<pre><code>$note = mysql_fetch_array( $note_content );
if($note['type'] == 'list')
{
$note_type='list';
print "<dl>";
while($note = mysql_fetch_array( $no... | php | [2] |
1,010,319 | 1,010,320 | Understanding Python daemon threads | <p>I've obviously misunderstood something fundamental about a Python Thread object's daemon attribute.</p>
<p>Consider the following:</p>
<pre><code>daemonic.py
import sys, threading, time
class TestThread(threading.Thread):
def __init__(self, daemon):
threading.Thread.__init__(self)
self.daemon... | python | [7] |
826,925 | 826,926 | Java equal and hashCode with non primitive types | <p><br>
I have a class with some non primitive members.</p>
<pre><code>class Relation {
String name;
Role roleFrom;
Role roleTo;
}
class Role {
RoleType roleType;
String details;
}
class RoleType {
String typeName;
String details;
}
</code></pre>
<p>Two relations are equal, when </p>
<ol>
<li>the name ... | java | [1] |
3,112,241 | 3,112,242 | Animating a toast in android? | <p>Am trying to animate my toast but have been unsuccessful so far. This is what I have in my <code>onCreate()</code>:</p>
<pre><code>ImageView image = new ImageView(this);
image.setImageResource(R.drawable.icon);
Animation move = new TranslateAnimation(0,100, 0, 100);
move.setDuration(2000);
move.setFillEnabled(true)... | android | [4] |
5,966,109 | 5,966,110 | Determining if a query is in a string | <p>I have a list of query terms, each with a boolean operator associated with them, like, say:</p>
<pre><code>tom OR jerry OR desperate AND dan OR mickey AND mouse
</code></pre>
<p>Okay, now I have a string containing user-defined input, <code>inputStr</code>.</p>
<p>My question is, in Python, is there a way to dete... | python | [7] |
4,366,568 | 4,366,569 | Setting text in activity using Button | <p>I was wondering what is the correct way to set the text of a TextView after a button has been pushed? I currently have an app that would change the text every time the activity was created (but for now it only sets the text as one value for testing purposes):</p>
<pre><code>public void onCreate(Bundle savedInstance... | android | [4] |
1,487,999 | 1,488,000 | Javascript - execute after all images have loaded | <p>Having read other people's questions I thought </p>
<pre><code>window.onload=...
</code></pre>
<p>would answer my question. I have tried this but it executes the code the instant the page loads (not after the images load).</p>
<p>If it makes any difference the images are coming from a CDN and are not relative.</p... | javascript | [3] |
3,389,789 | 3,389,790 | jQuery: how do I activate a datepicker from an element that is separate from the input field that the datepicker inserts the date into? | <p>This does not work the way I want to. currently, the text field activates the datepicker. but I want the click of the button to activate the datepicker:</p>
<pre><code> <script type="text/javascript">
$j(function() {
$j(".prop-expiry input").datepicker({
showTrigger: '#exp... | jquery | [5] |
2,040,125 | 2,040,126 | Valid Java Exception Handling - is it really required in all cases? | <p>I'm reading through the documentation <a href="http://docs.oracle.com/javase/tutorial/essential/exceptions/catchOrDeclare.html" rel="nofollow">here</a>. This example is what I'm questioning:</p>
<blockquote>
<p>The first kind of exception is the checked exception. These are
exceptional conditions that a well-wr... | java | [1] |
5,891,101 | 5,891,102 | Python -- Save Objects Together in a Binary File? | <p>I have a <code>python</code> class that contains many objects -- some are data structures (<code>lists</code>, <code>dicts</code> etc) and some are handlers to other classes (that also contain other data structures...).</p>
<p>Rather than using <code>pickle</code> to save the entire class & its contents, I was ... | python | [7] |
2,978,448 | 2,978,449 | Show submit button dynamically when email is valid | <p>I'm sure this should be easy, but I can't get it working.</p>
<p>html</p>
<pre><code><label for="email">Enter email for updates:</label>
<input type="text" name="email" id="email" placeholder="your@email.com" />
<button name="submit" type="submit">Submit</button>
</code></pre>
<p>js<... | jquery | [5] |
1,889,185 | 1,889,186 | Android in app billing - where to place the bind code | <p>I am going through this tutorial they have: developer.android.com/guide/market/billing/billing_integrate.html</p>
<p>and I am in this section "Binding to the MarketBillingService"</p>
<p>They give those code snippets there:</p>
<pre><code>try {
boolean bindResult = mContext.bindService(
new Intent("com.andr... | android | [4] |
3,077,939 | 3,077,940 | jquery: div hide/show on focus issue | <p>Thanks to <strong>inti's</strong> code I was able to figure out the answer! </p>
<p>jQuery:</p>
<pre><code>$(document).ready(function(){
$("body").click(function(e) {
//checks to see if the tag you clicked has the #login
//div as a parent.
if($(e.target).closest("#login").size() == 0) {... | jquery | [5] |
5,624,806 | 5,624,807 | iPhone: screenshot | <p>Is there any method that calls in app when user made screenshot (hold home button + power) ???
Or which methods could be called ? Like applicationDidBecomeActive or something else ? Thanks...</p>
| iphone | [8] |
4,025,388 | 4,025,389 | android style is not taken into account | <p>I have a problem while creating styles in android:</p>
<p>When I use </p>
<pre><code>android:textAppearance="?android:attr/textAppearanceSmall"
</code></pre>
<p>in Button for instance, that's working fine, but if I create a styles.xml like:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<resource... | android | [4] |
1,781,698 | 1,781,699 | integrated webview in android | <p>I am Android developer .I have integrated webview in android.In that application about chart.Chart is working well in 4.0 version.But we got data all from HTML via.Please help me how to make refresh data.</p>
<p>Thanks</p>
| android | [4] |
1,380,034 | 1,380,035 | selector for button not working | <p>I want to change the background of the button when the button is unclickable.I have used selector for that but it is not working in the case when the button remains unclickable.</p>
<p>This is the selector file:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schema... | android | [4] |
5,221,463 | 5,221,464 | PHP If Variable isset add input with checkbox checked not working | <p>I am having a problem with some code...</p>
<p>Here is the code:</p>
<pre><code><?php
if (isset($myVar)) {
echo '<input type="checkbox" name="ck1" id="ck1" checked />Checked/Not checked';
}
?>
</code></pre>
<p>I've tried checked, checked="checked" checked="true" ...but for some reason the checkbox doe... | php | [2] |
3,731,587 | 3,731,588 | Allocate space for char | <p>String construct got space for the data by doing</p>
<pre><code>new char[strlen(cp)+1];
</code></pre>
<p>Since there are only <code>strlen(cp)</code>characters in the string, what is the extra byte for?</p>
| c++ | [6] |
4,009,915 | 4,009,916 | How to reverse-engineer www.sryth.com | <p>At the risk of this topic getting voted down and or closed, and my reputation going into negative, I am opening this topic up to discussion in the hopes that it will yield a some useful insights.</p>
<p>I've been experimenting with www.sryth.com in order to glean how it might be implemented.</p>
<ul>
<li><p>Firstl... | php | [2] |
34,856 | 34,857 | Two id's for javascript function | <p>I have a javascript function that goes like this:</p>
<pre><code>function change_one()
{
var one = document.getElementById("one").value;
document.getElementById("tag").value=one;
}
</code></pre>
<p>It works fine until there are two elements the same id.</p>
<p>I'm using php to fetch stuff from mysql and while it... | javascript | [3] |
3,438,980 | 3,438,981 | Extracting property names from a c# source file | <p>I want to parse a c# file. The only thing I want is to determine if it contains a property with a specific name; just a simple true/false response. Or rather, since I'd checking for more than one property in each run, extracting a list of property names could be helpful</p>
<p>I thought that I could create an elega... | c# | [0] |
16,507 | 16,508 | PHP Learning Curve | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3487276/what-to-do-after-learning-basic-php">What to do after learning basic PHP?</a><br>
<a href="http://stackoverflow.com/questions/2948323/how-to-increase-my-advanced-knowledge-of-php-further-quickly">How to in... | php | [2] |
13,683 | 13,684 | C++ init member variables with multiple constructors | <p>Usually a constructor should look like this:</p>
<pre><code>//ctor1
SmallSim::SmallSim()
:mSimInit(false)
,mServersCreated(false)
,mTotalCPUTime(0)
{
...
}
</code></pre>
<p>What happens if I have multiple constructors?</p>
<p>It looks to me that If I call the first constructor from my second, the member vars ... | c++ | [6] |
3,392,076 | 3,392,077 | How to Send C++ Struct Message from C# Socket? | <p>This is the C++ Message that i need to pass from C#:</p>
<pre>
struct LoginMessage:public NMessage
{
char szUser[ 16 ];
char szPass[ 16 ];
LoginMessage()
{
msgId = CTRL_SESSION_LOGIN;
msgSize = sizeof( LoginMessage );
}
};
struct NMessage
{
DWORD msgSize;
u... | c# | [0] |
2,057,868 | 2,057,869 | DateTime, minutes since update? | <p>I have this DateTime object (update) which is set to DateTime.now, when i update my application.</p>
<p>I also have this timerTick event, called on every 5 seconds which should check how many minutes ago, update was.</p>
<p>I've tried with:</p>
<pre><code>if ((DateTime.Now - Updated).Minutes > 0)
{
update... | c# | [0] |
2,995,880 | 2,995,881 | Does running separate python processes avoid the GIL? | <p>I'm curious in how the Global Interpreter Lock in python actually works. If I have a c++ application launch four separate instances of a python script will they run in parallel on separate cores, or does the GIL go even deeper then just the single process that was launched and control all python process's regardless... | python | [7] |
2,021,969 | 2,021,970 | How to impose interface? | <p>How I should make sure that classes needed as a one of params to my templated class will have a certain interface? I know that one way is to make in Interface class pure virtual but I would like to avoid it. Is there any other way to do it? I would like to avoid anything which isn't standard</p>
<pre><code> //E... | c++ | [6] |
1,121,893 | 1,121,894 | Bind event to all "select" dropdownlist elements | <p>I have a form with a variable amount of "select" dropdownlists and textboxes. I want to bind the <code>.change()</code> event to only the "select" elements. I've tried <code>$(":input").change()</code> but binds the <code>.change()</code> event to all the inputs. Is there something like <code>$(":text")</code> or a ... | jquery | [5] |
4,874,400 | 4,874,401 | merge all the elements in a list python | <p>I have a list of string like:</p>
<pre><code>s = [("abc","bcd","cde"),("123","3r4","32f")]
</code></pre>
<p>Now I want to convert this to the following:</p>
<pre><code>output = ["abcbcdcde","1233r432f"]
</code></pre>
<p>What is the pythonic way to do this?
THanks</p>
| python | [7] |
226,740 | 226,741 | Do I *always* have to check for null after a safe cast? | <p>Quick question; do I always need to check for a null value after performing a safe cast? I do it this way now, but in a situation like this:</p>
<pre><code>void button1_Click(object sender, EventArgs e)
{
Button = sender as Button;
if (button != null) // <-- necessary?
{
// do stuff with 'b... | c# | [0] |
1,829,389 | 1,829,390 | Location object Javascript | <p>I've got a php file inside this folder structure:</p>
<p>Web -> script -> gen.php</p>
<p>From this gen.php I want to redirect with the <code>location()</code> function in Javascript to</p>
<p>Web->Index.html</p>
<p>I tried to do it like this:</p>
<pre><code>location = "localhost/Web/index.html"
</code></pre>
<... | javascript | [3] |
5,780,128 | 5,780,129 | Creating objects in Java question | <p>In PHP, to create a new object you would do something like this, <code>$dog = new Dog;</code>. But in Java you would do something like, <code>Dog x = new Dog;</code> or <code>Dog x;</code>. Could someone explain why you need to say the Dog class in front of the variable?</p>
| java | [1] |
2,700,952 | 2,700,953 | Python shelve with already opened file | <p>Is it possible to use shelve with a file that is already opened? I'd like to do something like the following, but shelve.open doesn't accept a file descriptor.</p>
<pre><code> f = open('file.shelve')
s = shelve.open(f)
</code></pre>
| python | [7] |
3,318,171 | 3,318,172 | Android:Playing bigger size audio wav sound file produces crash | <p>I am trying to play the bigger size audio wav file(which is >20 mb) using the following code(AudioTrack) on my Android 1.6 HTC device which basically has less memory. But i found device crash as soon as it executes reading, writing and play. But the same code works fine and plays the lesser size audio wav files(10kb... | android | [4] |
4,798,566 | 4,798,567 | Create Android library | <p>I've written a library (game engine) and would like to use it for my apps and games that I'll be creating. </p>
<p>I see there are two ways to add libraries to your code:</p>
<ol>
<li>Export to jar and add that to build path</li>
<li>Have it as a project file its self, and simply add project to build path.</li>... | android | [4] |
879,562 | 879,563 | Retrieving a closest node to the caret position | <p>I have a document (inside editable iframe),<br>
I need to retrieve a closest node to the caret position, not the parent node, but the sibling node (so they must have same parent) that is located (when available) left to the caret position(collapsed selection).</p>
<p>The node can be any node, like text node, paragr... | javascript | [3] |
1,832,521 | 1,832,522 | Trouble understanding instance variable | <p>Here is the definition:</p>
<p>In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable) // I get this part</p>
<p>, for which each object of the class has a separate copy. // This part I don't get.</p>
<p>How can an object have a seperate copy? a ... | c++ | [6] |
4,299,688 | 4,299,689 | xmlHttpRequest.send(Params) not working in tomcat 7 | <p>I am trying to send some parameters through xmlHttpRequest.send(params) written in a JS file to my servlet where I try to get the parameters by req.getParameter("some_Parameter"); it returns null on the servlet. though if i send the parameters by appending them in url it works fine. but when the url will be large it... | javascript | [3] |
461,150 | 461,151 | android.annotation.SuppressLint undefined | <p>I am new to Android trying to use Linphone pluging in Android getting android.annotation.SuppressLint undefined erorrs after importing this API.
The attribute value is undefined for the annotation type TargetApi PlusApi.java
please help!!</p>
| android | [4] |
5,248,149 | 5,248,150 | does explode get executed more than once in a foreach? | <pre><code>$array='hello hello2';
foreach(explode(' ',$array) as $v)
echo $v;
</code></pre>
<p>How many times does explode get executed?</p>
<p>And is it better that to use another var like:</p>
<pre><code> $exploded = explode(...);
foreach($exploded as $v)
...
</code></pre>
<p>?</p>
| php | [2] |
4,991,908 | 4,991,909 | Reading a text file word by word | <p>I have a text file containing just lowercase letters and no punctuation except for spaces. I would like to know the best way of reading the file char by char, in a way that if the next char is a space, it signifies the end of one word and the start of a new word. i.e. as each character is read it is added to a strin... | c# | [0] |
4,509,836 | 4,509,837 | Math result should be zero but is slightly off compared to direct substitution | <p>Update: Thanks guys, I didn't realize it was very close to zero but not exactly zero. Is there a way around it so my program sees it as a zero? Its throwing my results off because this value is not being picked up as a zero.
Update2: figured it out, adding:</p>
<pre><code>from decimal import *
getcontext().prec =... | python | [7] |
5,300,364 | 5,300,365 | Sending email from asp.net 3.5 using vb.net | <p>Dim mail As New MailMessage</p>
<pre><code> Mail.Subject = CtxtMessage.Text
Mail.To.Add("admin@gmail.com")
Mail.From = New MailAddress("abcd@gmail.com")
Mail.Body = "good work"
Dim smtp As New SmtpClient("smtp.gmail.com")
smtp.EnableSsl = True 'Secured conn
smtp.Credentials = New Syste... | asp.net | [9] |
4,023,414 | 4,023,415 | Sticky slide menu using jquery | <p>often many site developing sticky slide menu. the menu slide out from bottom right and when user click on close button it does not close rather it's size become small. menu has title always like "Recommended for you".</p>
<p>i was looking for this type of menu and search google for any jquery plug-in exist or not b... | jquery | [5] |
3,427,570 | 3,427,571 | protect (encrypt) password in the web.config file (asp.net) | <pre><code> <system.net>
<mailSettings>
<smtp from="email@domain.com" deliveryMethod="Network">
<network clientDomain="www.domain.com" host="smtp.live.com" defaultCredentials="false" port="25" userName=" email@domain.com " password="password" enableSsl="true" />
</smtp>
</... | asp.net | [9] |
1,693,263 | 1,693,264 | PHP not writing client IP to file | <p>I cant figure out why it wont write the client IP address to the file, everything else works.</p>
<pre><code><?php
$myFile = "ips.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $_SERVER['REMOTE_HOST']);
fclose($fh);
echo $_SERVER['REMOTE_ADDR'];
?>
</code></pre>
<p>Thanks in advanc... | php | [2] |
2,900,870 | 2,900,871 | Rejection from Apple because "This game is not recognize by Game Center" | <p>I just got a rejection from Apple because they are having the error message: "This game is not recognize by Game Center".
I have been testing (with many others) the game for weeks using Game Center and nobody ever had that error. All provisioning profiles have GC enable, is has been submitted with GC enabled, achiev... | iphone | [8] |
5,124,071 | 5,124,072 | Trying to create an alarm using rtc ans i2c on Atmega64 but having a query | <p>I have to create a clock and calendar with rtc using i2c which I have done and it is working fine. But I want to implement a multiple alarms feature in this program. Now when I do add an alarm for a specific time for the buzzer to start ringing, the time is not displayed until the buzzer stops! So since my buzzer ri... | jquery | [5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.