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
5,411,470
5,411,471
How to strip dashes out of file basename and display using php?
<p>I'm trying to list links to all the files in a folder on my web site by including the code below in the index page in that folder. </p> <p>Using this code outputs file names that look like this <code>name-of-file</code> which are linked to <code>name-of-file.html</code>.</p> <p>Now how do I modify the code below t...
php
[2]
1,277,635
1,277,636
C++: Declare a global class and access it from other classes?
<p>I have a class which should be declared globally from main() and accessed from other declared classes in the program, how do I do that?</p> <pre><code>class A{ int i; int value(){ return i;} }; class B{ global A a; //or extern?? int calc(){ return a.value()+10; } } main(){ global A ...
c++
[6]
2,614,568
2,614,569
How to create a modal popup window with external file in Javascript?
<p>I am currently working on a website and I want to create a modal popup window in JavaScript. The problem is, I want to pull the contents of the window from a separate .html file and not from a hidden div on the page (this is how most of the examples I have seen show you how to do it).</p> <p>I would really apprecia...
javascript
[3]
2,980,207
2,980,208
Finding specific string within a string, and recombining them
<p>Trying to figure this out and am just getting lost. What I am trying to do...</p> <p>I have a program that takes a tarot card and gives the user the meaning. So the code passes the card selected as "One of Cups" but the image files names are formatted as "1ofCup" - so I am trying to get the program to check for ...
php
[2]
4,906,364
4,906,365
I am getting HTML response through web service
<p>I am getting HTML response through web service and i want xml from web method,i am using TBXML xml purser, its occur occasionally.like as</p> <p>The resource cannot be found.body{font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}p {font-family:"Verdana";font-weight:normal;color:black;margin-top:...
iphone
[8]
3,603,261
3,603,262
Memory allocation/reference comparison for ints and Integers
<p>With the following:</p> <pre><code>String a = new String("test"); String b = "test"; System.out.println(a == b); //false </code></pre> <p>We get false, since <code>String a</code> is an object, so <code>a</code> points to a different location in memory than the string literal, <code>b</code>. I wanted to see how ...
java
[1]
4,880,780
4,880,781
How to access a variable in an object from a member object's function
<p>Ok, I have a class:</p> <pre><code>class class1 { public: class2 object2; int a; }; </code></pre> <p>where:</p> <pre><code>class class2 { public: void function2(); }; </code></pre> <p>Basically, I need function2 in object2 to be able to access "a." How would I go about doing this? Thanks.</p>
c++
[6]
1,968,376
1,968,377
How to Force close all Applications Running in the Backgroung of the phone Programatically?
<p>I want to force close all applications running in the background of the phone after Every 2 seconds.How to do that?I found a lot here on SO as well as on Google Still not got the right Solution yet.So Please someone help me for my this issue.</p> <pre><code>activityManager = (ActivityManager) getSystemService(Conte...
android
[4]
4,057,267
4,057,268
Horizontal view switching like in the official Google plus app
<p>Anyone have a code sample of horizontal view switching like in the official Google plus app. Im mean were you switch between Nearby - Circles - Incomming in the Stream view.</p>
android
[4]
5,951,469
5,951,470
Enum internationalization exception
<p>I have an enum and I tried to internationalize it like:</p> <pre><code>public enum ActivityEnum { PROJECT_CREATED, PROJECT_EDITED, PROJECT_DONATION; @Override public String toString() { switch (this) { case PROJECT_CREATED: return Messages.get("activity.project.created"); case PROJECT_EDITED: ...
java
[1]
160,011
160,012
Automatically increment filename
<p>Right now, this is my code</p> <pre><code>int number = 0; DirectoryInfo di = new DirectoryInfo(scpath + @"Screenshots\"); if (di.Exists) { } else { di.Create(); } int screenWidth = Screen.GetBounds(new Point(0, 0)).Width; int screenHeight = Screen.GetBounds(new Point(0, 0)).Height; Bitmap bmpScreenShot = new ...
c#
[0]
3,659,187
3,659,188
iPhone:Streaming feed URL sample?
<p>I have a media streaming code like below for playing streaming video. I want to test it with some working streaming url feed on iOS 4 devices. Could someone provide me the exact sample streaming video feed if anything is available for iPhone supported? So that, i can test this code and make sure it works well, thoug...
iphone
[8]
80,545
80,546
Cannot create test condition after using nextLine()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/767372/java-string-equals-versus">Java String.equals versus ==</a> </p> </blockquote> <p>I have been having difficulties using nextLine() to get a string, and then use it as a test condition (either in an if sta...
java
[1]
5,008,463
5,008,464
Set multiple textview android in single listview
<p>I am able to send and receive message xmpp client and display them in listview in corresponding layouts. When i send or receive message. I get both the sent and received message combined in a single textview on different layouts.I need to display them in different layouts's textview. i want to display received mess...
android
[4]
3,134,764
3,134,765
Double PopUP Onclick IE8
<p>I have the following code</p> <pre><code>&lt;script&gt; function Results() { document.report_form.action = "index.php?p=report_view"; document.report_form.target = "_blank"; document.report_form.submit(); return true; } function CSV() { ...
javascript
[3]
1,310,200
1,310,201
File Layout Exception
<p>I'm writing a java Application that can open and edit files. But I want it to give me an error if the layout of the file isnt as it should be. My file looks like this:</p> <pre><code>Title X Y Name X times line </code></pre> <p>If looked into try and catch but that doesnt give me the right solution to give an erro...
java
[1]
2,261,030
2,261,031
PHP have syntax like this: $expr= $a || $b
<p>In javascript I can do:</p> <pre><code>$a= $b || $c </code></pre> <p>if $b is null or empty then $a=$c, else $a=$b.</p> <p>there is somthing like that in php?</p> <p>i tried:</p> <pre><code>$a=$b &amp;&amp; $c </code></pre> <p>but I get $a=true or false, not the value of $b or $c.</p>
php
[2]
2,660,691
2,660,692
How can I found a specific data in jpg image file by PHP
<p>I have a very much of jpg images, these images are copy of contract. and i need PHP script that can check these images if it had a fingerprint and stamp and barcode and image of person. Thanks in advance.</p>
php
[2]
1,166,226
1,166,227
asp.net After a Server.Transfer how do you get the path of the current page?
<p>To get the url of the current page, I usually do something like this:</p> <pre><code>string path = Request.Path; </code></pre> <p>If I do this after a Server.Transfer then I get the path of the page where the transfer was done. How can I get it for the current page?</p> <p>For example:</p> <p>On Page1.aspx I do...
asp.net
[9]
2,460,645
2,460,646
Passing Parameters via URI in Android
<p>Is it possible (or recommended) to pass parameters to content providers via URIs in Android, similar to how web addresses use them? That is to say, can I use name/value pairs in content:// URIs?</p> <p>For example, I have a search provider that can search based on names. I pass it a URI like this:</p> <p>content...
android
[4]
935,356
935,357
click admob ad and forbid push up window
<p>I have an app which has an admob ad. When users click the ad, it will push up a window. Is it possible to go to the web page directly rather than push up a window?</p> <p>Welcome any comment</p>
iphone
[8]
3,387,297
3,387,298
How can I find last <td> in table with PHP
<p>I wonder how can i find out last in table with PHP, aka if that is last then i want to apply different style and content to it.</p> <p>This is part of my code generating table content.</p> <pre><code> $content .= '&lt;/tr&gt;'; $totalcols = count ($columns); if (is_array ($tabledata)) { foreach ($tab...
php
[2]
794,336
794,337
How do I pass the value of a variable to an specific page element with solely javascript?
<p>Let's say I have:</p> <p>var url="http://www.google.html";</p> <p>how do I put the url variable value as the href value of an specific anchor tag in the page? I know about str.link() but how I can use that with an specific element? and can I use link*( to build anchors of images? That didn't seem to work for me. T...
javascript
[3]
3,365,980
3,365,981
Jquery - .click() is not launched after first attempt
<p>I have a div containing 3 input fields and a button. When the button is clicked, my js launched. My JS checks for input that have empty values and puts them with a red background. Everything working fine. My problem is as follows. Lets imagine the following situation: I just input the the 2 first input fields and cl...
jquery
[5]
985,723
985,724
Java-String is never read error!
<p>This is driving me insane! Here's the code:</p> <pre><code>public static void main(String[] strings) { int input; String source; TextIO.putln("Please enter the shift value (between -25..-1 and 1..25)"); input=TextIO.getInt(); while ((input &lt; 1 || input &gt; 25) &amp;&amp; (input &lt;-25 || in...
java
[1]
3,988,225
3,988,226
Why can't you declare a static struct in C#, but they can have static methods?
<pre><code>// OK struct MyStruct { static void Foo() { } } // Error static struct MyStruct { } </code></pre>
c#
[0]
3,905,090
3,905,091
How to write the codes of LFU for Simplescalar?
<p>I am still new in Simplescalar and also in programming. Do anyone know how to write the codes to implement Least frequently used policy in Simplescalar? </p> <p>It is a urgent!</p>
c++
[6]
4,181,835
4,181,836
Application Is stop if i pressed Back Button In Android
<p>i have created one application it contains Progress bar with maximum limit.if i press start for starting my progress bar progress bar starts in background and got message box in application only. But if i press BACK button then my application get stop.. i want my application running in background though i press BAC...
android
[4]
2,959,255
2,959,256
Why isn't there a getContentView() method for Activity?
<p>The Activity class has a setContentView() method. The PopupWindow Class has a getContentView() method but nothing else does. Is there another way to get the main content view for an activity?</p>
android
[4]
2,339,519
2,339,520
How to specialize a given template for a template
<p>Is it possible to specialize this template for any basic_string's?</p> <pre><code>template&lt;class T&gt; struct X {}; </code></pre> <p>Since basic_string is a template itself, I know this would be a solution:</p> <pre><code>template &lt;template &lt;class, class, class&gt; class T&gt; struct X {}; template &lt;&...
c++
[6]
5,946,548
5,946,549
Insert several chars instead of one into string
<p>I have a string with expression. For example the string is "a + b". I need insert float variables instead of that characters. "a" = 2.4494 and "b" = 5.545466. I convert variables to string and then make from strings with expression and with values char arrays.</p> <pre><code>expr = expressions.get(i)[0]; // string ...
java
[1]
928,114
928,115
Finding all classes that implement C# interface - Similar to Java
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/26733/getting-all-types-that-implement-an-interface-with-c-3-5">Getting all types that implement an interface with C# 3.5</a><br> <a href="http://stackoverflow.com/questions/927861/how-to-find-what-classes-implem...
c#
[0]
1,193,999
1,194,000
jQuery - Traversing the DOM
<p>Here is my HTML:</p> <pre><code> &lt;li&gt; &lt;div class="menu_inner"&gt; &lt;a href="#"&gt; &lt;div class="button"&gt;&lt;img class="486" src="images/portalbutton.png" /&gt;&lt;/div&gt; ...
jquery
[5]
4,283,258
4,283,259
Animate Jquery addClass on hover
<p>I'm new to Jquery so unsure how i would go about editing the code below to create a fade in when the class element is hovered over.</p> <pre><code> &lt;script type="text/javascript"&gt; &lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!-- $(function() { $('div.work-item').hover(function() { }).hover(function() { $(...
jquery
[5]
2,364,836
2,364,837
rebuild a code from a decompiled java code
<p>how to rebuild a code from a decompiled java code and how to modify the classes whose name contains $ to suit the application</p>
java
[1]
2,231,336
2,231,337
C# how to populate a string, IList, or Array through if statement
<p>I have the following code:</p> <pre><code>foreach (string file in FleName) if (!ActualFiles.Any(x =&gt; Path.GetFileName(x).Equals(file))) { IList&lt;string&gt; MissingFiles = file; } </code></pre> <p>I have 3 if statements that access this...
c#
[0]
2,348,049
2,348,050
how does compareTo and compare work?
<p>I know that compare and <code>compareTo</code> returns an <code>int</code> value.</p> <p>For example:</p> <pre><code>Returns 0 if a equal b -1 if a &lt; b +1 if a &gt; b </code></pre> <p><code>sort</code> method makes a call to either <code>compareTo</code> or <code>compare()</code> methods. But how does <code>so...
java
[1]
5,241,993
5,241,994
running a compiled java program on linux
<p>I use eclipse for developing my applications.</p> <p>I have 2 java files, one is main and one is class that is used by main. In eclipse, I just execute as java program and it works. (default package).</p> <p>Now I just want to run this program on linux and other windows. How do I run it? if you can point to me a t...
java
[1]
2,093,668
2,093,669
C# Product Calculation Tool
<p>I am looking to implement a product calculation tool into my web site and I am looking for advise on possible tutorials/web links people may have to help with this. The tool will be used for a joinery website. What I am wanting the form to do is add values from different drop down lists and produce a quote price.</p...
c#
[0]
3,749,818
3,749,819
How to implement two queries within one MySQL statement?
<p>how to implement two queries within one MySQL statement? </p> <p>for example coding</p> <pre><code>&lt;?php var query=mysql_query("INSERT INTO adminDetails (user_name) VALUES ('uma');SELECT * FROM adminDetails"); ?&gt; </code></pre> <p>The above sql is giving result.but i used the same concept in below statement ...
php
[2]
3,528,139
3,528,140
is jquery a problem for large scale sites?
<p>can jquery be a problem for large scale sites in relation to something like facebook, where a huge number of visits hit the site or the site containing a great amount of content?</p>
jquery
[5]
4,203,255
4,203,256
php shipping charges api
<p>I want to use one api that will calculate shipping charge automatically &amp; return me the price. please give me solution with one example of api which you will give because i dont know how to use it.</p> <p>thank you </p>
php
[2]
3,409,525
3,409,526
Async methods in C#
<p>I have several process that need to run in the background of a Windows Forms application, because they take too much time and I do not want to freeze the user interface until they completely finish, I would like to have an indicator to show the process of each operation, so far I have a form to show the progress of ...
c#
[0]
1,749,816
1,749,817
Caching problem with a web view activity
<p>The activity launched is a webview activity.when i login first time then shows the login page but when logged on second time then the web view cache the pervious login and shows me the homepage instead it should be showing a login page again.i don't have a logout button in my web view.</p> <pre><code>switch (v.getI...
android
[4]
2,713,565
2,713,566
Want to check if my banner was clicked - admob
<p>i've a added a banner using AdMob,</p> <p>I want to check if it was clicked.</p> <p>this is my code:</p> <pre><code>public class CalcActivity extends Activity { private AdView adView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a...
android
[4]
3,413,586
3,413,587
Is device deployment enough to simulate application update?
<p>The application update process via app store (on the device by a lambda user) is not very well documented. I've sum up all this to these questions :</p> <ul> <li>what happens when the user updates his app? Is everything erased, or just some part of the app?</li> <li>so what is kept, what is not kept?</li> <li>how t...
iphone
[8]
346,202
346,203
What does x(); refer to?
<pre><code>var y = new w(); var x = y.z; y.z= function() { doOneThing(); x(); } </code></pre> <p><em>where <code>w</code> does not contain a <code>z</code> object but contains other objects (e.g, <code>a</code>, <code>b</code>, <code>c</code>)</em></p> <p>What is <code>x();</code> possibly referring t...
javascript
[3]
1,307,351
1,307,352
SQLiteOpenHelper won't fire onCreate
<p>I am using this code</p> <pre><code>public class PeopleDBHelper extends SQLiteOpenHelper { public static final String TABLE_NAME = "Person"; public static final String DB_PATH = "/data/data/com.machinarius.labs.preloadedsql/databases/"; public static final String DB_NAME = "preload-test.sqlite"; private static fin...
android
[4]
4,277,353
4,277,354
polymorphism in java
<p>is method overloading is a example of run time polymorphism? is method overloading example of compile time polymorphism?</p>
java
[1]
3,741,059
3,741,060
Filter Array Duplicates On Associative Value
<p>I've got an array:</p> <pre><code>( [0] ( [room_num] =&gt; 1 [is_event] =&gt; true [date] =&gt; '01/01/2013' ) [1] ( [room_num] =&gt; 2 [is_event] =&gt; false [date] =&gt; '' ) [2] ( [room_num] =&gt; 3 [is_event] =&gt; false [date] =&gt; '' ) [...
php
[2]
2,920,901
2,920,902
Jquery if checkbox is checked add a class
<p>I am trying to add a class when a checkbox is checked.</p> <p>My jquery:</p> <pre><code>$('input').attr("checked").change(function(){ $('div.menuitem').addClass("menuitemshow"); }) </code></pre>
jquery
[5]
5,876,652
5,876,653
Android Frame Animation
<p>I would like to know if it is possible to remove one of the frames I added using addFrame in Android?</p> <p>Thanks</p> <p>Kelvin</p>
android
[4]
2,249,015
2,249,016
PHP Undefined variable in Apache error_log
<p>I'm getting a series of:</p> <p>"Undefined variable: loginError in /Library/WebServer/Documents/clients . . ."</p> <p>entries in my Apache error_log which I would like to prevent. I have a simple login.php page which, if there's an error logging in sets the $loginError variable as such:</p> <pre><code>$loginErro...
php
[2]
5,947,258
5,947,259
How to change the url though php?
<p><Br> i want to change the url though php. <br> as we have </p> <pre><code>window.location.href = "http://www.something.com"; </code></pre> <p>in javascript. <br> I want to same thing but in php.<br> how to do that?<br> Thanks in advance.</p>
php
[2]
1,023,717
1,023,718
what are the steps need to consider to migrate Windows based applicaotin from 1.1 to .net 3.5
<p>can anyone tell me main steps to consider while migrating 1.1 to 3.5 windows based applicatoin?</p> <p>what are the steps need to consider at initially while planing for migration? as per i know this applicatin i need to migrate like wsf and wpf and soo on.</p> <p>thanks</p>
asp.net
[9]
3,257,149
3,257,150
Add/remove characters in python?
<p>I have two things I need this for, these should explain what I mean:</p> <ol> <li>To have a 'shell popup' of sorts, like <code>man</code> does, that can be removed when done</li> <li>To have a blinking ellipsis (...) for visual effect</li> </ol> <p>Is there any standard Python way to do this? Could I 'unprint' the...
python
[7]
3,730,696
3,730,697
What does it mean global namespace would be polluted?
<p><strong>What does it mean global namespace would be polluted?</strong></p> <p>I don't really understand this that global namespace getting polluted. Is this something related to garbage collection.</p>
javascript
[3]
1,815,033
1,815,034
Interface class with getter and setter in c#
<p>As I read here <a href="http://msdn.microsoft.com/en-us/library/75e8y5dd%28v=VS.100%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/75e8y5dd%28v=VS.100%29.aspx</a></p> <p>It is possible to put get in an Interface class BUT NOT set ?</p> <p>So if I want getter and setter in Interface I have to creat...
c#
[0]
1,123,366
1,123,367
isset($_COOKIE) is not working
<p>I am using the function set cookie to set (id) cookie like so:</p> <pre><code>$cookie_id = $insert_userid; setcookie("id", $cookie_id, time() + 31556926, '/', 'www.example.com'); </code></pre> <p>The code above is working fine. I am checking the setting with firefox and the correct cookie is there. Now on my other...
php
[2]
1,222,481
1,222,482
best way to make base uiviewcontroller iphone
<p>I an making an app which has many different uiviewcontrollers but they share the same functionality. I am going to make a basecontroller so the other classes extend this. However there are about 5-7 variables that I need to provide to the basecontroller. What is the proffered way to do this? Making a constructor tha...
iphone
[8]
4,149,725
4,149,726
Asynchronous task
<p>I have created an asynchronous task like this:</p> <pre><code>private class LongOperationcheckall extends AsyncTask&lt;String, String, String&gt; { @Override protected String doInBackground(String... params) { String result="Start"; try { Looper.myLooper().prepare(); ...
android
[4]
5,931,045
5,931,046
a basic Text to speech app not working
<p>i tried the following on the emulator but the as the app starts it gives a runtime error . could someone please help me on this . Heres' the code i tried </p> <pre><code>package com.example.TextSpeaker; import java.util.Locale; import android.app.Activity; import android.content.Intent; import android.os.Bundle; i...
android
[4]
923,991
923,992
BufferedReader reads only 61 bytes
<p>i wanna read a 90kb file (which apparently equals approximately 90,000 bytes) using Java's BufferedReader, but it stops after only 61 bytes. The file's alright, I've checked it using an HexEditor.</p> <pre><code>private ArrayList&lt;byte[]&gt; readAsBytes(String dir, String filename, int lineCount) { /** Read f...
java
[1]
1,213,284
1,213,285
How to do Gridview Datakey value at @nd page of gridview?
<p>The Problem is:</p> <p>i have a gridview to bind with 20 records &amp; its allowpaging is true,but pageindexchanging event is not fired &amp; pagesize is10</p> <p>&amp; on rowdatabound of gridview i get datakey value for first 10 records but not get the datakey value for next 10 records(i.e. 2nd page)</p> <p>&am...
asp.net
[9]
1,565,989
1,565,990
how to downgrade project from android2.2 to android 2.1 ?
<p>I have my android project running on android 2.2 . I want it to work on android 2.1 . How do I do that ?? Changing the target sdk in manifest file did not help . I tried to clean the project but it deleted my R.java file. Plz suggest urgently.</p>
android
[4]
3,293,734
3,293,735
ASP.NET getting viewstate in global.asax
<p>Is it possible to get at the viewstate in the global.asax file? I am having a problem with viewstate on some clients and I want to log what the viewstate is in the Application_Error event.</p>
asp.net
[9]
359,104
359,105
How to send text area content to next page via post method?
<p>I got a textarea that has some html code in it. I want to send the content of this textarea without any change to next page via post method. </p> <pre><code>&lt;html&gt; &lt;form id="myform" name="myform" action="./getdata.php" method="post"&gt; &lt;td&gt;&lt;textarea rows="7" cols="15" name="outputtext" style="wi...
php
[2]
4,358,438
4,358,439
Android - Simplifying Radicals
<p>I am trying to make a calculator that performs the quadratic formula. </p> <p>Currently if my result would be a decimal it returns NaN. (EDIT: Resolved)</p> <p>Preferably I would like the result to be in an simplified radical form (i.e. √(99) = 3√(11) ).</p> <p>How would I go about achieving this?</p> <p>This is...
java
[1]
2,632,372
2,632,373
Passing form name and form object names to functions
<p>I'm having trouble understanding the workings of Javascript...I want to pass a form name and the submit button name so that the function can evaluate a passed value and either enable or disable the submit button. </p> <p>It works if I explicitly use the names but I'd like it to work dynamically. Unfortunately I j...
javascript
[3]
2,573,224
2,573,225
Android: how to make a ListView that looks similar to Preferences?
<p>I do not want to use the framework provided Preferences, rather I would like to create a ListView that looks similar. In particular, I would like it to use the same font size and style for the TextViews.</p>
android
[4]
8,906
8,907
How to reduce this code?
<p>Is there any way to shorten this code:</p> <pre><code>$resultCategoryName = mysql_query("SELECT ecname FROM electioncategorymaster WHERE ecid=".$Category); $rowCategoryName = mysql_fetch_row($resultCategoryName); $CategoryName = $rowCategoryName[0]; </code></pre>
php
[2]
4,464,338
4,464,339
Working with Excel ? In Asp.net?
<p>In web application, i write the code for displaying the data in excel sheet to gridview. it is working fine but, can i track the sheet name of that particular excel sheet. For example i have sample.xls in that how can i find the sheet name. i write the query like this</p> <pre><code> OleDbCommand cmd = new OleDb...
asp.net
[9]
2,502,220
2,502,221
embedding php pchart on page
<p>How can I get a pchart in a specific location on my html page? right now when I follow the example and use </p> <blockquote> <p>$myPicture->autoOutput();</p> </blockquote> <p>It just overwrites my entire page and just shows the graph.</p> <h2>edit. 4:32pm</h2> <p>Looking at the pChart source I found inside pIm...
php
[2]
596,798
596,799
How to tell java.lang.String.split to skip the delimiter?
<p>as input my program gets a String containing IP Addresses are separated by a line delimiter, i.e. one IP Address per line. To validate each of the addresses I do:</p> <pre><code>String[] temp; temp = address.split(System.getProperty("line.separator")); </code></pre> <p>and then I loop though the array of Strings.<...
java
[1]
5,170,699
5,170,700
is this valid javascript?
<p>I am new to javascript, but is this valid?</p> <pre><code>&lt;script type="text/javascript"&gt; if (condition()) { location = "http://example.com/foo/bar/baz"; } function condition() { if(something) return true else return false &lt;/script&gt; </code></pre> <p>I am trying to write a javascri...
javascript
[3]
3,803,038
3,803,039
System hang while using Apache-POI java library for reading an excel file
<p>I used Apache-POI java library for reading excel files, it worked well. I read about 100 cells of every excel file, then I close the excel file.</p> <p>The strange is when the excel file has large data, it will read the data successfully and then into another function system would crash. </p> <p>I would appreciate...
java
[1]
4,437,181
4,437,182
Passing variable between functions in JavaScript
<p>How can I pass the variable <code>word1</code> in the first function to the second function in pure JavaScript?</p> <pre><code>function functionOne() { var word1 = "dog" ; } function functionTwo() { var word2= word1; } </code></pre> <p>I've checked the other questions in stackoverflow on this subject but ...
javascript
[3]
559,209
559,210
jQuery Find Element Using Property
<p>I am using jquery to locate some elements from a table. The problem is that I might not know all the time the type of the element. That means an element can be a simple TD or a SELECT. But since both have text associated with it I want to retrieve the element if that has the text property. </p> <pre><code>$($(rows[...
jquery
[5]
5,342,758
5,342,759
how to identify whether X and y coordinates of touch lie with in range of bitmap image or not
<p>here is the code snippet to get bitmap and i am using Touch Event to get the coordinates</p> <pre><code>`BitmapDrawable drawable = (BitmapDrawable) view.getDrawable(); Bitmap bitmap = drawable.getBitmap(); float x=event.getX(); float y=event.getY();` </cod...
android
[4]
4,114,611
4,114,612
Count a certain file type in a zip file using php
<p>I want to be able to count a certain file type in a zip file with PHP.</p> <p>I have zip files with files that have a .ppml extension contained in them and need to find out how many are in each file without unzipping them.</p> <p>Thanks in advance for your help.</p>
php
[2]
1,662,592
1,662,593
Why do we include jQuery in the header?
<p>I was told not to mess with the core files. Also, I don't want jQuery to load on every single page.</p>
jquery
[5]
4,183,176
4,183,177
Which view touch event will get called + iPhone
<p><strong>First Scenario</strong> : Suppose we have a first view as FirstView. in this view(FirstView) we add another view(SecondView) having exactly same frame as FirstView as</p> <pre><code>[FirstView addSubView:SecondView]; </code></pre> <p>Now touch event of which view(FirstView or SecondView) will get called?</...
iphone
[8]
5,028,591
5,028,592
Recommended way to "load" javascript file dependencies?
<p>I have a priorityQueue class that depends on a set of heap functions being loaded. Currently they're in separate files, priorityQueue.js and fheap.js. I would like to do</p> <pre><code>&lt;script src="priorityQueue.js"&gt;&lt;/script&gt; </code></pre> <p>and have the fheap.js file automatically loaded (order doesn...
javascript
[3]
5,494,919
5,494,920
searching inside an array for a value
<p>Morning Guys</p> <p>im currently playing with javascript and am creating a simple black jack game, i want to keep track of cards which have already been pulled from the pack. heres my function</p> <pre><code>function usedCards(value,suit) { var exists = false; for(i = 0; i&lt; usedCardNo.length;i++) { if (v...
javascript
[3]
2,733,889
2,733,890
What's the difference when initializing an array declaration with a string literal and a list of distinct characters?
<pre><code>char short_string[] = "abc" char short_string[] = {'a', 'b', 'c'} </code></pre> <p>what I think is the difference is that the 2nd line is a switch statement and that it requires input from user (either a b or c as the 1st line is more of a statement.... is this right ?</p>
c++
[6]
122,180
122,181
JavaScript - Iterate through object properties
<p><strong>Beginners JavaScript</strong></p> <p><strong>Code</strong></p> <pre><code>var obj = { name: "Simon", age: "20", clothing: { style: "simple", isDouche: false } } for(var propt in obj){ alert(propt + ': ' + obj[propt]); } </code></pre> <p><strong>Question</strong></p> <...
javascript
[3]
1,522,150
1,522,151
"JNI WARNING: illegal start byte 0xff" why?
<p>I'm using reflection to get access to the native properties. However, the following code results in :</p> <pre><code>W/dalvikvm( 1714): JNI WARNING: illegal start byte 0xff W/dalvikvm( 1714): string: 'ÿÿÿÿÿÿÿÿ' W/dalvikvm( 1714): in Landroid/os/SystemProperties;.native_get (Ljava/lang/Stri...
android
[4]
3,235,350
3,235,351
Multiple 'endings' to a function - return an object, return a string, raise an exception?
<p>This one's a structure design problem, I guess. Back for some advice.</p> <p>To start: I'm writing a module. Hence the effort of making it as usable to potential developers as possible.</p> <p>Inside an object (let's call it <code>Swoosh</code>) I have a method which, when called, may result in either success (a n...
python
[7]
816,997
816,998
Why the IEnumerable.Except method doesn't return any elements?
<p>I'm generating two <code>IEnumerable&lt;int&gt;</code> objects:</p> <pre><code>var listA = model.SelectedFormats.Select(a =&gt; a.ID); //values: 1,2,4 var listB = basket.OrderPosition.Select(x =&gt; x.BookFormatTypeID); //values: 1,4 var result = listA.Except(listB); </code></pre> <p>but I can't see any results ...
c#
[0]
3,596,835
3,596,836
C++ Why is it calling the function with reference
<p>say i have the following C++ class.</p> <pre><code>class C { int foo() const; int &amp; foo(); }; </code></pre> <p>and i just call <code>myC.foo()</code>, i can see using the debugger that it calls the one with the reference.</p> <p>why?</p> <p>thanks!</p>
c++
[6]
5,632,120
5,632,121
asp.net division followed by formatting
<p>I have the following code:</p> <pre><code>&lt;tr&gt; &lt;td class="add_border_bold" nowrap="nowrap"&gt;Schedule Saved (days)&lt;/td&gt; &lt;td width="100%" class="add_border"&gt; &lt;%# Eval("schedule_saved_days", "{0:0,0}")%&gt; &amp;nbsp; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class...
asp.net
[9]
501,940
501,941
how to add, edit, delete and queries since other computer (with internet)
<p>this is my connection class, i know i am going to put the ip, or i am in a error ? the direction of internet? what do i go to put? can i do it with web service? what is the form easy for to do it? here my connection class...</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using Sy...
c#
[0]
4,123,327
4,123,328
how to invoke media scanner on button click in android
<p>Actually problem is that when i insert server images into Sdcard its gone and also display in sdcard but when i open phone Gallery it is not showing . I also use this code for invoke media scanner on button click .... </p> <pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+Envi...
android
[4]
3,648,937
3,648,938
Concurrency Problem in Java
<p>I am designing a client-server chat application in Java. This is a secure application where the messages are exchanged using cryptographic algorithms. I have one server and it can support many clients. My problem is that when one client logs on the server it works fine, but when another user logs into the system, th...
java
[1]
601,595
601,596
Put data between foreach() in PHP
<p>How can I put data between specific results in the foreach() function?, I have an array like this:</p> <pre><code>array('01:data1:data2:data3', '01:data4:data5:data6', '02:data1:data2:data3') </code></pre> <p>When I print the array with <code>foreach()</code> I want to put html code between each number, like:</p> ...
php
[2]
1,429,466
1,429,467
Version of python to learn, revisited
<blockquote> <p><strong>Possible Duplicate:</strong><br /> <a href="http://stackoverflow.com/questions/170921/to-learn-python-2-then-3-or-3-from-the-start">To learn python 2 then 3, or 3 from the start?</a> </p> </blockquote> <p>I started learning python in 2.6 but didn't get as far as I would have liked before g...
python
[7]
782,103
782,104
Use markitup or masked input plugin (for example) on several elements, created after page loading?
<p>Here is a small example with the masked input plugin :</p> <pre><code>//apply the mask to an input $('.st').live('click', function() { $(this).mask("99:99"); }); </code></pre> <p><code>.st</code> is a text input with a td, the use can clone the td. However, when you clone this td, and try to click in the <code>....
jquery
[5]
1,669,187
1,669,188
compare and select classes by member function - a neat way
<p><strong>Given:</strong> </p> <ol> <li>a set of class instances (CL) and a reference instance (r)</li> <li>the class has several getters, such as 'getA', 'getB', ...</li> </ol> <p><strong>Todo:</strong> Find those instances from CL that match 'r' by comparing 'getA', 'getB', ... For good code, only one selection fu...
python
[7]
119,582
119,583
Convert 40px to sp
<p>What is the sp value for 40px? Please also tell the formula of conversion.</p> <p>I am trying to convert my font sizes present in psd into sp units for mdpi density i.e. 320*480 with 160 dpi</p>
android
[4]
769,656
769,657
Dynamic VariableFromString in objective C
<p>I want to dynamically create variable from string in objective C.</p> <p>Like <code>NSClassFromString</code> thats way. In that I want to access variable.</p> <p>Any idea about this?</p>
iphone
[8]