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
2,750,173
2,750,174
jquery .trigger('click') works only once (in < IE9)
<p>I've searched on the other question but could not find the same situation as i'm in.</p> <p>I've created a overview of items with some dropdowns next to it to filter the results (which will be done by ajax). So when a dropdown is changed, I want to trigger the 'page 1' link so the first page of results will be requested and displayed.</p> <p>The problem is, the alert 'go to page 1' only comes up once in Internet Explorer 7 and 8. The second time I change a dropdown there is nothing. (when i place an alert in the 'change' function, it will pop up every time)</p> <p>Shortly my code is</p> <pre><code>$('.pageLink').live('click', function(event){ event.preventDefault(); // read quickfilter here // request the results and do some magic animations to display them alert('go to page 1'); }); $('[name^=quicksearch]').change(function(){ $('.pageLink[href="#1"]').trigger('click'); }); </code></pre>
jquery
[5]
4,332,152
4,332,153
what's an expression and expression statement in c++?
<p>I've read usually statements in c++ ends with a semicon; so that might help explain what an expression statement would be. but then what would you call an expression by giving an example?</p> <p>In this case, are both just statements or expression statements or expressions?</p> <pre><code>int x; x = 0; </code></pre>
c++
[6]
5,660,121
5,660,122
How to embed a url/page redirection script to a closing pop up window
<p>Please am making use of this script bellow to execute a pop up window when the close button is clicked on but i want to add an extra script that will help me open a new url/page when the "OK" button is clicked please can anyone help me out, here is the javascript am using: </p> <pre><code>&lt;script language="Javascript"&gt; var needToConfirm = true; window.onbeforeunload = confirmExit; function confirmExit(){ if (needToConfirm){ my_window = window.open ("1.html","mywindow1","status=1,width=350,height=150"); return "You have attempted to leave this page. If you have made any changes " +"to the fields without clicking the Save button, your changes will be " +"lost. Are you sure you want to exit this page?"; } } &lt;/script&gt; </code></pre>
javascript
[3]
560,472
560,473
how to show only the last four digit of a credit card number
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/773396/how-to-show-only-part-of-an-int-in-c-sharp-like-cutting-off-a-part-of-a-credit">How to show only part of an int in c# (like cutting off a part of a credit card number)</a> </p> </blockquote> <p>I want to display a string in which only the last four digit of the Credit Card # are shown. Also I want to show the reason description. </p> <p>The credit card number is inputted in the "textbox1" the value reason description is taken from the combobox "cmbreason"</p> <p>I want to show the string-> "Received returned card ending in (last 4 cc #) due to (reason) Will dispose off after 45 days"</p> <p>The string is passed to the variable noteline1.</p> <p>How will I achieve it? Please help!</p>
c#
[0]
4,901,419
4,901,420
Java if-else comparison
<p>I've a program test to see if the user input is a positive number and an integer. The <code>if</code> statement test if it is an integer, the <code>else if</code> test if it is negative. If it is a negative or a decimals, the user is asked to input a positive integer. The problem is at the else statement, it is waiting for the user input again, I want it to use the value from <code>System.out.print("Enter the test number: ");</code> if it pass the if and else if test.</p> <p>I try assigning the user input after <code>System.out.println("Please enter an integer!");</code> to an int variable but if the user input a double, I would get an error so I figured this way didn't work. Any insight on how to make the program work is appreciated, thanks!</p> <pre><code>import java.util.Scanner; public class FibonacciNumbersTester { public static void main(String[]args) { //Variables Scanner userDed = new Scanner(System.in); String userChoice = "Y"; while(userChoice.equalsIgnoreCase("Y")) { Scanner userNum = new Scanner(System.in); System.out.print("Enter the test number: "); if(!userNum.hasNextInt() ) { System.out.println("Please enter an integer!"); } else if(userNum.nextInt() &lt; 0 ) { System.out.println("Please enter a postive integer!"); } else { int NumTo = userNum.nextInt(); System.out.println(NumTo); } System.out.print("Would you like to continue? (Y/N)"); userChoice = userDed.next(); } } } </code></pre> <p>Thanks.</p>
java
[1]
5,826,235
5,826,236
Check if a file was included orloaded
<p>Is there any elegant way to check if a file was included by using <code>include</code>/<code>include_once</code>/<code>require</code>/<code>require_once</code> or if the page was actually loaded directly? I'm trying to set up a testing file inside class files while I'm creating them.</p> <p>I'm looking for something similar to Python's <code>if __name__ == "__main__":</code> technique. Without setting globals or constants</p>
php
[2]
1,956,532
1,956,533
Hiding row on dropdown selected index change
<p>I am using an asp.net formsview in my asp.net page and updatepanel . It has two templates Insertemplate and EditTemplate. Indie both templates there is a dropdownlist with id ddlCountry. I have a dropdownlist with all countries. I am showing states dropdown, if country is US and want to hide the row where states dropdown is shown If country is Non US. I am using following code but it is not working:</p> <pre><code>protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) { Control c = (Control)sender; Control nc = c.NamingContainer; if (nc.ID == "fvBillTo" &amp;&amp; rblShipSelect.SelectedValue == "billing") { setShippingAndTaxesDisplay(); DropDownList ddlCountry = c as DropDownList; if (ddlCountry.SelectedItem != null &amp;&amp; ddlCountry.SelectedItem.Value == "001") { HtmlGenericControl trState = nc.FindControl("trState") as HtmlGenericControl; trState.Visible = true; } else { HtmlGenericControl trState = nc.FindControl("trState") as HtmlGenericControl; trState.Visible = false; // code stops here } } } </code></pre>
asp.net
[9]
4,783,953
4,783,954
How do you know the correct path to use in a PHP require_once() statement
<p>As many do I have a config.php file in the root of a web app that I want to include in almost every other php file. So most of them have a line like:</p> <pre><code>require_once("config.php"); </code></pre> <p>or sometimes</p> <pre><code>require_once("../config.php"); </code></pre> <p>or even</p> <pre><code>require_once("../../config.php"); </code></pre> <p>But I never get it right the first time. I can't figure out what php is going to consider to be the current working directory when reading one of these files. It is apparently not the directory where the file containing the require_once() call is made because I can have two files in the same directory that have different paths for the config.php.</p> <p>How I have a situation where one path is correct for refreshing the page but an ajax can that updates part of the page requires a different path to the config.php in the require_once() statement;</p> <p>What's the secret? From where is that path evaluated?</p> <p>Shoot, I was afraid this wouldn't be a common problem - This is occurring under apache 2.2.8 and PHP 5.2.6 running on windows.</p>
php
[2]
3,482,590
3,482,591
Object methods of same class have same id?
<pre><code>class parent(object): @classmethod def a_class_method(cls): print "in class method %s" % cls @staticmethod def a_static_method(): print "static method" def useless_func(self): pass p1, p2 = parent(),parent() id(p1) == id(p2) // False id(p1.useless_func) == id(p2.useless_func) // True </code></pre> <p>In the above code, I dont understand why is the useless_func has same id when it belongs to two different objects?</p>
python
[7]
4,364,763
4,364,764
Reverse htmlentities()
<p>For special characters like <strong>áéí</strong> I can call htmlentities():</p> <p><code>$mycaption = htmlentities($mycaption, ENT_QUOTES);</code> </p> <p>to get the corresponding html entities: </p> <p><code>&amp;aacute;&amp;eacute;&amp;iacute;</code></p> <p>How can I reverse this back to "áéí"? Thanks</p>
php
[2]
2,080,967
2,080,968
how to handle this error in jquery library
<p>I am using particular library for constrain on my textbox it giving me following error. How can I resolve it...</p> <pre><code>$.constrain usage: //jquery.constrain.js: 5Uncaught SyntaxError: Unexpected identifier </code></pre> <p>link for library is at</p> <p><a href="http://jsfiddle.net/U9N63/" rel="nofollow">http://jsfiddle.net/U9N63/</a></p>
jquery
[5]
173,621
173,622
how to create login form using sqlite in iphone view based application?
<p>i want to create login form using sqlite in iphone view based application please help me.give any idea about sqlite in iphone and any sqlite tutorial for iphone application development..</p>
iphone
[8]
3,318,379
3,318,380
How to read from a file char by char in C++?
<p>I'm trying to read from a file, but the only thing I get on working is using getline().</p> <p>The problem is that reading a whole line doesnt to the job for me.</p> <p>My input file looks like this:</p> <pre><code>abc 10 20 bbb 10 30 ddd 40 20 </code></pre> <p>when the first word in each line should be saved as a string, and both number afterwards as ints. The delimiter between the "words" in each line can be either a SPACE or a TAB.</p> <p>So is the only solution is reading char by char? Or is there another solution?</p>
c++
[6]
4,158,964
4,158,965
How to move values around in a HashMap
<p>I have class, lets say Hockey. The Hockey class will set the hockey's score like the code below:</p> <pre><code>public class Hockey{ private HashMap&lt;String, Integer&gt; hockeyScore; public Hockey(){ hockeyScore = new HashMap&lt;String, Integer&gt;(); } public void setHockeyScore(String clubName, int score){ hockeyScore.put(clubName, score); } } </code></pre> <p>A hockey game will only have two teams and two scores, is it possible to swap the scores? For example when we insert into hashmap and it comes out with the keys and values...</p> <blockquote> <p>team 'a' = 23</p> <p>team 'b' = 10</p> </blockquote> <p>then you swap the values in the hashmap which will look like...</p> <blockquote> <p>team 'a' = 10</p> <p>team 'b' = 23</p> </blockquote> <p>Sorry guys, I was wondering if there is a like a method that swaps the scores around, without manually using the 'a' and 'b' reference. Like once you insert any keys and values into the hashmap, this method will swap the values around.</p>
java
[1]
3,488,776
3,488,777
python coding speed and cleanest
<p>Python is pretty clean, and I can code neat apps quickly. But I notice I have some minor error someplace and I dont find the error at compile but at run time. Then I need to change and run the script again. Is there a way to have it break and let me modify and run?</p> <p>Also, I dislike how python has no enums. If I were to write code that needs a lot of enums and types, should I be doing it in C++? It feels like I can do it quicker in C++.</p>
python
[7]
4,697,620
4,697,621
Java - Image flicker
<p>OK so take a look at this vid (it's 3 seconds long..) showing the problem:</p> <p><a href="http://www.screenr.com/VbV" rel="nofollow">http://www.screenr.com/VbV</a></p> <p>See how the images flicker when you first enter the room?</p> <p>Here's how I have the images set up (they are pulled from <code>tiles</code> folder in the .jar file)</p> <pre><code> for (int i = 0; i &lt; 522; i++) { tiles[i] = tk.getImage(this.getClass().getResource(String.format("tiles/t%d.png", i))); } </code></pre> <p>and here's how they are painting on:</p> <pre><code> for (row = 0; row &lt; board.length; row++) { for (col = 0; col &lt; board[row].length; col++) { int index = board[row][col]; g.drawImage(tiles[index], 32 * col, 32 * row, this); } } </code></pre> <p>How do I stop the flicker... </p>
java
[1]
5,210,986
5,210,987
I have to create speech recognition software for iphone
<p>I have to create a sample application of speech recognition for iPhone. Please provide me some resources, API and sample projects.</p>
iphone
[8]
5,398,139
5,398,140
move_uploaded_file how to build a upload directory
<p>I got a easy question, but didn't found answer on Google. I am building an application that will have to run on various servers and I have no idea if it will be installed in root, subdir, or in any other way. Also I don't have idea if it will be installed on IIS, Apache, or other type od server. I have a realy nasty problem. How to build a upload dir that will be always good. That upload dir will be in an application folder, so I have some point to start, but I can't figure it out how to write proper upload dir.</p> <pre><code>//tried this for first time $upload_dir = getcwd().'upload/img'; //then tried this $upload_dir = 'upload/img'; //and tried couple of others, but more lame, so I will not post it... </code></pre> <p>The thing is that warning is raised that says failed to open stream: No such file or directory, and another Unable to move $temp_name to 'upload/img'.</p> <p>Really don't know where is something wrong. I am sure that this is a lame question, but don't know how to do it good.</p>
php
[2]
4,435,644
4,435,645
Saving image captured using webcam in metro apps
<p>I'm new to metro app coding. I know how to capture image and display in image block. But then I want to save in picture library and I do not have any idea about it what to do. Here is the code of what I have done till now.</p> <pre><code>private async void Button_Click_1(object sender, RoutedEventArgs e) { var ui = new CameraCaptureUI(); ui.PhotoSettings.CroppedAspectRatio = new Size(4, 3); var file = await ui.CaptureFileAsync(CameraCaptureUIMode.Photo); if (file != null) { var bitmap = new BitmapImage(); bitmap.SetSource(await file.OpenAsync(FileAccessMode.Read)); Photo.Source = bitmap; } // Do something useful w/ the file } </code></pre>
c#
[0]
5,241,836
5,241,837
User comes though the proper path
<p>I want to make sure that the user comes though the proper path.</p> <p>So if the user hits page2 or page3 without having been to index then I want to send them back to page1.</p> <p>What is the best way to do this?</p>
php
[2]
351,312
351,313
how to draw vertical line dynamically?
<p>I want a vertical line drawn dynamically inside the a table row. Some thing like below in XML:</p> <p>I was able to get all the layout from code, except the "View". Any suggestion would be appreciated!</p> <pre><code>&lt;TableRow&gt; &lt;LinearLayout ...... android:orientation="vertical"&gt; &lt;CheckBox&gt;..&lt;/CheckBox&gt; &lt;Button&gt;..&lt;/Button&gt; &lt;/LinearLayout&gt; &lt;View // this is what I want to achieve, dynamically android:layout_width="2dip" android:layout_height="fill_parent" android:background="#FAFFFB"/&gt; &lt;/TableRow&gt; </code></pre>
android
[4]
1,228,117
1,228,118
Get the running page in an application
<p>For example my application contain 3 pages and run that application when the middle of that application means at 2 page i got a phone call after that phone call again i start that application using menu in home screen .At that time i want a page where we stop in previous(that means 2 page).Give me the suggestions Thanks in advance</p>
android
[4]
915,690
915,691
how to set the row number of row for checkboxlist in asp.net?
<p>I have one checkboxlist with repeat columns=3. If the item count for the datasource of it is less than 20,i need to generate 20 rows with single column.If it is between 21 and 40 then 20 rows and two columns.if it is between 41 to 60 then 20 rows and 3 columns and for more than 60 records then as normal that checkboxlist behave. Any suggestion is appreciated.</p> <p>Thanks Mohak</p>
asp.net
[9]
2,502,555
2,502,556
How to access content page controls from master page in asp.net
<p>it is very easy to access master page control from content page like </p> <pre><code>protected void Page_Load(object sender, EventArgs e) { // content page load event DropDownList thisDropDown = this.Master.FindControl("someDropDown") as DropDownList; userLabel.Text = thisDropDown.SelectedValue; } </code></pre> <p>but how could i access controls of content page from master page. suppose a textbox there in content page and one button is there in master page. i want that when i will click on master page button then i want to show the text of textbox in the content page in the label of master page. how to achieve it. please help me with code sample. thanks.</p>
asp.net
[9]
3,530,566
3,530,567
how to get date from table then store it to variable in php
<p>I have a table that stores current_date by timestamp when users get registered.</p> <pre><code>seeker name.. current_date ali...2012-04-22 22:12:36 </code></pre> <p>Now I have to store this date in some variable. I am using this query:</p> <pre><code>$uname= $_REQUEST['name2']; $qry5= "select current_date from seeker where name='$uname'"; $res4=mysql_query($qry5, $con); $rs5= mysql_result($res4,0); echo $rs5; </code></pre> <p>This query should return the date that is stored in the correspondence of user "2012-04-22", but this query returns the date of today "2012-05-02". Please tell me where I made mistakes. Thanks in advance.</p>
php
[2]
4,578,070
4,578,071
how to populate option menu(drop down box) on the selection of another option menu in python?
<p>I want to know about the python code of which i asked. the thing is:</p> <p>two option menu 1-country 2-city</p> <p>when we select the country ,should be populate all city to second option menu which is related to that particular country which we select from country option menu.</p> <p>please give me reply very soon......</p>
python
[7]
4,244,424
4,244,425
Using compare validator
<p>Is there a way in using compare validator that when you use lessthanequal or greaterthanequal operator it automatically treat the type as int? Let's say adding additional tag in web config or any setup? thanks</p>
asp.net
[9]
4,940,637
4,940,638
Trouble editing a link with str_replace
<p>Ideally I want to use the php script as an include that will be on every page. </p> <p>I have link: <a href="http://www.facebook.com/sharer.php?u=http://123.456.789.101/~user/file.php" rel="nofollow">http://www.facebook.com/sharer.php?u=http://123.456.789.101/~user/file.php</a></p> <p>and I want to make it look like this: <a href="http://www.facebook.com/sharer.php?u=http://MyUrl.com/file.php" rel="nofollow">http://www.facebook.com/sharer.php?u=http://MyUrl.com/file.php</a></p> <p>Essentially I want to replace "123.456.789.101/~user" with "MyUrl.com"</p> <p>There will be multiple links that I am going to need to change. Also, the file name "file.php" part changes for each page. I will not know what the exact page name will be. </p> <p>I tried this but it does not work. If I echo the str_replace it gives me the correct link but I can not get the new link to replace the old link in the page.</p> <pre><code>&lt;?php $string = 'http://www.facebook.com/sharer.php?u=http://123.456.789.101/~user'; $pattern = '123.456.789.101/~user'; $replacement = 'MyUrl.com'; str_replace($pattern, $replacement, $string); ?&gt; </code></pre> <p>Thank you so much.</p>
php
[2]
1,800,355
1,800,356
Bug in rstrip or what?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6311968/python-rstrip-removes-one-additional-character">python .rstrip removes one additional character</a> </p> </blockquote> <p>What is the problem here? it seems that rstrip removes more than necessary in the one to the last line of code.</p> <pre><code>s = 'LedArray.py' s.rstrip('y') 'LedArray.p' s.rstrip('py') 'LedArray.' s.rstrip('.py') 'LedArra' s.rstrip('y.py') 'LedArra' </code></pre>
python
[7]
5,108,075
5,108,076
How can i get 64 bits of the fractional part of the square root of a number in java?
<p>How can i get 64 bits of the fractional part of the square root of a number in java?</p>
java
[1]
3,967,312
3,967,313
Android app with street view image API
<p>I used the street view image API in my android app, and the following code is the way I retrieve images in my app :</p> <hr> <pre><code>URL url2 = new URL("http://maps.googleapis.com/maps/api/streetview?size=400x400" + "&amp;location="+x_str+","+y_str+"&amp;sensor=false"+"&amp;heading="+tmp_Azimuth+"&amp;key=xxxxxxxxxxx"); HttpGet httpRequest = new HttpGet(url2.toURI()); HttpClient httpClient = new DefaultHttpClient(); HttpResponse response = (HttpResponse) httpClient.execute(httpRequest); HttpEntity entity = response.getEntity(); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); InputStream is = bufHttpEntity.getContent(); Bitmap bm = BitmapFactory.decodeStream(is); iv.setImageBitmap(bm); is.close(); </code></pre> <hr> <p>My app sends the above request every seconds, and I usually get a error for "image return null" and get no images after few minutes, but I am sure I didn't exceed the 25000 quota. I checked the API console for the number of images I have requested, but it always shows the usage is 0 !! Could anyone tell me which part of my usage get wrong so I got that error? And why the API console did not show my usage? I have been confused about this for a long time! Thank you very much for the help!</p>
android
[4]
791,407
791,408
Why am I getting the error "parameter pack 'F' must be at the end of the template parameter list"
<p>I have code that uses a variadic template and I'm trying to understand where to put the ellipsis. In the below code I put them, like the error says, at the <em>end</em> of the template parameter list. But I still get errors. What am I doing wrong?</p> <pre><code>template &lt;typename T&gt; struct S { void operator &lt;&lt; (const T &amp;) {} }; template &lt;template &lt;typename, typename...&gt; class ... F, typename T = int&gt; struct N : S&lt;F&lt;T&gt;&gt; ... {}; </code></pre> <blockquote> <p><code>prog.cpp:10:82: error: parameter pack 'F' must be at the end of the template parameter list</code></p> </blockquote>
c++
[6]
1,645,690
1,645,691
How to get Hindi Keyboard/translate into hindi text programatically in Android
<p>I am developing an application in Android Tablet , i created below query to get hindi text dynamically but no response. <a href="http://stackoverflow.com/questions/8006418/how-to-dynamically-convert-and-show-data-in-hindi-in-android">How to dynamically Convert and show data in Hindi in Android</a></p> <p>If it's not possible at least guide me how can i programatically get Hindi Virtual Keboard in my Bee tel Tablet. Or else i need to translate English into hindi dynamically for that i already know if i use <strong>Google Translator API</strong> we can do this but in my case most of the time my application will work <strong>without any internet/network</strong> so in that case i can't use google translator so can any one tell me any other alternatives i have....</p> <p>Please give me reply,for every valuable answer i will give Kudos...</p>
android
[4]
1,263,606
1,263,607
Overloading and a "flexible" function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12682722/overloading-and-any-number-of-arguments">Overloading and any number of arguments</a> </p> </blockquote> <p>Write a new function called superOperator() that can take any number of arguments (up to 3). First, it multiplies all the arguments and stores the result in a variable (result1), then it adds up all the arguments and stores the result in another variable (result2). Finally it returns the difference between result1 and result2 (result1 – result2). If you use overloading, you will end up with three functions with the same name. Examples: superOperator(5) returns 0 superOperator(2, 5) returns 3 superOperator(4, 3, 7) returns 70</p> <p>How do I make a flexible function that will take up to three and as little as 1 parameter and do the assigned tasks? I assume, by the question, that they are all int type but may be need to be read because of "can take any number of arguments.</p>
c++
[6]
3,735,469
3,735,470
Cannot retrieve all saved objects and show in listView
<p>Hi in my application I am saving string information entered by the user. then serializing those string for retrival later. When I go to open the file to where they are saved I always only get the last string that was entered. Can you see where i am going wrong? </p> <p>This is the retrival code</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.lightlist); adapter = new ArrayAdapter&lt;String&gt;(LightList.this, android.R.layout.simple_list_item_1, lightNames); refreshBut = (Button)findViewById(R.id.button1); try { File file = getCacheDir(); fis = new FileInputStream(new File(file, LightSetup.FILENAME )); ois = new ObjectInputStream(fis); String a; while((a = (String)ois.readObject()) != null){ adapter.add(a); setListAdapter(adapter); } ois.close(); } catch (FileNotFoundException e) {e.printStackTrace();} catch (StreamCorruptedException e){e.printStackTrace(); } catch (IOException e) {e.printStackTrace();} catch (ClassNotFoundException e) {e.printStackTrace();} }//end onCreate </code></pre> <p>And this is the serializing code</p> <p>public void onClick(View arg0) {</p> <pre><code> String stringData = data.getText().toString(); try { File file = getCacheDir(); fos = new FileOutputStream(new File(file,FILENAME )); os = new ObjectOutputStream(fos); os.writeObject(stringData); fos.close(); os.close(); } catch (IOException e) {e.printStackTrace();} Intent i = new Intent("com.Sonny.HCIProject.CreateConfirm"); startActivity(i); finish(); }//end onClick </code></pre>
android
[4]
4,349,345
4,349,346
Why is my app filtered for Android 1.5 and 1.6 devices?
<p>Our last update for our application caused it to be filtered out for Android 1.5 and Android 1.6 devices. We did not change anything in our manifest (aside from the updated version code). </p> <p>These similar questions did not help:<br> <a href="http://stackoverflow.com/questions/4952197/android-app-no-longer-visible-by-android-1-5-on-devices">Android App no longer visible by Android 1.5 on devices</a><br> <a href="http://stackoverflow.com/questions/7225372/android-app-not-appearing-in-market-for-1-51-6-devices-bluetooth-is-androidreq">Android app not appearing in Market for 1.5&amp;1.6 devices, Bluetooth is android:required=&quot;false&quot;</a> </p> <p>We created a test app with a stripped down manifest and compiled it with the Android 1.5 SDK. Even this basic app is filtered out. We tried contacting Android Market support five days ago but Google makes it pretty clear they don't want to provide support to developers and say that it's unlikely we'll get a reply.</p> <p>Here is the <strong>full</strong> AndroidManifest.xml for the test app:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.highwaynorth.test" android:versionCode="6" android:versionName="6.0"&gt; &lt;uses-sdk android:minSdkVersion="3" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".MainActivity" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Why is this being filtered?</p>
android
[4]
654,148
654,149
Is possible to position the popup near the LinkButton in datalist asp.net?
<p>I have a DataList that displays the news, and a LinkButton to open a ModalPopupExtender I would like to position the popup near the LinkButton.Per can someone please tell me how to do it with jquery? Thank you all Fabrizio</p>
asp.net
[9]
5,291,761
5,291,762
Redirect to error page when the browser back button hit?
<p>I want to redirect to my Error page. If the user clicks the Back button in my web application. I want to achieve this simply in Javascript. Do anyone knows?</p>
javascript
[3]
3,464,156
3,464,157
What is the most fast way to run 2 for loop ?
<p>I have simple code </p> <pre><code>for( int i = 0 ; i &lt; arr.GetLength(0) ; i++) { for( int j = 0 ; j &lt; arr.GetLength(1) ; j++) { arr[i, j ] = 0; } } </code></pre> <p>I need to make this code to be very fast - so i want to use the <code>Tasks.Parallel.For</code></p> <p>What will be the most fast and effecint way to use the <code>Parallel.For</code> ? </p> <p>It can be like this </p> <pre><code>Parallel.for( int i = 0 ; i &lt; arr.GetLength(0) ; i++) { Parallel.for( int j = 0 ; j &lt; arr.GetLength(1) ; j++) { arr[i, j ] = 0; } } </code></pre> <p>or just use one <code>Parallel.for</code> ? </p>
c#
[0]
4,965,439
4,965,440
PHP - Divide sequence of numbers by decimal seperation
<p>I have a number that represents a software version (ex: 1.2.0.14) and I need to separate each number that is divided by a decimal and store each number as a separate variable.</p> <p>Example:</p> <p>Original number is 1.2.0.14</p> <pre><code>$current_version_major = 1; $current_version_minor = 2; $current_version_revision = 0; $current_version_build = 14; </code></pre> <p>What would be the most efficient way to go about doing this?</p>
php
[2]
2,484,673
2,484,674
Why do I get error can't multiply sequence by non-int of type 'float' PYTHON
<p>I wrote a simple program to calculate tax for some electrical parts, it goes like this:</p> <pre><code>print "How much does it cost?", price = raw_input() print "Tax: %s" % (price * 0.25) print "Price including tax: %s" % (price * 1.25) raw_input ("Press ENTER to exit") </code></pre> <p>And I keep getting this error:</p> <pre><code>Traceback (most recent call last): File "moms.py", line 3, in &lt;module&gt; print "Tax: %s" % (price * 0.25) TypeError: can't multiply sequence by non-int of type 'float' </code></pre>
python
[7]
5,651,451
5,651,452
ASP.NET button click event only works when on Top level master page
<p>I have base.master (top-level), second.master (submaster). A button in the top-level master fires the click event fine, on a page which ues that one master, if its on page where the second.master is used, that button click event doesn't work.</p> <p>No buttons that I place in the submaster work either, heres the code:</p> <pre><code>protected void afd(object sender, EventArgs e) { var a = "C"; } &lt;asp:Button runat="server" OnClick="afd" Text="huh" /&gt; </code></pre> <p>Base.master directive:</p> <pre><code>&lt;%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="True" CodeBehind="Base.master.cs" Inherits="UmbracoWebsite.masterpages.Base" %&gt; </code></pre> <p>Register.master directive:</p> <pre><code>&lt;%@ Master CodeBehind="~/masterpages/Register.master.cs" Inherits="UmbracoWebsite.masterpages.Register" Language="C#" MasterPageFile="~/masterpages/Base.master" AutoEventWireup="True" %&gt; </code></pre>
asp.net
[9]
1,405,168
1,405,169
python interpreter with ellipsis _ function?
<pre><code>&gt;&gt;&gt; type(_) &lt;type 'ellipsis'&gt; &gt;&gt;&gt; 1 + 1 2 &gt;&gt;&gt; _ 2 &gt;&gt;&gt; </code></pre> <p>what's the usefulness of this _ function?</p>
python
[7]
4,287,275
4,287,276
ViewState as Attribute
<p>Instead of this .. </p> <pre><code> public string Text { get { return ViewState["Text"] as string; } set { ViewState["Text"] = value; } } </code></pre> <p>I would like this .. </p> <pre><code> [ViewState] public String Text { get; set; } </code></pre> <p>Can it be done?</p>
asp.net
[9]
5,340,712
5,340,713
assign passed object to member object in constructor
<p>for some reason I can´t achieve this.</p> <pre><code>Line::Line(const Pixel &amp;aStart, const Pixel &amp;aEnd){ start = aStart; end = aEnd; } </code></pre> <p>the Line class:</p> <pre><code>class Line : public Vertex{ public: Line(const Pixel &amp;start, const Pixel &amp;end); Pixel getStart(); Pixel getEnd(); private: Pixel start; Pixel end; }; </code></pre> <p>g++ tells me</p> <blockquote> <p>error: no matching function for call to ‘Pixel::Pixel()’ note: candidates are: </p> <pre><code>- Pixel::Pixel(int, int, int, int, int) - Pixel::Pixel(int, int) - Pixel::Pixel(const Pixel&amp;)//not implemented by me, some sort of default constructor? </code></pre> </blockquote> <p>I thought actually Im using the last constructor, but something doesnt work. Any help much appreciated.</p> <p>EDIT: The Pixel Class:</p> <pre><code>class Pixel{ public: Pixel(int x, int y); Pixel(int red, int green, int blue, int x, int y); void setRed(int red); void setGreen(int green); void setBlue(int blue); void setColor(int r, int g, int b); int getRed(); int getGreen(); int getBlue(); bool isChanged(); int getX(); int getY(); private: int red; int green; int blue; int x; int y; bool hasBeenChanged; }; </code></pre>
c++
[6]
3,992,373
3,992,374
how to convert html2pdf in asp.net with ItextSharp?
<p>i want to create PDF from some XHTML code. is it possible. i use itextsharp but not success. i am finding open source code or Dll. if any one have ItextSharp code to convert Xhtml code to PDf , we welcome.</p>
asp.net
[9]
4,637,770
4,637,771
best way to find a prime number
<p>what will be the best way to find a prime number so that the time complexity is much reduced.</p>
c++
[6]
3,412,193
3,412,194
Not getting Form value, in java
<p>I have a form and bean. From bean I am retreiving values and setting in DTO. That is also setting in FORM. But getter property value is null. I don't know what is the problem here. Can anybody suggest on this?</p> <pre><code>import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.ArrayList; public class LoginForm extends XFormBase { private String title; public void setTitle(String title) { this.titleValue = title; System.out.println(" Form set"+titleValue); } public String getTitle() { this.title = titleValue; System.out.println(" Form get"+titleValue); return title; } } </code></pre>
java
[1]
1,846,344
1,846,345
How to do it right : embedding a png directory to an android project and reffering to its items
<p>what i did was that i added a directory named Images, which is full of png files to src\ (so all the images are in src\Images and then reffered to it in code like this:</p> <pre><code>BitmapFactory.decodeFile("Images\\"+i+".png"); </code></pre> <p>it didnt work, how can it be done correctly?</p>
android
[4]
146,057
146,058
customization of the camera overlay
<p>My first question for customization is at <a href="http://stackoverflow.com/questions/10147458/add-a-uibarbutton-for-zbarreaderviewcontroller/10147745#comment13026724_10147745">here</a> and with help from <a href="http://stackoverflow.com/users/251513/mat">Mat</a>. I can customize it. Now I would like to customize the overlay by loading and view from a nib file... What I am to do is</p> <blockquote> <p>Create another UIViewController called myCustomVIew with its xib</p> <p>Add a toolbar on top and some buttons onto it</p> <p>Set controller.cameraOverlay = aView.view</p> </blockquote> <p>Please take a look at <a href="http://i.stack.imgur.com/jK2OF.png" rel="nofollow">here</a>, so that you can picture what I am doing so far <img src="http://i.stack.imgur.com/jK2OF.png" alt="enter image description here"></p> <p>However when I run my app, the view is shown at <a href="http://i.stack.imgur.com/HQdWh.png" rel="nofollow">here</a>.<img src="http://i.stack.imgur.com/HQdWh.png" alt="enter image description here"></p> <p>I know I have just screwed up somewhere, please advice me about this issue.</p>
iphone
[8]
66,054
66,055
Upload files directly to Amazon S3 from ASP.NET application
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/117810/upload-files-directly-to-amazon-s3-from-asp-net-application">Upload files directly to Amazon S3 from ASP.NET application</a> </p> </blockquote> <p>My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?</p>
asp.net
[9]
5,477,112
5,477,113
asp.net roles provider sample code
<p>i want to implement asp.net role provider to assign users over my LAN to roles and have my asp.net intranet app implement security based on roles.</p> <p>i dont want to use VS to manage this witht he built in tools but rather hand this off to users to manage themselves. i want an admin folder with a few pages for admin roles to be able to create/edit roles and manage users in roles...</p> <p>i am not able to find sample code... can anyone provide me a link to some sample i can use to admin roles and users?</p> <p>thanks </p>
asp.net
[9]
4,551,950
4,551,951
JQuery: Specify placement of error messages inline using Metadata and Validate plugins
<p>I'm doing form validation using JQuery with the validate and metadata plugins. I'm using the metadata plugin so I can specify the rules and messages inline in the html form instead of in the javascript in the page . I'm getting an error when I try to specify the location of the error message using errorPlacement. (If I specify it in the section it works fine, but not if I specify it inline.)</p> <p>Here's what my html looks like:</p> <pre><code>&lt;input name="list" id="list1" type="checkbox" validate="{required:true, minlength:1, messages:{required:'Please select at least one newsletter.', minlength:'Please select at least one newsletter.'}, errorPlacement: function(error, element) { error.appendTo('#listserror');} }"&gt; </code></pre> <p>As reported by the validate debug function, the error is: "<strong>error.appendTo is not a function.</strong>" </p> <p>It works fine if I specify it in the section like this:</p> <pre><code>$().ready(function() { $("#subscribeForm").validate({ errorPlacement: function(error, element) { if (element.attr("name") == "list" ) error.appendTo("#listserror"); else error.insertAfter(element); } }); }); </code></pre>
jquery
[5]
4,635,556
4,635,557
C# - error : Unable to read the project file
<p>Have a bigSmall problem here. I cant open any type of project in visual studios. Even when i creating a new one I get the error: </p> <p><strong>C:\Windows\Microsoft.NET\Framework\v4.0.30319 The element &lt;#text> beneath element is unrecognized.</strong></p> <p>When I choose to open a SLN file or open trough File>Open>Project/Solution I get an other error:</p> <p><strong>One or more projects in the solution were not loaded correctly. Please see the Output Window for details.</strong></p> <p>Anyone knows? Seen some solutions on the net but it doesnt seem they help me with this.</p> <p>Thanks.</p> <p>&lt;></p> <p>I have reinstalled Visual Studios but the bug remain.. Seriously. Ripping my hair of. Really need this to work!</p>
c#
[0]
1,876,206
1,876,207
App icon and Default.png is not working properly in 2G iphone?
<p>My app icon of my application is not working in 2g version of the iphone (icon.png). only appear white icon with application name and also problem in default.png. can any one help me</p>
iphone
[8]
4,639,898
4,639,899
I sometimes recieve a parse error when loading script
<p>I don't know if this has happended to some of you developers before but sometimes when I reload a script on the browser, I receive this php error:</p> <blockquote> <p>Parse error: syntax error, unexpected $end in /.../ on ...</p> </blockquote> <p>It will point to different line numbers on my script for every time it does appear and if I realod the script on the browser, then it loads the page successfully with no errors.</p> <p>My question is though that why does this error sometimes appear when I load the script on the browser?</p>
php
[2]
1,202,327
1,202,328
Global variables in Javascript across multiple files
<p>A bunch of my JavaScript code is in an external file called helpers.js. Inside the HTML that calls this JavaScript code I find myself in need of knowing if a certain function from helpers.js has been called.</p> <p>I have attempted to create a global variable by defining:</p> <pre><code>var myFunctionTag = true; </code></pre> <p>In global scope both in my HTML code and in helpers.js.</p> <p>Heres what my html code looks like:</p> <pre><code>&lt;html&gt; ... &lt;script type='text/javascript' src='js/helpers.js'&gt;&lt;/script&gt; ... &lt;script&gt; var myFunctionTag = false; ... //I try to use myFunctionTag here but it is always false, even though it has been se t to 'true' in helpers.js &lt;/script&gt; </code></pre> <p>Is what I am trying to do even doable? </p> <p>Thanks,</p>
javascript
[3]
74,532
74,533
Why is new being used with a function expression?
<p>While looking at some source code I found this:</p> <pre><code>require["./helpers"] = new function() {...}; </code></pre> <p>Why is <code>new</code> being used here? When I run this on JSLint I get</p> <p><code>Weird construction. Delete 'new'.</code></p> <p>So is this just a form of style, personal preference? Or is there something behind this?</p>
javascript
[3]
2,501,777
2,501,778
how to get timezone offset value
<p>My requirement is , i need to convert the time zone value to offset value for ex.. Asia/Dubai to +4 .. consider am intializing date in js. </p> <pre><code>var currentDate = new Date(); </code></pre> <p>and it is possible to set the time zone and get the offset..</p> <pre><code>currentDate.setTimezone("Asia/Dubai"); var offsetValue=currentDate.getTimezoneOffset(); alert('offsetValue---'+offsetValue); </code></pre> <p>its not working.. page error at set time zone.. is there any other way to get the offet value? Need to consider DST too..</p>
javascript
[3]
60,290
60,291
Will C/C++ libraries work on Android Phone
<p>Does anyone have any experience using JNI to call native C/C++ libraries in Android? Is the environment suitable for running C/C++ libraries and if so is there anything specific about the environment which you need to accommodate? Thanks</p>
android
[4]
2,967,366
2,967,367
Understanding flow of object creation
<p>I'm new to java and I wonder if there is simple way to know flow like the following of object creation, I'm using eclipse and when I write <code>new ObjectInputStream</code> and press <kbd>CTRL</kbd>+<kbd>SPACE</kbd>. I don't see any option that I can enter new BufferedInputStream (I have copied the code from example) and than to create new object for FileInputStream etc.</p> <pre><code>in = new ObjectInputStream(new BufferedInputStream(new FileInputStream("emp.dat"))); List temp = (List)in.readObject(); </code></pre> <p>I give that example since this is the first time that I saw this kind of creation new object flow and I want to use some best practice for the next times.</p>
java
[1]
5,626,518
5,626,519
How to pass array value from one class to other class
<p>How can i pass an array value from a delegate class to view controller class</p> <pre><code>const char *query2=[tempQuery UTF8String]; NSMutableArray *arr1 = [[NSMutableArray alloc]init];; if (sqlite3_prepare_v2(database,query2,-1,&amp;statement1,NULL)==SQLITE_OK) { //NSLog(@"vt", vt); while (sqlite3_step(statement1)==SQLITE_ROW) { vt=[[[Question1 alloc]init]autorelease]; vt.question=[NSString stringWithUTF8String:(char *)sqlite3_column_text(statement1,3)]; [arr1 addObject:vt.question]; NSLog(@"arr1 is %@",[arr1 description]); </code></pre> <p>Where arr1 is an array value. So that array value has to pass in another class.</p> <p>Thanks in advance.</p>
iphone
[8]
3,539,966
3,539,967
What's the best way to learn jQuery?
<p>I have just started learning jQuery and what I've found is that there are tutorials for the basics and copy-paste tutorials for premade plugins, but nothing on how to get to that advanced level that I have found. What would you recommend as a way to learn jQuery?</p>
jquery
[5]
3,663,617
3,663,618
How can I prevent selecting text in Google Chrome?
<p>Doesn't oEvent.preventDefault(); work in GC? I need to prevent selecting text when the onmove event is triggered. </p> <p><b>EDIT:</b> It turns out to be very easy...</p> <pre><code>function disableSelection() { document.onselectstart = function() {return false;} // ie document.onmousedown = function() {return false;} // others } function enableSelection() { document.onselectstart = null; // ie document.onmousedown = null; // others } </code></pre> <p>After that, there's no text selection triggered on the move event (ie. on the select event -- ie - indeed ie!)</p>
javascript
[3]
2,519,351
2,519,352
How to print the name of an array in java
<p>I wanna print the name of an array within a function that I pass as an String argument:</p> <pre><code>public static String[][] cleanCSVtable(String[][] data_table) {} </code></pre> <p>instead of something like this: </p> <pre><code>[[Ljava.lang.String;@ba4539 </code></pre> <p>For example lets assume that I have defined this array outside of the main function as </p> <pre><code>public static String [][] XYZ = null; </code></pre> <p>I wanna print XYZ within this function instead of </p> <pre><code>[[Ljava.lang.String;@ba4539. </code></pre> <p>Any hacks/hints/ideas?</p>
java
[1]
3,452,539
3,452,540
how can we include favourite functionality in android?? please provide any example
<p>how can we include favourite functionality in android?? please provide any example i mean to say there is a one phase in my app "favourite". when you click on particular item from the list that particular item will be add into the favourite and you can view that selected item in that favourite list.</p>
android
[4]
1,428,681
1,428,682
Changing image depending on div contents
<p>I have a jquery div returning simple text and I want to display a different image without the user noticing a flash every few seconds. </p> <pre><code>&lt;script&gt; function status(){ $('#status').empty(); $('#status').load('status/&lt;?php echo $call-&gt;sid;?&gt;'); setTimeout(status, 5000);} status(); &lt;/script&gt; </code></pre> <p>So this refreshes every 5 seconds to get the status. How can I assign various images depending on the returned results? Ex (calling, in-progress, completed).</p>
jquery
[5]
2,142,307
2,142,308
chat application implementation in iphone os
<p>I am required to make an app which includes the feature for multiple chat client. I have seen several apps on itunes. I was just wondering how to implement this. Am new to iphone application development and not aware where to begin.</p> <p>Also, I have seen the mention of xmpp framework. Can someone please elaborate a bit on this or some other information to implement it.</p> <p>Thanks in advance.</p>
iphone
[8]
3,770,632
3,770,633
Load javascript into bottom of head
<p>I need some help. Is there a way to use javascript to add scripts src's to the end of the head? I have some dynamic scripts that are now allowing me to put my scripts at the bottom of the head Is there a way to do this with javascript.</p> <p>For example, I need these to be at the bottom of the head tag:</p> <pre><code>&lt;script src="/jQuerySlider/jquery-1.6.4.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/jQuerySlider/jquery.easing.1.3.js" type="text/javascript"&lt;/script&gt; </code></pre>
javascript
[3]
2,480,961
2,480,962
Generate some unique numbers and put into array
<p>I'm trying to create a method that produces 10 unique random numbers, but the numbers are not unique, I get several duplicates! How can I improve the code to work as I want?</p> <pre><code> int[] randomNumbers = new int[10]; Random random = new Random(); int index = 0; do { int randomNum = random.Next(0, 10); if (index == 0) { randomNumbers[0] = randomNum; index++; } else { for (int i = 0; i &lt; randomNumbers.Length; i++) { if (randomNumbers[i] == randomNum) break; else { randomNumbers[index] = randomNum; index++; break; } } } } while (index &lt;= 9); foreach (int num in randomNumbers) System.Console.Write(num + " "); </code></pre> <p>EDIT 2: I have corrected all errors now, but this code isn't working becuase the numbers are not unique! I have updated my code above to the latest version. I preciate some help to solve this! Thanks!</p>
c#
[0]
5,036,791
5,036,792
good C# interview questions book
<p>Please suggest me a good C# interview questions book</p>
c#
[0]
1,735,301
1,735,302
cannot pass string variable to function
<p>When I am trying to run this code the variable $column it's not passing. But instead if I use a string (eg "ABC") it gets passed. What's wrong?</p> <pre><code>(a) calling function foreach ($columns as $column) { if(PMA_SQP_isKeyWord($column)) { (b) called function function PMA_SQP_isKeyWord($column) { </code></pre>
php
[2]
4,094,721
4,094,722
How to handle multiple popup dialogs in Web Application
<p>What is the best way to handle multiple popup dialogs in ASP.Net Web Application? Trying I have approx 5+ popup dialogs to show in the main page. currently I am using the ModalPopUpExtender to display the first popup. Do I have to Create a (New Panel and ModalPopUpExtender) for every popup? All this code in the main page would make it very cluttered.</p>
asp.net
[9]
4,922,521
4,922,522
Creating a System.Func without specifying the generic argument
<p>I have the following piece of code I use in my tests which has a bit of duplication:</p> <pre><code>Func&lt;string, User&gt; getUser = GetFirstItem&lt;User&gt;; Func&lt;string, Plan&gt; getPlan = GetFirstItem&lt;Plan&gt;; _planLeader = UserRoleHelper.GetUserWithAdditionalPlans(_commonDao, getUser, getPlan, 5); </code></pre> <p>The GetFirstItem method has the following signature:</p> <pre><code> T GetFirstItem&lt;T&gt;(string whereClause) where T : class </code></pre> <p>My problem is that I am having to create two separate variables getUser and GetPlan for the 2 different function calls in order to explicitly declare the generic argument.</p> <p>Is it possible to create a System.Func without declaring the generic type?</p> <p>Something like:</p> <pre><code>Func&lt;T, User&gt; getUser = GetFirstItem&lt;T&gt;; </code></pre> <p>This obviously will not compile as T is not defined.</p> <p>Is there a way round this?</p>
c#
[0]
3,180,774
3,180,775
Android Trun on backlight
<p>I need to turn on screen back-light and keyboard backlight when my application receive notification. I have tried with PowerManager It it wasn't successful. </p> <p>Is there any way to turn on screen and keyboard backlights?</p> <p>Thank You. </p>
android
[4]
5,343,319
5,343,320
Templated Vector and Colour Maths library (Specialisation)
<p>I have created a maths library that operates via templates, it allows the user to specify the size and type of the array within a class which is then used to create a maths vector of any dimension up to four. As soon as I went to create a colour class, it struck me how similar the vector and colour class are. Is there anyway in which I could reduce code reuse and use some form of inheritance or specialisation to separate:</p> <ol> <li>Specific functionality (ie vector3 does not have a setXYZW() function, instead only a setXYZ()) to the dimension of which it can only be used in.</li> <li>Colour class and vector class can both (in terms of array data member) be of size ranging from 1 to 4 and the both share the same operators, but differ in their use in some circumstances such as a multiply vector differs from a multiply colour.</li> </ol> <p>My knowledge of templates is not that good, so I would very much appreciate if anyone can show me the best solution to such a situation?</p> <p><pre> <code>template &lt; std::size_t N = 3, typename T = float > class Vector { typedef T Degree, Radian; private: T m_vecEntry[N]; public: // arithmetic operations Vector operator + (const Vector &amp; _vector) const; Vector operator - (const Vector &amp; _vector) const; Vector operator * (const Vector &amp; _vector) const; Vector operator * (float _val) const; }; </pre></code></p> <p><pre> <code>template &lt; std::size_t N = 4, typename T = float > class Colour { private: T m_colEntry[N]; public: // arithmetic operations Colour operator + (const Colour&amp; _colour) const; Colour operator - (const Colour&amp; _colour) const; Colour operator * (const Colour&amp; _colour) const; Colour operator * (float _val) const; }; </pre></code></p>
c++
[6]
2,422,163
2,422,164
iphone mailcomposer
<p>i have my tabbar and i can hide this tab bar by the following code below but when tapping cancle of iphone mail composer does not return to the default screen can you please guide how can i do this</p> <pre><code>-(void)displayComposerSheet { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@""]; // Set up recipients NSArray *toRecipients = [NSArray arrayWithObject:@""]; NSString *emailBody = @""; [picker setMessageBody:emailBody isHTML:NO]; //[self presentModalViewController:picker animated:YES]; UIViewController *xyz=(UIViewController*)[myMarketsVicAppDelegate getMainTabbarRef]; [xyz presentModalViewController:picker animated:YES]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self dismissModalViewControllerAnimated:YES]; } </code></pre>
iphone
[8]
1,403,390
1,403,391
How can I check whether multiple variables are equal to the same value?
<p>How do I compare multiple items? For example, I wish to check if all the variables A, B, and C are equal to the char 'X' or all three are equal to 'O'. (If 2 of them are X and one is O it should return false.)</p> <p>I tried:</p> <pre><code>if (A, B, C == 'X' || A, B, C == 'O') { //Do whatever } </code></pre> <p>but it didn't work. What is the best way to do this?</p>
c++
[6]
1,466,918
1,466,919
Converting string to double in C#
<p>I have a string with double-type values ("value1#value2#value3#...). I split it to string table. Then i want to convert an element from this table to double, and I get a n error. What is wrong? How can I get from this string (string a) values in double type?</p> <p>Greetings!</p> <pre><code>string a = "52.8725945#18.69872650000002#50.9028073#14.971600200000012#51.260062#15.5859949000000662452.23862099999999#19.372202799999250800000045#51.7808372#19.474096499999973#"; string[] tablicaLatLng = a.Split(new char[] { '#' }); for (int i = 0; i &lt; tablicaLatLng.Length; i++) { Console.WriteLine(tablicaLatLng[i]); } Console.WriteLine(tablicaLatLng[0]); // 52.8725945 Convert.ToDouble(tablicaLatLng[0]); // error </code></pre>
c#
[0]
4,920,512
4,920,513
IE7 turns the edges of my rollover images black
<p>I am using jquery script for my image rollovers and I am encountering a problem in IE7 only where all of my images load in properly but once you rollover the image and roll out the edge of the top image turns black. Does anyone have any idea as to what might be causing this. The site can be found at free-to-be-me.com/ask-ava.php.</p> <p>Here is the code i am using:</p> <pre><code> $(function() { $(".bw").hover(function() { $(this).animate({ opacity: 0.0 }, 200); }); }); $(function() { $(".bw").mouseout(function() { $(this).animate({ opacity: 1.0 }, 200); }); &lt;div class='liner-nav'&gt; &lt;div class='container'&gt; &lt;a class='html' href='ava-lb/options.html' style='border:none;' rel='group'&gt;&lt;img src='images/ava/School_pink.png' class='bw' style='border:none;' /&gt;&lt;/a&gt; &lt;img src='images/ava/School_blue.png' class='colour' alt='' /&gt; &lt;/div&gt; &lt;/div&gt; }); </code></pre> <p>Thanks in advance for your help.</p> <p>EDIT</p> <p>I have been trawling the internet for hours now trying various different hacks to try to stop IE7 from ballsing up PNGs. I have come to the conclusion that although IE7 can handle PNGs with the minimum of fuss, it doesn't handle the change of opacity well. So i have opted for a straight image swap as it is achieves the same thing. Thanks for your help.</p>
jquery
[5]
5,952,096
5,952,097
What does this 'static' mean and why is it like that
<pre><code>public class tt { static{ System.out.println("class tt"); } } </code></pre> <p>It the first time ive come across it and im wondering what it is and what it's used for</p>
java
[1]
1,041,424
1,041,425
PHP require/include coding practices
<p>Just curious...when writing a require/include statement, what do you prefer as better practice?</p> <pre><code>require('filename.php'); </code></pre> <p>or</p> <pre><code>require 'filename.php'; </code></pre> <p>Thanks!</p>
php
[2]
4,059,078
4,059,079
Making a char** with std::?
<p>I have an opengl function that requires a const char**. So essentially a vector of strings. I was wondering if this could be done using the C++ Standard Library without making a vector of <code>const char*</code> which would demand heap allocation.</p>
c++
[6]
281,198
281,199
Simple JavaScript Word Count Function
<p>I finally started to learn JavaScript and for some reason I can't get this simple function to work. Please tell me what I am doing wrong.</p> <pre><code>function countWords(str) { /*Complete the function body below to count the number of words in str. Assume str has at least one word, e.g. it is not empty. Do so by counting the number of spaces and adding 1 to the result*/ var count = 0; for (int 0 = 1; i &lt;= str.length; i++) { if (str.charAt(i) == " ") { count ++; } } return count + 1; } console.log(countWords("I am a short sentence")); </code></pre> <p>I am getting an error <code>SyntaxError: missing ; after for-loop initializer</code></p> <p>Thanks for your assistance</p>
javascript
[3]
552,713
552,714
Is there any way to take only part of string in jquery?
<p>I have some anchor links which has id's starts with <code>"menu-"</code>. </p> <pre><code>&lt;a href="" id="menu-alphabetic"&gt; &lt;a href="" id="menu-city"&gt; &lt;a href="" id="menu-country"&gt; </code></pre> <p>In my jquery code, I want to take only anchor links' ids after <code>menu-</code></p> <pre><code>For example: $("a[id^=menu-]").click(function(){ e.preventDefault(); $(this).tab('show'); }); </code></pre> <p>But <code>$(this)</code> takes all id. I want only word which comes after <code>menu-</code>.</p>
jquery
[5]
4,605,887
4,605,888
How build hash map for key and 2 values in Java?
<p>I want to build hash map to contain</p> <pre><code>&lt;string, array and double(sum(double2). array contain string, int1, double1, double2 (int1*double1) </code></pre> <p>for example:</p> <pre><code>string1, word1,2,1.1,2.2 , 7.3 (2.2+1.1+4.0) string1, word2,1,1.0,1.1 , 7.3 string1, word3,2,2.0,4.0 , 7.3 string2, ... .. ... stringn,.... </code></pre>
java
[1]
913,374
913,375
Incorrect behaviour of size() and at() in string class
<p>I've got this code:</p> <pre><code>string test("żaba"); cout &lt;&lt; "Word: " &lt;&lt; test &lt;&lt; endl; cout &lt;&lt; "Length: " &lt;&lt; test.size() &lt;&lt; endl; cout &lt;&lt; "Letter: " &lt;&lt; test.at(0) &lt;&lt; endl; </code></pre> <p>The output is strange:</p> <pre><code>Word: żaba Length: 5 Letter: � </code></pre> <p>As you can see, length should be 4 and letter: "ż".</p> <p>How can I correct this code to work properly?</p>
c++
[6]
1,145,827
1,145,828
Create a private namespace independent of other javascript?
<p>I am creating a script which may be used on a variety of websites. Since I don't know the circumstances of it's use, I'd like to be able to place it in a sandbox of sorts, where it does not affect other javascripts on the page, and is in turn not effected by other javascripts.</p> <p>The most basic start is using a self-invoking function:</p> <pre><code>(function(){ x = function(){ alert('hi!'); x(); })(); </code></pre> <p>But my problem is that if x is already assigned as such, you cannot override it:</p> <pre><code>x = function(){ alert('too late!'); (function(){ x = function(){ alert('hi!'); x(); })(); </code></pre> <p>This will alert "too late!" rather than "hi!", which is not my desired effect. Can anyone help?</p>
javascript
[3]
6,504
6,505
Accessing password protected url from python script
<p>In python, I want to send a request to a url which will return some information to me. The problem is if I try to access the url from the browser, a popup box appears and asks for a username and password. I have a username and password for this url however, I don't know how to make python automatically complete these fields to access the URL. </p> <p>This is my code that returns a 401 error:</p> <pre><code>bing = "https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=% (term)s&amp;$top=50&amp;$format=json" %__function() results = urllib2.urlopen(bing).read() </code></pre> <p>EDIT: Just for clarification, the function <code>function</code> returns a variable called <code>term</code> which is the term being queried in the URL</p>
python
[7]
4,077,388
4,077,389
Running jQuery inside $(window).load() function but not inside $(document).ready function
<p>I have this existing function that will icons in a web page using jQuery UI position plugin:</p> <pre><code>&lt;script type='text/javascript'&gt; jQuery( document ).ready( function( $ ) { var element_selector='.test'; if ( $(element_selector).length !== 0) { //jQuery UI Position code here } }); &lt;/script&gt; </code></pre> <p>This function is found near the footer section of the HTML although in some places it outputs on the head section. Someone suggested me to load this jQuery inside $(window).load() function. The reason is that $(document).ready event is fired when DOM is loaded, so it’s fired when the document structure is ready, but before images are loaded.</p> <p>$(window).load() event is fired after whole content is loaded. So .position() method might not calculate correct position when it’s fired to early (before images are loaded). </p> <p>If this true, how to revise the above load in $(window).load(). Thanks.</p> <p><strong>UPDATE</strong>: I have changed from:</p> <pre><code>jQuery( document ).ready( function( $ ) { </code></pre> <p>To this:</p> <pre><code>jQuery(window).load(function($) { </code></pre> <p>And I get this error in the console:</p> <pre><code>Uncaught TypeError: object is not a function </code></pre> <p>It fails on this line:</p> <pre><code>$(divname515e62e8355b0).children().wrapAll('&lt;div class="mydoc cf"&gt;'); </code></pre> <p>where divname515e62e8355b0 is the selector define here:</p> <pre><code>var divname515e62e8355b0 = '#test_selector'; </code></pre>
jquery
[5]
4,116,343
4,116,344
How to run openGrads script commands using c#
<p>I have been encountering the error of Metafile not open. When I execute the c# program the command line opens up and shoots this error without performing the activity to be initiated by the script. How do I solve this? Here is the code where I pass all my commands--</p> <pre><code>static void Main(string[] args) { ProcessStartInfo info = new ProcessStartInfo(); ExecuteMultipleCommandsReturnProcess(@"C:\OpenGrADS\Contents\Cygwin\Versions\2.0.a9.oga.1\i686\opengrads.exe", " ", new List&lt;string&gt;() { "l", "open" }, null, null); } </code></pre>
c#
[0]
1,648,027
1,648,028
Can I stop <a> action?
<p>Basically if I have <code>&lt;a href="" onclick="someFunction();"&gt;&lt;/a&gt;</code> which will download a file. If the user says NO to <code>confirm("Do you agree?")</code> dialog, we don't want to let the user download this file. </p> <p>This is all done with HTML and Javascript. All on client.</p> <p>We want to kill the <code>&lt;a&gt;</code> to continue. Is it possible? Or can we deferred <code>&lt;a&gt;</code> ?</p> <p>Thanks</p>
javascript
[3]
2,941,407
2,941,408
How to filter out repeating HTML with jQuery
<p>I have some HTML I'm working on using programming from a CMS I didn't write and it's outputting some HTML radio options and is repeating them. Unfortunately I can't control the output of this programming, so I'm attempting an alternative route of just trying to only allow 1 instance of the HTML to show up. Here's an example:</p> <pre><code>&lt;label class="fc_radio" for="shipping_service_101"&gt;&lt;input type="radio" name="shipping_service" id="shipping_service_101" value="101|45" class="fc_radio fc_required"&gt;&lt;span class="fc_shipping_carrier"&gt;USPS International Shipping Rate (tracking included)&lt;/span&gt; &lt;span class="fc_shipping_cost"&gt;&lt;span class="fc_currency_symbol"&gt;$&lt;/span&gt;45&lt;/span&gt; &lt;/label&gt; &lt;label class="fc_radio" for="shipping_service_101"&gt;&lt;input type="radio" name="shipping_service" id="shipping_service_101" value="101|45" class="fc_radio fc_required"&gt;&lt;span class="fc_shipping_carrier"&gt;USPS International Shipping Rate (tracking included)&lt;/span&gt; &lt;span class="fc_shipping_cost"&gt;&lt;span class="fc_currency_symbol"&gt;$&lt;/span&gt;45&lt;/span&gt; &lt;/label&gt; </code></pre> <p>As you can see, it's identical code. Is there anyway with jQuery to essentially filter out the extra HTML that's being outputted and keep 1 instance of the HTML inside the ? They're inside a div with this ID and Class:</p> <pre><code>&lt;div id="fc_shipping_methods_inner" class="fc_shipping_methods_inner"&gt; REPEATING HTML HERE &lt;/div&gt; </code></pre>
jquery
[5]
4,457,715
4,457,716
Android app development software
<p>What is the best software for creating Android applications? This software have to have possibility to make string connection to remote database. Also, have to have possibility to create or change allready created templates and screens. One more think I need from that software is possibility to make push notifications for all or just selected users (users who selected some specific category of news or something like that).</p>
android
[4]
4,949,529
4,949,530
how to console with google chrome
<p>I want to console with google chrome when I test my website. If I found some error, I want to see in Developer > Developer Tools >console using link. Now, my google chrome doesn't shown error link. eg. when I query from database, and I show this query using jquery but It has some error. But console can't not output this error link and can't give me something.php code. Please answer.</p>
php
[2]
2,686,804
2,686,805
Sending a whatsapp message from app
<p>is there a way in android to send a whatsapp message straight from my own app? I want the user to select a whatsapp contact and then have my app send the whatsapp message</p> <p>Thanks</p>
android
[4]
4,890,331
4,890,332
ASP.NET Wizard Steps: Getting form data to next page?
<p>I can't figure out how to pass form data from a Wizard Steps Control to a new page. I posted <a href="http://stackoverflow.com/questions/1461273/pass-hiddenfield-value-within-a-wizardsteps-control-to-next-site">THIS POST</a> some days ago, but the answer here didn't really help me because i can't even get the value from a TextBox on the new page.</p> <p>I put tried to put this insted of the hiddenfield but <code> &lt;asp:TextBox ID="amount" runat="server" Text="tester"&gt;&lt;/asp:TextBox&gt;</code> but the <code>Request.Form["amount"]</code> is still just null.</p> <p>How do i pass form data from a wizard steps control to a new page? Should this really be that hard? </p>
asp.net
[9]
5,099,055
5,099,056
Android, get app size
<p>I'm looking for a way to calculate the size of an installed Android application/package. I can't find this information in neither ApplicationInfo nor PackageInfo objects. From the ApplicationInfo I can get the path for the data and the app itself. Data is a directory structure, but when attempting to read it recursivly I get a nullpointer. Is there any better way of doing it? Any sample code?</p>
android
[4]
4,967,062
4,967,063
Client server interaction
<p>Hi guys i am new to android, can anyone guide me how server interact with client. Please give some useful links for simple client server interaction with source file. </p>
android
[4]
633,224
633,225
help with navigation for iphone
<p>this is my flow <strong>navA-> navB->navC</strong> then when user press NavC back button he goes to navA</p> <p>but when user again press navA he should go to navB but its going on navC i dont know why</p> <p>in navC i did this</p> <pre><code>XMLAppDelegate *appDelegate=(XMLAppDelegate*)[UIApplication sharedApplication].delegate; [self.view removeFromSuperview]; [appDelegate.window addSubview:appDelegate.preLoginNavController.view]; </code></pre> <p>and in navA i am doing this to go to navB //<strong>this is preLoginNavController.m</strong> XMLAppDelegate <em>appDelegate=(XMLAppDelegate</em>)[UIApplication sharedApplication].delegate;</p> <pre><code> //appDelegate.RootNavController.shouldHasBackButton = YES; [self.navigationController.view removeFromSuperview]; [appDelegate.window addSubview:appDelegate.navigationController.view];//[navigationController view] </code></pre> <p>and in appdidfinish()</p> <pre><code>[window addSubview:[preLoginNavController view]]; [window makeKeyAndVisible];**strong text** </code></pre> <p><strong>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'</strong> thats why i am using this a</p> <pre><code>appDelegate.newsNavController.shouldHasBackButton = YES; [appDelegate.window addSubview:appDelegate.newsNavController.view]; </code></pre> <p>do i need to push in the mehtod defined bu you or i can use in betwwen while adding subview??</p> <p>like</p> <pre><code>AccountApplication* controller = [[AccountApplication alloc] initWithNibName:@"AccountApplication" bundle:nil]; // [self.navigationController pushViewController:controller animated:YES]; // [controller release]; </code></pre>
iphone
[8]