Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
39,865 | 39,866 | How can I get the index of non-sibling elements in jquery? | <p>HTML:</p>
<pre><code><ul>
<li>Help</li>
<li>me</li>
<li>Stack</li>
<li>Overflow!</li>
</ul>
<br>
<ul>
<li>Can</li>
<li>I</li>
<li>connect</li>
<li>these?</li>
</ul>
</code></pre>
<p>Javascript/JQuery:</p>
<pre><code>$("li").live('click', function(){
alert($(this).index());
});
</code></pre>
<p>I put together a simple jsfilled page to help describe my problem: <a href="http://jsfiddle.net/T4tz4/" rel="nofollow">http://jsfiddle.net/T4tz4/</a></p>
<p>Currently clicking on an LI alerts the index relative to the current UL group. I'd like to know if it was possible to get a 'global index' so that clicking on "Can" returns the index value of 4.</p>
<p>Thank you,
John</p>
| javascript jquery | [3, 5] |
2,807,421 | 2,807,422 | local variable performance in Javascript vs C# | <p>My Javascript code here. Instead of everytime trying to access document which is global context we made it to activation object. So that we can improve our read/write performance.</p>
<pre><code>function initUI(){
var doc = document,
bd = doc.body,
links = doc.getElementsByTagName("a"),
i= 0,
len = links.length;
while(i < len){
update(links[i++]);
}
doc.getElementById("go-btn").onclick = function(){
start();
};
bd.className = "active";
}
</code></pre>
<p>Whether is it applicable to C# as well?
Lets say,</p>
<p>defining <code>var customObject = new CustomClass();</code> as a member variable and accessing like below,</p>
<pre><code>void MyMethod()
{
var obj = customObject;
var name = obj.name;
//some code here
..
..
}
</code></pre>
<p>will increase the performance?</p>
| c# javascript | [0, 3] |
5,381,847 | 5,381,848 | jquery manipulate html | <p>my dynamic generated html look like below</p>
<pre><code><ul class="missingList">
<li>Please select at least one answer</li>
<li>Please select at least one answer</li>
<li>Please select at least one answer</li>
<li>Please select at least one answer</li>
<li>Please select at least one answer</li>
<li>Please select at least one answer2</li>
<li>Please select at least one answer2</li>
<li>Please select at least one answer2</li>
</ul>
</code></pre>
<p>i want to use jquery to check for all duplication filter the result so that the output become</p>
<pre><code><ul class="missingList">
<li>Please select at least one answer</li>
<li>Please select at least one answer2</li>
</ul>
</code></pre>
| javascript jquery | [3, 5] |
234,613 | 234,614 | how to refresh parent window by using Javascript in .cs | <p>How to refresh the parent window while closing the popup window(child window).</p>
<p>We are calling the java script functions in code behind to refresh the parent window by using page.ClientScript.RegisterStartupScript().But t is working fine in IE(internet explorer) but not working in Mozilla Firefox and Google Chrome.</p>
<p>In the Mozilla Firefox the pop up value is saving in the database but it is not updating into the parent page.If i did refresh manually the value is getting updating into the parent page. If i put debugger in RefreshPage()(javascript function) function in IE it is firing but not in Firefox.</p>
<p>The below code for call the javascript function in .cs class.</p>
<pre><code> page.ClientScript.RegisterStartupScript(this.GetType(), "PopupSave", "<script>javascript:alert('" + dsMessage.Tables[0].Rows[0]["ErrorMessage"].ToString() + "');window.open('','_self','');window.close();window.document.forms[0].submit();</script>");
</code></pre>
<p>The above code RefreshPage() is the javascript function to refresh the page</p>
<p>i.e.</p>
<pre><code>function RefreshPage() { window.document.forms[0].submit(); }
</code></pre>
<p>Please help me i tried with different scenarios but no output.</p>
<p>instead of RefreshPage() i used different functions</p>
<p>like reload(),</p>
<p>window.opener.forms[0].submit(),</p>
<p>likewise but still no output anyone knows please help me.</p>
| c# javascript asp.net | [0, 3, 9] |
1,088,602 | 1,088,603 | Issue with Popup | <p>I am using a window.open() in a hyperlink to open a popup in my page. I have a folder structure like </p>
<pre><code> parent
Controls
Reports
reportviewer.aspx
Search.aspx
</code></pre>
<p>form search.aspx i need to open reportviewer.aspx in a popup(javascript) .How to achive this ?How to pass the url ?</p>
| c# asp.net | [0, 9] |
431,914 | 431,915 | how to put a logo in a jquery dialog box | <p>I want to put a logo in a jquery dialog box at left side of the title window(e.g mozilla firefox logo in FF). How can it be achieved?</p>
| javascript jquery | [3, 5] |
2,609,261 | 2,609,262 | android where to create application data directories | <p>I am an iOS programmer and trying to migrate an app to Android. I need to create application directories to handle some files. iOS has reserved a folder for each app called documents directory but where is used to create directories to handle data on android? SD card, flash or root? Thank you</p>
| java android | [1, 4] |
1,978,621 | 1,978,622 | Secure HttpWebRequest so I can send credentials possible? | <p>I have the following code which connects to my php server and retrieves data from it. The only thing is, I need to send the username and password securely from this webrequest to the PHP server. Looking at the docs for the webrequest class, there is a credentials property as well as a preauthenticate property. I'm assuming these are for the network credentials (all my users are in AD).</p>
<p>Is it possible to secure this post request with credentials or is this just a bad idea? I've also found SetBasicAuthHeader - I'll read up on this and see if it might help. All traffic will be on SSL from ASPX site to the PHP site</p>
<pre><code> // variables to store parameter values
string url = "https://myphpserver.php";
// creates the post data for the POST request
string postData = "Username=" + username + "&Password=" + "&UID=" + UniqueRecID;
// create the POST request
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.ContentLength = postData.Length;
// POST the data
using (StreamWriter requestWriter2 = new StreamWriter(webRequest.GetRequestStream()))
{
requestWriter2.Write(postData);
}
// This actually does the request and gets the response back
HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse();
string responseData = string.Empty;
using (StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
{
// dumps the HTML from the response into a string variable
responseData = responseReader.ReadToEnd();
}
</code></pre>
| c# asp.net | [0, 9] |
3,438,976 | 3,438,977 | jQuery input field format into XX-XX-XX | <p>I couldn't find a plugin suitable for this.
I want to be able to format the way the user would be able to input in the field.</p>
<pre><code>XX-XX-XX
</code></pre>
<p>Where X is any digits from 0-9</p>
| javascript jquery | [3, 5] |
5,201,946 | 5,201,947 | Defined function is not found | <p>I have this function which is called in a for loop. </p>
<pre><code> function printResult(name, i) {
$('#list').append("<a href='#' onClick='goto(" + i + ");' class='item'><H1>" + name + "</H1> </a>");
}
</code></pre>
<p>The a href-tags are appended as they should, but when I call the goto function firebug says: 'goto is not defined'</p>
<p>But it is!!</p>
<p>This is the function:</p>
<pre><code>function goto(myPoint){
map.setCenter(new google.maps.LatLng(marker[myPoint-1].position.lat(), marker[myPoint-
1].position.lng()));
markerArr[myPoint-1]['infowindow'].open(map, markerArr[myPoint-1]);
}
</code></pre>
<p>I'm clueless as to why the function is not found. Does it have something to do with it being called in the appended a href-tag?</p>
| javascript jquery | [3, 5] |
3,697,985 | 3,697,986 | php and javascript cookie | <p>why php get cookie new value only when i refresh page twice.
When run page first time, php do not get cookie value.</p>
<p>Thanks</p>
<pre><code><script type="text/javascript">
var name = 'test1';
var value = '1234';
var expirydays = '1';
expiry = new Date();
expiry.setDate(expiry.getDate() + expirydays);
document.cookie = name+"="+escape(value)+";expires="+expiry.toGMTString();
</script>
<?php
print_r($_COOKIE);
?>
</code></pre>
| php javascript | [2, 3] |
3,486,248 | 3,486,249 | ASP.NET server and PHP? | <p>I wanted to know, is a server that supports ASP.NET and PHP on the same box common? wordpress/mediaWiki/phpBB3 seem like a nice combo but i am developing a ASP.NET project.</p>
| php asp.net | [2, 9] |
1,737,196 | 1,737,197 | How to detect the existence of an element in javascript? | <pre><code>var newHead = '<div id="head'+text+'"></div>';
var header = "head"+text;
if (document.getElementById(header) == undefined) {
//alert(document.getElementById("head"+text));
$("#result-job").append(newHead);
var result = '<div id="div' + dataSplit[0] + '"><input type="radio" checked="checked" class="choosenJob" name="rdb_job" value="' + dataSplit[0] + '" id="' + dataSplit[0] + '" /><label for="' + dataSplit[0] + '">' + dataSplit[1] + '</label><br /></div>';
$("div#" + header).append(result);
} else {
var result = '<div id="div' + dataSplit[0] + '"><input type="radio" checked="checked" class="choosenJob" name="rdb_job" value="' + dataSplit[0] + '" id="' + dataSplit[0] + '" /><label for="' + dataSplit[0] + '">' + dataSplit[1] + '</label><br /></div>';
$("div#" + header).append(result);
}
</code></pre>
<p>Can those script run well ?
I want add some new element(div) in the result div
but my script didnt work</p>
<p>fiddle simulation: <a href="http://jsfiddle.net/86kH4/5/" rel="nofollow">http://jsfiddle.net/86kH4/5/</a></p>
| javascript jquery | [3, 5] |
4,373,408 | 4,373,409 | How do I prevent Incoming calls from closing my program? | <p>I have an Android application in java, and I don't want my application to close whenever I recieve an Incoming Call.</p>
<p>Does anyone know of a way to prevent incoming calls from closing my application in java?</p>
| java android | [1, 4] |
5,601,235 | 5,601,236 | get current page in C# | <p>For instance if I have <a href="http://www.mywebsite.com/about.aspx" rel="nofollow">http://www.mywebsite.com/about.aspx</a>. Store about.aspx (or whatever page we're on) in a variable. Also need this to work even if there is information after the page in the url such as a query string.</p>
| c# asp.net | [0, 9] |
2,661,565 | 2,661,566 | text inside li element | <p>im printing out unordered lists dynamically..something like this</p>
<pre><code>$sql2 = mysql_query("SELECT id, todo FROM todo");
while($row = mysql_fetch_array($sql2))
{
$todo1 = $row["todo"];
$todofeed.='
<ul>
<li>' . $todo1 . '</li>
</ul>
';
}
</code></pre>
<p>I want each li element that is printed out to be a link for some jQuery effect and for that I need the text inside each li element dynamically i.e. as and when i click on it.Any way around this?</p>
| php javascript jquery | [2, 3, 5] |
2,435,676 | 2,435,677 | Access element, which contains current <script> | <p>I've got following page:</p>
<pre><code><div><script>AddSomeContent(??, 1)</script></div>
<div><script>AddSomeContent(??, 2)</script></div>
</code></pre>
<p>I need to replace the <code>??</code> with the surrounding <code><div></code> DOM object, so the function <code>AddSomeContent</code> can modify it. Is there any oportunity to do this?</p>
<p>Before any other comments: I don't have any other option. I'm already trying to hack some existing page, and only thing I can control is content of the <code><script></code>. </p>
<p>I'm using jquery, but I can change it.</p>
<p>Edit: for clarification. <code>AddSomeContent</code> looks like:</p>
<pre><code>function AddSomeContent(somediv, parameter)
{
$(somediv).append('there goes some data, that I dynamically create from some stuff depending on the parameter');
}
</code></pre>
<p>And I want to first div contain result with <code>parameter = 1</code>, second div <code>parameter=2</code></p>
| javascript jquery | [3, 5] |
4,128,425 | 4,128,426 | setInterval works online on same sytem (with 2 browsers open) but not online on separate systems | <p>I have a setinterval code updating a div. This works fine when tested in two separate browsers on the same system but when I test online on say a separate mac and PC and it stops. </p>
<p>The code is as follows:-</p>
<p>Javascript:</p>
<pre><code> function setupAjaxIntervalDiscuss(){
setInterval(function()
{
var datastring = 'refreshchat=true&projid=' + proj_id + '&uid=' + uid;
ajaxUpdateDiscussion(datastring);
}, 2000);
}
function ajaxUpdateDiscussion(ajaxdata){
$.ajax({
type: "POST",
url: "uploaddata.php",
data: ajaxdata,
success: function(data){
$("#discussresult").html(data);
refreshNav();//Updating a scrollbar styled with JS
}
});
}
</code></pre>
<p>PHP(this update correctly just here for ref) :</p>
<pre><code> if(isset($_POST["refreshchat"])){
$user_id= $_POST['uid'];
$proj_id=$_POST['projid'];
echo '<img class="closeddiscuss" src="images/closey.png" title="close" alt="close"/>';
$get_discuss_query = "SELECT * FROM discuss INNER JOIN user ON discuss.user_id=user.user_id
WHERE discuss.project_id=$proj_id ORDER BY discuss_id DESC";
$get_discuss_result=mysql_query($get_discuss_query);
while($row=mysql_fetch_assoc($get_discuss_result)){
$text = nl2br($row['discuss_text']);
$name = $row['user_name'];
$user_profileimageurl = $row['user_profileimageurl'];
echo '<div class="discussbubble"><p>'.$text.'</p><img class="smallprofileimage" src="'.$user_profileimageurl.'" alt="user profile image"/> by '.$name.'</div>';
}
}
</code></pre>
| php javascript jquery | [2, 3, 5] |
5,167,507 | 5,167,508 | How can i access server controls from my external JavaScript file? | <p>When i use this <code>"#<%= txtNumberOfDrugsInKit.ClientID %>"</code>, i can access the server control from my JQuery script; but when i put this in an external script file, it does not work.</p>
<p>How can i access an asp textbox from my external JavaScript file? I cant believe this is not working.</p>
| asp.net javascript jquery | [9, 3, 5] |
1,668,748 | 1,668,749 | class and interface | <p>I wonder 3 things.</p>
<p>1: If I have implemented an interface (with a method) in a superclass where im declaring that method, and then I extend that superclass in another class. Then I don't have to redeclare that method right?</p>
<p>2: But if I don't declare that method in the superclass but in the child class then I instantiate the superclass. What happens then? It didn't contain any method from the instance.</p>
<p>3: Could you use implement in a class and then not declaring that method? Maybe it will be used as a superclass only for other classes to extend. And then just declare that method in the child classes or do you have to declare it in the current class you are implementing the interface?</p>
| java php | [1, 2] |
3,662,203 | 3,662,204 | How can I change the href of an anchor after it has been clicked? | <p>I have a page that pulls in data via AJAX. As well as this I have a link to download said data as a CSV file.</p>
<p>The problem I have is that upon I need to pass some parameters along with the click event so that the server can return the correct CSV file.</p>
<p>Without any processing the link looks like this:</p>
<pre><code><a href="/manager/TargetResults.csv" class="black">Download Target Reports</a>
</code></pre>
<p>This then fires off an ASP.NET MVC Controller action that returns the CSV. What I want to do though is pass two parameters along in the query string. Initially I thought that I could intercept the click event and add data to the query string like so:</p>
<pre><code>var holder = $('.hidden-information').first();
var newOutlets = $('input[name="newoutlets"]', holder).val();
var queryDate = $('input[name="enddate"]', holder).val();
var anchor = $(this);
var link = anchor.attr('href');
link = link + "?endDate=" + queryDate + "&newOutlets=" + newOutlets;
anchor.attr('href', link);
</code></pre>
<p>It would seem that changing the href at this stage will not update the link in time and the URL will be as it was when it hits the server?</p>
<p>Is it possible to change a URL after it has been clicked or do I need to look at another method?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,854,726 | 3,854,727 | How to fetch data from database in jquery file | <p>I have a js file that is using an image array . in that array there is name of images that are to be used on client side page. I want that image name from database. I am using asp.net technology. Please help me out.</p>
| javascript jquery asp.net | [3, 5, 9] |
1,219,115 | 1,219,116 | Error: jQuery.imageMagnify is undefined Source File | <p>Iam getting a js error as " Error: jQuery.imageMagnify is undefined
Source File: file:///C:/Users/SS/Desktop/doing/jquery.magnifier.js
Line: 85"</p>
<p>Please help me to solve it.</p>
| javascript jquery | [3, 5] |
1,831,283 | 1,831,284 | get text area and text field data - jquery | <p>I have 2 text areas in my page as;</p>
<pre><code><input type="text" id="a1"/>
<textarea id="b2"></textarea>
<a id="button">button</a>
</code></pre>
<p>When user click the button link, I want to <code>alert</code> the data entered in <code>a1</code> and <code>b2</code>.</p>
<p>How can I do this?? Here is there <strong><a href="http://jsfiddle.net/k9kYR/" rel="nofollow">demo</a></strong></p>
<p>Thanks in advance...<code>:)</code></p>
<p>blasteralfred</p>
| javascript jquery | [3, 5] |
3,712,972 | 3,712,973 | How to display a message on the first press of a button? | <p>I need to display the message with first time the button is pressed only. If I press the button again, it will redirect me. How to do in javascript? </p>
<p>I have submit button, first time press button it will show the message. Pressing the same button the next time should NEVER SHOW the message, it should forward to the next page.</p>
<p>Please show me how to do this in javascript?</p>
| javascript jquery | [3, 5] |
176,241 | 176,242 | jQuery.inArray not behaving as expected | <p>I'm trying to loop through a list of numbers and check if that number is part of another list of numbers using jQuery.each and jQuery.inArray. jQuery.inArray does not seem to be behaving as expected.</p>
<p>Here is my code:</p>
<pre><code>var some_numbers = [1, 2];
var more_numbers = [0, 1, 2];
$.each(more_numbers, function(index, value) {
if($.inArray(value, some_numbers)) {
console.log(value);
}
});
console.log('Some Numbers:');
console.log(some_numbers);
</code></pre>
<p>Here is the resulting console output:</p>
<pre><code>0
2
Some Numbers:
[1, 2]
</code></pre>
<p>Will someone please help? This is maddening.</p>
<p><strong>Edit:</strong> Problem solved! Changed my condition to this:</p>
<pre><code>if($.inArray(value, some_numbers) !== -1)
</code></pre>
<p>Thanks everyone!</p>
| javascript jquery | [3, 5] |
476,746 | 476,747 | Gridview export to excel not working in google chrome | <pre><code>private void ExportGrid(GridView grdReport)
{
if (grdReport.Rows.Count > 0)
{
grdReport.HeaderStyle.BackColor = Color.Gray;
grdReport.HeaderStyle.ForeColor = Color.White;
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.Buffer = true;
var stringWrite = new StringWriter();
var htmlWrite = new HtmlTextWriter(stringWrite);
Response.AddHeader("content-disposition", "attachment;filename=");
Response.Charset = string.Empty;
Response.ContentType = "application/vnd.ms-excel";
grdReport.RenderControl(htmlWrite);
Response.Write(style);
Response.Write(stringWrite.ToString());
Response.Flush();
Response.End();
}
</code></pre>
<p>Above is the code which i'm using to export gridview to excel. it is working fine in IE and firefox but not in Google Chrome. In Chrome an aspx page gets downloaded. Is any a need of change in code? please let me know.</p>
| c# asp.net | [0, 9] |
2,682,822 | 2,682,823 | Select input appened to page | <p>I have an input field that is appended to a div tag through a location.href reload. How would select that input field using jQuery? If I add it to the page it won't work, I'm assuming because the input isn't loaded into the DOM yet. </p>
<pre><code>$('#fileName1').focus(function() {
alert('Handler for .focus() called.');
});
</code></pre>
| javascript jquery | [3, 5] |
2,793,444 | 2,793,445 | How can I validate that several textboxes contain data when I click submit? | <p>I have 10 defined textboxes with strings.</p>
<p>I have to check all if they are not empty while clicking ok button</p>
<p>whats the cleanest way to check them all and when function is at end. each checkbox which was empty to give this a specific CSSclass. perhaps. ClassError. ( which highlights red) </p>
<p>I'm happy for answers.</p>
| c# asp.net | [0, 9] |
1,328,597 | 1,328,598 | why does location.reload() break my $.post? | <p>I have a select element, that posts (just fine) when changed using $.post. But if I want to reload the page, and add a <code>location.reload()</code> then it doesn't post. If I remove the line, it posts fine. Any ideas?</p>
<pre><code> <script type="text/javascript">
$('#target').change(function() {
$.post('<?=$base_url?>orders/create-new/order-items/<?=$order_id?>/target',
{
use_sort_modifier: $('select#target').val(),
order_id: <?=$order_id?>
}
);
location.reload(); // Works without this line.
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
6,020,673 | 6,020,674 | prevent click event from element but not from <a> children | <p>my code looks like this:</p>
<pre><code><div class="disabledClickevent">
<ul>
<li><a>link1</a></li>
<li><a>link2</a></li>
</ul>
</div>
</code></pre>
<p>the div has a click event that gets disabled with <code>return false;</code>
my problem is that this also disables the <code><a></code> links</p>
| javascript jquery | [3, 5] |
4,716,929 | 4,716,930 | Javascript / jQuery: How do I remove a range of numbered classes? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/57812/remove-all-classes-that-begin-with-a-certain-string">Remove all classes that begin with a certain string</a> </p>
</blockquote>
<p>I have a script which adds one of six classes randomly to the body. The classes are numbered between 1 and 6, like this:</p>
<p><code>theme-1</code> to <code>theme-6</code>.</p>
<p>I need a clean way to remove all of them. Right now I have this:</p>
<pre><code>$('body').removeClass('theme-1');
$('body').removeClass('theme-2');
$('body').removeClass('theme-3');
$('body').removeClass('theme-4');
$('body').removeClass('theme-5');
$('body').removeClass('theme-6');
</code></pre>
<p>But it's kind of clunky right? Is there a way I can say "remove any classes between <code>theme-1</code> to <code>theme-6</code>"?</p>
| javascript jquery | [3, 5] |
1,066,259 | 1,066,260 | javascript onclick event binding | <p>I have my script here,</p>
<pre><code> <script type='javascript'>
$(LastRow).find('#delete').attr('onclick','Comment_Delete(event,'+cID+')')
</script>
<input type="image" id="delete" border="0" src="../Resource/images/commentcross.jpg";" style="border-width:0px;">
</code></pre>
<p>i want control to be rendered as,</p>
<pre><code><input type="image" id="delete" border="0" onclick="Comment_Delete(event,1048);" src="../Resource/images/commentcross.jpg";" style="border-width:0px;">
</code></pre>
<p>i.e. i want to bind <code>onclick</code> event to my <code>id=delete</code> tag.i have used my live as,</p>
<pre><code>$(LastRow).find('#delete').live('click','Comment_Delete(event,'+cID+')')
</code></pre>
<p>but gettintg error in chrome as <code>TypeError: Cannot call method 'replace' of undefined</code></p>
| javascript jquery | [3, 5] |
2,020,129 | 2,020,130 | function for each element | <p>Ive got a function:</p>
<pre><code>setInterval ( doSomething, 100 );
function doSomething ( )
{
$("#i_msl").animate({ top: "-150px",}, 1000 ).delay(1000);
$("#i_msl").animate({ top: "-300px",}, 1000 ).delay(1000);
$("#i_msl").animate({ top: "0px",}, 1000 ).delay(1000);
}
</code></pre>
<p>but it works only for one element. How can I make it work for all elements with #i_msl on page?</p>
| javascript jquery | [3, 5] |
832,690 | 832,691 | R.Java not showing up | <p>I've tried everything i can think of and i still can't get the R.java file to show up.
It's supposed to be in the "gen" folder in eclipse when i create a new project i believe.</p>
<p>I tried the following:</p>
<ol>
<li><p>I went to Project > Clean... </p></li>
<li><p>I heard that there might be issues in the xml files, i couldn't find any errors there.</p></li>
<li><p>I tried using both android 2.1 and 2.2(my goal is to program in 2.2 but i tried both anyway).</p></li>
</ol>
<p>Please help. I've seen a few other questions regarding the same issue on here; i've tried using the suggestions found in the answers to those questions but unfortunately, no luck.</p>
<p>Progress: 1</p>
<p><strong>SOLVED:</strong> I found out i was missing Android SDK Platform Tools. If you're having the same problem, make sure you have it installed. </p>
<p><strong>Go to Window > Android Sdk and Avd Manager > Available Packages > Android Repository > Android SDK Platform Tools(the latest version) > Install.</strong> Sorry for causing any confusions. I will one-up those who put some effort into helping me. Thank you very much for your efforts. :)</p>
| java android | [1, 4] |
50,390 | 50,391 | drag and drop listview in android | <p>Im using CursorAdapter in my Listview for direct mapping of data to the database. my problem is when im creating a drag and drop listview. How to drag and drop items in Listview for reordering in android? </p>
| java android | [1, 4] |
591,426 | 591,427 | jquery equivalent of javascript onclick(this.form) | <p>I currently have something like this:</p>
<pre><code><form action="cart.php?action=update" method="post" name="cart" id="cart">
<input maxlength="3" value="25" onKeyup="chk_me(this.form)" />
etc..
</form>
</code></pre>
<p>The onKeyup event executes/calls the chk_me function with this.form as its parameter.</p>
<p>I need to convert that to a jQuery equivalent to something like this:</p>
<pre><code>$(document).ready(function(){
$('input').keyup(function(){
chk_me(this.form);
}):
});
</code></pre>
<p>This example doesn't work ofcourse. But how can I make it work?</p>
<p>Maybe in other words: How can I get this.form (exactly the same) in jQuery (or perhaps between script tags)?</p>
| javascript jquery | [3, 5] |
2,935,612 | 2,935,613 | Is Dialog.show() a non-blocking method? | <p>I've got a button that kicks off a background thread to do some work and I am trying to use a ProgressDialog to prevent the user from double clicking that button (or any other ui elements) while that work is being done. The first thing I do in my buttons onClick code is to display the progress dialog, which takes over the screen. The problem I am seeing is that if I rapidly tap this button, sometimes two or more presses will register before the ProgressDialog is shown. This leads me to assume that ProgressDialog.show() is returning before the ProgressDialog is actually visible.</p>
<p>Can anybody confirm this? Also, is there a way to change this behavior, or at least get a notification of when the dialog is actually visible? I saw Dialog.onStart() but given the javadoc, this appears to be called before the Dialog is actually visible...</p>
<p>UPDATE:
While it appears that there is no good way of solving this problem in general, the following works for my situation where my work is done by an external thread and the amount of work to do takes longer than the time it takes for all the button clicks to be processed:</p>
<pre><code>void myOnClickHandler() {
if(myButton.isEnabled()) {
myButton.setEnabled(False);
// do work here
// setEnabled(true) is invoked at the end of my spawned thread's run().
}
}
</code></pre>
| java android | [1, 4] |
818,575 | 818,576 | asp.net url generation with name and id | <pre><code>test.Controls.Add(GetButton(thisReader["session_id"].ToString(), "Join Session"));
</code></pre>
<p>I have changed the above code to the one below to</p>
<pre><code>test.Controls.Add(GetButton(thisReader["session_name"].ToString(), "Join Session"));
</code></pre>
<p>I did this because i wanted to have my end of URL <code>session= session_name</code> instade of the <code>session_id</code> . doing this now created a problem because the since session_id was not passed i the results on the next page based on session_id are not displayed.Please refer the original question <a href="http://stackoverflow.com/questions/10046586/asp-net-url-generation">asp.net url generation</a></p>
<pre><code>Response.Redirect("EnterSession.aspx?session=" + e.CommandArgument.ToString());
</code></pre>
<p>how can solve this problem ?</p>
<p>c# part of entersession.aspx</p>
<pre><code>public partial class _EnterSession2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SessionID.Value = Request.QueryString["session"];
// Label2.Text = DateTime.Now.ToString();
if (User.Identity.IsAuthenticated)
{
string userName = User.Identity.Name;
//Username.Value = User.Identity.Name;
Username.Value = userName.ToLower();
HiddenField1.Value = User.Identity.Name;
}
}
</code></pre>
| javascript asp.net | [3, 9] |
3,143,981 | 3,143,982 | Android - Internet Activity doesn't cease after app closes | <p>QA Keeps reporting a bug where after closing the app internet activity is still going. We stream video. They say after the app closes, the streaming doesn't stop because the network activity icon on the top status bar remains on for a minute after the app closes. I have checked all my streams and logs and there is no indication of network activity. Also, when my app closes we call</p>
<pre><code>int pid = android.os.Process.myPid();
android.os.Process.killProcess(pid);
</code></pre>
<p>Also for each activity in the manifest I have set android:finishOnTaskLaunch="true" and for the main activity android:launchMode="singleTask"</p>
<p>With this code, is it even possible that the app could have network activity even after it is closed and killed?</p>
<p>If not, why is the network activity icon going when the app closes and how do I get rid of it?</p>
| java android | [1, 4] |
2,825,635 | 2,825,636 | Senior WinForms developer with no ASP experience - legitimate chance at a Senior ASP.NET position? | <p>I would like to know from those in hiring roles and in senior ASP.NET roles, would you seriously consider a person like myself for a senior ASP.NET role?</p>
<p>A bit about myself: I am seriously considering a switch from WinForms to ASP.NET. There just do not seem to be many positions for desktop application developers anymore. It's becoming a niche field. In the pursuit of greater opportunities, I am trying to repackage myself as an ASP.NET developer. Unfortunately, there is the obvious lack of professional experience that is a gap on the resume. Seriously, the only real issue with losing my senior status is the paycut involved. I couldn't care less about the title, but sadly, we all have bills.</p>
<p>I could argue that there is a lot more to software development that knowing the intricacies of web development vs desktop-- there are issues of designing reusable code, design patterns, C# language features, database experience (another place where my experience is light), class design, professional maturity, and so on.. But I fear that these arguments will fall on deaf ears, especially in these times, when there are already so many experienced ASP.NET developers already out of work. I can sling together a few simple web pages that hit a database and show the data, but this is far from a professional web site, I'm afraid.</p>
| c# asp.net | [0, 9] |
862,922 | 862,923 | Duplicating filename issue | <p>I have a web page in which different user account can be created and the files created for individual user will be diaplayed in the gridview. That is, The files created by abc will be displayed in gridview when abc logs in. Whenever a user creates a file, these files are stored in a folder so that whenever the user clicks on the filename in the gridview the control goes to this folder to open it. So now my question is how can I manage the duplication of the filename. that is, If the user abc creates a filename "Lion", this will be stored in the folder and also in the database and will be displayed to abc when he/she logs in. Now another user say xyz wants to create the the same filename "Lion" which is going to store in the same folder, then that file created by abc will be replaced by the one created by xyz. How can I avoid this?</p>
| c# asp.net | [0, 9] |
2,740,671 | 2,740,672 | How does jQuery use namespace to avoid conflict with other 3rd JavaScript library? | <p>I have gone through the jQuery Source Code, but I cannot find how jQuery implement the namespace functionality?</p>
| javascript jquery | [3, 5] |
4,688,341 | 4,688,342 | How important is it to learn jQuery with ASP.NET | <p>I'm reading a chapter on jQuery in a ASP.NET book. To be honest I'm finding it quite boring.</p>
<p>How important is it to learn jQuery? And do many ASP.NET developers use it for their pages?</p>
<p>Regards
TDG</p>
| asp.net jquery | [9, 5] |
5,644,929 | 5,644,930 | Don't call second click event after first has returned false | <p>I'm having an issue with a pop-up menu. I basically have 2 click events, one is for opening a menu, which returns <code>false</code> if a particular button is clicked and the other click event is on the <code>document</code> and meant to close the menu if someone clicks anywhere on the page but the menu.</p>
<p>In below example, I'm not expecting to see <code>click on document</code> in the console, but I do. What am I doing wrong?</p>
<pre><code>$('#content .addOptions').live("click",function(){
console.log("click on addoptions")
return false;
});
$(document).click(function () {
console.log("click on document")
});
</code></pre>
| javascript jquery | [3, 5] |
4,980,780 | 4,980,781 | Android Drag / Animation | <p>I want to make a page where you can drag an image (and play a little animation)</p>
<p>so i'm doing something (and i think it's not ideal - so i need your help):</p>
<p>my code:</p>
<pre><code>ButtonIMG = BitmapFactory.decodeResource(getResources(), R.drawable.ButtonIMG );
Canvas c = null;
while (true) {
if (!holder.getSurface().isValid()) {
continue;
}
if (gifCounter<10){
animataion = BitmapFactory.decodeResource(getResources(), R.drawable.animataion1);
gifCounter++;
}
if (gifCounter<20 && gifCounter>=10){
animataion = BitmapFactory.decodeResource(getResources(), R.drawable.animataion2);
gifCounter++;
}
if (gifCounter<30 && gifCounter>=20){
animataion = BitmapFactory.decodeResource(getResources(), R.drawable.animataion3);
gifCounter++;
}
if (gifCounter>=30){
gifCounter=0;
}
c = holder.lockCanvas();
c.drawARGB(255, 220, 220, 220);
c.drawBitmap(ButtonIMG, x, y, null);
c.drawBitmap(animataion, 100, 100, null);
}
</code></pre>
<p>.
.
.</p>
<pre><code>public boolean onTouch(View v, MotionEvent me){
switch (me.getAction()) {
case MotionEvent.ACTION_DOWN:
x = me.getX();
y = me.getY();
break;
}
}
</code></pre>
| java android | [1, 4] |
5,157,865 | 5,157,866 | ASP.NET document.getElementById('<%=Control.ClientID%>'); returns null | <p>I'm trying to retrieve a server control in JavaScript. For testing purposes I am calling the JavaScript function from the page load event.</p>
<pre><code>protected void Page_Load(object sender, EventArgs e){
ClientScript.RegisterClientScriptBlock(GetType(), "js", "confirmCallBack();", true);
}
</code></pre>
<p>And my JavaScript function is </p>
<pre><code>function confirmCallBack() {
var a = document.getElementById('<%= Page.Master.FindControl("PlaceHolderContent").FindControl("Button1").ClientID %>');
var b = document.getElementById('<%=Button1.ClientID%>');
}
</code></pre>
<p>my problem is that both a and b return null. Even when I view the page source the correct ClientID is returned.</p>
<p>I should add that I'm using master page.</p>
<p>Any ideas.</p>
| javascript asp.net | [3, 9] |
3,641,206 | 3,641,207 | jQuery - Dynamically Create Button and Attach Event Handler | <p>I would like to dynamically add a button control to a table using jQuery and attach a click event handler. I tried the following, without success:</p>
<pre><code>$("#myButton").click(function () {
var test = $('<button>Test</button>').click(function () {
alert('hi');
});
$("#nodeAttributeHeader").attr('style', 'display: table-row;');
$("#addNodeTable tr:last").before('<tr><td>' + test.html() + '</td></tr>');
});</code></pre>
<p>The above code successfully adds a new row, but it doesn't handle adding the button correctly. How would I accomplish this using jQuery?</p>
| javascript jquery | [3, 5] |
6,018,024 | 6,018,025 | What does this for loop do? | <pre><code>for (var i = RegData.length - 1; i >= 0; i--){
var row = Titanium.UI.createTableViewRow();
var title = Titanium.UI.createLabel({
text:RegData[i].title,
font:{fontSize:14,fontWeight:'bold'},
width:'auto',
top:2,
textAlign:'left',
left:2,
height:16
});
</code></pre>
<p>I want the explanation of this line... and is there any alternate ways of writing this.</p>
<p><strong>for (var i = RegData.length - 1; i >= 0; i--){</strong></p>
| javascript android | [3, 4] |
4,104,263 | 4,104,264 | Setting up a website to sync data with android phone | <p>I am writing an android application that requires a large amount of bandwith to collect data and then process this data. doing this induvidually on each phone would be quite a waste.(I have the code already and it works as a standalone java application). So i decided to upload this data onto a website and let the users sync their phone with the website. But i have no clue as to how to go about this. (I already have a website which is hosted on my home computer). Would anyone know how to go about this. are there any tutorials for doing this?( Since i already have my code in a standalone java application is it possible to put up this application on my server in java only since i am relatively new to php and wouldnt know the required code to accomplish this task.)</p>
| java android | [1, 4] |
1,376,419 | 1,376,420 | Reading files inside a APK | <p>I am having an android application that is using an external jar that
has in addition to regular classes an html file.</p>
<p>Meaning my final apk root directory looks something like this </p>
<ul>
<li>assests </li>
<li>res</li>
<li>AndroidManifest.xml</li>
<li>classes.dex</li>
<li>resources.arsc</li>
<li>helloworld.html</li>
</ul>
<p>How can I access from my application to the last file
"helloworld.html"?</p>
| java android | [1, 4] |
2,774,594 | 2,774,595 | how to send multiple check box item lists to class | <p>I wanted to send all the selected checkbox items to the class how do i send it.if i use <code>check1.selectedvalue/item</code> it sends only one.so how do i do this</p>
<pre><code>protected void check1_SelectedIndexChanged(object sender, EventArgs e)
{
for (int z = 0; z < check1.Items.Count; z++)
{
if (check1.Items[z].Selected)
{
string checking = "\u2022" + check1.Items[z].Text ;
}
}
Mail emailsystem = new Mail();
emailsystem.GetEmail(comment.Text, StatusList.SelectedValue, check1.SelectedValue);
}
</code></pre>
| c# asp.net | [0, 9] |
5,547,616 | 5,547,617 | Error calling getResources().openRawResource() | <p>I have to read a file called <code>hello.txt</code> using the following code on java/eclipse/android:</p>
<pre><code>import java.io.InputStream;
public class Tokenirzer {
public String ReadPath () {
InputStream inputStream = getResources().openRawResource(R.raw.hello);
}
}
</code></pre>
<p>However I get the following error:</p>
<blockquote>
<p>The method getResources() is undefined for the type Tokenirzer</p>
</blockquote>
<p>What am I doing wrong?</p>
| java android | [1, 4] |
3,025,885 | 3,025,886 | A working example of how to use cookie.js | <p>I was wondering if you could help/show me how to use cookie.js for my example I have been stressing trying to figure this out. I must saty in advance that I am new to programming full stop so I I humble and would love a plain example of how to use cookie.js</p>
<p>I wish to maintain the same state on my sub menu div after page refresh. I have constructed a jsFiddle to show how the navigation works without a cookie. </p>
<p><a href="http://jsfiddle.net/replacement4/nKFt7/60/" rel="nofollow">http://jsfiddle.net/replacement4/nKFt7/60/</a></p>
<p>This is my attempt using cookies. </p>
<p><a href="http://jsfiddle.net/replacement4/nvf3V/3/" rel="nofollow">http://jsfiddle.net/replacement4/nvf3V/3/</a></p>
<p>I hope it is something simple and I've just miss understood... </p>
| javascript jquery | [3, 5] |
2,537,367 | 2,537,368 | Getting error: "Control Collection Can Not Be Modified" | <p>Hi i am initially using this code but now when i am debuging this code i am getting error ..</p>
<p>"The Controls collection cannot be modified because the control contains code blocks "</p>
<p>my code is:</p>
<pre><code>for (int m = 0; m < dtGroupedByDate.Rows.Count; m++)
{
Label Date = new Label();
Date.Text = dtGrpBySmDate.Rows[m][0].ToString();
Date.Style["margin-left"] = (m > 0) ? "20px" : "0px";
this.Controls.Add(Date);
Label PowerSum = new Label();
PowerSum.Text = dtGroupedByDate.Rows[m][1].ToString();
PowerSum.Style["margin-left"] = "20px";
this.Controls.Add(PowerSum);
}
</code></pre>
<p>Please help me why i am getting this error..</p>
| c# asp.net | [0, 9] |
1,731,638 | 1,731,639 | android screens | <p>I want to create an application under ANDROID, but there are many different views. How many screen resolutions for ANDROID devices?</p>
<p>example code:</p>
<pre><code>class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
</code></pre>
| java android | [1, 4] |
2,114,790 | 2,114,791 | Troubles with creating jQuery animation sequence | <p>I am trying to execute an animation sequence on progress bars:</p>
<pre><code>function animateProgress() {
var params = [{from: 50, to: 100}, {from: 0, to: 100}, {from: 0, to: 50}];
animateProgressStep(params, 0);
}
function animateProgressStep(params, i) {
$(".progress").width(params[i].from).animate({width: params[i].to}, {
duration: 2000,
complete: function() {
if(i + 1 < params.length) {
animateProgressStep(params, i + 1);
}
}
});
}
</code></pre>
<p>This works if there is a single bar on the page, but if there are many, it breaks on the second iteration because <code>complete</code> callback is called as many times as there are progress bar elements on the page. </p>
<p>What would be a solution? </p>
<p>Can play with it here: <a href="http://jsfiddle.net/TythE/1/" rel="nofollow">http://jsfiddle.net/TythE/1/</a></p>
| javascript jquery | [3, 5] |
3,594,761 | 3,594,762 | syntax highlighter | <p>hello i'm looking a dynamic syntax highlighter for PHP.</p>
<p>I'm not looking a highlighter to highlight a code snippet. looking a dynamic highlighter that highlights the code as i type.</p>
<p>**</p>
<p>I need this feature for online editor. (actually for the text-area element in a posting form.)</p>
<p>**</p>
<p>example: <a href="http://jsfiddle.net" rel="nofollow">http://jsfiddle.net</a></p>
| javascript jquery | [3, 5] |
47,622 | 47,623 | Convert php array_sum to java | <pre><code>$a = array(2, 4, 6, 8);
echo "sum(a) = " . array_sum($a) . "\n"; //==20
</code></pre>
<p>how i can do this in java?</p>
| java php | [1, 2] |
2,638,785 | 2,638,786 | PageRedirect to previous Page? | <p>I have a page(A) that has a popup. When the link in the popup is clicked, it takes you to page B. Page B has a Submit and cancel button. Cancel button should get me back to Page A. How is it possible with javascript or Asp.net?? </p>
<p>Thank you in advance!!</p>
| c# javascript asp.net | [0, 3, 9] |
635,134 | 635,135 | How can I test whether input has focus in an if structure? | <p>I've got this code here now, but the alerts still come up after you click on the input, when it doesn't have focus. I would like to get rid of the click function too, if possible, so that it only alerts when the input has focus.</p>
<pre><code>$('#inputSize').click(function(){
if ($('#inputSize').is(':focus')){
$(document).keydown(function(e){
if (e.keyCode == 38) {
alert( "up pressed" );
return false;
}
if (e.keyCode == 40) {
alert( "down pressed" );
return false;
}
});
}
});
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
1,918,738 | 1,918,739 | dropdwnlist autopostback not working | <p>dropdwnlist autopostback not working
my code as follows:</p>
<pre><code><asp:DropDownList ID="ddlState" runat="server" Width="200px" AutoPostBack="true" onselectedindexchanged="ddlState_SelectedIndexChanged" >
<%-- <asp:ListItem Selected="True">--Select--</asp:ListItem>--%>
</asp:DropDownList>
</code></pre>
<p>Codebehind is:</p>
<pre><code>protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)
{
ddlDistrict.Enabled = true;
ddlTaluka.Enabled = true;
DataTable dtObj = new DataTable();
using (var client = ServiceClient<IPallaviAddressManager>.Create("PallaviAddressManager"))
{
dtObj = client.Instance.GetAllStates();
}
var result = (from dt in dtObj.AsEnumerable()
where dt.Field<Int64>("StateID") == Convert.ToInt64(ddlState.SelectedValue)
select dt);
dtObj = result.CopyToDataTable();
ddlDistrict.DataSource = dtObj;
ddlState.DataTextField = "Description";
ddlState.DataValueField = "DistrictID";
}
</code></pre>
<p>Can you help?</p>
| c# asp.net | [0, 9] |
1,789,273 | 1,789,274 | How can I assign an HTML5 data value to an element? | <p>I have the following code:</p>
<pre><code> $.modal({
title: title,
closeButton: true,
content: content,
complete: function () {
applyTemplateSetup();
$('#main-form').updateTabs();
$('#main-form').data('action',action);
// updated to line below but still does not work
$('#main-form').data('action','Edit');
},
width: 900,
resizeOnLoad: true,
buttons: {
'Submit': function (win) {
formSubmitHandler($('#main-form'));
},
}
</code></pre>
<p>Once my data is loaded I am trying to set the data attribute action. I then have more code that reads it in the submit handler:</p>
<pre><code>var formSubmitHandler = function (form) {
//e.preventDefault();
var $form = form;
var val = $form.valid();
if (!$form.valid || $form.valid()) {
var submitBt = $(this).find('button[type=submit]');
submitBt.disableBt();
var sendTimer = new Date().getTime();
$.ajax({
url: $form.attr('action'),
dataType: 'json',
type: 'POST',
data: $form.serializeArray(),
success: function (json, textStatus, XMLHttpRequest) {
json = json || {};
if (json.success) {
if ($form.data('action') == "Edit") {
$('#modal').removeBlockMessages()
submitBt.enableBt();
} else {
</code></pre>
<p>However it seems the value is not being set correctly as when I step through the code this is not getting a true value: <code>$form.data('action') == "Edit".</code> Am I doing something wrong?</p>
| javascript jquery | [3, 5] |
2,866,128 | 2,866,129 | c# convert `List<string>` to comma-separated string | <p>Is there a fast way to convert <code>List<string></code> to a comma-separated <code>string</code> in C#?</p>
<p>I do it like this but Maybe there is a faster or more efficient way?</p>
<pre><code>List<string> ls = new List<string>();
ls.Add("one");
ls.Add("two");
string type = string.Join(",", ls.ToArray());
</code></pre>
<p>Thanks</p>
<p>PS: Searched on this site but most solutions are for Java or Python</p>
| c# asp.net | [0, 9] |
2,093,254 | 2,093,255 | for each function jquery | <p>i have a toggle function which i have working fine, only i cant get it to work for each element on the page.</p>
<p>my current function is</p>
<pre><code>$(".tog").click(function() {
$("#shortinfo").toggle();
$('#shortinfo').toggleClass('open');
return false;
})
</code></pre>
<p>ive tried</p>
<pre><code>$(".tog").each.click(function() {
$("#shortinfo").toggle();
$('#shortinfo').toggleClass('open');
return false;
})
</code></pre>
<p>and </p>
<pre><code>$(".tog").each (click(function() {
$("#shortinfo").toggle();
$('#shortinfo').toggleClass('open');
return false;
</code></pre>
<hr>
<p>I have an accordion similar too</p>
<pre><code><h1>title </h1>
<div class="shortcontent">asdasdasd</div>
<div class="longcopy">long stuff here</div>
<h1>title </h1>
<div class="shortcontent">asdasdasd</div>
<div class="longcopy">long stuff here</div>
<h1>title </h1>
<div class="shortcontent">asdasdasd</div>
<div class="longcopy">long stuff here</div>
<h1>title </h1>
<div class="shortcontent">asdasdasd</div>
<div class="longcopy">long stuff here</div>
</code></pre>
<p>the idea is when its clicked 'shortcontent' dissapears. at the moment that is only happening on the first section</p>
| javascript jquery | [3, 5] |
1,218,056 | 1,218,057 | how to attach/extend methods to dom element | <p>Having this html:</p>
<pre><code><div id='hi1'> aaa </div>
</code></pre>
<p>When doing:</p>
<pre><code>$('#hi1').sayHi();
</code></pre>
<p>I would like to get an alert saying 'hi'</p>
<p>anybody knows how this is done ?</p>
| javascript jquery | [3, 5] |
1,660,626 | 1,660,627 | how to show thumbnail of friends by using usercontrol in asp.net. | <p>i am working on my project and am not able to show thumbnail in 3*3 order.I have used one User control (image,URL).so its will look just like friends in my list and when i will click on any one friend the profile of that particular friend should be displayed. </p>
| c# asp.net | [0, 9] |
2,908,368 | 2,908,369 | Please tell me how to get zclip work | <p>can anyone provide me a example of a jQuery Zclip. <a href="http://www.steamdev.com/zclip/" rel="nofollow">http://www.steamdev.com/zclip/</a></p>
<p>I tried the demo they have given. but seems i cant get it to work. Thanks.</p>
| php javascript jquery | [2, 3, 5] |
5,166,774 | 5,166,775 | How to handle StreamReader? | <p>I use StreamReader to read my csv file.
The problem is : i need to read this file twice, and in second time then i use StreamReader
StreamReader.EndOfStream is true and reading not executed.</p>
<pre><code>using (var csvReader = new StreamReader(file.InputStream))
{
string inputLine = "";
var values = new List<string>();
while ((inputLine = csvReader.ReadLine()) != null)...
</code></pre>
<p>Can enybody help</p>
| c# asp.net | [0, 9] |
1,714,335 | 1,714,336 | Problem making request to server with Jquery | <p>I have a problem making a request to a server
My simple code is:</p>
<pre><code><html>
<head>
<script type="text/javascript" src="/Users/t/Desktop/App/etc.../jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/Users/t/Desktop/App/etc.../json_parse.js"></script>
<script type="text/javascript">
$.getJSON("http://127.0.0.1:8000/search/",{long:"29"},
function(data){
alert("data is"+ data.place[0].pk);
});
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>
</code></pre>
<p>I can not get a "GET /search/?long=29 HTTP/1.1" .
I always get a "OPTIONS /search/?long=30 HTTP/1.1"
Also when i check it with Firebug it says 0 requests.
Why is that?</p>
| javascript jquery | [3, 5] |
3,224,851 | 3,224,852 | Detaching/Opening an iFrame into a New Window - How? | <p>I have an iframe setup within a page and basically want to know whether it's possible to have a button in this iframe and when pressed, opens the iframe into a new browser window, showing the contents of the iframe.</p>
<p>If possible, would really appreciate any help using either javascript or jQuery on how to achieve this.</p>
<p>I am using IE6.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
2,642,674 | 2,642,675 | jquery and/or javascript simplest issue (but can't figure it out) | <p>The following line works i.e. radioClicks function gets called.</p>
<pre><code>$("input:[name='"+54464+"']").bind( "click", radioClicks );
</code></pre>
<p>but this one doesn't:</p>
<pre><code>$("input:[name='"+options.rowId+"']").bind( "click", radioClicks );
</code></pre>
<p>and yes, you have guessed it, options.rowId = 54464 (at least in the debugger) .</p>
<p>What am I missing ???</p>
<p>Thanks</p>
<p>EDIT:</p>
<p>I removed the : as some suggested, I used alert(options.rowId) and it shows 54464 as expected. Also, it is not used in a loop. The code is:</p>
<pre><code>function radioFormatter (cellvalue, options, rowObject)
{
$("input[name='"+options.rowId+"']").bind( "click", radioClicks );
if("checked" == cellvalue)
return "<input type='radio' name='"+ name +"' id='"
+ options.colModel.name + "' value='" + options.rowId
+ "' checked>";
return "<input type='radio' name='" + name + "' id='" +options.colModel.name
+"' value='" + options.rowId + "'>";
}
</code></pre>
<p>It is used with jqgrid where I have a row with multiple columns with a radio button in it.</p>
<p>I have tried everything I can think of with no success...</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
1,356,207 | 1,356,208 | "too much recursion" error with live handlers in jQuery 1.3.2 | <p>This question is similar to <a href="http://stackoverflow.com/questions/639862/too-much-recursion-error-in-jquery-1-3-2">my last question about "too much recursion" errors in jQuery</a>, but involving live handlers. I have one element within another. Both of them have custom event handlers with the same name. The outer element has a traditional handler and the inner element has a live handler. When I try to trigger the event on the outer element, my browser pauses for a while, then I get an error saying "too much recursion".</p>
<p>I read on the <a href="http://docs.jquery.com/Events/live" rel="nofollow">live handler documentation page</a> that I can prevent bubbling of a live handler by returning false within the handler function. However, I tried this and it doesn't seem to make a difference. Either way, the outer function seems to somehow be called many times when I am trying to call it only once.</p>
<p>How can I fix this? Is it possible to have handlers with the same name like this, or do I have to come up with different names? You can test the problem using this code:</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>live event handler test</title>
</head>
<body>
<div id="outer">
<div id="inner">
</div>
</div>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$("#outer").bind("test", function() {
$("#inner").trigger("test");
});
$("#inner").live("test", function() {
return false;
});
$(function() {
$("#outer").trigger("test");
});
</script>
</body></html>
</code></pre>
| javascript jquery | [3, 5] |
726,160 | 726,161 | event.pageX and event.pageY undefined in IE7 | <p>This is the onclick listener inside an a tag</p>
<pre><code>onclick="showMap('change-img-box',event); return false;"
</code></pre>
<p>This is the jquery</p>
<pre><code>function showMap(id,e){
var hpos = e.pageX, ypos = e.pageY; alert(hpos+'----'+ypos);
if($("#"+id).is(":visible")){
$("#"+id).hide();
}else{
$("#"+id).css({"top": ypos+10, "left": hpos+10}).hide().fadeIn(300);
}
}
</code></pre>
<p>Not sure why, but IE 7 says that both hpos and ypos are undefined. How can I fix this. Thanks in advance.</p>
| javascript jquery | [3, 5] |
5,924,036 | 5,924,037 | JQuery - CSS Editor? Is there one? | <p>Is there a JQuery plugin that has a css editor? What I mean is something like this:</p>
<p><a href="http://www.cssportal.com/css-style-editor/" rel="nofollow">http://www.cssportal.com/css-style-editor/</a></p>
<p>Kind of like the dreamweaver style editor.</p>
<p>If there isn't something like this, Its probably not that hard to create, eh? :)</p>
<p><strong>Update:</strong></p>
<p>To be more clear, I would like to create my own css editor (or use a JQuery one) to replace the one that tinyMCE uses: <a href="http://tinymce.moxiecode.com/tryit/jquery_version.php" rel="nofollow">http://tinymce.moxiecode.com/tryit/jquery_version.php</a></p>
<p>Click on the style editor in the tinyMCE.</p>
<p>I would basically want to recreate that in JQuery, but would probably need to do some php backend stuff to save the changes and put it back into the tinyMCE editor.</p>
| javascript jquery | [3, 5] |
5,781,325 | 5,781,326 | Preventing list items from displaying whilst overlay images load | <p>I have created 6 divs .box that contain an unordered list and images with the images being absolutely positioned above each list. Is there a way I can make sure the content under the image isnt revealed whilst the content boxes fade in?</p>
<p><a href="http://jsfiddle.net/NKFgC/" rel="nofollow">http://jsfiddle.net/NKFgC/</a></p>
<p>Kyle</p>
| javascript jquery | [3, 5] |
1,107,839 | 1,107,840 | about Speed: Python VS Java | <p>Just curious about speed of Python and Java..
Intuitively, Python should be much slower than java, but I want to know more...Could anybody give me more? or introduce some nice post to read?</p>
| java python | [1, 7] |
1,657,272 | 1,657,273 | Ajax calls to HTTPS. Android PhoneGap XHR status=0 | <p>I want to make AJAX calls to HTTPS from HTTP, but have <code>XHR.status=0</code>.</p>
<p>I use following code to make the call:</p>
<pre><code> $j.ajax({
type: method || "GET",
async: this.asyncAjax,
url: url,
contentType: 'application/json',
cache: false,
processData: false,
data: payload,
success: function(response){
alert("Resp");
},
error: function(xhr, status, error) {
alert("3-"+xhr.status+" STATUS: "+status+" ERROR: "+error+" URL: "+url);
},
dataType: "json",
beforeSend: function(xhr) {
if (that.proxyUrl !== null) {
xhr.setRequestHeader('SalesforceProxy-Endpoint', url);
}
xhr.setRequestHeader(that.authzHeader, "OAuth " + that.sessionId);
xhr.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
}
});
}
</code></pre>
| javascript android | [3, 4] |
5,918,782 | 5,918,783 | Getting selected value from RadioButtonList | <p>New to ASP.NET(C#)...</p>
<p>I have a RadioButtonList on my page that is populated via DataBinding</p>
<pre><code><asp:RadioButtonList ID="rb" runat="server">
</asp:RadioButtonList>
<asp:Button Text="Submit" OnClick="submit" runat="server" />
</code></pre>
<p>How do I get the value of the radio button that the user selected in my "submit" method?</p>
| c# asp.net | [0, 9] |
4,233,853 | 4,233,854 | Running a libraby for fuzzy logic classification (jfuzzylogic) on Android? | <p>I have implemented code that classifies hand gestures into the correct corresponding letters and words as a Java application.</p>
<p>What am trying to do now is to implement my classification algorithm on android so that i am able to classify these gestures by processing the input data on my Android device.</p>
<p>Can i use "jfuzzylogic" in Android, and if not is there a alternative to this library that could run in Android?</p>
| java android | [1, 4] |
3,925,060 | 3,925,061 | Im trying to create an excel file....but while running on the server the following error comes | <p>Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. </p>
<p>To free disk space, delete files you no longer need from the disk you are saving to.</p>
<p>any idea why???</p>
| c# asp.net | [0, 9] |
4,670,308 | 4,670,309 | Javascript script tags inside JQuery .html function | <p>Quick question is it possible to get javascript script tags inside JQuery .html function?</p>
<pre><code>function pleaseWork(){
$('#content').html('<h3 style="color:#335c91">This is the header</h3><div class="holder"><script type="text/javascript" src="javascriptFile.js"></script></div>');
}
</code></pre>
<p>What I am trying to accomplish is when the user clicks on a button, this header and javascript code show up in the div content, right now when I click on the button, there is no header showing and it goes to a blank page and shows the javascript code (it works, but not how I would like it to work.)</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
4,105,667 | 4,105,668 | If ID has class, set attribute of another element | <p>I'm trying to detect if a class is present and, if so, set the background attribute of another element. This is what I have but it's not working.</p>
<pre><code>if(jQuery("#slider-banner").hasClass('living-nutrients'))
{
jQuery("#home-middle-first").css("background-image","[path to new background image]");
}
</code></pre>
<p>BTW - My next step is for this to detect it whenever the ID "slider-banner" changes, but so far I can't even get it to work once on page load. Any help would be greatly appreciated... Thanks!</p>
<p><strong>EDIT:</strong> I changed from .attr to .css as instructed. Makes sense... but still not working. I've tried adding console.log message within the IF statement and got nothing also. Does that give anyone any more ideas?</p>
<p><strong>Example HTML where class changes:</strong></p>
<pre><code><img id="slider-banner" class="living-nutrients" src="[image path]">
</code></pre>
<p><strong>Example HTML where I want to change background image:</strong></p>
<pre><code><div class="home-middle-one-third" id="home-middle-first">
<a href="#"></a>
</div>
</code></pre>
<p><strong>UPDATE:</strong></p>
<p>For everyone who said it "should work"... you are right! Turns out that, as written, it doesn't like being in the footer of the page, but when I moved it to the head, presto!</p>
<p>The final piece of this puzzle is to have it detect and evaluate based on the #slider-banner changing, (or more accurately, which class is present for the ID'd area), not just the page loading, as is currently. </p>
<p>The ID is for one element of a slide within a slider. There are three possible classes I could assign to the ID depending on which slide is visible. So I need the script to evaluate every time a slide changes.</p>
<p>Any ideas? Thank you all!</p>
| javascript jquery | [3, 5] |
392,473 | 392,474 | Delete text and other elements before and after the element | <p>I need to delete everything (text and other elements) before and after the element <code><a></code> with value class <code>chatlink</code>.
All this, within each element <code><div></code> with value class <code>main</code>.</p>
<p><strong>But only if <code><div></code> element with the value <code>main</code> contains a link with the value of <code>chatlink</code>.</strong></p>
<p>For example:</p>
<pre><code><div class="main">
Bla bla bla :)
<a href="#" class="chatlink"><img src="#" /></a>
bla bla bla ...
<a href="#" class="chatlink"><img src="#" /></a>
tra la la la laaa
<a href="#" class="postlink">some text</a>
tralalaaa
</div>
</code></pre>
<p>Final code:</p>
<pre><code><div class="main">
<a href="#" class="chatlink"><img src="#" /></a>
<a href="#" class="chatlink"><img src="#" /></a>
</div>
</code></pre>
<p>Is it possible?</p>
| javascript jquery | [3, 5] |
4,202,274 | 4,202,275 | how to darw the image faster in canvas | <p>I am capturing mobile snapshot(android) through monkeyrunner and with the help of some python script(i.e. for socket connection),i made it to display in an html page.but there is some time delay between the image i saw on my browser and that one on the android device.how can i synchronise these things so that the mobile screen snapshot should be visible at the sametime on the browser.</p>
| javascript python | [3, 7] |
5,542,593 | 5,542,594 | jQuery post works on load, but not on click | <p>I first implemented the following snippet to show a "hi" alert and do a jQuery post at "document ready". This first step worked fine. I then added a couple of lines to execute the block only on-click of a tag.
Now the "hi" alert works as expected (only after I click on the link), however the post returns an 'error, the post didn't work' and doesn't complete as expected. To reiterate, if I remove the 2 lines flagged with /<em>*</em>/ below, the code works just fine (immediately after the page loads). Any ideas why?</p>
<pre><code>$(document).ready(function(){
$('a.postlink').click(function() { /*** post works if I remove this line ***/
alert("hi");
jQuery.post("http://myurl",
{registration_id: 'device1', command: 'MESSAGE', message: 'Hello', longMessage: ''},
function(data) {
alert("ok");
})
.error(function() {
alert("error, the post didn't work");
});
}); /*** and this line ***/
});
</code></pre>
| javascript jquery | [3, 5] |
5,149,983 | 5,149,984 | How do I use the ActionBar on older versions of Android? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6031774/what-is-the-equivalent-of-actionbar-in-earlier-sdk-versions">What is the equivalent of ActionBar in earlier sdk versions?</a> </p>
</blockquote>
<p>If I'm not mistaken, the Android guidelines say you should use the ActionBar for the global navigation within an app.</p>
<p>But at the same time, you typically want to target the oldest API possible for maximum compatibility. </p>
<p>I'm beginning development on an app and I set the target to Android 2.2. </p>
<p>Is it possible to use the action bar here? If not, what do i use?</p>
<p>Thanks
Kevin</p>
| java android | [1, 4] |
4,850,542 | 4,850,543 | how to copy a Select input and append it to a div in Jquery | <p>i have a Select input and it's name is "item" for example </p>
<pre><code><select name="item">
<option value="1">1</option>
<option value="2" selected="selected">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</code></pre>
<p>i want to add a button that will copy this Select and removed Selected value if any and then append that copy to an a div called "all items".</p>
<p>how can i do that in Jquery?
thanks </p>
| javascript jquery | [3, 5] |
3,165,293 | 3,165,294 | onload callback on image not called in ie8 | <p>I'm trying to preload image and set the height and width to a container.</p>
<p>The problem seems to be with caching in ie8 since it fails to load on subsequent refreshes.</p>
<p>I've looked up and tried multiple solutions but seems nothing is working, at least not consistently.</p>
<p>current Javascript:</p>
<pre><code> img = new Image();
img.src = '/images/site/image.jpg';
img.onload=function(){
var width = img.width + 'px';
var height = img.height + 'px';
$('#container').css({'width':width,
'height':height
});
};
</code></pre>
<p>Any suggestions are appreciated, thanks.</p>
| javascript jquery | [3, 5] |
3,469,256 | 3,469,257 | running logcat on Eclipse | <p>I searched through whole internet but I still don't understand how I need to set up logCat what it would run. Could someone help with this? </p>
| java android | [1, 4] |
4,144,862 | 4,144,863 | Recommend a Java / Android Game Library - card, board, etc.? | <p>My dev team and I are looking to do a game in Android, instead of iPhone for our next sprint iteration. We've been tweaking with <a href="http://bitbucket.org/snej/geekgameboard/" rel="nofollow">GeekGameBoard</a> (which we love), and I was wondering if anyone could recommend a similar game library for Java / Android-esque.</p>
<ul>
<li>We're not looking for OpenGL </li>
<li>We're looking for Board Game / Card Game (engine or code framework)</li>
<li>Also, open-source preferable.</li>
</ul>
<p>Any advice?</p>
| java android | [1, 4] |
5,690,708 | 5,690,709 | How to check for correct url | <p>I am working on a current web app and we would like to determine if the page being requested is correct or not, we do this in a <code>Global.asax</code> on the <code>Application_BeginRequest</code> method, we check for the urls such as if someone enters <code>http://mywebtest/badurl</code> then we send them to a custom 404 page, but we are having trouble making it work when it has a .aspx extension, there are pages that are good with aspx extensions but others that do not exist should be fowarded to the custom 404. How can we do this?</p>
<pre><code>If a page with .aspx is requested that does not exist,
to redirect it to the custom 404 page?
</code></pre>
<p>I was trying something like (but its just a guess) and it did not work..</p>
<pre><code>if ((string)System.IO.Path.GetExtension(Request.Path) == string.Empty)
{
HttpContext.Current.RewritePath("~/custom404.aspx");
}
</code></pre>
<p>Thank you</p>
| c# asp.net | [0, 9] |
1,207,186 | 1,207,187 | HttpContext.Current.Session.IsNewSession still true after redirect | <p>I am trying to redirect to the same page with different query string parameters</p>
<pre><code>HttpResponse resp = HttpContext.Current.Response;
resp.Redirect(landingPagePath)
</code></pre>
<p>To avoid further processing after redirection i check if </p>
<pre><code>HttpContext.Current.Session.IsNewSession == false
</code></pre>
<p>but for some reason i found that this is not always the case after redirection</p>
<p>can anyone please tell why is this happening</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
4,480,380 | 4,480,381 | tagName is null or not an object -- error msg in IE7 using latest version of jQuery (1.2.6) | <p>has anyone else seen this error message. a quick check with google doesn't show me much.</p>
| asp.net javascript jquery | [9, 3, 5] |
5,696,717 | 5,696,718 | jQuery .fn is saying "not a function" | <p>When I call this custom function</p>
<pre><code>$.fn.inputBoxHelper = function () {
var args = arguments[0] || {};
var matchingElem = $.grep(this, function (e) { return $(e).val() == $(e).attr('title'); });
$(matchingElem).addClass(args.className);
this.bind({
focus: function(){
if ($(this).val().trim() == $(this).attr('title')) { $(this).val(emptyString).removeClass('gray'); }
},
blur: function(){
if ($(this).val().trim() == emptyString) { $(this).val($(this).attr('title')).addClass('gray'); }
}
});
return this;
}
</code></pre>
<p>Like this</p>
<pre><code>$('input:text').inputBoxHelper({ className: 'gray' });
</code></pre>
<p>It gives me the error when I call it</p>
<pre><code>$("input:text,input:checkbox").inputBoxHelper is not a function
file:///D:/repository/scripts/script_tests/test.js
Line 20
</code></pre>
<p>Even when I change the function to just</p>
<pre><code>$.fn.inputBoxHelper = function () {return this;}
</code></pre>
<p>it does the same thing. It seems to run fine and work correctly as all the functionality works on the input boxes but get the error. Anyone have any ideas?</p>
| javascript jquery | [3, 5] |
3,275,792 | 3,275,793 | Deserialize json so I can databind to it | <p>I've got a json string, which I want to deserialize and put it in an list. I've got my code below, can someone help me in the right direction please? When I run Response.Write(reports.Count); after I've tried to deserialise, it does count 2 entries, but I cant seem to bind to it. Any advice? </p>
<pre><code>public class Report
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
on page_load.....
responseData = [{"FirstName":"George","LastName":"Clooney"},{"FirstName":"Brad","LastName":"Pitt"}]
IList<Report> reports = new JavaScriptSerializer().Deserialize<IList<Report>>(responseData);
Response.Write(reports.Count);
ReportRepeater.DataSource = reports;
ReportRepeater.DataBind();
</code></pre>
| c# asp.net | [0, 9] |
4,566,624 | 4,566,625 | Worrying about concurrency issues - should I only allow 1 user at the time? | <p>I’m working on an administration tool for a project that does a small amount of reading and writing to different files and some database queries and updates. Now I believe it’s improbable that we would ever have an issue with this since we’re not that many people using this project. But if I can, I want to minimize or eliminate the risk of it ever happening while not disturbing the normal users. I'm using Windows Authentication and Roles. </p>
<p>One of my ideas is to create a lock and only allowing 1 user to administer at the time. By using the Session.SessionID and saving it in the Application state as an exclusive lock. E g if a user would want to administer he would first go to a landingpage and there where would be this check (oh, this isn't atomic I take it?):</p>
<pre><code>if (Application["lockedBy"] == null)
{
Application["lockedBy"] = Session.SessionID;
Application["lockedName"] = User.Identity.Name;
Response.Redirect("Admin.aspx");
}
</code></pre>
<p>And the admin page there would be a button to release the lock and redirect to another page. Or if the user forgets using the Session_End() in the global.asax file and having an autorefresh. But how would this stop someone from pressing the browsers backbutton and bypassing this?</p>
<p>Or should I try to make sure the configuration files haven’t been changed before writing to them? But how would I save the state for this page. Should I like save the files modification time in Session state and if they diff just abort the save action? </p>
<p>So the question is: how should I protect my application from concurrency issues while not disturbing the normal users?</p>
| c# asp.net | [0, 9] |
1,682,005 | 1,682,006 | How to disable back button in browser using javascript or any script | <p>Im using wamp server for my php scripts. And Im having difficulties on the logout code.
Every time I click on the logout link and then click on the back button on web browser it still shows the page which can only be access by the user who is logged in.
I have this code at the beginning of the index.php which is called by the log out link to destroy the session:</p>
<pre><code><?php
session_start();
session_destroy();
?>
</code></pre>
<p>And I have this at the beginning of the user page:</p>
<pre><code><?
session_start();
if(!session_is_registered(myusername)){
header("location:login.php");
}
?>
</code></pre>
<p>I don't know why the userpage can still be access after the user has logged out.
So I'm thinking of disabling the back button when the user has logged out.
Please help.</p>
| php javascript | [2, 3] |
1,824,848 | 1,824,849 | Android memory leak tool? | <p>Is there any good visual tool which can be used to detect memory leaks in Android?</p>
| java android | [1, 4] |
3,501,654 | 3,501,655 | Best Way Of Getting Data In Separate Javascript File? | <p>Let me first describe the situation the best I can.</p>
<p>So I am working in a PHP MVC framework. Inside the controller of a method I collect and format the data as it needs to be and I send it off to the view. The view page in turn uses that data but also includes separate javascript script files that also need to access the data the controller is passing to the view.</p>
<p>What is the best way to make sure the data the controller is passing to the view is accessible to the other javascript files?</p>
<p>Right now what I am doing is just creating a bunch of hidden for fields so that in my javascript I can just do:</p>
<pre><code>$('selector').val();
</code></pre>
<p>In order to access the data but I can't help to think that there might be a cleaner way to do this.</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.