Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
4,063,171
4,063,172
Catch exception throw from inside of the with statement
<pre><code>zip_file_name = "not_exist.py" try: with zipfile.ZipFile(zip_file_name) as f_handle: print("open it successfully") except (zipfile.BadZipfile, zipfile.LargeZipFile), e: print(e) </code></pre> <p>Is this the correct way to handle exception throw by a with statement?</p>
python
[7]
4,864,131
4,864,132
Event.type not working in Mozilla Firfox
<p>By referring this <a href="http://api.jquery.com/event.type/" rel="nofollow"><strong>link</strong></a>, I had adopted a property called <code>Event.Type</code> to my <code>script</code> for a particular need and it worked fine in <code>IE9</code>. After that while making <code>compatibility test</code>, i came to kn...
jquery
[5]
5,320,448
5,320,449
How to load all Jars in the same path that as url shows into JVM after a certain URLClassLoader had been created?
<p>Oh, sorry for my poor presentation skill, I mean that now I have create an URLClassLoader A, and its URL[] is B, now I need to load and unload all the jars in B dynamically. But I don't know how to do it. </p>
java
[1]
1,828,941
1,828,942
How to make sure a static method/property runs before all other static properties in other classes
<p>I have some classes in my project with static properties. How could I make one static method that populates a container from which these static properties read data from. How could I make one static method run first before any other static method.How do you which classes static properties get loaded first</p>
c++
[6]
5,195,047
5,195,048
Passsing JSON in OnClick Events
<p>How can I embed the following parameter string in an onclick event without breaking the JS? Right now there is collision with double Quotes. the values in th onclick event are coming from a JS variable.</p> <p>Ex:</p> <pre><code>initializeMap('["2012-02-17 15:39:19.0,33.38727791932264,-86.74324840021933","2012-01-...
javascript
[3]
4,012,535
4,012,536
How come alert breaks javascript execution?
<p>how is that possible that call to the alert function changes behavior of a js script? Something like that:</p> <pre><code>function add_token (item) { var li_data = $.data(item.get(0), "tokeninput"); </code></pre> <p>works but this:</p> <pre><code>function add_token (item) { alert('a'); var li_data = $...
javascript
[3]
2,561,445
2,561,446
PHP unlink() breaks file_exists, header, and echo functions?
<p>I have the following code:</p> <pre><code>$tmpfile = $tempDirectory . $file ; if (file_exists($tmpfile)) { header('Location: &lt;some location&gt;'); } </code></pre> <p>It works flawlessly, the file exists, I get redirected to my new page.</p> <p>So, now I know that the file exists and works. So, I go into ...
php
[2]
2,914,898
2,914,899
How to place aspx-files in seperate Web Application Projects in one solution?
<p>We have been building ASP.Net websites for many years. During this time we gathered a lot of knowledge of ASP.Net. We know what to use, a what not. One problem is still, persistently, bugging us. I hope to solve this for once and for all.</p> <p>We have a fairly large solution with lots of aspx-files. All aspx-file...
asp.net
[9]
4,977,885
4,977,886
Bar code scanner in Android
<p>I want to Create an application which can read the Ba Codes. I want to do this through my on application not using third party applications like 'ZXing'. Please any coding help or tatorial...</p>
android
[4]
524,759
524,760
full screen in android at runtime (no notification/status bar and app title bar)?
<p>is following both lines are <br></p> <pre> getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); </pre> <p>considering I am writing this line in activity class </p> <p>Thanks in advance</p>
android
[4]
5,338,397
5,338,398
nextLine() Issues with java Scanner Class
<pre><code>import java.util.Scanner; public class b { public static void main(String[] args){ Scanner keyboard = new Scanner(System.in); String[] lines = new String[5]; lines[0] = keyboard.nextLine(); lines[1] = keyboard.nextLine(); lines[2] = keyboard.nextLine(); ...
java
[1]
4,244,150
4,244,151
glassfish server is not working
<p>i am working on netbeans versin 7 with glass fish server 3.1 in java but whenever i run a project ,it shows "glassfish server start failed"</p> <p>and a warining that i am pasting here is shown</p> <pre><code> SEVERE: not.found.in.original.location[Ljava.lang.Object;@1760a96 WARNING: DPL8027: Ignore WEB-INF/sun-w...
java
[1]
5,881,808
5,881,809
What is $$ in php?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2715654/what-does-mean-in-php">What does $$ mean in PHP?</a><br> <a href="http://stackoverflow.com/questions/4179489/double-dollar-sign-php">Double dollar sign php</a> </p> </blockquote> <p>What is $$ in php. ...
php
[2]
819,343
819,344
How to put a string variable inside a doublequote?
<p>So I would like to create a text(like a log file) from the database. Each text represent a user's record. Obviously each record has different name according to the database. And I am wondering how to put the string variable inside the doubleqoute when creating the text file.</p> <pre><code>public static void create...
c#
[0]
4,586,981
4,586,982
java - How to handle array:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
<p>In my code i am comparing the 2 elements of an array. but i got the following exception.please can anybody help me</p> <blockquote> <p>array:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3 at Sarray.main(Sarray.java:64)</p> </blockquote> <p><br></p> <pre><code>public class Sarray ...
java
[1]
4,512,118
4,512,119
setting backgroung image to button tag in asp.net
<p>i tried to set image to the button tag in asp.net but it gave an error saying background-image cannot be applied to . Please help I wrote the following code</p> <pre><code>&lt;asp:Button ID="bsrc" runat="server" Style="left: 545px; position: absolute; top: 18px;font-family:Tahoma; font-size:small" Text="Search" Wid...
asp.net
[9]
3,978,695
3,978,696
importing in python and checking __name__
<p>I am importing a module (i am using its name as module only). Whenever i press </p> <pre><code>module.__name__ </code></pre> <p>it is showing some name Module.module</p> <p>when i did </p> <pre><code>print module </code></pre> <p>,i go to the path mentioned. I don't have the module, it has a pyd file. I am co...
python
[7]
1,559,235
1,559,236
How to kill an Android app and all running service/tasks from another service?
<p>I am writing an app that intercepts the launching of apps, killing them, then restarting them if certain permissions are met. I've managed to figure out the first part(launching of apps) by having a service that monitors the system log. I'm now working on killing the app that was just launched. I'm trying to use:</p...
android
[4]
1,997,006
1,997,007
Android how to show .docx file in webview?
<p>In my app i have URL:: <a href="http://mymobilece.com/api/api_getexammaterials.php?id=27" rel="nofollow">http://mymobilece.com/api/api_getexammaterials.php?id=27</a> Its a file how to show in webview? but not with Google document viewer.</p>
android
[4]
2,121,919
2,121,920
Connect device for debugging with Android?
<p>I need to connect my device (Sony S) to eclipse for debugging. How can I do this?</p> <p>I've got it plugged in, and set up for development with debugging mode turned on.</p> <p>I have adb devices to see if its there and it isnt.</p> <p>I am on OSX 10.6</p>
android
[4]
1,917,604
1,917,605
Android Map programming
<p>Actually i am developing a Map browser app in Android. I have a .dat file contains map information with a File format like this,</p> <pre><code>struct point{ int x, int y; }; </code></pre> <p>How can i read this .dat file using this format and copy the values into x and y?</p>
android
[4]
3,397,817
3,397,818
Not able to retrieve key from App.Config
<p>In my WAP project I have a reference to another C# Project (non-web). In that C# project I have an app.config and I renamed it to [projectName].config</p> <p>I then tried to grab a key from my [project].config from some code within my C# Project and it can't find it:</p> <pre><code>return ConfigurationManager.App...
asp.net
[9]
4,195,892
4,195,893
How can i force an user to select the file extension i want?
<p>How can I force the user to save the file as .java or whatever?</p> <p>Thank you!</p> <p>EDIT: </p> <p>I would like to use the JFileChooser option and throughout, force the user to select the file extension that I want. </p>
java
[1]
6,025,209
6,025,210
multiple form validation
<p>If all asp.net controls are required to be within a form in order to be generated, how does one go about using the jquery validation plugin with multiple forms on the same page?</p> <p>What I mean by that is, how can I have two forms both containing asp controls that can be validated independently with jquery valid...
jquery
[5]
5,451,624
5,451,625
How can I "avoid" mousedown over some inside elements?
<p>My <a href="http://jsfiddle.net/GUPUG/4/" rel="nofollow">code</a> :</p> <h1>HTML</h1> <pre><code>&lt;div style="position:relative;"&gt; &lt;div class="boxImmagineResultNext"&gt;&lt;/div&gt; &lt;div class="boxImmagineResult"&gt; &lt;textarea cols="15" rows="5"&gt;&lt;/textarea&gt; ...
jquery
[5]
2,077,138
2,077,139
Displaying progress dialog before starting a new activity
<p>I have an activity 'Activity1' and also another activity named 'Activity2'. The 'Activity2' is loaded upon clicking a button in 'Activity1'. I wanted to display the progress dialog until the new activity is loaded . Can you please show me the code to do this </p>
android
[4]
664,410
664,411
elegant way to convert IP to octal
<p>I have been looking for an elegant way in php to convert an IP address into its octal representation without having to do each of the four digits separately. </p> <p>for example, the IP: 1.2.3.4 would be 0001.0002.0003.0004</p>
php
[2]
1,832,134
1,832,135
Data connection to Internet
<p>My app is making a connection, using the DefaultHttpClient and HttpPost, to the internet. I configured it to have Internet permission (manifest) and all is working well when my device is connected via WIFI. Switching off the WIFI and trying to use a data connection via the phone network seems to fail (there is not r...
android
[4]
3,562,079
3,562,080
Process C#| How To Make A Process Into system tray
<p>So, I have a <code>Process</code> running in C#, and I want to make it a system tray. Is it possible?</p> <p>This is the code I am using:</p> <pre><code>Process proc = Process.Start("XXXX"); </code></pre>
c#
[0]
1,949,528
1,949,529
Is there an infinite loop in my code?
<p>My webpage crashes when I run this:</p> <pre><code>function replace() { var str = document.getElementById('feeds'); var cont = str.innerHTML; curstring = "twitter: "; while (cont.indexOf(curstring)) { replaced = cont.replace(curstring,"TWIMG "); str.innerHTML = replaced; } } ...
javascript
[3]
2,606,802
2,606,803
Problem with $_POST
<p>This wont work. All the fields are correct etc and I have a db connection.</p> <p>To the problem</p> <p>I use this script to insert a post into the db:</p> <pre><code>&lt;?php if (isset($_POST['msg'])) { $title = mysql_real_escape_string($_POST['title']); $msg = mysql_real_escape_string($_POST['msg']); // koll...
php
[2]
5,012,958
5,012,959
Gather all Python modules used into one folder?
<blockquote> <p><strong>Possible Duplicate:</strong><br /> <a href="http://stackoverflow.com/questions/907660/gather-all-python-modules-used-into-one-folder">Gather all Python modules used into one folder?</a> </p> </blockquote> <p>I don't think this has been asked before-I have a folder that has lots of differen...
python
[7]
5,543,205
5,543,206
PHP errors for (isset) variables and optimization
<p>My error logs get huge quick because I reference a ton of variables with may or may not exist. I have been going back through and starting to clean them up but wanted to see if there was a more effective (and cleaner) way of checking for php variables. </p> <p>Currently I use as the following:</p> <p>Example 1:</p...
php
[2]
2,004,578
2,004,579
What's the pythonic way of declaring variables?
<p>Usually declaring variables on assignment is considered a best practice in VBScript or JavaScript , for example, although it is allowed. </p> <p>Why does Python force you to create the variable only when you use it? Since Python is case sensitive can't it cause bugs because you misspelled a variable's name?</p> ...
python
[7]
4,971,316
4,971,317
onCreate not getting called for first activity when calling startActivity consecutively for two different activities
<p>I have three activities <strong>A</strong>, <strong>B</strong>, and <strong>C</strong>.</p> <p>In <code>onCreate()</code> of A, I call <code>startActivity(...)</code> in two consecutive statements for launching B &amp; C. But android does not calls <code>onCreate()</code> on activity B instantly. Instead when I pre...
android
[4]
2,781,479
2,781,480
HTML tags in string for TextView
<p>If I put simple HTML formatting tags, such as &lt;b&gt;...&lt;/b&gt; into a string resource and display the string in a TextView, the expected formatting is applied. But how can I do this if I build up my own String and display it? If I do something like String str = "This is &lt;b&gt;bold&lt;/b&gt;";, the actual ta...
android
[4]
741,218
741,219
jquery test a condition vs entire collection without a loop
<p>Pretty simple to do with loop but I'm wondering if there's a way to see if every item in a collection matches a condition without a loop. For example:</p> <pre><code>if( $('.many-items-of-this-class').hasClass('some-other-class') ) { } </code></pre> <p>This returns true if any item in the collection returns true. ...
jquery
[5]
2,606,451
2,606,452
Detect end of running process without Admin rights
<p>I was wondering if it was possible to detect when a certain process gets killed or closed the normal way. With other words if the process is removed from the process list.</p> <p>I know it's possible by using WMI and the System.Management.ManagentEventWatcher, however this needs Administrator rights, I'd prefer if ...
c#
[0]
567,423
567,424
Android SeparatedListAdapter - How to use custom object as List Item?
<p>I have a basic object called <code>Employee</code>. You can retrieve an Employee's name and id using <code>.getName()</code> and <code>.getId()</code>.</p> <p>I want to use Jeff Sharkey's SeparatedListAdapter to build a sectioned list. For the list items though, I need to use my custom Employee objects for the item...
android
[4]
2,386,065
2,386,066
Location of default image button in android?
<p>Does anyone know where I can find the default image used for button in android? It will be a nine-patch with the .9.png extensions. </p>
android
[4]
1,472,400
1,472,401
How to prevent Overloading?
<p>Is it possible to prevent overloading of user defined functions in C++? Suppose I have a function as:</p> <pre><code>void foo(int , int); </code></pre> <p>Can I prevent foo from being overloaded, and if so how? If I can, can this be extended to prevent overriding of the methods through inheritance?</p>
c++
[6]
2,003,446
2,003,447
strtotime / 86400 not returning even number of days
<p>I am having a strange result with PHP Version 5.3.1, can anyone explain the below result?</p> <pre><code>$secondsDiff = strtotime(date("2011-11-10")) - strtotime('2011-07-15'); return ($secondsDiff/86400); </code></pre> <p>it returns 117.958333333??</p> <p>When I use dates closer together it generally works.</p> ...
php
[2]
1,389,769
1,389,770
Java Subclasses last instance overwriting values
<p>I'm a web developer dabbling in Java (again) and I'm having trouble with something.</p> <p>Basically, I have a superclass Employee with two subclasses that extend it called Management and Programmer. The Employee class contains an array <code>employees</code> that is basically an array of Employee objects.</p> <p>...
java
[1]
2,936,113
2,936,114
Need help understanding the + operator in Javascript
<p>Why is <code>1 + + + 1 = 2</code> in Javascript?</p> <p>What is this behavior called? Is it documented somewhere? </p> <p>Thanks.</p>
javascript
[3]
122,968
122,969
How to add share application button from activity to google+ and facebook?
<p>I am building android application now i already completed, but I want to add Share button in root activity that user can share my application(link to download from google market) to google+ , facebook, twitter and linkin.</p> <p>How can i do it?</p> <h1>my code:</h1> <pre><code>ImageButton sharingButton = (ImageB...
android
[4]
5,565,029
5,565,030
ASP.NET What is this called using from keyword to loop through list
<p>Hey I just wanted to find out the working of the following script as I never seen "From" used like this before</p> <pre><code> var formattedList = from a in value select new { a.value, currencyId = a.currencyId == -1 ? "" : a.currencyId ...
asp.net
[9]
2,636,873
2,636,874
jQuery problems with tinybox
<p>I'm using tinybox <a href="http://www.scriptiny.com/2011/03/javascript-modal-windows/" rel="nofollow">http://www.scriptiny.com/2011/03/javascript-modal-windows/</a> for a pop-up window. It looks like this: </p> <pre><code>TINY.box.show({ iframe: "someDocument.html", boxid: "frameless", width: 300, height: 200, ...
jquery
[5]
4,090,239
4,090,240
Is this a good bind method?
<pre><code>Function.prototype.bind = function() { var $this = arguments[0]; return this.apply($this, Array.prototype.slice.call(arguments, 1)); }; </code></pre> <p>Is it good enough to use in real-world application?</p>
javascript
[3]
5,198,506
5,198,507
PhotoSwipe JS gallery, remove specific event handler
<p>In <a href="https://github.com/codecomputerlove/PhotoSwipe/blob/master/src/photoswipe.class.js" rel="nofollow">PhotoSwipe</a> JavaScript image gallery is there any way to remove a specific event handler? I found you can remove ALL but I found no way to remove one by name.</p>
javascript
[3]
5,204,046
5,204,047
Reading standard output from process, always empty
<p>Running this code:</p> <pre><code>Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.FileName = "tool.exe"; p.Start(); p.WaitForExit(); </code></pre> <p>Makes tool.exe run, and output some content on standard output. However, if I try to capture the content using:</p> <pre><code>Process p...
c#
[0]
3,214,925
3,214,926
What does this mean in my boss's python code?
<p>This is the code :</p> <pre><code>modulename, classname = settings.APP_USER_CLASS.rsplit('.',1 ) modulemeta = __import__(modulename, globals(), locals(), [classname]) </code></pre> <p>I don't understand this: <code>__import__(modulename, globals(), locals(), [classname])</code> mean ,</p> <p>so what is it ,<...
python
[7]
5,527,542
5,527,543
Strip All Urls From A Mixed String ( php )
<p>i reposted this question because i didn't find a good answer.</p> <p>i have a string which can contains text with urls.</p> <p>i want a function to strip all urls from this string and just let the text.</p> <p>by example the string can contains like this :</p> <p>1) hey take a look here : <a href="http://xxx.xxx...
php
[2]
4,536,931
4,536,932
How to sort an array starting with a specific position
<p>I have an array:</p> <pre><code>int[] array = {1,2,3,4,5,6,7,8,9,10}; </code></pre> <p>I want to pick a starting point for the sorting. If I choose <code>6</code> the output should be </p> <pre><code>(6,7,8,9,10,1,2,3,4,5) </code></pre>
java
[1]
85,267
85,268
Object definition SyntaxError
<p>Why does the second line of code produce an error but not the third?</p> <pre><code>{ foo: 'bar' } // =&gt; 'bar' { "foo": 'bar' } // =&gt; SyntaxError: Invalid label ({ "foo": 'bar' }) // =&gt; { foo: 'bar' }. </code></pre>
javascript
[3]
2,582,174
2,582,175
Why is my setImage line not working?
<p>I have written 1 code for</p> <pre><code>-(IBAction)action:(UIEvent *)id { [act setImage:[UIImage imageNamed:@"down.png"] forState:UIControlStateHighlighted]; } </code></pre> <p>It's working, but I have written 1 code for</p> <pre><code>-(IBAction)action:(UIEvent *)id { [act setImage:[UIImage imageNamed:@...
iphone
[8]
4,978,984
4,978,985
formatting float to two decimal format
<p>I'm trying to print out a float value in plain text with two decimal values (if possible). For example, if I had 229806210.039999 in the database, then I would like to print it out as 229806210.04, but for some reason it's printing out in scientific notation: 2.29806208E8, which is incorrect in that the last two dig...
java
[1]
3,845,502
3,845,503
what does "*" mean in Python?
<p>I came across with a line in python.</p> <pre><code> self.window.resize(*self.winsize) </code></pre> <p>What does the "*" mean in this line? I haven't seen this in any python tutorial.</p>
python
[7]
476,636
476,637
Is arr.length=0 better than arr=[] in javascript while reseting
<p>I'm improving the performance of a HTML5 Game,while I reset some arrays,in order to reduce the garbage collection,I tend to use array.length=0(Yet I'm not sure if it's working in real world)<br> I did some tests to find out the speed of these 2 types of reset array here<br> <a href="http://tinkerbin.com/hqQvp5fQ" r...
javascript
[3]
3,555,855
3,555,856
Relative Date from Unix Timestamp with PHP
<p>I've seen a few other people talking about relative dates, but I still haven't managed to get it working properly.</p> <p>My script pulls a unix timestamp from a MySQL database and I would like the it to display something like this:</p> <blockquote> <p>2 minutes ago<br> 16 hours ago<br> On Tuesday 10th Novem...
php
[2]
3,322,320
3,322,321
Passing data to Datagrid textbox in another form
<p>I open a datagrid when I double-click the textbox in my form1. I need to give two clicks on a cell of datagrid in form2 and when I click it already bring value to the textbox in form1. I've tried many ways no longer works, which he already ran automatically adds the value in the textbox before I click the cell, can ...
c#
[0]
6,021,001
6,021,002
Why does the void operator invoke GetValue(expr) when it always evaluates to undefined?
<p><a href="http://ecma262-5.com/ELS5_Section_11.htm#Section_11.4.2" rel="nofollow">The void operator in JavaScript</a> will call the internal <code>GetValue(expr)</code>, but always return <code>undefined</code>, regardless of what value or expressions are. </p> <p>The spec says:</p> <blockquote> <p><strong>11.4.2...
javascript
[3]
4,202,908
4,202,909
boost c++ library object serialization problem
<p>The error was:</p> <pre><code>terminate called after throwing an instance of 'boost::archive::archive_exception what(): input stream error Aborted </code></pre> <p>I have these code in my main.c</p> <pre><code>Object *obj = new Object(); { std::ifstream ifs("FILEX"); boost::archive::text_iarchive ia(ifs);...
c++
[6]
1,946,960
1,946,961
Creating a maze type application
<p>How would I go about building maze type app for the iPhone, I can't find any tutorials ag all. </p>
iphone
[8]
1,823,054
1,823,055
Image Displays Incorrectly On All Versions Of Internet Explorer
<p>I have the following Javascript code that resizes images on a page:</p> <pre><code> var max_size = 498; $(".slideimage").each(function(i) { if ($(this).height() &gt; $(this).width()) { var h = max_size; var w = Math.ceil($(this).width() / $(this).height() * max_size); } else { ...
javascript
[3]
1,373,184
1,373,185
PC ram size using python or windows command line
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python">How to get current CPU and RAM usage in Python?</a> </p> </blockquote> <p>How to read pc ram size using python or wmi generator/Windows command line </p>
python
[7]
5,871,687
5,871,688
android developer console exception report platform not mentioned?
<p>I am new to android development. Recently I published a free app. after 70 to 80 downloads I have received a stack trace for a null pointer exception, </p> <p>But the platform is not mentioned it only says 'Other'.</p> <p>I am unable to reproduce the issue at my end and the stack trace is giving me no clue I have ...
android
[4]
4,709,119
4,709,120
jQuery scrollTop function
<p>I have one page where the next page is fired when the user reaches the bottom of the page:</p> <pre><code>$(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ next_funtion(); } }); </code></pre> <p>However, I want next page to be fired when the user...
jquery
[5]
3,045,068
3,045,069
C++, how many years experience?
<p>As a little background, I've been programming for a long time now using various languages, systems, etc.</p> <p>I've come across the old problem of a recruiter wanting to know "how many years experience" I have of C++. I'm a little stumped as I've bounced around it many times over a number of years. I don't think I...
c++
[6]
2,785,122
2,785,123
Anyone Know any Java Bookmarking Site
<p>Hi Anyone know good website for learning and updating for Java learning. Is something like dotnetkicks.com same in Java. </p> <p>Please let me know.?</p>
java
[1]
3,082,956
3,082,957
Windows 7 Compatibility Issue in .NET
<p>When we create a SetUp &amp; Deployment project for our application in .net, the default folder for our application to be installed is being set as <code>C:\Program Files.....</code> Our application will run perfectly if we are using a Windows XP machine. But if we are using a Windows Vista or Windows 7 machine, the...
c#
[0]
3,220,916
3,220,917
Best way to get lat and long from gps and sending to a server to get data back using expandable list view android
<p>what is the best way to design an expandable list view, the details for the list view will come from server after the device sends the latitude and longitude to the server. </p> <p>I am early learner on AsyncTask, as User Interface might freeze when getting lat,long and sending the same to the server and getting ba...
android
[4]
5,300,221
5,300,222
How to get JSON from the Blogger API filtered by category
<p>I am trying to get list of recent posts from a blog filtered by category completely on the client-side using jQuery. I'm really close and there have been a lot of posts here at stackoverflow which have been immensely helpful. Here is what I have so far... </p> <pre><code>&lt;script type="text/javascript"&gt...
jquery
[5]
348,641
348,642
C# STARTUPINFO Flags to show UI for a process started from a Service in XP
<p>I'm launching a process from a windows service in XP, I'm just launching the process not trying to interact with it. The process starts but the UI does not show. I believe I need to set some flags in STARTUPINFO to make process visible, and hoping someone could show how and what flags to set.</p> <pre><code> sPa...
c#
[0]
294,785
294,786
Mysterious javascript behaviour: unequal equals
<p>I really don't know how is it possible, and I couldn't reproduce the error in a simplified environment, say JSFiddle. But here is how it looks in my application. </p> <p>I'm trying to convert value that can be 'True', 'False' or 'something else' string into boolean if it is either True or False. In most cases it wo...
javascript
[3]
5,336
5,337
java.lang.NullPointerException error when selecting list item
<p>I receive the null pointer error when i tried to connect an activity to an fragment class.. activity class is an listactivity and when clicking on particular list, fragment class should open..any body has sample code or solution can provide me..my fragment class name is Termfragment..</p> <p>i used this code in my ...
android
[4]
4,197,735
4,197,736
How to get the current seconds in the current month?
<p>I am trying to calculate the current second in the current month, but I'm having trouble creating a simple function that does it.</p> <p>My best guess involves using getTime() - the current milliseconds since January 1 1970 - and then subtracting X, where X is the number of milliseconds up to the end of the previou...
javascript
[3]
3,596,869
3,596,870
Two error messages (I changed to mysqli, and now get different error messages!)
<p>Help!<br> 1. here is the page: <a href="http://www.bpanzullo.com/ThornAJAX/Ajaxindex.html" rel="nofollow">http://www.bpanzullo.com/ThornAJAX/Ajaxindex.html</a> The only name in the database now is Paul I get 2 error messages when I type in Paul:</p> <pre><code>Warning: mysqli_query() expects at least 2 parameters...
php
[2]
5,287,387
5,287,388
Android Licensing Check Code... need direction...?
<p>I have been searching all over the web, reading MANY articles trying to find a completed working example of Android Licensing Check for my app. I have already setup PROguard and was wanting to use the LVL even though I read it is easily bypassable.. DEXguard, which cost money, is suppose to be better...</p> <p>Any...
android
[4]
2,041,226
2,041,227
Twitter+Oauth on iPhone: How do you logout?
<p>I'm using <a href="http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master" rel="nofollow">http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master</a> for Twitter+Oauth in my iPhone app. I'm trying to create a facebook connect like feature where can log in and log out of twitter. This paticular Twitter...
iphone
[8]
3,093,649
3,093,650
jQuery hover opacity IE8
<p>This is for a thumbnail - a simple opacity set then hover function.</p> <p>What am I missing? This is working in most browsers (including IE7) but in IE8 I get nothing.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { // set opacity on page load $(".image-thumb").css("opacity...
jquery
[5]
5,159,118
5,159,119
How to run a method in a loop only once?
<p>I'm using a switch as a state manager for my XNA game. The switch is a part of main update method, so it's run every frame. Sometimes I need to set a timer value and it should only be set once per method call. There are multiple methods that set the timer per case, so it can't use the current and previous state numb...
c#
[0]
5,083,619
5,083,620
How to unify redundant tuples of a dictionary?
<pre><code>t = ({'x':1}, {'x':1}, {'y':2}) </code></pre> <p>I am unifying it using:</p> <pre><code>l = [] for i in t: if i not in l: l.append(i) tuple(l) </code></pre> <p>gives the result <code>({'x': 1}, {'y': 2})</code></p> <p>Is there any better way for that?</p> <p>Another Sample Input = <code>({...
python
[7]
5,565,834
5,565,835
C++ basic type wrappers
<p>I'd like to make some basic wrapper classes around simple types in C++. Since you can't just inherit from base types like you should be able to, I'm just using a wrapper class. The problem is, I want to be able to cast directly to that type, since that cast would be totally valid. The compiler just doesn't let yo...
c++
[6]
3,680,033
3,680,034
ASP.NET Question: Request.Url.Host property
<p>Does this property return, e.g., www1.domain.com, www2.domain.com, etc.</p> <p>And if there is any exception?</p> <p>Thanks.</p>
asp.net
[9]
2,850,856
2,850,857
Can not insert css image into pseudo :before
<p>I am trying to insert a background image into a header:before element, but jquery fails.</p> <p><strong>HTML</strong> content </p> <pre><code> &lt;a href="image.jpg" class="image-source"&gt;Try insert image into .header:before&lt;/a&gt; </code></pre> <p><strong>JS</strong></p> <pre><code> $('.i...
jquery
[5]
753,756
753,757
Return values from one script to another script
<p>I have the following script that will run each script (sequentially) in a directory:</p> <pre><code>import os directory = [] for dirpath, dirnames, filenames in os.walk("path\to\scripts"): for filename in [f for f in filenames if f.endswith(".py")]: directory.append(os.path.join(dirpath, filename)) fo...
python
[7]
711,138
711,139
Hide a character in text with jQuery?
<p>I want to change some text which says 'Name:' to 'Name'. In other words, I just want to hide the ':'.</p> <p>Can jQuery select a character or word within a div? If so it would be easy to hide the ':' character or if needs be replace the text to same word but without that character.</p> <p>Thanks </p>
jquery
[5]
4,461,163
4,461,164
how to customize subview that supports only landscape mode
<p>i have one view with 4 subviews.</p> <p>my application will supports both portrayed and landscape modes.</p> <p>Among the 4 subviews,one of the view is support only for portrayed.</p> <p>how can i done this.</p> <p>Thank u in advance. </p>
iphone
[8]
2,500,749
2,500,750
appending a string to another string
<p>I have 2 lists :</p> <p>list1 contains "T" "F" "T" "T"</p> <p>list2 contains "a" "b" "c" "d"</p> <p>I want to create a third list such that I append element1 in list1 to element1 in list2.</p> <p>So list3 would be the following: "Ta" "Fb" "Tc" "Td"</p> <p>How can i do that?</p>
python
[7]
6,025,802
6,025,803
jQuery version issue causes menu to stop working in IE 6
<p>I found a nice multi-level menu that I would like to use because it's cross-browser friendly AND it works in IE 6. However, it only works correctly in IE 6 with jQuery versions up to 1.3.2. Newer versions cause a problem that prevents the sub-sub-menu items to stop working. There must have been a change in jQuery 1....
jquery
[5]
5,118,358
5,118,359
How to sort 3D array in c#, with each row is specific to one entry if 1D array?
<p>Please guide me as how to sort an array with taking into consideration that each row is specific to one specific column value. For example,</p> <p>1D array<br> 5<br> 3<br> 4 </p> <p>2D array<br> 1,2,3<br> 3,4,5<br> 6,7,8 </p> <p>In above example,let say, 5 (In 1Darray) is associated with the first ...
c#
[0]
1,175,238
1,175,239
User login before executing Java app
<p>I'm trying to create a login before users use my Java app and I'm stuck. I've made a file called login.php on my website (wordpress user database) but I'm confused as what to do on the Java end. Basically I want it to log in, and then check to see if they have permissions to use the specific app.</p> <p>The PHP is ...
java
[1]
1,251,671
1,251,672
Search box on top like browser
<p>How can I place the search box to stay on the top like in the default browser in android? I don't mean search widget, I mean a search dialog that are persistant on the top of the activity.</p>
android
[4]
324,152
324,153
Set selected radio from radio group with a value
<p>Why am I struggling with this?</p> <p>I have a value: 5</p> <p>How do I check the radio button of group "mygroup" with the value of 5?</p> <pre><code>$("input[name=mygroup]").val(5); // doesn't work? </code></pre>
jquery
[5]
5,814,105
5,814,106
dependency between singletons in different assemblies
<p>singleton B initializes singleton A. singleton A has no knowledge of B. How can we use A and be sure that B has done its initialization routine first? </p> <p>B and A are in different assemblies and are maintained by different teams.</p> <p>Trying to keep the implementations completely seperate.</p> <hr> <p>T...
c#
[0]
5,530,400
5,530,401
Unique number list
<p>I have an HTML form from which a user selects numbers using checkboxes. The numbers are put into an PHP array like this:</p> <pre><code>&lt;input type="checkbox" name="formnumber[]" value="1" /&gt; </code></pre> <p>There are 24 numbers to pick from 1 to 24. I want to output a list of 10 unique lines with 5 unique ...
php
[2]
3,331,096
3,331,097
What are helper objects in java?
<p>Hi I come across few of the times called helper objects... can anybody elaborate what are those helper objects and why do we need them?</p>
java
[1]
3,482,396
3,482,397
www.domain.com not displaying website but www.domain.com/index.php displays it correctly
<p>I have a Php website and I recently renewed the domain and hosting. When I checked www.domain.com it it not displaying website but when I check for www.domain.com/index.php displays it correctly.. what shall I do to make this correct.</p>
php
[2]
4,242,787
4,242,788
Drag and drop/ dropping elements issue
<p>Hello i am developing a shopping cart and i would like to send values to each of my fields in the basket. I have the example here: <a href="http://jsfiddle.net/ckSPG/1/" rel="nofollow">http://jsfiddle.net/ckSPG/1/</a></p> <p>I would like the data to be organized:-? </p> <pre><code>$(function() { $(".dragga...
jquery
[5]
3,324,463
3,324,464
Python math output incorrect
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1787249/why-doesnt-this-division-work-in-python">Why doesn&#39;t this division work in python?</a> </p> </blockquote> <p>A simple problem I'm having (I Think) The following statement:</p> <pre><code> print (...
python
[7]