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 |
|---|---|---|---|---|---|
509,961 | 509,962 | Make sure both threads finish execution before executing a piece of code | <p>I need to execute a piece of code when two conditions have been met.</p>
<ol>
<li>Subject text is successfully queried from the database using background thread.</li>
<li>The dimension of View is retrieved successfully using main thread.
Both Subject text and dimension of View are stored as Activity's member variab... | android | [4] |
4,433,687 | 4,433,688 | preg_replace to remove all words beginning with http:// and ending with a space | <p>i got an idea to remove all links from a string with PHP.</p>
<p>i need a preg_replace to remove and strip all words beginning with :</p>
<p>http:// or https:// or www. or www3. or ftp://</p>
<p>and ending with a white space.</p>
<p>example : hello <a href="http://dsqdsq.com/fdsfsd?fsdflsd" rel="nofollow">ht... | php | [2] |
2,142,780 | 2,142,781 | jquery - leaving the hover state | <p>I have 2 div tag. The first contains a table. The second contains some text. When the page is loaded both div have no background-color. When there is an hover on a td of the first div, the second div background-color is set to yellow (see code below). My problem is that when I leave the table with the mouse, the bac... | jquery | [5] |
1,609,070 | 1,609,071 | null cookie upon redirecting from sandbox | <p>problem is that i am using paypal sandbox for testing purpose, whenever i redirect user to sandbox then i works fine, but upon return , it losses cookies and session too, i tried both ,
i am facing it for last 1 month but no progress, tried several forums but no help,
First i used session, that works on everypage ... | asp.net | [9] |
1,377,975 | 1,377,976 | Alternative ways to instantiate a class in Python | <p>I am currently writing my python classes and instantiate them like this</p>
<pre><code>class calculations_class():
def calculate(self):
return True
Calculations = calculations_class()
</code></pre>
<p>I was wondering if I was doing this correctly, or if there were any other ways to instantiate them. T... | python | [7] |
371,271 | 371,272 | String to Integer array conversion | <p>I need to add values into an int array. </p>
<pre><code> int[] placeHolders[];
</code></pre>
<p>Now i do not know the size of the elements to add into this array. I add it while i have input. I want to know how can i convert my string output values into int array repeatedly. </p>
<p>Input: 23.45.1.34</p>
<p>... | java | [1] |
4,158,182 | 4,158,183 | javascript Access parent from event listener | <p>I am trying to create a wrapper for google map api. The following function is part of an object. I keep getting "self is undefined". Typically the listener only has function(event), I tried adding self to the parameter list to get access to the parent object.</p>
<pre><code>var self = this;
google.maps.event.addL... | javascript | [3] |
3,294,971 | 3,294,972 | jQuery catch img | <p>We have a script used for each <code>.item</code>:</p>
<pre><code>$(".item").each(function(){
item_link = "http://...";
block = $('.block', this);
$.get(item_link, function(data) {
var src = $('img.slide', data).attr('src');
block.html(src);
});
});
</code></pre>
<p><code>item_link<... | jquery | [5] |
4,940,568 | 4,940,569 | Unicode strings on a embedded software | <p>I need to write an app on embedded device using C++.
I may need to support Unicode too (though I am not an expert on it). I had
a look at Joel Spoolsky's article too about Unicode: <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow">http://www.joelonsoftware.com/articles/Unicode.html</a></p>... | c++ | [6] |
2,259,870 | 2,259,871 | combining effects in jquery | <p>How would I alter the below page and code so that when my 'news' P fades out the content below it... slides smoothly up instead of jumping.</p>
<pre><code> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://ww... | jquery | [5] |
5,899,094 | 5,899,095 | How to find document element by regexp? | <p>for example I have many input elements with name "test_(1...100)". I want to find all of them.</p>
| javascript | [3] |
2,382,896 | 2,382,897 | How to add a controller for an aspx page? | <p>This is the common issue ,that i have faced.
when the user clicks one of the menu item, if the user didn't login ,I want to redirect to Login page itself.
Which is the efficient way to do this?</p>
<p>In Jsp we have a controller for every page, I dont know what we use in asp.net.</p>
| asp.net | [9] |
1,825,338 | 1,825,339 | Why the First if case prints Equal and Second Not Equal? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3130311/weird-java-boxing">Weird Java Boxing</a> </p>
</blockquote>
<pre><code>public class example {
public static void main(String[] args) {
Integer a=127,b=127;
if(a==b)
Syste... | java | [1] |
171,952 | 171,953 | Xcode not detecting iPhone | <p>i am using XCode 4.1, when i open an old project it is showing the iPhone device, but it is not detecting the iphone device on a new project.</p>
<p>Thanks</p>
| iphone | [8] |
3,349,603 | 3,349,604 | Problem with displaying information from DB | <pre><code>//conn to DB
echo $_POST['text'];
$filter = $_POST['text'];
$sql = "SELECT DISTINCT * FROM contents
WHERE
MATCH(content,title) AGAINST ('$filter')
";
$mksql=mysql_query($sql);
while($row = mysql_fetch_assoc($mksql)) {
echo $row['title']."<br />";
}
</code></pre>
<p>I send POST request to another ... | php | [2] |
618,264 | 618,265 | I can't retrieve data using JSON parsing | <pre><code>{
"user": {
"name": ["bineesh", "Administrator", "binu", "binu", "bijith", "prem"]
},
"email": ["bineesh256@gmail.com", "erpadmin@gmail.com", "binu245@gmail.com", "binu245@gmail.com", "bijith256@gmail.com", "toast@gmail.com"],
"phone": ["7293553814", "12345", "0", "0", "0", "904656723... | android | [4] |
4,875,308 | 4,875,309 | Which class should we use for sending sms/text messages? | <p>What class can we use to send a text message? I tried this on the emulator, 2.0:</p>
<pre><code>import android.telephony.SmsManager;
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(...);
</code></pre>
<p>and that works ok. On my G1 running 1.5, I get a verify error, guessing because SmsManager is not... | android | [4] |
2,958,327 | 2,958,328 | overloading operator >> like std::cout | <p>I would like to create a class similar to std::cout. I know how to overload the >> and << operators, but I would like to overload the << operator so it would be <strong>input</strong>, just like in std::cout.</p>
<p>it should be somthing like:</p>
<pre><code>class MyClass
{
std::string mybuff;
publ... | c++ | [6] |
4,253,510 | 4,253,511 | How to get a substring from command line arguments in netbeans software? | <p>How to get a substring from command line arguments in netbeans software.Netbeans software doesn't support the inbuilt string function substring.kindly help.</p>
| java | [1] |
5,114,598 | 5,114,599 | Create Shake movement in IPhone application | <p>I want to create an application using shaking. That is when i shake my IPad, then the icon will be move automatically depends upon shaking. If anybody about know about it, how to create these type of applications, please help me.</p>
<p>Thanks.</p>
| iphone | [8] |
3,411,826 | 3,411,827 | How to create a dynamic Table? | <p>Is there any way to create a dynamic html table element using Jquery .</p>
<p>In This table I want to add the Td inner element as anchor tag.</p>
| jquery | [5] |
1,298,101 | 1,298,102 | How can I put an Android app that I'm developing onto a phone? | <p>As the title say I am making an android app and need to test it on the phone... I have run it in the emulator but now I want to actually put it onto the android phone.. problem is i have no idea how to do this.</p>
| android | [4] |
4,073,940 | 4,073,941 | Jquery attr method returns undefined for a checked checkbox | <p></p>
<p>For the above checkbox</p>
<pre><code>document.getElementById("checkbox1").checked // -> returns true
</code></pre>
<p>But</p>
<pre><code>var byAppr = document.getElementById('checkbox1').value;
$(byAppr).attr('checked') // -> returns undefined
</code></pre>
<p>I am testing this in firefox 3.6</p>... | jquery | [5] |
1,800,566 | 1,800,567 | JOptionPane won't show its dialog on top of other windows | <p>I have problem currently for my swing reminder application, which able to minimize to tray on close. My problem here is, I need JOptionPane dialog to pop up on time according to what I set, but problem here is, when I minimize it, the dialog will pop up, but not in the top of windows when other application like expl... | java | [1] |
504,512 | 504,513 | Not able to dynamically add the event handler to a button element using jQuery | <p>In this fiddle, i am not able to get the <a href="http://jsfiddle.net/saravanan/YNM68/" rel="nofollow">Dynamic Event Handler</a></p>
<p>onclick event to be triggered for the dynamically generated button.</p>
| jquery | [5] |
5,893,392 | 5,893,393 | Reading first letter of a word and choosing its number of alphabet | <p>I want to use a scanner to import a word. Then use a string to only use 1 letter and after this lookup which letter is which number and then println it. </p>
<p>How can I achieve this?</p>
| java | [1] |
354,367 | 354,368 | Generics/templates in python? | <p>How does python handle generic/template type scenarios? Say I want to create an external file "BinaryTree.py" and have it handle binary trees, but for any data type. </p>
<p>So I could pass it the type of a custom object and have a binary tree of that object. How is this done in python?</p>
| python | [7] |
1,468,173 | 1,468,174 | How to create a Default, Custom Styled Spinner | <p>I am trying create my custom Style spinner with help of <a href="http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/" rel="nofollow">this</a> site. But the changes no appear. I did exactly like shown in that site. But I don't know understand what should I do to see the result</p>... | android | [4] |
2,667,466 | 2,667,467 | Implementation of RESTful Services using Design patterns | <p>Can you provide me some URL's where i can find design pattern code examples for implementing restful services.</p>
<p>Thanks</p>
| asp.net | [9] |
625,406 | 625,407 | Is it possible to get the source of code of this java script without running it DONT PASTE IN YOUR BROSWER | <p>not trying to get anyone to run this i simply want to know what it does as someone tried to get me to go here on facebook</p>
<p>eztop-viewers.tk/working.js</p>
| javascript | [3] |
5,195,600 | 5,195,601 | Compiled Python CGI | <p>Assuming the webserver is configured to handle <strong><em>.exe</em></strong>, Can i compile a python CGI file into an exe for speed. What would some pros and cons be to such a desession?</p>
| python | [7] |
456,262 | 456,263 | How to compare UIButton title with another string in iPhone? | <pre><code>NSString *s1= [btnStreetType titleForState:UIControlStateNormal];
BOOL str= [s1 isEqualToString:s1 ];
</code></pre>
<p>In the code above, why does <code>isEqualToString</code> return NO? I have to check whether the title is an empty string or not, but it always returns NO.</p>
| iphone | [8] |
2,740,947 | 2,740,948 | Python won't import math module. It's fetching a file that isn't even there. What do I do? | <pre><code># quadratic.py
# A program that computes the real roots fo a quadratic equation.
# Illustrates the use of the math library
# Note: This program crashes if the equation has no real roots
import math # math makes the library available
def main():
print "This program finds the real solutions to a quadrati... | python | [7] |
1,186,660 | 1,186,661 | error in create object of class | <p>I have my Spinner which is an object of the class SpinnerAdapter.
I try to create the object but there is an errors I try to solve it but I can not.</p>
<p>Here is a picture of error that happened:</p>
<p><img src="http://i.stack.imgur.com/RbqgC.png" alt="enter image description here"></p>
| android | [4] |
926,385 | 926,386 | Android - Text Switcher | <p>I'm trying to add a text switcher dynamically but I get the error:</p>
<blockquote>
<p>The method setFactory(ViewSwitcher.ViewFactory) in the type ViewSwitcher is not applicable for the arguments...</p>
</blockquote>
<p>Here's my code:</p>
<pre><code>TextSwitcher ts = (TextSwitcher) new TextSwitcher(this);
ts.s... | android | [4] |
5,403,247 | 5,403,248 | if isset not set - php | <pre><code>if(isset($_POST['text1']) && isset($_POST['text2'])) {
echo "xxxxxx";
echo "yyyyyyyyyy";
} else {
?>
<form>
</form>
<?php
}
?>
</code></pre>
<p>When isset is not set I want the form shown and when submitted form not shown, using PHP. This code when ! isset is activated... | php | [2] |
1,899,468 | 1,899,469 | Parallel assignment in C++ | <p>Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)</p>
<pre><code>#include <iostream>
int main() {
int a = 4;
int b = 5;
a, b = b, a;
std::cout << "a: " << a << endl
<< "b: " << b << endl;
return 0;
... | c++ | [6] |
2,279,521 | 2,279,522 | Which of the following is faster? | <p>Which of the following is faster? And, just by the way, which would you personally prefer? (The position variable stores the CSS position of a DIV element.)</p>
<p><strong>1)</strong></p>
<pre><code>if (/(relative|absolute|fixed)/).test(position) { ... }
</code></pre>
<p><strong>2)</strong></p>
<pre><code>if (!(... | javascript | [3] |
1,268,643 | 1,268,644 | Unable to change text() value | <pre><code><div class="search_on" id="search-item">
<span class="text">one</span>
</div>
<ul class="search_item" style="display: none;">
<li><a href="#">one</a></li>
<li><a href="#">two</a></li>
<li><a href="#">thr... | jquery | [5] |
5,009,078 | 5,009,079 | How to get elements from array list in android | <p>Hi all in my application by using web service i get the data from database and stored that data in hash table.I took that data from hast table to array.this array data can be displayed in button.My array contains 10 elements.For animation i used view flipper.Now i want to do is display that array elements on butto... | android | [4] |
708,928 | 708,929 | Properties of Double.NaN and why does Integer wrapper not have an NaN data memeber? | <pre><code>i=Double.NaN
while(i==i)
{
//some code
}
</code></pre>
<p>what is the output?
Why don't we have a <code>Integer.NaN</code>?</p>
| java | [1] |
3,414,053 | 3,414,054 | Notice: Undefined variable: var1 in \www\test.php on line 7 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2619573/how-to-use-include-within-a-function">How to use include within a function?</a> </p>
</blockquote>
<p>i have two file </p>
<p><strong>inc.php file</strong></p>
<pre><code><?php
$var1 = "foo";
$var1 ... | php | [2] |
788 | 789 | how to do php 4 dimension array sorting | <p>Cassandra Json format looks like this</p>
<pre><code> "recommendResult":[{
"mediaId":"",
"mediaEntry":[{
"user1":{
"name":"sooin",
"rating":"3",
"views":"2",
"like":"ture",
"comment":"good"
},
... | php | [2] |
3,393,272 | 3,393,273 | "used struct type value where scalar is required" at .layer.position | <p>I want to make a selection before apply one of two animations,
what I thought is: make a Piont "one", if my "myImageView" is at the Point "one", then apply animationNo1, else apply animationNo2, but I got this:"used struct type value where scalar is required", at line "if (myImageView.layer.position = one) "
What I... | iphone | [8] |
1,359,286 | 1,359,287 | What are some types of programs I could write to reinforce/advance my early skillset? | <p>I'm coming to the end of my intro programming class, we're using java and have been doing command line programs so far, no gui's which I've enjoyed quite a bit. So far in the class the programming assignments have been somewhat challenging but leave me wishing for a bit more. I find myself wanting to write a progr... | java | [1] |
1,509,142 | 1,509,143 | Call HTML control in code behind | <p>How can I get gridview HTML textbox value in .aspx.cs code?? E.g. :</p>
<pre><code><input id="Frequency" name="customerName" type="text" style="width: 44px" />
</code></pre>
<p>If i use the bellow code ,Then i can get the value on selectedIndex event.</p>
<pre><code>string n = String.Format("{0}", Reques... | asp.net | [9] |
274,334 | 274,335 | Pass Parameter to JS function of TabContainer OnClientClick | <p>I'm assigning a JS function to OnClientClick property of a TabContainer like this</p>
<pre><code>TabContainer1.Tabs[0].OnClientClick="JSTest"
</code></pre>
<p>I would like to know how I can pass a parameter to this function JSTest. I tried this</p>
<pre><code>TabContainer1.Tabs[0].OnClientClick="JSTest('1');"
</c... | asp.net | [9] |
4,345,157 | 4,345,158 | Sessions - Where to use session_start()? | <p>When do you call session_start()?</p>
| php | [2] |
3,221,793 | 3,221,794 | How to copy file based on partial filename in python | <p>I'm trying to copy certain .JPG files from my photocard to another directory. The files are named IMG_7853.JPG, IMG_7854.JPG, and so on (they range from IMG_0001.JPG to IMG_9999.JPG). If I want to copy all files greater than IMG_7853 what's the best approach in python. The code below works fine for listing all fi... | python | [7] |
4,011,620 | 4,011,621 | issue with tinyscrollbar.js | <p>I have a site which dynamically loads content and tinyscrollbar.js seems to work fine in Safari, but breaks horribly in other browsers such as FireFox and Chrome. All js, css and html are inline for dev purposes and can be found <a href="http://davidstappphotography.nfshost.com" rel="nofollow">here</a>. Can anyon... | jquery | [5] |
1,494,614 | 1,494,615 | What is the name of this control in android | <p>May i know the name of the below placed image control, also please tell me how to implement similar control in my application.</p>
<p>This control appears, after long press on contact image.</p>
<p><img src="http://i.stack.imgur.com/4cpvX.jpg" alt="enter image description here"></p>
| android | [4] |
3,833,126 | 3,833,127 | Get a filename from a string in PHP | <p>I have this strings saved in my mysql database in format like:</p>
<pre><code>/uploads/attachments/18/105/WordPress_3_Cookbook.pdf
</code></pre>
<p>Now, I need to get only the file name.</p>
<p>I guess I need some function in PHP that check the string from the backwards and get everything to the first slash.</p>... | php | [2] |
427,377 | 427,378 | android: How to call the number by android application | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4275678/how-to-make-phone-call-using-intent-in-android">how to make phone call using intent in android?</a> </p>
</blockquote>
<p>Please give me code for calling the number through android Application.</p>
<p>T... | android | [4] |
714,359 | 714,360 | How does Square Reader (squareup) device work via earphone jack in Android? | <p><a href="https://squareup.com/reader" rel="nofollow">https://squareup.com/reader</a> describes a hardware card reader that plugs into earphone jack on Android (and iPhone) too. </p>
<p>I wonder how the Square app reads the data from the earphone jack. Is it possible to send custom data via the earphone jack, or is ... | android | [4] |
1,146,368 | 1,146,369 | raising exceptions issue | <p>here is my code:</p>
<pre><code>class longInputException(Exception):
def __init__(self, length, max):
Exception.__init__(self)
self.length = len(length)
self.max = max
try:
max = 3
s = raw_input('Enter something-->')
if len(s) > max:
raise longInputException(s,... | python | [7] |
4,243,875 | 4,243,876 | web.xml file is missing | <p>I am new for Dynamic Web Projects.
I created a new Dynamic web project in e-Clipse. But when I check the structure of it doesn't have the web.xml in the WEB-INF / lib folder.
I can copy paste it. That's true but I wanna know what should I configure to generate it automatically at the beginning?</p>
| java | [1] |
4,614,950 | 4,614,951 | array spliting based on our requirement | <p>My array contains the values with comma as separator, like </p>
<pre><code>array={raju,rani,raghu,siva,stephen,varam}.
</code></pre>
<p>But i want to convert into the below format like</p>
<pre><code>array = {raju:rani raghu:siva atephen:varam}.
</code></pre>
<p>please give some logic to implement this one.</p... | javascript | [3] |
5,949,379 | 5,949,380 | Create several new objects within a for-loop in Java | <p>I want to create several objects from a class in a for loop. but I don't know how to code it. What I have written creates a new object but it overwrites the previous object.</p>
<pre><code>package assginment1_version4;
import java.util.*;
public class Client {
public static void main (String[] args) {
System... | java | [1] |
744,753 | 744,754 | How do I clear out phone storage on my Android Phone? | <p>How do I clear out phone storage for an Android Increible?</p>
| android | [4] |
5,464,928 | 5,464,929 | Can't write normal page navigation | <p>Sorry for my English, no one helped me on Russian-speaking sites. This code has to create page navigation. On each page five articles for certain month have to be displayed. But when I change page month also changes. For example I need articles for 2012-12, and it shows articles for 2012-13 and so on. Sorry once aga... | php | [2] |
4,400,868 | 4,400,869 | java string.getIndex correct index ignoring punctuation | <p>If I had a string like this one that has punctuation like <code>,, ?, ;,</code>, what if I wanted to use <code>string.indexOf();</code> to search for a string such as "<code>like</code>", and get back the index? </p>
<p>If I remove all punctuation I could search it but because of the punctuation earlier it would gi... | java | [1] |
2,167,404 | 2,167,405 | sms through php from any no | <p>I know I can send sms through php using api or gateway.
But my question is how those websites send sms through our mobile no. How is this done.
Any help</p>
| php | [2] |
1,765,773 | 1,765,774 | Add and removing rows [with input field] in a table | <p>I'm a total javascript noobie. I developed the code bellow following and modifing some random tutorial I found.
It should add and remove rows with input fields at a table, however, it does nothing. It also worth saying that I called the function as a link. I added 'javascript:addRow()' inside the tag and at the he... | javascript | [3] |
1,470,811 | 1,470,812 | My Math.random() method always return with 1 ? WHy? | <p>There are 3 marbles randomly generated and i'll compare them if they are same,different or one is different. My code is below and my question is above... can u help me out ?</p>
<pre><code>public static void marb(){
int a[],b[];
int num=0;
a=new int[3];
b=new int[3];
a[0]=1;
a[1]=2;
a... | java | [1] |
3,038,078 | 3,038,079 | Javascript error: "missing ) after argument list" | <p>I am getting the error <code>missing ) after argument list</code> in my Firebug console.</p>
<p>I can't understand why. The problem is with the text that is passed in as an argument to the before() method. I am pretty sure it's something to do with the quotation marks. I have tried doing <code>\"</code> and <code>\... | javascript | [3] |
2,212,687 | 2,212,688 | Generating a unique random number between 2 numbers | <p>For my specific purposes, I need to generate a whole number between 1 and 120 inclusive (which I can do no problem). </p>
<p>Once that number has been generated, I need to pull it from the pool so it can't be generated again. </p>
<p>Continue this process until all numbers are exhausted, at which point, the pool... | android | [4] |
102,188 | 102,189 | Tracking Ip address and country name(asp.net)? | <p>Yesterday i saw a site in which, site is listing the ip address and country name, saying that recently visited members (a list of ip address with country name,city name). Can i know how can i track that information any reference or any code. Thank You.</p>
| asp.net | [9] |
5,105,545 | 5,105,546 | Create website login for Android? | <p>I'm creating an app for a website, and it requires the user to log in to access the game. How do I handle that login?</p>
<p>I have JSoup handling the parsing, and I can get the <code>username</code> and <code>password</code> fields from the website, but I'm not certain how to submit the login.</p>
<p>(And yes, I'... | android | [4] |
5,932,670 | 5,932,671 | How do you add extra html after an element with jQuery? | <p>I'm aware of <a href="http://api.jquery.com/append/" rel="nofollow">jQuery's append()</a> which appends html inside the selected element. I want to add more html after the selected element. For instance:</p>
<pre><code><a href="/somewhere/">Somewhere</a>
</code></pre>
<p>I want to add the html <code>... | jquery | [5] |
5,448,537 | 5,448,538 | jquery - how to change div text after form submit | <p>i have a form to enter directions and display a google map</p>
<pre><code><form action="#" onsubmit="setDirections(this.from.value, 'address', 'en_US'); return false">
</code></pre>
<p>Outside the form i have the following:</p>
<pre><code>Formatted Directions<div id="printdirec"><a href="http://ma... | jquery | [5] |
5,205,472 | 5,205,473 | Validation for dropdowns created dynamically using javascript | <p>I have few dynamic dropdowns that the created on change of a dropdownlist, on submit of addbutton I need to make sure that none of the dynamic dropdowns are empty. The default value of dynamic dropdowns is empty.</p>
<p>I tried the code below , but it does'nt seem to get the selected value of the dropdown.</p>
<pr... | asp.net | [9] |
5,155,805 | 5,155,806 | PHP template string replace | <p>just wondering what's the best approach for template String replace.</p>
<pre><code>preg_replace('/{%(\S+)%}/', 'bill', $tableOutput);
</code></pre>
<p>With the preg_replace, if there are lots of string needs to be replace, the function will be called many times depend on the number of string needs to be replace. ... | php | [2] |
2,547,011 | 2,547,012 | rand select between n and m | <p>here is code from programming pearls this code prints random numbers in decreasing form</p>
<pre><code>void randselect(m,n){
pre 0<=m<=n;
poset : m distinct integers from 0 ...n-1 printed in decreasing form
if (m>0)
if ( bigrand() %n)<m
print n-1//here i dont understand print n-1 what means?pr... | c++ | [6] |
3,594,426 | 3,594,427 | How to set up a connection with remote database in android? | <p>Can you please tell me how can I make a simple connection with remote db in android app? Basically, I want to save users names, emails etc. in a remote database and retrieve them later on demand. When answering - could you provide me some sample code so I can figure it out myself please? Thanks in advance!</p>
| android | [4] |
754,651 | 754,652 | What happens if i don't mark a non-serializable field as transient in java? | <pre><code>public class PersistentAnimation implements Serializable, Runnable
{
private Thread animator;
private int animationSpeed;
public PersistentAnimation(int animationSpeed)
{
this.animationSpeed = animationSpeed;
animator = new Thread(this);
... | java | [1] |
5,508,317 | 5,508,318 | php stay of user selection of radio button on refresh of form (due to error checking or other) | <p>This is my code</p>
<pre><code><input type="radio" name="rdNumber" value="100"<?=(isset($_POST['rdNumber']) == 100 ? "checked" : "")?>/>100
<input type="radio" name="rdNumber" value="1000" checked="checked"/>1000
</code></pre>
<p>It does not work as required.. when the form is submitted (and in... | php | [2] |
4,027,769 | 4,027,770 | Activity not losing its state when I rotate the emulator screen | <p>I have created one layout with two edit boxes. After I launch my application, I enter some text in both of the edit boxes, and I press the 7 and 9 buttons to rotate the emulator screen, and the text I have entered still remains. But I have read from the docs that upon screen orientation change, the activity will be ... | android | [4] |
350,201 | 350,202 | Creating a random number generator in jscript and prevent duplicates | <p>We are trying to create a random number generator to create serial numbers for products on a virtual assembly line.
We got the random numbers to generate, however since they are serial numbers we don't want it to create duplicates.
Is there a way that it can go back and check to see if the number generated has alr... | javascript | [3] |
2,664,811 | 2,664,812 | How to split E-mail address from a text? | <p>In a text box, I keep E-mail addresses.
for example </p>
<pre><code>Text_box.value="a@hotmail.com,b@hotmail.com,c@hotmail.com"
</code></pre>
<p>How can I split all of the email addresses? Should I use Regex?</p>
<p>Finally, I want to keep any E-mail address which is correctly coded by user</p>
| c# | [0] |
3,213,113 | 3,213,114 | What is the @ syntax in C# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/91817/whats-the-use-meaning-of-the-character-in-variable-names-in-c">What's the use/meaning of the @ character in variable names in C#?</a> </p>
</blockquote>
<p>i have seen in several places including Reshr... | c# | [0] |
3,862,718 | 3,862,719 | C++ Error in calling the function | <p>I have a function definition of the following form (within a large code):</p>
<pre><code>class Abc{
public:
bool func(const std::string& text,::DE::d type,unsigned a,unsigned& b);
};
</code></pre>
<p>Here DE is a class of the following form:</p>
<pre><code>class DE
{
public:
enum d{U,L};
};
</co... | c++ | [6] |
3,148,059 | 3,148,060 | Window pane hanging/freezing on resizing | <p>The pane is a child of CHtmlView. The pane is docked via Codejock XTP panemanager.</p>
<p>If I don't load help (.chm) into the pane it doesn't freeze at all. But when it's loaded the document is navigational and works fine.</p>
<p>While it's hanging, if I alt-tab to another window and then come back it stops hang... | c++ | [6] |
939,927 | 939,928 | Web page loading time using java | <p>How to know the time taken to load a web page using java..?Can any one help me regarding this..Thanks in advance..</p>
| java | [1] |
4,554,423 | 4,554,424 | How it is possible to stretch the image manually to our required pixel position | <p>How it is possible to stretch the image manually to our required pixel position.in my android application i want to stretch my image to the specified position by dragging the end points of it.can anybody suggest me how to do this............</p>
| android | [4] |
5,961,117 | 5,961,118 | trouble wih validation inside of asp wizard | <p>I have a group of 5 textboxes and I am using an asp:wizard. I want to check to see if all of the textboxes are empty I want to fire a label named lblItemBlock. Nothing I have tried has worked so far and so i tried cutting it down even smaller to test. I made the label visible on the page and on the active step tried... | c# | [0] |
3,596,121 | 3,596,122 | iPhone Screen Capturing Question | <p>I'm writing an iPhone App that allows people to share images that may be copyrighted(not illegally). The issue I am having is that I'm looking for a way to work around the screen capturing. Is there any possible way you can disable screen capturing or possibly distort the image in some way so capturing will be use... | iphone | [8] |
5,263,656 | 5,263,657 | asp.net search engine for static application | <p>i dont have much knowledge about asp.net, i have to do one simple search engine for my web application(c# asp.net),all are static pages, and some folders consistson aspx and html files... plz help me...</p>
<p>thanks in advance...</p>
| asp.net | [9] |
4,073,055 | 4,073,056 | cin.ignore(3) after failure to get a double with cin >> var | <p>I'm learning c++ with c++ Primer Plus, and I'm on chapter 7 and trying to create the following function:</p>
<pre><code>double getDouble(const char * message){
double temp;
std::cout << (message);
if (!(std::cin >> temp)){
std::cin.clear();
std::cin.ignore(3); // Why does thi... | c++ | [6] |
1,033,597 | 1,033,598 | jQuery No Conflict Mode for extra functions | <p>I'm sure this is a simple question, just can't seem to get it to work right.</p>
<p>I was having some conflicts with jQuery, so I used the aliasing feature mentioned in the official documentation.</p>
<pre><code>jQuery(document).ready(function($){
$('.loadmore').addClass('hidden'); // works fine!
loadmore();
... | jquery | [5] |
2,027,436 | 2,027,437 | if else-if making code look ugly any cleaner solution? | <p>I have around 20 functions (is_func1, is_fucn2, is_func3...) returning boolean</p>
<p>I assume there is only one function which returns true and I want that!</p>
<p>I am doing:</p>
<pre><code>if is_func1(param1, param2):
# I pass 1 to following
abc(1) # I pass 1
some_list.append(1)
elif is_func2(param... | python | [7] |
1,314,752 | 1,314,753 | Black screen after softkeyboard dissapear in android | <p>i am adding editoraction for my edittextfield using the below code</p>
<pre><code> ed1=(EditText)findViewById(R.id.editText1);
ed1.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if... | android | [4] |
3,926,385 | 3,926,386 | Background worker and garbage collection? | <p>Can I define a background worker in a method ? </p>
<pre><code>private void DownLoadFile(string fileLocation){
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler((obj, args) => {
// Will be executed by back ground thread asynchronously.
args.Result = Downl... | c# | [0] |
3,156,467 | 3,156,468 | Capture Video in iPhone | <p>I used the following code to record video.</p>
<pre><code> UIImagePickerController *m_objpicker;=[[UIImagePickerController alloc] init];
m_objpicker.sourceType = UIImagePickerControllerSourceTypeCamera;
m_objpicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
// hide ... | iphone | [8] |
1,448,264 | 1,448,265 | jQuery event on select change except one select | <p>I have a page with several select buttons. I would like for a function to be called in jQuery any select function except for say one with <code>id="Select1"</code> is changed. I know that I can link the function to each select that I want liked to the event, but it would be much more convenient to specify those th... | jquery | [5] |
5,292,962 | 5,292,963 | Unable to run a java program from another java program | <p>Iam trying to run a java file(editor.java) from another java program(exec.java). It takes input and displays file not found message.please give me suggestion through which I run a progam succesfully.</p>
<pre><code> import java.io.*;
public class exec {
public static void main(String argv[]) {
try {... | java | [1] |
2,712,049 | 2,712,050 | How to remove “A N D R O I D” text at boot up? | <p>At the Android 2.1 boot up i found "A N D R O I D" text . I want to hide this text or remove it. Do any one have the idea where i am storing this "A N D R O I D" text???</p>
| android | [4] |
3,619,108 | 3,619,109 | Object reference is not set into instance of an object | <p>I am retrieving data from database table.</p>
<p>By giving input as 1 in </p>
<pre><code>textbox1(voucherno)-->damagedetail =
web.getdamageddetail(Convert.ToInt32(voucherno.Text));
</code></pre>
<p>I want get <em>branchno</em> as output in textbox2(branchno) </p>
<pre><code>branchno.Tex... | c# | [0] |
858,901 | 858,902 | jquery input detect value change | <p>I downloaded a calendar from the web. This one: <a href="http://www.codeanddesign-studio.com/wp-content/uploads/2011/03/Date-Range-Picker.gif" rel="nofollow">http://www.codeanddesign-studio.com/wp-content/uploads/2011/03/Date-Range-Picker.gif</a></p>
<p>Calendar works great, now I want to check everytime that the i... | jquery | [5] |
5,833,150 | 5,833,151 | clearInterval doesn't work? | <p>I have some problem with this code, when I click the start button everything is working as expected but when I want to stop animation with <code>clearInterval</code> it doesn’t work, just keeps looping... What I am doing wrong? </p>
<pre><code> var a = function() {
$("div").animate({height:300},"slow");
... | jquery | [5] |
5,985,077 | 5,985,078 | Detecting utf8 encoding errors | <p>While working with Froogle, the datafeed is constantly bugging me with encoding problems in some article-descriptions.</p>
<p>The script, string and output is utf8 encoded, but I can't find the characters that cause the problem.</p>
<p>is there a way to detect troublesome characters?</p>
| php | [2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.