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,205,588
5,205,589
Error while placing a spinner inside Activity Group
<p>I have an activity group containing 3 activities. When a button is pressed, I enter into this activity group and show the 1st activity. From the 1st activity I can goto 2nd activity and from 2nd activity I can goto 3rd activity.</p> <p>I have a spinner in this 3rd activity layout. Problem is I am not able to click on that spinner. Error gets displayed showing:</p> <pre><code>12-31 11:29:41.082: ERROR/AndroidRuntime(474): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43791b18 is not valid; is your activity running? </code></pre> <p>How can I solve this issue? Can anyone plz help...</p> <p>Hi,</p> <p>Please find the code for spinner attached:</p> <pre><code>setContentView(R.layout.requestinfo); Spinner spinner = (Spinner) findViewById(R.id.spinner); ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource( PGDealerInfoRequestActivity.this, R.array.request_options, android.R.layout.simple_spinner_item); spinner.setAdapter(adapter); </code></pre> <p>Inside requestinfo.xml,</p> <pre><code>&lt;Spinner android:id="@+id/spinner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/darker_gray" android:textSize="12sp" android:textStyle="bold" android:layout_marginLeft="10dp" android:layout_marginTop="8dp" /&gt; </code></pre>
android
[4]
3,574,511
3,574,512
null test versus try catch
<p>Does anyone have metrics on performing null test versus wrapping code in a try catch?</p> <p>I suspect that the null test is much more efficient, but I don't have any empirical data.</p> <p>The environment is C#/.net 3.x and the code comparison is:</p> <pre><code>Dude x = (Dude)Session["xxxx"]; x = x== null ? new Dude(): x; </code></pre> <p>versus</p> <pre><code>Dude x = null; try { x = (Dude)Session["xxxx"]; x.something(); } catch { x = new Dude(); } </code></pre> <p>are there any advantages to wrapping in try catch?</p>
c#
[0]
1,038,476
1,038,477
What does f means in animation
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4659517/what-does-suffix-f-mean-in-android-programming">What does suffix ‘f’ mean in Android programming?</a> </p> </blockquote> <p>Excuse me if it was a stupid question, but I always see people writing something like 350f and 15f when initializing animations (passing as paramter) . What does f mean? Thank you</p>
android
[4]
3,710
3,711
get start point and end point of user selection
<p>I am trying to get the starting and ending points of user selection. This is the content of a DIV that I have</p> <pre><code>abc def ghi jkl mno pqr stuv wxyz </code></pre> <p>When I select <code>pqr</code> The starting point becomes 1 and the ending point becomes 4 which is wrong</p> <p>When I select the whole thing, the starting point becomes 0 and the ending point becomes 33 which is right</p> <p>I have the following code:</p> <pre><code> sel = window.getSelection(); le = sel.toString().length; if (sel.getRangeAt &amp;&amp; sel.rangeCount) { range = window.getSelection().getRangeAt(0); sp = range.startOffset; ep = sp + le; } </code></pre>
javascript
[3]
3,527,116
3,527,117
how to add thead to my grid in jquery
<p>i have my grid like this in jquery</p> <pre><code>success: function(result) { $('#MyGrid tbody').append('&lt;tr&gt;&lt;td&gt;' + result.FileName + '&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="#" class="remove"&gt;Remove&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;'); } </code></pre> <p>now i want to add thead to MyGrid to which i need to add style property and inside thead i also need to add tr having style property. as like </p> <pre><code> &lt;thead style=""&gt;&lt;tr style=""&gt;&lt;/tr&gt;&lt;/thead&gt; </code></pre> <p>through jquery</p> <p>also i need to remove that thead in another jquery function. so could you please provide me how to add thead and delete that thead in jquery which has tr inside it.</p> <p>thanks, michaeld</p>
jquery
[5]
3,549,658
3,549,659
Is it possible in python to define functions outside of a programs main namespace and add them for easy access like a .h file in c?
<p>I don't want to really define my own PyObject. I want to have functions available for use within a program, but I don't have a need for class instances and don't want to prefix the fuction call with the name of the module import.</p> <p>As an example of what I don't want</p> <pre><code>import coke coke.make(data) </code></pre> <p>Now an example of what I do want</p> <pre><code>import coke make(data) </code></pre> <p>Is such possible in Python?</p>
python
[7]
4,671,504
4,671,505
jet.OLEDB.4.0 provider Error that i get
<p>i try to install my C# program on Windows 7 64bit</p> <p>i installed Access too</p> <p>and i got this error:</p> <pre><code>The Microsoft.jet.OLEDB.4.0 provider is not registered on the local machine </code></pre> <p>that can be the problem ?</p> <p>thank's in advance</p>
c#
[0]
1,133,848
1,133,849
Validate CreditCard Number and checked radio button javascript
<p>I have radio buttons radioVisa, and radioMaster. If either one is checked, I need to first check to see which one is selected and then validate that the card number entered is valid. I also need to make sure that only numbers are entered.... I am not allowed to use any regular expression techniques.... If the radioVisa is checked, it seems to work but when I added the code for the radioMaster, if it is checked it does't work.... Can someone tell me what I am doing wrong please....</p> <pre><code>function isValidCardNumber(num, isVisa, isMaster){ var card = new Array(); if (document.getElementById('radioVisa').checked){ card = isVisa; } if (num[0] != '4' || num.length != 16 ){ return false; } else { return true; } else if (document.getElementById('radioMaster').checked){ card = isMaster; } if (num[0] != '51' || num[0] != '52' || num[0] != '53' || num[0] != '54' || num[0] != '55' || num.length != 16 ){ return false; } else { return true; } </code></pre>
javascript
[3]
2,059,552
2,059,553
How to pass variable to double metaphone function
<p>I've downloaded the double metaphone function: <a href="https://github.com/dracos/double-metaphone" rel="nofollow">https://github.com/dracos/double-metaphone</a></p> <p>It' supposed to work like this: </p> <pre><code>&gt;&gt;&gt; dm(u'aubrey') ('APR', '') &gt;&gt;&gt; dm(u'richard') ('RXRT', 'RKRT') &gt;&gt;&gt; dm(u'katherine') == dm(u'catherine') True </code></pre> <p>How do I pass a variable to this function? The u is always in the way. I need to be able to do</p> <pre><code>dm(x)==dm(y) </code></pre> <p>right now this is what happens:</p> <pre><code>&gt;&gt;&gt; x='wal mart' &gt;&gt;&gt; y='wall mart' &gt;&gt;&gt; dm(x)==dm(y) Traceback (most recent call last): File "&lt;pyshell#35&gt;", line 1, in &lt;module&gt; dm(x)==dm(y) File "&lt;pyshell#18&gt;", line 6, in dm st = ''.join((c for c in unicodedata.normalize('NFD', st) if unicodedata.category(c) != 'Mn')) TypeError: normalize() argument 2 must be unicode, not str </code></pre>
python
[7]
86,985
86,986
How do I explicitly instantiate a template function?
<p>I have a template function with one argument. I have to instantiate that function without calling that function means explicitaly I have to instantiate.</p> <p>I have this function:</p> <pre><code>template &lt;class T&gt; int function_name( T a) { } </code></pre> <p>I instantiated that function like this:</p> <pre><code>template int function_name&lt;int&gt;(int); </code></pre> <p>But I got the following errors:</p> <pre><code>error: expected primary-expression before 'template' error: expected `;' before 'template' </code></pre> <p>Please can any one help me?<br> Thanks in advance.</p>
c++
[6]
5,836,602
5,836,603
How do I make the Pro version of my app replace or get rid of the free version?
<p>How do I make the Pro version of my app replace or get rid of the free version? after the user has downloaded and installed the Pro version... since I'm sure they wouldn't want both apps on the phone.</p>
android
[4]
220,742
220,743
Android id error
<p>I am new to android and having this same problem every time I do something. Whenever I put a line this line in any of my codes it gives me an error in "id". The error says, "id cannot be resolved or is not a field."</p> <p>What am I doing wrong?</p> <pre><code>myImageView = (ImageView)findViewById(R.id.imageview); </code></pre>
android
[4]
5,255,045
5,255,046
unable to use login session across pages in php
<p>I am unable to pass login session information to other HTML pages. Below is my login php code. I can successfully login but cant pass on the information to other pages like HTML home page and it gets opened though I am not logged in to same. I tried different codes for the same</p> <pre><code>&lt;?php require_once("config.php"); $email=$_POST['email']; $password=$_POST['password']; $email = stripslashes($email); $password = stripslashes($password); $email = mysql_real_escape_string(strip_tags($email)); $password = mysql_real_escape_string(strip_tags($password)); // Check occurence of email password combination $sql="SELECT * FROM register WHERE email='$email'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $email, table row must be 1 row if($count==1) { $row = mysql_fetch_array($result); if($password == $row['password']) { session_start(); $_SESSION['login'] = "1"; header("location:home.html"); exit; } else { echo "Please enter correct Password"; header("location:login.html"); session_start(); $_SESSION['login'] = '' exit(); } } else { header("Location:register.html"); exit(); } ?&gt; Below is the php snippet that I use at the top of my HTML page: &lt;?php require_once("config.php"); session_start(); if (!(isset($_SESSION['login']) &amp;&amp; $_SESSION['login'] != '')) { header ("Location: login.html"); exit; } ?&gt; </code></pre>
php
[2]
5,611,467
5,611,468
how get object element down?
<p>I need to get the object <code>test2</code> when I click on the element <code>test1</code></p> <pre><code>&lt;ul&gt; &lt;li id="test1"&gt;&lt;a href="javascript: void(0);"&gt;Label one&lt;/a&gt; &lt;ul id="test2"&gt; &lt;li&gt;&lt;a href="test.php"&gt;test&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li id="test3"&gt;&lt;a href="javascript: void(0);"&gt;Label two&lt;/a&gt; &lt;ul id="test4"&gt; &lt;li&gt;&lt;a href="test.php"&gt;test&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How do I get the object <code>test2</code> when I click on <code>li id="test1"</code> ?</p>
jquery
[5]
2,595,378
2,595,379
A simple class for getting and printing a string
<p>I have just started working with classes and in this code I'm trying to have a class which gets a string from the user, counts the length of it and then prints it. But I'm getting some errors that i can't understand what are they for. I would appreciate some help.</p> <pre><code>#include&lt;iostream&gt; using namespace std; class String { public: String(); // constructor void Print(); // printing the string void Get(); // getting the string from the user. int CountLng( char *); // counting length ~String(); // destructor private: char *str; int lng; } str1; String::String() { lng=0; str=NULL; } int CountLng( char *str) { char * temp; temp=str; int size=0; while( temp !=NULL) { size++; temp++; } return size; }; void String::Get() { str= new char [50]; cout&lt;&lt;"Enter a string: "&lt;&lt;endl; cin&gt;&gt;str; }; void String::Print() { cout&lt;&lt;"Your string is : "&lt;&lt;str&lt;&lt;endl&lt;&lt;endl; lng= CountLng( str); cout&lt;&lt;"The length of your string is : "&lt;&lt;lng&lt;&lt;endl&lt;&lt;endl; }; int main() { str1.Get(); str1.Print(); system("pause"); return 0; } </code></pre>
c++
[6]
5,064,742
5,064,743
Concatenating all elements in list into a string python
<p>This one should be quick but for some reason I can't think of it. So say I have a list of elements n length (the number of elements will change at some point in the future). However, let's use this one as an example: </p> <pre><code>['ESZ12', 'ESH13', 'ESM13', 'ESU13', 'ESZ13'] </code></pre> <p>Now what I would like is to output this into a string that looks like this:</p> <pre><code>("ESZ12", "ESH13", "ESM13", "ESU13, "ESZ13") </code></pre> <p>The first one is indeed a list of elements and the second is just a complete string.</p> <p>Thanks</p>
python
[7]
1,347,745
1,347,746
PHP class not found but it's included
<p>I'm including a PHP class with</p> <pre><code>require_once($ENGINE."/classUser.php"); </code></pre> <p>but when the code is executed i receive this error:</p> <blockquote> <p>Fatal error: Class 'User' not found in C:\xampp\htdocs\WebName\resources\engine\ajax\signup.php on line 12</p> </blockquote> <p>I still can't figure out what's the problem. I'm 99% sure it's correct.</p> <p>The "$ENGINE" is correct, and the class is correct too (Netbeans suggests me class methods and variables).</p> <p>signup.php:</p> <pre><code>&lt;?php /* Created on: 13/12/2011 * Author: * * Description: User signup procedure. */ require_once("../settings.php"); require_once($ENGINE."/classUser.php"); $user = new User(); $user-&gt;createUser($_POST["username"], $_POST["email"], $_POST["password"]); ?&gt; </code></pre> <p>classUser.php:</p> <pre><code>&lt;?php /* Created on: 13/12/2011 * Author: * * Description: This class manages users. */ require_once("settings.php"); require_once($LIBRARY."/cassandraphp/cassandra.php"); class User { public function createUser($username, $email, $password){ $cassandra = Cassandra::createInstance($CASSANDRASERVER); $cassandra-&gt;set( "user.".$username, array( 'ID' =&gt; uniqid(), 'Username' =&gt; $username, 'Email' =&gt; $email, 'Password' =&gt; $password ) ); } } ?&gt; </code></pre>
php
[2]
5,835,249
5,835,250
Do I need to set debug="false" in my ASP.NET web app before I use the "Publish Web Site" feature in VS 2005?
<p>Basically, what I'm wondering is if I need to set debug="false" before hitting the "Publish Web Site" button or if I can switch it after all the files have been published.</p>
asp.net
[9]
4,683,649
4,683,650
How can I load java class from database?
<p>like following source code:</p> <pre><code>package util.abc; public class Test{ public String out(){ return "Hello World!"; } } </code></pre> <p>I can using:</p> <pre><code>Class c = Class.forName("util.abc.Test"); </code></pre> <p>to get this Class,but I must to put this source file(<code>Test.java</code>) in ClassPath <code>/util/abc/</code></p> <p>I want dynamic load this class from database (store the source code as <code>string</code>,or <code>binary</code>)</p> <p>This is possible ?</p> <p>thanks for help :)</p>
java
[1]
3,015,749
3,015,750
PHP How can I fix this error? Fatal error: Cannot redeclare class iSerializable
<p>I am having a problem with detecting if an interface class is already declared</p> <p><em>Error reported is:</em></p> <p><strong>Fatal error: Cannot redeclare class iSerializable in /public_html/application/AppCode/iSerializable.interface.php on line 3</strong></p> <pre><code>line1: //nothing here line2: require_once($filename); line3: interface iSerializable { public function writeXML(DomDocument $doc, DomElement $element); } </code></pre> <p><strong>If this was a normal class, then i would have used this example function given below</strong> </p> <pre><code>if(class_exists('iSerializable') != true) { //put class iSerializable here } </code></pre> <p><strong>but here, this class is an Interface, how can i check if this interface is already declared?</strong> </p> <p>Can any one kindly suggest me a proper way or solution to this problem?</p>
php
[2]
34,562
34,563
get attribute value with javascript in select list
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10369241/use-created-attribute-with-javascript-in-select-list">Use created attribute with javascript in select list</a> </p> </blockquote> <p>im trying to access an attribute that i created in a select list.</p> <pre><code>&lt;script language="JavaScript"&gt; function updateUrl() { var newUrl = document.getElementById('test').getAttribute('car'); alert(newUrl); } &lt;/script&gt; &lt;select name= "test" id= "test" onChange= "updateUrl()"&gt; &lt;option value="1" selected="selected" car="red"&gt;1&lt;/option&gt; &lt;option value="2" car="blue" &gt;2&lt;/option&gt; &lt;option value="3" car="white" &gt;3&lt;/option&gt; &lt;option value="4" car="black" &gt;4&lt;/option&gt; &lt;/select&gt; </code></pre> <p>it keep giving me null. how do i get the value from attribute car?</p>
javascript
[3]
124,833
124,834
How to redirect in jQuery using POST instead of GET
<p>In my jQuery function I'm redirecting Using window.location.href like this:</p> <pre><code>window.location.href = "${pageContext.request.contextPath}/redirectUser.ajax?login="+response.result.name; </code></pre> <p>It works fine, but I see this String in browser like this:</p> <pre><code>http://localhost:8080/task7/redirectUser.ajax?login=user </code></pre> <p>My controller also uses GET</p> <pre><code>@RequestMapping (value="/redirectUser.ajax",method = RequestMethod.GET) public String forwardUserToUsersPage(ModelMap model, HttpServletRequest req){ User foundedUser = userDao.findByLogin(req.getParameter("login")); req.getSession().setAttribute("user", foundedUser); return "userPage";//to WEB-INF/jsp/userPage.jsp } </code></pre> <p>How can I rewrite this part of application in order to user POST method to redirect and to handle in controller ? </p> <p>Here is function that receives reply from servler (part of function actually)</p> <pre><code>function doAjaxPost() { // get the form values var queryString = $('#loginform').formSerialize(); $.ajax({ type: "POST", url: "${pageContext. request. contextPath}/loginUser.ajax", data: queryString, //"name=" + name + "&amp;pswd=" + pswd, success: function(response){ // we have the response var delay = 1500; if (response.status == "OK_USER") { $('#error').html(''); $('#info').html("Login exists, password is correct everything will be fine.&lt;br&gt; Redirect to User's page"); //var delay = 3000; setTimeout(function() { window.location.href = "${pageContext.request.contextPath}/redirectUser.ajax?login="+response.result.name; }, delay); } .... </code></pre> <p>So how can I redirect using jQuery or something else using POST method ? </p>
jquery
[5]
3,643,907
3,643,908
Call function with parameter given in arguments lists
<p>I want to receive a function in parameter and call it with one parameter as: <code> </p> <pre>public static &lt;T&gt; T foo(Callable&lt;T&gt; func) { return func.call("bar"); } </code></pre> <p>But it call doesn't take any parameter. Any idea on how can I do this?</p> <p>No matter how much I search, I dont find anything that help me...</p>
java
[1]
701,189
701,190
Creating a reference to variable directly from string (without switch statement)
<p>I know the title is not very clear so here it's in code:</p> <pre><code>function output($selector){ $one = 1; $two = 2; $there = 3; return ? //should return 1 without if or switch statement } echo output('one'); </code></pre> <p>If this is possible, how?</p>
php
[2]
3,036,862
3,036,863
Can I log user out after session has reached maxlife
<p>I have a piece of code below where session variables can last for 12 hours:</p> <pre><code>ini_set('session.gc_maxlifetime',12*60*60); ini_set('session.gc_divisor', '1'); ini_set('session.gc_probability', '1'); ini_set('session.cookie_lifetime', '0'); </code></pre> <p>But what my question is that is it possible to log the user out once 12 hours has passed and the session variables have expired? In other words I have a teacherlogout.php page, after 12 hours has passed can it redirect the user to the logout page once the user has navigated to another page or refreshed the page after 12 hours?</p> <p>UPDATE:</p> <p>Could this work:</p> <pre><code>if ((isset($username)) &amp;&amp; (isset($userid))){ ...//WHOLE CODE }else{ header( 'Location: teacherlogout.php' ) ; } </code></pre>
php
[2]
5,836,773
5,836,774
$(selector).find().live() returning the parent from a multiple selector
<p>I'm having some trouble with <code>.find()</code> on a <code>.live()</code> returning the wrong element.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div id="div1"&gt; &lt;input type="text" id="txt1" /&gt; &lt;/div&gt; </code></pre> <p><strong>Javascript (jQuery):</strong></p> <pre><code>$('#div1,#div2').find('input').live('keypress',function() { console.log(this); }); </code></pre> <p>I expect <pre>&#60;input id="txt1" type="text"></pre> to be returned, but instead I'm getting back <pre>&#60;div id="div1"></pre></p> <p>Any thoughts on why I would be getting the parent container <code>div</code> of the <code>input</code> instead of the <code>input</code> itself?</p> <p><a href="http://jsfiddle.net/6rxCu/5/" rel="nofollow">jsFiddle example</a></p> <hr> <p><strong>Addendum:</strong></p> <p>I'm not really looking for alternate code that works (I could easily split this into two <code>.live()</code> calls), I'm just trying to find out why this doesn't work.</p> <p>Yes, I realize that #div2 does not exist.</p> <p>Yes, I realize that the documentation for .live() says to <a href="http://api.jquery.com/live/#caveats" rel="nofollow">only attach .live() to the root selector</a>. However, $(selector).find().live() <a href="http://jsfiddle.net/6rxCu/4/" rel="nofollow">works in simpler situations</a>.</p>
jquery
[5]
5,132,757
5,132,758
Using Custom List on SlidingMenu
<p>Im trying to implement Koush's Widgets <a href="https://github.com/koush/Widgets" rel="nofollow">https://github.com/koush/Widgets</a> inside of a jfeinstein10's SlidingMenu but i can figure out how to do it or if its doable</p> <p>I got both working, I can add add the widgets to any activity and also got the slidingmenu with a separate xml.</p> <p>Im using the example code from <a href="https://github.com/koush/Widgets" rel="nofollow">https://github.com/koush/Widgets</a> as base</p> <p>Thanks for the help.</p>
android
[4]
821,214
821,215
acces of local final variable in inner class broken
<p>I got a method in which server-client communication is done "onClick" therefor i create a anonymous OnClickListener, and I want to publish a toast if the communication was successfull or not. To do this I need the Acitivity in which context to publish the toast, and as I externalized the method, it must be given as a "this" argument to the Activity. But as I am inside an anonymous inner class I cannot access the this pointer of the Acitivity, and even though I stored it in a local final variable</p> <pre><code>private final Activity activity = this; @Override public void onCreate(Bundle savedInstanceState) { lastResult = null; super.onCreate(savedInstanceState); setLayout(R.layout.main); qrscan = (Button) findViewById(R.id.qrcodescan); qrscan.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { initiateScan(activity); } } ); } private AlertDialog initiateSend(Activity activity) { if(lastResult != null) { String[] arr = lastResult.content.split("/"); AlertDialog.Builder downloadDialog = new AlertDialog.Builder(activity); String[] args = Util.filterString(arr,this); downloadDialog.setTitle(args[0]); downloadDialog.setMessage("Auftragsnummer:" + args[1]); downloadDialog.setPositiveButton(getString(R.string.ja), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialogInterface, int i) { try { String send = lastResult.content; send += "/uid/" + R.id.username + "/cid/" + R.id.password; String result = Util.send(send); //toaster(send); Util.toaster(result,activity); if(!(result.equals("OK") || result.equals("ok") || result.equals("Ok"))) throw new Exception("Bad Server Answer"); Util.toaster("Communication erfolgreich",activity); } catch(Exception ex) { ex.printStackTrace(); Util.toaster("Communication nicht erfolgreich",activity); } } }); downloadDialog.setNegativeButton(getString(R.string.nein), new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) {} }); return downloadDialog.show(); } return null; } </code></pre> <p>Any clue what i messed up?</p>
android
[4]
3,957,389
3,957,390
Error C2064: term does not evaluate to a function taking 1 argument
<p>When I try the below program its gives me the :error C2064: I tried in google but not able to find the exact reason. Please help.</p> <pre><code>class myClass { public: void function(myClass dTemp) { cout&lt;&lt;"Inside myClass: taking myClass parameter"&lt;&lt;endl; } }; </code></pre> <p>. </p> <pre><code>int main() { myClass myClassTemp; myClass myClassTemp1; myClassTemp(myClassTemp1);// error C2064: term does not evaluate to a function taking 1 argument. return 0; }; </code></pre>
c++
[6]
536,785
536,786
Get java version that was used to compile class
<p>Is it possible somehow to get java version that was used to build class? Is there are any information compiled into class file? Possible there is some specific headers/footers or something like that.</p>
java
[1]
5,227,648
5,227,649
Add a website forum to an app
<p>What is the best way to add a website forum to an android app? I want the forum topics in a listview. Then if you click a item in the listview it opens an other activity with another listview with the posts in it. I want also that it is possible to ad posts to a topic. I have on the server side an mysql database. How do i start on the android side for this?</p>
android
[4]
3,831,527
3,831,528
"A potentially dangerous Request.Form value was detected from the client" error using TINY MCE for CMS
<p>When I put value in textbox then its throught this error. I am making Content Management System.</p> <pre><code>A potentially dangerous Request.Form value was detected from the client (elm1="&lt;p&gt;ABC&lt;/p&gt;"). </code></pre> <p>when page go to server then it's through error.<br> Please assist.</p>
asp.net
[9]
1,133,091
1,133,092
Php date() function gets wrong minutes... why?
<p>I was working with a project in Php and I noticed that date (and time too) return wrong time. At first it seemed the wrong timezone, but later I noticed that there is not one or more hours of difference (I'm working on localhost) with system clock, but about 28 minutes... That's weird.. what could it possibly be?</p>
php
[2]
820,070
820,071
Date to day conversion in php
<p>Hi friends in my webpage i need to calculate the day[ie. SUN,MON,TUE...] from the date .. The date is in ['06/22/2009'] this format ? How can i calculate it in to day[That is it will show me MON] in php . Please help me to find out . Thanks in advance..</p>
php
[2]
4,734,172
4,734,173
prepend inside prepended element
<p>I am having problems with the following jquery code.</p> <pre><code>$(document).ready(function() { $(".box").submit(function(e) { e.preventDefault(); var input_value = $(".textbox").val(); $("&lt;li&gt;"+ input_value +" &lt;br /&gt; &lt;form class='box'&gt;&lt;input type='text' name='textbox' class='textbox reply'&gt;&lt;/form&gt; &lt;ul class='list'&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;") .prependTo($(this).siblings('.list').first()); }); }); </code></pre> <p>Everything works fine when I prependTo() to the existing HTML but once I try to prependTo() to the element that was created by javascript I run into an error.</p> <p>I created the following <a href="http://jsfiddle.net/hV2Rr/" rel="nofollow">jsfiddle</a> to illustrate</p>
jquery
[5]
259,627
259,628
How would I go about getting the package names of the applications that can be Home on android
<p>My activity gets set as the default Home by the user, but I want to be able to launch the default Home from within my activity as well. I've tried hard coding the following: </p> <blockquote> <p>Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); PackageManager pm = getPackageManager(); String packageName = "com.android.launcher"; String className = "com.android.launcher.Launcher"; final ComponentName cn = new ComponentName(packageName, >className); intent.setComponent(cn);</p> </blockquote> <p>This seems to work on my droid, but force closes on the HTC Ally. I'm thinking there's an easier way to just get a list of the apps that have the category Home and Default.</p> <p>For those that have used the Home Swittcher app. I essentially want to generate that list of installed default Home activities on the phone.</p>
android
[4]
5,293,668
5,293,669
Android is there a way to have a list box with a set size, instead of filling the parent or content?
<p>I would like to have a TextView on top where if it was more then 5 lines of text, it would scroll. Then a list of text on the bottom that simply files the remain space.</p> <p>I'm using the ScrollView with a TextView inside. The problem is if I set the top scroll to warp content, it will keep getting bigger if there is more then 5 lines of text. If I set it to fill parent, the button text view will not get displayed. Is there a way to do this?</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Tell a Furtune Chat" android:textSize="38px" /&gt; &lt;ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Tell a Furtune \n ted \n teda \n rob \n fred \n bed \n jack \n junk \n more" android:textSize="38px" /&gt; &lt;/ScrollView&gt; &lt;ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Tell a Furtune \n ted \n teda \n rob \n fred \n bed \n jack \n junk \n more" android:textSize="38px" /&gt; &lt;/ScrollView&gt; &lt;/LinearLayout&gt; </code></pre>
android
[4]
3,476,967
3,476,968
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
<pre><code>&lt;html&gt; &lt;title&gt;Title&lt;/title&gt; &lt;body&gt; &lt;link type="text/css" rel="stylesheet" href="css/bootstrap.css"/&gt; &lt;/body&gt; &lt;center&gt; &lt;? mysql_connect ("localhost", "root","") or die (mysql_error()); mysql_select_db ("dbname"); $term = $_POST['term']; $sql = mysql_query("select * from items where name like '%$term%'"); while ($row = mysql_fetch_array($sql)){ echo '&lt;table class="table - striped"&gt; &lt;theader&gt; &lt;tr&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;&lt;/br&gt; Name&lt;/th&gt;&lt;/tr&gt;'; echo ' &lt;tbody&gt;&lt;td&gt;'.$row['id']; echo'&lt;/td&gt;'; echo '&lt;td&gt;'; echo '&lt;/theader&gt;' .$row['name']; echo '&lt;/td&gt;'; echo ''; } ?&gt; &lt;/center&gt; &lt;script src="js/bootsrap.js"&gt; &lt;/script&gt; &lt;/html&gt; </code></pre> <p>I'm, getting this error: </p> <pre><code>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/runedev1/public_html/itemdb/search.php on line 19 </code></pre> <p>When I run the code on localhost using Xampp, it works fine, when I upload it to the web-host, the error appears.</p> <p>Yes, I am changing the database name, user and password when putting it on the webhost.</p>
php
[2]
4,085,690
4,085,691
How to retrieve milliseconds from java.sql.Timestamp
<p>I have a timestamp object and need to get the milliseconds from it, can someone help me with an example code snippet ?</p>
java
[1]
2,683,518
2,683,519
Event, GUI and Threads
<p>I have parent form and child form. Parent form contains a dataGridView (list of accounts) and the child form allows a user to register an account.</p> <p>The child form is launched on a separate thread.</p> <p>When the account is registered, it's added to the SQL database and event is fired on the child form which the parent form subscribes to. The parent form then updates the dataGridView to add the new value from the database.</p> <p>The problem is when trying to update the dataGridView in the parent form upon the event being fired I get a cross thread error. Is this normal behaviour in this context?</p>
c#
[0]
787,526
787,527
Intercept the Share click on Gallery
<p>Is it possible to listen to the click of the Share button in Android's Gallery app? After I capture that click, I want to start my Activity without presenting the list of apps the user can share with.</p> <p>I know I can listen to Intent.ACTION_SEND and display my app in the share menu but I am not looking for that implementation.</p> <p>I'd appreciate your suggestions.</p>
android
[4]
5,676,189
5,676,190
Checking for types of objects in my script?
<p>I'm writing a localStorage wrapper to make inserting and retrieving data easier when needing it to do more robust queries.</p> <p>My script is here: <a href="https://github.com/OscarGodson/storageLocker" rel="nofollow">https://github.com/OscarGodson/storageLocker</a></p> <p>A user of my script asked me how he could save a Date and i told him the proper procedure (save <code>new Date().getTime()</code> to the JSON and revive it with something like <code>new Date(json.time)</code> but he was trying to do <code>hisStorage.save({'the_date':new Date()})</code>, but to his surprise when he went to get the data it'd be malformed.</p> <p>So, my question is, how can I catch inserts like this and other objects (maybe events?), convert them for the users to be stored in the JSON and also retrieved properly? I've been working on it all day and i can't figure out how to check for certain types of objects and convert accordingly via some switch case.</p> <p>The save and retrieve part of my script looks like this:</p> <p><strong>Saving Data:</strong></p> <pre><code>storageLocker.prototype.save = function(value){ var json = JSON.parse(localStorage.getItem(this.catalog)); if(json == null){json = {};} for(var key in value){ if(value.hasOwnProperty(key)){ json[key] = value[key]; } } localStorage.setItem(this.catalog,JSON.stringify(json)); return this; } </code></pre> <p><strong>Getting Data:</strong></p> <pre><code>storageLocker.prototype.get = function(value){ json = JSON.parse(localStorage.getItem(this.catalog)); if(json == null){json = {};} if(value){ if(typeof json[value] !== 'undefined'){ return json[value]; } else{ //Makes it so you can check with myStorage.get('thisWontExist').length //and it will return 0 and typeof will return object. return new Object(''); } } else{ return json; } }; </code></pre>
javascript
[3]
1,448,437
1,448,438
Process text input through a textarea
<p>i have website with text area where user pastes text which looks like this: </p> <pre><code>Name Surname Age Mail John Smith 99 john@john.com </code></pre> <p>i want to make variables from words "John","Smith",... and then save them to database</p> <p>thanks</p>
php
[2]
2,011,062
2,011,063
JQuery with Forms
<h2>I have the following HTML:</h2> <pre><code>&lt;form class="lala"&gt; &lt;input type="text" id="textv" value="Text 1" size="5"&gt; &lt;input type="submit" value="Go!"&gt;&lt;/form&gt; &lt;form class="lala"&gt;&lt;input type="text" id="textv" value="Text 2" size="5"&gt;&lt;input type="submit" value="Go!"&gt;&lt;/form&gt; </code></pre> <h2>Now I have the following JQuery:</h2> <pre><code>$(document).ready(function(){ $(".lala").submit(function() { alert($("#textv").val()); }); </code></pre> <p>Of course this is not working (I know I shouldn't use duplicate IDs) , but how can I show an alert of the text value where the corresponding submit button was clicked?</p> <p>Thanks, Joel</p>
jquery
[5]
4,080,977
4,080,978
Email confirmation
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5141294/how-to-find-email-has-been-delivered-in-android">how to find email has been delivered in android</a> </p> </blockquote> <p>How do I confirm that an email has been delivered when sending email with android?</p>
android
[4]
3,866,633
3,866,634
c# how to calculate the working days left in a month
<p>Hi i am new to <code>c#</code> and programing in general i have been trying to learn from adapting other peoples code the code below i have changed the code as i want to calulate the amount of working days left in a month but the problem is the code runs over the amount of days in a month so this month has <strong>29 days</strong> but the code errors as the code runs to the <strong>30th</strong> I can not figure out which part of the code to change any help would be great </p> <pre><code> private void days() { //Monday to Friday are business days. var weekends = new DayOfWeek[] { DayOfWeek.Saturday, DayOfWeek.Sunday }; DateTime testing = DateTime.Now; string month1 = testing.ToString("M "); string year1 = testing.ToString("yyyy"); int month = Convert.ToInt32(month1); int year = Convert.ToInt32(year1); //Fetch the amount of days in your given month. int daysInMonth = DateTime.DaysInMonth(year, month); string daysleft = testing.ToString("d "); int daystoday = Convert.ToInt32(daysleft); //Here we create an enumerable from 1 to daysInMonth, //and ask whether the DateTime object we create belongs to a weekend day, //if it doesn't, add it to our IEnumerable&lt;int&gt; collection of days. IEnumerable&lt;int&gt; businessDaysInMonth = Enumerable.Range(daystoday, daysInMonth) .Where(d =&gt; !weekends.Contains(new DateTime(year, month, d).DayOfWeek)); //Pretty smooth. int count = 0; foreach (var day in businessDaysInMonth) { count = count + 1; } textBox9.Text = count.ToString(); } } </code></pre>
c#
[0]
5,089,714
5,089,715
Which iPhone OS version shows the maps application?
<p>I have a 3.0 iPhone and the maps show blank.</p> <p>what earliest iPhone version allows me to view maps in the built in maps app.?</p>
iphone
[8]
617,493
617,494
Help me to remove the error in my program?
<pre><code>import java.awt.*; import java.awt.event.*; import javax.swing.*; class math { JFrame jf; JTextField jt; JButton jb; JButton jb1; math() { jf=new JFrame("frame"); jf.setSize(200,200); jf.setVisible(true); jt=new JTextField(50); jf.setLayout(new FlowLayout()); JButton jb=new JButton("30"); JButton jb1=new JButton("sin"); jb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { jt.setText("30"); } }); jb1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { String s=jt.getText(); double x=Double.parseDouble(s); double s1=Math.sin(x); jt.setText(s1); } }); JButton jb2=new JButton("cos"); jf.add(jt); jf.add(jb); jf.add(jb1); jf.add(jb2); } public static void main(String args[]) { new math(); } } //its giving error that double can't be applied to jt.setText </code></pre>
java
[1]
5,851,494
5,851,495
android How to set Hidden this bar (in tablet Android 4.0.3)
<p>I'm trying to make my app to Fullscreen (with no any bar) how I can coding to set it. (Android version 4.0.3) Thx very Much <img src="http://i.stack.imgur.com/gVJ3o.png" alt="enter image description here"></p>
android
[4]
3,933,471
3,933,472
If construct displaying only else value - PHP
<p>Here is my statement:</p> <pre><code>if($row_x['xfield']==$_POST['x1'] AND $row_x['yfield']==$_POST['y']) { echo "ok"; } else { echo "invalid"; } </code></pre> <p>When both are not equal to each other, it must display 'invalid' else, 'ok'. But in this case it displays 'invalid' whether it is valid or not.</p> <p>Any clues to why?</p>
php
[2]
1,562,087
1,562,088
is there way for programmatically storing an 'address' of properties for an objects in PHP?
<p>Suppose I have an object in PHP $o, about which I can get $o->a->b, or maybe $0->c['d'].</p> <p>Is there a way of storing these as sort of address for handling elsewhere?</p> <p>What I have is that at several different places I need to process different properties of the object, but in the same way.</p> <p>So what I'd like to do is build a collection of addresses as I go along, and then hand them all to a single function which goes through them all and does the processing.</p> <p>Eg:</p> <p>$o->a = 'red';</p> <p>$o->b->c = 'red';</p> <p>$o->d['e'] = 'red';</p> <p>... and I want to change all 'red' to 'green', but those particular keys and properties may change depending on circumstances.</p>
php
[2]
3,642,062
3,642,063
Customized Installation in Android
<p>Is it possible to control the package installation process<br> in Android? </p> <p>The problem is that I'm asked to install and uninstall packages without using the default android installer. I need to control the entire process within my application. </p> <p>I already have my application in the /system/app/ folder,<br> so it might have the INSTALL_PACKAGE and DELETE_PACKAGES permission<br> (that was what I read). </p> <p>I also have been looking to the source code of the installer,<br> but can't find a way to start installing or uninstalling<br> a package on my own. </p> <p>Could this be done? </p> <p>Thank you all</p>
android
[4]
5,485,307
5,485,308
jQuery basic structure
<p>i wanna understand what that line means: </p> <pre><code>var oViewport = { obj: $('.viewport', root) }; </code></pre> <p>it's a line out of the plugin tinyscrollbar. Can someone explain the values of this line to me? I really searched for an answer but didn't find one. I appreciate your help. </p>
jquery
[5]
3,583,986
3,583,987
Rotate a single RotateDrawable in a LayerDrawable
<p>I'm building an app that has some sort of compass in it, and I want to use a LayerDrawable to draw and animate the compass. The LayerDrawable consists of a static background image for the compass background, and a RotateDrawable for the rotating part. Here's my XML code for the drawable resources:</p> <p>compass_text.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/compasstext" android:fromDegrees="0" android:toDegrees="360" android:pivotX="50%" android:pivotY="50%" /&gt; </code></pre> <p>compass_layers.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:drawable="@drawable/compassbackground" /&gt; &lt;item android:drawable="@drawable/compass_text" /&gt; &lt;/layer-list&gt; </code></pre> <p>The LayerDrawable displays just fine, but how do I rotate it? This is the code I tried:</p> <pre><code>compassText = (RotateDrawable)getResources().getDrawable(R.drawable.compass_text); compassText.setLevel(5000); </code></pre> <p>This does nothing. What am I doing wrong?</p>
android
[4]
1,224,654
1,224,655
How to implemt two function using 1 jquery
<p>I'm new for jquery..... i have a doubt in the code given below..... if i click the btn the corresponing parent div only should move. Check the code give below. Thanks in advance.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(e) { $('.btn').click(function(){ $('.aaa').animate({'left':'500'},500); return false; }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="cnt"&gt; &lt;div class="aaa" style="width:50px; height:50px; background-color:red; position:relative"&gt;&lt;/div&gt; &lt;a href="#" class="btn"&gt;Btn&lt;/a&gt; &lt;/div&gt; &lt;div class="cnt"&gt; &lt;div class="aaa" style="width:50px; height:50px; background-color:red; position:relative"&gt;&lt;/div&gt; &lt;a href="#" class="btn"&gt;Btn&lt;/a&gt;&lt;/div&gt; </code></pre>
jquery
[5]
3,862,277
3,862,278
Finding a char from an array, spliting at that point and then inserting another char after
<p>I am basically looking for a way to check if a certain string contains any of a certain list of chars, and if contains one of these to split the string and then insert the same char infront/after it. This is because these certain chars are breaking my search when they are input due to SQL not handling them well.</p> <p>This is how far I have actually got so far:</p> <pre><code>string[] errorChars = new string[] { "!", "}", "{", "'", }; for (int i = 0; i &lt; errorChars.Count(); i++) { if(fTextSearch.Contains(errorChars[i])) { } } </code></pre>
c#
[0]
5,817,840
5,817,841
validating a field using jquery
<p>rather than using a jquery plugin. if i have two fields and the first field is required and is currently on focus. if i click or tab over to the next field how can i check with jquery to see if the field contains any data and if it doesnt append some text or a class next to it? is onblur() used or?</p> <p>thanks</p>
jquery
[5]
3,773,427
3,773,428
Passing variable to PHP from JS
<p>I know its REALLY simple, but I'm a newbie. I want to pass a variable from a PHP query via JS (for open-flash-chart) to the data file which is PHP.</p> <p>This is my JS inside my PHP file. I'm pretty certian my issue is with the JS part since I've never used it before. </p> <pre><code>&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var player = "&lt;? echo $player1 ?&gt;"; swfobject.embedSWF( "open-flash-chart.swf", "my_chart", "900", "350", "9.0.0", "expressInstall.swf", {"data-file":"data2.php"} ); &lt;/script&gt; </code></pre> <p>I am trying to pass the $player variable to the graph data file which is this ( data2.php)</p> <pre><code>&lt;?php include("include/session.php"); include 'open-flash-chart/php-ofc-library/open-flash-chart.php'; if (isset($_GET['player'])) { $player = $_GET['player']; } $sql = "SELECT pos FROM nflscore where username = '$player'"; </code></pre>
php
[2]
1,643,208
1,643,209
checking for number of selectors with jquery
<p>I am trying to see if there are any tags which have the class="red" in the code. I thought that this would work but it isn't. How would I do this?</p> <pre><code>if ($("[class='red']").length &lt;=0) /*if some of the entries are invalid (aka- have a red star)*/ { alert('Some Entries are Invalid'); return false; } </code></pre>
jquery
[5]
4,554,937
4,554,938
use first-Child with $(this)
<p><code>$(this):first-child</code> is the wrong syntax</p> <p>I didn't know how to use <code>first-child</code> with <code>$(this)</code> in a <code>.each</code> loop.</p>
jquery
[5]
1,664,036
1,664,037
When to use a HashTable
<p>In C# I find myself using a List, IList or IEnumerable 99% of the time. Is there a case when t would be better to use a HashTable (or Dictionary in 2.0 and above) over these?</p> <p>edit:</p> <p>As pointed out, what someone would like to do with the collection often dictates what one should be using, So when would you use a Hashtable/Dictonary over a List?</p>
c#
[0]
5,149,604
5,149,605
Convert Html to Pdf in flurry background
<p>I used several search and methods to find this convertion from html to pdf but I didn't got. What is the way to convert an HTML page to PDF? I already downloaded <code>tcpdf library</code> but I don't how I to use it.</p> <p>Thanks in advance.</p>
php
[2]
3,389,889
3,389,890
Unable to connect php and html file
<p>i have added action value Registration file</p> <pre><code> &lt;body&gt; &lt;div id="registration"&gt; &lt;h2&gt;&lt;b&gt;&lt;i&gt;Electronic Montessori Learning&lt;/i&gt;&lt;b&gt;&lt;/h2&gt; &lt;form id="RegisterUserForm" action="connect.php" method="post"&gt; &lt;fieldset&gt; &lt;p&gt; &lt;label for="name"&gt;Name&lt;/label&gt; &lt;input id="name" name="name" type="text" class="text" value="" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="password"&gt;Password&lt;/label&gt; &lt;input id="password" name="password" class="text" type="password" /&gt; &lt;/p&gt; &lt;p&gt; &lt;button id="registerNew" name="registerNew" type="submit"&gt;Register&lt;/button&gt; &lt;/p&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; &lt;body&gt; </code></pre> <p>I have not posted all code of registration.html as it is working fine</p> <p>connect.php</p> <pre><code>&lt;?php $db=mysql_connect("localhost", "root", "") or die(mysql_error()); echo "Connected to MySQL&lt;br /&gt;"; mysql_select_db("users") or die(mysql_error()); echo "Connected to Database"; $name =''; $password =''; if(isset($_POST['registerNew'])){ // Storing form values into PHP variables $name = $_POST['name']; // Since method=”post” in the form $password = $_POST['password']; } mysql_query("INSERT INTO user_eml(Name, Password) VALUES('$name', '$password' ) ") or die(mysql_error()); echo "Data Inserted!"; echo 'Thank you for submitting your details!'; ?&gt; </code></pre> <p>but still its not working and when i press register button it shows php code of connect.php</p>
php
[2]
5,120,566
5,120,567
Calling the date time , without initiating the dialog box of Datetime control
<p>I am basically using a datetime control in my application.</p> <p>Wherein on a click event i am initiating datetime dialog.</p> <p>In another scenario, i want to move current date, to next day, or previous day. I don't want the dialogbox of date time control to be displayed.</p> <p>Is it possible??</p>
android
[4]
5,001,728
5,001,729
What's wrong with this simple javascript code .. It doesn't alert
<p>I have just started learning some javascript and the code below doesn't alert anything .. what's wrong with the code ...</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;title&gt; javascript &lt;/title&gt; &lt;script type="text/javascript"&gt; function text(test) { alert(test); } text("It works"); &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; </code></pre>
javascript
[3]
1,045,243
1,045,244
Unable to copy cell values
<p>On click of the Copy link in a row, I need to create another row and copy all its contents to the new row. This is the code I have:</p> <pre><code>addNewInlineRow(sid, idToUse); // this creates a new row with empty values //this copies the value from old row to new row $("#"+rowId+ " td").each(function(index){ $("#"+idToUse+ " td").get(index).text($(this).text()); }); </code></pre> <p>But this code is not working. Any suggestions? I cannot clone the entire TR due to existing complex logic for creating TR id!!</p>
jquery
[5]
1,303,608
1,303,609
How the bit.ly system get the path from url?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3901635/php-passing-parameters-via-url">PHP passing parameters via URL</a> </p> </blockquote> <p>I know that if you have a page <code>www.domain.com/?id=ABC</code> you can get the <em>ABC</em> in the <code>index.php</code> file using a </p> <p><code>$_GET['id'];</code></p> <p>My question is how does a <code>bit.ly/ABC</code> can give the <em>ABC</em> to their php file without having an <code>?id=ABC</code> in the path?</p>
php
[2]
4,340,512
4,340,513
dynamically select a javascript object attribute
<p>[How] can I achieve the following?</p> <pre><code>var object = new Object(); object.field1 = "test1"; object.fiedl2 = "test2"; function showSpecificField(fieldName){ //get the field Name passed in to function from object //something like: return object.fieldName ??? } alert(showSpecificField("field2"));// should alert the text "test2" alert(showSpecificField("field1"));// should alert the text "test1" </code></pre>
javascript
[3]
1,828,605
1,828,606
Detecting all plugins in Internet Explorer
<p>I want to display all plugins' info in all browser,But IE , <code>navigator.plugins</code> is null. I look help for google but it said you can only detect the plugin you want to detect..So is there other ways to do this?</p>
javascript
[3]
3,770,198
3,770,199
Explain string boolean test result
<p>I have this code:</p> <pre><code>&gt;&gt;&gt; char = 'A' &gt;&gt;&gt; 'A' == char True &gt;&gt;&gt; ('A' or 'B') == char True </code></pre> <p>Why does this not equal <code>True</code>?</p> <pre><code>&gt;&gt;&gt; ('B' or 'A') == char False </code></pre>
python
[7]
5,777,892
5,777,893
Android : launching google maps using intent from a tab and pressing back button
<p>In my application i have a tabhost with one tab for "map"</p> <p>On clicking map i am launching a new activity within which i am launching the google map using intent. </p> <p>Now when i click on "back" key, i get the tab view with map tab being pressed and below a blank screen. </p> <p>If i click map again, screen remains the same , map is not launched again.</p> <p>How can i get the map displayed whenever i press map. Like i press anyother tab and again press map , it should display map.</p> <p>Here is my code launching the map:</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setMapView(); } private void setMapView() { // get lat , log here Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:" + latitude + "," + longitude+ "?z=10" ) ); startActivity(intent); } </code></pre>
android
[4]
4,114,512
4,114,513
Developing a custom speech bubble
<p>I am new to Android application development. I am building an Android app where the user needs to be able to add speech bubbles (think comics) over existing images. I have some questions on how to implement this,</p> <ul> <li>Should i build a custom component? can you help me to build the appropriate xml?</li> <li>Allow the user to move the speech bubble using touch- Any pointers or examples would be great!</li> <li>Also let him resize the speech depending on the amount of text - Any pointers or examples would be great!</li> <li>Finally he should be able to add text to speech bubble!! this bubble is it the same as the text view with a different background?</li> </ul> <p>Please i need your help!! </p>
android
[4]
5,356,814
5,356,815
What values will return 0 in this function?
<p>The following function uses a <a href="http://www.openjs.com/articles/syntax/short_circuit_operators.php" rel="nofollow">Short Circuit Operator</a> to return <code>0</code> as default:</p> <pre><code>function custNumParse(str){ return str*1||0; } </code></pre> <p>I am not sure when this will return the second (I mean, I know that it will when <code>str*1</code> can't be evaluated to <code>true</code>), but I am not sure what inputs could produce that output when multiplying by <code>1</code>.</p> <p>I know that the falsish values are <code>0, "", false, null, undefined, NaN</code>, but this doesn't help me that much.</p> <p>In other words I am clueless what would happen when I use that function with objects or booleans, etc. I know I can test them all, but I am sure there is an easier way to go</p> <p>Any ideas on what is the most proper way to find these guys without testing them all?</p>
javascript
[3]
4,927,274
4,927,275
Display the grid view images according to a number
<p>Hi i want to display the number of images according to one number.That means if number is 1 i want to displat only one imageview in grid,if number is 3 i want to display the 3 images in grid .But i take only one image that means depending on the number that image will be displayed th</p>
android
[4]
974,187
974,188
convert Graphics to Image in c#
<p>How to convert Graphics to Image?</p>
c#
[0]
5,580,117
5,580,118
concatenate two integer values into a char array
<p>Im trying to extract two (int32_t) values, and place them within a char array.</p> <pre><code>int32_t version = getVersion(); if (version &lt; 0) { return; } else { //first part of number needs to be shifted right int32_t major = (((version) &gt;&gt;16) &amp; 0xFFFF); int32_t minor = ((version) &amp; 0xFFFF); // need to concatenate these two values, and place a "." between them setVersion(...);//requires a char array, should for example be "1.1" } </code></pre> <p>can anyone give me any advice on the best way to do this? without the use of std::strings please. I would prefer a char array.</p> <p>Thanks in advance</p>
c++
[6]
2,436,987
2,436,988
how to call a php function on button click
<p>These are two files</p> <p>Calling.php</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;form action="Called.php" method="get"&gt; &lt;input type="button" name="B1" value="B1"&gt; &lt;input type="button" name="B2" value="B2"&gt; &lt;input type="Submit" name="Submit1"/&gt; &lt;!-- &lt;a href="http://www.google.com?act=google"&gt;Google&lt;/a&gt; &lt;a href="http://www.yahoo.com?act=yahoo"&gt;yahoo&lt;/a&gt; --&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And Called.php</p> <pre><code>&lt;?php if(isset($_GET("Submit1"))) { echo("&lt;script&gt;location.href = 'http://stackoverflow.com';&lt;/script&gt;"); } if(isset($_GET["B1"])) { echo("&lt;script&gt;location.href = 'http://google.com/';&lt;/script&gt;"); exit(); } if(isset($_GET["B2"])) - List item { echo "&lt;meta http-equiv='refresh' content='0;url=http://www.yahoo.com'&gt;"; exit(); } ?&gt; </code></pre> <p>When i click the buttons "B1" and "B2", page will blink but now where redirect and third one "Submit" button will redirect to new page and there i am getting the out put as "Called.php".</p> <p>Please spend few seconds for this php beginner.</p>
php
[2]
962,856
962,857
Insert new column in Table
<p>I have a problem where the <code>:eq()</code> does not accept the counter, <code>n</code>, to insert values to a new column to the table in the HTML. </p> <pre><code>$(document).ready(function() { var $tablerow = $('table.table').find('tr'); count = 0; $tablerow.each(function(index, value){ count += 1; var $listitem = $(this); n = parseInt($listitem.index()); var $newRow = $("&lt;td&gt;" + n + "&lt;/td&gt;"); $("table.table tr:eq(n)").append($newRow); }); }); </code></pre> <p>HTML</p> <pre><code>&lt;table class="table"&gt; &lt;tr&gt;&lt;td&gt;First row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;second row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;third row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;fourth row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;fifth row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;sixth row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;seventh row&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;eighth row&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; </code></pre>
jquery
[5]
2,225,289
2,225,290
Using namedtuples to consolidate multiple dictionaries
<p>Given n-number of models which contain m-number of key:value pairs, can namedtuples be used to consolidate that information inside of one object? By consolidate, I mean refactor, so that I can pass around this object and access particular bits of information from it.</p> <p>How it is organized currently:</p> <pre class="lang-python prettyprint-override"><code>Model_1_Dict = {'key1':('value1','value2','value3'),'key2':('value1','value2','value3')} Model_2_Dict = {'key1':('value1','value2','value3'),'key2':('value1','value2','value3')} </code></pre> <p>Each model dictionary will have 3 value pairs per key. The key represents an independent variable name (from a regression model), the values represent the beta coefficient, calculated value(x), and an associated function... semantically like this:</p> <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; Model_1_Dict["Variable Name"] ("Beta Coefficient", "Calculated Value", "myClass.myFunction") </code></pre> <p><code>Model_1_Dict["Variable Name"][1]</code> gets updated later on in the code. I could either pass <code>= None</code> at initialization, and then update the value on calculation. Or append the value to the values list object sometime later on (I think this is a non-issue). </p> <p>I want to know if there is a better way to handle the model information using other structures, such as namedtuples?</p>
python
[7]
5,411,579
5,411,580
c# minimum of two numbers if one or both is greater than 0
<p>The logic I'm looking for is if either of the numbers are >= 0 (which they don't have to be), then return the minimum of the two that is also greater than 0. The code I've written for it is so ugly that I'm ashamed to post it! </p> <p>EDIT: Samples 1, -1 => 1 5,6 => 5 -1,-1 => 0</p> <p>(if both are less than 0, return 0)</p>
c#
[0]
1,082,829
1,082,830
Is there something like a rolling OutputStream?
<p>Is there a simple Java OutputStream that mimics a functionality similar to the log4j RollingFileAppender ? Basically it would write to a file that grows to a maximum size, then renames it, begins a new one etc. Just thought I'd ask, before writing it from scratch.</p>
java
[1]
3,629,167
3,629,168
Loading A Page With Ajax- Without Jquery
<p>Can someone please show me the basic syntax for loading a page via AJAX just using javascript-- not jquery? load() method?</p> <pre><code>xmlhttp=new XMLHttpRequest(); </code></pre> <p>Where do I go from here?</p>
javascript
[3]
715,553
715,554
Calling function on opener window
<p>The child lost its parent!!</p> <p>I have a parent window, when somebody clicks on an image a JS popup opens and displays the photo and its information.</p> <p>To close the popup/child window, and to flash an element on my parent/opener window, I have been using this function:</p> <pre><code>function closeWindow() { var currentID = document.getElementById('currentID').value; window.opener.flashElement(currentID); window.close(); } </code></pre> <p>My problem is this doesn't work if my users navigate away from the page that the popup originally opened. For example, in the popup window, there are next and previous buttons to scroll through the individual photos in that set of results, which reloads the page with a new querystring value.</p> <p>If my user scrolls (reloads page) less than 7 times it's okay but if they scroll more than that, the <code>window.opener</code> function does not work, and because of that, the <code>window.close</code> function doesn't either!</p> <p>I could probably rebuild the page so the data comes via an AJAX call, rather than reloading the page, but that's a lot of work I could do without.</p> <p>Any ideas?</p>
javascript
[3]
1,455,688
1,455,689
Activity with Flag FLAG_ACTIVITY_CLEAR_TOP (android)
<p>I have stack of activities launched after one another.<br> but in one of the activity I need to launch that particular activity with flag <code>FLAG_ACTIVITY_CLEAR_TOP</code>. </p> <p>So that it will finish all the previous activities and start. </p> <p>Problem I am facing that i don't want to finish one of the activity from the stack it should be presence on back of the newly launched activity.</p> <p>Suppose I have activities <code>[A] [B] [C] [D]</code><br> I am starting <code>[D]</code> activity with flag <code>FLAG_ACTIVITY_CLEAR_TOP</code> after starting activity <code>[D]</code> it will destroy all the activities, I want activity <code>[B]</code> to be kept running on the back and when we press back key on <code>[D]</code> it should display activity <code>[B]</code>.</p> <p>How to do this? </p> <p>Thanks,<br> PP.</p>
android
[4]
2,498,652
2,498,653
Android GPS as an Activity
<p>This is working perfectly for me.</p> <pre><code>public class GPSActivity extends Activity { LocationManager locmgr = null; String android_id; DbAdapter db; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = new DbAdapter(getBaseContext()); db.open(); android_id = Secure.getString(getBaseContext().getContentResolver(), Secure.ANDROID_ID); locmgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, this.onLocationChange); Toast.makeText(getBaseContext(), "Waiting for location..." , Toast.LENGTH_SHORT).show(); } LocationListener onLocationChange=new LocationListener() { public void onLocationChanged(Location loc) { String latlong = "Lat: " + loc.getLatitude() + " Long: " + loc.getLongitude(); Toast.makeText(getBaseContext(), latlong, Toast.LENGTH_SHORT).show(); try{ db.insertGPSCoordinates(android_id, Double.toString(loc.getLatitude()), Double.toString(loc.getLongitude())); } catch(Exception e){ } } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } }; //pauses listener while app is inactive @Override public void onPause() { super.onPause(); locmgr.removeUpdates(onLocationChange); } //reactivates listener when app is resumed @Override public void onResume() { super.onResume(); locmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, onLocationChange); } } </code></pre> <p>How do I use this from Broadcastreceiver ? I want to to start collecting co-ordinates when BOOT_COMPLETE. And keep that running depending on that <code>locmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5, this.onLocationChange);</code> setting. I am getting confused how to keep that working periodically. </p>
android
[4]
3,514,794
3,514,795
android:Strange behavior on dialogbox
<p>i have Strange problem on dialog box.</p> <p>I increase the value of X and sending it to dialogbox</p> <p>on the dialogbox - I keep seeing the same value.</p> <pre><code>public String TMP; int X=1; . . . @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case MENU_ABOUT: X++; TMP = String.valueOf(X); showDialog(ABOUT); break; } return super.onOptionsItemSelected(item); } . . . protected Dialog onCreateDialog(int id, Bundle args) { AlertDialog.Builder builder = new AlertDialog.Builder(this); if (id==0) { builder.setTitle(TMP); builder.setIcon(R.drawable.ic_launcher); builder.setCancelable(false); builder.setPositiveButton("Back", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }); AlertDialog alert = builder.create(); return(alert); } AlertDialog alert = builder.create(); return(alert); } </code></pre> <p><strong>and I keep seeing 2 all wase</strong></p>
android
[4]
5,827,952
5,827,953
Trying to extract specfic data with split
<p>i have this txt file name contacts.txt that contains this:</p> <pre><code>kate|female|kathryn bailey beckinsale|26-jul-1973|#23 underworld drive|(621) 142-7827|kate@lycans.net jessica|female|jessica claire biel|03-mar-1982|27 texas avenue|(53)2344223|jbiel@yahoo.com johnny|male|john christopher depp ii|09-jun-1963|711 pirate road|(773) 476-6634|jspaw@piratebay.org </code></pre> <p>my script is this:</p> <pre><code>function syncText() { var xhr = new XMLHttpRequest(); xhr.open("get", "data/contacts.txt", false); xhr.send(null); if (xhr.status == 200) { var data = xhr.responseText; var items = data.split("|"); items.sort(); var div = document.getElementById("header2"); for (var i = 0; i &lt; items.length; i++) { var p = document.createElement("p"); var text = document.createTextNode(items[i]); p.appendChild(text); div.appendChild(p); } } else { alert("data retrieval failed..."); } } </code></pre> <p>The HTML is this:</p> <pre><code>&lt;div id="header2"&gt; &lt;button onclick="syncText()"&gt;Load&lt;/button&gt; &lt;/div&gt;` </code></pre> <p>i only want to retreive kat, jessica, johnny.. please help me</p>
javascript
[3]
4,744,838
4,744,839
core plot graph draw issue in iphone
<p>when i use this line to draw graph my app quits</p> <pre><code>CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view; hostingView.hostedGraph = barChart; </code></pre> <p>error </p> <pre><code>[UIView setHostedGraph:]: unrecognized selector sent to instance 0x595fb20 2011-06-11 11:00:14.452 CGH[4909:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedGraph:]: unrecognized selector sent to instance 0x595fb20' </code></pre> <p>how to fix this issue , i have included all lib correctly </p> #### Update <p>i am using it again but i am getting this error , i have connected the class in nib file</p> <pre><code>2011-09-28 14:53:06.791 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file. 2011-09-28 14:53:06.795 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file. 2011-09-28 14:53:06.797 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file. 2011-09-28 14:53:06.800 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file. 2011-09-28 14:53:06.847 Ihope_test_sql[9307:707] -[UIView setHostedGraph:]: unrecognized selector sent to instance 0x1cd920 2011-09-28 14:53:06.875 Ihope_test_sql[9307:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedGraph:]: unrecognized selector sent to instance 0x1cd920' *** Call stack at first throw: </code></pre>
iphone
[8]
2,896,480
2,896,481
opening and reading a file whose name is given at runtime
<p>My problem is how to use correctly the function <code>infile.open()</code>.</p> <p>I have a class that, among the others, has the following public properties:</p> <pre><code>class myclass { public: int rows int columns const char* array_file } </code></pre> <p>All values are given at run-time.</p> <p>When I call the function that uses a member of the class I have (pt is a pointer to a member of the class)</p> <pre><code>#include &lt;vector&gt; #include &lt;fstream&gt; #include &lt;iostream&gt; typedef std::vector&lt; std::vector&lt;int&gt; &gt; Matrixint; void function(myclass* pt) { Matrixint array_name(pt-&gt;rows, std::vector&lt;int&gt;(pt-&gt;columns)); std::ifstream infile; infile.open("%s", pt-&gt;array_file); // my problem: is this correct? for (int a = 0; a &lt; pt-&gt;rows; a++) { for (int b = 0; b &lt; pt-&gt;columns; b++) { infile &gt;&gt; array_name[a][b] ; } } infile.close(); } </code></pre> <p>Is this way of opening/reading the file correct?</p> <p>The data in the file will be formatted as in <a href="http://stackoverflow.com/questions/5239689/reading-data-from-file-into-array">this question</a> (please note: only the array will be present in the file, no other data)</p>
c++
[6]
2,506,040
2,506,041
c# - ref modifier for ...reference types
<p>I am a bit confused about this piece of code.</p> <pre><code> public static void Foo(A p) { p.SomeProp = "ccc"; p = null; // !!! } static void Main(string[] args) { A p = new A(); Foo(p); Console.WriteLine("SomeProp is: " + p.SomeProp); Console.ReadLine(); } </code></pre> <p>The output is: </p> <p><strong>"SomeProp is: ccc</strong>" </p> <p>But I would have expected a NullReferenceException.</p> <p><br /></p> <p>However, if I change it like so, using the ref modifier:</p> <pre><code> public static void Foo(ref A p) { p.SomeProp = "ccc"; p = null; } static void Main(string[] args) { A p = new A(); Foo(ref p); Console.WriteLine("SomeProp is: " + p.SomeProp); Console.ReadLine(); } </code></pre> <p>I get a NullReferenceException - the second one is understandable for me.</p> <p>But how can it be, that in the first piece of code p is NOT set to null, but the property gets its value set? </p> <p>My question is: what is the p argument of the Foo method in the first piece of code if it is not a reference to the orginal instance?</p> <p><hr /></p> <p>Btw. here is the definition of class A</p> <pre><code>public class A { public string SomeProp; } </code></pre>
c#
[0]
4,657,822
4,657,823
How pass session variables between two or more aspx pages?
<p>My Scenario,</p> <p>Im using asp.net 2.0 .I have Site where it creates a unique id and it is inserted in Database and displaying in Textbox that is invisible. Now i need to send this Id to next Page. i Used Session("MemberId") = Txtnewid.Text. Its not working It shows zero value when i assign to variable string. Please Help Me . Thanks in advance</p>
asp.net
[9]
429,704
429,705
Should I use android: process =":remote" in my reciver?
<p>i have a reciver which is called every so often, and I gave noticed many people use android: process =":remote" in their recievers. mine is used to check a few things and if the conditions match then activate an alarm. My question is should I use the line I had posted above in my manifest? And if so what are the benifits of doing so? </p> <p>Thanks, Jason. </p>
android
[4]
4,809,081
4,809,082
Why does +!{}[true] output 1 in javascript
<p>I was watching this video <a href="http://www.youtube.com/watch?v=Trr95ij1358" rel="nofollow">http://www.youtube.com/watch?v=Trr95ij1358</a></p> <p>And Mr Baranovskiy emphasizes that javascript developers should know what this evaluates to:</p> <p><strong>+!{}[true]</strong></p> <p>So I gave it a shot. </p> <p>It outputs 1</p> <p>Can anyone give me a reason for this?</p>
javascript
[3]
334,337
334,338
Object reference not set to an instance of an object on adding an object to a list
<p>In the following code for, yet an unknown to me reason it keeps on throwing a the exception in the title. </p> <pre><code> try { conn.Open(); createDraw.ExecuteNonQuery(); rdr = getDrawId.ExecuteReader(); string rd = rdr[0].ToString(); int tid = Int32.Parse(rd); Drawing dr = new Drawing(tid, pos, orientation, defaultColour, 200.0, 300.0, fname, "local"); this.NoteScatterView.Items.Add(dr.getSvi()); if (dr != null) { drawings.Add(dr); } } catch (Exception ex) { Microsoft.Surface.UserNotifications.RequestNotification("Unable to create Drawing", ex.Message + "in Session.createDrawing"); } </code></pre> <p>I'm just trying to add the drawing object in a list of Drawings</p> <pre><code> private List&lt;Drawing&gt; drawings; </code></pre> <p>for later use, but I don't know why this exception is thrown. </p>
c#
[0]
1,956,996
1,956,997
Double precision failing - Can't use Big-decimal
<p>Problem: Double minus another double is returning unaccurate results.</p> <p>Usual solution: Use big decimal to perform calculations.</p> <p>I can't use this because it's in the middle of a game loop, can only set big decimal with a value when it's created with <em>new</em>, within a game loop I'm running out of memory.</p> <p>What solution?</p> <p>Here's the code:</p> <pre><code>public void UpdateStatsBar(double WorldPopulation, double WorldDead) { Number = mOriginalPopulation - WorldPopulation; } </code></pre> <p>The kind of numbers I'm using go into the billions and go tens of digits deep (averages for stats) example: 1432,323,234.234215232425322342</p>
java
[1]
4,286,035
4,286,036
How do I rename the file in file_put_contents?
<p>I have this code snippet that grabs a SWF file and saves it locally. Works like a charm! However, I need to rename the file and have no idea how to do so. All help is greatly appreciated! Thanks!</p> <pre><code>$filename = "filename"; //Without extension $urls = array($swf_url); foreach($urls as $url) { $data = file_get_contents($url); file_put_contents('/home/public/'.basename($url), $data); } </code></pre>
php
[2]
5,748,305
5,748,306
Does each file get its own copy of the static variable?
<p>Suppose you have a static global variable in your header file, and you use this variable in your main.cpp.</p> <pre><code>// header.h static int variableOne = 100; //main.cpp . . cout &lt;&lt; variableOne &lt;&lt; endl; </code></pre> <p>Will main.cpp get its own copy of <strong>variableOne</strong> (although the value is still 100...)? Or am I mixing this concept with extern (I know that extern tells the compiler that <strong>variableOne</strong> is defined elsewhere in the project...)</p> <p>Thank you.</p>
c++
[6]
472,468
472,469
Find nested element in query
<p>I need to find an DropDownList with class addressControlCountry. How?</p> <pre><code>&lt;div id="myDiv"&gt; &lt;asp:DropDownList runat="server" CssClass="addressControlCountry" /&gt; &lt;/div&gt; </code></pre> <p>This doesn't work</p> <pre><code>$('#myDiv .addressControlCountry') </code></pre>
jquery
[5]
2,228,204
2,228,205
MFMailComposer send email without presenting view
<p>I have created a sample iphone application , that sends an email to a particular user.The user address should be static.I am using MFMailComposer class to send an email from iphone.Its work fine.</p> <p>Now i want to send email to user without presenting MFMailComposerView.Can we programmatically presses the MFMailComposer send button ?.So it will automatically sends an email.</p> <p>Is this possible? If means how can i programmatically invoke the send button? </p> <p>Plz help me?</p> <p>Thanks in advance.....</p>
iphone
[8]
2,247,586
2,247,587
how to run exe from web app
<p>I need to copy data to card writer attached to local pc from the web app(run card writer exe with parameters with java runtime). What's the best way to implement such functionality? Java applet, web service or something else? </p>
java
[1]