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
856,098
856,099
Why aren't Java weak references counted as references during garbage collection?
<p>Why are Java weak references not counted as references with respect to garbage collection?</p>
java
[1]
763,364
763,365
Discard and print other lines in C sharp
<p>appGUID: <code>643d4128-1484-4aa1-8c17-38ae3b0cf974</code> </p> <p>appGUID: <code>3974af88-1fb1-4ba7-84b9-59aa00c707bb</code> </p> <p>I want my program to discard lines that contains some specific values for "appGUID" as in above.</p> <p>My Code is here :</p> <pre><code>IEnumerable&lt;string&gt; textLines ...
c#
[0]
310,371
310,372
If I use Android 4.2.2 API 17 to develop my app it can run in oldest versions?
<p>If I use Android 4.2.2 API 17 to develop my app it can run in oldest versions, like a tablet running an android 4.0 ?</p>
android
[4]
4,361,620
4,361,621
Split html string with regex
<p>It's possible to split an html string with regex like this one</p> <pre><code>var mystring="&lt;p style='display:inline'&gt;hello world&lt;/p&gt;!!'; </code></pre> <p>and obtain an array like this one?</p> <pre><code>[&lt;p style='display:inline'&gt;,hello world,&lt;/p&gt;,!!] </code></pre> <p>UPDATE: I did it u...
javascript
[3]
653,783
653,784
How can I use jQuery to set a div to be visible?
<p>I have a div as part of a page that is rendered like this:</p> <pre><code>&lt;div id="productdiv" style="visibility:hidden;"&gt; </code></pre> <p>Upon a certain event, I want this div to become visible.</p> <p>The following does not work:</p> <pre><code>$("#productdiv").show(); </code></pre> <p>What will work?<...
jquery
[5]
3,086,395
3,086,396
ASP.NET USER ROLE Issue
<p>I am trying to establish which Role for logged user. </p> <p>Login.aspx:</p> <pre><code>if (ValidateUser(password, userDetails.Rows[0]["Password"].ToString())) { FormsAuthenticationTicket tkt; string cookiestr; HttpCookie ck; tkt = new FormsAuthenticationT...
asp.net
[9]
5,505,752
5,505,753
Javascript if-statement vs. comparsion
<p>Is it true that in if-statement JavaScript wrap the condition into a Boolean?</p> <pre><code>if(x) =&gt; if(Boolean(x)) </code></pre> <p>Is it true that in comparison JavaScript wrap the compare elements into a Number?</p> <pre><code>a == b =&gt; Number(a) == Number(b) </code></pre>
javascript
[3]
2,666,760
2,666,761
How to convert numbers to words?
<p>How can I use Javascript for converting numbers to words? The display requires Indian rupees and paise format. </p>
javascript
[3]
5,975,660
5,975,661
simple php script to retrieve google keyword search completion
<p>I am trying to retrieve just the search completion shown in Google search result for any keyword. For example the search completion for</p> <p><a href="http://www.google.com/#hl=en&amp;q=google+keyword+search" rel="nofollow">http://www.google.com/#hl=en&amp;q=google+keyword+search</a></p> <p>is 48,400,000 (Results...
php
[2]
816,416
816,417
How to delete photo from iPhone photo library
<p>Is there any method to delete the photo(s) from the photo library. (NOTE: I dont want to copy the images into the document directory (sandbox), and then delete it from there; I want to refer the actual image from photo library)</p> <p>I have different considerations, but I am not sure anyone from these will work or...
iphone
[8]
4,791,672
4,791,673
Alternate three and three rows in a table with jQuery
<p>I want to set the alternate background color for rows in a table - but the twist is that I don't want every other row to be colored, I want to treat them in blocks of three rows.</p> <p>So for a table with eight rows I want the first three to be white, then the next three to have a background color, and the last tw...
jquery
[5]
4,042,799
4,042,800
ListFragment like facebook/g+/youtube sliding menu
<p>i'm using this library <a href="https://github.com/iPaulPro/SlidingMenu" rel="nofollow">https://github.com/iPaulPro/SlidingMenu</a> to add a slide menu.</p> <p>in the library example the back view ListFragment is simple and use only one xml template for all items in the list.</p> <p>i dont want to add item by code...
android
[4]
39,763
39,764
jquery Focus Callback
<p>Can somebody please tell me why this isnt working?</p> <pre><code>$("textarea.settings").focus(function () { var size = $(this).height(); console.log(size); if(size == 40) {$(this).animate({height: 120},"slow");} }, function () { $(this).animate({height: 40},...
jquery
[5]
5,279,508
5,279,509
Create instance of "Class" Using "Reflection" in JavaScript
<p>I searched the web for some way to create instance of "Class" in "reflection" using javaScript but I found nothing.</p> <p>generally i'm trying to do someting like java code.</p> <pre><code>Object o = Class.forename("MyClassName"); </code></pre> <p>but in javaScript, in such way that I'll get the instance of clas...
javascript
[3]
4,322,991
4,322,992
BASIC Javascript slider/rollovers NO JQUERY
<p>I am trying to learn <code>JavaScript</code>. </p> <p>So I can build my own sliders, rollovers, really awesome <code>JavaScript</code> web stuff :) - without the use of plugins and such. </p> <p>I was hoping someone could head me in the directions of building these on my own - tutorials <code>Jsfiddle</code>, etc....
javascript
[3]
2,249,288
2,249,289
Please explain this ambiguity?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7718508/order-of-evaluation-of-arguments-using-stdcout">Order of evaluation of arguments using std::cout</a> </p> </blockquote> <pre><code>#include&lt;iostream&gt; #include&lt;cstdio&gt; #include&lt;cstring&gt; ...
c++
[6]
909,367
909,368
Don't understand the const method declaration
<p>Too much C# and too little C++ makes my mind dizzy... Could anyone remind me what this c++ declaration means? Specifically, the ending "const". Many thanks.</p> <pre><code>protected: virtual ostream &amp; print(ostream &amp; os) const </code></pre>
c++
[6]
1,918,188
1,918,189
How to extend ListActivity without declaring ListView in XML layout in android
<p>Hi guys iam developing a Screen in android.Iam writing code for that screen to work both in Portrait and Landscape orientation.Here my Portrait and Landscape XML is different,that is why iam using different XML Files for both Portrait and Landscape orientaion.Here i included that these XML Files in onConfigurationCh...
android
[4]
5,994,772
5,994,773
Validate vars in URL
<p>If I know what vars I can have in my URL how do I validate my URL and ignore the ones that aren't on my list?</p> <p>I suppose I will have all 'good' vars in an array</p> <pre><code>$good = array("name", "car", "year", "color"); </code></pre> <p>Then I need to get the request URL, then break it apart looking for ...
php
[2]
295,164
295,165
Very simple jQuery attribute question
<p>Either I have misunderstood <a href="http://api.jquery.com/attr/" rel="nofollow">the jQuery docs for .attr()</a>, or I'm making a very stupid error. </p> <p>Why isn't this working?</p> <pre><code>&lt;div id="mydiv" title="mytitle"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ ...
jquery
[5]
1,471,973
1,471,974
Getting the value of the selected option tag in a select box
<p>I have an select box</p> <pre><code>&lt;select name="type1"&gt; &lt;option value="1"&gt;Laser Printer&lt;/option&gt; &lt;option value="2"&gt;Line Printer&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Now I have a button with id <code>#New1</code> when this button gets clicked I need to display the value b...
jquery
[5]
3,639,989
3,639,990
How can I make my app launch faster?
<p>I am experimenting with an app I am developping.</p> <p>When I launch the app, there is currently a 3 second delay before the app UI is usable. During the delay the screen is black, apart from the task bar and, below it, the app title bar.</p> <p>I was thinking about displaying a splashscreen as a dialog in the ma...
android
[4]
484,835
484,836
PHP Ternary Syntax Issue (been coding too long)
<p>So there is a problem with this, but i'm blind to it. Even after reading the documentation twice (<a href="http://us.php.net/manual/en/language.operators.comparison.php" rel="nofollow">PHP Comparison Operators</a>)</p> <pre><code>isset($items['blog']) ? unset($items['blog']) : NULL; </code></pre> <blockquote> <p...
php
[2]
3,427,006
3,427,007
Remove Currency Amount From String
<p>I want to remove all currency symbol and amount from page. </p> <p>Example my string:</p> <p>"This is $10,000 amount is not enough $20. But Make $200.45 profit them."</p> <p>Output:</p> <p>"This is amount is not enough . But Make profit them."</p> <p>How do I remove through c# code.</p> <p>If anyone can give...
c#
[0]
3,475,951
3,475,952
Implement google earth in iphone?
<p>I am implementing one iphone applicaiton in which I want to implement google earth.</p> <p>I have done research on net for google earth for if any google earth api available or not.</p> <p>But I have not found sucess.</p> <p>Can you advice me is it possible to implement google earth in our applciation.</p> <p>Pl...
iphone
[8]
4,572,717
4,572,718
Will android:alwaysRetainTaskState flag save the activity intent?
<p>Suppose the current task stack of my app P contains activities: A B. A started B with some intent i.</p> <p>A is defined with android:alwaysRetainTaskState flag. </p> <p>Then user switched to other app, and after a while the process of P is killed by OS.</p> <p>Then user started P from home screen. Since A has an...
android
[4]
791,468
791,469
Seg Fault (Whats Wrong, strcpy)
<p>In GDB I get:</p> <pre> (gdb) backtrace 0 0xb7d91544 in strcpy () from /lib/libc.so.6 1 0x08048982 in ISBN::ISBN(char const*, ISBNPrefix&) () 2 0x08048d4a in main () (gdb)</pre> <p>From this code:</p> <pre><code>ISBN::ISBN(const char* str, ISBNPrefix&amp; list) { if(isValid(str)) { isSet = tru...
c++
[6]
3,592,167
3,592,168
Get all XML attributes value matching criteria and update the same
<p>Need to iterate through all the XML attribute value which matches a particular criteria (using XPath) and then replace the same.</p> <pre><code>&lt;?xml version= "1.0"?&gt; &lt;inventory id= "toys"&gt; &lt;bikes sex= "boy"&gt; &lt;style id= "mountain" level= "high" size= "24"&gt; &lt;model&gt;24-inch Boys Mountain ...
c#
[0]
5,404,751
5,404,752
Can this style of carousel be done with jQuery?
<p>This is a Flash-based gallery: <a href="http://spin.co.uk" rel="nofollow">http://spin.co.uk</a> I love the way it works, but Flash isn't an option for me.</p> <p>I've had a look at various plugins but couldn't find any demo or indication that this kind of setup is even possible. I don't need to jump between slides,...
jquery
[5]
4,837,284
4,837,285
Create an Associative array in PHP
<p>How do I write PHP code to manually create this array?</p> <pre><code>Array ( [0] =&gt; Array ( [Id] =&gt; 2 [Fruit] =&gt; Apple ) [1] =&gt; Array ( [Id] =&gt; 5 [Fruit] =&gt; Orange ) ) </code></pre>
php
[2]
5,571,131
5,571,132
difference <?php echo '$test'; ?> and <?=$test?>
<p>What is the difference between</p> <pre><code>&lt;?php echo '$test'; ?&gt; </code></pre> <p>and </p> <pre><code>&lt;?=$test?&gt; </code></pre> <p>?</p>
php
[2]
2,031,966
2,031,967
Assign same text to multiple DIV by jquery
<p>Suppose that I have many <code>DIV</code>s with different <code>ID</code>s and I want to insert a small snippet of html into all of those <code>DIV</code>s with different <code>ID</code>s. I tried</p> <pre><code>$("#lblTopPager", "#lblBottomPager").html('hello my data'); </code></pre> <p>but it doesn't work. Can a...
jquery
[5]
1,032,544
1,032,545
faster way to handle time string with python
<p>I have many log files with the format like:</p> <pre><code>2012-09-12 23:12:00 other logs here </code></pre> <p>and i need to extract the time string and compare the time delta between two log records. I did that with this:</p> <pre><code>for line in log: l = line.strip().split() timelist = [int(n) for n ...
python
[7]
5,591,471
5,591,472
How to have screen revert to BLACK between pages?
<p>0</p> <p>Hi - I tried out the Background Image Scaling script and with Cybr's update it works like magic. It SCALES the image perfectly. No distortion.</p> <p>BUT, my image isn't "computer friendly". I.e.: Not 1024 X 768 or even close to that. (Heck, my monitor has a wide screen, so it isn't 1024 X 768 either! Is...
javascript
[3]
4,203,998
4,203,999
Multiple WinWord in Task Manager
<p>my c# application creates winword in task manager and close properly from taskmanager. but in case my application crashed then the winword remains opened in task manager and cannot able to process those word document.</p> <p>so in that case i want to kill those winword alone which is created by my application and n...
c#
[0]
1,419,971
1,419,972
Function returning pointer to itself?
<p>Is it possible in C++ to write a function that returns a pointer to itself?</p> <p>If no, suggest some other solution to make the following syntax work:</p> <pre><code>some_type f () { static int cnt = 1; std::cout &lt;&lt; cnt++ &lt;&lt; std::endl; } int main () { f()()()...(); // n calls } </code></p...
c++
[6]
5,124,630
5,124,631
I want to display table instead of displaying hi if i click menu 1
<p>in this if i click menu1 hi will display.instead of that i want a to diaplay a table with 5 rows and 6 colunns.any one help me</p> <h2>JavaScript</h2> <pre><code>function displayDate1() { document.getElementById("demo1").innerHTML=" hi"; document.getElementById("demo2").innerHTML=""; } function displayDate2() ...
javascript
[3]
1,195,231
1,195,232
Open a php link in a javascript popup window
<p>I have a PHP script with an link like this <code>&lt;a href='iteminfo.php?ID={$i['itmid']}]}</code></p> <p>I want to open this link in a pop-up windows but i can't put that variable from link in javascript. My problem is that <code>$i['itmid']</code> comes from databse and for every link the id is diffrent and js g...
javascript
[3]
4,612,279
4,612,280
This jquery function doesnt work in mobile site can you help me please
<pre><code> $("select[name=merchant2]").change(function(){ $("input#mname2").val($(this).children(':selected').html())}); // the collection of initial options $("select[name=merchantspoints]").change(function(){ $x=parseInt($(this).children(':selected').attr("name")); $("input#mname").val($(...
jquery
[5]
2,465,914
2,465,915
List all networks in android?
<p>I am gonna to implement a application, to list all the networks and manually select one of them( similar to the stock one ), can some one what kind of api can I use or what documentation should I refer to , or any reference sites ?</p> <p>Thanks in advance !</p>
android
[4]
3,743,438
3,743,439
Android animation doesn´t start
<p>I know it's to be something very simple, but i don't see the problem.</p> <p>I've a LinearLayout:</p> <pre><code>LinearLayout menuSlide = (LinearLayout) findViewById(R.id.menuSlide); menuSlide.startAnimation(new ExpandAnimation(menuSlide, 0, (int) (screenWidth*0.7), 20)); </code></pre> <p>And the ExpandAnimation ...
android
[4]
59,937
59,938
Initialize a value in comboBox in C#
<p>I realize that my comboBox is always empty when program start. I have to click the arrow beside to choose a value. How do we do it so that the comboBox will show a value when the program start?</p>
c#
[0]
5,932,232
5,932,233
What is the point of reassigning argument variables?
<p>I realise that it is useful (for performance reasons) to do something like...</p> <pre><code>function Abc(a, b, c) { var window = window; </code></pre> <p>So when the code accesses <code>window</code>, it doesn't need to go up the scope chain to finally find <code>window</code>. The same can be done for <code>...
javascript
[3]
4,874,717
4,874,718
Get specific content from web page with preg_match
<p>I want to get content (with all css, links working and so on) from specific web page part, which are in <code>&lt;div id="some-content"&gt;&lt;/div&gt;</code></p> <pre><code>preg_match("/&lt;div id=\'some-content\'&gt;(.*)&lt;\/div&gt;/m", file_get_contents('www.xxx.com'), $output); print_r ($output); </code></pre>...
php
[2]
2,806,999
2,807,000
What does that code line means in Jquery
<p>I was studying one code and I saw this:</p> <pre><code>var $notes = $('&lt;ol id="notes"&gt;&lt;/ol&gt;'); </code></pre> <p>I thought it was the same thing of</p> <pre><code> var $notes = $('ol#notes'); </code></pre> <p>But I tested it and its not the same thing.....</p> <p>Can someone enlight me ?</p>
jquery
[5]
337,920
337,921
Returning values from Callback
<p>I don't have any previous javascript experience.</p> <p>I'm trying to implement the following function which I wish to use to return the values lat and lng:</p> <pre><code>function get_address() { var geocoder = new google.maps.Geocoder() geocoder.geocode({ address: "SE-17270 Sverige"}, function(locR...
javascript
[3]
5,749,483
5,749,484
What's the best technology for connecting from linux to MS SQL Server using python? ODBC?
<p>By best, I mean most-common, easiest to setup, free. Performance doesn't matter.</p>
python
[7]
3,334,500
3,334,501
deleting specific SQL column data through PHP
<p>Hi I have a SQL table as below;</p> <pre><code>-------------------------- col1 | col2 | col3 | col4| -------------------------- 10 | 20 | 30 | 40 | 15 | 22 | 12 | 21 | 11 | 40 | 50 | 60 | </code></pre> <p>and I'm trying to delete column specific data from the table. For instance I want to dele...
php
[2]
302,121
302,122
JavaScript string newline character?
<p>Is <code>\n</code> the universal newline character sequence in Javascript for all platforms? If not, how do I determine the character for the current environment?</p> <p>I'm not asking about the HTML newline element (<code>&lt;BR/&gt;</code>). I'm asking about the newline character sequence used within JavaScript s...
javascript
[3]
896,617
896,618
Detecting just started applications
<p>I need to write a java code that watches the applications. Whenever the user starts an applications (game, IE, Office...) it should write down the name of the application and the date it just started.<br> Is this doable in Java? Can anyone provide me with some code hints?<br> Note that am using a windows machine.</p...
java
[1]
2,880,076
2,880,077
Adding zero to an int variable results in weird number
<p>I'm having a problem with what should be simple additon in Javascript.</p> <p>Take a look at this firebug output:</p> <p><img src="http://i.imgur.com/YacT4.png" alt="Firebug output screenie"></p> <p>What I'm making is a 2D tile map in canvas, and for objects in the map that are greater than one tile in size, they...
javascript
[3]
423,164
423,165
jquery select custom attr
<p>I have a textfield where I'm adding a custom attr called maxchars and a value of 255. I can't seem to read the value, could someone tell me what I might be doing wrong. </p> <p>jquery</p> <pre><code>var textarea = jQuery(this); var maxlength = parseInt(textarea.attr("maxchars")); </code></pre> <p>html</p> <pre><...
jquery
[5]
1,473,313
1,473,314
Convert string to an attribute for a nested object in javascript
<p>I am trying to access a string <code>"key1.key2"</code> as properties of an object. For example :</p> <pre><code>var obj = { key1 : {key2 : "value1", key3 : "value2"}}; var attr_string = "key1.key2"; </code></pre> <p>The variable <code>attr_string</code> is a string of attributes in a nested object joined by <code...
javascript
[3]
1,753,338
1,753,339
How to use methods from two classes in eachother in Java?
<p>I've been looking around and I only found one answer which wasn't clear enough, to me at least.</p> <p>I am building a very basic chat application with a GUI and I have separated the GUI from the connection stuff. Now I need to call one method from GUI in server class and vice versa. But I don't quite understand ho...
java
[1]
2,074,027
2,074,028
Static variables initialization order
<p>I have put breakpoint into "get"</p> <pre><code>static readonly LawClass s_Law = new LawClass(); public static LawClass Law { get { return s_Law; } } </code></pre> <p>and found out s_law is null. </p> <p>How is it possible? I thought static variables are initialized before first class access and in line-by-line o...
c#
[0]
4,779,414
4,779,415
I'm an experienced C++ developer - how can I enter the gaming industry?
<p>I've been working in C++ in embedded environments for a number of years, developing navigation applications. There is a gaming company in my hometown that I like the look of, but I don't have game development experience. You could consider a navigation app as a type of game, depending on who you are running from.<...
c++
[6]
4,707,576
4,707,577
Concatenate code object in Python
<p>I'd like to gather multiple functions (the list is unknown) in a single one dynamicly, I fugured out how to create dynamicly a python function using types.FunctionType. However the first argument is a code object and cannot be a list of code object. How can I create a single function from multiple ones ?</p> <p>th...
python
[7]
4,921,593
4,921,594
How to modify the Layout params of a child in a ListView in Android?
<p>Anyone help me to modify the layout params of a child in a ListView in Android.Please give some code snippets if you can.</p>
android
[4]
191,866
191,867
JQuery Conditionally submit forms
<p>I have a table with multiple rows. Each row is a form. I want to use JQuery to submit all the forms that have the check box checked. The form is posting to an IFrame so there is not much need for AJAX.</p> <p>So far I have:</p> <pre><code> $("form").submit(); </code></pre> <p>which submits the form. but all fo...
jquery
[5]
142,629
142,630
Why would anyone want to put an interface in an interface in Java?
<p>I am reading about what an interface contains and I understand in addition to the usual they can also contain inner classes or other interface. </p> <p>Can anyone explain why or for what purpose anyone would want to put an interface inside an interface. Also why would anyone put an inner class inside. I have looked...
java
[1]
1,356,509
1,356,510
Python Card Display
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4170238/poker-hand-string-display">Poker hand string display</a> </p> </blockquote> <p>hi all im having a bit of a hard time figuring this question out . so if i can get any help i would greatly appreciate it. t...
python
[7]
2,524
2,525
Trying to use file encryption but am getting an error with File.Encrypt(FileName) returning an exception
<p>I tried codeproject help as well as MSDN but no success. Here is a copy of my test code returning an exception:</p> <pre><code> private void button2_Click(object sender, EventArgs e) { File.Decrypt("Text.pvf"); string[] DataFile = File.ReadAllLines("Text.pvf"); if (DataFile[5] == "6")...
c#
[0]
3,793,867
3,793,868
How to Set Off the GPS on button click in Android
<p>I have a problem that I want to OFF the GPS on button click in Android, but I unable to do that. Please suggest me the solution.</p> <p>Thanks in advance.</p>
android
[4]
5,676,280
5,676,281
my program doesn't accept time print out sentence
<p>Here's the code that what I have. I also have in my class file: <code>import java.util.*;</code> and <code>long time;</code> and two formulas to calculate time before and after my calculations, and there is no error.</p> <pre><code>import java.io.*; public class RhoMain { public static void main(String arg[])thr...
java
[1]
2,405,289
2,405,290
How can I get Phone wallpaper in Android?
<p>I am working on an Android application. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.</p>
android
[4]
4,099,445
4,099,446
String split & join
<p>I have a collection of strings. I need to be able to join the items in this collection into one string and afterwards split that string backwards and get original string collection. Definitely I need to introduce a delimiter character for join/split operation. Given the fact that original strings can contain any ch...
java
[1]
190,620
190,621
PHP preg match with line ends in Linux and Windows
<p>This code works on Linux but fails to match on Windows:</p> <pre><code>if ( preg_match ( "~&lt;meta name='date' content='(.*)'&gt;\n&lt;meta name='time' content='(.*)'&gt;\n&lt;meta name='venue' content='(.*)'&gt;\n~", file_get_contents($filename), $matches) ) ... </code></pre> <p>I guess the line end coding is w...
php
[2]
228,366
228,367
Using Nullable Types: boolean
<p>I have a checkbox in a column of a DataGridView. Right now I got an exception because there is no checkbox checked. I am not sure how to handle it?</p> <pre><code> private void uncheckGrid(ref DataGridView dgv, int index) { try { foreach (DataGridViewRow row in dgv.Rows) ...
c#
[0]
5,636,975
5,636,976
split a line of text into two lines using a <br> in c#
<p>I have the following code (inherited!) that will split a line of text into 2 lines with a html line break <code>&lt;br/&gt;</code>.</p> <pre><code>public static string BreakLineIntoTwo(this HtmlHelper helper, string input) { if (string.IsNullOrEmpty(input)) return string.Empty; if (input.Length &lt; 12) ret...
c#
[0]
5,527,971
5,527,972
How do set request parameter value while calling java method?
<p>Hi All : I need to call a method of java class from jsp page.. While calling that in jsp page, need to set some request parameters also. How do i do that in jsp page?</p> <p>Ex :</p> <p>Java class :</p> <pre><code> public void execute() { string msg = request.getParameter("text"); } </code></pre> <p>JSP fi...
java
[1]
4,342,249
4,342,250
NSTimer and performing a selector on the main thread
<p>Is it possible to run a selector which is invoked by the nstimer on the main thread?</p> <p>The NSTimer is spawned in it's own thread.</p> <p>My structure is that a thread invokes a method with a nstimer, the nstimer invokes a method that do some updates, but I need these updates to happen on the main thread. What...
iphone
[8]
2,181,989
2,181,990
Redirect one page to another using # and page id in one file in jquery moblie phonegap in iphone not working
<p>I am new in jquery mobile with phonegap.I had done all css and js files links in index.html , But when I working in customer_registration.html and call page using #pageid , its not working, and js file also included, but its also not working. Please help..</p>
iphone
[8]
546,143
546,144
positions in a list. python
<p>Lets say I have this list:</p> <pre><code> lst = [[0], [0, 0], [0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0, 0]...] </code></pre> <p>how can I add a certain number to each cell according to its position in the lists for exapmle: I want to add a formula to each cell by multipying 3 with the position on the list*position...
python
[7]
5,028,087
5,028,088
not able to open links in a new tab
<p>I need to verify a lot of links on a page. Rather than opening each link myself. This is what I did. </p> <p>jquerified the page using firequery plugin. Then I typed following code in firebug.</p> <pre><code>a = $('a'); $.each(a, function(i,val){ $val = $(val); $val.attr({target: '_blank'}); $val.trigger('cl...
jquery
[5]
1,419,387
1,419,388
Is there a way to obtain the path to ProgramData in Windows using javascript?
<p>I need to obtain the path to the APPDATA for the current user in Windows(XP, Vista, 7, 8), using javascript. Is there a way to do this?</p>
javascript
[3]
3,986,812
3,986,813
storing ajax result into PHP session
<p>I see examples how to fetch data from php to ajax (and display it via javascript.) As in log-in example, we can check whether there is a valid email and password entered, we can simply display "You are now logged in." Till here I understand and work out. But, now as the user logs in, I need to set the php session. ...
php
[2]
2,450,917
2,450,918
how to run unix commands from java
<p>I want to execute some Unix commands from the java code.</p> <p>I want to run logcat command from java code.</p> <p>I am using the below code to do this:</p> <pre><code> Process p = Runtime.getRuntime().exec("logcat -v time -f /mnt/sdcard/abc.txt"); </code></pre> <p>The above code is working perfectly.</p> <p>...
android
[4]
4,086,637
4,086,638
in_array confused about strict option
<p>When I use strict option (which I was expected to be the best option since I'm comparing numbers to numbers) if never comes out true. But without strict it works fine! I'm just checking if array already contains post_id. If doesn't not add, if yes don't add duplicate.</p> <pre><code>if (!in_array($post-&gt;ID, $coo...
php
[2]
661,450
661,451
php REQUEST_URI
<p>I have the following php script to read the request in URL :</p> <p><code> $id = '/' != ($_SERVER['REQUEST_URI']) ? str_replace('/?id=' ,"", $_SERVER['REQUEST_URI']) : 0; </code></p> <p>It was used when the URL is <a href="http://www.testing.com/?id=123" rel="nofollow">http://www.testing.com/?id=123</a></p> <p>Bu...
php
[2]
4,378,435
4,378,436
Xampp apache crashed php rar
<p>I have rar extensions installed on php using xampp go-pear</p> <p>It shown in php info that rar is enabled.</p> <p>My code is following</p> <pre><code>&lt;?php $rar_file = rar_open('htdocs.rar') or die("Can't open Rar archive"); $entries = rar_list($rar_file); foreach ($entries as $entry) { echo 'Filename: ...
php
[2]
4,099,108
4,099,109
jQuery jPicker users: hexadecimal returns 8 digit value?
<p>I've just about got the jPicker script working flawlessly in my app. However, the value it returns contains 8 digits. Example: 212ebcff</p> <p>Is there a preset variable that forces jPicker to return a 6 digit hex value?</p>
jquery
[5]
5,114,373
5,114,374
SAX parser getting error while parsing special character " : "
<pre><code> &lt;media:group&gt; &lt;media:content type="video/mp4" url="http://cdn2.junctiontv.net/dmv/roku/ChiroDiniTumiJeAmar2997fps800kbpsForIPTV.mp4" bitrate="800" duration="8100"/&gt; &lt;/media:group&gt; &lt;media:thumbnail ...
android
[4]
2,061,728
2,061,729
is this possible to create subdirectory in FTP using ftp.MakeDirectory?
<p>I have to create this query to get some answer before i change my code.Pardon me if this question is doesn't make sense to you guys.</p> <p><strong>Scenario 1:</strong></p> <pre><code>string path :ftp://1.1.1.1/mpg/test"; FtpWebRequest requestDir = (FtpWebRequest)FtpWebRequest.Create(new Uri(path)); requestDir.Cre...
c#
[0]
76,048
76,049
Executing JavaScript when a link is clicked
<p>Which is preferable, assuming we don't care about people who don't have JavaScript enabled?</p> <pre><code>&lt;a href="#" onclick="executeSomething(); return false"&gt;&lt;/a&gt; </code></pre> <p>Or</p> <pre><code>&lt;a href="javascript:executeSomething()"&gt;&lt;/a&gt; </code></pre> <p>Is there any difference? ...
javascript
[3]
4,792,713
4,792,714
How to use sqlserver to store session state?
<pre><code>&lt;sessionState mode="SQLServer" cookieless="true" regenerateExpiredSessionId="true" timeout="30" sqlConnectionString="Data Source=MICHAEL;Integrated Security=SSPI;" stateNetworkTimeout="30"/&gt; </code></pre> <p>I wonder what I am doing wrong.</p>
asp.net
[9]
3,451,740
3,451,741
How to run jar files
<p>I have a Win XP machine which has java installed on it. The problem that I cannot open jar files. It seems that association is broken. How can I launch jar files by using console. Or maybe there is a way to set a proper association.</p>
java
[1]
4,723,133
4,723,134
How to plot a marker with latlog in ocean area
<p>I would like to know is it possible for google map able to set marker in ocean area if latlog given? If yes, plz give code samples for me. Thanks</p>
javascript
[3]
969,202
969,203
jquery disable parts of page
<p>I am displaying a modeless jquery dialog on top of a page. When the dialog is displayed I wish to only allow the user to interact with a certain portion of the page (mainly because I do not want them naving away or clicking other controls that cause postbacks). I thought it would work well to use the same mechanism ...
jquery
[5]
5,534,049
5,534,050
Can I chain this jQuery?
<p>Is it possible to shorten these jQuery snippets by chaining them together? For the second chain, I'd like to get rid of the <code>w</code> class if possible.</p> <pre><code>$('#content').prepend("&lt;h1 /&gt;"); $('#content h1').append( $('#content&gt;p:first strong').html() ); $('#content&gt;p:first strong').pare...
jquery
[5]
4,930,275
4,930,276
how to combined between "easy silder" & "prety photo" jquery plugins?
<p>i have a problem put 2 jquery scripts in one page. only one is working until i remove the second script the other working. here is the code of easy slider</p> <pre><code>&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt; </code></pre> $(document).ready(function(){ $("#slider").easyS...
jquery
[5]
3,278,152
3,278,153
checkdnsrr error with php 2.9.2
<p>i am trying to use checkdnsrr() function with php 2.9.2, but it shows an error as "Call to undefined function checkdnsrr()".. is it because this function is not compatible with the version i am using? Can i have an alias of this function so that it works with my version?</p>
php
[2]
1,190,577
1,190,578
updating object state from another class
<p>Hello all i'm a noob here and to oophp.</p> <p>I'm looking to update an exiting objects state from another class.</p> <p>So in the main file i have...</p> <pre><code>$obj1 = new class1(); $obj2 = new class2(); </code></pre> <p>and in class1 i have i setter method that changes the objects state.</p> <p>soooo wha...
php
[2]
4,797,041
4,797,042
copy to vector giving segfault
<p>I am trying to copy the vector data from <code>sample</code> to <code>Y</code> as below</p> <pre><code>std::map&lt;std::string, std::vector&lt;double &gt; &gt;sample; std::map&lt;std::string, std::vector&lt;double &gt; &gt;::iterator it1=sample.begin(), end1=sample.end(); std::vector&lt;double&gt; Y; </code></pre>...
c++
[6]
4,488,150
4,488,151
Prevent deadlock shared boost mutex
<p>I want to use a shared mutex so threads only get locked when a vector/map/whatever is written to rather than read from. But I think func2() will never get the uniqueue lock because func1() will never get to unlock. Is there any way to not count a same-thread lock on shared_mutex when trying to get the uniqueue lock?...
c++
[6]
5,020,221
5,020,222
How do I make PHP display files in the opposite order that readdir does?
<p>I'm using this to return images in the order they were added to the directory, however I want them to be ordered from newest to older. How can I do it? Thanks</p> <pre><code>&lt;? $handle = @opendir("images"); if(!empty($handle)) { while(false !== ($file = readdir($handle))) { if(is_file("images/" . $file)) ...
php
[2]
4,034,274
4,034,275
C# check if a process exists then close it
<p>I'm trying to Close a process within C# but how do I check if is open first? Users asked for this feature and some of them will be still using the close button of the other process.</p> <p>So, right now works fine:</p> <pre><code>Process.GetProcessesByName("ProcessName")[0].CloseMainWindow(); </code></pre> <p>No...
c#
[0]
2,209,867
2,209,868
If element is over another element?
<p>With jQuery how do i find out if div <code>one</code> is over div <code>two</code>? Not, which z-index is higher but what div is visually over the other div.</p> <pre><code>&lt;style type='text/css'&gt; #one { position:absolute; top:0; left:0; width:100px; height:100px; background-color:red; z-index:2; ...
jquery
[5]
4,151,728
4,151,729
Function to count how many numbers are there with the digits and division value specified
<p>I started making a function that will be able do the following: <em>Count how many 6 digit numbers you can make with the digits 0,1,2,3,4 and 5, that can be divided by 6?</em></p> <p>How I currently try to start, is I make an array of all the possible numbers, then take out every number that has any of the <code>nu...
javascript
[3]
1,965,499
1,965,500
What is the right way to write 'Get' method?
<p>With one of mine coworkers often argue about "the right way" of writing 'Get' methods. My opinion is <code>object GetSomeObject()</code>. My colleague thinks it is better to be <code>void GetSomeObject(object obj)</code>. I know the result is one and the same in both cases. I want to hear and other opinions. Ohhh i ...
c#
[0]
5,811,635
5,811,636
how to find the expired date in php
<p>hi i need to find whether the given date is passed or future.</p> <pre><code>$elapsedTime = new DateTime('2011-03-15 00:20:00'); $elapsedInt = $elapsedTime-&gt;diff( new DateTime() ); echo ( $elapsedInt-&gt;invert ? 'Future' : 'Past' ) . "&lt;br/&gt;"; </code></pre> <p>i tried this code but i am getting error beca...
php
[2]