Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
1,615,834
1,615,835
jQuery insertion of an anchor doesn't work
<p>My original HTML is:</p> <pre><code>&lt;div class="add-inv-button"&gt;Add to Your Game Plan &lt;/div&gt; </code></pre> <p>I have the following jQuery code:</p> <pre><code> jQuery('.add-inv-button').click(function(){ jQuery(this).removeClass('add-inv-button'); jQuery(this).addClass('completed-button'); jQuery(this).html('&lt;a class="open-popup" href="#popup01"&gt;Done it!&lt;/a&gt;'); }); </code></pre> <p>And I have the following simplelightbox reference:</p> <pre><code>$(function(){ jQuery("a.open-popup").simpleLightbox({ closeLink:'a.close' }); }) </code></pre> <p>This is what's supposed to happen: After I click on "add-inv-button", the HTML updates, creating an anchor with class "open-popup". After I click on this anchor, the simplelightbox div at #popup01 (on the same page) appears (with z-index of 999).</p> <p>However, this is what actually happens: After I click on the "add-inv-button", the HTML updates correctly. But when I click on the new anchor, the browser does not jump to the #popup01 simplelightbox on the page. It clears the page and tries to link to www.mydomain.com/#popup01 instead, resulting in an empty page.</p> <p>It seems like the jQuery simplelightbox doesn't detect the a.open-popup link because the link was added after the page originally loaded. If I refresh the page, then everything works correctly.</p> <p>How should I fix this? Thanks.</p>
jquery
[5]
663,185
663,186
postToWall on facebook After login in iphone
<p>Does anybody have idea about how to post a wall on facebook after login button in iphone. i have to post default image and text. If yes in which fb class it have to write .i have latest sdk for facebook. Thanks </p>
iphone
[8]
2,532,553
2,532,554
android style is not taken into account
<p>I have a problem while creating styles in android:</p> <p>When I use </p> <pre><code>android:textAppearance="?android:attr/textAppearanceSmall" </code></pre> <p>in Button for instance, that's working fine, but if I create a styles.xml like:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;style name="smalltext" parent="@style/Text"&gt; &lt;item name="android:textSize"&gt;10sp&lt;/item&gt; &lt;item name="android:textColor"&gt;#FFF&lt;/item&gt; &lt;item name="android:textAppearance"&gt;?android:attr/textAppearanceSmall&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>and replace in Button:</p> <pre><code>style="@style/smalltext" </code></pre> <p>nothing is taken into account.</p> <p>Would you have any idea of what could be wrong ?</p> <p>thanks a lot, Luc</p>
android
[4]
2,265,263
2,265,264
Transparent Background in Java SWT Label
<p>Is there anyway in Java SWT that I can place a label on top of another label and then have the label on top to have a transparent background?</p> <p>I am doing this in a class that extends Composite as I want to create a custom SWT "fancy button" out of 2 labels. So the label below will be the lable that consist of only an image while the one on top will be the label with the text of the "fancy button". But the label on top has to have a transparent background so as to not cover the image below it.</p> <p>Currently, the label on top is covering the label below.</p> <p>Any idea how I could do this?</p> <p>Thanks!</p>
java
[1]
5,404,043
5,404,044
What happens when when the start value of a python substring command is negative?
<p>Example:</p> <pre><code>mystring = " ... some string ... " mystring[-50:40] # &lt;--- what does this mean? </code></pre>
python
[7]
1,771,041
1,771,042
Getting the Python PMW module?
<p>I got a game which uses PMW in its code and I wanted to know is that already installed with Python, or does it come separate? Whre can I get it from so I could get this game running?</p> <p>I have difficulties opening it as it requires PMW.</p>
python
[7]
4,447,079
4,447,080
State List drawable does not show up in all screens
<p>I have a drawable named btndonate.xml</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" android:constantSize="true" android:dither="true" android:variablePadding="true" &gt; &lt;item android:drawable="@drawable/donate_hover" android:state_pressed="true" /&gt; &lt;item android:drawable="@drawable/btn_donate" android:state_window_focused="true" /&gt; &lt;item android:state_focused="true" android:drawable="@drawable/donate_hover"&gt; &lt;/item&gt; &lt;item android:state_focused="false" android:drawable="@drawable/btn_donate"&gt;&lt;/item&gt; &lt;/selector&gt; </code></pre> <p>I am using it in activity's xml like </p> <pre><code> &lt;Button android:layout_centerInParent="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/btndonate" android:id="@+id/btn_home_donate"&gt;&lt;/Button&gt; </code></pre> <p>i am using the same button with different id's in my other activities xmls.. but it shows up in some and hidden in others i dont know y the same button does not show up n all my activities though the drawable is same for all of them .. ??</p> <p>any one plz help ??</p>
android
[4]
3,555,013
3,555,014
how to pre-select an option in a dropdown in javascript?
<p>i have this code for a dropdown</p> <pre><code>if (chosen == "Parade") { selbox.options[selbox.options.length] = new Option("Select Venue",""); selbox.options[selbox.options.length] = new Option("Benavides Park","Benavides Park"); selbox.options[selbox.options.length] = new Option("CME Auditorium","CME Auditorium"); selbox.options[selbox.options.length] = new Option("Engineering Sports Complex","Engineering Sports Complex"); selbox.options[selbox.options.length] = new Option("Field in front of Grandstand","Field in front of Grandstand"); selbox.options[selbox.options.length] = new Option("Plaza Mayor","Plaza Mayor"); selbox.options[selbox.options.length] = new Option("Quadricentennial Park","Quadricentennial Park"); selbox.options[selbox.options.length] = new Option("Rectors Hall","Rectors Hall"); selbox.options[selbox.options.length] = new Option("Seminary Gym","Seminary Gym"); selbox.options[selbox.options.length] = new Option("Tinoco Park","Tinoco Park"); selbox.options[selbox.options.length] = new Option("UST Grandstand","UST Grandstand"); selbox.options[selbox.options.length] = new Option("UST Gymnasium","UST Gymnasium"); selbox.options[selbox.options.length] = new Option("Venue not listed/outside UST","Venue not listed/outside UST"); } </code></pre> <p>what is the code for the option "Benavides Park" to be the default value? in html it's like this</p> <pre><code>selected="selected" </code></pre> <p>how about in javascript?</p>
javascript
[3]
4,034,233
4,034,234
Array.sort() doesn't sort numbers correctly
<p>In Chrome 14, and Firefox 5 (haven't tested other browsers), the following code doesn't sort the numbers correctly:</p> <pre><code>&lt;script&gt; a = new Array(); a.push(10); a.push(60); a.push(20); a.push(30); a.push(100); document.write(a.sort()) &lt;/script&gt; </code></pre> <p>It returns 10,100,20,30,60</p> <p>I've tried different numbers, and it always acts as if the 0s aren't there and sorts the numbers correctly otherwise. Anyone know why?</p>
javascript
[3]
2,186,161
2,186,162
Is Android a language or a framework/platform?
<p>I know that Android uses the Java language with a limited Java SDK and that Google claims it isn't Java. But is it right to say that Android is a Programming language? Or is it more right to say that Android is a framework in Java? Or is both true?</p>
android
[4]
5,541,980
5,541,981
register and unregister broadcast
<p>I am to create an application.Through my application users can read the incoming phone number.My activity have two buttons, On and off. If the user clicks the on button ,then the following code will execute.</p> <pre><code>IntentFilter filter=new IntentFilter(TelephonyManager.EXTRA_STATE); registerReceiver(new MyPhoneReceiver(), filter); </code></pre> <p>And If the user clicks the off button ,then the following code will execute.</p> <pre><code>unregisterReceiver(new MyPhoneReceiver()); </code></pre> <p>MyPhoneReceiver is my brcastreceiver calss name.If the user is click the on button then the onReceive() method will be ready to read incoming call number and display that number.Likewise if I click the off button, then broadcast will be unregistered. My onRecieve() code is</p> <pre><code>public void onReceive(Context context, Intent intent) { System.out.println("am hereeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); Bundle extras = intent.getExtras(); if (extras != null) { String state = extras.getString(TelephonyManager.EXTRA_STATE); Log.w("sarath DEBUG", state); System.out.println("state is:"+state); if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) { String phoneNumber = extras.getString(TelephonyManager.EXTRA_INCOMING_NUMBER); Log.w("sarath DEBUG", phoneNumber); System.out.println("phone no. is:"+phoneNumber); } } } </code></pre> <p>My problem is when i click the on button nothing is happening.when a incoming call came then also its not executing onRecive() code.please help me friends</p>
android
[4]
667,652
667,653
how to remove sublayout from the Layout in Android?
<p>I am new to Android.Can anyone give some ideas for my problem.</p> <pre><code> /* Parent Linear Layout */ final LinearLayout par_layout=new LinearLayout(this); par_layout.setOrientation(LinearLayout.VERTICAL); /* Child Linear Layout */ final LinearLayout chl_layout=new LinearLayout(this); chl_layout.setOrientation(LinearLayout.VERTICAL); TextView tv_name=new TextView(this); tv_name.setText("Name "); TextView tv_item=new TextView(this); tv_item.setText("Items "); Button btn_submit=new Button(this); btn_submit.setText("Submit"); btn_submit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub par_layout.removeAllViewsInLayout(); } }); chl_layout.addView(tv_name); chl_layout.addView(tv_item); chl_layout.addView(btn_submit); par_layout.addView(chl_layout); setContentView(par_layout); </code></pre> <p>In the above code at the time of button click i wish to clear the chl_layout from the par_layout.But i can't . Can anyone give some ideas ??</p> <p>Note : The following code also not working </p> <pre><code> par_layout.removeView(chl_layout); </code></pre>
android
[4]
3,958,109
3,958,110
Referencing jquery object in method paramater
<p>Is it possible to somehow reference the current jquery object/collection in a method parameter...</p> <p>For example</p> <pre><code>$('#sub &gt; :last-child').height($('#sub &gt; :last-child').height() + (gap * -1)); </code></pre> <p>Can I somehow change the second reference, or am I stuck with storing in a variable.</p> <p>Thanks,</p>
jquery
[5]
2,242,187
2,242,188
ASP.NET Attempt to attach auto-named a database failed?
<blockquote> <p>Parser Error Message: An attempt to attach an auto-named database for file D:\Projects\Damnation\Damnation.Website\Damnation.Website.Tracker\BugNET_WAP\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.</p> </blockquote> <p>Why could this be happening? My connection string doesn't use <code>|DataDirectory|</code>, it is:</p> <pre><code>&lt;connectionStrings&gt; &lt;add name="BugNET" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=dnmain;Integrated Security=True;"/&gt; &lt;/connectionStrings&gt; </code></pre> <p>I get this error when I try to load default.aspx, after installing <a href="http://bugnetproject.com" rel="nofollow">BugNET</a>.</p>
asp.net
[9]
5,140,019
5,140,020
Problem with keyup and shift+tab
<p>I'm writing a small jQuery form routine designed to help a user fill in a group of bank sort code fields. There are 3 fields - when the user has filled in 2 numbers in one field, the cursor is automatically focus() on the next field.</p> <p>However the problem arises if the user decides to shift+tab back to the previous field. If this field already contains 2 characters, the cursor doesn't stay within that field but jumps forward again.</p> <p>HTML:</p> <pre><code>&lt;div class="formItem sortCode clearfix"&gt; &lt;input type="text" maxlength="2"&gt; &lt;input type="text" maxlength="2"&gt; &lt;input type="text" maxlength="2"&gt; &lt;/div&gt; </code></pre> <p>jQuery:</p> <pre><code>var $sortCollection = $('.sortCode input'); $('.sortCode input').keyup(function(event) { var sortValue = $(this).val(); var sortPosition = $sortCollection.index(this); if (!(event.keyCode == 9 &amp;&amp; event.shiftKey)) { if (sortValue.length == 2 &amp;&amp; sortPosition != 2) { sortPosition += 1; $sortCollection.eq(sortPosition).focus().select(); } } }); </code></pre> <p>I have a feeling the issue is to do with the keyup event being triggered when the shift key is released but I'm not sure. Please could someone take a look.</p>
jquery
[5]
2,176,339
2,176,340
Using myFuncArray.shift()() to call functions
<p>I am having troubles using shift() to call functions I have put in an array. I have put together a simple example illustrating the problem.</p> <p>Essentially the function gets called, however, the changes to variables in the function do not stick.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; Taco = function() {}; Taco.prototype.init = function() { this.ex1 = "ex1 in init()"; alert(this.ex1); }; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="Submit" onClick="withShift();" value="withShift"/&gt; &lt;div id="div1"&gt; &lt;/div&gt; &lt;input type="Submit" onClick="noShift();" value="noShift"/&gt; &lt;div id="div2"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; // This calls init but does not hold the value of ex1 after the call withShift = function() { taco = new Taco(); funcQ = []; funcQ.push(taco.init); funcQ.shift()(); div1 = document.getElementById("div1") div1.appendChild(document.createTextNode(taco.ex1)); }; // this calls init and it holds the value... noShift = function() { taco2 = new Taco(); taco2.init(); div1 = document.getElementById("div2") div1.appendChild(document.createTextNode(taco2.ex1)); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thank you in advance for any suggestions.</p>
javascript
[3]
4,386,547
4,386,548
How can I create a sorted list of integer and string pairs?
<p>How can I create a list (or some other type of container) of integer and strings pairs that allows duplicates in both pairs and can be sorted by the integer value?</p> <p>I need to fill a container with names (string) and scoring (integer) pairs, the container must allow duplicated values in both name and scoring, and i need to sort this list by the scoring value.</p> <p>I tried with a SortedMap but doesn't allow duplicated values:</p> <pre><code>SortedMap&lt;Integer,String&gt; sm=new TreeMap&lt;Integer, String&gt;(); sm.put(23, "Peter"); sm.put(11, "Tony"); sm.put(110, "Claire"); sm.put(13, "ferca"); sm.put(55, "Julian"); sm.put(13, "Pedro"); </code></pre> <p>In this example, ferca and Pedro have the same scoring value, this is something I need to allow, but the SortedMap overwrites "ferca" with "Pedro".</p> <p>What is the best container type to do this?</p>
java
[1]
5,195,467
5,195,468
How to get the html header values like h1 using html parser dom?
<p>how to get the header value like h1 or h2 which lies inside a div having some class name using simple html parser dom? ex: - <code>&lt;html&gt; &lt;body&gt; &lt;div class="somename"&gt; &lt;h1&gt;MyText&lt;/h1&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></p>
php
[2]
3,408,584
3,408,585
if statement OOP
<p>I have the following code</p> <pre><code>/* Errors exist, have user correct them */ if($form-&gt;num_errors &gt; 0) { return 1; //Errors with form } /* No errors, add the new account to the */ else if($database-&gt;addLeagueInformation($subname, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype)) { return 0; //New user added succesfully } else { return 2; //Registration attempt failed } </code></pre> <p>I want to add the following to it </p> <pre><code>$databases-&gt;addLeagueTable($name) </code></pre> <p>This should happen at the same time as addLeagueInformation. Any ideas?</p> <p>Edited, will this work?</p> <pre><code>else if($database-&gt;addLeagueInformation($subname, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype) &amp;&amp; $databases-&gt;addLeagueTable($name) &amp;&amp; $_SESSION['players'] == $subplayers &amp;&amp; $comp_name = "$format_$game_$name_$season" &amp;&amp; $_SESSION['comp_name'] = $comp_name) </code></pre>
php
[2]
4,018,700
4,018,701
Opening a document programatically in C++
<p>I have a console program written in C++. Now I want to open a manual document(in .txt or .pdf) everytime a user of the program types 'manual' in console. How can I do this? Any links to a tutorial would be helpful.Thanks</p>
c++
[6]
3,939,051
3,939,052
How can I programmatically set adjustViewBounds to true in Android?
<p>I want to set adjustViewBounds property of my ImageView to true, programmatically, not in XML. How can I do it?</p>
android
[4]
2,476,822
2,476,823
How to check if a date is in a given range of day+month?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/976669/how-to-check-if-a-date-is-in-a-given-range">How to check if a date is in a given range?</a> </p> </blockquote> <p>Having each year divided into periods such as</p> <pre><code>from 11-28 to 01-20 from 01-21 to 02-16 from 02-17 to 03-15 from 03-16 to 05-04 from 05-05 to 07-25 from 07-26 to 10-10 from 10-11 to 11-27 </code></pre> <p>And some days as</p> <pre><code>$date1 = '06-09-1990'; $date2 = '05-03-1867'; $date3 = '02-29-1945'; $date4 = '06-24-2012'; $date5 = '12-25-2015'; $date6 = '07-15-2010'; </code></pre> <p>How to check if a day is in one of these range?</p> <p>P.S. Excuse me for my english</p>
php
[2]
151,258
151,259
How to render text on path?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8337221/how-to-write-curved-text">How to write curved text?</a> </p> </blockquote> <p>I want to render text as in given image (in place of "AMEX 3"). Please tell me how to achieve this.</p> <p><img src="http://i.stack.imgur.com/97a8u.png" alt="Image with the text &quot;AMEX 3&quot; inside a curved arrow"></p>
android
[4]
1,718,593
1,718,594
Detecting an arbittrary button press on a USB joystick WITHOUT pygame
<p>Is there anyway I could register button pushes on a joystick without using any function from pygame? </p>
python
[7]
5,619,763
5,619,764
Autogeneration of Get & Set methods?
<p>I think the creation of holder classes, classes with just attritutes, get methods and set methods can be autogenerated. I understand that Eclipse is a defacto "standard" Java IDE these days. Does Eclipse do this? Do other IDEs?</p> <p>I'm guessing the only reasons for making dedicated data holding classes instead of using HashMaps is to have mixed datatypes in a more visible/safter way and for the occasion when you want to DO something to the data when inserting it or retrieving it. Thoughts?</p>
java
[1]
1,802,703
1,802,704
stream_get_contents replacing plus with space
<p>So this is something that I have not been able to find any documentation on. I have a plain text string that I am trying to turn into a stream in php.</p> <pre><code>$myStr = "A bit of text +test +test2"; $stream = fopen('data://text/plain,' . $myStr, 'r'); var_dump(stream_get_contents($stream); </code></pre> <p>The output of this code is </p> <pre><code>A bit of text test test2 </code></pre> <p>I tried using preg_replace to add an escape to the plus signs however this did not seem to have any effect. Any other ideas? Thanks</p>
php
[2]
4,699,954
4,699,955
Verifying date format
<p>I want to verify that the date entered is in yyyy/mm/dd format. If by mistake user enters in dd/mm/yyyy format, it must automatically convert to yyyy/mm/dd using Javascript function.</p> <p><strong>Edited:</strong></p> <pre><code>function CheckDateFormat() { EnteredText = document.getElementById('LDate').value; LengthOfText = EnteredText.length; Status = true; for(i=0;i&lt;=LengthOfText;i++) { currentChar = EnteredText.substr(i,1); if (currentChar == '/' &amp;&amp; (i != 5 || i != 8)) { alert("Invalid date format"); document.getElementById('LDate').focus; status = false; } if (status == false) break; } } </code></pre>
javascript
[3]
2,416,159
2,416,160
Adding Paypal Pay Now button in Android app
<p>This may have been asked before but I cannot find a definitive answer </p> <p>I am currently using Google in app billing for my application and users are asking me if they can use Paypal. </p> <p>Is it against the market policy if I add a Paypal Buy now button to my payment screen which opens a URL in a webview and goes to Paypal.com ? ….</p> <p>The app is published in the Android Market</p> <p>Thanks in advance </p>
android
[4]
5,077,434
5,077,435
Trying to change img src if another element is visible with jQuery
<p>I have a div ("panel" class) on my page that toggles open/closed on the click of a paragraph element ("flip" class), which has an image inside of it.</p> <p>Here's the HTML:</p> <pre><code>&lt;div class="panel"&gt;Contact info&lt;/div&gt; &lt;p class="flip"&gt;&lt;img src="images/contactExpand.png" /&gt;Expand&lt;/p&gt; </code></pre> <p>And the jQuery:</p> <pre><code>$(".flip").click(function(){ $(".panel").slideToggle("slow"); }); </code></pre> <p>Everything works fine so far, but I want the image src to change to "contactCollapse.png" when the panel div is visible. This doesn't seem to do anything (image just stays the same):</p> <pre><code>if ($(".panel").is(":visible") == true) { $(".flip img").attr("src","../images/contactCollapse.png") } else { $(".flip img").attr("src","../images/contactExpand.png") } </code></pre> <p>Am I missing something? Thanks for any help!</p>
jquery
[5]
359,836
359,837
mapping two list
<p>I have two list like this:</p> <pre><code>list1 = [{'id':1, 'name':'foo', 'age':20}, {'id':2, 'name':'foo', 'age':20}] list2 = [{'id':2, 'created':'2004-12-23'}, {'id':12, 'created':'2004-12-23'}, {'id':1, 'created':'2004-12-23'}] list1 = [{'id':1, 'name':'foo', 'age':20, 'match':True}, {'id':2, 'name':'foo', 'age':20, 'match':True}] </code></pre> <p>I want to add match to the corresponding list if the id of list1 and list2 matches. How would I do that efficiently?</p>
python
[7]
3,477,284
3,477,285
Implementation of XML templates in asp.net mvc and asp.net applications?
<p>Open Google blogger uses XML templates for blogs. I want to implement same kind functionality in my asp.net mvc and asp.net applications.</p> <p>We can use master pages and themes in asp.net applications but I need to use XML templates same like Google Blogger uses.</p> <p>This question is in continuation to my previous discussion : <a href="http://stackoverflow.com/questions/4335797/consideration-of-points-while-started-to-build-some-open-source-applications">link text</a></p>
asp.net
[9]
772,819
772,820
how to handle large amount of float data?
<p>We have a binary file which contains a large amount of <code>float</code> data (about 80MB). we need to process it in our Java application. The data is from a medical scanner. One file contains data from one <code>Rotation</code>. One <code>Rotation</code> contains 960 <code>Views</code>. One <code>View</code> contains 16 <code>Rows</code> and one <code>Rows</code> contains 1344 <code>Cells</code>. Those numbers (their relationship) are fixed.</p> <p>We need to read ALL the floats into our application with a code structure reflect above structure about <code>Rotation-view-row-cell</code>. </p> <p>What we are doing now is using <code>float[]</code> to hold data for <code>Cells</code> and then using <code>ArrayList</code> for <code>Rotation</code>, <code>View</code> and <code>Row</code> to hold their data. </p> <p>I have two questions:</p> <ol> <li>how to populate the Cell data (read floats into our float[]) quickly?</li> <li>do you have better idea to hold those data? </li> </ol>
java
[1]
1,288,148
1,288,149
Anything in here that would escape string (PHP)
<pre><code>$_GET['search'] = ucfirst(strtolower(str_replace("_"," ",urldecode($_GET['search'])))); </code></pre> <p>For some reason it's adding slashes into the string similar to mysqL_escape_string, anyone got any ideas what would be causing it?</p>
php
[2]
1,510,172
1,510,173
Check whether all selects with name chosen[] is a value other than 0
<p>How can I do so it checks all the selectors with name="chosen[]" does not have value 0?</p> <p><a href="http://jsfiddle.net/LWayp/16/" rel="nofollow">http://jsfiddle.net/LWayp/16/</a></p>
jquery
[5]
4,859,285
4,859,286
changing python path on mac?
<p>I would like to change PATH from Python 2.6.1 to 3.1.2. I have both versions installed on my computer but when I type python --version in the terminal I get Python 2.6.1 so thats the current version its "pointing" to. Now if I type Python3.1 it changes the current version to the one I want to use, though the PATH is still 2.6.1. Downloaded with the Python 3.1 package comes a Update Shell Profile.command, so when I run it and then run nano ~/.bash_profile it says there: Setting PATH for Python 3.1 the orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/3.1/bin:${PATH}" export PATH.</p> <p>Does this mean that I have changed the PATH or does it just give me instructions how to?!</p> <p>Regards</p>
python
[7]
404,364
404,365
How can I know an activity is going to be killed by OS?
<p>I know I can use isFinishing() in onPause() to know whether an activity is going to be killed by finish(). </p> <p>Then, how can I know an activity is going to be killed by OS temporarily due to low memory?</p> <p>Thanks.</p>
android
[4]
2,656,343
2,656,344
Which javascript library to use (no JQuery)
<p>Okay sorry if its a stupid question, but i would really like to hear more expreienced developers opinion.</p> <p>Which javascript library would you offer?</p> <p>Truth is i do think jQuery is cool but i dont know how to say this im not really satisfied with it, specially with its JSON handling.</p> <p>So im looking for one what i can use for my project. I was taking a look at <a href="http://sproutcore.com/" rel="nofollow">Sproutcore</a> </p> <p>When i was surfin some websites i saw some of them (maybe im wrong but as i see its beeing more) are not useing jQuery they are uesing other type of libraries.</p> <p>So could please someone offer a few? Yes i know google is my friend but if someone uses a library and satisfied with it i guess its way more better to know the reasons why.</p> <p>Thank you</p>
javascript
[3]
3,913,176
3,913,177
how do i validate a textbox in asp for unbalanced parentheses
<p>I want to validate an ASP textbox for unbalanced parenthesis. Like i want to display an error if the user starts a curly bracket but does not end it in a textbox.</p> <p>Thanks</p>
asp.net
[9]
2,667,761
2,667,762
Are empty true blocks an idiom in JavaScript?
<p>I just came across code that looks like this:</p> <pre><code>if (foo == "bar"){}else{ } </code></pre> <p>Is there a good reason for someone to write it that way instead of</p> <pre><code>if (foo != "bar") { } </code></pre> <p>or am I just dealing with a raving lunatic (this is my assumption based on other things in the code).</p>
javascript
[3]
3,793,605
3,793,606
More efficient way to write this Jquery code
<p>Is there a better, more efficient way to write this code? It's a make shift drop down menu that allows user to RSVP for multiple people. Sorry, it's kind of a mess, but I think what I'm doing is clear. If not, I'm at my computer and will respond quickly with more info need be.</p> <pre><code> //There's got to be a better way to do this $('#guest_num_1').click( function() { $('#num_guests a#quant_guests').html("1") $('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6 ').hide() }); $('#guest_num_2').click( function() { $('#num_guests a#quant_guests').html("2") $('.guest_name_2').fadeIn() $('.guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6').hide() }); $('#guest_num_3').click( function() { $('#num_guests a#quant_guests').html("3") $('.guest_name_2, .guest_name_3').fadeIn() $('.guest_name_4, .guest_name_5, .guest_name_6').hide() }); $('#guest_num_4').click( function() { $('#num_guests a#quant_guests').html("4") $('.guest_name_2, .guest_name_3, .guest_name_4').fadeIn() $('.guest_name_5, .guest_name_6').hide() }); $('#guest_num_5').click( function() { $('#num_guests a#quant_guests').html("5") $('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5').fadeIn() $('.guest_name_6').hide() }); $('#guest_num_6').click( function() { $('#num_guests a#quant_guests').html("6") $('.guest_name_2, .guest_name_3, .guest_name_4, .guest_name_5, .guest_name_6').fadeIn() }); </code></pre>
jquery
[5]
271,159
271,160
Android : how to edit the bar at the top of the screen?
<p>I'm beginning to learn Android Development and I have a bar at the top of my app, containing the title of the activity and the app icon. I want to know how to edit it (change the text, background color, etc), and remove it ? I also want to know how to edit the title of my app, because it's currently the name of its main activity...</p> <p>Thanks a lot.</p>
android
[4]
4,691,264
4,691,265
Pythonic syntax for appending an arbitrary class object list property
<p>Is there an analog of <code>setattr()</code> that allows for appending an arbitrary list property of an instantiated class object? If not, is there a recommended way of doing so?</p> <p>This is a trivialized version of what I'm doing currently:</p> <pre><code>foo = SomeClass() ... attr = "names" value = "Eric" values = getattr(foo, attr) values.append(value) setattr(foo, attr, values) </code></pre> <p>This seems clunky and inefficient.</p> <p>Edit: this assumes that foo.names (or whatever arbitrary value might be assigned to the attr variable) is in fact a list.</p>
python
[7]
1,737,236
1,737,237
How to import a user module which has the same name with a system module?
<p>I have a legacy python program which defined a module whose name conflict with a system module in the current python, what's the easiest method to fix this? This module has been imported in many place, so it would be great if no need to change the the old python source.</p>
python
[7]
1,510,284
1,510,285
how to force textchanged to work onblur?
<p>actually i want to do tabbing in a Gridview rowwise i have done it. Problem is that i have done by using onTextChange event now whenever i hav to do tabbing i have to text and then enter the tab,then only it works and my requirement is that tab should be done for without entering the text also So as i'm having all the code i want to forcefully do this onBlur event. ?? </p>
asp.net
[9]
5,658,687
5,658,688
access controls on a asp.net master page from child page
<p>i want to access a span on a asp.net master page from child page, so i'd made a public property on that master page--></p> <pre><code> public partial class Ui_MasterPage_UI : System.Web.UI.MasterPage { public int tax = 0; public string notification { set { (this.FindControl("notification") as HtmlAnchor).InnerText = value.ToString(); } } ------------------//some code } </code></pre> <p>and now wants to access this from a child page to set some text into that htmlanchor tag,</p> <p>so that i'd written some script--> </p> <p><strong>child page</strong></p> <pre><code>public partial class Ui_ProductDetails : System.Web.UI.Page { protected void ListView_ProductDetails_itemcommand(object sender, ListViewCommandEventArgs e) { Master.notification = "some text"; ////////showing error ------------------//some code } ------------------//some code } </code></pre> <p>but getting the syntax error i think there is some problem in above code,,,,,so plz review it...... is there any other way to do this ??? thnku </p>
asp.net
[9]
63,441
63,442
ASP.NET _doPostBack from Javascript
<p>The follow code does not work in IE:</p> <pre><code>&lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $(":text[id*=txtPopCEP]").keypress(function(e){ var tecla = (e.which) ? e.which : e.keycode; if(tecla == 13) { __doPostBack('ctl00$ContentPlaceHolder1$ImageButton1', ''); } }); }); &lt;/script&gt; </code></pre> <p>It doenst call the doPostBack function.But in FF it works...Any ideias?</p> <p>ImageButton1 code output:</p> <pre><code> &lt;input type="image" name="ctl00$ContentPlaceHolder1$ImageButton1" id="ctl00_ContentPlaceHolder1_ImageButton1" src="imagens/btCEP.jpg" style="border-width:0px;" /&gt; </code></pre>
asp.net
[9]
1,296,933
1,296,934
If statement not working how I want it to
<p>The following C++ code:</p> <pre><code>if (a != '0.5' || a != '0.6') { cout &lt;&lt; "The answer is neither 0.5 nor 0.6 " &lt;&lt; '\n'; } </code></pre> <p>I have also tried</p> <pre><code>if ((a != '0.5') || (a != '0.6')) { cout &lt;&lt; "The answer is neither 0.5 nor 0.6 " &lt;&lt; '\n'; } </code></pre> <p>and tried</p> <pre><code>if ( !(a== '0.5') || !(a==0.6) { cout &lt;&lt; "The answer is neither 0.5 nor 0.6 " &lt;&lt; '\n'; } </code></pre> <p>Receives a number from a user and checks if the number is 0.5 or 0.6; if it is it should execute as a false statement but if it's any other number it should execute as true. However, it keeps executing as true though it should execute as false when I enter 0.5 or 0.6. This is different when I use an else if statement in which it works fine that is:</p> <pre><code>if (a != 0.5) { //what to do if true. } else if (a != 0.6) { //What to do if this is true and the first id wrong. } else { //What to do if none are true. } </code></pre> <p>Why can't the != execute in the if statement?</p>
c++
[6]
5,269,240
5,269,241
C# - Reference type still needs pass by ref?
<p>Consider the following code (for simplicity, i did not follow any C# coding rules).</p> <pre><code>public class Professor { public string _Name; public Professor(){} public Professor(string name) { _Name=name; } public void Display() { Console.WriteLine("Name={0}",_Name); } } public class Example { static int Main(string[] args) { Professor david = new Professor("David"); Console.WriteLine("\nBefore calling the method ProfessorDetails().. "); david.Display(); ProfessorDetails(david); Console.WriteLine("\nAfter calling the method ProfessorDetails().."); david. Display(); } static void ProfessorDetails(Professor p) { //change in the name here is reflected p._Name="Flower"; //Why Caller unable to see this assignment p=new Professor("Jon"); } } </code></pre> <p><hr /></p> <p>As expected the output is :</p> <blockquote> <p>Before calling the method ProfessorDetails()...</p> <p>Name =David </p> <p>After calling the method ProfessorDetails()...</p> <p>Name =Flower </p> </blockquote> <p>The call <code>p=new Professor("Jon");</code> in <code>ProfessorDetails(Professor p)</code> is not effective, even though it is reference type. Why should i still need to use the <code>ref</code> keyword to get the desired result?</p>
c#
[0]
3,206,757
3,206,758
ASP.NET code generator for creating pages for lookup tables
<p>I am looking for a code generator that will create basic maintenance asp.net pages for lookup tables stored in sql server. I can clean up the pages after they are generated and connect them to my business objects. I just wanted the controls to be generated to create a starting point. Do any exist?</p>
asp.net
[9]
1,801,968
1,801,969
Page Response Error
<p>I working on iphone Application Development. I created a sampleTest button and whenever i click on it the following function invoking. But unable to return any response. Its showing empty alert message. (hostName and portNo are dynamic inputs) </p> <pre><code>sampleTestBtn.addEventListener('click', function() { var regDetails = '{"user_login": {"email": "sample@sample.com", "password": "password"}}'; var client = Titanium.Network.createHTTPClient({timeout: 10000}); client.cache = false; client.open("POST", "http://"+hostName+":"+portNo+"/AccountCreate"); client.setRequestHeader("Content-Type", "application/json"); client.send(regDetails); alert(JSON.parse(this.responseText)); }); can any one please. </code></pre>
iphone
[8]
226,698
226,699
how to use own media player in android webview?
<p>i have android webview app for play rtsp and m3u8 link i want my own media player for play these link please help me about this i want play these link rtsp,rtmp,mms,m3u8 if its possible then please help me solve this issue</p>
android
[4]
4,933,245
4,933,246
How can I write object oriented Javascript without using a framework?
<p>Sorry, I am still trying to teach myself Javascript and I was wondering whether someone knew the best way to write object oriented Javascript with classes that will interact well with PHP classes.</p>
javascript
[3]
822,186
822,187
Java - .class not found issue
<p>I have following code,</p> <pre><code>class AA { public static void main(String[] args) { long ll = 100 ; AA1 a1 = new AA1() ; if(ll == 100) // Marked line long lls [] = a1.val(ll); } } class AA1 { public long [] val (long ll1) { long [] val = new long []{1 , 2, 3}; return val ; } } </code></pre> <p>which executes properly without the marked line. However, gives error ".class expected" with marked line. Can anybody help me what is the problem and how to solve this ?</p>
java
[1]
5,828,726
5,828,727
How to get the first day of a given week number in PHP (multi-platform)?
<p>What is the simplest way to do it in PHP ?</p> <p>I want the date of the Monday of a given week number of a year (example : week number 3 of 2009)</p> <p>Thanks !</p> <p>EDIT : If you use Linux only machines, use cletus' solution, however I am looking for something that can work on Windows AND Linux. </p>
php
[2]
2,146,893
2,146,894
Javascript seting dom event to prototype method in constructor
<p>I'm having some Javascript woes, lets say we have a constructor</p> <pre><code>function test(element) { this.element = element; this.element.onfocus = function() { this.onfocus(); } } test.prototype.onfocus = function() { alert("focused"); } new test(document.getElementByID("E1")); </code></pre> <p>So I am trying to dynamically set the focus event inside the constructor, but it doesn't seem to work, and I can't figure it out. </p> <p>Anyone help?</p> <p>Thanks,</p> <p>AJ</p>
javascript
[3]
411,362
411,363
Convert HTML to PDF in ASP.NET
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net">Convert HTML to PDF in .NET</a> </p> </blockquote> <p>How can i use the acrobat driver to covert web page to pdf , i have a icon on my browser. How can i use that in ASP.NET to convert the web page to pdf pro grammatically.</p>
asp.net
[9]
4,977,042
4,977,043
Command prompt within another widget
<p>I have a GUI with label and entry widgets on a frame widget. I want to add a command prompt.to the frame through which the user can submit commands. I know about using the cmd module to create a prompt in the python shell, but I want the prompt to be part of my GUI window. Is there a way to 'embed' a command prompt in a canvas for example? Right now I am using Cmd.<strong>init</strong>(self) and cmdloop to start a prompt in python shell...</p> <p>Just to clarify further, I would like the shell to run from within my GUI window (e.g. inside a canvas), and not as its own window. Is that possible?</p>
python
[7]
2,233,730
2,233,731
use slideDown after image loads
<p>i use <a href="http://jpgraph.net/" rel="nofollow">gpgraph</a> library for charts drawing. i need to dinamicaly create graphs, so i use jquery for it.</p> <p>Look at this script please</p> <pre><code>$("#graph").click(function(u) { var f = 502; //just for example $("#graph_content").html('&lt;img src="mygraph.php?value1='+f+'" /&gt;'); $("#graph_content").slideDown(600); u.stopPropagation(); }); </code></pre> <p>in <code>mygraph.php</code> i generate the image of graphic, depend on <code>value1</code>. </p> <p>but i need to <code>slideDown()</code> the div with image after it loads. in my case while it loads an image, it allready slides down a <code>div</code>, so i lose effect i wanted. i can't imagine how can i use <code>load</code> method here?</p> <p>maybe you will help me:)</p> <p>Thanks</p>
jquery
[5]
828,295
828,296
How to append a string to the content of a error log file in an highly frequented environment?
<p>From my age old php days (years ago) I slightly remember that I had <em>big</em> trouble with creating a log file in PHP. At random times, the file suddenly was plain blank (empty). I used something pretty close to this:</p> <pre><code>$myFile = "myFile.txt"; $fh = fopen($myFile, 'a'); $str = "New Entry...\n"; fwrite($fh, $str); fclose($fh); </code></pre> <p>Is that really a safe way to work with a error log file when there are like 500 users at the same time executing PHP scripts (by surfing the website)? Lets assume there's a really bad bug that causes every page view to produce an error log. That poor myFile.txt is then accessed like 100 times per second. I feel that this won't work. I hope I'm wrong.</p> <p>How would you do that?</p>
php
[2]
2,016,763
2,016,764
How to display umlauts in a web page?
<p>Hi I was wondering what is a quick way of showing umlauts on your page? I was thinking something like the code below, but how should I do the pseudocode part?</p> <pre><code>$language = $_POST['language']; if ($language = "fi" ) { $filename = "C:/xampp/htdocs/finnish.txt"; } else if ($language = "eng") { $filename = "C:/xampp/htdocs/english.txt"; } else if ($language = "swe") { $filename = "C:/xampp/htdocs/swedish.txt"; } else if ($language = "rus") { $filename = "C:/xampp/htdocs/russian.txt"; } $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize($filename)); fclose ($fd); $delimiter = "*"; $splitcontents = explode($delimiter, $contents); $counter = 0; foreach($splitcontents as $titles[$counter]) { //PSEUDO CODE CONVERT_UMLAUTS_TO_VIEVABLE_FORM($titles[$counter]); $counter = $counter + 1; } </code></pre>
php
[2]
4,696,541
4,696,542
stop NSTimer causes error
<p>I used the codes below to stop a NSTimer</p> <pre><code>-(void)stopTimer:(NSTimer*)timer; { if(!timer) return; if([timer isValid]) { [timer invalidate]; timer = nil; } } </code></pre> <p>sometimes it causes 'EXC Bad Access"</p> <p>sometimes I got</p> <pre><code> -[__NSCFType isValid]: unrecognized selector sent to instance 0x6298eb0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType isValid]: unrecognized selector sent to instance 0x6298eb0' </code></pre> <p>I think my codes has checked if the NSTimer is valid, if sure then executes 'invalidate'</p> <p>Welcome any comment</p>
iphone
[8]
1,600,654
1,600,655
How do certain iPhone apps allow purchases without IAP?
<p>According to section 11.2 of the App Store Review Guidelines,</p> <pre><code>Apps utilizing a system other than the In App Purchase API (IAP) to purchase content, functionality, or services in an app will be rejected. </code></pre> <p>Various apps like JetSetter, Gilt, and Kayak include in-app purchasing flows that either collect credit card information directly, or use a UIWebView to direct the user to a third-party website to purchase goods and services.</p> <p>What provision allows apps to do this, and what are the limitations to purchasing physical goods and services in an iPhone app without using IAP?</p>
iphone
[8]
141,062
141,063
Bizarre issue running PHP background process
<p>I am attempting to run a background process from within a PHP script. I have successfully used this method elsewhere in production environments with no issues. The basic rundown is as follows:</p> <pre><code>file_put_contents($batch_file, "#!/bin/bash\ncd " . dirname(__FILE__) . "\nphp thescript.php some params\nrm \$0"); chmod($batch_file, 0750); shell_exec($batch_file . " &gt; /dev/null 2&gt;/dev/null &amp;"); </code></pre> <p>This method allows the calling script to terminate while $batch_file does it's thing. It's working fine in my dev environment, but on my host (bluehost), the background process simply runs the calling script again AS THOUGH IT WAS THE SAME REQUEST from the browser (causing an endless loop).</p> <p>Let me illustrate: </p> <p>The user makes a request for <a href="http://example.com/frontend.php" rel="nofollow">http://example.com/frontend.php</a></p> <p>frontend.php runs the background task "php backend.php with some params", but the output of that background task is the same as what the user sees when visiting <a href="http://example.com/frontend.php" rel="nofollow">http://example.com/frontend.php</a>. In fact, I can call "php inexistant_file.php" and the output is the same.</p> <p>If I inspect $_SERVER, it appears to not change, even though I'm calling a DIFFERENT script from a different interface (CLI vs via apache) and passing command-line parameters.</p> <p>I suspect a weird caching bug/issue, but have disabled w3tc (it's a wordpress site) with no success. </p> <p>Any insight?</p>
php
[2]
1,785,881
1,785,882
Is yield break equivalent to returning Enumerable<T>.Empty from a method returning IEnumerable<T>
<p>These two methods appear to behave the same to me</p> <pre><code>public IEnumerable&lt;string&gt; GetNothing() { return Enumerable.Empty&lt;string&gt;(); } public IEnumerable&lt;string&gt; GetLessThanNothing() { yield break; } </code></pre> <p>I've profiled each in test scenarios and I don't see a meaningful difference in speed, but the <code>yield break</code> version is slightly faster.</p> <p>Are there any reasons to use one over the other? Is one easier to read than the other? Is there a behavior difference that would matter to a caller?</p>
c#
[0]
1,578,524
1,578,525
Sort the unsorted text file and rewrite to same text file in sorted order
<p>I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,</p> <pre><code>Richmond,Virginia Seattle,Washington Los Angeles,California Dallas,Texas Jacksonville,Florida </code></pre> <p>I wrote a code to sort them in order and this will display in sort order by City.</p> <pre><code>&lt;?php $file = file("states.txt"); sort($file); for($i=0; $i&lt;count($file); $i++) { $states = explode(",", $file[$i]); echo $states[0], $states[1],"&lt;br /&gt;"; } ?&gt; </code></pre> <p>From this, how can I rewrite those sorted information back into the states.txt file?</p>
php
[2]
2,717,479
2,717,480
How to programatically find my friends Gps is switched on
<p>i am writing a code for finding a friend's distance who is near to me using GPS. whenever i select to "find a friend", it should list out the names of my friends who is within 1 Km along with their distance from me. I am accessing my contacts list in which the names and phone numbers of my friends are saved. Now am able to list the contacts name but the distance is displayed with similar value for all the contacts. Actually i wanted to know how the GPS of my friends phone is detected by me.how to write the code for that. if anyone have any idea about this, please rely to this. Thanks in advance</p>
android
[4]
4,834,203
4,834,204
Insert value into array object
<p>I have an array which contains an number of array objects. Is there a way to insert something in the array object for example [d] = value4 in array object [0]?</p> <pre><code> Array ( [0] =&gt; stdClass Object ( [a] =&gt; value1 [b] =&gt; value2 [c] =&gt; value3 ) [1] =&gt; stdClass Object ( [a] =&gt; value1 [b] =&gt; value2 [c] =&gt; value3 ) ) </code></pre>
php
[2]
62,520
62,521
jQuery mouseenter works great with mouse but not with tab key
<pre><code>$( "#list li:eq(0)" ).bind('mouseenter focus', function(event) { jQuery("#logo img").css('top', '-132px'); console.log( event.type, " :: ", this.id ); }).bind('blur mouseleave', function(event) { jQuery("#logo img").css('top', '-41px'); console.log( event.type, " :: ", this.id ); }); </code></pre> <p>This piece of jQuery works great with the mouse over but not with the tab key over! Have you encounter a similar problem?</p> <p>I have tried .bind to fire both event and still not working!</p> <p><strong>if fires the event on mouseenter but nothing in focus!</strong></p>
jquery
[5]
1,255,884
1,255,885
how to read xml file on the svn server with php...?
<p>I'm working on a project in my work, before a week a found a problem which i could not solve it till now!!</p> <p>my project: i create a web side in php for the company where i work to display some Statistics and the informations for these Statistics i should read it from a xml file on the repository svn. i had get a privateKey and a https pasword for the log in to do that... but the problem that i don't know how to get the https access to svn with the php script cuse i had not did it bevore... i also don't know if it possible??</p> <p>so if you think you could help with your comments it would be grateful...</p> <p>thank in advance..</p>
php
[2]
5,679,413
5,679,414
help with validate field
<p>how do i check a field contain number and alphabet.</p> <p>something like $str = 3ab, ab3, a3</p>
php
[2]
5,753,474
5,753,475
register globals php
<p>I know register globals should not be used but cannot quite understand why? </p> <p>For example: this is the code that I find so often to demonstrate the security risk of using register globals while passing something like <code>example.com?authorized=1</code> to the script:</p> <pre><code>if (authenticated_user()) { $authorized = true; } if ($authorized) { include '/highly/sensitive/data.php'; } </code></pre> <p>My question is if the user has to pass <code>authorized=1</code> in the url he should be aware of the variable names that i use in my script, right? How is that possible?</p> <p>Also isn't a function like <code>parse_str()</code> which behaves somewhat similar to register globals a security risk too? </p>
php
[2]
2,769,129
2,769,130
In Javascript, if you have a function can you get the arguments by name?
<p>Let's say you have </p> <pre><code>var funct=function(a,b){ return a+b; }; console.log(funct); </code></pre> <p>Is there any way you can get the names of the arguments (a and b) from funct? If you are with in the function do you have any access to them? I know "arguments" gives you an array-like object, but is there anything that gives you a map-like or object-like representation of the arguments so that you can get their names when the function was declared?</p>
javascript
[3]
1,613,797
1,613,798
Detect network card ID in asp.net
<p>Is it possible to know network card id of the user host computer from where the request is coming like IP address. I am interesting to know if it is possible at IIS or asp.net level or any other possible way of knowing it?</p>
asp.net
[9]
5,608,629
5,608,630
Jquery and adding row to table
<p>I have the following jquery code.</p> <pre><code>var destTable = $("#numbers"); $(document).ready(function() { $("#btnAdd").click(function() { //Take the text, and also the ddl value and insert as table row. var newRow = $("&lt;tr&gt;&lt;td&gt;hi&lt;/td&gt;&lt;/tr&gt;"); $("#numbers").append(newRow); }); }); </code></pre> <p>What I would really like is to store a reference to an element once and then use it from there on it.</p> <p>The code above add's a row to my table as expected but if I use. <code>$(destTable).append(newRow)</code> or <code>destTable.append(newRow)</code> nothing happens could anyone shed any light on this for me?</p> <p>Thanks</p>
jquery
[5]
1,820,811
1,820,812
UIDocumentInteraction Controller + QLPreviewController
<p>we are using documentinteraction controller for previewing documents. for 4.2 we are using QLPreviewController.</p> <p>Now we are trying to achieve showing multiple documents with preview controller. when user scrolls horizontally need to show next document from list in preview controller.</p> <p>So question is ... is it doable? or any work around this. what box.net are using for showing documents?</p> <p>Thanks,</p>
iphone
[8]
4,335,717
4,335,718
Force browsers to reload chache WITHOUT server side code
<p>I need the ability to force reload of cache when a user goes to my page (for a few reasons) and I have seen ways to do this with server side code but I am using a hosted CMS and do not have the ability to use server side code. Is there a way to do this with javascript alone?</p> <p>Or should I use something like <code>myjavascript.js?=v1</code> on all of my css and js files? </p> <p>what is the best method?</p>
javascript
[3]
3,814,495
3,814,496
without using jquery, how can i get all input fields of type "text"?
<p>i know i can do:</p> <pre><code>document.getElementsByTagName("input"); </code></pre> <p>do i need to loop through and check the attributes for type == "text" ?</p> <p>i know jquery has input[type="text"] but i presume that's a jquery thing?</p>
javascript
[3]
4,030,237
4,030,238
substr function in PHP5
<p>I am developing an application were I need to use the next PHP5 code: </p> <pre><code>&lt;?php $Hurrengo_Hitza = 'word_3'; $Handiena_MarkID = 0; $Handiena_Hitzarentzat = -2; $Hitza_Index = substr($Hurrengo_Hitza , 5); print $Handiena_MarkID . $Hitza_index . $Handiena_Hitzarentzat; </code></pre> <p>The result I am looking for is <code>0 3 -2</code> and the result I am getting is <code>0-2</code>. Which is the problem?</p>
php
[2]
5,401,822
5,401,823
Calling new Form by clicking an item on the ListBox
<p>I'm a student and I'm still new in software programming. I have a listbox in my form and in my listbox box there are item or name listed example "Eric, Molly, Mel" and when I click "Eric", it should redirect me to a new form containing more information about "Eric". How can I call new form using the item listed in the listbox?</p>
c#
[0]
2,195,042
2,195,043
memory exceed error in android
<p>hi i am trying to generate dynamic layout at runtime, so i uses so 15 images for that but while loading this layout it crashes and display following error</p> <p>java.lang.OutOfMemoryError: bitmap size exceeds VM budget </p> <p>04-07 16:07:35.465: ERROR/dalvikvm-heap(547): 85100-byte external allocation too large for this process.</p> <p>so what should i do for managing memory? thanx</p>
android
[4]
3,424,467
3,424,468
android interactive magazine & detailing
<p>I am developing an android tablet application, that sales representatives will use to show some brochure. What are the ways of developing interactive magazines in android (like wired in ipad)? And detailing user actions(i.e. click, view movie)? </p>
android
[4]
2,304,975
2,304,976
Issue in vector
<pre><code>class item { int i; }; vector&lt;item&gt; ls(3); // line 1 item i1(1); // line 2 ls.push_back(i1); // line 3 </code></pre> <ul> <li>line 1: <ul> <li>default ctr called once</li> <li>copy ctr gets called 3 times </li> </ul></li> <li>line 3: <ul> <li>copy ctr gets called 4 times</li> </ul></li> </ul> <p>My question is in line-3, what initial 3 copy ctr are doing?</p>
c++
[6]
1,090,852
1,090,853
iOS 4.0 contentScaleFactor and scale - how to handle in 3.1.3?
<p>I am tasked with making an app that works in iOS 4.0 work in 3.1.3 and 3.2 again. Mostly it is straightforward but the handling of the new API for scale and other situations where values must be passed/returned is hard.</p> <p>respondsToSelector/performSelector takes care of nearly everything else.</p> <p>Here's a simplified version of what is going on:</p> <pre><code>-(float)getImageScaleFactor { if([[UIScreen mainScreen] scale == 2.0) return kScaleFactorForRetinaDisplay; else return kScaleFactorForOlderDisplay; } </code></pre> <p>scale isn't in iOS prior to 4.0.</p> <p>Can anyone show a code sample that will work in all versions of iOS? </p>
iphone
[8]
5,639,662
5,639,663
How to share same data between multiple activities in android?
<p>How to share same data b/w multiple activities.Present i'm using Intent but it is not working properly. It means for some activities i need to pass some other data at that time common data which i need to pass that data is losing . so how can i overcome this problem .Please help me regarding this.</p> <p>Thanking you.</p>
android
[4]
1,474,363
1,474,364
To build, or not to build a kind of Gridview control from scrach?
<p>I want to show some results in a GridView kind of way. But for each page I want to show 3 "inner Repeaters" showing data from 1-10,11 20 and 21-30 respectively. You can see this in the folowing image.</p> <p><img src="http://img196.imageshack.us/img196/1285/examplesv.jpg" alt="alt text" /></p> <p>My question is, is this easier to buid with only one gridView, and several Item Templates, OR should I buid a new user control from strach?</p>
asp.net
[9]
4,904,534
4,904,535
how to get number of count of tweets in php codeigniter
<p>how to get number of count of tweets in codeigniter frame work... can any one plz help me . As im new to this API's</p> <p>thanks,</p> <p>spice.</p>
php
[2]
1,500,514
1,500,515
importing a development version of a package from a specific directory
<p>I'm trying to load a development version of a popular Library into my project. Obviously they will have the same package name and therefore cannot co-exist without disambiguation.</p> <p>My understanding of python module management doesn't go beyond site-packages, the module search path and standard import statements.</p> <p>My code begins with the following imports:</p> <pre><code>from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget from IPython.frontend.qt.embedded_kernelmanager import QtEmbeddedKernelManager from IPython.frontend.qt.kernelmanager import QtKernelManager from IPython.lib import guisupport </code></pre> <p>How do I get the IPython symbol to point to a user supplied directory ? </p>
python
[7]
102,436
102,437
Kindly suggest me how to create depend Textboxes in ASP.NET
<p>I have numeric <code>textbox1</code>, numeric <code>textbox2</code> and numeric <code>textbox3</code>, where <code>textbox3</code> should show the value that is the multiple of <code>textbox1</code> and <code>textbox2</code>. The <code>textbox3</code> should change dynamically when the values in the other two change. Thanks.</p>
asp.net
[9]
1,952,078
1,952,079
Why does {10 + '1'} + 10 equal 10?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/9803597/javascript-blockstatement-confusion">JavaScript BlockStatement confusion</a> </p> </blockquote> <p>Why does <code>{10 + '1'} + 10</code> equal 10?</p> <p>I'm guessing the 1 doesn't work because its in a string but not sure about the rest.</p>
javascript
[3]
4,216,466
4,216,467
unexpected T_BOOLEAN_OR
<p>I am receiving an error with this code. I am new to PHP but it is my understanding that <code>||</code> is translated to 'OR'. I am trying to check if the uploaded file meets any of the three conditions, and if so set an error. </p> <pre><code>if ($uploaded_size &gt; 1048576) || ($uploaded_type == 'application/octet-stream') || (file_exists($target)) { echo "Error: File was not uploaded.&lt;br&gt;"; $ok=0; } </code></pre> <p>The error states that "unexpected T_BOOLEAN_OR"</p>
php
[2]
4,700,199
4,700,200
Most efficient way of accessing coordinates
<p>Given the following definition</p> <pre><code>union { double coords[3]; struct { double x,y,z; }; } p; </code></pre> <p>it is possible to access the coordinates of a 3D point both by index and by name (both ways have their advantages). But are they equivalent? More precisely: will the following expressions</p> <pre><code>... p.coords[0] ... p.x ... ... p.coords[1] ... p.y ... ... p.coords[2] ... p.z ... </code></pre> <p>(pairwise, for each line) generate the same (assembly) code? Is there a difference in efficiency between the two ways of accessing a coordinate?</p>
c++
[6]
2,822,422
2,822,423
asp:HyperLink populating {0}
<p>I have the following HyperLink:</p> <pre><code> &lt;asp:HyperLink ID="Link1" runat="server" NavigateUrl="~/pros.aspx?proid={0}" Text=&lt;%#CObj(Eval("ProID"))%&gt; DataNavigateUrlFields=&lt;%#CObj(Eval("ProID"))%&gt; /&gt; </code></pre> <p>The result is that I get a hyperlink that shows the current ID</p> <pre><code> 9855555 </code></pre> <p>but when I hover over it, it shows the following url: </p> <pre><code> http://localhost/CDDDev/pros.aspx?proid={0} </code></pre> <p>I wanted the {0} to be populated with the actual ProID</p> <p>As such, I wanted it to show something like:</p> <pre><code> http://localhost/CDDDev/pros.aspx?proid=9855555 </code></pre>
asp.net
[9]
5,828,936
5,828,937
Proportionally resize a bitmap
<p>I've got a bitmap... and if the bitmap's height is greater than maxHeight, or the width is greater than maxWidth, I'd like to proportionally resize the image so that it fits in maxWidth X maxHeight. Here's what I'm trying:</p> <pre><code> BitmapDrawable bmp = new BitmapDrawable(getResources(), PHOTO_PATH); int width = bmp.getIntrinsicWidth(); int height = bmp.getIntrinsicHeight(); float ratio = (float)width/(float)height; float scaleWidth = width; float scaleHeight = height; if((float)mMaxWidth/(float)mMaxHeight &gt; ratio) { scaleWidth = (float)mMaxHeight * ratio; } else { scaleHeight = (float)mMaxWidth / ratio; } Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap out = Bitmap.createBitmap(bmp.getBitmap(), 0, 0, width, height, matrix, true); try { out.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(PHOTO_PATH)); } catch(FileNotFoundException fnfe) { fnfe.printStackTrace(); } </code></pre> <p>I get the following exception:</p> <p><code>java.lang.IllegalArgumentException: bitmap size exceeds 32bits</code></p> <p>What am I doing wrong here?</p>
android
[4]
464,961
464,962
how to split the data from sqlite. i need to separate data by each sentence(means split by .)
<pre><code> String subTopicsArray [] = detail.split("\\. "); StringBuffer splitTopics = new StringBuffer(); for(int i=0; i&lt;subTopicsArray.length; i++){ String abc=subTopicsArray[i].trim(); if (abc.length() &gt; 0) { splitTopics.append(i+1+") "+subTopicsArray[i].trim()+"."+"\n" ); splitTopics.append("\n"); } </code></pre> <p>Am using this but am getting two dots for last sentence</p>
android
[4]
3,759,390
3,759,391
Always visible view in Android
<p>In iOS we can add subviews to UINavigationController view which will always stay visible across the application and do not slide with the views when they are pushed/popped. </p> <p>I am trying to accomplish the same thing in Android but cannot see a way to do this. I've seen solutions like adding the view to every Activity but that does not give me the result I want. </p> <p>What I am trying to do is to add an image for the footer which always is on the bottom across the application and does not slide with the activities when they are transitioned. </p>
android
[4]
1,576,395
1,576,396
Function with return value char* returning garbage
<p>I'm trying to build a utility class that I can re-use, that converts a <code>std::string to a char*</code>:</p> <pre><code>char* Foo::stringConvert(std::string str){ std::string newstr = str; // Convert std::string to char* boost::scoped_array&lt;char&gt; writable(new char[newstr.size() + 1]); std::copy(newstr.begin(), newstr.end(), writable.get()); writable[newstr.size()] = '\0'; // Get the char* from the modified std::string return writable.get(); } </code></pre> <p>The code works when I tried to load the output from within the stringConvert function, however when used in other parts of my application, this function returns garbage.</p> <p>For example:</p> <pre><code>Foo foo; char* bar = foo.stringConvert(str); </code></pre> <p>The above code returns garbage. Is there any workaround for this kind of issue?</p>
c++
[6]
4,376,861
4,376,862
Counting Lines and numbering them
<p>Another question.</p> <p>This program counts and numbers every line in the code unless it has a hash tag or if the line is empty. I got it to number every line besides the hash tags. How can I stop it from counting empty lines? </p> <pre><code> def main(): file_Name = input('Enter file you would like to open: ') infile = open(file_Name, 'r') contents = infile.readlines() line_Number = 0 for line in contents: if '#' in line: print(line) if line == '' or line == '\n': print(line) else: line_Number += 1 print(line_Number, line) infile.close() main() </code></pre>
python
[7]
1,435,854
1,435,855
How can I use in my project some classes from other project?
<p>I have an android project and I want to use some classes from another android project. How can I do that? In my project I draw the road between 2 points. From the new project I want to use some classes that help me draw more points on the map and tooltips with information for they.</p>
android
[4]
4,500,913
4,500,914
Can core data be used without tableView?
<p>I've seen some sample code about core data. All of that uses navigation base template where the tableView is already provided. When I remove the tableView or use window base template, it kept crashing with the console stated the same error, something like it couldn't find this entity name. And the entity name is exactly the same (in @"" as it should be). So can I use core data to do saving without having those table? Thanks in advance </p>
iphone
[8]
1,941,336
1,941,337
C# Update Object Properties without breaking instance
<p>I want to update an instance with properties of a newly created object at once but not breaking the instance binding to other variables. For eg.</p> <pre><code>public class MyClass{ public double X; public double Y; } MyClass a = new MyClass(2,1); MyClass b = a; MyClass c = new MyClass(1,1); a = c; //'b' should also be equal to 'a'. //I dont want to do something like this: a.Y = c.Y; a.X = c.X; </code></pre> <p>In my code, 'b' is actually not accessible anymore because it is binded to some UI, 'a' is my only way through updating 'b'. So after 'a = c' is called, b should have the location of [1,1].</p>
c#
[0]