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
4,105,682
4,105,683
Multiple key presses in JavaScript only working in IE
<p>I have the following code:</p> <pre><code>function handle_paste_keydown(key) { if(key.keyCode == 86 &amp;&amp; key.ctrlKey) // Ctrl + V { alert("Test..."); } } </code></pre> <p>This works in IE, but none of the other browsers. My reason for doing this is that I have finished creating a rich-...
javascript
[3]
3,949,633
3,949,634
When does jQuery click function need an 'event'?
<p>I had a click function with jquery which didnt work until I added the 'event' (see below). </p> <p>When is the event needed? This documentation doenst use it: <a href="http://api.jquery.com/click/" rel="nofollow">http://api.jquery.com/click/</a></p> <p>Didnt work:</p> <pre><code>$(document).ready(function () { ...
jquery
[5]
3,364,249
3,364,250
How to identify the begin and end of an incoming call in Android?
<p>I'm developing an application which should:</p> <ul> <li>Start when incoming call begins.</li> <li>End as soon as the call has ended.</li> </ul> <p>More specifically, I don't want the application to begin while the phone is ringing, but when the actual <strong>conversation</strong> is begins (aka, the user has acc...
android
[4]
2,568,657
2,568,658
If just the index.php loads as its generic unparsed self, what exactly is [not] happening?
<p>I visited a client's site today, and I'm getting the actual content of their index.php file itself rather than their website. The function of the index.php file says:</p> <pre><code>This file loads and executes the parser. * </code></pre> <p>Assuming this is not happening, what would be some common reasons for tha...
php
[2]
3,401,422
3,401,423
How to change the text of "More" bar item in a tab bar base iphone application
<p>I faced a problem that I can not find a way to change the text of "More" bar item in the tab bar, just like what I can do on other tab bar items. After searching the forum, I only find a way to change the title of the "More" view pushed by "More" button. Can anyone help me out? Thanks in advance.</p> <pre><code>UIN...
iphone
[8]
3,445,175
3,445,176
ListView become black in color whenuser scrolls
<p>I have a ListView on my Android Activity. When i scroll it the background of each text will be black until i click on one of the items. How i can fix it???</p> <p>my xml file is</p> <pre><code>&lt;ListView android:id="@id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; </code></...
android
[4]
5,611,117
5,611,118
Detecting Audio Input & output devices connected to system
<p>I want to findout how many audio input and output devices connected to my system in C#.net</p> <p>Please suggest any.</p> <p>Thanks.</p>
c#
[0]
1,535,546
1,535,547
what are the algorithms to use for recognizing objects?
<p>Using Artificial intelligence, what should be the algorithms for recognizing objects?? can Neuural network recognize objects??</p>
c#
[0]
5,001,993
5,001,994
T_STRING error even when I don't have any PHP code, just the open close PHP markings
<p>Yes, another one of these T_STRING errors...but hopefully this one is different.</p> <p>Here is all the code I have on my page:</p> <pre><code>&lt;?php ?&gt; &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt; &lt;/urlset&gt; </code></pre> <p>As y...
php
[2]
3,727,076
3,727,077
how to read bytes from a video file in android
<p>I have a question that I want to read bytes from video resided in sdcard in chunk size 1024, means I have to read 1024 bytes from the file at a time. I am able to fetch number of bytes from the video but I can't get it in chunks, I don't know how to achieve this. Please suggest me the right solution regarding the sa...
android
[4]
1,886,417
1,886,418
Quickest way to clone element and autioincrement id (jquery)
<p>A simple task of cloning an element and autoincrement its id.</p> <p>can it be done in 1 line?</p>
jquery
[5]
1,727,469
1,727,470
Recomendations for books / other resources to learn android real time game dev?
<p>I would like to create my first real time game for the android platform. I am searching for good resources to get started from, I have little knowledge about game development (just the basic ideas) and would appreciate any helpful websites or books you could recommend.</p> <p>Thanks, Jason </p>
android
[4]
5,452,693
5,452,694
Using all parameters of a function? I'm confused
<pre><code>DrawBorderBox(55, 20, 200, 50, 4, fontBlack, pDevice ); void Menu::DrawBorderBox( int x, int y, int w, int h, int thickness, D3DCOLOR Colour, LPDIRECT3DDEVICE9 pDevice) { //Top horiz line DrawFilledRect( x, y, w, thickness, Colour, pDevice ); //Left vertical line DrawFilledRect( x, y, thick...
c++
[6]
2,851,376
2,851,377
Problem with onListItemClick and clicklisteners
<p>I am trying to create a onListItemClick which will show to the user a dialog with two options. Each option should call a function to execute a certain action. The error i am getting is:</p> <p>Cannot refer to a non-final variable position inside an inner class defined in a different method</p> <pre><code> protecte...
android
[4]
5,649,090
5,649,091
c++ to c#'s "As"?
<p>How do I cast a struct to one of its base types?</p> <p>In c# you can do that with the keyword "as" like <code>Entity as Monster</code>. How can I do this in c++?</p> <p>This is my structure:</p> <pre><code>struct Entity { USHORT X; USHORT Y; UINT Serial; USHORT SpriteID; }; struct Monster : Enti...
c++
[6]
4,730,341
4,730,342
Why we should use inverse version of int defined by hex in C#
<p>Quote from <a href="http://www.codeproject.com/Articles/35134/How-to-calculate-CRC-in-C" rel="nofollow">this article</a>:</p> <blockquote> <p>In many industries, the first polynomial is in use to create CRC tables and then apply it for performance purposes. The default polynomial, defined by IEEE 802.3 is 0xA001 ...
c#
[0]
2,341,559
2,341,560
Setting a background drawable for a dialog?
<p>Tried posting this at android dev, wanted to go here too in case anyone knows. I'm trying to supply a custom background drawable for a dialog. I've created the following in my styles.xml file:</p> <pre><code> &lt;style name="CustomDlg" parent="@android:style/Theme.Dialog"&gt; &lt;item name="android:windowBackgr...
android
[4]
489,555
489,556
Variable getting stuck, won't change
<p>So I have a list of elements like:</p> <pre><code>&lt;span class="rank" id="someID1" user_id="1"&gt;Whatever 1&lt;/span&gt; &lt;span class="rank" id="someID2" user_id="2"&gt;Whatever 2&lt;/span&gt; &lt;span class="rank" id="someID3" user_id="3"&gt;Whatever 3&lt;/span&gt; </code></pre> <p>And I have a JQuery Select...
jquery
[5]
3,483,309
3,483,310
Dynamic creating table?
<p>I am writing a code for dynamically creating table in a button click, i Write the code it is working fine, But when i click the button again i want to add the rows to the existing table. Please help me. My code is :</p> <pre><code>Table table = new Table(); table.ID = "Table1"; Page.Form.Controls.Add(table)...
asp.net
[9]
1,118,499
1,118,500
How to pop up an alert box when the browser's refresh button is clicked?
<p>If the user refreshes the page in question it will add another record to the database, so I want to warn the user through an alert box if they really want to refresh the page and if they click ok then the page should be refreshed otherwise if they click cancel it won't be.</p> <p>How to make this type of alert box ...
javascript
[3]
5,731,757
5,731,758
Java Graphics.drawImage with different source color spaces and image types
<p>I'm trying to overlay a mostly-transparent PNG over a JPEG, and output the result as a JPEG file. I've attached my test input. Here's the code: (edit: FYI, this was translated into Java from Scala, not sure if I missed a syntax error or two, but you should get the idea from the code)</p> <pre><code>BufferedImage im...
java
[1]
2,641,710
2,641,711
Hide Android "voice to Text" Dialog Box
<p>I am working with an Voice to Text Application where I need to keep Voice command Dialog in background, means I don't want to hide it again n again.</p> <p>Pls shows me how can I do this.</p>
android
[4]
3,246,143
3,246,144
linking events two way
<p>I have the following code:</p> <pre><code> $('#Element1').event(function() { $('#Element2').event({ prop: $('#Element1').someMethod() }); }); </code></pre> <p>Now the Element 2 responds on an Event of Element1 and when Element 1 property changes. How to do it vice-versa in an optimum manner.</p>
jquery
[5]
3,244,160
3,244,161
Does python have a "causes_exception()" function?
<p>I have the following code:</p> <pre><code>def causes_exception(lamb): try: lamb() return False except: return True </code></pre> <p>I was wondering if it came already in any built-in library?</p> <p>Ya'ir</p> <p>Edit: Thx for all the commentary. It's actually impossible to detect wh...
python
[7]
623,264
623,265
What's the difference between TouchPaint and FingerPaint Android samples?
<p>They both seem rather similar. Is one a newer version of the other? Or does one demonstrate something conceptually different from the other?</p>
android
[4]
1,625,118
1,625,119
How to achieve this animatied transition effect when selection changes?
<p>(The title sucks. How to improve?)</p> <p><img src="http://www.clafy.com/images/mwsnap001.jpg" alt="Animated selection"></p> <p>In the picture above, there are 5 items. Use gestures to change selected item. During selection changing, there is some kind of animation like the Dock of MacOSX(although not that fancy)....
iphone
[8]
3,100,813
3,100,814
OptionalDataException in java
<pre><code> package com.n; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; public class S implements Serializable { private static final long serialVersionUID = 1L; ...
java
[1]
1,241,022
1,241,023
How to sort this jQuery element to this
<p>I want to make id="a" element div to be the second div in the div.b element. And I want to how to make id="a" element div to be the last div in the div.b element. </p> <p>Here is the code:</p> <pre><code>&lt;div class='b'&gt; &lt;div&gt;a&lt;/div&gt; &lt;div&gt;a&lt;/div&gt; &lt;div id="a"&gt;I want t...
jquery
[5]
5,449,242
5,449,243
Android - Idle time?
<p>How to know the idle time for an android device?</p> <p>Idle time is the time where human interaction is last made with the device (touch on screen or keyboard click)</p> <p>Partial or full code is very much appreciated.</p>
android
[4]
3,711,672
3,711,673
mediaplayer dies android
<p>i have a little problem with the media player class. I have a button, and by pressing it a sound will be played. The thing is that there is some delay between when i press the button and when the sound is played, and if i press it too many times the media player dies, and then no sound is played at all and i get the...
android
[4]
3,657,564
3,657,565
How to store an audio file into database using Android Sqlite?
<p>I am New to Android. My Requirement is to storing an audio file into database using Android Sqlite. can any one suggest me?</p> <p>Thanks in advance.</p>
android
[4]
4,487,218
4,487,219
Get a copy of a large (160000+ internal object tree) object
<p>Ok, I have a set of very large, identical, trees cached in memory (to be populated with non-identical data [they contain information about stuff inside each node]).</p> <p>I want to copy a single instance of the tree, and populate each copy with a seperate set of data.</p> <p>However, at the moment, the cached 'bl...
c#
[0]
4,378,466
4,378,467
C++ - Too Many Initializers for Arrays
<p>I have made an array like this but then it keeps saying I had too many initializers. How can I fix this error?</p> <pre><code> int people[6][9] = {{0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0...
c++
[6]
1,321,924
1,321,925
When is better to complete a save of Seekbar onProgressChanged vs. onStopTrackingTouch?
<p>I have a Seekbar and I want to save the state to database when the progress is changed. </p> <p>I am wondering in which event to put my code <a href="http://developer.android.com/intl/fr/reference/android/widget/SeekBar.OnSeekBarChangeListener.html" rel="nofollow">onProgressChanged</a> vs. <a href="http://develope...
android
[4]
1,709,339
1,709,340
How to redirect external links in page like Google using jQuery?
<p>I want to make a redirect for every external link on my page like Google</p> <p>when u hover the link it shows the real one but when you click it it becomes a redirect page.</p> <p>Please Help!!</p> <p>Thanks.</p>
jquery
[5]
2,389,749
2,389,750
Base64 encode uploaded file then save in database
<p>I want to base 64 encode uploaded file then save this into Blob type column of a table in MySQL database.</p> <p>I have tried built in PHP function base64_encode with file variable but this does not seem to work.</p> <p>Is there a way we can do this?</p> <p>The reason is that I do not want to use moveuploaded fil...
php
[2]
2,992,019
2,992,020
Java: can I have arrays in Hashmaps?
<p>Can I have arrays in Hashmaps ?</p> <p>If so, what's the exact syntax to declare such hashmap ?</p> <p>thanks</p>
java
[1]
187,074
187,075
How to iterate through multiple select options
<p>i have like 50 select boxes.</p> <p>I like to understand how I can go through all the select boxes that have ids like select_1 select_2 select 3.</p> <p>Also, I like to go through all the select list and values that were not selected. </p>
jquery
[5]
746,521
746,522
Java: Using scanner to read in boolean values failing.
<pre><code>import java.util.Scanner; public class Cardhelp2{ private static String[] pairArray={"A,A","K,K","Q,Q","J,J","10,10","9,9","8,8","7,7","6,6","5,5","4,4","3,3","2,2"}; public static void generateRandom(int k){ int minimum = 0; int maximum = 13; for(int i = 1; i &lt;= k; i++) { int randomNum = mi...
java
[1]
301,350
301,351
python : FTP with TarFile
<p>i have the following code, and i want to know how can supress the error, i tried some google search but with no sucess.</p> <pre><code>def backup_system(dirs): """ Funcao para fazer backup das confs do systema """ os.walk("/") try: tar = tarfile.open("/home/backup/system/system_backup_%s.tgz" %...
python
[7]
263,077
263,078
New message popup
<p>I currently have a messaging system. I am looking to make it so that when a user receieves a new message, they get an alert. A popup perhaps? Like a message box saying "you have a new message".</p> <p>How could I achieve this? Thanks</p>
php
[2]
931,975
931,976
Returning A Custom Object From XMLHttpRequest Object
<p>I am returning an "Employee" object from my javascript ajax call..</p> <pre><code>var xhReq = new XMLHttpRequest(); xhReq.open("POST", "MobileClientService.svc/REST/TestReturnEmployee", false); xhReq.send(null); var serverResponse = xhReq.responseText; </code></pre> <p>What is returned is JSON data. I would like ...
javascript
[3]
3,431,543
3,431,544
Issues when installing the application in iphone
<p>I am developing iPhone applications. I have to use push notification for my iPhone application. For that, I have created new provisioning profiles for my iPhone application. I have configured for APNS. Before installing this profile, the application was working in my device. But after installing the profile, I am ge...
iphone
[8]
5,569,590
5,569,591
jQuery .change() stops working when I remove a debug alert()
<p>So I have the following code at the moment:</p> <pre><code>&lt;form action=""&gt; &lt;div id="term"&gt;&lt;select name="s2" &gt; &lt;option name="" value=""&gt;--Select Term--&lt;/option&gt; &lt;/select&gt;&lt;/div&gt; &lt;div id="dept"&gt;&lt;select name="s3" &gt; &lt;option name="" value=""&gt;--Select Depart...
jquery
[5]
3,063,265
3,063,266
.each() find the last item and create an if statement
<p>I've got the following jQuery,</p> <pre><code>function animTweets($tweets) { $tweets.each(function () { var $tweet = $(this); $('#twitterTile').queue('myQueue', function (next) { $tweet.animate({top: 0, height: 'show'}, {duration: 300, ...
jquery
[5]
1,169,196
1,169,197
Destroy an Intent?
<p>When I create a Intent:</p> <pre><code>Intent in = new Intent(this, myclass.class); this.startActivity(in); </code></pre> <p>I create a new Intent but the last Intent is not destroy<br> It's still in memory<br> How can I kill this last destroy?</p> <p>So I want to create two Intents in two different classes: in t...
android
[4]
463,223
463,224
javascript select element
<p>I have a select element like this</p> <pre><code>&lt;select name ="cars"&gt; &lt;option value="frd"&gt; Ford &lt;/option&gt; &lt;option value="hdn"&gt; Holden &lt;/option&gt; &lt;option value="nsn"&gt; Nissan &lt;/option&gt; &lt;/select&gt; </code></pre> <p>I want to set selected to "Holden" with javascript ...
javascript
[3]
3,695,865
3,695,866
java.lang.OutOfMemoryError: bitmap size exceeds VM budget?
<p>friends,</p> <p>i am using following code to display bitmap on screen and having next and previous buttons to change images.</p> <p>and getting out of memory error</p> <p><strong>New Code</strong></p> <pre><code>HttpGet httpRequest = null; try { ...
android
[4]
3,831,314
3,831,315
How to find out extension of a file through its url?
<p>I am trying to find out what extensions a particular url has, Here is what I am trying to do:</p> <pre><code>$pathinfo = pathinfo('http://imgur.com/9P54j'); $extension = $pathinfo['extension']; echo $extension; </code></pre> <p>The url 'http://imgur.com/9P54j' is actually a url having 9P54j.gif image, and its not ...
php
[2]
3,932,088
3,932,089
Java: ArrayLists help, references
<p><strong>Class A:</strong> Contains a filled arraylist of Employee objects which each contain employeeName and employeeNumber</p> <p>Is it possible for <strong>Class B</strong> to create a variable that references class A's arraylist of Employee objects? I only need to search that arraylist. Maybe print it. Not chan...
java
[1]
5,332,964
5,332,965
Imports Excel File in GridView (Editing ans searching)
<p>does anyone know how to load an Excel file to a asp.net application? And GriView charged you can edit and search data in GridView?</p>
asp.net
[9]
4,451,575
4,451,576
VCRedist - how can I tell if it's been run?
<p>I have an old, old VC++ app that we've ported to VS2005. Our existing users need to get the VC++2005 DLLs, so my app is placing the vcredist_x86.exe on their machines and running it. I check a registry entry under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Installations\ which is x86_Microsoft.VC80....
c++
[6]
5,554,289
5,554,290
jquery image tooltip
<p>What I'm trying to achieve here is an image tooltip. When I hover over a link, the corresponding image will show up. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type='text/css'&gt; .tooltipcontent{ position:absolute; display:none; opacity:0.0; } &lt;/style&gt; &lt;script type='text/javascript' src='jq.js'...
jquery
[5]
1,325,072
1,325,073
How to update TextView from a class that doesn't extend Activity class
<p>I am New to Android. I am having a tough time with my code. Here is my problem. I have a TextView in my MainActivity which extends activity. And this textview has top be updated from another class which extends an Adapter class and implements GestureDetector. </p> <p>Based on the fling event I am updating my text...
android
[4]
3,076,617
3,076,618
Utility activities?
<p>I'm a little confused about the naming conventions used here... but AFAIK it is possible to build an activity(?) that performs some small function than many different programs could use. For example a date-picker tool for use in a calendar or alarm program.</p> <p>Fist of all I wish to know what these things are ca...
android
[4]
1,422,693
1,422,694
Python script to script enter and exit
<p>I am trying to create a python script that on a click of a button opens another python script and closes itself and some return function in the second script to return to the original script hope you can help.</p> <p>Thanks.</p>
python
[7]
5,709,822
5,709,823
Is conversion necessary for integer comparisons in PHP?
<p>Throughout much of the code I review, I often see things such as:</p> <pre><code>// $myvar could be anything if (intval($myvar) &gt; 0) { // do stuff } </code></pre> <p>Or similarly:</p> <pre><code>if ($myvar != null &amp;&amp; intval($myvar) &gt; 0) { // do stuff } </code></pre> <p>In an ongoing quest to p...
php
[2]
1,445,372
1,445,373
c# search arraylist problem
<p>In my code I have an arraylist, called heart, which contains numbers from 1-13.</p> <pre><code>heart.Add("any"); for(int i = 0; i &lt; 14; i++) { heart.Add(i); } </code></pre> <p>As you can see it also contains "any" placed in the first element. When I use this code to get the all of the elements that has a v...
c#
[0]
4,704,371
4,704,372
Loading an application from Eclipse to a real Android device over wifi
<p>I read many articles on how we can launch an Android emulator faster.</p> <p>I found <a href="http://stackoverflow.com/questions/1554099/slow-android-emulator/2049798#2049798">this SO post</a> where <em>user286101</em> said that he "can load the app over wifi onto the real device in a fraction of the time".</p> <p...
android
[4]
1,684,443
1,684,444
How do I name these php variables
<p>I want to use a forloop to create a number of vars... their names are <code>$var1</code> to <code>$var15</code>. How do I do that? I'm doing <code>$$var.$i</code> but it's not working. </p> <pre><code>for($i=1; $i &lt;= 15; $i++){ $$var.$i = 'this is the content of var'.$i; } </code></pre>
php
[2]
2,823,528
2,823,529
styles and theme
<p>I still not understanding the parent role in the android styles I have put my XML code into the style XML which works well. I have been trying to get my head round android styles and I just not getting it. Any help would be great.</p> <p>ps. I have been reading all about styles on the net. But the information is go...
android
[4]
3,560,200
3,560,201
How can i create dynamic rhythm graph in android
<p>i have to create a dynamic graph in android .... picture is given below..</p> <p><img src="http://medicineworld.org/images/blogs/heart-rhythm-5580.jpg" alt="alt text"></p> <p>Please guide me.....</p>
android
[4]
5,210,406
5,210,407
In Java why is length a method for Strings, while it is a variable for Arrays?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8720220/why-is-string-length-a-method">Why is String.length() a method?</a> </p> </blockquote> <p>If I want to know the length of an array I will have to type the following:</p> <pre><code>array.length </code><...
java
[1]
1,586,587
1,586,588
how to call split method on designtime binding value
<p>Hi all I have a grid with some templatecolumn , now i want to bind to on object property. one of these property is a string type that i want split it in design time. my code is here, but i have error. i know my code is wrong. please help me if any one know the right option to do this.</p> <pre><code> &lt;telerik:Gr...
asp.net
[9]
5,326,256
5,326,257
function name as as input of another function?
<p>I an image processing enginner, and am using Python as a prototyping language. </p> <p>Most of the time, as I get thousands of images, named "imagen.jpg", n being the increment. </p> <p>So the main structure of my program may be seen as :</p> <pre><code>def main_IP(imgRoot, stop_ncrement): name = update_the_inc...
python
[7]
2,914,737
2,914,738
How to stop intentservice in android?
<p>Could anyone tell me how to stop <code>intentservice</code> in Android?</p> <p>If I use <code>stopservice</code> to stop an intentservice, it doesn't work.</p> <p>I have browsed the website, but nobody has given a clear answer to this question.</p>
android
[4]
2,553,808
2,553,809
Opening new window and allowing & sign/ numbers
<p>Goal: when users type in anything in an input box, it will open a new window and append &amp;yuri=0 to it. <br> <br> Current code: <br></p> <pre><code> $(function() { $('.baseUrl').click( function() { window.location = $(this).attr('href') + $('.appendUrl').val() + '&amp;yuri=0'; return false; ...
jquery
[5]
3,690,534
3,690,535
Extract number from variable
<p>I have this string:</p> <pre><code>$guid = 'http://www.test.com/?p=34'; </code></pre> <p>How can I extract the value of get var <code>p</code> (34) from the string and have <code>$guid2 = '34'</code>?</p>
php
[2]
1,987,311
1,987,312
jQuery trigger function on change
<p>I have the following two slider functions which work well and display like so: <img src="http://mpasqualone.com/sliders.png" alt="alt text"></p> <p>I have diskAmount and transferAmount stored in global vars, however what I am now trying to figure out is how do I get the sum of the two to initially show as the month...
jquery
[5]
2,011,064
2,011,065
how to upload the image taken by calling camera activity from android phone?
<p>hi i have an image which is taken from andorid by calling image _capture how do i upload it to a windows server?</p> <pre><code> Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); startActivityForResult(intent, 0); public void onActivityResult(int requestCode, int result...
android
[4]
3,324,692
3,324,693
Fill an actionsheet with an array
<p>I have an actionsheet popup in my iphone application. I would like to fill it with strings from an array instead of predetermined values. </p> <p>I can't find anything online to do this! Perhaps actionsheet isn't the right thing to use?</p> <p>Right now this is what I'm using to build it:</p> <pre><code>roomsp...
iphone
[8]
5,542,467
5,542,468
Regex checks for a specific string
<p>How can I modify this script so it checks and makes sure it contains the exact string "abc"?</p> <pre><code>(/^[a].*/i.test(mystring)) </code></pre> <p>It needs to be case insensitive and take lower and upper caps.</p>
javascript
[3]
801,689
801,690
java recommendation algorithm
<p>can you please help me with the following? </p> <p>Assume we have about 100 movies which are rated by users in a <strong>1-10</strong> scale. Each user has a <em>unique</em> name and rates as many movies as he wants. I want to implement an algorithm that finds out common interests between users. Specifically, when...
java
[1]
1,392,423
1,392,424
How can I use Jquery show() hide() table rows based on a query string variable?
<p>I have a landing page with several actions. The action are within table rows that are hidden by default and open when a user clicks the action title. I want to control what is shown/hidden based on a query string variable.</p> <p>For example one of the actions is "Request a call." There are links on other pages ...
jquery
[5]
1,254,091
1,254,092
Identifying a random repeating pattern in a structured text string
<p>I have a string that has the following structure:</p> <p><code>ABC_ABC_PQR_XYZ</code></p> <p>Where PQR has the structure:</p> <p><code>ABC+JKL</code></p> <p>and</p> <p><code>ABC</code> itself is a string that can contain alphanumeric characters and a few other characters like "_", "-", "+", "." and follows no s...
php
[2]
4,967,750
4,967,751
ASP.net Imitate Slow Connection Speed
<p>Our web application is meant to be run on remote locations with very slow internet speed. We are considering various factors to reduce application overheads. This question is only related to see how our application would work on slow bandwidth.</p> <p>We are still on development, we would like to be able to browse ...
asp.net
[9]
2,510,881
2,510,882
Enumerations in C# negative side effects of using a negative number
<p>In a C# enumeration, are there any negative side effects of using a negative number?</p> <p>I am modelling response codes and one of the codes in negative. This compiles but I want to know if there are any negative side effects to this.</p> <pre><code>public enum ResponseCodes { InvalidServerUserPasswordCombo ...
c#
[0]
4,528,823
4,528,824
Most efficient way to remove non-numeric list entries
<p>I'm looking to 'clean' a list by excluding any items which contain characters other than 0-9, and wondering if there's a more efficient way than e.g.</p> <pre><code>import re invalid = re.compile('[^0-9]') ls = ['1a', 'b3', '1'] cleaned = [i for i in ls if not invalid.search(i)] print cleaned &gt;&gt; ['1'] </c...
python
[7]
2,523,132
2,523,133
How to use multiple URLs in PHP REQUEST_URI statement?
<p>Here is my code...</p> <pre><code>if($_SERVER['REQUEST_URI'] == '/shop/category/handheld-thermal-imaging/') { echo '&lt;div class="current-mark"&gt;&lt;/div&gt;&lt;div class="top-level"&gt;&lt;a href="/shop/category/handheld-thermal-imaging/"&gt;HANDHELD&lt;br /&gt;THERMAL IMAGING&lt;/a&gt;&lt;/div&gt;'; } else i...
php
[2]
1,396,996
1,396,997
BackgroundWorker and WebBrowser Control
<p>Is it possible/recommended to use background worker threads with the web browser control?</p> <p>I am creating a bot that searches google for keywords, then checks for sites in the first 10 pages to see if a site is ranked.</p> <p>The user can provide a maximum of 20 sites to check, and can use proxies. So ideally...
c#
[0]
56,908
56,909
jQuery: Unbind event handler
<p>I chose to go with binding element to the body to have them affecting elements even though they are not yet there. Now, I want to unbind some handlers as I go and this is where I am encountering some difficulties. </p> <p>Code: </p> <pre><code>$('body').unbind('click', deleteComment); //unbind $('body').on('clic...
jquery
[5]
6,929
6,930
How to check if the last column of line in csv file is "True" in a buffered reader
<p>I have a CSV file and I am reading data byte by byte by using buffered stream. I want to ignore reading the line if the last <code>column = "True"</code>. How do I achieve it?</p> <p>So far I have got:</p> <pre><code>BufferedStream stream = new BufferedStream(csvFile, 1000); int byteIn = stream.ReadByte(); while ...
c#
[0]
5,218,222
5,218,223
Mutex Lock wait time and watchdog
<p>We are measuring a performance scale of multi threaded real time application. I need to write a adapter to measure the time spent on</p> <ol> <li>Waiting time for locking the mutex </li> <li>Time spent between mutex.lock -> mutex.unlock : critical section execution time </li> </ol> <p>and also component like lockt...
c++
[6]
3,609,642
3,609,643
PHP Try Catch Exceptions how does it work
<p>I'm new to try catch in php, and I was playing around with it.</p> <p>when I try this one, it works fine</p> <pre><code>try { if (!$connect) { throw new Exception("it's not working"); } } catch (Exception $e) { $e-&gt;getMessage(); } </code></pre> <p>When I try this one, it doe...
php
[2]
4,140,860
4,140,861
Java Utility Classes and Extension through Inheritance
<p>I have a utility class with some static methods which I use in some places around my code. I am facing a problem now. I want to replace the functions in this utility class in order to provide better implementation. Obviously this cannot be achieved directly without some serious hacking.</p> <p>My question is: what ...
java
[1]
793,413
793,414
How to build native web app for iPhone or iPad
<p>I have installed Phonegap and trying to build native web app for iPhone/iPad. But am not getting how to do. i have some knowledge in html,css and javascript. If any one will suggest me how to do if possible with a small example. Thank you.</p>
iphone
[8]
1,961,945
1,961,946
How to Downgrade my android application?
<p>In my application i need to run my application of both versions android 2.1 and android 2.2. my application run sucessfully in android 2.2 but it shows error "DTD handler not supported" when i run on 2.1. My build is made in 2.1,but this application only run in its a web application and i am using sax parser. pleas...
android
[4]
2,593,807
2,593,808
Dynamically adding imageViews onto a linear Layout
<p>I am a newbie in Android. I have a requirement where I have to add the imageViews dynamically onto a linear layout and then have to animate each image individually. </p> <p>I am not aware of the way to add the imageViews dynamically onto a linear layout. Plz help me out.</p> <p>Thanks</p>
android
[4]
3,362,112
3,362,113
Get a user-defined object in Javascript
<p>I have a script which creates a user-defined object like this:</p> <pre><code>obj = new Tree(); </code></pre> <p>This object is always present and interacting with the user.</p> <p>I want to create a button on the page which, if pressed, should retrieve this object, make some changes to the object and call some m...
javascript
[3]
4,425,965
4,425,966
Javascript content rotator?
<p>I’ve got the basics of a content rotator done, the only problem is it doesn’t loop itself back to the beginning and I cannot figure out why! It is a very simple javascript script:</p> <pre><code>window.onload = function() { setInterval("transition()", 5000); } function transition() { var y = docume...
javascript
[3]
618,655
618,656
C++ compile error
<pre><code>#include&lt;string&gt; using namespace std; int main(){ const int SIZE=50; int count=0; ifstream fin("phoneData.txt"); ofstream fout("phoneList.txt"); string firstName, lastName, phoneNumber; if (!fin){ cout&lt;&lt;"Error opening file. program ending."&lt;&lt;endl; return 0...
c++
[6]
3,461,067
3,461,068
declaring the document root when in sub folder
<p>Can anyone help me use the correct way of doing includes. Rather than: <code>include('header.php');</code></p> <p>It's a multi page site and i want to add files into other folders for example an Information folder.</p> <p>In this information folder i have a file called <code>aboutus.php</code> which has includes t...
php
[2]
4,662,833
4,662,834
If vs. while in specific JavaScript code
<p>Why does the author of <em>Test-Driven JavaScript Development</em> (Christian Johansen) use the <code>while</code> statement instead of the <code>if</code> statement in the code below?</p> <pre><code>function getEventTarget(event) { var target = event.target || event.srcElement; while (target &amp;&amp; ta...
javascript
[3]
3,459,590
3,459,591
Dyanamic Execution of javascript code
<p>I have the following JavaScript: </p> <pre><code>var djs = function (ob) { return { remove: function () { //removes element if (is_array(ob)) { for (var i = 0; i &lt; ob.length; i++) ob[i].parentNode.removeChild(ob[i]); } else { ...
javascript
[3]
2,066,295
2,066,296
Array.length problem in JavaScript
<p>I've written this sample code to print the length of x. But for some reason, I am not getting anything! Help! </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type = "text/javascript"&gt; function myF() { var x = [1,2,3,4]; var y = document.getElementById("thing"); y.innerHtml = x.length; } &lt;/script...
javascript
[3]
196,008
196,009
How to get Requirement ID filed value by workitem collection?
<p>i am trying to get the TFS task information through below code but when i am trying to fetch the value of Requirement ID column for a task then it is throwing FieldDefinitionNotExistException exception.</p> <pre><code> if (teamProjectCollection == null) { teamProjectCollection = TfsTeamProje...
c#
[0]
370,969
370,970
Jquery division between two numbers
<p>Can you guys please help me in this matter :</p> <p>I have two variable in jquery x and y , and I am doing a division between those two , and I let's say the result is 2.5 , but I only want to show 2 from 2.5 , how do I do that?</p>
javascript
[3]
413,326
413,327
In jQuery, want to remove all HTML inside of a div
<p>I have a div, and I want to remove all the HTML inside of that div.</p> <p>How can I do this?</p>
jquery
[5]
2,531,126
2,531,127
Working with Java
<p>How do I read an array from a text file in java?</p>
java
[1]
3,339,418
3,339,419
C# - Best way to handle saving multiple configurations (and accessing data live)
<p>So I've seen many questions that talk about the best method to store settings but haven't really seen any that deal with my situation.</p> <p>Basically my app today has one settings tab with about 75 options/settings. A user is able to basically have different "copies" of these settings (think: dropdown that when ...
c#
[0]