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 |
|---|---|---|---|---|---|
2,773,550 | 2,773,551 | how loop through return ajax data using jquery? | <p>My test.php file contains the following information that is sends list of information.</p>
<pre><code> while($row = mysqli_fetch_array($testResults))
{
echo "<li>" . $row['test'] . "</li>";
}
</code></pre>
<p>Output:</p>
<pre><code> <li> test A </li>
... | jquery | [5] |
1,491,971 | 1,491,972 | How to extract end of URL in Javascript? | <p>I have URLs in the form:</p>
<blockquote>
<p>serverName/app/image/thumbnail/2012/4/23/1335228884300/bb65efd50ade4b3591dcf7f4c693042b</p>
</blockquote>
<p>Where <code>serverName</code> is the domain name of the server.</p>
<p>I would like to write a JS function that accepts one of these URLs and returns the very... | javascript | [3] |
3,076,876 | 3,076,877 | Clearinterval name isn't defined after JS while loop | <p>I'm using this code:</p>
<pre><code>var s_wrap = document.getElementById('slider');
var s_list = document.getElementById('slider-list');
var li_items = s_list.getElementsByTagName("li");
var next = document.getElementById('next');
var pos, item_w, refreshIntervalId;
next.onclick = function() {
item_w = window... | javascript | [3] |
5,568,316 | 5,568,317 | Welcoming Guest using SQL tables | <p>I have this code currently inside of my page.</p>
<pre><code><?php
if ($admin->get_permissions()==3)
echo 'Welcome Administrator';
elseif ($admin->get_permissions()==1)
echo 'Welcome User';
else
echo 'Welcome Guest';
?>
</code></pre>
<p>Now if yo... | php | [2] |
4,458,766 | 4,458,767 | PHP PDO + copy out Array | <p>I have a PDO Query that returns what appears to be an array $pds. I can loop through this array as follows:</p>
<pre><code>foreach ($pds as $row) {
}
</code></pre>
<p>I need to loop through the same array a second time but when I do this there doesn't appear to be any data in the array. Also I've tried to copy t... | php | [2] |
3,387,271 | 3,387,272 | Combine an Image File with an Audio File | <p>I have a requirement in my PHP site to join an image(jpg or png) with an audio(wav) and the output should be a video (like mpeg ,mp4 or wav itself).</p>
<p>Is there any tool available for this?</p>
| php | [2] |
2,104,163 | 2,104,164 | Convert String to Double and put it into a Stack | <p>I have this expression, for example:
<code>400 2.11 +</code>
I try to push real numbers into a stack, when i do that, it shows me an error in this part of code</p>
<pre><code>ch = input.charAt(j);
if (ch >= '0' && ch <= '9' || ch == '.')
temp = temp + ch;
else if (ch == ' ') {
x = Double.pars... | java | [1] |
288,109 | 288,110 | java unicode encoded file reading problem in jdk 1.3 | <p>I am using jdk1.3 for blackberry platform. Now I am facing a problem when I trying to read an Unicode encoded xml file.</p>
<p>My code :</p>
<pre><code>java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(path),"UTF16"));
br.readLine();
</code></pre>
<p>... | java | [1] |
6,207 | 6,208 | Disable warning/error beep when changing focus | <p>Whenever I change the focus from one textbox to another it plays an irritating warning/error beep.</p>
<p>Example:</p>
<pre><code>public void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Return)
textBox2.Focus();
}
</code></pre>
<p>whenever I press <stron... | c# | [0] |
1,773,592 | 1,773,593 | C++: What is the default length of an int? | <p>I've been searching for a while but couldn't find a definite answer to this apparently simple question: what is the default length of an int? </p>
<p>I know that by default, an int is signed. But is it short or long? </p>
<p>According to the "Fundamental data types"table found in the following page, an int is a ... | c++ | [6] |
2,745,383 | 2,745,384 | How to replace jQuery with a different version | <p>ASP.NET 3.5</p>
<p>Project uses jQuery v1.2.6 which is included in a master page and I'd like to replace it with different version only on selected pages which use this master.</p>
<p>How can it be done?</p>
| jquery | [5] |
2,644,199 | 2,644,200 | How to disable call function on click | <pre><code>$('form').ketchup();
</code></pre>
<p>Form contains input with <code>type="submit"</code> and id, say, "bindOff". Is it possible not to call function when clicking on this input?</p>
| jquery | [5] |
1,586,142 | 1,586,143 | Fancy box does not work in second time | <pre><code>$(document).ready(function () {
$("#GridBusOne a[id*='l1']").fancybox( {
'type' : 'iframe',
'hideOnOverlayClick':false,
'hideOnContentClick': false,
'closeClick' : false,
});
});
<%--<a href="Mine.aspx" class="s11" id="s1">Click</a>--%... | jquery | [5] |
2,076,534 | 2,076,535 | Appending to a Python list without making list of lists | <p>I start out with an empty list and prompt the user for a phrase. I want to add each character as a single element of the array, but the way I'm doing this creates a list of lists. </p>
<pre><code>myList = []
for i in range(3):
myPhrase = input("Enter some words: ")
myList.append(list(myPhrase))
print(my... | python | [7] |
2,619,695 | 2,619,696 | Can I optimize checking for multiple null values in C# | <p>I have the following code: </p>
<pre><code>if (Session["CurrentUrl"] != null & Session["CurrentHost"] != null)
</code></pre>
<p>I use this in many places. I am wondering if anyone can think of a way to optimize the C# code just to make things slight more clear.</p>
| c# | [0] |
6,018,886 | 6,018,887 | How to change the background color on hover using jQuery | <pre><code><div>
<div id="nav">
<ul>
<li><a class="active" href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<script type="text/javas... | jquery | [5] |
3,639,894 | 3,639,895 | Java Script: Using Same Instance in two diffrent .js | <p>How can I use same instance of one particula .js across all .js functions</p>
<p>For eg: var test = new Test();</p>
<p>this test i need to use when ever I want to access Test() function(i.e same instance)</p>
| javascript | [3] |
1,333,715 | 1,333,716 | How can I change an option menu's sub-item selection color programmatically? | <p>I know how to change the selection color of android option menu but how can I change the selection color of an option menu's sub-item?</p>
| android | [4] |
4,972,957 | 4,972,958 | Why java.sql.Time.toString() adds hours? | <p>Follow the simple a example</p>
<pre><code>java.sql.Time t = new Time(1000);
System.out.println("Time t =" + t);
</code></pre>
<p>This gives the following output:</p>
<pre><code>Time t = 01:00:01
</code></pre>
<p>While I would expect:</p>
<pre><code>Time t = 00:00:01
</code></pre>
<p>Could someone tell me how ... | java | [1] |
899,238 | 899,239 | What do I need for a Windows C# quickstart? | <p>What bits and pieces do I need to be able to compile and run a simple Windows console application written in C#? Does the version of Windows matter?</p>
| c# | [0] |
2,474,053 | 2,474,054 | Function within a function in python | <p>I recently came across this idea of defining a function within a function in Python. I have this code and it gives error: </p>
<hr>
<pre><code>def f1(a):
def f2(x):
return a+x
return 2*a
</code></pre>
<hr>
<p>Error: On calling <code>f2(5)</code></p>
<pre><code>Traceback (most recent call last):
F... | python | [7] |
5,223,675 | 5,223,676 | Javascript <script> tag error | <p>I faced a strange issue today at my work place. In a JSP, i had multiple script tags like below, one of which has a empty space in src of the script tag. This JSP is loaded successfully firefox, after i input the values and click submit, the JSP is submitted twice, once with post request and other with get request. ... | javascript | [3] |
4,186,225 | 4,186,226 | setContentView not working | <p>i have file name TabGroupActivity.java which contains the below function as </p>
<pre><code> public void startChildActivity(String Id, Intent intent) {
try{
Window window = getLocalActivityManager().startActivity(Id,intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
if (wi... | android | [4] |
1,920,002 | 1,920,003 | Use ASP.NET when creating Windows 8 App | <p>Hi i just wonder if I could use ASP.NET to create a Windows 8 App or is ASP.NET only for homepages?</p>
| asp.net | [9] |
2,034,164 | 2,034,165 | Script that recognizes first sentence, put it inside a heading and the rest inside a paragraph | <p>Hey there,
I have this code, i take a wordpress post content, put it inside a variable and than match the first sentence, put it inside a h2 heading and the rest inside a paragraph.</p>
<p>1.The problem is this... my script recognizes only . or ! or ? at the end of the first sentance. <strong>Can i make it recogni... | php | [2] |
2,750,480 | 2,750,481 | How to check if current thread is not main thread | <p>I need to check if the thread running a certain piece of code is running on the main (UI) thread or not. How can I achieve this?</p>
| android | [4] |
6,022,667 | 6,022,668 | php method for key retrieval | <p>Is there any equivalent <strong>php method</strong> to 'urllib.urlopen()' for retrieving the public key from any public key server</p>
| php | [2] |
5,431,258 | 5,431,259 | Service or Bound Service? | <p>Simple question.</p>
<p>I'm creating an application that connects to an XMPP server on Android. I want to keep the connection on till the user logs out.</p>
<p>Should I use a regular Service or a Bound Service to keep the connection on?</p>
<p>Any tips, advice and helpful information are welcomed.</p>
<p>Thank y... | android | [4] |
1,129,966 | 1,129,967 | How can write pseudo-code on java to solve this? | <p>Suppose Alice has picked three distinct integers and placed them into a stack S in random order. Write a short, straightline piece of pseudo-code (with no loops or recursion) that uses only one comparison and only one variable x, yet guarantees with probability 2/3 that at the end of this code the variable x will st... | java | [1] |
2,269,014 | 2,269,015 | How to print a board in python? | <p>I was trying to program the game called triple triad on Python, but I have a problem with the output of the board, it has to be like this every square, where each number represents a cardinal point,there are 9 squares, three for every line.</p>
<pre><code>| 1 | 1 | 9 |
|2@3|1*6|7*2|
| 4 | 1 | 2 |
</code></pre>
<... | python | [7] |
2,802,693 | 2,802,694 | order by timestamp without a database? | <p>I have to store some info (timestamp of post, title and link) from various feeds (facebook,twitter,rss and some custom xml) without using a database. So I'm writing what I need to xml files and then pulling everything in using simplexml. This works fine. However, I need output the info from the various feeds in to a... | php | [2] |
3,321,161 | 3,321,162 | Documentation about a jQuery function return | <p>I've been looking at the API documentation for jQuery functions and one thing I cannot find is for any arbitrary function, what exactly does the function return. For example:</p>
<pre><code>$(this).appendTo($someElement);
</code></pre>
<p>What does the appendTo function return. I looked at the documentation and it... | jquery | [5] |
1,060,361 | 1,060,362 | Auto-Implemented Properties c# | <ol>
<li><p>could someone explain me what's the idea behind using Auto-Implemented Properties c#?</p>
<pre><code>public class Customer
{
public int ID { get; set; }
public string Name { get; set; }
}
</code></pre>
<p>I get the motivation to use properties for private field, so we can determine how one can acc... | c# | [0] |
2,506,549 | 2,506,550 | Jquery fold effect not working for asp.net controls? | <p>In asp.net, i am trying to do fold effect on div using asp.net button control but it is not working. instead of asp.net button when i put html controls the effect working fine. can any body help me why it is not working.</p>
<pre><code><script type="text/javascript" language="javascript">
$(document).ready(f... | jquery | [5] |
285,282 | 285,283 | how to get string from sms | <p>i need some help.
how to get text from sms, I will receive sms like this in my device "GPS location: <a href="http://maps.google.com/maps?q=-6.97425,107.63164" rel="nofollow">http://maps.google.com/maps?q=-6.97425,107.63164</a>" and if it start with "GPS location:" then i want to retrieve the link to my application,... | android | [4] |
4,277,522 | 4,277,523 | Facing problem to access resource file in maven project | <p>I am unableto access <code>myXml.xml</code> file through <code>MyStaticClass.java</code> class from following project structure.<br>
If I put this xml file somewhere under java folder I can access it by:</p>
<pre><code>MyStaticClass.class.getResourceAsStream("[...]/myXml.xml");
</code></pre>
<p>But can't access fr... | java | [1] |
4,421,169 | 4,421,170 | android hello world program taking too much time to run | <p>I had followed android developer forum for installation and done all the steps. But finally when i try to run the application , it is just handing on "ANDROID" black screen with below message on console</p>
<pre><code>[2011-10-09 23:59:27 - HelloAndroid] Android Launch!
[2011-10-09 23:59:27 - HelloAndroid] adb is r... | android | [4] |
5,856,547 | 5,856,548 | System.NullReferenceException: Object reference not set to an instance of an object | <blockquote>
<p><strong>Possible Duplicates:</strong>
<a href="http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net">What is a NullReferenceException in .NET?</a>
<a href="http://stackoverflow.com/questions/6213271/system-nullreferenceexception-object-reference-not-set-to-an-instance... | c# | [0] |
1,644,481 | 1,644,482 | better way to do Debug only assert code | <p>I am writing my first Android application and I am liberally using asserts() from junit.framework.Assert</p>
<p>I would like to find a way to ensure that the asserts are only compiled into the debug build, not in the release build.</p>
<p>I know how to query the android:debuggable attribute from the manifest so I ... | android | [4] |
470,015 | 470,016 | Online customization tshirt site | <p>I want to integrate an online customization options for tshirt where you can design your own tshirt with uploading images or using predefined templates/symbols/text etc..</p>
<p><a href="http://ilogo.in/personalize.php?p=3105#land" rel="nofollow">like this</a></p>
<p>Please help me with a prebuilt template/plugin/... | php | [2] |
2,586,747 | 2,586,748 | particular tabbar item hide when app loads in Tab bar controller? | <p>HI,
i have added the following in Appdelegate.m file to hide particular tab bar item("Hai") in tab bar controller(created by IB).but it did not work </p>
<pre><code> - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if ([viewContro... | iphone | [8] |
3,198,695 | 3,198,696 | Error converting a numeric month into textural representation | <p>I am using the following code in php to convert the month in numeric to textural representation. </p>
<pre><code>date('M',strtotime(8));
</code></pre>
<p>But for every digit I am getting 'Dec' as my month.</p>
<p>How should i make it work. </p>
<p>Thank you
Zeeshan</p>
| php | [2] |
5,559,711 | 5,559,712 | Using $_GET on other pages | <p>I have a search file - dir/search.php</p>
<p>In search.php:</p>
<pre><code><script type="text/javascript" src="timeout.js"></script>
</code></pre>
<p>In timeout.js:</p>
<pre><code><script src="functions.php"></script>
</code></pre>
<p>In functions.php in one line I have:</p>
<pre><code>... | php | [2] |
3,668,389 | 3,668,390 | Adding a button to the default incoming call screen in Android | <p>I'm in the process of developing an Android app for which I need to add a button on the incoming call screen. Is it possible to add a new button to the existing incoming call screen or should I create a custom screen specific to my app?</p>
<p>Edit:
I want to add a button in addition to the Answer and Decline butto... | android | [4] |
3,090,075 | 3,090,076 | How to set the label of a layout programmatically? | <p>Is it possible to set a label of a class/screen/layout programmatically? I am retrieving a short string e.g. "Today is Sunday" from a webpage and I would like to set that string as the title/label of the screen.</p>
<p>What I meant for label/title: The grey box at the top of the screen which can be set manually in ... | android | [4] |
4,545,713 | 4,545,714 | What's the best way to retrieve the position of an element relative to one of its ancestors? | <p>I have a td inside a table. </p>
<p>What's the best way to get its position relative to the table?</p>
<p>Should I be using offset, position or something else?</p>
| jquery | [5] |
3,817,368 | 3,817,369 | Common "Debug" function within class library | <p>I am using several class libraries within a project, and one of them is a typical "project.common.dll" library containing some common helper functions. One of these functions is a debug function that creates debug output.
Now I would like to enable/disable debug output by using a user-level property (application se... | c# | [0] |
3,984,038 | 3,984,039 | warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data -- C++ | <p>I made a simple program that allows the user to pick a number of dice then guess the outcome... I posted this code before but with the wrong question so it was deleted... now I cannot have any errors or even warnings on this code but for some reason this warning keeps popping and I have no clue how to fix it...
<str... | c++ | [6] |
4,819,660 | 4,819,661 | Why doesn't this jQuery add an image to my div? | <p>I am trying to use the <a href="http://api.jquery.com/add/" rel="nofollow">add function</a> to add an HTML fragment to a div but I can't get it to work. My code:</p>
<pre><code>$('#curveContainer').add('<img src="http://upload.wikimedia.org/wikipedia/commons/f/f0/Blue-dot-5px.png" alt="test" />');
</code></... | jquery | [5] |
4,028,001 | 4,028,002 | Can PHP include work for only a specified portion of a file? | <p>I have a PHP include that inserts an html form into another html form. When the form gets included I now have two form headers. Is there a php tag I could use that would allow me to...</p>
<pre><code><form id="orderform">
<!-- <?php for the include FROM here?> -->
PROD:<input class="ProductNa... | php | [2] |
4,527,085 | 4,527,086 | How to wait current thread execution and execute another thread completedly | <pre><code>public class Thread1 extends Thread {
public void run() {
testFun1();
}
public void testFun1(){
for(int i=1;i<10;i++){
try {
Thread.sleep(1000);
System.out.println("From testFun1() = "+i);
} catch (Exce... | java | [1] |
5,871,650 | 5,871,651 | Native methods in Java | <p>I have spent some time learning what are Java Native methods and that they are implemented in platform dependent code(mostly C).</p>
<p>But where can I find those native implementations of Java? eg : sleep(long millis) method of Thread class is native. But where is its implementation code???</p>
| java | [1] |
2,877,453 | 2,877,454 | File loop in PHP | <p>I wrote some code to create a text file just once each time I execute the php file.
Its idea is to check all existing files with a specific name then create a text file with the previous name +1</p>
<p>For example, if there is a file called <code>filetext0.txt</code>, my code will create a file called <code>filetex... | php | [2] |
1,381,764 | 1,381,765 | Removing Double space from a textbox using REGEX | <p>Input: </p>
<pre><code>"I want to remove double space from textbox."
</code></pre>
<p>Output: </p>
<pre><code>"I want to remove double space from textbox."
</code></pre>
<hr>
<pre><code>function valid(f) {
return f.replace(/^\s+|\s+$/g,'').replace(/\s+/g,' ');
}
</code></pre>
<p... | javascript | [3] |
705,348 | 705,349 | Store multi-line input into a String (Python) | <p>Input:</p>
<pre class="lang-none prettyprint-override"><code>359716482
867345912
413928675
398574126
546281739
172639548
984163257
621857394
735492861
</code></pre>
<p>my code :</p>
<pre><code>print("Enter the array:\n")
userInput = input().splitlines()
print(userInput)
</code></pre>
<p>my problem here is tha... | python | [7] |
5,715,307 | 5,715,308 | jquery loads after images | <p>Is it possible that any js document "$(document).ready()" loads before images load?</p>
| jquery | [5] |
2,165,359 | 2,165,360 | external-internal storage | <p>In android, whats the difference between external storage that is nonremovable (internal) and the internal storage? I am not sure where to save my data. I just need to save a game stats that a person can pull anytime they want</p>
<p>Thank you</p>
| android | [4] |
3,627,363 | 3,627,364 | Split string by delimiter ignoring delimiter inside quotes | <p>string from the file i'm importing: <code>1,2,3,"a","b","c","1,2,3,4,5",6,7</code></p>
<p>desired output would be an array split by the comma but ignoring any comma that falls between double quotes.</p>
<pre><code>[0] = 1;
[1] = 2;
[2] = 3;
[4] = "a";
[5] = "b";
[6] = "c";
[7] = "1,2,3,4,5";
[8] = 6;
[9] = 7;
</co... | php | [2] |
4,539,175 | 4,539,176 | Error 101 (net::ERR_CONNECTION_RESET): Unknown error | <pre><code><?php
// Connect to database //
require("phpsqlajax_dbinfo.php");
$con=mysql_connect("localhost","root","");
if (!$con)
{
die ('cannot connect:'.mysql_error()); }
mysql_select_db("tracking", $con);
function parseToXML($htmlStr) {
$xmlStr=str_repla... | php | [2] |
5,107,930 | 5,107,931 | How to prevent access to object properties that do not yet exist | <p>Often I have this situation:
<code>
var obj = { field: 2 };
</code></p>
<p>and in the code:
<code>
do_something( obj.fiel ); // note: field spelt wrong
</code></p>
<p>ie The property is incorrectly typed. I want to detect these bugs as early as possible.</p>
<p>I wanted to seal the object, ie
<code>obj = Object... | javascript | [3] |
3,562,118 | 3,562,119 | Wrong output from mktime() in PHP | <p>I am trying to set up a php where that it sets the date up for the 1st September for each year. I am using CRON to state that everytime the date is 7th September, then the php will actually update the database for rows whose dates ae a week before that 7th September, (ist September).</p>
<p>Now the code below I tes... | php | [2] |
2,935,569 | 2,935,570 | Weird JAVA Boolean Evaluation Issue | <p>Hi I have the following code:</p>
<pre><code> boolean result = someexpression();
if(!result)
{
System.out.println("False...");
}
if (result);
{
System.out.println("True");
}
</code></pre>
<p>It prints both (Fals... | java | [1] |
287,026 | 287,027 | Delegate method for UIImagePIcker notr getting called | <p>Please help me out because i have set the delegate self as well i set their protocol refrence in .h class.same code run for different class but not for this class.</p>
| iphone | [8] |
3,311,970 | 3,311,971 | Converting an array with 50,000+ entries into a mysql database | <p>Ok, so I am helping someone with their site. Their original coder thought it would be a great idea to put their entire database in an array.</p>
<p>I am looping through each piece of data in the array and inserting it into a new mysql table I created, the rows are getting inserted just fine but the problem is that ... | php | [2] |
2,820,932 | 2,820,933 | Errors when modifying a dictionary in python | <p>Suppose I want to create a dictionary that maps digits to numbers less than 100 ending in those digits as follows:</p>
<pre><code>d = {}
for i in range(100):
r = i % 10
if r in d:
d[r] = d[r].append(i)
else:
d[r] = [i]
print d
</code></pre>
<p>First of all, when i is 20, d[r] is apparently a NoneType when I... | python | [7] |
2,769,109 | 2,769,110 | How to check if a program is installed on system | <p>how can I check with Java if a program is installed on system, for example to check for Mozilla Firefox?</p>
| java | [1] |
1,649,262 | 1,649,263 | How to unbind a live event? | <p>I am trying to unbind the click event for my code.</p>
<p>I have</p>
<pre><code>$('#test').unbind('click'); //this won't work
$('#test').live('click', function(e){
alert('alert')
$(this).unbind(e) //this won't work
})
</code></pre>
<p>I am using jquery 1.63 and I need <code>.live</code> for my element.</... | jquery | [5] |
5,501,424 | 5,501,425 | How to save empty form field as null? | <p>I have a html form that sends POST data to php file.
In php I'm making a query to mysql database. In database I have int column that accept null.</p>
<p>The problem is when web form field is empty, I want to save null to database.
I tried to make check before building the query</p>
<pre><code>if (empty($licence))
... | php | [2] |
3,442,781 | 3,442,782 | appendTo() not working in chromium 14 linux | <p>I'm trying to append data into <code><h5></code> tag in below manner..</p>
<pre><code>$('<h5>').text(data[key].age).appendTo('#myContainer' + i);
</code></pre>
<p>but in chromium 14 for linux, this type of chaining doesn't work so i'll have to use..</p>
<pre><code>var x = $('<h5>').text(key);
x.... | jquery | [5] |
5,096,413 | 5,096,414 | Detect touch on EditText, but not interrupt it? | <p>I need to know when the user touches/taps/clicks the edittext in my activity.</p>
<p>How can I do this without interrupting the events, so the keypad still displays properly?</p>
<p>(And I need to know about it before the OS displays the keypad...if possible)</p>
| android | [4] |
2,696,428 | 2,696,429 | Binary tree through jQuery | <p><a href="http://frank-mich.com/jQuery/" rel="nofollow">http://frank-mich.com/jQuery/</a> .this is the link where i can draw binary tree. but when I copied the source, everything is working well but the tree is not getting displayed inside the box. Please anybody who can solve this problem and give me code after remo... | jquery | [5] |
4,604,065 | 4,604,066 | Any better alternatives for getting the digits of a number? (C++) | <p>I know that you can get the digits of a number using modulus and division. The following is how I've done it in the past: (Psuedocode so as to make students reading this do <em>some</em> work for their homework assignment):</p>
<pre><code>int pointer getDigits(int number)
initialize int pointer to array of som... | c++ | [6] |
4,830,462 | 4,830,463 | thumbs.db messing up my upload routine | <p>I'm getting the following error while uploading a zip archive.</p>
<pre><code>Warning: ZipArchive::extractTo(C:\xampplite\htdocs\testsite/wp-content/themes/mytheme//styles\mytheme/Thumbs.db) [ziparchive.extractto]: failed to open stream: Permission denied in C:\xampplite\htdocs\testsite\wp-content\themes\mythem\upl... | php | [2] |
4,089,579 | 4,089,580 | Application crashes on setting two onclick listener | <p>I have placed the following code in the main activity in the onCreate method </p>
<pre><code>public class MyTest extends Activity implements OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//... some other code here to init the layout
... | android | [4] |
4,450,915 | 4,450,916 | javascript function name vs function literal usage | <p>When testing for a partial evaluation function: </p>
<pre><code>function partialEval(fn)
{
var sliceMethod = Array.prototype.slice;
if(arguments.length > 1)
{
var aps = sliceMethod.call(arguments, 1);
}
return function () {
return fn.apply(this,aps.concat( sl... | javascript | [3] |
2,322,120 | 2,322,121 | Python: Mapping with Index of Previous Occurrence | <p>I'm often met with an analog of the following problem, and have had trouble writing clean code to solve it. Usually, I have something involving a temporary variable and a for loop, but is there a more elegant way?</p>
<p>Suppose I have a list of booleans or values which evaluate to booleans:</p>
<pre><code>[True, ... | python | [7] |
3,169,621 | 3,169,622 | Getting folder name | <p>I iterate over a bunch of folders and files in the folders, doing this:</p>
<pre><code>def get_files_in_directory(directory=rootDirectory):
for root, dirs, files in os.walk(directory, topdown='true'):
print("root %s dirs %s files %s" %(root, dirs, files));
for file in files:
ext = os... | python | [7] |
5,727,086 | 5,727,087 | How to remove AspxAutoDetectCookieSupport | <p>Many of my url's on my site www.mysite.com/Display.aspx?ID=128</p>
<p>gets displayed to users as</p>
<p>www.mysite.com/Display.aspx?ID=128&AspxAutoDetectCookieSupport=1</p>
<p>How can I remove AspxAutoDetectCookieSupport.</p>
<p>I understand it has to do something with cookie in web.config, but where? And w... | asp.net | [9] |
341,893 | 341,894 | Blowfish Crypt confusion | <p>Not sure why but i think i have totally not understood how this works....</p>
<p>I found an example script which had this:</p>
<pre><code>echo crypt('abc123', '$2a$04$saltsaltsaltsaltsaltxx');
</code></pre>
<p>And it claims to give the output:</p>
<pre><code>$2a$04$saltsaltsaltsaltsaltxuK2.MS4sJd6ZjnuS0fp2eenjnd... | php | [2] |
2,375,110 | 2,375,111 | Getter function that won't crash when object not found | <p>I have a class that contains a member variable which is a list of custom objects. I am trying to write a getter function which looks through this list trying to find one with the provided name. I would like to return said object by constant reference if found, or just output "Object with name "name" not found." othe... | c++ | [6] |
5,514,570 | 5,514,571 | How to make application completely ignore screen orientation change in Android? | <p>Is there a way to make an application completely ignore a screen orientation change?</p>
| android | [4] |
4,617,985 | 4,617,986 | Strange arithmetic error with vectors | <p>I am using DirectX to draw on screen. </p>
<p>I want to make the image about whilst keeping the dimensions, so I am assigning some arithmetic to the vertexes:</p>
<pre><code>float boxPosFactorX = (869-3)+(100/100 * (1063 - 869));
float boxPosFactorY = (940-3)+(100/100 * (1038 - 940));
vertexes[0].Position = ne... | c# | [0] |
3,949,599 | 3,949,600 | ASP.NET Cache unique | <p>Is HttpRuntime Cache unique for each user in ASP.NET as well as the Sessions?</p>
| asp.net | [9] |
2,453,131 | 2,453,132 | How to replace \" in a string with \\"? | <p>I would like to replace \" in a string with \\" using c#.
I wanna escape this character. I cant find and replace \ with \\.</p>
| c# | [0] |
3,997,392 | 3,997,393 | Dirty memory use in iOS | <p>My app uses about 50 MB of memory at startup when I look at dirty memory using the VM Tracker instrument. It's a pretty simple app, and from what I recall at WWDC this year, this seems like way too much memory use for an app with only one simple UIWebview at startup. </p>
<p>I think I recall someone from Apple te... | iphone | [8] |
3,028,988 | 3,028,989 | How to set the background color of new activity after clicking tabs | <p>I am switching activities on tab clicks and successful at this. But, in one of my Activity class I am doing the following:
<code>public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main);}</code></p>
<p>main.xml has the following:</p>
<pre><code><LinearL... | android | [4] |
3,374,194 | 3,374,195 | 'pow' Was Not Declared In This Scope | <pre><code>#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int e=0;
int b=0;
cout<<"Enter Exponent";
cin>>e;
cout<<"Enter Base";
cin>>b;
pow(e, b);
cout<<"Power:"<<e;
return 0;
}
void pow(int e, int b)
{
i... | c++ | [6] |
2,956,982 | 2,956,983 | Simple JavaScript not working | <p>Can somebody tell me what I am doing wrong?</p>
<pre><code>window.onload = initForm;
function initForm() {
var allTags = document.getElementsByTagName("*");
for(i=0; i<allTags.length; i++) {
if (allTags[i].className.indexOf("textbox") > -1) {
allTags[i].onFocus = fieldSelect;
... | javascript | [3] |
3,984,163 | 3,984,164 | PHP DOMDocument stripping HTML tags | <p>I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this:</p>
<pre><code><block name="content">
<?php echo 'this is some rendered PHP! <br />' ?>
<p>Main column of <span>content</span></p>
</block... | php | [2] |
3,176,152 | 3,176,153 | Distance Routing Vector Implementation | <p>I am trying to implement Distance Vector Routing algorithm, using <a href="http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html" rel="nofollow">http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html</a><br>
(in C++). </p>
<p>Here is what I have done so </... | c++ | [6] |
3,574,303 | 3,574,304 | Getting more than excepted with siblings().length | <p>I have the following html</p>
<pre><code><div id="myDiv">
<table>
<tbody>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
&l... | jquery | [5] |
564,548 | 564,549 | is it possible to share desktop screen on web site through .net c#? | <p>is it possible to share desktop screen on web site through .net c#?<br>
My requirement is that, I want to create a website in C# which allow users to share their screens</p>
| c# | [0] |
4,823,776 | 4,823,777 | Server tag in OnClientClick | <p>The following gives me an error of "The server tag is not well formed"</p>
<pre><code><asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete"
OnClientClick="return confirm('Are you sure you want to delete <%# Eval("Username") %>?');">
Delete
</asp:LinkButton>
</code></pre>
... | asp.net | [9] |
5,762,828 | 5,762,829 | why is that my context.getResources().getStringArray() still got error | <p>Good day, i am figuring out what's wrong with my code. I hope you guys can help me.
This is my code:</p>
<pre><code>String[] commandWords =
context.getResources().getStringArray(R.array.on_command);
</code></pre>
<p>This is my strings.xml file:</p>
<pre><code> <?xml version="1.0" encoding="utf-8... | android | [4] |
5,425,813 | 5,425,814 | Should I somehow protect my $_FILE user input? | <p>I want to make my site hack-proof so this is why I do:</p>
<pre><code>Text: mysql_real_escape_string($myVar);
Number: (int)$myVar;
</code></pre>
<p>Should I use something similar to file array that is given by <code>$myVar = $_FILE['myFile'];</code> ?</p>
| php | [2] |
4,126,175 | 4,126,176 | android phone won't have 2 dev apps on it at once | <p>i'm developing a couple of apps at the moment one is an image-processing app, the other a google maps app. when i'm developing them i can only have one app at a time on the phone. is there any reason for this? my phone is a Samsung galaxy portal api2.1.</p>
<p>i'd like to have a few apps on my phone that are in the... | android | [4] |
4,192,465 | 4,192,466 | texlive.js possible? | <p>I just found about <a href="https://github.com/kripken/emscripten/wiki" rel="nofollow">emscripten</a>,
<a href="http://manuels.github.com/texlive.js/website/" rel="nofollow">texlive.js</a> is it really a converted version of texlive in JavaScript or a server as <a href="http://www.scribtex.com/" rel="nofollow">Scrib... | javascript | [3] |
478,310 | 478,311 | Define a js function inside another js function | <p>I've recently found this code snippet:</p>
<pre><code>function start() {
function sleep(milliSeconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliSeconds);
}
sleep(10000);
return "Hello Start";
}
</code></pre>
<p>What advantages do we ... | javascript | [3] |
4,967,770 | 4,967,771 | String helper method | <p>I need a little help on how i could put in a helper method. This is the helper method I wrote.</p>
<pre><code>public static String helper(String help) {
help = help.toLowerCase();
help = help.replaceAll("\\s+", "");
}
</code></pre>
<p>and this is how i used it in main method.</p>
<pre><code>String help = ... | java | [1] |
5,377,620 | 5,377,621 | js code to tell if a function is available for an object | <p>The following line of javascript gets a Uncaught TypeError: <strong>Object #Text has no method 'getAttribute'</strong> in chrome and safari but not in IE.</p>
<pre><code>this.Element.getAttribute("whatever")
</code></pre>
<p>I get that this.Element is the main problem, but would like a temporary fix for debugging ... | javascript | [3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.