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,750,837
1,750,838
What is a safe way to check that a listbox is empty in JQuery?
<p>What is a safe way to check that a listbox is empty in JQuery ? Alternative question, how to check if there is no item actively selected ?</p> <p>I have tried :</p> <pre><code>if(... .val() != "null") </code></pre> <p>also </p> <pre><code>if(... .val() != null) </code></pre> <p>as I spotted <code>null</code> ...
jquery
[5]
3,366,390
3,366,391
Cookies being created but unable to echo them
<p>At the end of my registration script I set a cookie of 'loggedin' like so</p> <blockquote> <p>setcookie("loggedin", $username, time()+60*60*24*30 );</p> </blockquote> <p>And then just redirect back to the home page.</p> <p>I'm trying to echo out the contents of that cookie. I can see it has been created when I...
php
[2]
3,627,042
3,627,043
Do I need an Alarm or a Service to perform a repetative task?
<p>I am developing a gps tracking for Android i want my application to start when the phone boots up and send gps coordonates from 10 in 10 minutes. </p> <p>Do i need to use a service or an AlarmManager broadcast receiver can do the job ?</p>
android
[4]
3,649,210
3,649,211
displays float into Text View
<p>I want to display a float into Text View</p>
android
[4]
1,501,828
1,501,829
multiple matches in regex
<p>Hi I am trying to get the following javascript code to work. When I am typing a line containing all three names fever, nightsweats and nocturia - I want an alert window to come on reminding me that those three in combination represent a dangerous sign. what am I doing wrong? thanks so much in advance!!! </p> <pre...
javascript
[3]
3,823,392
3,823,393
easier way of doing both portrait and landscape in one xml file? in android
<p>I have nearly finished my app but still have to make sure landscape orientations is ok, is there any xml code that I can put in layout that will cover both portrait and landscape?</p> <p>Many thx</p>
android
[4]
5,675,195
5,675,196
What is an element vs. a selector in jQuery?
<p>I'm trying to understand the </p> <blockquote> <p>jQuery( element )</p> </blockquote> <p>part of the <a href="http://api.jquery.com/jQuery/#jQuery1" rel="nofollow">jQuery documentation</a>.</p> <p>Q: Is this their example of what an element is:</p> <pre><code>$(myForm.elements).hide(); </code></pre> <p>It's t...
jquery
[5]
3,860,157
3,860,158
I don't want $_SESSION to stop after a long period of time
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/514155/extending-session-timeout-in-php">Extending Session Timeout in PHP</a> </p> </blockquote> <p>I have php sessions where the problem I could have is that if for a long time I do not use the application, if ...
php
[2]
4,411,149
4,411,150
Java application that uses a string method and length
<p>How do I design and implement a Java application that reads a string from the user and prints it one character per line from right to left?</p>
java
[1]
1,836,327
1,836,328
Convert a negative number to a positive one in JavaScript
<p>Is there a math function in JavaScript that converts numbers to positive value?</p>
javascript
[3]
1,902,367
1,902,368
keep adding value in php
<p>Initially,the $number = 0. After 1st time clicking Add button, the value becomes 10. When 2nd time clicking, the value is changed to 20. then 3rd time is 30, 4th time 40.</p> <p>Below is my code, is there anyone know how to fix it? Thanks!</p> <pre><code>&lt;?php $number = 0; if(isset($_POST['add'])){ ...
php
[2]
686,231
686,232
Foreach loop in C++ equivalent of C#
<p>Can any body convert this code to C++ </p> <pre><code>string[] strarr = {"ram","mohan","sita"}; foreach(string str in strarr) { listbox.items.add(str); } </code></pre> <p>Thanks in advance.</p>
c++
[6]
852,742
852,743
inline editing with jquery
<p>Are there any guidelines on doing 'inline' editing with jqeury?</p> <p>I know I am not using the correct term here, but basically you click on a some text and dynamically the area changes to an editable input box with a submit button.</p> <p>Is there any built in capabilities with jquery?</p>
jquery
[5]
4,126,604
4,126,605
Audio controlling
<p>I want to develop a small audio controlling software. Only basic functionality like volume controlling, or / and bass controlling. </p>
c++
[6]
5,673,541
5,673,542
How do you make non-www. links contain www. in php?
<p>Im storing imdb.com links for each movie thats listed in the DB, and check for duplicates before a new movie is inserted. The problem is, some links are <a href="http://imdb.com/whatever" rel="nofollow">http://imdb.com/whatever</a> while others are http://<strong>www</strong>.imdb.com/whatever</p> <p>What would be ...
php
[2]
3,599,790
3,599,791
How to abort window.print();
<p>I have a page that uses <code>window.print();</code> which is already printed in the source.</p> <p>But I want for a certain situation via a link trigger, maybe, to nullify/abort this command. Basically telling the page not to launch print dialog when something is clicked to launch the page. Maybe with <code>window...
jquery
[5]
4,083,519
4,083,520
How can i restore the messages in android
<p>I am able to getting all messages with its data, type ,address,status etc. but i am not able restore these messages.I tried the following way.it insert correctly but it show current date not date of message recieved or send.Please help me how can i restore messages.</p> <pre><code> ContentValues values = new Con...
android
[4]
4,565,665
4,565,666
Parsing issues while parsing xml response android
<p>Xml response is like , but in one tag , the text is this:</p> <pre><code>&lt;Description&gt; &amp;lt;center&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;span&amp;gt;Warehouse / Building Maintenance&amp;lt;/span&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; &amp;...
android
[4]
1,384,785
1,384,786
addContentView align at the screen's bottom android?
<p>i would like to ask something about the addContentView command. I have created a custom view apparted from a LinearLayout(fill parent, wrap content) in vertical mode and some buttons.. My question is if it's possible to place my custom view at the bottom of the screen by using the addContentView command.</p> <p>I n...
android
[4]
883,026
883,027
php eval function and performance
<p>Im creating a web app where I want all of the responses to the user stored in a language file for easy editing. So Im using eval() to manage dynamic messages lik so:</p> <pre><code>$msg = 'Hello $user, your favorite color is $color'; $colors = array("red","green","blue","yellow"); $users = array("bob","craig","...
php
[2]
1,548,933
1,548,934
Change text property of all items in form
<p>I have many buttons and labels on my c# form. I have a button that changes all butons' and labels' text properties (change language button). Do i have to write all items in click event of button or is there a method that scans all form control items and change their text properties.</p> <p>There are many other cont...
c#
[0]
2,254,264
2,254,265
Unexpected mathematical output
<p>I am trying to count my eggs in an exercise in Learning Python the Hard Way. The formula for counting the eggs is:</p> <pre><code>print (3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6) </code></pre> <p>and the suggested answer is <code>7</code>. I am getting <code>6.75</code> and have no idea why, I think I am putting it in c...
python
[7]
2,422,952
2,422,953
Does jQuery ship with SharePoint?
<p>Currently, we want to upgrade jQuery in our products, so I want to know if SharePoint use jquery in its js? It will help us to make decision about which jquery version we are going to use. I try to find jquery reference in SharePoint 2010, but I didn't find it. Does it mean there is no jQuery in SharePoint? </p> <...
jquery
[5]
2,004,701
2,004,702
How to implement session handling in Java to be servlet container independent?
<p>AFAIK: <a href="http://www.freeopenbook.com/mysqlcookbook/mysqlckbk-CHP-19-SECT-4.html" rel="nofollow">Session handling is done by the servlet Container</a> (e.g. Tomcat, Glassfish...), i would prefer a solution which is servlet container independent, like php does it, implement some handler or filter and let the ap...
java
[1]
5,931,520
5,931,521
How do I tell if an internet url points to a folder or a file using HttpWebRequest in C#?
<p>It should be well known that a internet URL can point to either a folder or a file.<br/> A folder usually responds with a default page -- e.g. index.html. A file responds with itself.</p> <p>In either case, you don't know which one you are getting. Imagine for instance ("http://www.example.com/fileorfolder.html"). ...
c#
[0]
3,770,851
3,770,852
how to use Gridview with a variable number of Imagebuttons?
<p>I need some help for my app. I need a view containing an undefined number of ImageButtons based on a variable. That is, supposing the variable is set to 3, then 3 Imagebutton should be shown on the screen. Is there any way I can build this? I'm trying it using GridView, but it seems that you must provide a fixed num...
android
[4]
5,430,050
5,430,051
In C# is there a better way to write this boolean evaluation
<p>this seems really awkward ...does anybody have any suggestions for a cleaner approach?</p> <pre><code> bool case1 = (dte.StartDateTime &gt;= Date) &amp;&amp; (dte.StartDateTime &lt; Date.AddHours(_interval)); bool case2 = (dte.EndDateTime &gt; Date) &amp;&amp; (dte.EndDateTime &lt; Date.AddHours(_interval)); b...
c#
[0]
2,574,344
2,574,345
To grab the data in a Table's TD and display it in a Input Text box
<p>I got a Table with some data inside it like this:<br/></p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt; hello world! I am new to JQuery &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input type="text" id="displayingText" value=""&gt; </code></pre> <p>I was trying to grab the data in the TD tag of the table and disp...
jquery
[5]
3,216,681
3,216,682
How to check which UIViewController is active
<p>I need to check which UIViewController is active so I have implemented some cases depending upon the result.</p> <pre><code>[self.navigationController.visibleViewController className] </code></pre> <p>This always returns null. </p> <p>I am checking with this statement: </p> <pre><code>if([iDetailController isKin...
iphone
[8]
1,404,697
1,404,698
Problem in detecting Internet Connection in Android
<p>I have created a Android application using Google Maps. Now I want to check whether an internet connection is available or not. I search in Google and finally I got solution through Stackoverflow:</p> <pre><code>boolean HaveConnectedWifi = false; boolean HaveConnectedMobile = false; ConnectivityManager cm = (Co...
android
[4]
3,586,252
3,586,253
jquery animation
<p>i dont know what is wrong with this code.. it will just don't work even if it has the same syntax with the other one..</p> <pre><code>$(document).ready(function(){ $("#inner").animate({height:'200',top:'-100'},1000); $("#inner").animate({width:'200',margin-left:'-100'},1000); }); </code></pre> <p>you can see th...
jquery
[5]
3,650,287
3,650,288
Python: Random combination from two files
<p>New to python, bear with me. I have two text files, each has a word on a line (some funny words). I want to create a third file which has the random combination of those. with a space between them.</p> <p>Example:</p> <pre><code>File1: Smile Sad Noob Happy ... File2: Face Apple Orange ... File3: Smile Orange Sad...
python
[7]
4,295,299
4,295,300
how to convert the unopened webpage to pdf using java?
<p>I need to convert unopened web page to PDF. But i have a URL for that particular page. so how can i get that URL page as PDF file with out opened that page in java?</p> <p>can any one know meet such scenario? </p>
java
[1]
1,217,442
1,217,443
javascript function structure
<p>this is an exmaple.</p> <pre><code>var x=5; var y=x.multiplied(6); // return y=30; </code></pre> <p>how to create a function like <code>.multiplied()</code> function on js?</p> <p>the function structure is like this</p> <pre><code>var1.doSomething(var2); </code></pre>
javascript
[3]
4,812,961
4,812,962
How do you use localStorage in JavaScript?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2800238/javascript-html5-localstorage">Javascript + HTML5 localstorage</a> </p> </blockquote> <p>What is it for and how do you use it? Thanks.</p>
javascript
[3]
4,605,874
4,605,875
Passing a PHP Value from a link
<p>I am new to PHP and learning. I'm trying to pass a value through a url link but it doesn't seem to work.</p> <p>The link value I am passing is <a href="http://www.mysite.com/index.php?id=f" rel="nofollow">http://www.mysite.com/index.php?id=f</a></p> <p>I want to run a js script if ID not F seen below but right now...
php
[2]
1,311,009
1,311,010
default value of enumeration element in c#?
<pre><code> public enum DAYS { Monday=1, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } </code></pre> <p>here suppose i want to override default value of enum element as like monday. here as i know that after giving 1 to monday 2 will be default value of tuesday and next one will have 3 or so on, </p> <p...
c#
[0]
478,349
478,350
contruct dynamically a viewholder
<p>I am managing my view with a viewholder and i am trying to get different textview and image view result according <strong>if condition is verify (see snipset bellow )</strong> The problem is that when I scroll and then returning to the top the result display become different from the origin . Bellow my snipset code ...
android
[4]
4,446,638
4,446,639
Copying stdin to stdout causes strange results
<p>I've got a super simple program. My intention is to copy standard input to standard output. Here's the source code:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace LALA { class LALA { static void Main() { ...
c#
[0]
4,954,674
4,954,675
What effect has a statement like 'var and do_something_with(var)' in Python?
<p>While looking for some answers in a package source code (<em>colander</em> to be specific) I stumbled upon a string that I cannot comprehend. Also my <em>PyCharm</em> frowns on it with 'statement seems to have no effect'.</p> <p>Here's the code abstract: </p> <pre><code>... for path in e.paths(): keyparts = []...
python
[7]
4,680,084
4,680,085
Setting "submit"
<p>At the top of my file I have</p> <p>PHP Code: <code>if (!ISSET ($_POST['submit']))</code> which tests if the submit has been hit, if not displays the form....</p> <p>What I'd like to be able to to is generate a link that would be processed directly by the php code that the form would normally be submitted to... (d...
php
[2]
5,483,473
5,483,474
How does a C++ object access its member functions?
<p>How does a C++ object know where it's member function definitions are present? I am quite confused as the Object itself does not contain the function pointers. <code>sizeof</code> on the Object proves this. So how is the object to function mapping done by the Runtime environment? where is a class's member function-...
c++
[6]
3,853,730
3,853,731
Transfer session variables over php header redirect
<p>so I can't seem to figure out how to transfer session variables after a PHP header refresh, the code is below: essentially my workflow is User submits form to a php processing page that does stuff with the variables, after its done I want the form to redirect to the 'offers.php' keeping the session variables intact....
php
[2]
1,990,105
1,990,106
Trying to remove duplicate jquery scripts
<p>I've added this</p> <pre><code>&lt;?php wp_enqueue_script("jquery"); ?&gt; </code></pre> <p>before</p> <pre><code>&lt;?php wp_head(); ?&gt; </code></pre> <p>so that I can just use the wordpress included jquery script, and deleted the extra jquery script I've been loading, but when I go to Inspect Element in Chro...
jquery
[5]
5,042,998
5,042,999
Change latin numbers to arabic number by javascript
<p>I have a clock with javascript i want change latin numbers this clock to arabic number by javascript, i tried as following code, but it doesn't work true. How can fix it?</p> <p><strong>DEMO:</strong> <a href="http://jsfiddle.net/NdzHg/" rel="nofollow">http://jsfiddle.net/NdzHg/</a></p> <pre><code>&lt;script type...
javascript
[3]
2,820,758
2,820,759
How to check and see an images extension using PHP?
<p>How can I check to see if the image is a PNG, GIF, TIFF and JPG and if so create the thumbnail and save it to the thumb file.</p> <p>So far I can check and save for JPEG images.</p> <p>Here is the code below.</p> <pre><code>&lt;?php //Name you want to save your file as $save = 'members/3/images/thumbs/thumb-pic....
php
[2]
3,687,916
3,687,917
Cant retrieve dhcp info on Android 2.2
<p>I have this code working on Android 4.0.3 on the Nexus One:</p> <pre><code>WifiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE); DhcpInfo info = wifi.getDhcpInfo(); String s_gateway = String.valueOf(info.gateway); String gatewayString = intToIp(Integer.parseInt(s_gateway)); ...
android
[4]
319,843
319,844
DateTime conversion from Utc to Local in .NET 4.0
<p>I have a function which among other things does a conversion from Utc to Local and vice-versa. The problem is that when I run it on a PC with Win 7 it works OK, but when I run it on a PC with Vista the conversion goes wrong.</p> <p>ex: My current time zone is +2 UTC</p> <p>MyCurrentTime is set to 27.09.2012, 19:00...
c#
[0]
1,405,752
1,405,753
iPhone CAAnimations playing serially
<p>Is it possible to define all CAAnimations at start and play them one after another serially without using delegates, like what we do in CAAnimationGroup, where in animations are played simultaneously. Instead I just want them to play serially.</p>
iphone
[8]
3,168,372
3,168,373
Pass a jQuery variable to a string
<p>I have a jQuery object called <code>window.offset</code>. </p> <p>This object has another object called <code>search</code>. </p> <p>It has two values, <code>top</code> &amp; <code>left</code>.</p> <p>Eg: </p> <pre><code>window.offset.search = {top:200, left:150} </code></pre> <p>I want to pass this 'search' ob...
jquery
[5]
1,346,621
1,346,622
if image exists show image else show different image + image path
<pre><code>&lt;?php $img = shellImage($data[$y]-&gt;kunena_avatar_rows[$z]-&gt;avatar, 'noresize'); ?&gt; &lt;?php if ($img-&gt;exist) : ?&gt; &lt;?php echo $img-&gt;draw(); ?&gt; &lt;?php else: ?&gt; &lt;img src="media/avatars/resized/size200/nophoto.jpg"&gt; &lt;?php endif; ?&gt; </code></pre> <p>Trying to fig...
php
[2]
1,930,531
1,930,532
Python : split string by ' and -
<p>How do split string by apostrophe <code>'</code> and <code>-</code> ?</p> <p>For example, given <code>string = "pete - he's a boy"</code></p>
python
[7]
2,871,057
2,871,058
jQuery.map(....).concat is not a function
<p>Why would the following jquery code sometimes throw the error "concat is not a function":</p> <pre><code>var myArray = $('div.foo') .filter(function() { return $(this).is('.something'); }) .map(function() { return [['a', 'b', $(this).val()]]; }); return myArray.concat(anotherArray); </code></p...
javascript
[3]
1,767,977
1,767,978
draw editview / textview on fingertouch in android
<p>I am newbie in android,in my app i required draw textview/editview on finger touch where user is able to type in that.I searched a lot but find nothing relevant.I found links to draw editview/text but not on fingertouch.so please suggest me, Its urgent help me</p>
android
[4]
4,163,706
4,163,707
How to remove HTTPS to HTTP Security Alert message in .Net
<p>How to disable or block that Security Alert so that when any user access my Secured Page he will not get Security Alert Dialog. Any help will be appreciated and thank you in advance. </p> <p>Thanks Narendra Singh</p>
asp.net
[9]
4,728,277
4,728,278
How to display development credits at the beginning of application?
<p>When the application is opened i would like to display credits by to the user like maybe a screen with the company's logo and some other stuff. How do i go about doing this?</p>
android
[4]
1,129,910
1,129,911
Javascript Opera + Safari issue
<p>For some reason this page won't work in Opera + Safari <a href="http://dev.reggi.com/clients/mike2/" rel="nofollow">http://dev.reggi.com/clients/mike2/</a></p> <p>this is the main code I wrote that I believe is failing:</p> <pre><code>/*this script finds the multiples of the box_width and makes that the with of th...
javascript
[3]
4,857,162
4,857,163
how to read a file from a Jar file located on remote server
<p>I want to read and copy file from jar file(for eg. application.xml from EAR )located on remote server to local machine. when i search on net for this, i found java.util.jar.JarFile API. This API read jar only from local machine as it takes only string as input and not URL for jar location in constructor. I know ...
java
[1]
1,100,328
1,100,329
Display byte[] to ImageView in Android
<p>Is it possible to do this? I'm reading an XML file that has the Base64 string of an image. I'm planning to use Base64.decode to have the byte array of the image string. I'm stuck though on how to use it in an ImageView. Do i have to create a 'drawable' class first then set it to ImageView's src property?</p> <p>Tha...
android
[4]
275,006
275,007
How to set maximum characters per line for text view in android
<p>Hiii all, this may be a possible duplicate but I couldn't find solution for my problem.I need to limit the number of characters per line when displaying on the textview and display the remaining characters in the next line.I cannot set ems value and I also tried setting maxLength attribute in xml but it is not displ...
android
[4]
2,809,001
2,809,002
execute a code after the page is loaded completely or delay the execution of the code
<pre><code>$(document).ready(function() { if($('#upcomeEvent').length &gt; 0) $('#upcomeEvent').insertAfter('#eventBanner'); }); </code></pre> <blockquote> <p>execute a code after the page is loaded completely or delay the execution of the code</p> <p>I need to execute <code>$('#upcomeEvent').insert...
jquery
[5]
1,917,112
1,917,113
Can i change the Cursor size in android edit text field?
<p>I want to change the width and color of the cursor that blinks in an Android EditText field. Is that possible?</p>
android
[4]
4,084,468
4,084,469
C# Application Path how to get it to work for websites
<p>Here is my question, and I have searched this stackoverflow but cannot find the correct solution. </p> <p>I have an website, that is stored in (locally on my machine)</p> <p>C:\websites\Website1 </p> <p>in the same folder I have </p> <p>C:\websites\Website1\xmldoc.xml</p> <p>I want to be able for the program to...
c#
[0]
2,681,740
2,681,741
Encoding of $_SERVER variables like $_SERVER['REQUEST_URI']
<p>I need to do some string operations on <code>$_SERVER</code> value especially <code>$_SERVER['REQUEST_URI']</code></p> <p>How PHP encodes such strings? Should I use <code>mb_*</code> family functions?</p> <p>To understand better my question, let's say I have a page on my webserver called like this:</p> <pre><code...
php
[2]
3,223,731
3,223,732
Calling a class from another class OOP
<p>I currently have a class called Connect with the following code:</p> <pre><code>class Connect { public $sqlHost='host'; public $sqlUser='user'; public $sqlPass='pass'; public $sqlDB='db'; public $db; public function __construct() { $this-&gt;db = new mysqli($this-&gt;sqlHost, $this-&gt;sqlUser, $this-&...
php
[2]
5,987,607
5,987,608
How to embed JavaScript in PHP within div (in an include file)?
<p>I'm trying to get an image to display in a div depending on the URL of the page. This div is in an include file that gets used for all pages of the website. What I want is if it's the homepage (with or without index.php), is for the div to show the image. What I've pieced together so far is:</p> <pre><code>&lt;scri...
javascript
[3]
4,134,580
4,134,581
Is there a C#-like lambda syntax in JavaScript?
<p>Is there a framework or post processor for JavaScript that supports lambda syntax like in C#?</p> <p>Function definitions in CoffeeScript seem to look like lambdas but I have not looked into them thoroughly.</p> <p>Can anyone tell me, <em>can I use lambda syntax in JavaScript?</em></p>
javascript
[3]
2,158,315
2,158,316
Function printing correct Output and None
<p>I have defined this function that takes a word and a string of required letters and that returns True if the word uses all the required letters at least once. When I run this, it gives me the correct output but I do not understand why it also outputs 'None'.</p> <p>Here is my code:</p> <pre><code> def uses_all(wor...
python
[7]
4,490,806
4,490,807
How do I add leading zeroes to String.Format parameters?
<p>I have the following code:</p> <pre class="lang-cs prettyprint-override"><code>string textTransDate = String.Format("{0}-{1}-{2} {3}:{4}", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute); </code></pre> <p>I want to add leading zeroes to the month and day parameters ...
c#
[0]
3,061,171
3,061,172
question on string in c++
<p>does this work on string in c++?</p> <pre><code>string s="lomi"; cout&lt;&lt;s&lt;&lt;endl; </code></pre> <p>what is bad in this code?</p> <pre><code>#include &lt;iostream&gt; #include &lt;cstring&gt; using namespace std; int main(){ string s=string("lomi"); for (int i=0;i&lt;s.length();i++){ ...
c++
[6]
471,080
471,081
Using of Toast with thread in android
<pre><code>progressDialog = ProgressDialog.show(GetResponse.this, "", "Loading..."); new Thread() { public void run() { try { // inside i have written code for making connection to the server using SSL connection. }catch (Exception e) { ...
android
[4]
389,984
389,985
Cannot save a url as a value in a PropertiesConfiguration object
<p>This one has me stumped.</p> <p>I have something like:</p> <pre><code>PropertiesConfiguration pc = new PropertiesConfiguration(); pc.setProperty("url", "jdbc:postgres://localhost:5432/somedb"); pc.setBasePath("."); pc.setFileName("my.properties"); </code></pre> <p>I have this code in a jar that was built on Linux...
java
[1]
2,206,337
2,206,338
what next after 'dive into python'
<p>I've been meaning to learn another language than java. So I started to poke around with python. I've gone over 'dive into python' so I have a decent knowledge about python now. </p> <p>where do you suggest I go from here? I dont want to go through another advanced book again and would like to use the python knowl...
python
[7]
545,687
545,688
window.setTimeout Not Firing
<p>I'm sure I'll hate myself when I find out what the issue is, but I can't for the life of me figure out why this won't work. I'm using setTimeout elsewhere in the site just like this and it is working fine.</p> <pre><code>&lt;input type='button' value='Submit Form' onclick='ValidateForm()'/&gt; var submitFinalTimeo...
javascript
[3]
3,769,215
3,769,216
Get time remaining of a setInterval
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3144711/javascript-find-the-time-left-in-a-settimeout">Javascript: find the time left in a setTimeout()?</a> </p> </blockquote> <p>For example if I have:</p> <pre><code>&lt;script&gt; var timer = setInterv...
javascript
[3]
302,055
302,056
How can I order a list of Points so that no lines drawn intersect?
<p>I am getting a List of Points from the user clicking on the screen.</p> <p>And I want to draw a polygon based on this points. The problem is that the user might not be clicking in the right order (<em>no intersecting segments</em>) to form a correct polygon, therefor I'm looking for a code snippet which would sort ...
c#
[0]
3,755,602
3,755,603
Keep mobile Data always on function
<p>If you go through HTC phones, they have an option for mobile data network setting to "Always enable mobile data". As I understand, it helps to maintain a TCP connection. I want to implement the same functionality, how to implement it ? as I think, need to use wakelock?</p>
android
[4]
5,204,760
5,204,761
Create a file in filesystem using java
<p>I am creating an <code>xml</code> file using document object which goes something like this.</p> <pre><code>DOMSource ds=new DOMSource(doc); PrintStream ps=new PrintStream("file.xml"); StreamResult sr=new StreamResult(ps); javax.xml.Transformer.transform(ds,sr); </code></pre> <p>The file creation is fine and ...
java
[1]
1,428,329
1,428,330
Returning the first number of a parameter in Python
<p>Edit: Thank you guys for your help, but I had trouble applying it to my actual problem. I was trying to get a general idea of how to do a similar problem to one I was assigned, but I haven't been able to figure it out.</p> <p>So, my functions is going to take two parameters, both of which are numbers. If the first ...
python
[7]
2,547,684
2,547,685
How to make Android app start on pressing on switch
<p>I want to have a situation where an android phone is actually running, so that it might be able receive calls and pressing the on switch, which activates the screen to use apps, actually starts an app running with no further user intervention.</p> <p>I have seen a similar question which was answered starting with t...
android
[4]
3,592,211
3,592,212
Java Image Import Display
<p>I am having trouble understanding if I am reading my images in correctly. My code with a random Bill Gates Picture:</p> <pre><code>import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class ReadingImage { public static void main(String[] ar...
java
[1]
3,510,787
3,510,788
How to get a list of top 5 links from a google search?
<p>I need a list of top 5 links obtained from a user query about a partiuclar subject.Is there any way by which I can do this ? How can I fetch top 5 links of a google search ? Is there any API available for it ?Some demo examples will be helpful. </p> <p>Thanks in advance.</p>
java
[1]
589,862
589,863
Boring javascript calling: why a non-desirable js function has been called?
<p>I'm building an aspx page with a button that calls another page in a different window, through javascript:</p> <pre><code>function assuntos() { window.open("pg_assuntos.aspx", "List", "scrollbars=no,resizable=no,width=600,height=480"); } </code></pre> <p>in the page's Onload event, I have the code:</p>...
asp.net
[9]
5,708,273
5,708,274
Get pixel value from an Android display?
<p>I'm not even concerned with the camera per se. I want at the closest thing to the display screen. Meaning: it could even be the desktop the user is looking at, completw w/ the background and the icons she moves back and forth. </p> <p>Let's say, at time t=1 sec, the app goes to pixel (78, 300) on that display a...
android
[4]
3,496,847
3,496,848
Adding Map to collection of maps
<p>I have collection of maps.</p> <pre><code>Collection&lt;Map&lt;String,Object&gt;&gt; xyz = (Collection&lt;Map&lt;String,Object&gt;&gt;) someMethod(); xyz.add(new HashMap&lt;&gt;()); </code></pre> <p>If I try to add another map to this collection it gives me run time exception as</p> <p>UnsupportedOperation.</p> ...
java
[1]
5,518,474
5,518,475
jquery ajax call with xml query not working. Need advice
<p>I've written some code that is supposed to load an xml file via AJAX, parse a couple variables, and alert them to the screen. It isn't working... Can any guru's out there tell me what I've done wrong?? </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax...
jquery
[5]
5,446,022
5,446,023
How can change tabspecification text into another tab activity?
<p>I am working in android. I have used tab host and tab widget. i have 4 activity to add as view.</p> <p>this is my program:</p> <p>public class TabDemo extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCrea...
android
[4]
5,441,107
5,441,108
Android and onSaveInstance and Restore
<p>I have a big problem. I have a activity where I have two imageViews. In onCreate I have List pictures where I have 10 pictures. Every time when I start this activity both imageViews get random picture from List and shows them. For example: When I start activity I can see car and pencil and when I start this activity...
android
[4]
446,295
446,296
jQuery each() non-blocking?
<p>Is jQuery's each() function non-blocking?</p> <p>In the below example, I expect "test in each" to be logged first, but in each test "test out of each" is logged first.</p> <p>So this is causing the loop to run up to the body (sometimes the document) element before returning an error.</p> <p>I'm just trying to get...
jquery
[5]
350,948
350,949
PHP Mailing Code sending mail to spam/quarantine
<p>The title explains itself. It is a website for in-house employees to buy and sell from each other. Its based solely around Microsoft Outlook emailing addresses. All the emails are supposed to be sent from the seller's email as they post items. Except when I enter <code>&lt;php phpinfo(); ?&gt;</code> on the action p...
php
[2]
111,286
111,287
How to update system clipboard when Toolkit.getDefaultToolkit().getSystemSelection() returns null.
<p>The following code:</p> <pre><code>Toolkit.getDefaultToolkit().getSystemSelection().setContents( new StringSelection(a), null); </code></pre> <p>returns <code>null</code> because it is not supported on my Computer. But, I am wondering how I set my Computers selection if it does not support this. There has to ...
java
[1]
6,033,045
6,033,046
How to tell if a class is descended from another class
<p>I have a function that accepts a class (not an instance) and, depending on whether or not it's a specific class <em>or a subclass of that</em>, I need to pass it in to one of two other (third-party) factory functions.</p> <p>(To forestall any objections, I'm aware this is not very Pythonic, but I'm dependent on wha...
python
[7]
4,090,998
4,090,999
Cant read my cookie from the root of my site
<p>I successfully set a cookie with javascript on one page like this: .. I went to this article and took the code from it: <strong>UPDATE :</strong> </p> <pre><code>**http://techpatterns.com/downloads/javascript_cookies.php** </code></pre> <p>The code works.. but I can set and read my cookie from one page only, when ...
javascript
[3]
2,993,935
2,993,936
Instead of calling the same function twice
<p>I'm first checking if a function returns a valid result, and then, if the result is valid, I need to use that in my script. But instead of checking once, and then coming back again to the function for its result, is there a way to do it all in one go? Here, <code>$strVal</code> is the variable I need to use in an qu...
php
[2]
4,740,231
4,740,232
add and remove class works with blank link but not with page link
<p>I am really noob on jquery but I tried almost more than my best to solved it out by reading old posts created by valuable users of Stackoverflow. My problem is I try to add class onclick event. Its working only if I set the hyperlink link to blank(#) <code>&lt;a href="#"&gt;test&lt;/a&gt;</code> but if i set to hype...
jquery
[5]
4,460,990
4,460,991
does explode get executed more than once in a foreach?
<pre><code>$array='hello hello2'; foreach(explode(' ',$array) as $v) echo $v; </code></pre> <p>How many times does explode get executed?</p> <p>And is it better that to use another var like:</p> <pre><code> $exploded = explode(...); foreach($exploded as $v) ... </code></pre> <p>?</p>
php
[2]
4,402,137
4,402,138
How to use intent params to verify the callers calling onActivityResults() method?
<p>I'm wondering if it is possible to verify the the callers calling onActivityResult() method of startActivityForResult(); Here is the situation: I have two widgets in my home screen for invoking the default camera and video of device. Intent has been used with following params for camera: android.provider.MediaStor...
android
[4]
3,705,601
3,705,602
Slide Menu Library error
<p>I used <a href="https://github.com/jfeinstein10/SlidingMenu" rel="nofollow">Slide menu</a> library into my android project and when I include this the eclipse fire and error at project.R.id cause it can't access my project.R</p>
android
[4]
2,613,985
2,613,986
JavaScript: Load a script when specific <a> is active
<pre><code>&lt;script&gt; function AdImageTag(){ var q1=document.getElementById( 'ctl00_ContentPlaceHolder1_ctl00_ctl00_Showcase' ).childNodes[1].innerHTML; var counter1=0; function iterate(q1,counter1){ q1= document.getElementById( 'ctl00_ContentPlaceHolder1_ctl00_ctl00_Showcase' ).childNodes[1].innerHTML; if(q1...
javascript
[3]
2,621,875
2,621,876
Java switch constant expression... Is there any clever way to get this to compile?
<p>I'm returning to Java dev after many years away from it. Is there anyway to get this code to compile?</p> <pre><code>class Mpeg4 { public static final int FourCC2Int(char aA, char aB, char aC, char aD) { return (aA &lt;&lt; 24) | (aB &lt;&lt; 16) | (aC &lt;&lt; 8) | (aD); } publ...
java
[1]