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
208,910
208,911
jQuery event is not firing
<p>Im experiencing a problem where the click event assigned to the button tag is not firing upon clicking. There are several buttons with same class attribute but this should not effect the JS since class selector effects all matched elements.</p> <p>The entire html part is hidding on page load and shown properly when a specific link is clicked, but no event is fired when clicking the submit button. Also would someone be kind and link the url for jquery, bootstrap.css and bootstrap.js if you have it close by so I can try to create the desired effect in jsfiddle. Much obliged</p> <p>HTML: </p> <pre><code>&lt;span class="reply-comment" id="&lt;?php echo $imagecomments[1][$i]['commentid']; ?&gt;"&gt; &lt;div class="row-fluid"&gt; &lt;div class="span11 offset1"&gt; &lt;textarea class="&lt;?php echo $imagecomments[1][$i]['commentid']; ?&gt;" id="reply-textarea"&gt;&lt;/textarea&gt;&lt;br&gt; &lt;button class="btn btn-mini submit-reply-button" data-commentid="&lt;?php echo $imagecomments[1][$i]['commentid']; ?&gt;"&gt;&lt;strong&gt;Submit&lt;/strong&gt;&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>JS:</p> <pre><code>$('.reply-comment').hide(); $('.submit-reply-button').click(function(e){ e.preventDefault(); var commentid = $(this).data('commentid'); var reply = $(textarea.commentid).val(); var filename = $('.mainimage').data('filename'); var imgowner = $('.mainimage').data('imgowner'); $.ajax({ type: 'POST', url: '?category=addimgcomment', data: { "commentid" : commentid, "imgcomment" : reply, "filename" : filename, "imgowner" : imgowner }, success: function(data){ $(textarea.commentid).val(""); $('.'+commentid+'subcomments').html(data); } }); return false; }); </code></pre>
jquery
[5]
4,361,586
4,361,587
logic for checking sequential order in decimal numbers using java
<p>I want to check the sequential order of decimal numbers and find the missing number. For eg: If i have 1.1.1, 1.1.3, 1.1.4, 2.1.1, 2.1.3, 2.1.2, 3, etc Here i need to find the missing number 1.1.2 and also out of sequence 2.1.2. Kindly help me with logic.</p>
java
[1]
1,741,941
1,741,942
Limit what classes can extends another class
<p>I'm currently writing a solution that contains some abstract classes. One of these should only be extended from a few other classes as using it from other places than intended could cause a little bit of a mess. So what I want to do is limit what classes can extend this class.</p> <p>So if I have a class named ImportantStuff which is abstract I want to say that only Class A and Class B are able to extend it while any other class can't.</p> <p>You might wonder why I would want to do something like this. Well the code is written for work so there will be lots of other programmers working with it later, so I wish to make it clear for those that this class is not intended to be used from any other places than it already is. Yes I know I can write it in a class description and I have, but I want to make it 100% clear by blocking it as not all programmers are good at reading comments:) Also I'm kinda curious if it can be done in a good fashion as I couldn't find a good answer on the web.</p> <p>So my question is: what is the <strong>best</strong> way to make this happen? I guess I can send a key or something that is handled in the constructor, but is there a cleaner way to do this?</p>
php
[2]
608,174
608,175
I have an illegal start of type error, does anybody know what is that?
<p>im getting an illegal start of type error after I compiled my program. does anybody has any idea why am I getting this error? thanks</p> <pre><code>import java.util.Scanner; class utility{ private String gender; utility('m'); public void setGender(char inGender){ if(("m".equals(characterToUpperCase(inGender)))||("f".equals(characterToUpperCase(inGender)))); gender = characterToUpperCase(inGender); } private String characterToUpperCase(char inGender) { return null; } public static void main(String[]args){ Scanner in = new Scanner(System.in); } } </code></pre> <p>Here is the error:</p> <pre><code>illegal start of type utility('m'); </code></pre>
java
[1]
393,504
393,505
Android setContentView within an if statement
<p>this is a follow on from a previous question </p> <p><a href="http://stackoverflow.com/questions/10287998/android-setcontentview-not-being-applied">Android setContentView not being applied</a></p> <p>in this if statement i want to be able to setContentView when i set them both to R.layout.introact the if statement works but in the else part i want it to load a different layout but when i change it to R.layout.introact2 it Force closes the app</p> <p>heres the code</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String leagueCount = getIntent().getStringExtra("leagueCount"); Log.d("lc", "Received league count of:"+ leagueCount); if ("2".equals(leagueCount)){ setContentView(R.layout.introact); Log.d("lc", "Using league count of 2 layout"); }else{ setContentView(R.layout.introact); Log.d("lc", "Using default layout"); } </code></pre>
android
[4]
177,974
177,975
Orientation Change not Grabbing Correct layout
<p>I have two layout files, one for landscape (layout-land) and one for portrait (layout-port). When I run my application the correct layout is grabbed initially dependent upon how I am holding my phone. If I am holding landscape, landscape is grabbed and visa versa. BUT, once I initially launch my application, if I change orientation the first layout grabbed at launch is used when switching orientation.</p> <p>How do I get Android to changed layout xml per orientation change after initial launch of applicaiton? </p> <p>In my manifest I have android:configChanges="orientation/keyboardHidden" </p>
android
[4]
4,371,049
4,371,050
Number prototype definition
<p>Can someone explain me how to overcome this thing?</p> <pre><code>String.prototype.one = 1; "one".one; //returns 1 Number.prototype.one = 1; 1.one; //returns 'SyntaxError: Unexpected token ILLEGAL' </code></pre>
javascript
[3]
4,693,194
4,693,195
Composition of classes
<p>How come, when setting up class composition, contained classes can be called with a default constructor but not with one that takes parameters?</p> <p>That's kind of confusing; let me offer an example.</p> <pre><code>#include "A.h" class B { private: A legal; // this kind of composition is allowed A illegal(2,2); // this kind is not. }; </code></pre> <p>Assuming both the default constructor and one that takes 2 integers exists, only one of these is allowed. Why is this?</p>
c++
[6]
5,844,562
5,844,563
PHP string equals check fails
<p>I have a weird problem. I have checking a php string like this:</p> <p>On Page1</p> <pre><code>$_SESSION['test']=&lt;a value from a row fetched from db&gt; </code></pre> <p>On Page2</p> <pre><code>$myVar=$_SESSION['test']; echo $myVar; if($myVar=="This is the match string"){ echo "Matched"; }else{ echo "Not Matched"; } </code></pre> <p>I can see that $myVar echoed out the same string that I am checking again "This is the match string" but it still goes into else. I tried:</p> <pre><code>$myVar=(string)trim($_SESSION['test']); </code></pre> <p>but it still goes into else. What can be the issue? Any idea?</p>
php
[2]
1,770,236
1,770,237
PHP: Trying to gt a part of url to INTO PHP
<p>Okay so I have my PHP code: (I need help with the 4th line) More info down below the code.</p> <p>Basicly I am trying to get code below. i am trying to put get part of url but it doesn;'t work</p> <pre><code>$oIMDB = new IMDB('&lt;?ph p echo$_GET("m");?&gt; ') </code></pre> <p>and on the 4th line i put the code and the code doesn't work, how can i use it?</p>
php
[2]
799,396
799,397
The process cannot access the file
<p>i have a program that i use to write data to an excel file....and at the same time i use an excel file to import data from the first excel file using (import data) tool</p> <p>this is part of the program code</p> <pre><code> private void Log(string pText) { //textBox1.AppendText(pText + "\r\n"); // does not put cr lf, why? this.BeginInvoke(new MethodInvoker(delegate(){ textBox1.AppendText(pText); textBox1.AppendText("\n");})); } private void LogStatus(string pText) { textBox1.AppendText(pText + "\t"); textBox1.AppendText("\n"); } { StreamWriter theString = new StreamWriter(FileName + ".csv", true); theString.WriteLine(DateTime.Now + dataToSave + "\t\n"); theString.Close(); </code></pre> <p>my problem is when i start to debuge my program in Visual C# 2008</p> <p>it will work will and start to write data to the first excel file....then during the debug process</p> <p>i want to import data from the first excel file to the second one using import data(it's important for me to do that in real time i cant delay the import process)</p> <p>the debuging process stopped and the visual C# 2008 higlight this line of the code</p> <hr> <pre><code> theString.Close(); </code></pre> <hr> <p>and a message popup to me said</p> <p>The process cannot access the file because another process has locked a portion of the file.</p> <p>any help in overcome this problem plz</p> <p>and thanks</p>
c#
[0]
2,836,456
2,836,457
How to add <br /> after Artikler with jquery, beginner's quesion
<p>The following source is created dynamically.</p> <p>I'd like to add </p> <pre><code> &lt;br /&gt; after Artikler, to become Artikler&lt;br /&gt;. </code></pre> <p>Source </p> <pre><code>&lt;div id="shopping"&gt; &lt;p&gt;&lt;!--TEXT:--&gt; &lt;A HREF="cart-8.asp" CLASS="longsum"&gt;7&amp;nbsp;Artikler, verdi:&amp;nbsp;10 199,00&lt;/A&gt;&lt;/p&gt; &lt;/div&gt; </code></pre> <p>I think I need to use </p> <pre><code>.after('&lt;br /&gt;'); </code></pre> <p>but I am not sure how to get Artikler.</p> <p>7&nbsp; will be changed dynamically.</p> <p>Could you anyone tell me how to do it please.</p> <p>Thanks in advance.</p>
jquery
[5]
463,569
463,570
Includes and GET
<p>I currently have profiles on my website with a unordered list for the navigation, when a list item is clicked it loads the content from a AJAX call.</p> <pre><code>"Users Uploads" -&gt; AJAX -&gt; request.php with $_POST['id'] = '1' &amp; $_POST['request'] = 'users_uploads' -&gt; include_once('user_uploads.php'); </code></pre> <p>now the problem with this is that i cannot pass the $_GET through to the user_uploads.php as it needs it to find the specific users uploads. I know this is a terrible way of handling the requests but i already have it set for the other tabs.</p> <pre><code>if($_POST['request'] == "photos"){$user-&gt;requestPhotos($_POST['id']);} </code></pre> <p>What would be a effiecent way of somehow passing the $_GET through to user_uploads.php?</p>
php
[2]
4,301,035
4,301,036
How to know which overlayitem is being tapped?
<p>currently I used a map view and placed some overlay items in them</p> <p>I overiden the onTap function in ItemizedOverlay so that when user tap on the markers icons on the map, some action will perform.</p> <p>However, I don't know how to know which marker is being tapped so that the related data of the item will be displayed in the screen. How can I do that?</p> <p>Thanks!!!</p>
android
[4]
1,240,214
1,240,215
Detecting if jQuery is already has a running instance
<p>I'm making a script which requires jQuery X version. Let's say 1.7.1.</p> <p>Script will be included into other systems like include('script-main.php'); as a plugin. I will just tell my customers to copy/paste it, because I have no direct access to their servers. It will be on sale on a website like eBay.</p> <p>I need to know if they already loaded jQuery 1.4 in header, or another version.</p> <p>So, how can I do a check like this? (in pseudo code)</p> <pre><code>if(jQuery-&gt;isLoaded()) { if(jQuery-&gt;getVersion() &gt; 1.7) { //do my task } else { //include 1.7 but don't mess up already installed 1.4! //If they already have some jQuery coded in that page, it shouldn't break them - neither touch } } else { jQuery-&gt;load(); //load 1.7.1 via googleapis } </code></pre>
jquery
[5]
5,596,068
5,596,069
I just started learning the syntax of c++. What now?
<p>I more or less know the syntax of C++, but when I start to write a program, I have nothing to write, I am blank. The thing is I knew the syntax of C as well and I didn't know how to write programs in that either. Though I could understand the written answers of almost anything.</p> <p>So, my question here is how do I start writing my own programs or how do I put my thoughts on any program using any programming language?</p>
c++
[6]
5,196,533
5,196,534
How do I get actual image width and height using jQuery?
<p>On a page I have displayed 100 images, which have the width and height attribute changed. Image id is in a loop. </p> <p>How do I get the original image size, inside this loop? $(this).appendTo(".prod_image").attr('height',150).attr('width',150).attr('title','').attr('name','').attr('alt','').attr('id','id'+i);</p>
jquery
[5]
4,813,823
4,813,824
Iphone: uitextview setting done button
<p>I use a UITextView in my application. The text editing is ok. I set the return button to Done. When I finish the editing, I like to hide the keyboard with the done button. My Question: How can I set the done button?</p> <p>Thanks, Balu.</p>
iphone
[8]
4,996,861
4,996,862
changing domain value of href using jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3459136/i-need-to-update-href-value-using-jquery">I need to update href value using jquery</a> </p> </blockquote> <p>I wanted to change the domain value of href using jquery. If in the href="http://www.google.com?gsec=account" if i find gsec=account then i wanted to change only the domain value of href should be "http://account.google.com?gsec=account. There are other query string parameters which are added to gsec=account dynamically. So in the href whatever the value is i need to change only the domain name.</p>
jquery
[5]
1,265,792
1,265,793
flush and ob flush are not working
<p>here is my code. The <code>ob_flush()</code> and <code>flush()</code> functions are not working. Why? </p> <pre><code>&lt;?php function get_headers_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 4); $r = curl_exec($ch); $r = split("\n", $r); return $r; } $urls = file('users.txt', FILE_IGNORE_NEW_LINES); foreach ($urls as $url) { $headers = get_headers_curl(trim($url)); if (false !== stripos(implode("\n", $headers), "Apache")) { echo "$url ====&gt; ok" ; ob_flush(); flush(); } } ?&gt; </code></pre>
php
[2]
5,966,278
5,966,279
How to display a .doc or .docs file's content into a html page using php?
<p>I need to display a .doc or .docx file using php.</p>
php
[2]
4,053,409
4,053,410
PHP: for loop and birthday date
<p>I have a little problem</p> <p>birthday´s get stored as DATE in the MySQL database.</p> <p>DATE is 00-00-00</p> <p>and now when i make the select options, i did it with a for loop:</p> <pre><code>&lt;?php $month_names = array("januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"); for ($i=1; $i&lt;=12; $i++) { echo "&lt;option "; if ($i == $month) { echo "selected=\"selected\" "; } echo "value=\"$i\"&gt;", $month_names[$i-1], "&lt;/option&gt;\n"; } ?&gt; </code></pre> <p>This works, but gives me 1,2,3,4,5,6,7,8,9,10,11,12 as values.</p> <p>I need to have it like this 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12.</p> <p>How can i do this?</p>
php
[2]
4,752,721
4,752,722
Disable EditText blinking cursor
<p>Does anyone know how to disable the blinking cursor in an EditText view?</p> <p>Thanks, Kevin</p>
android
[4]
5,168,793
5,168,794
Individual volume controls to differents sounds
<p>I'm trying to make a simple app that have various sounds and every sound (could be wav or mp3) have diferents volume controls but I don´t know where start :S </p> <p>I've been searching for the answer or similar answer but not exceed.</p> <p>I will apreciate your help!</p>
android
[4]
454,041
454,042
Radio Button List
<p>I wonder whether someone may be able to help me please.</p> <p>I'm using the code below to construct a list with a radio button as a way of selecting each row of data.</p> <pre><code>&lt;?php mysql_connect("hostname", "username", "password")or die(mysql_error()); mysql_select_db("database"); $result = mysql_query("SELECT userdetails.userid, finds.userid, finds.locationid, detectinglocations.locationid, detectinglocations.locationname, finds.dateoftrip, finds.findname, finds.finddescription FROM userdetails, finds, detectinglocations WHERE finds.userid=userdetails.userid AND finds.locationid=detectinglocations.locationid AND finds.userid = 1"); if (mysql_num_rows($result) == 0) // table is empty echo 'There are currently no finds recorded for this location.'; echo"&lt;table&gt;\n"; while (list($userid, $dateoftrip) = mysql_fetch_row($result)) { echo"&lt;tr&gt;\n" . "&lt;td&gt;&lt;input type='radio' name='radio' dateoftrip, value='{$userid}' /&gt;&lt;/td&gt;\n" ."&lt;td&gt;&lt;small&gt;{$dateoftrip}&lt;/small&gt;&lt;td&gt;\n" ."&lt;/tr&gt;\n"; } echo"&lt;tr&gt;&lt;td colspan=\"3\"&gt;"; echo"&lt;br&gt;"; echo"&lt;/td&gt;&lt;/tr&gt;"; echo'&lt;/table&gt;'; ?&gt; </code></pre> <p>I can manage to construct the list but the value next to the radio button is the 'userid' whereas I'm looking to put the 'dateoftrip' against each radio button.</p> <p>I've been working on this for a while now and I can't see where my error is.</p> <p>I just wondered whether someone could perhaps take a look at this please and let me know where I'm going wrong.</p> <p>Many thanks</p>
php
[2]
425,513
425,514
Read Zip file from URL with PHP
<p>I'm searching for a good solution to read a zip file from an url with php.</p> <p>I checked the zip_open() function, but i never read anything about reading the file from another server.</p> <p>Thank you very much</p>
php
[2]
602,751
602,752
run time text boxs
<p>hey all... its very hard to explan i hope you understand it and help coz i really need your help guys the thing is i have to make the user choose the number of matrix with this number i have to create the same number of matrices again and do calculation on each one like if user matrix 3x3 i have to redo this matrix with different value 3 times my question is : 1- how can i re do the same number of textboxs over and over . 2- how i can calculate each matrix and get the value i hope you understand</p>
c#
[0]
1,557,818
1,557,819
Deleting of an item, indexing problem...
<pre><code>for (var i = 0; i &lt; max; i++) { deleteButton[i].addEventListener('click', function (e) { AddPatientVitalsModel.globalData.splice(i, 1); }); } </code></pre> <p>When i click on a button, a new table is added... i change some information in table and again add another table... and i delete this table... but the array value does delete the first index alone.</p> <p>The Value of <strong>i</strong> is always zero and it deletes the first item in the Array. How can i ensure that for each table it has different ID.</p> <p>For each click i feel so that i value always starts from Zero.... </p>
javascript
[3]
442,562
442,563
Getting index of dictionary item based on item.key
<p>How can I find the index of an element of a dictionary based on the element key? I'm using the following code to go through the dictionary: </p> <pre><code>foreach (var entry in freq) { var word = entry.Key; var wordFreq = entry.Value; int termIndex = ??????; } </code></pre> <p>Could anyone help please?</p>
c#
[0]
1,057,654
1,057,655
Writing to a servlet from a java class and reading from another application
<p>I want my java class , which has the processed information , to write to a servlet. Then I want the separate module to read this information from the servlet. Is it possible to do so?</p> <p>In many examples I found writing to a servlet and getting back the response to the same java class. I want the content which has written to the servlet to remain until my other application reads from it. </p> <p>Please , any help is appreciated.</p>
java
[1]
3,695,501
3,695,502
tagging dictionary data
<p>I would like to do something equivalent to "tagging" a dictionary element.</p> <p>Here is some pseudo-code to illustrate the idea:</p> <pre><code>mydict = dict() mydict['thiskey'] = 'myvalue' #then i would like to do this: mydict['thiskey'].tag = 1 </code></pre> <p>is there anything like this? or maybe i could just append to the value somehow? but i would need to know how to still access the original value...</p>
python
[7]
3,290,785
3,290,786
Is it possible to extract the input sent to a printer using c#?
<p>I have to create a windows service that will monitor all printouts taken from a specific machine. I have to extract the formatted input sent to a printer and process it. I have got no idea on how to perform this.Has anyone of you dealt with this kind of requirement. I have to do it in c#. Please suggest.</p>
c#
[0]
1,848,882
1,848,883
What's wrong with this code?
<p>Here is the code: <a href="http://pastebin.com/RVSLLyQi" rel="nofollow">http://pastebin.com/RVSLLyQi</a></p> <p>Starting from line 37, the html outputs to empty 'a' tags. I'm guessing something is wrong with my syntax on that line. Still a beginner here. Any help would be appreciated!</p>
php
[2]
1,141,286
1,141,287
Script tag in JavaScript string
<p>I am encountering an issue where having a ending script tag inside a quoted string in JavaScript, and it is killing the script. I assume this is not expected behaviour. An example of this can be seen here: <a href="http://jsbin.com/oqepe/edit" rel="nofollow">http://jsbin.com/oqepe/edit</a></p> <p>My test case browser for the interested: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091028 Ubuntu/9.10 (karmic) Firefox/3.5.4.</p>
javascript
[3]
843,701
843,702
Caching on shared server - security issue for local cache directory?
<p>I am working with this script: <a href="http://www.cforcoding.com/2009/05/supercharging-javascript-part-4-caching.html" rel="nofollow">http://www.cforcoding.com/2009/05/supercharging-javascript-part-4-caching.html</a></p> <p>Basically the instructions recommend not to use caching if it will be used on a shared server. </p> <p>Now I am using another script which dynamically generates a gif image from a font file and the text I provide and stores it in a local cache drive. Here is part of that code:</p> <pre><code>$hash = md5(basename($font_file) . $font_size . $font_color . $background_color . $transparent_background . $text) ; $cache_filename = $cache_folder . '/' . $hash . $extension ; if($cache_images &amp;&amp; ($file = @fopen($cache_filename,'rb'))) { header('Content-type: ' . $mime_type) ; while(!feof($file)) print(($buffer = fread($file,$send_buffer_size))) ; fclose($file) ; exit ; } </code></pre> <p>So my 2 questions are:</p> <p>1) For the code I pasted here, is there any security issue?</p> <p>2) And can I just use this piece of code which is used for caching with the website url I provided at the beginning ( <a href="http://www.cforcoding.com/2009/05/supercharging-javascript-part-4-caching.html" rel="nofollow">http://www.cforcoding.com/2009/05/supercharging-javascript-part-4-caching.html</a> ) Basically replace their caching method with this one to avoid security issues as mentioned. Or do you recommend some other method?</p>
php
[2]
2,372,192
2,372,193
In Asp.net, on button click, how to open a download dialog, and then redirect the user to another page?
<p>I have a button. When the user clicks it, I want to trigger a download dialog box, and then redirect the user to another page.</p> <p>However, I'm having problems getting the download and redirect to run together. Once the download dialog box is shown, execution on the rest of the code seems to end:</p> <pre><code>Sub DisplayDownloadDialog(ByVal filepath As String) Dim filename As String = Path.GetFileName(filepath) Response.ContentType = "application/octet-stream" Response.AddHeader("Content-Disposition", "attachment; filename=""" &amp; filename &amp; """") Response.WriteFile(filepath) End Sub </code></pre> <p>I tried to add a refresh to the header, but it still doesn't work. I also tried javascript (but not using window.open...since some browsers block that), but I can't get a redirect to work.</p> <p>Any ideas? I really appreciate the help.</p>
asp.net
[9]
563,514
563,515
which of this method is recomended - mail function
<p>hay now i want to send mail to 200 users first way $users = 'user1@,user2@,user3,etc';</p> <pre><code>foreach(explod(',',$users as $mail){ mail($mail,'','',''); } </code></pre> <p>or</p> <pre><code>mail(mail one,mail 2,mail3,mail4,etc) </code></pre> <p>i know the code is fully error</p> <p>but i want the meaning</p> <p>which is the best mail with multi by spreate by , or looping the mail function with the one mail every time</p>
php
[2]
1,838,757
1,838,758
javascript split undefined array
<pre><code>var ar= []; ar[0] = 'abc|def'; ar[1] = ['www|aaa', 'bb|cct', 'oo|kopp']; for(var i=0; i&lt;ar[1].length; i++) { var f = ar[1][i].split['|']; alert(f[0]); //error f is undefined } </code></pre> <p>Why there is error on split function? I am new to javascript.</p> <p>Thanks.</p>
javascript
[3]
61,437
61,438
Rotation and resizing the image + iPhone
<p>I am trying to resize and rotate an image over the iPhone. i picked the image and displayed it using UIImageView</p> <p>and rotation of the image is done by two buttons (for clockwise &amp; counterclockwise)</p> <p>resizing of image works fine while rotation button not pressed but when i pressed to rotate image into clockwise direction and the resize the image, width of the image increases rapidly even i am trying to decrease the width.</p> <p>and when i pressed to rotate image into counterclockwise direction and the resize the image, height of the image increases rapidly even i am trying to decrease it.</p> <p>i found that there is some sign changed while rotating the image along with the value, coz once press the clockwise button and then counterclockwise button, and then resizing works fine.</p> <p>i used the following code for rotating the image.</p> <pre><code>CGAffineTransform transformRotate = CGAffineTransformMakeRotation(movingAngle); imageViewRotation.transform = transformRotate; </code></pre> <p>where movingAngle is in Radians and imageViewRotation is the UIImageView which contains the image.</p> <p>waiting for your reply</p>
iphone
[8]
1,980,721
1,980,722
Can asp integrate with .Net 4.0?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/133173/classic-asp-and-asp-net-integration">Classic ASP and ASP.NET Integration</a> </p> </blockquote> <p>I got to work on one application that is created in asp about 15 yrs ago. Now some functionalities are to be added into this application using .Net 4.0. This may sound silly but can .Net 4.0 be integrated with asp application? I understand asp was used before .Net came into existence and .Net came just 10 yrs ago. If it can be integrated we could be saved from writing tons of code. Any help would be greatly appreciated.</p> <p>Thanks in advance :)</p>
asp.net
[9]
1,614,433
1,614,434
JavaScript: how to test if clearInterval function is true or false
<p>I've a little question i'd like to test if my <code>clearInterval(playfunction)</code> is true of false and I tought it would work like this</p> <pre><code>if(clearInterval(play)==true){ //do this 1 } else{ //do this 2 } </code></pre> <p>But it dosnt work like this...what did I do wrong?</p> <p>Kind Regards, and thanks for help!</p>
javascript
[3]
4,522,884
4,522,885
Referencing a list element by it's name
<p>I'm trying to scan through a list of dictionary references to get the number of keys in each dictionary. How do I go about referencing an element's name as opposed to the content of the dictionary? Each of the elements in the audit_dicts list is a reference to an existing dictionary.</p> <pre><code>audit_dicts = [ osdata, weblogic, tomcat ] for i in audit_dicts: print "Length of the %s dictionary is %d lines." % (i.name(), len(i)) </code></pre> <p>I understand that it has to do with the contents type being a dictionary, but is there no way to print the name of the element in the list? I'm essentially using the list to store all of these dictionaries, so that I can perform multiple actions on them in a single loop. Also, is there a way to declare these dictionaries within the same loop? What is the pythonic way of doing so? I currently have a bout 20 different dicitonaries of data, but I've only been able to to delcare each one individually before building the dictionary from web data.</p> <pre><code>for i in audit_dicts: i = {} </code></pre>
python
[7]
5,123,532
5,123,533
preincrement / postincrement in java
<p>Can someome help me to understand why: </p> <pre><code>int i=1; int j=1; int k=1; int l=1; System.out.println(i++ + i++); System.out.println(++j + ++j); System.out.println(k++ + ++k); System.out.println(++l + l++); </code></pre> <p>give:</p> <p>3<br> 5<br> 4<br> 4 </p>
java
[1]
5,306,307
5,306,308
How to get word from CurrentInputConnection in android?
<p>I am working on custom InputConnection in android. Everything is working fine, but i want to get characters between cursor's current position and start position of particular word.</p> <p>Is there any suggestion? how can i do that?</p> <p>Thanks..</p>
android
[4]
5,682,361
5,682,362
Working with Bundles in Android
<p>I have an app containing many functions, of course. On of my functions is returning two variables, one <code>int</code> and one <code>String</code>. I've figured out that the easiest way to return this variables is to put them in a <code>Bundle</code>, e.g like this:</p> <pre><code>private Bundle returnInfo() { Bundle result = new Bundle(); String something = "This is a test"; int number = 15; result.putInt("number", number); result.putString("string", something); return result; } </code></pre> <p>And in another function like this:</p> <pre><code>private void getInfo() { Bundle gotcha = returnInfo(); String gotSomething = gotcha.getString("string"); int gotNumber = gotcha.getInt("number"); } </code></pre> <p>This is just a part of my app, in fact this is just a mockup to show you my problem. Cause when I debug my app, the variables <code>gotSomething</code> and <code>gotNumber</code> contains <code>null</code>, but my Bundle <code>gotcha</code> contains <code>Bundle[{string=This is a test, number=15 }]</code> isn't this the way to solve my problem? </p>
android
[4]
4,713,216
4,713,217
UITableViewCell highlighting issue - iPhone
<p>I have a UITableView and I am having an issue with whenever I try to click on the Cell. When the cell is highlighted it puts some test on top of the text that is already on the cell make the text on the cell hard to read. This only happens while I have the cell highlighted. </p> <p>Please help me with this issue. </p> <p>Thanks </p>
iphone
[8]
2,274,944
2,274,945
iphone is there a way to store a image in your app to the Images Gallery?
<p>I'm putting together a photo gallery program. I's their a way to store the images in my app to the image gallery??? I'v seen sample code to get images using the uiimagepicker, but nothing for storing them in the photo gallery?</p>
iphone
[8]
5,121,585
5,121,586
Total no of possible special characters can be used in C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2522933/how-to-find-whether-a-string-contains-any-of-the-special-characters">How to find whether a string contains any of the special characters?</a> </p> </blockquote> <p>Dear All,</p> <p>simple question I have a string and I want to make sure that there are special characters (like # $ _ &amp; %) in that string.How can we achieve this using C#</p> <p>Thanks lokesh</p>
c#
[0]
5,767,329
5,767,330
how to use com.android.mms.transaction package in my app
<p>I am working on MMS app, I need to use "com.android.mms.transaction" this package in my app..</p> <p>please suggest me which JAR file I need to include my app to access this package..</p>
android
[4]
5,304,025
5,304,026
treeview with multiple columns in asp.net
<p>I need to create a treeview with multiple columns in asp.net. I have seen examples in winform but I want one in asp.net</p> <p>Can you help me with some code?</p> <p>Thank you</p>
asp.net
[9]
4,018,608
4,018,609
What should be the retain Count here + iPhone
<p>I have following lines of code in a program</p> <pre><code>VisitWebsiteVC *visitWebSite = [[VisitWebsiteVC alloc] initWithNibName:@"VisitWebsiteVC" bundle:nil]; NSLog(@"Retain Count :%i",[visitWebSite retainCount]); [self.navigationController pushViewController:visitWebSite animated:YES]; NSLog(@"Retain Count :%i",[visitWebSite retainCount]); [visitWebSite release]; </code></pre> <p>In the console I see the print statement as</p> <blockquote> <p>Retain Count :1<br> Retain Count :5</p> </blockquote> <p>I am not getting why the line after I am pushing my viewController is returning retainCount of my viewController as 5, when it must be 2.</p>
iphone
[8]
5,997,367
5,997,368
How to show the UITableview like as UIAlertview
<p>I am developing an application in which I am using one UIButton. </p> <p>When I click that button it needs to show the UITableView and other remaining controls are not working. I need to show the UITableView act like a UIAlertView.</p>
iphone
[8]
2,536,760
2,536,761
Insert selected text on the page into textarea (jQuery)
<p>Need to insert selected text on the page into textarea. There must be some button to do it.</p>
jquery
[5]
5,553,158
5,553,159
ScriptResource.axd not caching
<p>I have scriptresource.axd and webresource.axd files served with the following header but they never get cached:</p> <pre><code>HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Mon, 27 Feb 2012 18:26:38 GMT X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: IBA.NET=186661E187AA166417707A7A51716853DE5E800748512185BCCABB5D30F53A3545B3B423D3E86040BDFFCB50BF8A73868CA9887F9A9A1AE6C13002DF548444EC9A2B79298078B0DE3094F3C1304181CAB8D41E77C41F707611C9232A0947BD30BB4B7ECCE64B5CB8AA46D720F980961DDA3065796FB5E3D4E6773391C85556D919C84C20B360950D0B7BED18F6D32A8EFEC0E5E5F2440CE6BF57CF64EF94773A76BD0A46053412DC43A44BC22D99F8D1C92604C9E89289E736B15348944C95B554F3CED4|-1; path=/ Cache-Control: public, no-cache="Set-Cookie" Expires: Tue, 26 Feb 2013 18:26:38 GMT Last-Modified: Fri, 24 Feb 2012 14:16:48 GMT Content-Type: application/x-javascript Content-Length: 84019 </code></pre> <p>I am running the app with <code>&lt;compilation debug="false"&gt;</code> and <code>&lt;scriptResourceHandler enableCompression="true" enableCaching="true"/&gt;</code> to no avail.</p> <p>Any ideas?</p>
asp.net
[9]
710,093
710,094
javascript function input validation
<p>I am trying to write a javascript function which is called input() (performing input validation) and it will contain 3 arguments - the arguments are message, min and max.</p> <p>I am having trouble bringing/writing the the function as a whole, have managed to work out bits of the function though - any help appreciated!</p> <p>Code so far:</p> <pre><code> // declare variables var min = 5 var max = 20 var message = 'input must be between 5 and 20'; // get user input input = parseInt(prompt(message)); // check range while(isNaN(input) || input&lt;min || input&gt;max) { alert('input was invalid'); input = parseInt(prompt(message)); } // output validation alert('input was accepted'); </code></pre> <p>(from <a href="http://jsfiddle.net/AnJym/2/" rel="nofollow">http://jsfiddle.net/AnJym/2/</a>)</p>
javascript
[3]
4,931,424
4,931,425
spell checker in android application
<p>Does spellChecker same as spelling corrector? How can I implement spellChecker to check the user input for my android app in the AutoComplete text box? Thanks in advance.</p>
android
[4]
4,624,018
4,624,019
Grouping similar types of member variables together
<p>When writing a class do you group members variables of the same type together? Is there any benefit to doing so? For example:</p> <pre><code>class Foo { private: bool a_; bool b_; int c_; int d_; std::string e_; std::string f_; ... }; </code></pre> <p>As opposed to:</p> <pre><code>class Bar { private: std::string e_; bool a_; int d_; bool b_; std::string f_; int c_; . </code></pre> <p>.. };</p> <p>Or do you simply have them in the order they were added?</p>
c++
[6]
4,709,968
4,709,969
"__comp cannot be used as a function" c++ while trying next_permutation
<p>I'm trying to do permutations with next_permutation from the stl, however I'm getting an error and I can't figure out how to fix it. I've tried googling, however the only results that come up are when people used the same function and function's variables name but thats not the case here. </p> <p>Here's the error : </p> <pre><code>'__comp' cannot be used as a function </code></pre> <p>Here's the code :</p> <pre><code>struct rectangle{ int n; int h; int w; }; bool check(const rectangle&amp; rect1,const rectangle&amp; rect2){ return rect1.n &lt; rect2.n; } do{ //... } while ( next_permutation(recs.begin(), recs.end(), check) ); // Getting error on this line. </code></pre> <p>Here's the full source code along with the sample input in case it's needed <a href="http://pastebin.com/eNRNCuTf" rel="nofollow">http://pastebin.com/eNRNCuTf</a></p>
c++
[6]
717,139
717,140
C# - Who's online list? API?
<p>What's going on, I was just sitting here thinking of more ideas for my app and it jumped into my head "Online user list" is it possible to get a list some how, some way of all online users? my app already uses HWID and serial key to authorize so I'm guessing that on login and form close have it run a mySQL query to my server where their username / serial key is located and create a column called "online", then on form load have it set the value to "1" then on form exit set it to "0".</p> <p>So then I can make a php file and use client.download and then split it at each line to read the list. </p> <p>But the above idea sounds like a hassle and a little more then I need to do, does anyone have a possible simpler way of doing this? like maybe a link to a API for this or something of such.</p>
c#
[0]
592,260
592,261
How do I match 0,2,3,4 elements of one array to 0,2,3,4 elements of another array and print the 5th element from both the arrays in python?
<p>I am trying to match the 0,2,3,4 elements of an array storing the columns of one tab delimited file to 0,2,3,4 elements of another array storing the columns of another tab delimited file and print out the element 5 (column 6) from both the input files in python.</p> <p>Here is the code that I worked on but I guess that the code matches line by line between two files. However, I wanted to match the line of file1 to any line in file 2</p> <pre><code>#!/usr/bin/python import sys import itertools import csv, pprint from array import * #print len(sys.argv) if len(sys.argv) != 4: print 'Usage: python scores.py &lt;infile1&gt; &lt;infile2&gt; &lt;outfile&gt;' sys.exit(1) f1=open("/home/user/ab/ab/ab/file1.txt", "r") f2 = open ("/home/user/ab/ab/ab/file2.txt", "r") f3 = open ("out.txt", "w") lines1 = f1.readlines() lines2 = f2.readlines() for f1line, f2line in zip(lines1, lines2): ## for loop to read lines line by line simultaneously from two files #for f1line, f2line in itertools.izip(lines1,lines2): row1 = f1line.split('\t') #split on tab row2 = f2line.split('\t') # split on tab if ((row1[0:1] + row1[2:5]) == (row2[0:1] + row2[2:5])): # columns 0,2,3,4 matching between two infiles writer = csv.writer(f3, delimiter = '\t') writer.writerow((row1[0:1] + row1[2:5]) + row1[5:6] + (row2[0:1] + row2[2:5]) + row2[5:6]) </code></pre>
python
[7]
4,738,084
4,738,085
Retaining an object vs. Re-initializing it
<p>Well I guess this is not a normal how-to-do-this-or-that stackoverflow question, but perhaps someone could enlighten me of a better approach for this question.</p> <p>I've created an interface that could inherit different "engines" depending on a value and return the same object for all engines. This is a short time flat rentals application that has some integration with other applications in other states, obviously each one has a API, so I have to know how to send and receive each one differently and inside my application to be able to have the same object for all APIs. What I do exactly is I initialize something like this.</p> <p><code>$flat = new API(array('engine' =&gt; 'some_api')); // the array has some more information inside but it is unimportant for the question</code> </p> <p>Now I have a list of IDs that each of them is for a different API. Something like</p> <p><code>$list = array(1 =&gt; 'api_1', 2 =&gt; 'api_2'); // and more ...</code></p> <p><strong>Now for the question!</strong></p> <p>When iterating over the <code>$list</code> what would <em>you</em> think is better, Retaining all the possible engines inside the API object and for each ID I already have the "engine" initialized inside the API object (probably better speed/performance as everything is already allocated) <strong>or</strong> should foreach ID create a new API object with only the right "engine" initialized. (Lesser speed/performance but should be better on the memory management).</p> <p>The API object has no meaning outside of the scope of the iteration so there is no need to retain it further down the line, but perhaps there would be less garbage collection overhead all in all if I just initiate one object instead of say 2 or 4 for the amount of IDs I have.</p> <p>Any thoughts?</p>
php
[2]
4,604,657
4,604,658
Popoup on tap google maps overlay
<p>Is possibile to make a popup such as the google maps popup that show when I tap on the overlay ?</p> <p>I want to make a pop up like this:</p> <p><img src="http://i.stack.imgur.com/wpyCP.png" alt="snap"></p>
android
[4]
5,546,903
5,546,904
How i connect MySql in android
<p>i am trying to connect mysql in android i cant success so need to help -- and there any alternate way to developed application without mysql if there is small database needed. and which one is better to use mysql or sqlite and why ?</p>
android
[4]
5,930,644
5,930,645
asp.net Log-in doesn't work on firefox browser?
<p>i've log-in page in my site but log-in control doesn't work on any browser other than IE.</p> <p>please can anyone help me??</p> <p>thanks</p>
asp.net
[9]
3,251,445
3,251,446
Make jQuery dropdown toggle when click away?
<p>I am using a jQuery drop down and I want the box to toggle when you click off the box</p> <pre><code>$(document).ready(function () { $('li.menu_head').mouseenter(function () { $('div.newsadviceDrop').slideToggle('medium'); }); }); </code></pre> <p>Can you help me?</p>
jquery
[5]
4,110,814
4,110,815
Can an element of an array return by a function be used without prior assignment?
<p>I have a function returning an array: <code>function foo(){ return array('foo'=>1,'bar'=>2); }</code></p> <p>Can I access an element of the return array without assigning it to a temporary variable first (e.g. <code>foo()['bar']</code>)?</p> <p>The following example returning an object works like a charm:</p> <pre><code>function foo(){ return (object) array('foo'=>1,'bar'=>2); } echo foo()->bar;</code></pre>
php
[2]
5,270,310
5,270,311
ajax response vs normal http response
<p>By checking the <code>x-requested-with</code> header we can check whether a request is an ajax or not, but how does the browser knows it's an ajax response and it need not be rendered, rather it needs to be handled by JS?</p>
javascript
[3]
48,983
48,984
Help with overriding python import
<p>In application no.1 I have a settings.py file, and a utils.py, which contains the following:</p> <pre><code>from application_one import settings def someFunction(): // do some logic here based on imported settings </code></pre> <p>Then in application no.2 I do:</p> <pre><code>from application_one.utils import someFunction </code></pre> <p>In application no.2 I have a local settings.py and when I import 'someFunction()' I want to use the local settings.py not the file from application no.1. So how would one overide the import in application no.2?</p>
python
[7]
919,283
919,284
Facebook like button functionality
<p>I am developing facebook app,I can able to get all the data of news feed.But I want to get the same functionality as android faceboook "like" has.I can able to like and unlike the post,but cant change the likes count and (like to unlike) and (unlike to like) as fast as android facebook.</p> <p>I would like to know how they can able to do within fractions. </p>
android
[4]
5,638,511
5,638,512
iPhone flipside view
<p>Stupid question of the day: where can I find info in the docs about creating flipside views??? Thanks</p>
iphone
[8]
3,806,227
3,806,228
TableVIew Problem
<p>i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?</p>
iphone
[8]
1,203,271
1,203,272
How to only copy an element's styles to another element?
<p>I have tried "window.getComputedStyle" and "currentStyle",but it not work except the chrome. Please look my demo below firstly,thanks. <a href="http://www.learning.fancyboy.net/javascript/cloneStyles.html" rel="nofollow">http://www.learning.fancyboy.net/javascript/cloneStyles.html</a> The code is:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;clone style&lt;/title&gt; &lt;style&gt; *{margin:0;padding:0;} #text1{width:200px;height:50px;border:1px solid red;color:#ccc;line-height:50px;padding:5px;margin:5px;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;input type="text" id="text1" value="origin" /&gt; &lt;input type="text" id="text2" value="clone" /&gt; &lt;/div&gt; &lt;script&gt; var text1=document.getElementById("text1"), text2=document.getElementById("text2"), cssObj, sCssText=""; if(!!window.getComputedStyle){ cssObj=window.getComputedStyle(text1,null); sCssText=cssObj.cssText; } else{ cssObj=text1.currentStyle; for(var k in cssObj){ sCssText+=k+":"+cssObj[k]+";"; } } text2.style.cssText=sCssText; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Any idea?</p>
javascript
[3]
1,219,824
1,219,825
Is possible T<T>
<p>I have some class, for example <code>A</code>, and others who extended <code>A (A1,A2)</code>. The <code>A</code> is a container - it has only fields, any methods and properties.</p> <p>Another class is <code>B&lt;T&gt; where T : A</code>, and extends of <code>B (B1, B2)</code></p> <p>Is it possible do that in c#?</p> <pre><code>public List&lt;T&lt;T1&gt;&gt; DoSomething(object parameter) where T : B&lt;T1&gt;, new() where T1 : A, new() </code></pre> <p>In that method i must dynamic create T (B1 or B2 or B3) object and fill that generic object dynamic created T1 objects (A1, A2, A3). Yup i probably can use Activator, but use new T() will be better and use less casts</p>
c#
[0]
2,211,438
2,211,439
Is there a way to get $.ajax's default object
<p>Like the title says, Is it possible to get all the defaults that are associcate with the <code>$.ajax</code> function. </p> <p>So it would return something like this:</p> <pre><code>{ global:true, headers:{}, ifModified:false, type:"GET", url:"the current page url", etc.... }</code></pre>
jquery
[5]
894,021
894,022
Saving custom data types
<p>Im making an app similar to apples weather app. My main view has a NSMutableArray of objects to be displayed. This array is managed by the user. I want to be able to save this array so that when the app is relaunched it has the stuff the user selected. The objects stored are "Event" objects which is a custom object type that stores more custom objects that all hold some of the following: NSString, NSNumber, NSUInteger, NSURL. My research has led me to three options, none of which i understand, nor know how to implement: saving to a plist using writeToFile, archiving the data, or saving it to userPrefs. Does anybody know of a solution to my problem?</p> <p>Sample data object: ` </p> <pre><code>@interface Rider : NSObject { NSString *name; } -(Rider *) initWithName:(NSString *) nam; - (NSString *)description ; @property (nonatomic, retain) NSString *name; </code></pre> <p>`</p>
iphone
[8]
175,506
175,507
Defining member function of explicitly specialized class outside of the class definition
<p>I'm seeing an error related to templates (compiler is Visual Studio 2012) that I don't understand. Here's the code, boiled down to the essentials:</p> <pre><code>// Templated class - generic template &lt;typename T&gt; class Test { public: void WorksFine() {} // Comiples and works as expected at runtime void Problem(); }; // Templated class - expicit specialization for T = int. template &lt;&gt; class Test&lt;int&gt; { public: void WorksFine() {} // Comiples and works as expected at runtime void Problem(); }; // The definition below compiles and works fine at runtime. template&lt;typename T&gt; void Test&lt;T&gt;::Problem() {} // The definition below gives error C2910. template&lt;&gt; void Test&lt;int&gt;::Problem() {printf("In Test::Problem(int instantiation)\n");} </code></pre> <p>For the WorksFine method, the function definition is <i>inside</i> the explicitly specialized class definition, and everything is fine. But for the Problem method, when I define the method outside the explicitly specialized class definition, I get error C2910</p> <p>Why is this? Error C2910 indicates that the problem is that Test::Problem() is already defined. But it is <i>not</i> defined inside the class...there is no function definition only a declaration.</p> <p>It seems pretty lame to be able to do something or not depending on where you choose to put the function definition, which I always though was more of a style/syntax decision, not a functionality/semantics decision. Am I missing something?</p>
c++
[6]
775,315
775,316
How can i check if ctrl,alt are pressed on left mouse click in c#?
<p>I want to check in my form if <kbd>Ctrl</kbd><kbd>Alt</kbd> are pressed on left mouse click. Is there any way of checking it?</p>
c#
[0]
5,347,522
5,347,523
How do I exclude certain clicks from stopPropagation() ? Jquery
<p>I have a div #basket which is shown using the JQuery slideDown function.</p> <p>To slide the div back up the use can click anywhere on the page.</p> <pre><code>$(document).click(function () { $("#basket:visible").stop(true, true).slideUp("slow"); }); </code></pre> <p>Of course I don't want the div to be closed when a user clicks inside of it. So I use:</p> <pre><code>$("#basket").click(function (e) { e.stopPropagation(); }); </code></pre> <p>Now the problem I'm having is that a form is contained in the div and this cancels ALL click functions within the div.</p> <p>Is there a way to close this div by clicking on the page without cancelling all clicks?</p>
jquery
[5]
5,251,514
5,251,515
Poor performance with ListView when displaying large images
<p>I have a ListView with each item being a custom layout with multiple Views (including a large image of ~445x250, a smaller image of ~40x40, etc). While scrolling, the animation is extremely choppy. </p> <p>Can someone recommend how I can improve performance?</p> <p>One approach I tried was to eliminate any transparency in the images being used. This did improve it slightly, though there is still a noticeable lag when before a new item scrolls into view.</p> <p>Update: Here's the View heirarchy for the custom layout (for each item) - <a href="http://pastie.org/3333903" rel="nofollow">http://pastie.org/3333903</a></p>
android
[4]
630,513
630,514
Does a Java App display the version used?
<p>Can I inspect java code and determine what runtime it will be able to run on? For instance I want to make sure all applications in our environment are using Sun SE6 and JDK 1.6.</p>
java
[1]
1,994,015
1,994,016
Excel like Data Grid Control in PHP
<p>I need an excel-like data grid control to use in PHP. The most important feature I am looking for is the capability to 'add a comment' to each cell, like it happens in excel.</p> <p>Any ideas, please share.</p> <p>Thanks.</p>
php
[2]
79,520
79,521
Setting currently reading text of a book to the centre of the web browser document
<p>I have a windows based application which reads and play book. I'm using webBrowser control for text being read. The current text is highlighted always. The highlighted text always stays on top of document. But I want it to be at the centre of the document while playing book.</p> <p>Here the highlighted text refers to the complete line or paragraph.</p> <p>The approach I'm using is:</p> <p>//for getting x and y position of currently reading text</p> <pre><code> var parent = element.OffsetParent; int xoff = element.OffsetRectangle.X; int yoff = element.OffsetRectangle.Y; while (parent != null) { xoff += parent.OffsetRectangle.X; yoff += parent.OffsetRectangle.Y; parent = parent.OffsetParent; } //for getting the height of the document var yBoff = wbDocument.Document.Body.OffsetRectangle.Height; //for getting the offset rectangle for currently reading text Rectangle rect1 = wbDocument.Document.GetElementById(contentSpineID).OffsetRectangle; </code></pre> <p>//if y position of text is greater or equal to the height of document then set the text at the centre of the document(setting the offset rectangle to the new position)</p> <pre><code> if (yoff &gt;= yBoff/2) { yoff = yBoff / 2; rect1.Offset(0, yoff); } </code></pre> <p>But this code is not functional in my app. May be it might need some additional functionality also. So could anyone please tell me some solution for this?</p>
c#
[0]
723,199
723,200
check marking all the checkbox using jquery on click of a button
<p>This is how my table structure looks,</p> <pre><code> &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td id="**SelectCheckBox**" class="helpBod"&gt; &lt;input id="TimeSheetWebUserControl1_TimeSheetRepeater_ctl01_CheckBox0" type="checkbox" name="TimeSheetWebUserControl1$TimeSheetRepeater$ctl01$CheckBox0"/&gt; &lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="**SelectCheckBox**" class="helpBod"&gt; &lt;input id="TimeSheetWebUserControl1_TimeSheetRepeater_ctl02_CheckBox1" type="checkbox" name="TimeSheetWebUserControl1$TimeSheetRepeater$ctl02$CheckBox1"/&gt; &lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I have a button SelectAll im going to call a jquery function to check mark all the checkbox</p> <p>function look this </p> <pre><code>function jqCheckAll() { $("td#" + 'SelectCheckBox' + 'input:checkbox').attr('checked', true); } </code></pre> <p>problem is this will check mark only only checkbox what if i have 100 checkbox, i want to check mark all the this 100 checkbox on click of select all button.</p>
jquery
[5]
256,478
256,479
Iphone: uitextview setting done button
<p>I use a UITextView in my application. The text editing is ok. I set the return button to Done. When I finish the editing, I like to hide the keyboard with the done button. My Question: How can I set the done button?</p> <p>Thanks, Balu.</p>
iphone
[8]
3,433,426
3,433,427
What version of Python should I use if I'm a new to Python?
<p>If I'm absolutely new to Python and am literally reading about printing statements to console, variable types, collections, etc:</p> <blockquote> <p>What version of Python should I use?</p> </blockquote> <p>I'm aware that there is an abundance of 3rd party libraries for Python 2.6.x, but I'm scared I'll learn some things that won't carry over well into Python 3.</p> <p>For example, in Python 3 you can use input(), in Python 2 you have to use raw_input().</p> <p>Thank you very much for the information.</p>
python
[7]
4,228,842
4,228,843
php send email with attachment
<p>How to send the email with resume attachment ,</p> <p>i take snippet from this place <a href="http://www.weberdev.com/get_example-4595.html" rel="nofollow">Click here</a> </p> <p>In this site, snippet works fine,</p> <p>Even i got the mail, but attachment is not working, am getting attment as noname with 0kb </p> <p>size file, What is Issue in that snippet ,</p>
php
[2]
2,801,324
2,801,325
access path denied
<p>I had applied the following code as said by you : </p> <pre><code>byte[] b = YourByteArrayFromDb; File.WriteAllBytes(MyFilePath, b); </code></pre> <p>But I am receiving an exception "Access to the path is denied". How do I solve this using ASP.Net with C# ? And is there any format to set the path as string ?</p>
asp.net
[9]
2,542,843
2,542,844
How do i get Month and Date of JavaScript in 2 digit format?
<p>when we call <code>getMonth()</code> and <code>getDate()</code> on <code>date</code> object, we will get the <code>single digit number</code>. for example :</p> <p>For <code>january</code>, it displays <code>1</code>,but need to display it as <code>01</code>. How to do that?</p>
javascript
[3]
653,719
653,720
Array is lost after passed to a function
<p>I'm getting a length of 0 for the incoming array to this method below and undefined for the array properties that's being passed in below and not sure why:</p> <pre><code>function BindAlbumDropdownList(aAlbums, defaultAlbumID) { if(aAlbums.length == 0) return; var albumDropdownID = $("#abumDropdown").attr("id"); AddDropdownItem("-Select an Album-", "-1", "albumDropdown"); for(var a in aAlbums) { alert("a.name, a.id, albumDropdown: " + a.name + "|" + a.id + "|" + albumDropdownID); AddDropdownItem(a.name, a.id, albumDropdownID); } } </code></pre> <p>I'm passing in an array that was defined earlier in another method that calls this method and the array was defined and passed like this:</p> <pre><code>var aAlbums = GetAllAlbums(userID, accessToken); var defaultAlbumID = aAlbums[0].id; BindAlbumDropdownList(aAlbums, defaultAlbumID) </code></pre> <p>GetAllAlbums is returning a variable setup like this inside it:</p> <pre><code>var aFacebookAlbums = []; // array </code></pre> <p>and returns this array once populated.</p> <p>but when I enter the for loop in the BindAlbumDropdownList, I'm getting undefined for the array properties as well as the check for length is zero</p> <p>here's what the alert is giving me:</p> <pre><code>a.name, a.id, albumDropdown: undefined|undefined|albumDropdown </code></pre> <p>I am positive GetAllAlbums is returning an array with values in it because<br> <code>var defaultAlbumID = aAlbum[0].id;</code> gives me a valid value</p> <p>I noticed that it seems like BindAlbumDropdownList doesn't really know the incoming aAlbums is an array even though I am passing an array to it. Because I'm getting no intellisense showing the property array when trying to do aAlbum.length but I do get the .length property on the array just before I return it from the GetAllAlbums function.</p>
javascript
[3]
540,987
540,988
Question regarding application approval
<p>i have two questions</p> <ol> <li><p>Apple says there should not be any button or menu item which is not yet implemented. In my application in home screen, i have put one button and background image which feels like there are other 3 inactive buttons(greyed) though those are not active ones. I did this to show steps in application. Is that ok?</p></li> <li><p>I have used core location and other server access. There are methods for example </p> <ul> <li>(void)locationError:(NSError *)error; for core location and NSURLConnections's error method. My application simply shows view which pops up when there is no connectivity(with my server)Is that ok. </li> </ul></li> </ol> <p>Thanks</p>
iphone
[8]
2,342,613
2,342,614
how to test rooted application on adt emulator?
<p>As you can understand from title, I have made an application which uses sudo command in its one method. I, now, want test this application on Android. As I understand, emulator is not rooted. Thus, I have some questions; </p> <ul> <li>In ADT, is there a way to make ADT emulator as being rooted? If yes, how?</li> <li>If no, without needing to use physical device, how can I test my application?</li> </ul> <p>Note: can you give your answer step by step ? (first do then ... )</p> <p>Thanks</p>
android
[4]
2,553,761
2,553,762
Dynamic combobox javascript
<p>I am trying to make a combobox in javascript and populate it from an array. On selection I want to change a variable, call a function etc. I have looked at multiple tutorials on-line but for such an easy task the tutorials are dire.</p> <p>Can anyone help? Cheers</p>
javascript
[3]
4,383,733
4,383,734
how i pass parameter in sql reporting service in visual studio 2008 from front end through code?
<p>how i pass parameter in sql reporting service in visual studio 2008 from front end through code?</p>
asp.net
[9]
4,137,423
4,137,424
if statement with img.src
<p>The problem: whenever, if i have the single '=' the variable will show up and be fine.. but it completely ignores the if statement. if i only do the double '=='.. the variable doesnt show up, and it goes to the else state. lemme know if u see anything wrong.</p> <pre><code>var pic1 = document.getElementById('team1pic').src; var win1 = document.getElementById('wins').innerHTML; if (pic1 == 'pens.jpg') { document.getElementById('wins').innerHTML = PittWins; } else { document.getElementById('wins').innerHTML = 'no'; } </code></pre> <p>here is some html to go along with it that i have</p> <pre><code>&lt;a class="dock-item" id="pens" href="#" onclick="document.getElementById('team1pic').src='pens.jpg'"&gt;&lt;span&gt;Pittsburgh Penguins&lt;/span&gt;&lt;img src="pens.jpg" alt="Pittsburgh Penguins" /&gt;&lt;/a&gt;` </code></pre> <p>and then </p> <pre><code>&lt;th width="35%" &gt;&lt;img src="" / id='team1pic'&gt;&lt;/th&gt; </code></pre>
javascript
[3]
4,635,070
4,635,071
How to add .dll file in asp.net?
<p>I have a project where in i have implemented the AutoSearch functionality using asp.net TextBox and AJAX AutoComplete extender. I also have some javascript written for AutoComplete extender. I want to make this file as a .dll file and use it in another projects. How should i make a .dll out of this project? Please help me to do this. Thank you.</p>
asp.net
[9]
1,150,496
1,150,497
list view problem in android
<p>Hi friends I am using custom list view .I have trying to get user clicked row value can anybody tell how to get the value?</p> <p>Thanks </p>
android
[4]
3,932,687
3,932,688
What is the code to use python to access/download text from websites?
<p>Is there a way to access/download text from websites with python? If so, what is the code to do that? If not, is there another language that would work better?</p>
python
[7]
3,162,071
3,162,072
navigation bar and button
<p>any ideas how i can click on a button and then direct me back to homepage without having the navigation bar to show the previous page? meaning it's like starting from the beginning of the home page..</p>
iphone
[8]
928,040
928,041
Calling a dll function inside a C++ program
<p>I have a created two new C++ projects. One of them is a C++ .dll project and the other is console application project.</p> <p>For the dll program, here's the simple code (<strong>.cpp file</strong>):</p> <pre><code>PIPESTOSPACES_API int npipesToSpaces=0; PIPESTOSPACES_API int fnpipesToSpaces(void) { return 42; } </code></pre> <p>I have to call these dll functions and I am doing this through exporting the function from my C++ file, and implicit linking in my C++ console application. <br/> It would be great if some could mention the steps on how to call these exported .dll function in the C++ console application. I referred <a href="http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855/DLL-Tutorial-For-Beginners.htm" rel="nofollow">this</a> page to learn exporting the function etc.</p> <p>EDIT: I am currently using Visual C++ for all this stuff on Visual Studio 2010.</p>
c++
[6]
1,097,129
1,097,130
store json response in variable
<pre><code>var response_data = jQuery.ajax({ dataType: 'json', url: '/segments/'+ id + '/edit_user.json?context=' + context, type: 'POST', success: function(data){ return data; } }); if (response_data.warn_user == 'true'){ return true }else { warn_segment_edit('This field is presently being edited by ' + response_data.user_name + ' wait until editing is complete') return false } </code></pre> <p>I'm getting This field is presently being edited by <strong>undefined</strong> wait until editing is complete</p> <p>Is there any way to do it.</p> <p>Thanks</p>
jquery
[5]