Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
3,498,071
3,498,072
compare if with hebrew letter
<p>I write code that work only with english letters. when I ctry to do it with hebrew letter I get error.</p> <p>the code:</p> <pre><code>&lt;?php $idan="emr"; $firstletter = mb_substr($idan, 0, 1, 'UTF-8'); if ($firstletter=='e') echo "tov"; else echo "lo tove"; ?&gt; </code></pre> <p>work good. but the code:</p> ...
php
[2]
2,381,169
2,381,170
Pointers in javascript?
<p>Can we pass a reference of a variable that is immutable as argument in a function ? </p> <p>Example:</p> <pre><code>var x=0; function a(x) { x++; } a(x); alert(x);//Here i want to have 1 instead of 0 </code></pre>
javascript
[3]
1,008,568
1,008,569
Android - Parabolic motion
<p>I have a moving object in surface view it stat moving from fixed location.</p> <p>I need set to it to be move like parabolic way ..my object drawn like using x and y so I do</p> <p>not know using that thread how to calculate the X and y plz help?</p>
android
[4]
3,826,035
3,826,036
Installing .apk file on Emulator in Linux
<p>I'm trying to integrate the Zxing Bar code scanner into an application, but I need to install the bar code application on the emulator first. I already downloaded the .apk file. How do I install it on the emulator? I'm running Ububtu.</p>
android
[4]
1,632,077
1,632,078
Retrieve the list of alla jpg file of a directory
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3202203/finding-a-file-with-a-specific-name-with-any-extension">Finding a file with a specific name with any extension</a> </p> </blockquote> <p>i've this code for put into an array all the files contained into ...
php
[2]
2,906,973
2,906,974
Servlet Security question about j_security_check, j_username and j_password
<p>I used jdbcRealm in my web application and it's working fine. I defined all constraints also in my web.xml. Like all pages of url pattern /Admin/* should be accessed by only admin. I have a login form with uses standard j_security_check, j_username and j_password.</p> <p>Now, when i type Admin/home.jsf it rightly r...
java
[1]
3,603,350
3,603,351
Pause and Resume a For-Loop in C#
<p>hey guys, m working on a windows App in C#, i have a for-loop which does some updation in a loop, and i have 3 buttons on the form named "Stop,Pause,Resume". So the purpose is same as the buttons named.. any1 outthere know this how to do?</p> <p>Here is the Loop</p> <pre><code> private void btnCompleteAuto_Clic...
c#
[0]
3,011,233
3,011,234
capture mousedown event and get clientX and clientY in Mozilla
<pre><code>if (browserName == "Firefox") { if (window.captureEvents(Event.MOUSEDOWN)) { window.mousedown = load; } } function load(e) { alert(e.clientX); } </code></pre> <p>I want to mousedown on canvas and get <code>clientX</code> and <code>clientY</code>. I'm doing it the above way but not getting...
javascript
[3]
5,942,988
5,942,989
passing parameters from one php to multiple php
<p>.I have three php pages:</p> <p>page1.php page2.php page3.php</p> <p>on page1.php i have this code:</p> <pre><code>&lt;form id="try" method="post" action="page2.php"&gt; Batch: &lt;input id="batch" name="batch" type="text"/&gt;&lt;br /&gt; Dept: &lt;input id="dept" name="dept" type="text"&gt;&lt;br /&gt; &lt;inpu...
php
[2]
4,723,101
4,723,102
MediaPlayer video not showing
<p>I have this big problem with playing video on my app. I have this game and wanted to show some videos somewhere but, in the best case I can hear the sound but not see the video.</p> <p>this is the holder</p> <pre><code> public void surfaceCreated(SurfaceHolder holder) { level.playerholder = holder; ...
android
[4]
1,784,981
1,784,982
ASP.Net OnClick vs Function() Handles buttonName.Click
<p>What is the difference between using the OnClick attribute of an ASP.Net Button:</p> <p><code>&lt;asp:Button ID="btn" runat="server" Text="New" OnClick="enterFunctionHere" /&gt;</code></p> <p>vs. </p> <p>using the event directly in the function:</p> <p><code>Sub addNew() Handles btn.Click</code></p> <p>Thanks!<...
asp.net
[9]
435,454
435,455
Сompound string from multiple input fields
<p>I have a 3 input fields. 2 for values and one fild for result.</p> <pre><code> &lt;input type="text" value="" id="name"&gt; &lt;input type="text" value="" id="surn"&gt; &lt;input type="text" value="" id="result"&gt; </code></pre> <p>In the results of the first two zancheniya fields must be joined. For ...
jquery
[5]
5,426,162
5,426,163
Jquery disabling auto window scrolling
<p>I've created a simply Jquery image transition viewer, and every time a new photo is loaded, the window automatically scrolls up to the top of the new image that just loaded. I am trying to stop this, so that the transition does not interrupt wherever the user may be on the page. </p> <p>Here is my code so far:</p> ...
jquery
[5]
2,258,345
2,258,346
The method length() is undefined for the type JSONArray
<p>Eclipse always gives me this compilation error when I try to get the length of a JSONArray:</p> <blockquote> <p>the method length() is undefined for the type JSONArray</p> </blockquote> <p>Here is the code:</p> <pre><code>import org.springframework.context.annotation.Scope; import java.net.*; import java.io.*; ...
java
[1]
269,511
269,512
return value from a function running in separate thread
<p>I have this code that allows to execute functions in a separate thread if "Asynch" annotation is present on them. Everything works fine, except for the day when I realized I also have to handle return value for some new functions that I've just added. I could use handlers and message-passing for this, but, due to al...
java
[1]
208,975
208,976
how to avoid 'session break' in two panels
<p>i am a student and i am new in php</p> <p>i am working on my project</p> <p>i have two panels in my website (localhost) one is user other is admin</p> <p>in both panels i hace created sessions on all pages</p> <p>on user panel:</p> <pre><code>session_start(); if(!isset($_SESSION['user'])) header("Location: i...
php
[2]
555,477
555,478
"or die()" in Python
<p>Is anyone using anything like this in Python:</p> <pre><code>def die(error_message): raise Exception(error_message) ... check_something() or die('Incorrect data') </code></pre> <p>I think this kind of style is used in PHP and Perl.</p> <p>Do you find any (dis)advantages in this [style]?</p>
python
[7]
2,770,465
2,770,466
Using global variable as default parameter
<p><strong>a.py</strong></p> <pre><code>#!c:/Python27/python.exe -u from connection import Connection import globals globals.server_ip = '192.168.0.1' connection = Connection() </code></pre> <p><strong>globals.py</strong></p> <pre><code>#!c:/Python27/python.exe -u server_ip = '127.0.0.1' </code></pre> <p><strong...
python
[7]
4,677,933
4,677,934
Duplicate methods in java.io.Console?
<p>In <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Console.html" rel="nofollow"><code>java.io.Console</code></a>, there are two methods, <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Console.html#printf%28java.lang.String,%20java.lang.Object...%29" rel="nofollow"><code>printf</code></a> and <a ...
java
[1]
5,849,493
5,849,494
Why isnt the jquery anchor tag scroll working?
<p>Im trying to use some jquery to scroll some content on a portfolio gallery. The code im using i found on another site and allows the user to click the yellow arrows to scroll each project one at at time with anchor points however mine isn't allowing me to do that at the moment and im not sure why?</p> <p>I've set u...
jquery
[5]
1,845,260
1,845,261
jquery iterator function parameters
<p>How can I pass a parameter to a jquery iterator function (or whatever they're called), like:</p> <pre><code> var states = new Array(); states.push(true); $(children).each(function(states) { if(this.depth&gt;states.length) { states.push(this.collapsed); } else ...
jquery
[5]
5,455,519
5,455,520
Separate the digit in an Integer (User-Input)
<p>How do I enter a digit like '23423' and output it like '2 3 4 2 3'? And how do I make it so that user cannot enter less or more than 5-digits? (Your help would be appreciated. I just need hints from you guys since I'm learning Java. Looking forward to learn something new.)</p> <p>This is what I have so far:</p> <p...
java
[1]
633,778
633,779
iphone - comparing two times
<p>how do i , given two times in HH:mm:ss format compare then and determine which is the later time. </p> <p>12:00:00 &amp; 14:00:00 </p> <p>how do i determine that 14:00:00 is the later time </p>
iphone
[8]
2,360,583
2,360,584
How to align an 90 deg rotated label perfectly with the pixels?
<p>When rotating a label, the text is rendered very ugly. Is there an convenient way to get the label aligned with the pixels? Maybe there is some way of rounding the transform of the view, so that it isn't misaligned?</p>
iphone
[8]
3,625,521
3,625,522
Javascript get element that was clicked based on ClassName
<p>First, I would have created this example in JSFiddle but they are in read-only mode.</p> <p>I would like to get the specific element that was clicked based on a class.</p> <pre><code>var button = document.getElementsByClassName("mybutton"); button.onclick = function() { //how do I reference the specific button...
javascript
[3]
1,418,109
1,418,110
Loop and comparing each element of array?
<p>I am trying to compare each element from two array <code>$min</code> and <code>$max</code></p> <pre><code>$test = false; $min = array(2,3,3,55,556); $max = array(22,32,4,56,557); foreach($min as $key=&gt;$val){ foreach($max as $k=&gt;$v){ if($val &gt;= $v){ $test=true; break; } } }...
php
[2]
4,553,905
4,553,906
No Dumpbin.exe
<p>I do not see dumbin.exe on my sysytem . I have Visual Studio 2005 on my system . When I type dumpbin on command line , it says unrecognizable command .</p> <p>Does not it come ( by default ) with Visual Studio , or do I have to explicitly add this tool . </p>
c++
[6]
4,348,460
4,348,461
What is Operator overloading? Is operator overloading a specific feature to C++ and not available in Java
<p>Please explain in detail with examples. Thank you</p>
c++
[6]
4,306,635
4,306,636
Python: How to switch off scaning of the lib directories at start
<p>I have installed my own python with 10000 additional modules. Both the python and the modules are located on a small NFS share. When I start the python it scans all its library directories and looks for available modules. It takes several seconds.</p> <p>How I can explicitly switch this scanning process off?</p>
python
[7]
4,702,169
4,702,170
Can I call a funcion when I stop to "resize" the window?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/667426/javascript-resize-event-firing-multiple-times-while-dragging-the-resize-handle">javascript resize event firing multiple times while dragging the resize handle</a> </p> </blockquote> <p>Tried :</p> <pre><...
jquery
[5]
3,788,933
3,788,934
Code conversion from C to C#
<p>I have to convert code from c to c#. I want to know in how many ways I can do that. Are there any tools which will convert code from c to c# without affecting the functionality.</p> <p>Thanks &amp; Regards,</p>
c#
[0]
2,723,857
2,723,858
Difference between getmypid() and posix_getpid()
<p>What's the difference between the getmypid() and the posix_getpid() functions?</p> <p>I turned to getmypid() because my script has to run both on Windows and on Linux.</p>
php
[2]
2,960,728
2,960,729
How can obtain age by birth date
<p>I want get the exact age of the following date in var <code>$birth_date</code> by php, How is it?</p> <p><code>$birth_date = 2011/12/16;</code></p> <p>$birth_date => For example, this is my birth date.</p> <p>For example output from my birth date is: <code>0 Year, 0 Month, 1 Day</code></p>
php
[2]
5,916,190
5,916,191
applying force to more than one object
<p>hi i have been working with chai-3d and opengl for creating a simulation for haptic device . i have drawn a sphere which is positioned at center and another small spheres positioned around the center sphere, for each 15deg a sphere will be drawn based on the center sphere.below piece of code will draw center sphere....
c++
[6]
5,067,323
5,067,324
Object Oriented Programming in Javascript
<p>Consider an OOP model. I wanted to implement, </p> <pre><code>funct1( arg ).subfunct1( arg ); ( </code></pre> <p>Of course like jQuery. where you have <code>$( arg ).subfn( arg )</code></p> <p>I have done it successfully for one subfunction. BUT,</p> <pre><code>funct1( arg ).subfunct1( arg ); // ==&gt; works fi...
javascript
[3]
1,844,382
1,844,383
What's the term for this? [found, fluent interface]
<p>What's the term for this design?</p> <pre><code>object.method1().method2().method3() </code></pre> <p>..when all methods return *this?</p> <p>I found the term for this a while ago, but lost it meanwhile. I have no clue how to search for this on google :) Also if anyone can think of a better title for the question...
c++
[6]
5,163,120
5,163,121
Printing from Tkinter or PMW intrerface
<p>I have created an interface in both Python Mega Widgets and Tkinter that is an interface to a SQlite3 database. The query results are returned as a list and disiplayed in a memo field located on the main frame of the display.</p> <p>Can I create a small function that will be launched from a button that will <strong...
python
[7]
2,992,816
2,992,817
Problem with implicitly conversion of string
<p>I have a object 'currentVersion' of type Data and string variable of 'version',i need to assign what ever things coming 'version' to 'currentVersion' Code is like this</p> <pre><code> private static DataVersion currentVersion = new DataVersion(); string version = this_event.variableData[1].atr_value; and ...
c#
[0]
2,443,826
2,443,827
Get content of a file, throws "host name may be null"
<p>I'm having a trouble getting the content of a file located at a address similar to "http:///127.0.0.1:1935/app/unique_id/file.txt". The exception states that the host name may be null. I think the problem is due to the port.</p> <p>How do I get the content of the file?</p> <pre><code> final HttpGet httpGet...
android
[4]
122,019
122,020
Android: how to cancel a request of Location update with intent?
<p>I registered a PendingIntent to requestLocationUpdates(provider, minTime, minDistance, PendingIntent). But when my broadcast receiver receives this intend, how do I remove this request with removeUpdates(PendingIntent)? The receiver doesn't hold a reference to the original PendingIntent.</p>
android
[4]
3,944,179
3,944,180
How do I force a ViewGroup to draw off screen?
<p>I have several LinearLayouts that get filled with downloaded images or text within a ScrollView. The LinearLayouts have a LayoutAnimation applied to them, so each one "slides" into place when drawn. Is there a way to force the offscreen LinearLayouts to draw so that by the time the user scrolls to them, the animat...
android
[4]
5,463,284
5,463,285
String to date with no format specified
<p>I want to convert a string into a date, this is simple. But what I'd like to do it without knowing the date format.</p> <p>Here is a situation: say I have 100 dates and all are in the same format but I'd like to write a Java program to find out this format for me. The result of this program should give me a list of...
java
[1]
14,100
14,101
create new array from a multidimensional array
<p>I have this multidimensional array: </p> <pre><code>Array ( [0] =&gt; Array ( [id] =&gt; 1 [list_name] =&gt; List_Red ) [1] =&gt; Array ( [id] =&gt; 2 [list_name] =&gt; List_Blue ) ) </code></pre> <p>...and i would like to create a new array containing only the [id]'s from it.</p> <p>I would appreciate it alot if...
php
[2]
2,898,527
2,898,528
How do I identify or know which control is being referenced in a method?
<p>In my specific case, how do I identify or know which UITextField is being referenced in shouldChangeCharactersInRange method?</p> <p>I know the parameter (UITextField*)textField contains the object being referenced, but how do I compare to identify which one it is?</p>
iphone
[8]
5,394,643
5,394,644
Read a particular line in a string?
<p>Here is my string line:</p> <pre><code>string conSTR = "Data Source=(local);Initial Catalog=MyDB;User ID=sa"; </code></pre> <p>I just want to get the string <code>"(local)"</code>, and <code>"MyDb"</code> and <code>"sa"</code> word anybody can suggest how to do it in C#.</p>
c#
[0]
5,114,185
5,114,186
OVERLOADING OPERATORS = error
<p>I am trying to use overloading concept to equate 3 objects <code>c1</code>, <code>c2</code>, <code>c3</code>. But it is giving me an error </p> <pre><code>error: no match for 'operator=' in 'c3 = c2. circle::operator=(((circle&amp;)(&amp; c1)))' </code></pre> <p>What's the reason behind it how do I rectify it??</p...
c++
[6]
1,236,070
1,236,071
post method in javascript
<p>How i can pass the value from javascript post method from one page (home.aspx) to another page(post.aspx) which needs to open in new window using window.open method .? My code below:this javascript function called in button click event.</p> <pre><code>function postwith () { var myForm = document.createElement("fo...
javascript
[3]
2,562,950
2,562,951
Why is this code Seg_Faulting?
<p>I can't understand why this code would segmentation fault. Any help out there? This is for a riddle in a book, not for a homework assignment. </p> <p>Code : <a href="http://pastebin.com/WvWkckzX" rel="nofollow">http://pastebin.com/WvWkckzX</a></p> <p>Input : <a href="http://pastebin.com/yvHXquuf" rel="nofollow">ht...
c++
[6]
5,820,622
5,820,623
How to check whether a default browser is opened in the operating system (Java)?
<p>I am newbie here. During my work, I faced an interesting problem. I need to:</p> <p> <ul> <li>check whether a default html browser is opened; <li>check whether the browser is minimized/maximized (simply, a window's state); <li>get an url address typed in the browser. </ul> </p> <p><p>If any of these conditions is ...
java
[1]
2,734,190
2,734,191
issue with Javascript image changer
<p>I have a script running on my page to change the images. I want to repeat it 6 times to use in other places on the same page, but it wont work when I repeat it.</p> <pre><code> var delay = 2000 //set delay in miliseconds var curindex = 0 var randomimages = new Array() randomimages[0] = "hhh200.jpg" rando...
javascript
[3]
918,456
918,457
Access violation writing location 0xaaaaaaaa
<p>This is my current code of the class Score in the <code>Score.h</code> file:- </p> <pre><code>class Score { protected: long m_Scores; long m_HighScore; //private: public: Score(); ~Score(); void Init(); void Update(float deltaMS); void Render(); void Release(); void SetScore(long sc){ m_Scores=sc; } long Ge...
c++
[6]
1,810,231
1,810,232
Is there a way to return/print list item without quotes or brackets?
<p>Sorry if this is already mentioned somewhere(I couldn't find it).</p> <p>I basically want to list an item from a list but its including quotes and brackets(which I don't want). Here's my data:</p> <pre><code>inputData = {'red':3, 'blue':1, 'green':2, 'organge':5} </code></pre> <p>Here's my class to find items eit...
python
[7]
5,579,849
5,579,850
for loop in php - list ul li tags
<p>I need to find out how to list ul navigation, maybe in a <code>for</code> loop? Each ul have different classes (there is max 3 ul)</p> <p>first ul class named "first", "center", and "last" </p> <p>I need some samples to get started. </p> <p>like: </p> <pre><code> for($x = 1; $x &lt; 3; $x++){ ...
php
[2]
4,419,078
4,419,079
Compile time error on addition of two short variable [C#]
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4343624/integer-summing-blues-short-short-problem">Integer summing blues, short += short problem</a> </p> </blockquote> <p>I have summarized my problem into following code snippet.I have two short vaiable and I ...
c#
[0]
1,530,252
1,530,253
C# windows service sometimes hangs on Executing sql update
<p>I am doing a simple update, of a bit in a table using the code below. However, sometimes the program hangs on myCommand.ExecuteNonQuery(); and I don't know why. If Sql server is down, it will drop into the catch statement as expected but sometimes, for seemingly no reason, it will just hang on the execution state...
c#
[0]
5,610,383
5,610,384
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]
3,722,395
3,722,396
how to refactor the following codes
<p>I have a method want to refactor, and some dummy codes as below:</p> <pre><code>if(deletedInfo.isEmpty() &amp;&amp; addedInfo.isEmpty()) { // some logic codes } else if (!deletedInfo.isEmpty() &amp;&amp; addedInfo.isEmpty()) { // some logic codes } else if (deletedInfo.isEmpty() &amp;&amp; !addedInfo.isEmpt...
java
[1]
2,899,318
2,899,319
How to detect whether a keyboard is present or not
<p>How does android detects whether a keyboard is present or not? Which file I should modify if I need to change the way android detects the keyboard.</p>
android
[4]
5,127,775
5,127,776
What is difference between sys.exit(0) and os._exit(0)
<p>please help me in clarifying the concept of these two python statements in terms of difference/functionality.</p> <pre><code> 1. sys.exit(0) 2. os._exit(0) </code></pre>
python
[7]
5,791,347
5,791,348
Javascript Popup Text Limit in IE8
<p>Is there any limit to the amount of text that can be called via a Popup in javascript/jquery?</p> <p>I have a popup that works fine in IE9, FF etc BUT does NOT work in IE8</p> <p>The word count is 2667, is there any limitations in IE8 and can it be fixed via code?</p> <p>Update: When I edit the text, the popup wo...
javascript
[3]
3,085,794
3,085,795
const in c++ and memory folding
<p>when we declare the const variable it is said in Bruce eckel book that memory folding happens that means memory is not allocated for the variable I wanted to know what happens when we declare the variable as const</p>
c++
[6]
592,508
592,509
how to scroll scrollview horizontally
<p>hi i am new to iphone.I need to scroll scrollview horizontally instead of vertical.Is it possible to scroll horizontally.If it possible pls post link consist sample example.Thank u in advance. </p>
iphone
[8]
174,501
174,502
How to read file(bigger) in php from bottom up
<p>How to read files from bottom up in php?Is there something like stream in java which will read file incrementally but just backwards. Because my files can get up to 650 mb.</p>
php
[2]
4,475,365
4,475,366
Android selector - Text color
<p>the background of a button is set based on selectors defined as:</p> <pre><code> &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" android:dither="true"&gt; &lt;item android:state_checked="true" android:drawable="@drawable/checked" /&gt; &lt;item android:state_focused="true" androi...
android
[4]
1,413,368
1,413,369
Run Javascript Code
<p>I need to run javascript in php or python or java. My problem is, when a dynamic page load in browser some javascript executes and add some content on html. But if i download the file using wget or any programming language then i can not find the dynamic portion. I am giving you an example:</p> <pre><code>&lt;html&...
javascript
[3]
1,631,716
1,631,717
How to "map" an image
<p>I would like to know if there is a good way to "map" an image in android, I mean I have an image, figure a photo, and if an user taps on a body launch an activity, if he taps on a phone start something else and so on. I'm sorry if the question is stupid but it's way complicated google something you dont fully unders...
android
[4]
4,990,722
4,990,723
converting uchar in c++
<p>How do I convert a uchar to an int?</p>
c++
[6]
4,605,085
4,605,086
failing to open alert box before redirection.ASP.NET
<p>I'm trying to show an alert box before redirecting,but it's not working.The alert box only works if the redirection is not done.</p> <p>i modified the popular Alert.Show("string") class from Mads Kristensen as below....</p> <pre><code>public static class Alert { /// &lt;summary&gt; /// Shows a client-si...
asp.net
[9]
5,789,035
5,789,036
Ending an Event Driven Function in JavaScript
<p>I am using JavaScript with HTML5. When the user clicks on a button, an event-driven JavaScript function starts up. When the user clicks on the button again, another instance of this function starts up. So I have two instances of the same function handling a event. However I only want the new instance to be runnin...
javascript
[3]
1,119,980
1,119,981
Making a key-command for a python program with no GUI
<p>I want to make a key command so that the program will stop running when the Ctrl key then the 'e' key then the 'x' key then the 'i' and 't' keys are hit. So basically when the program is running if you type Ctrl + exit, the program will stop running. There is no GUI and I don't want to do this via a python interpret...
python
[7]
167,685
167,686
How to manipulate width of multiple images in javascript
<p>I have multiple images and i wnat to place all of them in a single line.How should i manipulate the width of images such that the sum of width of al images does not exceed the browser's width.??</p>
javascript
[3]
3,614,499
3,614,500
jQuery preventDefault
<p>Hi I have the following code: </p> <pre><code>collapsed.on('click', 'a',function(c) { c.preventDefault(); }); </code></pre> <p>Collapsed is basically a div element, inside this div there is an anchor tag which as it stands it does not work because of the prevent function. The prevent function needs to be there...
jquery
[5]
4,606,771
4,606,772
Replace text in textarea using Javascript
<p>I need to replace all the matches of a regular expression till the caret position in a textarea using Javascript. For example, if the text in the textarea is: "6 students carry 2 books to 5 classes" and the cursor is placed on books and the regular expression is /\d/, the numbers 6 and 2 should be replaced by, say,...
javascript
[3]
233,979
233,980
Stacks and queues are giving errors in Dev-C++
<p>I was given and assignment to develop a cellphone simulation, part of the requirements includes me using a queue to store the phone numbers that come from a txt file to simulate getting called. I have reviewed over and over again and including #include but the error message telling me "Queue" undeclared still shows ...
c++
[6]
474,356
474,357
javascript onblur/onfocus function not working
<p>I have the following two html form inputs:</p> <pre><code>&lt;input type="text" class="faded" name="mobile" value="012-245-6789" onfocus="hideDefault(this)" onblur="showDefault(this)"/&gt; </code></pre> <p>and </p> <pre><code>&lt;input class="faded validation_required" type="text" name="dob" value="MM/DD/YYYY" on...
javascript
[3]
3,209,105
3,209,106
what does 'and' N 'or' exactly mean in python?
<p>im really confusing now, in my program thought model if you met an expression like these</p> <p>expr = expr1 and expr2</p> <p>which mean the expr's type must be Boolean,same thing to 'or' operations</p> <p>see the codes below, suppose the three lines will print booleans</p> <pre><code>print(1==1 and 3) print(1==...
python
[7]
1,208,000
1,208,001
MKMapView GPS location question
<p>I am a newbie.. I have a doubt in MapView and CoreLocation. How to make the mapview to display "blue dot and circle animation" as in Locate Me action of Maps app? The solution may be very simple, but I don't have much idea about map in iPhone. Help me, pls.</p>
iphone
[8]
2,668,777
2,668,778
$_GET in ASP and choose file
<p>I'm trying to write ASP for the first time, I've only been using PHP for some years and never really got in to ASP. What I want to do is to get a value from the URLs get. For instance the url is like: page.asp?id=1</p> <p>Then I want this value to be in an include like:</p> <pre><code>&lt;!--#include file="somepag...
asp.net
[9]
1,006,318
1,006,319
what is the difference between "Basic Java" and " Core Java"?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2000349/what-is-the-difference-between-java-and-core-java">What is the difference between java and core java?</a> </p> </blockquote> <p>please somebody help me with this question. thanks.</p>
java
[1]
3,134,833
3,134,834
how to access other file type through php
<p>im considering to create a resource file in php to read other file type??</p> <p>for instance, instead of calling the image / javascript directly, i shall pass a query string to this resource.php indicating the type of file, and it would perform the same function as it is originally.</p> <p>for instance: using <co...
php
[2]
1,795,274
1,795,275
How do I check if a string is NOT a floating number?
<pre><code>var num = "10.00"; if(!parseFloat(num)&gt;=0) { alert("NaN"); } else { alert("Number"); } </code></pre> <p>I want to check if a value is not a float number, but the above code always returns <code>NaN</code>, any ideas what I am doing wrong?</p>
javascript
[3]
2,210,026
2,210,027
Java library to split text into smaller files
<p>I am looking for a java library that allows me to specify max size or max number of lines in output files, and then splits a large xml/text file into smaller files.</p> <p>I saw that there is a 2 year old question on SO for the same, however the answers there were for specific cloud platforms....I just want a libra...
java
[1]
6,011,938
6,011,939
How to pass a value in jQuery
<p>I want to pass an error message. How do I do it and what do I need to change?</p> <pre><code> success: function(data) { var div = $('&lt;div&gt;').attr('id', 'message').html(data.message); if (data.success == 0) { $.modaldialog.error('The operation failed.'); ... </code></pre> <p>I ...
jquery
[5]
5,384,337
5,384,338
What advantages are gained by using namespaces in javascript?
<p>Apart from not cluttering the global namespace and gaining the ability to encapsulate code in private members, is there any benefit?</p>
javascript
[3]
3,215,145
3,215,146
jquery loading image while elements loads
<p>hi im looking for any tutorials/articels about inserting a loading gif while elements load, ive seen it in a few sites. i can only seem to find articles on preloading images. </p>
jquery
[5]
1,165,221
1,165,222
How can I randomize an entire string of 62 characters?
<p>I have 62 base64 characters that I want to randomize. How can I do this using PHP? The string would be all letters, upper and lower case as well as numbers from 0-9.</p> <p>The thing that is most important to me is that the entire string be evaluated before a return value is given. In other words, if I request a st...
php
[2]
5,921,385
5,921,386
file name image upload
<p>When I upload image filename contain "two words.jpg" (there a white space in the middle). It will not echo an error message. Does anyone have the same issue?</p> <p>PHP:</p> <pre><code>$file = $_FILES['Filedata']; if ($file["size"] &gt; 20000) {echo "Excess limit size"; die('EXCESS');} </code></pre>
php
[2]
266,902
266,903
Undefined Variable Loop
<p>I am new to Python. I get an error that says "undefined Variable". I could not figure it out. The statement in the code is the following:</p> <pre><code>Classroom1 = Classroom(FirstCourseStartTime = 8, LastCourseEndTime = 7.75) m_count = 0 h_count = 0 t_count = 0 l_count = 0 loopsize = 10000 Loop(Classroom1, m_c...
python
[7]
1,259,020
1,259,021
How would I reduce nesting for form validation in PHP?
<p>This is function is taking up a lot of lines on my Functions page. </p> <p>I can't figure out on how to take it down unless putting them into an array, then using a <code>foreach</code> loop. But I want it to be specific on what is not allowed to be blank.</p> <pre><code>if ($EmployeeID === "") { echo "EmployeeI...
php
[2]
2,408,911
2,408,912
Update missed calls notification on android
<p>I need to cancel the missed calls notification for a certain number. I've seen the NotificationMgr class on com.android.phone but i'm unable to call it trough reflection. Is there any other way?</p>
android
[4]
1,301,576
1,301,577
A randomly generated 20 character's alpha-numeric key
<p>How can i create A randomly generated 20 character's alpha-numeric key in asp.net i need to save it i database on some link click.</p>
asp.net
[9]
4,995,669
4,995,670
Why is a duplicate random string generated by C# method
<p>The following method generates a random string with the given length.</p> <p>When executed twice in a row, the same string is given. Is anybody able to shed any light on why this might be?</p> <pre><code> public static string GenerateRandomString(int size, bool lowerCase) { StringBuilder builde...
c#
[0]
4,613,801
4,613,802
Replace Backslashes with Forward Slashes in Python
<p>I'm writing a cross platform file explorer in python. I am trying to convert any backslashes in a path into forward slashes in order to deal with all paths in one format.</p> <p>I've tried not only using string.replace(str, '\\', '/'), but also creating a method manually to search through the string and replace the...
python
[7]
4,318,473
4,318,474
how to update listview periodically in android
<p>my listview is not updated periodically in android it only updates when i scroll the listview then only its adapter changes</p> <pre><code>final Thread dataThread=new Thread(new Runnable() { public void run() { getFiveNearShops(); DataBaseHelper myDbHelper = new DataBaseHe...
android
[4]
1,660,833
1,660,834
Preventing any Activity from vanish while intent from activty to activity
<p>in my project i have a several activities.. but i have a one (parent) activity... from that activity i intend to other activities for getting data from other activities.. my problem is while indent back to my parent activity all details entered before were gone...can any one assist me how preserve those data's... th...
android
[4]
4,996,665
4,996,666
running clock and triggering
<p>constantly running a clock and trigger an other function for every 5 seconds.</p> <p>Please give me idea how to do this.</p> <p>Thanks a bunch </p>
python
[7]
4,072,188
4,072,189
Query about arrayadapter
<pre><code>ArrayAdapter&lt;String&gt; arrayadapter=new ArrayAdapter&lt;string&gt;(Sipnner_apActivity.this,android.R.layout.simple_spinner_item,arrarylist); </code></pre> <p>Here what is the meaning of <code>android.R.layout.simple_spinner_item</code> and why does the <code>Arrayadapter</code> class belong to <code>w...
android
[4]
3,628,114
3,628,115
java static variables
<p>i have two java files file1 and file2 as follows in package pak </p> <p>file1:</p> <pre><code>package pak; public class file1 { public static int x=432; public static void main(String[] args){ System.out.println("y is "+file2.y); while(x==432) { System.out.println("x is "+file1.x); } ...
java
[1]
254,928
254,929
php while loop output producing select for each item
<p>I know I have coded this incorrectly, but cannot seem to find a way to correct it. The aim, is to have a dropdown displayed populated with results from mysql database. It is currently displaying a dropdown for every address. I know why this is happening but cannot seem to correct it. Should the echo be out of the wh...
php
[2]
2,863,373
2,863,374
is there any limit for using window.open() in javascript
<p>Is there any limit of using <code>window.open("URL");</code> in JavaScript? <br> when I tried to open three windows using <code>window.open("URL")</code> after opening the second window the third window didn't open separately but it just refreshed the contents of first window and showed the contents of the third win...
javascript
[3]