Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
1,705,296
1,705,297
Inheriting a class with constructor arguments in java
<p>The situation is I want to inherit an object to have a cleaner constructor interface:</p> <pre><code>class BaseClass { public BaseClass(SomeObject object){ ... } } class SubClass extends BaseClass{ private SubObject subObject = new SubObject(); public SubClass(){ super(new SomeObjec...
java
[1]
2,949,497
2,949,498
Dispay printer dialog
<p>I use this line to have Adobe Reader print my generated pdf :</p> <pre><code>desktop.print(new File("temp.pdf")); </code></pre> <p>It always uses the standard printer. Is there a way to display the "choose printer" dialog instead?</p>
java
[1]
260,243
260,244
Why is <asp:ListItem> not allowed inside <asp:RadioButtonList>?
<p>I went to compile my asp.net website (.Net 2.0, VS 2008) and got some strange errors from the compiler.</p> <pre><code>Literal content ('&lt;asp:ListItem "1" Text="Yes"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem "0" Text="No"&gt;&lt;/asp:ListItem&gt;') is not allowed within a 'System.Web.UI.WebControls.L...
asp.net
[9]
3,284,277
3,284,278
Problem with indexOf on JavaScript array
<pre><code>var allProductIDs = [5410, 8362, 6638, 6758, 7795, 5775, 1004, 1008, 1013, 1014, 1015, 1072, 1076, 1086, 1111, 1112, 1140]; lastProductID = 6758; </code></pre> <p>for some reason I get a -1 or I guess which is equivalent to not found for this:</p> <pre><code>alert(allProductIDs[allProductIDs.indexOf(lastP...
javascript
[3]
2,405,349
2,405,350
jQuery exclude elements with certain class in selector
<p>I want to setup a click event trigger in jQuery for certain anchor tags.</p> <p>I want to open certain links in a new tab while ignoring ones with a certain class (before you ask I cannot put classes on the links I am trying to catch as they come from a CMS).</p> <p>I want to exclude links with class "button" OR "...
jquery
[5]
2,102,485
2,102,486
Python: Convert list of ints to one number?
<p>I have a list of integers that I would like to convert to one number like:</p> <pre><code>numList = [1,2,3] num = magic(numList) print num, type(num) &gt;&gt;&gt; 123, &lt;type 'int'&gt; </code></pre> <p>What is the best way to implement the <i>magic</i> function?</p> <p>Thanks for your help.</p> <p><b>EDIT</b>...
python
[7]
3,098,014
3,098,015
How to use Marshal.getActiveObject() to get 2 instance of of a running process that has two processes open
<p>Currently my code uses </p> <pre><code>SurferApp = Marshal.GetActiveObject("Surfer.Application") as Surfer.Application </code></pre> <p>to get the running instance of a software called surfer, for the sake of simplicity we can replace Surfer to Word that everyone knows about. Now let's say I have 2 MS word applica...
c#
[0]
3,379,822
3,379,823
Why do I have to specify namespace when choosing startup form?
<p>I wasn't able to set my new form as a startup form, it complained about it not existing. But after some minutes I tried with typing "Namespace.NewForm" and that worked.</p> <p>In my other project, The startup is set as this:</p> <pre><code> Application.Run(new MyForm()); </code></pre> <p>Why did I have to ...
c#
[0]
2,606,345
2,606,346
jQuery example for val() of input box
<p>The <a href="http://api.jquery.com/val/" rel="nofollow">example</a> for finding the value of an input box in jQuery is below.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; p { color:blue; margin:8px; } &lt;/style&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt...
jquery
[5]
946,021
946,022
alert dialog size varies based on list view
<p>I have created a alert dialog in oncreate dialog method of dialog fragment. I am populating the alert dialog with array adapter. My problem is the alert dialog size varies depending on the text in the adapter. I want the alert dialog to be fixed in default size. pls help.</p>
android
[4]
4,450,545
4,450,546
How To Create Folders Based on a Range of Numbers in Python
<p>I want to create a few folders based on a given range of numbers. For example, I want to create folders 500 through 520. Is there a way to create these folders using the <code>range(500, 520)</code> ?</p> <p>Am I heading down the right path with this code?</p> <pre><code> import os for i in range(500, ...
python
[7]
2,111,449
2,111,450
BroadcastReceiver with permissions
<p>There are some BroadcastReceiver. I want establish permission for BroadcastReceiver:</p> <pre><code> &lt;receiver android:name=".BR1" android:permission="testbr.pac.TestBR_MY_ACCESS"&gt; &lt;intent-filter&gt; &lt;action android:name="testbr.pac.TestBR"/&gt; &lt;/inte...
android
[4]
3,122,538
3,122,539
How to open front face camera and record video in android
<p>How to open front face camera using surface view and record video in android 3.1.can anybody provide code</p> <p>Thanks</p>
android
[4]
5,434,965
5,434,966
using jquery mousemove and setTimeout and clearTimeout to reveal/hide a menu
<p>I pasted some code below of what seems to be a common approach to reveal a menu on mousemove. It seems that as the mouse continues to move, the duration of the timeout increases. What's up with that? Is there a reason why the cleartimeout would not be working?</p> <pre><code>var timer; $(document).mousemove(fun...
jquery
[5]
4,624,750
4,624,751
Website structure / Newbie
<p>I created a website using php, passing values from page to page either with POST or GET.</p> <p>Though there is some cons, I dont know how to track specifically what data has been viewed in GoogleAnalytics as it just shows the name of the page (xxxx.php)</p> <p>On the other side, I see websites structured differen...
php
[2]
1,745,982
1,745,983
Atrribute Error in Python 2.73 when creating random string
<p>I'm using the following function (which I think is pretty straight-forward) to generate a random string:</p> <pre><code>import sys import string import random def random(size=16): lst = [random.choice(string.ascii_letters + string.digits) for n in xrange(size)] str = "".join(lst) return...
python
[7]
403,118
403,119
Sanitise or validate email php
<p>I am using <code>filter_var</code></p> <p>and a function to check if the email is valid</p> <pre><code>function checkEmail($email) { return filter_var($email, FILTER_VALIDATE_EMAIL); } </code></pre> <p>This is only thing I do. In registration for example i validate email with this function then insert in data...
php
[2]
753,964
753,965
Scroll fixed div to certain point
<p>I have seen a few examples of these, but mine is a little different and can't figure this out.</p> <p>I'm using a piece of jQuery found on these forums, to scroll a fixed div to certain point then stopping, using 'scrollTop'.</p> <pre><code>var windw = this; $.fn.followTo = function ( pos ) { var $this = this...
jquery
[5]
5,009,641
5,009,642
How to pass decimal values over serialport in C#?
<p>how to pass decimal values over serialport control?</p>
c#
[0]
1,857,477
1,857,478
Data container for fast lookup and retrieval
<p>Actually I need a data structure that helps me in reducing time for look-ups and retrieval of values of the respective keys.</p> <p>Right now I am using a map container with key as structure and want to retrieve its values as fast as possible. </p> <p>I am using gcc on fedora 12. I tried unordered map also, but it...
c++
[6]
4,867,760
4,867,761
How to use the NSUrlConnection for getting the data from web?
<p>iam developing one application.In that i want to use the usurlconnection class.SO please tell me how to use this one.This contain the lot of delegate methods.So please tell me how to use them.</p>
iphone
[8]
555,607
555,608
why type $this = $(this) in jquery
<p>I'm new to jQuery and have noticed someone go:</p> <pre><code>var $this = $(this); </code></pre> <p>Why do this? Is it to save typing? Does it help performance? Is it fairly standard practice?</p> <p>Also I've started doing things such as:</p> <pre><code>var minus_button = $('#minus_button'); </code></pre> <p>S...
jquery
[5]
5,386,008
5,386,009
Is there a tool for signing all jars in a folder and subfolders?
<p>Is there a tool for signing all jars in a folder and subfolders?</p>
java
[1]
5,325,809
5,325,810
Parse timestamps in plain text file and count them per 5 minute intervals
<p>My Input is a plain text file containing 6,000 timestamps, looks like this</p> <pre><code>2011-06-21 13:17:05,905 2011-06-21 13:17:11,371 2011-06-21 13:17:16,380 2011-06-21 13:17:20,074 2011-06-21 13:17:20,174 2011-06-21 13:17:24,749 2011-06-21 13:17:27,210 2011-06-21 13:17:27,354 2011-06-21 13:17:29,231 2011-06-21...
python
[7]
2,290,507
2,290,508
Problem with unique html() jQuery
<p>I have jQuery function, that if it will hit specific class is wrapping it with some oter divs.</p> <pre><code>(document).ready(function(){ var Text = $('.bd_box_cont').html(); $('.bd_box_cont').html(" &lt;div class='bd_box_tl'&gt;&lt;div class='bd_box_rt'&gt;" + Text +"&lt;/div&gt;&lt;/div&gt; "); ...
jquery
[5]
681,969
681,970
How to Send MMS Pro-grammatically without using Intent.ACTION_SEND
<p>I have gone to various blog and tutorial<code>(http://stackoverflow.com/questions/2972845/how-to-send-image-via-mms-in-android)</code> and unable to get solution.</p> <p>I want the solution to send Image with SMS (i.e MMS) pro grammatically without using Intent.</p> <p>There is no documentation in this regard.Plea...
android
[4]
2,253,949
2,253,950
Sql lite vs mysql db
<p>In android development, and when is it good to use sql lite vs Web server db? If a person delete the app or upgrade my app then will the db get deleted if i use sql lite? </p> <p>Thank you very much</p>
android
[4]
5,831,873
5,831,874
retrieve gmail account details configured in android
<p>In my application, I have to send a mail when a button is clicked. I have all details for sending the mail except the "from address". This "from address" should be the gmail account configured in the android phone. How can I fetch those details? Can anyone please help?</p>
android
[4]
2,088,087
2,088,088
I'm new to python, and trying to program a sales tax button for a calculator
<p>I just started programming in python not long ago, and I'm having trouble figuring out the rounding issue when it comes to tax and money. I can't seem to get decimals to always round up to the nearest hundredths place. for instance, in our state, sales takes is 9.5%, so a purchase of 5 dollars would make tax $.48,...
python
[7]
5,943,088
5,943,089
switch user to site url
<p>I had to check about data retrieve from data base in DDL and if this data equal specific value user will redirect to specific site (URL) .I tried to make this with if statement but it did not work please anyone help me.</p> <pre><code>protected void IMGSite_Click(object sender, ImageClickEventArgs e) { if (DDLB...
c#
[0]
4,943,560
4,943,561
Make an android activity method thread safe
<p>I have a method updateFoo() of an activity called both from a Handler thread every 5 seconds and from a button when user want to press it... updateFoo update the interface of my activity... to make this method thread safe I declared it "synchronized" ... Is that the right way???</p> <p>Thanks in advance for any hel...
android
[4]
4,949,063
4,949,064
Java removing unicode characters
<p>I get user input including unicode characters like </p> <pre><code>\xc2d \xa0 \xe7 \xc3\ufffdd \xc3\ufffdd \xc2\xa0 \xc3\xa7 \xa0\xa0 </code></pre> <p>for example:</p> <pre><code>email : abc@gmail.com\xa0\xa0 street : 123 Main St.\xc2\xa0 </code></pre> <p>desired output:</p> <pre><code> email : abc@gmail.com ...
java
[1]
2,026,962
2,026,963
PHP: Find largest value from results of two MySQL database queries
<p><strong>I have the following two <code>mysql_queries</code>:</strong></p> <p><strong>1.</strong></p> <pre><code>$primary_img_query = "SELECT imgWidth, imgHeight FROM primary_images WHERE imgId=$imgId"; $primary_img_data = mysql_query($primary_img_query) or die('MySql Error' . mysql_error()); </code></pre> <p><str...
php
[2]
2,618,831
2,618,832
How to avoid warning of Unreachable code
<p>I have the below</p> <pre><code>string currency = string.Empty; Regex r = new Regex(@"~(\w*[a-zA-Z0-9$£~%]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); for (Match m = r.Match(expression); m.Success; m = m.NextMatch()) { currency = (m.Groups[1].Value); break; } return currency; </code></pre> <p...
c#
[0]
432,765
432,766
PHP, adding to a database
<p>When filling in the fields in the browser and presing add product it returns Column count doesn't match value count at row 1 instead of adding it to the database.</p> <pre><code>&lt;?php if (isset($_POST['name'])) { $name = mysql_real_escape_string($_POST['name']); $price = mysql_real_escape_string($_POST['price']...
php
[2]
79,053
79,054
How do I reference a function's variable from another class? - C#
<p>I am having a hell of a time getting a variable from the function of another class usable in my Game1 (main) class. Specifically, I want to take width and height from the function SaveData in SetWindowSize.cs and use it in ReadSettings in Game1.cs.</p> <p>I get the error </p> <blockquote> <p>'ShovelShovel.SetWin...
c#
[0]
1,166,290
1,166,291
ASP.NET Membership API Equivalent for PHP
<p>Are there any good schemas/models for roles and membership for PHP/MySQL, apart from rolling a custom one? I like the way ASP.NET's membership and roles work and was wondering of there was an equivalent in PHP.</p>
php
[2]
5,667,039
5,667,040
Printing all static content in a .java file
<p>I have to print all the static content in l the .java files in my workspace. Can anyone suggest any tool or code to do that?</p> <p>By static means SIB's static constants, methods and all.</p>
java
[1]
4,853,251
4,853,252
is it possible to get function name in which given closure is running?
<pre><code>function MyFunction() { closure = function() { alert('my parent function name is: '/* now what here ? */); } closure(); } MyFunction(); </code></pre> <p>Result should be <code>my parent function name is: MyFunction</code></p> <p>(To moderators: I do not know why stackoverflow is preventing me fro...
javascript
[3]
1,702,185
1,702,186
Can we use ignore_user_abort() on any line of code?
<p>Can we use ignore_user_abort on any line of PHP like:</p> <pre><code>&lt;?php // Process Codes if($_GET['nonstop']) { ignore_user_abort(1); // Background process }else{ // Nonbackground process } // Other Codes ?&gt; </code></pre> <p>Or we need to use on only after <code>&lt;?php</code> (first line)?<...
php
[2]
5,696,783
5,696,784
(solved) JQuery: Getting data from child elements
<p>Markup:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#" class="item-list" data-id="1"&gt;Link 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="item-list" data-id="2"&gt;Link 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="item-list" data-id="3"&gt;Link 3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre...
jquery
[5]
5,045,761
5,045,762
What is the E-mail Attachment limitation in android?
<p>I wanted to know what is the maximum size of the file that we can attach with e-mail in android? Or is the attachment limit completely dependent on E-mail that we have configured ???</p>
android
[4]
5,056,513
5,056,514
Customized Grid in wxPython?
<p>How can I implement the grid(black border) in the following image in wxPython?</p> <p><img src="http://i.stack.imgur.com/yYRZn.png" alt="alt text"></p>
python
[7]
4,107,330
4,107,331
How do I set an absolute include path in PHP?
<p>In HTML, I can find a file starting from the <strong>web server's</strong> root folder by beginning the filepath with "/". Like:</p> <pre><code>/images/some_image.jpg </code></pre> <p>I can put that path in any file in any subdirectory, and it will point to the right image.</p> <p>With PHP, I tried something simi...
php
[2]
5,487,210
5,487,211
getting a row value from an "id" column
<p>in the following code, i would like to get the row result for column "id" as a result for $selectedmovieid. The 'commenid' is the primary key attribute. Sorry for not knowing how to use mysql_fetch_assoc properly.</p> <pre><code>&lt;?php require ("connect-comment.php"); $deleteid=$_GET['commentid']; $query1=mysql_q...
php
[2]
4,587,692
4,587,693
Bringing up SoftKeyboard on android
<p>I want to pop up the software keyboard when the user presses the search hardware search key.</p> <p>At the moment I use the following function with doesn't seem to work for the search key but which does work for the back key: The logging doesn't get even tiggered through the search key.</p> <pre><code>@Override pu...
android
[4]
5,703,012
5,703,013
Image Scroll in Firefox on Button click
<p>Please help On (Button onclick = "scroll_Ex('up');") the javascript is not working. I want to scroll image on button click Its working in IE but not in Firefox .Any altrenate code so that its works in Firefox and IFPrev is id of a file.htm </p> <p>The code is given below </p> <pre><code>function scroll_Ex(dirc) {...
javascript
[3]
1,913,381
1,913,382
Asp.net export in excel
<p>Iam doing export functionality in asp.net1.1... I used to passed a dataset to excel and export that records in excel... Now i want on certain condtion some records should highlight in red colors... So plz tell me how to do this.</p>
asp.net
[9]
4,167,559
4,167,560
Remove a child from parent and add it as Sibling to Parent
<p>I have a Bullet Region like</p> <ul><li>Hello</li><li>How</li><li>are</li><li>you</li></ul> <p>No i am selecting <li>are</li> and changing to Number Bullet. so my list should change like </p> <p><ul><li>Hello</li><li>How</li></ul><ol><li>are</li></ol><ul><li>you</li></ul></p> <ol> <li>want to end the Disc bullet...
javascript
[3]
4,680,837
4,680,838
passing value to other module python
<p>i have two script name is A.py and B.py</p> <p>i want to know how to send value from A.py to B.py.</p> <p>for more detail,when run finished A.py script at the end of script ,A.py call B.py.</p> <p>my question is i have to send some value from A.py to B.py.</p> <p>anybody some help me how to send value A.py to B...
python
[7]
1,375,581
1,375,582
Adding new input using jQuery
<p>I have a drop down called roomfac1 on my form and I would like <em>roomfac2</em>, <em>roomfac3</em>... (duplicate dropdowns) to be added when the user clicks on the <strong>Add</strong> button. How do I accomplish this using jQuery? In addition to this, I would also like the user to dynamically remove the newly crea...
jquery
[5]
1,696,351
1,696,352
C# refine method code for query
<p>i am trying to create a method to access an access2010 .accdb database simply by calling the method with the SQL statement. this method currently works after my many hours of "trial and error". Are there any ways to refine this piece of code to make it more robust yet simpler because of the many steps involved. (new...
c#
[0]
1,277,927
1,277,928
Beginner object references question
<p>If I instantiate an object in a main class, say:</p> <pre><code>SomeObject aRef = new SomeObject(); </code></pre> <p>Then I instantiate another object from the main class, say:</p> <pre><code>AnotherObject xRef = new AnotherObject(); </code></pre> <p>How can the instance of AnotherObject make use of the aRef ref...
java
[1]
598,851
598,852
jquery: get values of all children of a div
<p>I am trying to use jquery to get the values of all children element of a div.</p> <pre><code>&lt;div class='parent'&gt; &lt;input type='text' value='1' class='child' /&gt; &lt;input type='text' value='2' class='child' /&gt; &lt;input type='text' value='3' class='child' /&gt; &lt;input type='text' va...
jquery
[5]
505,049
505,050
Store and recall button in calculator application (iPhone)
<p>I'm new in iPhone development. I made a calculator in which I need to put 2 more buttons:</p> <ol> <li><code>Store</code>: Stores the current value of the display into a memory location.</li> <li><code>Recall</code>: Recalls the value in memory.</li> </ol> <p>But I don't know how.</p>
iphone
[8]
3,179,162
3,179,163
how to run asp.net project on iis real server windows 2008
<p>HI,</p> <p>i developed application in Visual Studio... ASP.NET project with master.page. I do it on my notebook and now I want put it on my server... i copy all files and give it to wwwroot directori in iis7 on my windows server 2008, but when i try start ist it wrote:</p> <hr> <p>Runtime Error Description: An ap...
asp.net
[9]
2,801,688
2,801,689
Response Keyword not Recognized
<p>i am trying to use commands like <code>Response.ClearContent()</code> and <code>Response.Write()</code> to export a datatable to Excel however visual studio is not recognizing the <code>Response</code> keyword. is there a <code>using</code> statment associated with these commands? Because i'm obviously missing somet...
c#
[0]
2,865,822
2,865,823
Set up parameter not recognized from parse request
<p>This has been playing on my mind for a while, I need to check that the user has entered the correct parameters, how do I do check this in an if statement in php? Users enters as follows;</p> <pre><code>www.domain.com/?amnt=100&amp;from=AAA&amp;to=BBB </code></pre> <p>so I need to check if they enter something as ...
php
[2]
5,812,913
5,812,914
Export data elements to text file in Python
<p>How could I alter the following code to get a table of data elements in a text file to be plotted in excel?</p> <pre><code> x = z = vz = vy = ax = ay = time = 0.0 y = 50 #Initial Height: 50 meters vx = 25 #Initial velocity in the x direction: 25 m/s az = -9.8 #Constant acceleration in the z direction: -9.8 m/s^2...
python
[7]
275,462
275,463
Targeting Google APIs
<p>I'm new to Android Development and Eclipse and I'm going through the various tutorials. </p> <p>When setting up Eclipse I installed Android 2.3.3 SDK Platform along with Google APIs for that platform.</p> <p>When I create new projects for most all of the tutorial programs I select Android 2.3.3 as my target.</p> ...
android
[4]
5,599,278
5,599,279
How to capture the href attribute of an internal link in jQuery and use the value of # for selecting a div tag Id
<p>I have an a navigation which contains links such as:</p> <pre><code>&lt;a href="#div1"&gt;DIV 1&lt;/a&gt; &lt;a href="#div2"&gt;DIV 2&lt;/a&gt; &lt;a href="#div3"&gt;DIV 3&lt;/a&gt; </code></pre> <p>Also I have three div tags as follow</p> <pre><code>&lt;div id="div1"&gt; SOME CONTENT &lt;/div&gt; &lt;div id="div...
jquery
[5]
648,558
648,559
C++ version of CopyOnWriteArrayList
<p>Java has <a href="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/CopyOnWriteArrayList.html" rel="nofollow">CopyOnWriteArrayList</a>, which enables me to iterate and mutate using 2 different threads simultaneously, without having any external locking.</p> <p>Do we have any similar thread safety da...
c++
[6]
698,665
698,666
Newbie query on dynamic addition of properties
<p>This is a follow-up to my previous <a href="http://stackoverflow.com/questions/12172119/javascript-how-to-avoid-addition-of-a-new-property-in-a-function/12172186">query</a>. I have been trying some code since then :</p> <pre><code>var myFunc = function(){ this.int1=1; var int2=2; }; myFunc.int1=3; myFunc.in...
javascript
[3]
1,974,358
1,974,359
How to avoid repeatedly calling a function in this case?
<p>I wrote a function to display an object on each wordpress post:</p> <pre><code>function pod(){ global $post,$pod; $id = get_the_ID(); $pod = new WP_POD( $id ); return $pod; } </code></pre> <p>I thought $pod is global, so, I can use $pod->stuffs when need, but it doesn't work. So, in each function I need to use stu...
php
[2]
4,718,836
4,718,837
How to implement fluent interface with a base class, in C++
<p>How can I implement this fluent interface in C++:</p> <pre><code>class Base { public: Base&amp; add(int x) { return *this; } } class Derived : public Base { public: Derived&amp; minus(int x) { return *this; } } Derived d; d.add(1).minus(2).add(3).minus(4); </code></pre> <p>Current code doesn't wo...
c++
[6]
5,337,552
5,337,553
iphone refresh json data from other class
<p>I am displaying json data in tableview </p> <pre><code>-(void)getJsonDataFromNet{ //retrieves the json data and display in tableview } </code></pre> <p>And For one of Selected row i am displaying multiselect alert tableview which i used the code from below link</p> <p><a href="http://starterstep.wordpress.com/20...
iphone
[8]
3,466,512
3,466,513
Moving the object on desired path using Accelerometer
<p>I want to move the ball image on the desired path lets say a road with a "V" turn with the help of Accelerometer values.I have taken separate image for track with alpha non zero on track. Using alpha values i am calculating next point for the ball. This works fine for the part of the track parallel to X or Y axis.</...
iphone
[8]
5,286,124
5,286,125
why string.matches and pattern.matches get different results?
<pre><code> // pattern 20xx/xx/xx, e.g. 2012/2/22 String Regex_Date_1 = "20\\d\\d/\\d{1,2}/\\d{1,2}"; String cell = "from 2011/7/31 to 2011/8/15 15:10-17:40,18:30-21:00"; System.out.println(cell); System.out.println("--- a ---"); System.out.println( cell.matches(Regex_Date_1) ); System.out.println("--- b ---"); Patt...
android
[4]
4,706,655
4,706,656
Javascript "Uncaught TypeError: object is not a function" associativity question
<p>Code is as follows:</p> <pre><code>&lt;body&gt; &lt;a href="javascript:;" id="test"&gt;hello&lt;/a&gt; &lt;/body&gt; &lt;script type="text/javascript"&gt; document.getElementById("test").addEventListener("click", function () { test() }, false) function test() { var postTypes = new Array...
javascript
[3]
5,239,592
5,239,593
How to implement Search More button how in google images
<p>How to implement Search More button how in google images? In google images search results saved, if I click on any link on the page and then press on the back button.</p>
javascript
[3]
4,270,900
4,270,901
C# how to get the name (in string) of a class property?
<pre><code>public class TimeZone { public int Id { get; set; } public string DisplayName{ get; set; } } </code></pre> <p>In some other class I've:</p> <pre><code> var gmtList = new SelectList( repository.GetSystemTimeZones(), "Id", "DisplayName"); </code></pre> <p><em>Note: System.Web...
c#
[0]
4,142,724
4,142,725
Windows Services
<p>I have to create a service in .net 1.1 and to install that service using setup project and successfuly installed that service but didn't show the service list</p>
c#
[0]
5,926,921
5,926,922
Update android application remotely
<p>how to update an android third party application on mobile with user permission?<br> We are developing one product.client installed it from our company website.<br> How to update it remotely?</p> <p>Thanks in advance</p>
android
[4]
1,606,024
1,606,025
How to write a function to rearrange a list according to the dictionary of index
<p>How to write a function to rearrange a list according to the dictionary of index in python?</p> <p>for example,</p> <pre><code> L=[('b',3),('a',2),('c',1)] dict_index={'a':0,'b':1,'c':2} </code></pre> <p>I want a list of :</p> <pre><code> [2,3,1] </code></pre> <p>where 2 is from 'a',3 is from 'b' and ...
python
[7]
4,652,999
4,653,000
Conditional loop
<pre><code> static bool BoxDiscovery(h) { ... //I've acquired bmp by this point in the ellipses above for (int v = 211; v &lt; 661; v++) { Color c = bmp.GetPixel(h, v); if (c.R &gt; 221 &amp;&amp; c.G &lt; 153) //if c.r &gt; 22...
c#
[0]
1,217,186
1,217,187
How to split domain info from username in PHP
<p>PHP is pulling the user id as <code>"domain\username"</code> through <code>$_SERVER['AUTH_USER']</code> I am looking to be able to echo just the username in the html.</p>
php
[2]
5,669,273
5,669,274
Do you have to include a false value in a ternary operator PHP?
<p>I need to add append data to a string if a certain variable is true, if not, I don't need to append anything. Currently I'm doing:</p> <pre><code>$string = (condition()) ? 'something'.$string.'something' : $string; </code></pre> <p>Is there a way to skip adding the false option in a ternary operator? It seems wast...
php
[2]
3,279,312
3,279,313
ArrayList not reading in properly
<p>I have an ArrayList &amp; I Want it to read in &amp; Total the numbers within the file, but it is only outputting the last number within the file, they are all on different lines etc.</p> <pre><code>Here is my code, thanks in advance: import java.io.File; import java.io.FileNotFoundException; import java.util.Arr...
java
[1]
4,920,196
4,920,197
Android Device chooser does not offer real Galaxy tab 10.1 device
<p>Running eclipse + android sdk on Windows XP<br> Have got "hello Android" application running in emulator OK.<br> Want it to run on Samsung Galaxy tab 10.1.<br> Android Device chooser does not see real device.<br> Have install usb drivers on XP from Samsung.<br> XP device manager shows: Samsung Mobile USB Modem, Sams...
android
[4]
3,589,699
3,589,700
Howto start a windows form in c#
<p>i have a simple programm, and i added a windows form, what must i make top start the form from the programm?</p>
c#
[0]
198,954
198,955
Difference between load vs DOMContentLoaded
<p>Whats the difference between</p> <pre><code>window.addEventListener("load", load, false); </code></pre> <p>and</p> <pre><code>document.addEventListener("DOMContentLoaded", load, false); </code></pre> <p>?</p>
javascript
[3]
4,410,430
4,410,431
jQuery appendTo problem on IE
<p>The code below works fine on Firefox, Safari etc with no errors at all. But won't work on any IE, also reports errors. Can someone help please?</p> <p>HTML</p> <pre><code>&lt;p class="tooltip-ent"&gt;...&lt;/p&gt; </code></pre> <p>jQuery</p> <pre><code>$('&lt;span class="tt-icon-ent"&gt;Something&lt;/span&gt;')....
jquery
[5]
3,449,682
3,449,683
How do I change the full background color of the console window in C#?
<p>In C#, the console has properties:</p> <pre><code>Console.BackgroundColor // the background color Console.ForegroundColor // the foreground/text color </code></pre> <p>These can be used to change the background color of the console, and the foreground, or text, color of the console.</p> <p>The issue is, when I do...
c#
[0]
2,050,034
2,050,035
python: pass string instead of file as function parameter
<p>I am beginner in python, and I need to use some thirdparty function which basically has one input - name of a file on a hard drive. This function parses file and then proceses it.</p> <p>I am generating file contents in my code (it's CSV file which I generate from a list) and want to skip actual file creation. Is t...
python
[7]
1,783,749
1,783,750
jQuery .each callback error
<p>I am currently messing with the <code>.each()</code> function in jQuery and I am trying to count all <code>div</code>'s with the the <code>id</code> of item and add them to a string.</p> <p>The problem is, I get a callback error from my jQuery source, which I load from jquery.com's website.</p> <pre><code>var item...
jquery
[5]
2,686,816
2,686,817
ListView not responding to Click or KeyPress
<p>I have a simple ListView in my layout.xml file.</p> <pre><code>&lt;ListView android:id="@+id/action_list" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; </code></pre> <p>And in my javacode, I add a setOnItemClickListener() to my listview:</p> <pre><code>listView.setO...
android
[4]
628,388
628,389
Issue with scrolling
<p>My scroll view scrolls down extra... what could be the possible reason? It works fine in first go but when I edit my textfield in the scrollview, it starts scrolling extra down. Any clue?</p>
iphone
[8]
5,383,868
5,383,869
Arrays not getting values
<p>I have been working on this yahtzee project and have run into a problem. The dice_number array doesn't seem to be getting the randomly generated values. The oneScore TextView always displays "--". I'm posting my code. Thanks in advance for any help given. Also if you need to see anymore of the code let me know. </p>...
android
[4]
4,195,202
4,195,203
How do you create a frozen/non scrolling window region using javascript?
<p>Am curious to know how you create a frozen/non-scrolling regions on a webpage using javascript! like the one used by Stackoverflow when they alert you of the badge you have earned with a "X" close button!</p> <p>Gath</p>
javascript
[3]
2,996,115
2,996,116
JQuery + HttpHandler returning whole html page instead of the expected data
<p>I have a design of JQuery calling a .ashx file returning a small table, which was working fine all this time. However, suddenly the http handler seems to be returning the whole html page instead, not everytime though.</p> <p>Not sure why this is happening! Any clues?</p> <p>Thanks in advance</p>
jquery
[5]
3,453,932
3,453,933
Handler vs AsyncTask
<p>I'm confused as to when one would choose AsyncTask over a Handler. Say I have some code I want to run every n seconds which will update the UI. Why would I choose one over the other? </p>
android
[4]
3,692,774
3,692,775
jQuery: When clicking on checkbox, input box below will be visible
<p>I am not very good at jQuery, so I have a question; is there a quick way to code so when you click on a checkbox (equally to 1), there will appear a text box below. </p> <p>I am currently learning jQuery, so this would be a great example.</p> <p>Thanks in advance!</p>
jquery
[5]
1,793,438
1,793,439
jQuery - Click call function and click function
<p>Basically when I click a button I want to call a function and run the button click function:</p> <p>This jQuery runs when the page loads:</p> <pre><code>jQuery( document ).ready( function ( $ ) { $('ul li:first-child').addClass( 'first_item' ); className = $('.first_item').attr('id'); alert('Date is:'+ class...
jquery
[5]
3,313,544
3,313,545
Selecting all checkboxes and passing it to another page on click of a button
<p>HI,</p> <p>I have multiple checkboxes in my report. I am using two buttons Select All and Deselect All for selecting all checkboxes and deselecting all checkboxes. But am not able to pass the checked values to another report. Only if I manually select the checkboxes then only those values are getting passed in the ...
javascript
[3]
435,015
435,016
What to do with multiple Android apps that share about 90% of source code?
<p>I have a public transport app for one country and I want to create a separate app for another country. Most of the code will be shared, but I need some classes to have different implementations for example TransitProvider.</p> <p>Is it possible to share code using Android Library Project? Can I do the following?</p...
android
[4]
2,464,681
2,464,682
Retrieve table id with jQuery
<p>I have some tables that are generated with automatic id, so I didn't know the table id before to do some stuff on it.</p> <p>To retrieve my id, I use this jQuery light code </p> <pre><code> $('table').each(function(){ alert(this.id); }); </code></pre> <p>Idea of the html code generated...
jquery
[5]
2,465,269
2,465,270
Online radio streaming
<p>I need to create a application for online radio streaming for a link(The path of the mp3 file) can somebody please provide me a link to go about it.The user then should be able to play the song and also stop playing the music.Please please its urgent any help will be appreciated.Thank you.</p>
android
[4]
1,708,884
1,708,885
Load XML content in javascript application
<p>I develop a javascript application which display data from xml with charts and lists. For now I put some sample files onto the server's directory that I load with :</p> <pre><code>$.ajax({ type: 'GET', url: 'data/default.xml', dataType: 'xml', ...}) </code></pre> <p>The Xml files can be very heavy so when one of t...
javascript
[3]
5,092,840
5,092,841
IPhone EventKit Discrepancy with NSDate ( Time is off by 1 hour )
<p>I was creating an <code>EKEvent</code> for iCal but the time was coming out incorrectly. </p> <p>When I created the <code>NSDate</code> and used a dateformatter to read it, the date was as I would expect it. But, when I would add the date as the <code>startDate</code> to the <code>EkEvent</code> and would add the ...
iphone
[8]
2,425,949
2,425,950
How to hide the Div at the Click of the Button in MVC
<p>My application is in MVC3.I want a particular Div in my View to Hide at the click of the button. Below is my Code that i tried.</p> <pre><code> $(document).ready(function () { $("#btnCompare").click(function () { if(MyCondition) { for(MyLoop) { } } } }); </code></pre> <p>My this code is not working...
jquery
[5]