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,448,020 | 3,448,021 | Get URL of ASP.Net Page in code-behind | <p>I have an ASP.Net page that will be hosted on a couple different servers, and I want to get the URL of the page (or even better: the site where the page is hosted) as a string for use in the code-behind. Any ideas?</p>
| asp.net | [9] |
1,908,370 | 1,908,371 | Evaluating an object false within a conditional | <p>Let's suppose we have defined a queue object and we want to loop while there are items in the queue.</p>
<p>The obvious solution:</p>
<pre><code>var queue = new Queue();
// populate queue
while (queue.size()) {
queue.pop();
}
</code></pre>
<p>The desired form: </p>
<pre><code>var queue = new Queue();
// popu... | javascript | [3] |
2,725,907 | 2,725,908 | Why do the Java tutorials construct Booleans explicitly? | <p>For e.g, </p>
<pre><code>marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
</code></pre>
<p><a href="http://java.sun.com/developer/technicalArticles/WebServices/jaxb/#binsch" rel="nofollow">JAXB Tutorial</a></p>
| java | [1] |
933,469 | 933,470 | Is there a way to configure email account on iPhone from code? | <p>I'm quite new in iPhone development. I'm interested to configure email account on iPhone from code. Is it possible? Is there any API in SDK to implement this?</p>
<p>Thank in advance for your answers.</p>
<p>Regards,
M. Wolniewicz</p>
| iphone | [8] |
1,411,025 | 1,411,026 | Why does a python descriptor __get__ method accept the owner class as an arg? | <p>Why does the <code>__get__</code> method in a <a href="http://docs.python.org/reference/datamodel.html#implementing-descriptors">python descriptor</a> accept the owner class as it's third argument? Can you give an example of it's use?</p>
<p>The first argument (<code>self</code>) is self evident, the second (<code>... | python | [7] |
1,422,749 | 1,422,750 | Which one is run first between Page_Load(object sender, EventArgs e) and $(document).ready(function ()? | <p>I add JQuery to my asp.net webpage. I can't understand the run order compleletly. So I write the foolowing code to test it. In any case, Page_Load will run first than $(document).ready(), is it right? </p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %... | asp.net | [9] |
5,828,703 | 5,828,704 | How to sort elements of array list in C# | <p>I have an ArrayList that contains,</p>
<pre><code>[0] = "1"
[1] = "10"
[2] = "2"
[3] = "15"
[4] = "17"
[5] = "5"
[6] = "6"
[7] = "27"
[8] = "8"
[9] = "9"
</code></pre>
<p>Now i need to sort the array list such that it becomes,</p>
<pre><code>[0] = "1"
[1] = "2"
[2] = "5"
[3] = "6"
[4] = "8"
[5] = "9"
[6] = "10"
[... | c# | [0] |
2,923,959 | 2,923,960 | Can I use any Android Phone for application development? | <p>Can I use any Android Phone for app development? Here in the Philippines, there are many available mobile phones with Android installed. But I want to buy the cheapest phone available (which I think is Samsung i5500 Galaxy 5). Thanks in advance!</p>
| android | [4] |
3,825,151 | 3,825,152 | Trying to enable/disable an input text when a chekbox is unchecked/checked | <p>I'm trying to enable/diable an input text when a chekbox is checked/unchecked</p>
<p>I have tried this below but it doesn't work..</p>
<pre><code> $('#checkbox').change(function(){
if($('#name').attr('disabled') == 'true')
$('#name').attr('disabled', 'false');
else
$('#name').attr('disabled'... | jquery | [5] |
4,123,826 | 4,123,827 | How to avoid "ls: write error: Broken pipe" with php exec | <p>I'm having an error that causes me a very big waste of time. This is the line:</p>
<pre><code> exec ("ls -U ".$folder." |head -1000", $ls_u);
</code></pre>
<p>This command runned on my shell needs less than a second, launched by php (direct from console, not throw apache) needs more than 15 seconds and I get this ... | php | [2] |
2,871,100 | 2,871,101 | iPhoneSDK: Launching multiple views from within a single view? | <p>I have a very simple entry form. After a button is pressed, I need to show two additional views launched from that view. Here is the error. I am not understanding the error. I thought I had declared two different types. Comments appreciated.</p>
<p>009-11-03 17:17:29.008 eProcessing-iPhone[34257:207] *** Terminatin... | iphone | [8] |
2,099,657 | 2,099,658 | Validating a numeric only textbox | <p>I've created a form based program that need some validation, all I need to to make sure the user can only enter numeric value in the distance text field</p>
<p>So far, I've checked that it's got something in it, if it has something then go on to validate it's numeric</p>
<pre><code>else if (txtEvDistance.Text.Leng... | c# | [0] |
286,531 | 286,532 | Find substring or exact string in php | <p>When I use strpos it returns false if the both strings are equal. Is there a function or a parameter to this function that returns tru if there is a substring in the main string or both strings are equal?</p>
<p>Or am i wrong and it does it for the full string also?</p>
| php | [2] |
2,401,324 | 2,401,325 | date from string YYMMDDHHMMSS | <p>I have a string of format YYMMDDHHMMSS. How to create a js date object from this pattern? Is there any built in method for this? Or I have to create split the string into array of string (each of length 2 characters) then used in new Data object?</p>
| javascript | [3] |
5,029,302 | 5,029,303 | Why does Android recreate activities on Orientation Change | <p>Does anyone know the rationale behind the design of Android to destroy and re-create activities on a simple orientation change?</p>
<p>Shouldn't allowing the activity to just redraw itself (if it so chooses) be a better, simpler and more practical design?</p>
<p>BTW, I'm well aware of how to disable my app from or... | android | [4] |
3,756,597 | 3,756,598 | Configurable URL with ACRA for Android when sending report to self hosted server? | <p>I'm using <a href="http://code.google.com/p/acra/" rel="nofollow">ACRA</a> for Android, and I want to send the crash reports to my own server. I've set it up alright, and everything works fine. However, I would like to make the URL that the reports are sent to configurable. But I do not know how to do it. </p>
<p>H... | android | [4] |
2,365,079 | 2,365,080 | example how to do multiple inherit? | <p>Can somebody give me a example: How do i multiple inherit int, float from first class and char, string from second class into the third class ?</p>
| c++ | [6] |
1,900,560 | 1,900,561 | Related to function declarations | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/455518/how-many-and-which-are-the-uses-of-const-in-c">How many and which are the uses of “const” in C++?</a> </p>
</blockquote>
<p>What is the difference between the following declarations?</p>
<ol>... | c++ | [6] |
828,983 | 828,984 | What is the fastest way to flatten arbitrarily nested lists in Python? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/406121/flattening-a-shallow-list-in-python">Flattening a shallow list in Python</a><br>
<a href="http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python">Flatten (an irregular) list... | python | [7] |
2,398,343 | 2,398,344 | python: dict as prototype/template for another dict - std.lib way to solve this? | <p>I was looking for a way to create multiple ad-hoc copies of a dictionary to hold some "evolutionary states", with just slight generational deviations and found this little prototype-dict:</p>
<pre><code>class ptdict(dict):
def asprototype(self, arg=None, **kwargs):
clone = self.__class__(self.copy())
... | python | [7] |
3,177,490 | 3,177,491 | Drag and drop in jquery | <p>I didn't get the id of dropped div on dropping on another div
i get the id_droppable i but didn't get the id_dropped div
The alert id_dropped give undefined as result</p>
<p>Please help me verify my code and correct my error.</p>
<pre><code>$(".full-circle").droppable({
accept: ".unseated_guest",
drop: fu... | jquery | [5] |
848,922 | 848,923 | Clarification on the docs for PendingIntent.FLAG_CANCEL_CURRENT | <p>From the <a href="http://developer.android.com/reference/android/app/PendingIntent.html#FLAG_CANCEL_CURRENT" rel="nofollow">documentation of Pending Intent <code>FLAG_CANCEL_CURRENT</code></a> in Android:</p>
<blockquote>
<p>by canceling the previous pending intent, this ensures that only entities given the new d... | android | [4] |
160,385 | 160,386 | Dynamically adding/removing sections within dynamically added sections | <p>The script is supposed to have buttons to add or delete a section. Within that section there are buttons to add or delete a sub-section called 'row'. The problem I'm having is linking the row buttons to the section they were created in. Ie, no matter which section they belong to, they add or delete in the last secti... | javascript | [3] |
1,520,098 | 1,520,099 | event.target on ie 8 | <p>jquery newbie here. </p>
<p>Is there a problem using <strong>event.target</strong> in ie8?</p>
<p>It seems to be working in ie9 and on my android. </p>
<p>This is my code:</p>
<pre><code> <script type="text/javascript">
$(function() {
$('#myMenu')[0].onclick = function(event) {
var select... | jquery | [5] |
5,681,761 | 5,681,762 | Cast a function pointer | <p>Suppose I have a function <pre><code>void myFun(int*) </code></pre> In C++ what exactly does the following mean</p>
<pre><code>
(void)(*)(void*)&myFun
</code></pre>
<p>Is it a pointer to a function that takes a <code>(void*)</code> as an argument and returns a <code>void</code>? Is this type of cast per... | c++ | [6] |
1,579,232 | 1,579,233 | check or uncheck all checkboxes based on a condition | <p>I have this html </p>
<pre><code> @foreach (var item in Model.Options)
{
<input type="checkbox" checked="checked" name="selectedObjects" noneoption=@(item.OptionText=="None of the above" ? "true" : "false") id="@(Model.QuestionNo)_@(item.OptionNumber)_chk" value="@item.OptionNumber" onchange="checkBoxCh... | jquery | [5] |
5,502,442 | 5,502,443 | How to make a view visible when a button is clicked and make that view invisible when the button is again clicked? | <p>I have a layout which is invisible when the activity starts.When I click on a button the layout becomes visible.My requirement is when I click the button for the second time, the layout should be invisible.I know this is a silly question but as I am a new to android, I am unable to figure it out.</p>
| android | [4] |
3,208,606 | 3,208,607 | Concatenate object items | <p>I have the following function which works fine.</p>
<pre><code>function ($objects, $items = array())
{
$result = array();
foreach ($objects as $object) {
$result[$object->id] = $object->first_name . ' ' . $object->last_name;
}
return $result;
}
</code></pre>
<p>However, I would like to pass i... | php | [2] |
4,305,726 | 4,305,727 | My info doesn´t erase after uninstall the app | <p>I made an app that use the sharedPreferences and i storage some info there, when i uninstall the app and install again the info storage there always appear, i don´t know why. I don´t programming anything to keep them there.</p>
<p>I just upgrade my Galaxy S to 2.2.1 and i did a back up of all my apps including that... | android | [4] |
4,851,587 | 4,851,588 | Trying to implement level order traversal on a binary search tree in Java | <p>Okay, so I'm trying to make a method that will return the level order of a basic binary search tree that carries int values in its nodes. I've figured out most of the other methods, such as insertion, post order and pre order, but I keep running into the same problem with the level order method</p>
<p>Here's the co... | java | [1] |
2,926,363 | 2,926,364 | saving html tags and and reproducing properly | <p>i am using mysql db and php code.</p>
<p>i store value like this in db <code><u><strike><i><b>Opinion</b></i></strike></u></code></p>
<p>that is with some editor. so how do i display it so that, it takes all the tags given to it.??? </p>
| php | [2] |
4,744,751 | 4,744,752 | How to check if a php script is being called by another script on the server? | <p>I have a script scripty.php</p>
<p>Sometimes this script gets called through the browser.</p>
<p>Other times it gets called by another script on the server.</p>
<p>How can I (securely) check within scripty.php to see whether or not it is being called by the server?</p>
| php | [2] |
5,243,412 | 5,243,413 | Tomcat server distribution license key | <p>I have a web application which is running on tomcat. I need to distribute it and install on many different servers. Some of these servers are not connected to the internet. I have to give this software to reseller companies who will install it in different locations. </p>
<p>Problem :: What is the best way I can ke... | java | [1] |
560,745 | 560,746 | PHP: How do you generate all possible combinations of values in an array? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1256117/algorithm-that-will-take-numbers-or-words-and-find-all-possible-combinations">algorithm that will take numbers or words and find all possible combinations</a> </p>
</blockquote>
<p>If I have an array suc... | php | [2] |
4,272,741 | 4,272,742 | Exception Handling problem in C++ | <p>Hii , I am new to C++ programming and need some help regarding the code i wrote below....
Its a basic exception handling program </p>
<pre><code>#include<iostream>
class range_error
{
public:
int i;
range_error(int x){i=x;}
}
int compare(int x)
{
if(x<100)
... | c++ | [6] |
905,493 | 905,494 | How do i fetch a single value from serialize() | <p>I have a form and i fetch the values of form using jQuery <code>.serialize();</code> for example to fetch the form data i use the following.</p>
<pre><code>var formData = $('form').serialize();
</code></pre>
<p>now the variable formData holds the following value.</p>
<pre><code>subcategoryname=aaaa&prefix=AA&... | jquery | [5] |
1,392,650 | 1,392,651 | Using contentProvider for the database of my app is good practice | <p>I am developing a app and that has a database. Normally i have no wish to access my app database from other apps. Even after that should i use contentProvider.</p>
| android | [4] |
3,869,935 | 3,869,936 | Signed INT Conversion of MSB ->LSB and LSB->MSB in C++ | <p>I checked out the SWAR algorithm (<strong>S</strong>IMD <strong>W</strong>ithin <strong>A</strong> <strong>R</strong>egister) for reversing bit order of <code>unsigned int</code>s. Is there something similar for <code>signed int</code>?</p>
| c++ | [6] |
5,562,893 | 5,562,894 | how to implement something like remote desktop or LogmeIn in Java? | <p>how to implement something like remote desktop or LogmeIn in Java? should I use something like Java.awt.Robot? which libraries should I look into?</p>
| java | [1] |
5,906,226 | 5,906,227 | How to convert and revert this time to UNIX using PHP? | <p>I want to save this date format into my DB 20/07/2012 22:10 in a UNIX format.
How can I do this, and how can I revert it to a readable format?</p>
| php | [2] |
1,878,489 | 1,878,490 | Overriding Extension Methods | <p>I've been thinking about using extension methods as a replacement for an abstract base class. The extension methods can provide default functionality, and can be 'overridden' by putting a method of the same signature in a derived class.</p>
<p>Any reason I shouldn't do this?</p>
<p>Also, if I have two extension me... | c# | [0] |
1,749,312 | 1,749,313 | jQuery: looking through a DIV, getting name that contains WITH id that contains | <p>I've got a very interesting need for jQuery.</p>
<p>I need to look into a specific DIV ID and then within that DIV, find an input thats name contains a certain string but is also checked.</p>
<pre><code>var exclusionsFridayChecked = $("#divExclusions").find("input[id~='Fridays'][type='checked']").length;
// hopin... | jquery | [5] |
3,885,709 | 3,885,710 | PHP video snapshot display | <p>Is there any way to display video(snapshot) as as a image in PHP?</p>
| php | [2] |
750,370 | 750,371 | asp:menu selected menu item highlight | <p>I'm using <code>asp:menu</code> for showing the menus in masterpage. If I click the menu item 1, the corresponding page is loading in the content page. I need that the selected menu item should be highlighted with some color. Please help me out.</p>
<p>Menu code is as follows:</p>
<pre><code><asp:menu id="Navig... | asp.net | [9] |
1,889,067 | 1,889,068 | can not start create popup window when activity first start | <pre><code>protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.question_layout);
show_popup();
}
private void show_popup(){
LayoutInflater lf = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATE... | android | [4] |
5,351,410 | 5,351,411 | Javascript - setTimeout function | <p>i try to develop a page and i have to use setTimeout function because i need to load my video in my page two seconds later.</p>
<p>In order to do that, i wrote this,</p>
<pre><code> window.onload = function () {
player = new Player('playerObject');
setTimeout(player.playByUrl($mp4Link),3000);
}... | javascript | [3] |
4,078,948 | 4,078,949 | creating loop for jquery datatables? | <pre><code>/*
* SQL queries
* Get data to display
*/
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS `" . str_replace(" , ", " ", implode("`, `", $aColumns)) . "`
FROM $sTable
$sWhere
$sOrder
$sLimit
";
$rResult = mysql_query($sQuery, $gaSql['link']) or fatal_error('MySQL Err... | jquery | [5] |
863,038 | 863,039 | how to store large integer in java( 10 digits ) | <p>which java data type would be able to store the numerical value 9999999999 ?</p>
| java | [1] |
260,139 | 260,140 | Android - How can I add an image view dynamically? | <p>I would like to add an image view dynamically and then add a 2 bitmaps to that view, how can I do this?</p>
| android | [4] |
3,835,937 | 3,835,938 | Using Cursor with setMultiChoiceItems in Alert dialog | <p>I want to display a multichoice list in an alert dialog box. If I'm using an array to store the list of items, then it is working fine : </p>
<pre><code>d.setMultiChoiceItems(R.array.items,
new boolean[]{false, true, false, true, false, false, false},
new DialogInterface.OnMu... | android | [4] |
4,069,321 | 4,069,322 | How to catch "Sorry, This video cannot be played" error on VideoView | <p>I have a VideoView and I am streaming videos from a remote server. Most of the times It would play the videos very smoothly. But sometimes, it displays an error message "Sorry, This video cannot be played". I have a hunch that this is more on the supported video formats. However, I don't know which are the supported... | android | [4] |
3,182,648 | 3,182,649 | JQuery: How stop an animation loop on mouse over? (Object Oriented) | <p>I have defined an object that displays a slideshow, below is a simplified version of the render method.</p>
<p>My problem is that I want to stop all the animations running on the startLoop method. But I'm not figuring it out.</p>
<pre><code>// Render display
this.render = function() {
...
MAKE HTML WITH SLI... | jquery | [5] |
512,517 | 512,518 | Javascript, Can I stretch text vertically | <p>Can I Stretch text in javascript? I dont want the font bigger because that makes it appear bolder than smaller text beside it, I just want to stretch the text vertically so its kind of deformed . This would be one div id and then normal text beside it would be another div id. Any ideas?</p>
<p>Thanks, -Matthew</p>
... | javascript | [3] |
5,977,054 | 5,977,055 | how to adjust alignment for text entered in a jtextfield to right | <p>i want to set the alignment of my text to right actually the fields are related to currency so if it starts form right it will look good.</p>
<pre><code>PreparedStatement stmt1 = con.prepareStatement("select sum(tv)as totalsum from mut_det WHERE rm_id = ?");
ResultSet rs1;
String rm1 = tf_rm... | java | [1] |
5,164,677 | 5,164,678 | Create Object at Runtime | <p>I have a simple factory below that I would like to simplify and not be required to modify each time I add a new object that I would like to return. In Javascript, how would I be able to create an object at runtime? Thanks</p>
<pre><code>switch (leagueId) {
case 'NCAAF' :
return new NCAAFScoreGrid();
case... | javascript | [3] |
1,691,740 | 1,691,741 | Are these pointer conversions using static_cast ok? | <p>Suppose we have the following code:</p>
<pre><code>#include <iostream>
struct A
{
virtual void f() {
std::cout << "A::f()" << std::endl;
}
};
struct B: A
{
void f() {
std::cout << "B::f()" << std::endl;
}
};
void to_A(void* voidp) {
A* aptr = st... | c++ | [6] |
5,828,608 | 5,828,609 | How to add string $action in form | <p>I have this php code in my register.php file:</p>
<pre><code>// include the Zebra_Form class
require 'system/Zebra_Form.php';
// instantiate a Zebra_Form object
$form = new Zebra_Form('register_form');
</code></pre>
<p>I now want to add action which will go to action="?do=register" </p>
<p>This is the class <a h... | php | [2] |
5,538,073 | 5,538,074 | ASP.NET rewritten custom errors do not send content-type header | <p>I have the following configuration in my web.config:</p>
<pre><code><customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/Error/Error.html">
<error statusCode="404" redirect="~/Error/Error.html" />
<error statusCode="400" redirect="~/Error/Error.html" />
</customErro... | asp.net | [9] |
284,392 | 284,393 | C++:boost file system to return a list of files older than a specific time | <p>I am using the <code>Boost::FileSystem</code> library with C++ running under Linux platform and I have a question following:</p>
<p>I would like to have a list of files which are modified older than a given date time. I dont know whether the boost::FileSystem offer such a method as:</p>
<pre><code>vector<string... | c++ | [6] |
2,732,104 | 2,732,105 | How to throw an exception for non-existence image choose | <p>in my scenario I choose an picture from gallery and show it in my imageView on the same layout and i can process to another activity using the image. But i have an force stop when i didnt choose any image when click the intent button. </p>
<p>Who have the idea on solving this?</p>
<pre><code>public void onCreate(B... | android | [4] |
4,244,740 | 4,244,741 | How to set the value inside a list in python? | <p>I have 10 dice that are all programmed the same as D1.</p>
<pre><code>D1 = random.randint(1,12)
</code></pre>
<p>I then store them all in a list like this:</p>
<pre><code>roller[DI,D2...]
</code></pre>
<p>A person then selects the die to keep (in a while loop) and when he wants to roll the remaining dice he end... | python | [7] |
3,875,328 | 3,875,329 | Android unknown error occurred in android when clicking on one of tab Activity | <p>unknown error occurred in android when clicking on one of tab Activity in android although it working fine but message displayed in toast "unknown error occurred"</p>
<p>public class importDiagram extends Activity {</p>
<pre><code>private UserLogIn mUserLogIn = null;
private Button mCategory = null;
GeneralWe... | android | [4] |
247,141 | 247,142 | jQuery not working while setting up a new site | <p>I am building a little hobby site for fans of a soccer team, and I am trying to add some jQuery, and I can not seem to get the jQuery to get triggered.</p>
<p>I made a submit button inside a form in the right hand column that is supposed to call a jQuery function when clicked, but it isn't calling the jQuery functi... | jquery | [5] |
2,415,443 | 2,415,444 | java regular expression | <p>a
b
k4
2c
a10u
u20
30
4u9uwr
uvw567uvw</p>
<p>for the above lines I need out put like below how to write the regular expression i tried with strLine.replaceAll("[a-z]", "").trim(); it is removing digit stating and ending with charecters but except the first 2 line a, b are not removing and aslo i am doing interger... | java | [1] |
1,485,903 | 1,485,904 | alternative to htmlspecialchars | <p>We can use htmlspecialchars to stip out html tags.</p>
<pre><code>$name = $_POST['inputbox1'];
$name = htmlspecialchars($name);
echo "Welcome".$name;
</code></pre>
<p>Is there another alternative?</p>
| php | [2] |
6,027,282 | 6,027,283 | change android.util.Log log text format | <p>I want to change the way the log text is formatted, </p>
<p>Currently when logging with android.util.Log</p>
<pre><code>Log.d("tag", "this is the text I added");
</code></pre>
<p>it comes as </p>
<pre><code><!>com.appname.android.classname 1286<!> this is the text I added
</code></pre>
<p>I want to ... | android | [4] |
2,757,997 | 2,757,998 | Please remove this problem:: javax.servlet.ServletException: Servlet execution threw an exception | <p>HTTP Status 500 -</p>
<p>type Exception report</p>
<p>message</p>
<p>description The server encountered an internal error () that prevented it from fulfilling this request.</p>
<pre><code>exception
javax.servlet.ServletException: Servlet execution threw an exception
`root cause`
java.lang.Error: java.lang.Run... | java | [1] |
3,073,724 | 3,073,725 | How to get user profile picture in twitter integration in android? | <p>Hi,
I am new to android trying to integrate twitter with my application. I need to do get twitter profile name and profile picture once the user is logged in. I am able to get profile name but not the profile picture. How can I get the profile picture?</p>
| android | [4] |
4,349,628 | 4,349,629 | Email Validation to accept all special character | <p>i have regular expression to validate the email address as below</p>
<p>var reg = /^([A-Za-z0-9_-+.])+\@([A-Za-z0-9_-.])+.([A-Za-z]{2,4})$/;</p>
<p>please help me to validate the entered email so that the input box should accept all special characters listed below.</p>
<pre><code> .!#$%^&*-=_+{}|/?`
</code></... | javascript | [3] |
3,948,594 | 3,948,595 | "listen " wait for tag to print | <p>I have javascript "API" function that need a certain tag to work with.</p>
<p>i got problem with the positioning of the script. here is what i mean :</p>
<ol>
<li><p>if the Script has been written in the head , i need to wait for the tag to get printed to work with , what's means that i need to follow on the page ... | javascript | [3] |
1,671,652 | 1,671,653 | Which are the advantages of developing in Java a server-side application compared to other languages? | <p>Our company is starting the development of a client-server application and a discussion is going on about which technologies should be used.
For the client (GUI) side we tend to QT and C++. For the server side, we have been advised to use Java and indeed it looks like it is one of the languages being used most for ... | java | [1] |
4,867,822 | 4,867,823 | apktool decompiler missing xml files in res folder | <p>I am using apktool to decompile the apk to get the res file. I downloaded the apktool and used command (apktool –d myapp.apk), it is extracting the res file but in value folder some xml files are missing.Please let me know the solution.Thanks..</p>
| android | [4] |
5,379,356 | 5,379,357 | which order is better when defining the local var? | <pre class="lang-java prettyprint-override"><code>PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
Map<String, Object> returnMap = new HashMap<String, Object>();
for (int i = 0; i < propertyDescriptors.length; i++) {
......
returnMap.put(propertyN... | java | [1] |
1,990,599 | 1,990,600 | Extend rand() max range | <p>I created a test application that generates 10k random numbers in a range from 0 to 250 000. Then I calculated MAX and min values and noticed that the MAX value is always around 32k...</p>
<p>Do you have any idea how to extend the possible range? I need a range with MAX value around 250 000!</p>
| c++ | [6] |
440,051 | 440,052 | How to Notify a folder using SHChangeNotify | <p>My application will create some folders and it's icon needs to be changed depending on certain activities.</p>
<p>I tried to use the function below and it seems it's not refreshing the folder</p>
<p><code>SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNE_ALLEVENTS | SHCNE_UPDATEIMAGE | SHCNE_UPDATEDIR |SHCNF_PATH | SHCNF_... | c++ | [6] |
3,046,557 | 3,046,558 | Dynamic HTML content through PHP | <p>I've heard it's a bad practice to echo dynamic HTML content through PHP. But what are the alternatives, in case you need it, like, f.e. a navigation menu on a website, repeated in every page?</p>
| php | [2] |
5,056,164 | 5,056,165 | How to find a node in a tree with JavaScript | <p>I have and object literal that is essentially a tree that does not have a fixed number of levels. How can I go about searching the tree for a particualy node and then return that node when found in an effcient manner in javascript?</p>
<p>Essentially I have a tree like this and would like to find the node with the ... | javascript | [3] |
2,598,624 | 2,598,625 | get js file query param from inside it | <p>I load this file with some query param like this:<br/>
<code><strong>src='somefile.js?userId=123'</strong></code></p>
<p>I wrote the below function in 'somefile.js' file that reads the 'userId' query param<br/>
but I feel this is not the best approach. Frankly, its quite ugly. <strong>Is there a better way</strong>... | javascript | [3] |
969,228 | 969,229 | PHP's DateTime-.add function works locally but not on server | <p>I'm stuck on this and don't know what else to try. This line of code works fine locally but fails on server. There is no error message. I just get a blank page.</p>
<p><code>$tempDate->add(new DateInterval('P1M'));</code></p>
<p>Any idea why I would see this behavior?</p>
| php | [2] |
980,191 | 980,192 | Does List and dictionary in python have a limited capacity ? if yes,how much is it? | <p>Does List and dictionary in python have a limited capacity ? if yes,how much is it ?</p>
| python | [7] |
1,391,435 | 1,391,436 | jQuery simple function with callback | <p>hi i'm trying writing down a function wich will do somenthing then bind a callback when finished, i would like to specify the callback when i init the js function...</p>
<pre><code> function hello(arg1,arg2,callback){
alert(arg1 + arg2);
callback;
}
hello('hello','world',function callback(){
alert('hey... | javascript | [3] |
1,789,221 | 1,789,222 | How do I invoke a function from a dynamic class from a module? | <p>Normal way:</p>
<pre><code>import ham
ham.eggs.my_func()
ham.sausage.my_func()
</code></pre>
<p>How I want it "Dynamic" way:</p>
<pre><code>str = 'eggs'
ham.str.my_func()
str = 'sausage'
ham.str.my_funct()
</code></pre>
<p>Same thing, but ideally how I would use it in a loop:</p>
<pre><code>for x in ['eggs', 's... | python | [7] |
1,991,528 | 1,991,529 | != operator and file streams | <pre><code>#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream file0( "file0.txt" );
ifstream file1( "file1.txt" );
if (file0 != file1) {
cout << "What is being compared?" << endl;
}
}
</code></pre>
<p>If the above code, what is being ... | c++ | [6] |
3,314,013 | 3,314,014 | How to get total content of string? | <p>I have passed a printf formated string to a function and try to separate the content of that string by using sscanf(). But following is the problem with the use of this function.
i have called the function as follws:</p>
<pre><code>int var = -1;
ostringstream ossi;
ossi << "myContent";
std::string detailStrin... | c++ | [6] |
1,319,310 | 1,319,311 | Android screen on when notification recived | <p>I need to on the screen, when received a notification for my application. Is there any specific way to on the screen?</p>
<p>Thank You </p>
| android | [4] |
1,374,609 | 1,374,610 | Insert Image into mysql database through Jsp | <p>Can any one provide the code for insert image in mysql through JSp page.</p>
<p>Malik
Thanks </p>
| java | [1] |
4,641,026 | 4,641,027 | Method to recursively delete any directory that has no files, my solution seems to work but trying to find ways it can break | <p>This method will delete any files and empty directories provided in the fileList. It seems to be working. I use recursion to delete the empty directories and i'm worried about cases that will create an infinite loop. Any thoughts or things to consider with this approach?</p>
<pre><code>public static void deleteFile... | java | [1] |
5,348,065 | 5,348,066 | Please tell me how can i restrict the user for max selection of 30 days? | <p>My chart can be seen here
<a href="http://www.tiikoni.com/tis/view/?id=ca9ead3" rel="nofollow">http://www.tiikoni.com/tis/view/?id=ca9ead3</a></p>
<p>As from the Chart seen , my requirement is that a User can select only Max 30 days from the Selection Area (Which is indicated in blue Color Currently on to Child Gr... | javascript | [3] |
248,596 | 248,597 | Steps in list question, Python beginner | <p>The following code include the last number.</p>
<pre><code>>>> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> numbers[::3]
[1, 4, 7, 10]
</code></pre>
<p>Why does not includet the last number 2, like 10, 8, 6, 4, 2?</p>
<pre><code>>>> numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>>... | python | [7] |
2,684,476 | 2,684,477 | List of all possible PHP errors | <p>Sometimes, while coding in PHP we get parse or syntax errors like those:</p>
<pre><code>Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in /var/www/example/index.php on line 4
</code></pre>
<p>I would like to know, if there is a list of all possible errors that PHP interpreter can output. I've s... | php | [2] |
1,173,905 | 1,173,906 | Python pixel manipulation library | <p>So I'm going through the beginning stages of producing a game in Python, and I'm looking for a library that is able to manipulate pixels and blit them relatively fast.</p>
<p>My first thought was pygame, as it deals in pure 2D surfaces, but it only allows pixel access through <code>pygame.get_at()</code>, <code>pyg... | python | [7] |
4,297,386 | 4,297,387 | java non-static variable in static context | <p>I have the following code : </p>
<pre><code>public class My_program {
class dbConnect {
public dbConnect();
public void connect_to_db(String connect_string) {
Class.forName(...);
...
}
}
public static void main(String[] args) {
String connect_string = "j... | java | [1] |
4,288,195 | 4,288,196 | Scoping rules and threads | <p>This is the program that works (I am able to hear the text to speech in action): </p>
<pre><code>import pyttsx
import threading
def saythread(location, text):
engine = pyttsx.init()
engine.say(text)
engine.runAndWait()
e = (1, "please work, oh my god")
t = threading.Thread(target=saythread,args=... | python | [7] |
4,453,915 | 4,453,916 | culturally neutral TryParse | <p>I have the following extension method</p>
<pre><code>public static bool IsValidCurrency(this string value)
{
CultureInfo culture = new CultureInfo ("en-gb");
decimal result;
return decimal.TryParse(value, NumberStyles.Currency, culture, out result);
}
</code></pre>
<p>I wish to have this to be cultural... | c# | [0] |
3,288,975 | 3,288,976 | Python Concat String | <p>I want to concat .old to a filename before I rename it with a function </p>
<p>Will this work:</p>
<pre><code>old = RemoteFileName + '.out'
ftp.rename (RemoteFileName,old)
</code></pre>
| python | [7] |
1,125,245 | 1,125,246 | how can I use e.pageY in jQuery to perform an event when mouse is moving up and not down? | <p>ok I am trying to create an event in jQuery that detects when a mouse is moving up. I am using
e.pageY event. so in this case I want the event to occur when the mouse's Y position is at less than 2. I have succesfully done that. here is the code.</p>
<pre><code>$(document).mousemove(function(e){
if (e.pageY &... | jquery | [5] |
125,595 | 125,596 | innertext return all the child and self text. how do i except one child text | <p>I have an xml file</p>
<pre><code><first>
first1
<second>second1</second>
first2
<third>third1</third>
first3
</first>
</code></pre>
<p>I want to read self text for <code><first></code> and child text for <code><third></code> except the child <code><... | c# | [0] |
3,213,003 | 3,213,004 | dynamic image crop in php | <p>hi i am using smart resizer (http://shiftingpixel.com/2008/03/03/smart-image-resizer/).
when i am giving path of files which exist on my server .this script gives me proper result.
but i path of another server , in this case this script is not giving proper result.</p>
<p>For using this script i have to pass this v... | php | [2] |
3,033,290 | 3,033,291 | Change style of text field based on the selection of a combo box using Javascript | <p>I would like to change the style of a text field based on the value selected in a combo box. Specifically, what I'd like to do is make the txtDepartment field gray and marked as "read only" if the option value selected in cboSource is 1. I've tried the code below, but I imagine my style code at least is wrong, if ... | javascript | [3] |
3,050,341 | 3,050,342 | Strange C++ behaviour involving multiple calls to destructor | <p>I'm running the following code in Dev Studio 2010:</p>
<pre><code>struct Foo
{
Foo() {cout << "Foo()" << endl;}
~Foo() {cout << "~Foo()" << endl;}
void operator ()(const int &) const {}
};
int bar[] = {0};
for_each(begin(bar), end(bar), Foo());
</code></pre>
<p>The output i... | c++ | [6] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.