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 |
---|---|---|---|---|---|
1,613,447 | 1,613,448 | IllegalArgumentException locking surface | <p><strong>Device Samsung galaxy s3. OS-4.0.4.I have a list view diplaying list items.Then after i keep my phone idle for 5-10 min,agian when i unlock and resume my application i see this exception</strong></p>
<pre><code>E/SurfaceTextureClient( 9044): dequeueBuffer failed (No such device)
E/ViewRootImpl( 9044): IllegalArgumentException locking surface
E/ViewRootImpl( 9044): java.lang.IllegalArgumentException
E/ViewRootImpl( 9044): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRootImpl( 9044): at android.view.Surface.lockCanvas(Surface.java:76)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2157)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1846)
E/ViewRootImpl( 9044): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2658)
E/ViewRootImpl( 9044): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRootImpl( 9044): at android.os.Looper.loop(Looper.java:137)
E/ViewRootImpl( 9044): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/ViewRootImpl( 9044): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRootImpl( 9044): at java.lang.reflect.Method.invoke(Method.java:511)
E/ViewRootImpl( 9044): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
E/ViewRootImpl( 9044): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
E/ViewRootImpl( 9044): at dalvik.system.NativeStart.main(Native Method)
</code></pre>
| java android | [1, 4] |
2,087,339 | 2,087,340 | Radiobuton list click show hide label control | <p>I am trying to show/hide Label control if the Radio button List value is 'N'. The code works fine but when I uncheck the radio button the Label control doesn't hide. Also I am using Jquery mousedown event to clear the selection. Please suggest.</p>
<pre><code>var radioList = "#<%= radioLst1.ClientID %>";
var lblID = document.getElementById('<%=LblIDNumber.ClientID%>');
$(radioList + " input:radio").click(function (e) {
if ($('#<%= radioLst1.ClientID %> input:checked').val() == "N") {
lblID.style.display = $(this).attr("checked") ? 'inline' : 'none';
}
else {
lblID.style.display = 'none';
}
});
</code></pre>
<p>I am using the following code to clear the selection of the radio button list.</p>
<pre><code> $(radioList + " input:radio").mousedown(function (e) {
if ($(this).attr("checked") == true) {
setTimeout("$('input[id=" + $(this).attr('id') + "]').removeAttr('checked');", 200);
lblID.style.display = 'none';
}
else {
return true
}
});
<asp:Label ID="LblIDNumber" style="display:none" runat="server">Number</asp:Label>
<asp:RadioButtonList ID="radioLst1" runat="server">
<asp:ListItem Value="U">Unknown</asp:ListItem>
<asp:ListItem Value="N">Not Applicable</asp:ListItem>
</asp:RadioButtonList>
</code></pre>
| jquery asp.net | [5, 9] |
2,675,113 | 2,675,114 | Getting next tag - jquery | <p>I have the following markup:</p>
<pre><code><button class="button" type="button"><span>Edit</span></button>
</code></pre>
<p>I want to have a click event on .button that changes the value of the next span.</p>
<p>So I have this as a test:</p>
<pre><code> $('.button').click(function(){
$(this).next('span').val();
})
</code></pre>
<p>This returns 'undefined' however. How can I select the span?</p>
<p>Thank you!</p>
| javascript jquery | [3, 5] |
4,088,411 | 4,088,412 | How to push values to a multi-dimensional array | <p>I can't figure out how to push values to a dynamic multi-dimensional array. This is the code i have:</p>
<pre><code>function compareNumbers(){
var count = $('.finishedRow').length;
var inputtedNums = new Array();
for(var i=0; i<count; i++){
$('.finishedRow').eq(i).find('li').each(function(j){
inputtedNums[i].push($(this).text());
});
}
console.log(inputtedNums);
}
</code></pre>
<p>So say there are, for example, 3 <code>finishedRow</code> selectors and each <code>finishedRow</code> selector contains 4 <code>li</code> elements with values of <code>first</code>, <code>second</code>, <code>third</code>, <code>fourth</code>. I want my <code>inputtedNums</code> variable to look like:</p>
<pre><code>inputtedNums = [
["first", "second", "third", "fourth"],
["first", "second", "third", "fourth"],
["first", "second", "third", "fourth"]
]
</code></pre>
<p>As my code is now I get the error: <code>Cannot call method 'push' of undefined</code>.</p>
<p>I'm sure I'm missing something fundamental here.</p>
| javascript jquery | [3, 5] |
428,297 | 428,298 | make linkbutton inside a datagrid non clickable on certain conditions? | <p>I have a datagrid with linkbutton inside it.</p>
<pre><code><asp:DataGrid id="listDataGrid" Runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Item Name">
<ItemTemplate>
<asp:LinkButton id="lbItemName" runat="server" OnClientClick="return false;" />
</Columns>
</asp:DataGrid>
In c#
foreach (DataGridItem dataGridItem in listDataGrid.Items)
{
LinkButton lbItemName;
lbItemName = (LinkButton)dataGridItem.Cells[1].FindControl("lbItemName");
if (display == false)
{
lbItemName.Attributes.Add("style", "text-decoration: none;cursor: default;");
lbItemName.Attributes["disabled"] = "disabled";
}
}
</code></pre>
<p>But link button still works as a clickable link. I want to make it to show as text.</p>
<p>THanks</p>
| c# asp.net | [0, 9] |
3,757,360 | 3,757,361 | Redirect if page has already been visited | <p>I think I'm stuck and I really hope someone can help me out here.<br/><br/>
So, I'm trying to make something like a quiz application with PHP and JS. The idea is that the user is given a picture with 4 possible answers and he has to guess what's in that picture. User receives x points based on the answer he clicked and gets redirected to the next page, with picture and answers, and so on. There's also a chance for user to skip to the next page. Here's the thing though:
<br/><br/>
How do I check if the user has already answered particular question, so I could redirect him to the next page if this one has already been answered? Basically, it would be like a protection from cheating, so that the user couldn't get more and more points from the same question.<br/><br/>
I'm currently stuck with MySQL solution, to make column for every page, store values there and then compare them when user tries to access particular page, redirecting him based on the stored value. Is it the only solution?<br/><br/>
I'm sorry if my english isn't that good, and I hope you guys can understand my question. :)</p>
| php javascript | [2, 3] |
68,442 | 68,443 | Removing default text from text box | <p>I got this Text box with default value as "First Name" ..Now when I click inside this text box to enter name , this value "First Name" keeps on displaying. What I want is to the text box to clear as soon as I click inside it. What property do I need to set in mt textbox tag ?</p>
<p><strong>[Edit]
ok anything from Telerik that I can use to do that ?</strong></p>
| c# asp.net | [0, 9] |
5,298,081 | 5,298,082 | click events on nested list items each with their own click handler | <p>I have nested unordered lists and click handlers on each li element. When clicking on a nested li, it's firing both events. Is there anyway to prevent this behavior? </p>
<pre><code><ul>
<li>thundercats
<ul>
<li>panthero</li>
<li>cheetarah</li>
</ul>
</li>
</ul>
</code></pre>
<p>So in the above list clicking "thundercats" would fire one event setting a value to "thundercats", clicking on panthero would fire another event setting a value to panthero.</p>
<p>Unfortunately clicking panthero causes the value to be set properly for an instant and then the click handler on thundercats fires and overwrites the value. Is there a way to prevent that?</p>
| javascript jquery | [3, 5] |
2,300,507 | 2,300,508 | why the $(function () executed always | <p>I am wondering why the <code>$(function () {}</code> is getting executed all the time. <code>function test(0</code> is not. what's the difference between those two?</p>
| javascript jquery | [3, 5] |
5,691,997 | 5,691,998 | Slide div back with back button | <p>I'm using sliding divs with this code:</p>
<p>html:</p>
<pre><code> <div id="container">
<div id="box1" class="box">Div #1</div>
<div id="box2" class="box">Div #2</div>
<div id="box3" class="box">Div #3</div>
<div id="box4" class="box">Div #4</div>
</div>
</code></pre>
<p>css:</p>
<pre><code> body {
padding: 0px;
}
#container {
position: absolute;
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: hidden;
}
.box {
position: absolute;
width: 50%;
height: 300px;
line-height: 300px;
font-size: 50px;
text-align: center;
border: 2px solid black;
left: 150%;
top: 100px;
margin-left: -25%;
}
#box1 {
left: 50%;
</code></pre>
<p>js:</p>
<pre><code> $('.box').click(function() {
$(this).animate({
left: '-50%'
}, 500, function() {
$(this).css('left', '150%');
$(this).appendTo('#container');
});
$(this).next().animate({
left: '50%'
}, 500);
});
</code></pre>
<p>There is the jsfiddle here: <a href="http://jsfiddle.net/jtbowden/ykbgT/2/" rel="nofollow">http://jsfiddle.net/jtbowden/ykbgT/2/</a></p>
<p>I would like to be able to use the previous button of my browser to go back to the previous div.</p>
<p>Is there a way to accomplish that?</p>
<p>EDIT:</p>
<p>I tried by just adding anchors, but it doesn't seem to work.</p>
| javascript jquery | [3, 5] |
429,965 | 429,966 | How can I get certain text from wikipedia? | <p>Take this for example:
<a href="http://en.wikipedia.org/wiki/United_States_Bill_of_Rights" rel="nofollow">http://en.wikipedia.org/wiki/United_States_Bill_of_Rights</a></p>
<p>Under the "Amendments" section, I want to get what each bullet point says, and display them in a nice list in an android application. I know there's a wikimedia api, but I have absolutely no idea how to use it, and from what I understand of it, you can get the text under a section, but I'm not sure if you can get each bullet point separately.</p>
<p>What would be the best way to do this? Or instead of this, should I just spend my time copying the text from over 300 pages onto a text file, and reading it in the application?</p>
| java android | [1, 4] |
3,086,206 | 3,086,207 | How to optimize my javascript? | <p>I have inherited a piece of code which has a series of functions like the following:</p>
<pre><code>$("#data[User][notify_one_day_out]").change(function () {
$("#updatenotificationsform").submit();
}
$("#data[User][notify_one_month_out]").change(function () {
$("#updatenotificationsform").submit();
}
</code></pre>
<p>and this goes on and on. How do I just write one function that does the same thing since every ID begins with data. Sorry am a JS newbie</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
4,534,336 | 4,534,337 | JS code added from codebehind doesn't run | <p>I wrote an application in ASP.Net I have a problem with centering a dynamically created popup. In the popup control I inserted the following code: </p>
<pre><code>string script = "<script type='text/javascript'>";
script += "$(document).ready(setMargin();); ";
script += "function setMargin(){ ";
script += "var wid = $('MC_resultPopup_pnlResultPopup').width();";
script += "$('MC_resultPopup_pnlResultPopup').css('margin-left', wid/2 + 'px');}";
script += "</script>";
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "SetAutoWidth", script);
</code></pre>
<p>But this code is not working. It does not even start. What am I doing wrong?</p>
| c# javascript | [0, 3] |
283,180 | 283,181 | CSSFriendly - Issue using CSSFriendly when same menu control is added as a reference in other pages | <p>I have a ascx page(Header) in which asp:Menu resides, this is used added as a reference in other pages. I use CSSFriendly to render asp:Menu into ul,li tags. This works fine for main pages,if i traverse into submenuitems and move to other pages in which also header is added as a reference, menu is displayed vertically.. </p>
| c# asp.net | [0, 9] |
5,815,766 | 5,815,767 | How do I encode an URL? | <p>When I run my project I get the url <code>http://localhost:5973/PageToPageValuePass/Default.aspx</code> I want to Encode the URL since sometimes I need to transfer data from page to page. When the urls are encoded then it increases the reliability.</p>
<pre><code>Server.UrlEncode("http://www.google.com/c#");
</code></pre>
<p>I get this, but how do I use it to help me encode the url?</p>
| c# asp.net | [0, 9] |
880,936 | 880,937 | Javascript equivalent of Python's iterkeys() dictionary method | <p>In Python I can use the <code>iterkeys()</code> method to iterate over the keys of a dictionary. For example:</p>
<pre><code>mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
</code></pre>
<p>gives me:</p>
<pre><code>a
c
b
</code></pre>
<p>How can I do something similar in Javascript?</p>
| javascript python | [3, 7] |
861,231 | 861,232 | setInterval jumps when move between browser tabs | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-also-work-when-a-tab-is-inactive-in-chrome">How can I make setInterval also work when a tab is inactive in Chrome?</a> </p>
</blockquote>
<p><a href="http://www.datingjapan.co" rel="nofollow">http://www.datingjapan.co</a></p>
<p>I have setInterval changing images as follows:</p>
<pre><code> var initialFadeIn = 1000; //initial fade-in time (in milliseconds)
var itemInterval = 6000; //interval between items (in milliseconds)
var fadeTime = 2500; //cross-fade time (in milliseconds)
var infiniteLoop = setInterval(function(){
position1.eq(currentItem1).fadeOut(fadeTime);
if(currentItem1 == numberOfItems1 -1) {currentItem1 = 0;}else{currentItem1++;}
position1.eq(currentItem1).fadeIn(fadeTime);
}, itemInterval);
</code></pre>
<p>I notice when I move between browser tabs in Chrome that when I come back to the site (after the interval has passed) the images quickly jump to the next. Is it possible to make this smoother? or make this occur in the background?</p>
<p>any info on this would be great.</p>
<p>thx</p>
| javascript jquery | [3, 5] |
2,805,320 | 2,805,321 | can we .find 2 classes? | <p>I'm wondering what's the best way to achieve this:</p>
<pre><code>var $optionSets = $('#options').find('.option-set','#talents')..
</code></pre>
<p>That doens't work.</p>
<p>basically i want to say to assign <code>var $optionSets</code> for both <code>.option-set</code> and <code>#talents</code></p>
| javascript jquery | [3, 5] |
2,289,038 | 2,289,039 | JQuery | change the innert html content of ul->li->a | <p>I have the following html</p>
<pre><code> <ul class="links main-menu">
<li class="menu-385 active-trail first active"><a class="active" title="" href="/caribootrunk/">HOME</a></li>
<li class="menu-386 active"><a class="active" title="" href="/caribootrunk/">FIND LOCAL PRODUCTS</a></li>
<li class="menu-387 active"><a class="active" title="" href="/caribootrunk/">DO BUSINESS LOCALLY</a></li>
<li class="menu-388 active"><a class="active" title="" href="/caribootrunk/">LOCAL NEWS &amp; EVENTS</a></li>
<li class="menu-389 active"><a class="active" title="" href="/caribootrunk/">BLOG</a></li>
<li class="menu-390 last active"><a class="active" title="" href="/caribootrunk/">ABOUT US</a></li>
</ul>
</code></pre>
<p>I am new to jquery. What I want is i want to wrap inner html of anchor tag(e.g. Home etc) in in a span. I want this functionality through jquery on document ready.</p>
| javascript jquery | [3, 5] |
4,103,310 | 4,103,311 | Android: How can I change the EditText text without triggering the Text Watcher I have on it? | <p>I have an EditText field with a Customer Text Watcher on it. In a piece of code I need to change the value in the EditText which I do using .setText("whatever"), the problem is as soon as I make that change the afterTextChanged method gets called which created an infinite loop. How can I change the text without it triggering afterTextChanged? </p>
<p>I need the text in the afterTextChanged method so don't suggest removing the Text Watcher...</p>
<p>Thanks</p>
| java android | [1, 4] |
1,673,226 | 1,673,227 | How to get year, month and day from different timezone? | <p>I am now in Hong Kong. How can I get the year, month and day from USA??<br>
I have tried: </p>
<pre><code>Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
sdf.format(calendar.getTime());
</code></pre>
<p>But I don't know how to get the year, month.
Please help</p>
| java android | [1, 4] |
835,668 | 835,669 | FindControl is not working as expected? | <p>I have this structure : </p>
<pre><code>Page
|
+---Ascx
|
+---<div runat="server">
|
+---<asp:button>
</code></pre>
<p>I already know that <code>Findcontrol</code> <em>doesn't</em> work recursively .</p>
<p>However when I pressed the button and went to debug and wrote : </p>
<p><code>this.FindControl("btn1")</code> it <strong>did</strong> find the <code>"button"</code></p>
<p><strong>But</strong></p>
<ul>
<li><code>this</code>= the ascx</li>
<li>There is a <code>div runat server</code> which wraps the button</li>
</ul>
<p>So <em>how</em> did it find it ? According to the definition , it doesn't suppose to work.</p>
<p>Msdn : </p>
<blockquote>
<p><strong>Control.FindControl</strong> --> The method does not search throughout a hierarchy of controls within
controls</p>
</blockquote>
| c# asp.net | [0, 9] |
2,014,141 | 2,014,142 | jQuery .add method seemingly not working? | <p>I wonder if anyone can explain this:</p>
<pre><code>$(document).ready(function() {
var popup = $('<div id="popup"><div class="popup-content"></div></div>');
var popupContent = popup.children('div');
var overlay = $('<div id="overlay"></div>');
console.log(popup);
console.log(popupContent);
console.log(overlay);
console.log(overlay.add(popup).appendTo('body'));
});
</code></pre>
<p>I've added some debugging in there in case you want to test it.</p>
<p>I don't understand why only the overlay gets appended when appendTo() is being called on a jQuery object containing two elements?</p>
<p>Any help would be much appreciated. </p>
| javascript jquery | [3, 5] |
91,041 | 91,042 | Store dropdown as live variable? | <p>I've got the following PHP:</p>
<pre><code><?php
$default = 'Select a job role';
$query = "SELECT DISTINCT Job_Title FROM rates";
$result = mysql_query($query);
while($myrow = mysql_fetch_array($result)) {
$action = $myrow['Job_Title'];
echo "<option value='$action'".($action == $default ? ' selected="selected"' : '').">$action</option>\n";
}
?>
</code></pre>
<p>I need to store whatever they select from this dropdown as a variable. Obviously if they change their choice it will keep changing the variable.</p>
<p>The reason behind this is I have another select statement whose results depend on the selection here.
If it can't be done with just PHP then Jquery is the preference if needed.</p>
<pre><code><select name="job-role">
<option value="J1">J1</option>
<option value="J2">J2</option>
<option value="J3">J3</option>
</select>
</code></pre>
| php jquery | [2, 5] |
2,963,490 | 2,963,491 | How to access PHP variables in JavaScript or jQuery rather than <?php echo $variable ?> | <p>How do I access PHP variables in JavaScript or jQuery? Do I have to write </p>
<pre><code><?php echo $variable1 ?>
<?php echo $variable2 ?>
<?php echo $variable3 ?>
...
<?php echo $variablen ?>
</code></pre>
<p>I know I can store some variables in cookies, and access these values via cookies, but values in cookies are relatively stable values. Moreover, there is a limit, you can not store many values in cookies, and the method is not that convenient. Is there a better way to do it?</p>
| php javascript jquery | [2, 3, 5] |
3,977,368 | 3,977,369 | Values of two select boxes | <p>Briefly Explaining my program :</p>
<p>I Have 3 select boxes</p>
<p>If the value selected by the user in the 1st box is 2 & Value selected by the user in second box is 3 (option values) then the third select box should display an array.</p>
<p>This code doesn't work but shows an idea:</p>
<pre><code>if ($('#firstbox').click(function() { ($(this).val() == '2'); } &&
$('#secondbox').click(function() { ($(this).val() == '3'); }) {
// Array Display here (not included the coding here, because there is no issue with this coding.. seems working fine)
}
</code></pre>
<p>I need help for the code included in if statment and && operation for checking the expression.</p>
| javascript jquery | [3, 5] |
1,042,625 | 1,042,626 | jquery check user browser type | <p>I'm using <code>$.browser</code> to try and check what type of browser users have accessing my site. The problem I have however is that both <strong>Safari</strong> and <strong>Chrome</strong> are webkit browsers and I therefore do not know how to distinguish between the too.</p>
<p>Is there a way to distinguish between safari and chrome so that I can have my site do something different?</p>
| javascript jquery | [3, 5] |
1,017,887 | 1,017,888 | JQuery Code not working in IE9 or lower versions | <p>EDIT*</p>
<p>In one of the pages in our website there is a pirate with a speech bubble that tells jokes. When the bubble is clicked the joke changes to another one at random in the list. For some reason this will not work in IE9 or lower. Can anyone tell me why?</p>
<p>I have checked the console and this error appears </p>
<pre><code>"CE2.w.external.InPrivateFilteringEnabled is not a function"
</code></pre>
<p>Here is the script:</p>
<pre><code>$(document).ready(function () {
var list = $(".joke-list li").toArray();
var elemlength = list.length;
// Encapsulate random value assignment within a function
var setRandomValue = function(element) {
var randomnum = Math.floor(Math.random() * elemlength);
var randomitem = list[randomnum];
$(element).html($(randomitem).text());
}
// Bind click button
$('.speech').click(function () {
setRandomValue(this);
});
// Set random value for the first time
setRandomValue($('.speech'));
$('.speech').css("width: 1000px;");
});
</code></pre>
<p>Here is a fiddle that I have thrown together to show the fault: <a href="http://jsfiddle.net/uRd6N/116/" rel="nofollow">http://jsfiddle.net/uRd6N/116/</a></p>
| javascript jquery | [3, 5] |
5,618,747 | 5,618,748 | Android: Perceptibility of Applications | <p>The current app that I'm developing requires me to know which apps the user is currently interacting with in any way (and there's no malicious intent here). That is, there are always loads of running app processes and services, but only a select few are actually instantiated or monitored by the user. </p>
<p>I only want to deal with the app processes that are running that the user knows are running. For example, it could be the current app in the foreground, and the music they are playing in the background. However, I want to ignore, say, the SetCPU, Maps, and keyboard services that are always running.</p>
<p>Most of this information can be had through a particular application's <code>RunningAppProcessInfo</code> instance, and within that the <code>importance</code> field. For the application in the foreground, the field would be set to <code>IMPORTANCE_FOREGROUND</code>. For my other condition (the music example one), there is a bit of an issue: there exists a <code>IMPORTANCE_PERCEPTIBLE</code> constant which would handle this scenario perfectly, but it's only relevant for API 9 and above (Gingerbread, effectively). After perusing the Android source, it appears that this particular value is set at a very low level in the Android OS, and is thus not something that is easily recreatable.</p>
<p>After that huge wall of text, my question is... how do I work around this? I need to be able to distinguish a music player (just happens to be the only example I can think of) from docile services, but at the same time I can't afford to relegate my app to only those who are running Gingerbread. What's a developer to do?!</p>
| java android | [1, 4] |
879,074 | 879,075 | Uncaught TypeError: Object #<HTML Document> has no method 'ready' | <p>I'm trying to implement a simple javascript into a website (website is on weebly), and I'm getting this error.
In the resources tab on chrome I can see it's loading all of the scripts.
Here's a piece of code:</p>
<pre><code><script type="text/javascript" src="/files/theme/cufon-yui.js"></script>
<script type="text/javascript" src="/files/theme/cufon-yanone-250.js"></script>
<script type="text/javascript" src="/files/theme/script.js"></script>
<script type="text/javascript" src="/files/theme/coin-slider.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider();
});
</script>
</code></pre>
<p>That's all fitted on the bottom of the .html file. It's a coin slider gallery.</p>
<p>Anyone out to help me ?</p>
<hr>
<p><em>From comment...</em></p>
<p>I am loading jQuery in the <code><head></code>...</p>
<pre><code><script src="ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; type="text/javascript"></script>`
</code></pre>
| javascript jquery | [3, 5] |
3,592,408 | 3,592,409 | Developing an online word processor while learning | <p>Right now i'm learning web dev(still in html phase) but i really wonder about something.
I was googling about how to develop a website like google docs but much much much simpler..thinking something just like notepad..By doing this, i will also learn some new stuff..
Anyways, as i read, i need to know javascript right? Why can't i do it in PHP?
You'll login, write something, and will save it..that's all..
Can someone please tell me the stuff i need to learn in order to make it possible..
Thank you very much</p>
| php javascript jquery | [2, 3, 5] |
4,115,615 | 4,115,616 | How to click a button on website? | <p>The HTML code is;</p>
<pre><code><input id="submit_button" type="submit" value="Convert file" title="Upload video to convert to MP4 format">
</code></pre>
<p>How would I go about clicking this button by using the webBrowser control?</p>
<p>I tried;</p>
<pre><code>webBrowser1.Document.GetElementById("submit_button").InvokeMember("onclick"); // click convert video button
</code></pre>
<p>but it is not working.</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
5,165,525 | 5,165,526 | AlertDialog...no OK button, only Cancel | <p>I want to show a alert dialog with OK and Cancel button but I only get Cancel. When I comment out cancel button i then get OK button. Weird. Anyway, here's the code:</p>
<pre><code>final AlertDialog ukucajIme = new AlertDialog.Builder(Kviz.this).create();
ukucajIme.setTitle("Insert your name");
final EditText input = new EditText(Kviz.this);
ukucajIme.setView(input);
ukucajIme.setButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Editable ukucanoIme = input.getText();
finish();
}
});
ukucajIme.setButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
ukucajIme.dismiss();
finish();
}
});
ukucajIme.show();
</code></pre>
<p>And question number two: whenever I try to use something like ukucajIme.setPositiveButton it gives me an error and says to change it to setButton. Why is that?</p>
| java android | [1, 4] |
5,128,615 | 5,128,616 | Why window.open do not opens a link which is given as var? | <p>I am trying to open a link which is in a div called hemsida.</p>
<pre><code> $('#hemsida').unbind('click');
$('#hemsida').bind('click', function(){
console.log('text: '+$(this).html());
window.open($(this).html());
});
</code></pre>
<p>But new window opens a wrong link. For example if text in div hemsida is hotmail.com, then link for new opening window is <a href="http://localhost.com/hotmail.com" rel="nofollow">http://localhost.com/hotmail.com</a>. console.log is giving right string. Any idea why? and do i have to change my div hemsida to a href to make it work or can i open a link by getting text from it? Thanks in advance. </p>
| javascript jquery | [3, 5] |
5,400,401 | 5,400,402 | how to write the javascript code to get the effect? | <p>mysite have two searches, one is the whole site search. another is google search. </p>
<p>the html structure is :</p>
<pre><code><div class="fr_search">
<select class="search_l">
<option value="0">the whole site search</option>
<option value="1">google search</option>
</select>
<form action="1.php" method="post" id="search-theme-form">
<input type="text" maxlength="128" name="search_theme_form" id="edit-search-theme-form-1" size="15" value="" title="input search term" class="form-text" />
<input type="image" name="submit" id="edit-submit" class="form-submit" src/images/search_btn_top.gif" />
<input type="hidden" name="form_build_id" id="form-9fb5cf2703f7df33fe84873222db2cbe" value="form-9fb5cf2703f7df33fe84873222db2cbe" />
<input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form" />
</form>
</code></pre>
<p></p>
<p>now, i want to do is when the site vistor select "the whole site search" from the drop-down list . when he input the term in the textbox, and click the submit button, the search result he get coming form the site. </p>
<p>when the vistor select "google search" fromm the drop-down list . when he input the search term in the textbox, and click the submit button, the search result he get coming form the Google Custom Search .
thank you.</p>
| javascript jquery | [3, 5] |
4,921,660 | 4,921,661 | Attach function to dynamically created DOM element | <p><strong>Goal:</strong></p>
<p>Append a DOM element with functionality. (One global listener is not desire here.)</p>
<p><strong>Problem:</strong></p>
<p>I don't know how to reference the new element in this context. The problem area is the <code>.on</code> event listener and the references to <code>$(this)</code> contained inside. Also, the ability for the function <code>get_value()</code> to call itself again from within.</p>
<p><strong>Relevant Code:</strong></p>
<pre><code>var dom_element = (function() {
// [...]
var create = function create( data ) {
// [...]
return $('<div />', { 'class': 'element', id: data.i_id })
// [...]
.on('load', function get_value() {
// [...]
$(this).find('.value').text(s_value);
// [...]
setTimeout('get_value()', 5000);
}());
},
// [...]
return {
create: create
};
}());
</code></pre>
| javascript jquery | [3, 5] |
3,002,657 | 3,002,658 | Detect mime type of an image via Javascript | <p>i am detecting images on my webpage with javascript document.images function which returns an rray of images. Is there any way to get the mime type of the image from this since i am not using any extension names on images which are loading?</p>
| javascript jquery | [3, 5] |
568,738 | 568,739 | Jquery .ajax not working as expected | <p>I've got the following code to call a json web service in a separate functions.js file.</p>
<pre><code>function getMajorGroups(){
var element = $(".item-group-button");
$.ajax({
type:"GET",
url:"localhost:6458/posApplication/getAllMajorGroups",
data:"{}",
contentType:"application/json; charset=utf-8",
dataType:"json",
done:successResult(majorGroups),
fail:errorResult(error)
});
}
function successResult(majorGroups){
var mGroups = response.d;
$("#item-groups").empty();
$.each(majorGroups ,function(){
var h3 = $('h3').append(majorGroups.code);
element.append(h3);
$("#item-groups").prepend(element);
});
}
function errorResult(error){
alert("error");
}
</code></pre>
<p>When I run the web page and I use firebug to trace the steps I can see the script is executed. But it does not execute the success or failure code inside the ajax call. Am I doing anything wrong here?</p>
<p>Below is an example of the string which the service return.</p>
<p>{"majorGroups":[{"update":"false","hasMore":"false","status":"A","description":"Beverage","majorGroupId":"48","code":"Beverage"},{"update":"false","hasMore":"false","status":"A","description":"Laundry","majorGroupId":"51","code":"Laundry"},{"update":"false","hasMore":"false","status":"A","description":"Cigarette","majorGroupId":"50","code":"Cigarette"},{"update":"false","hasMore":"false","status":"A","description":"Food","majorGroupId":"47","code":"Food"},{"update":"false","hasMore":"false","status":"A","description":"Health Center","majorGroupId":"52","code":"Health Center"}],"failure":"false"}</p>
| javascript jquery | [3, 5] |
1,744,859 | 1,744,860 | how to send mp3 file to an android app from a website | <p>i was wondering how this can be coded -</p>
<ol>
<li>My android app has a link to my website which hosts mp3 files - ex: abc.com/xxx.mp3</li>
<li>my website gets the request from the app for xxx.mp3, and sends the mp3 file back </li>
<li>the app sort of downloads the mp3 file to its local storage, and then plays the mp3 file from within this app itself.</li>
</ol>
<p>both the app and the website are under my control, and hence i can program it as required using any framework or language.</p>
<p>my concern is how this communication can happen - how does the website know whom to send the requested mp3 file to? ( i do not want the app to play the mp3 in streaming mode). I am assuming php and javascript can be used to do this.</p>
| php javascript android | [2, 3, 4] |
4,279,532 | 4,279,533 | javascript/jquery code to obtain the form # of the form in which the user has selected some text | <p>I have a page with multiple forms within it.</p>
<p>What I want is, obtain the form #, (eg second form is form #2) in which the end user has selected some text</p>
<p>I will use the form # to do some further operations on that specific form, using jquery and i need form # to be passed as parameter to the jquery calls that I have to make.</p>
<p>Is there some way to obtain this using jquery or javascript?</p>
| javascript jquery | [3, 5] |
1,328,915 | 1,328,916 | object function loop override javascript? | <p>i'm very confused about the following code : </p>
<pre><code> var x =[ {name : 'name1' , value : 15 },{name :'name2' , value: 60} ];
var y = [[1,2,3] , [4,5,6]] ;
for(var t in y){
x[t].myFun = function(){console.log(y[t])} ;
}
console.log(x[0].myFun()) ;
</code></pre>
<p>shouldn't this code return the first array in <code>y</code> why does it return the second array ?</p>
<p>here is a <a href="http://jsfiddle.net/minagabriel/y6yxZ/" rel="nofollow">jsFiddle</a></p>
| javascript jquery | [3, 5] |
2,031,246 | 2,031,247 | how can I call javascript function from another project in same solution? | <p>I have a asp.net webforms 3.5 solution with multiple projects. In one of the (web) projects I have a script folder containing javascript files. In my aspxpage in project A I would like to call a js function residing in a js file called MyScript.js which sits in project B?</p>
| javascript asp.net | [3, 9] |
695,097 | 695,098 | Cross-login and parsing user specific data | <p>I want to develop an application for a website which provides user specific information. These user specific information of course are just visible as long as you're logged-in. Json-interface and parser will be hosted on a different server and I'm wondering how to handle the login + maintain a session in order to parse the data. The loginscript of the website which I want to parse is using POST and puts a cookie with username + md5 password. </p>
<p>These are all information I can provide. Thanks in advance.</p>
| php android | [2, 4] |
1,937,249 | 1,937,250 | Help with JavaScript reading checkbox with [] | <p>i have written/modified a script to count checkboxes checked it works fine but i know need the checkbox name to read r1[] for my php scripts and now it doesn't work please help with java script...</p>
<p>THIS WORKS</p>
<pre><code><input name='r1' type='checkbox' value='' onClick='return GetSelectedItem2()' />
</code></pre>
<p>THIS DOES NOT WORK</p>
<pre><code><input name='r1[]' type='checkbox' value='' onClick='return GetSelectedItem2()' />
</code></pre>
<p>JAVASCRIPT</p>
<pre><code>function GetSelectedItem2() {
chosen = ""
numCheck = 0
len = document.f1.r1.length
for (i = 0; i < len; i++) {
if (document.f1.r1[i].checked) {
numCheck++
if (numCheck == 3) {
alert("Only pick two date")
document.f1;
return false;
}
}
}
}
</code></pre>
| php javascript | [2, 3] |
5,795,332 | 5,795,333 | How to solve the issue of postback through browsers reload button in Asp.Net | <p>I am working on a page in ASP.NET/C# where the user's information is saved to the database.<br>
There are many fields on the page and when the validations are done then the information is saved.</p>
<p>The submission of information is done using an ASP.NET button.<br>
The primary key of the table is generated in code itself, that is, every time it is increased by one. </p>
<p>I just faced an issue while reloading the page through the browser's reload button. I noticed that the same user information was submitted with the primary key value incremented by one.</p>
<p>So my question is how should I tackle this issue?<br>
Should I just clear values of all textboxes after successful submission of data so that it will validate and then the user has to fill the information again?</p>
<p>Please share your ideas as to how can I handle this.</p>
| c# asp.net | [0, 9] |
3,177,234 | 3,177,235 | Could someone give me an example of image uploader from URL? | <p>I am using this Image Upload and Cropping with PHP and Jquery: <a href="http://www.9lessons.info/2011/06/image-upload-and-cropping-with-php-and.html" rel="nofollow">9lessons.info</a> Maybe someone can give me please PHP script or link to script that allows me upload image from URL?</p>
| php jquery | [2, 5] |
3,877,555 | 3,877,556 | Is it possible to get clipboard data from a user with either PHP or JavaScript? | <p>Essentially, if a user visits the page, and they press <code>ctrl+v</code>, the image that is currently in their clipboard is pasted. Is this possible? I've been googling around for solutions and couldn't really find anything substantial. </p>
<p><a href="http://www.tinymce.com/tryit/imagemanager/integrated_with_tinymce.php" rel="nofollow">http://www.tinymce.com/tryit/imagemanager/integrated_with_tinymce.php</a> </p>
<p>There's an example. Find any image and put it into your clipboard and it will paste it.</p>
| php javascript | [2, 3] |
215,678 | 215,679 | How to add a class to a list item using jQuery | <p>I have a vertical list where I am storing the current selected items index in a PHP session variable.</p>
<p>Now, when I come back to the same page, I want to apply a CSS Class to that particular list item.</p>
<p>Not sure how to set the class of a particular index in a list using jQuery.</p>
<p>I am doing something like this:</p>
<pre><code>$('ul.selectable1 li').get(3).addClass('myselection');
</code></pre>
<p>The UL >li list has a class attached to it called "selectable1:</p>
<pre><code><ul id="items" class="selectable1">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
</code></pre>
<p>So if the Item-3 was stored in my session. I would like to make the list appear like this:</p>
<pre><code><ul id="items" class="selectable1">
<li>Item 1</li>
<li>Item 2</li>
<li class="myselection">Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
</code></pre>
| php javascript | [2, 3] |
500,221 | 500,222 | How to make a Jquery event on the change of an object? | <p>I'm sure there is some really easy solution to this problem, at least it seems like there should be. But I haven't been able to find it...</p>
<p>I have an object (it's not part of the DOM) and its properties are periodically getting updated:</p>
<pre><code>var myobject;
//wait 10 seconds
myobject.property1 = "abc";
</code></pre>
<p>I want to trigger an action when this property gets changed (it's not just 1, but many different properties). How do I go about doing this in JQuery?</p>
| javascript jquery | [3, 5] |
1,695,086 | 1,695,087 | Catch iframe reload with jQuery | <p>I have an iframe loaded dynamically with jQuery like this</p>
<pre><code>jQuery('<iframe id="myFrame" src="iframesrc.php"></iframe>').load(function(){
// do stuff when loaded
}).prependTo("#myDiv");
</code></pre>
<p>And I want to catch the reload event every time the inner frame is reloaded. I tried this:</p>
<pre><code>jQuery('body').on('load', '#myDiv', function() {
alert('iframe loaded');
});
</code></pre>
<p>But I'm not getting any response, both on the initial load and when following links inside the iframe. What am I doing wrong?</p>
| javascript jquery | [3, 5] |
5,129,711 | 5,129,712 | Javascript construction: variable *is set* but must be *null* | <p>Problem is: context variable <em>_curIndex</em> is set when there is first call of switchTo (<em>at point a</em>):</p>
<pre><code>function ShowSwitcherObject( id, switchIds )
{
this._id = id;
this._isInited = false;
this.isInited = function()
{
return this._isInited;
};
this._visible = false;
this.show = function()
{
if( this._visible == false )
{
$( '#' + this._id ).show();
this._visible = true;
this._isInited = true;
}
};
this._showSwitch = function()
{
$( '#' + this._switchIds[ this._curIndex ] ).show();
};
this._hideSwitch = function()
{
$( '#' + this._switchIds[ this._curIndex ] ).hide();
};
this.switchTo = function( index )
{
if( index != this._curIndex ) // point a
{
if( this._curIndex != null )
{
this._hideSwitch();
}
this._curIndex = index; // point b
this._showSwitch();
}
};
this._switchIds = switchIds;
return this;
}
</code></pre>
<p>It's interesting that if we comment <em>point b</em> the variable is <em>null</em> at point a.
There are no external sets of <em>_curIndex</em>. It could be only set by <em>switchTo</em>. Is it firefox bug or something else?</p>
| javascript jquery | [3, 5] |
1,988,767 | 1,988,768 | Insert element between index x, y | <p>I try to insert list item between list elements:</p>
<pre><code>$('#deals-providers dt').each(function(index) {
if (index == 10) {
$(this).insertBefore($('<dt/>').text('More item'));
}
});
</code></pre>
<p>but it doesn't work. How can I do this?</p>
| javascript jquery | [3, 5] |
4,635,829 | 4,635,830 | What is the Android equivalent of iPhone's NSCalendar? | <p>What might be the Android equivalent of the following iPhone code?</p>
<pre><code>NSCalendar *calender = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];
int units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *components = [calender components:units fromDate:[NSDate date] toDate:destinationDate options:0];
</code></pre>
<p>I am trying to do a date countdown to show the number of years, months, days, hours, minutes and seconds in a consecutive manner, not show the years, months, days, hours, minutes and seconds as a whole.</p>
<p>I have this, but I cannot get the hours, minutes and seconds. When I play with the hours, I keep getting hours in the days, not hours left.</p>
<pre><code> SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = format.parse(myDate);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
long nat = Math.round(date.getTime() / 1000);
long totaldifference = Math.abs(d1-d2);
long date_diff = Math.round(totaldifference/(24*3600));
//year
double year2 = Math.floor(date_diff/365);
date_diff-=year2*365;
double month2 = Math.floor(date_diff/30.5);
date_diff-=month2*30.5;
long day2 = date_diff;
</code></pre>
| java iphone android | [1, 8, 4] |
5,539,363 | 5,539,364 | Static vs member field revisited, need advice | <p>I need an advice on piece of functionality that I am ought to implement. The scenario is that we haven an HttpHandler which servers to intercept file uploads. In the handler, I need to persist a large dictionary of strings inside the memory. The dictionary might be as large as 100 entries. I am wondering whether it is safe to store that in a static variable, so that it is not initialized every time instance of the handler is created (there will be a lot of instance for sure). In general, what is the approach in such scenarios. Is it a generally better idea to use static fields, to persist data that will not be changed?</p>
| c# asp.net | [0, 9] |
2,962,154 | 2,962,155 | Add multiple drop down lists to ASP.NET form on-the-fly | <p>I have an ASP.NET form with one drop-down list. I want to have a "+" sign next to the list to allow the user to add another drop-down to the form, and so on, up to a maximum of 15 drop-downs. Ideally, this will be handled client-side, but I would also be open to a solution that involved a form post back. What is the best approach? </p>
| javascript asp.net | [3, 9] |
3,437,752 | 3,437,753 | How to validate mobile phone number entered? | <pre><code>complete = (Button) findViewById(R.id.complete);
complete.setOnClickListener(new View.OnClickListener() {
String validNumber = "";
public void onClick(View v){
validNumber = phoneNumber.getText().toString();
if (!validNumber.equals("")){
final String phoneNumPattern = "^(?=.*[0-9]){10,11}$";
Pattern pattern = Pattern.compile(phoneNumPattern);
Matcher matcher = pattern.matcher(validNumber);
if (matcher.matches() == true){
Toast.makeText(PhoneNumActivity.this, "Success", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(PhoneNumActivity.this, "Failed", Toast.LENGTH_SHORT).show();
}
}
else{
Toast.makeText(PhoneNumActivity.this, "Failed", Toast.LENGTH_SHORT).show();
}
}
});
</code></pre>
<p>I am developing an security apps which user needs to enter a valid mobile phone number, I set the pattern above where user can only enter number with min 10 digit and max 11 digit. But it come out an error </p>
<blockquote>
<p>java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 13:</p>
</blockquote>
<p>And one more question, can I set the pattern so that the first two digits of the mobile number is <code>01xxxxxxxxxx</code>?</p>
| java android | [1, 4] |
3,235,645 | 3,235,646 | problem in jquery to when use portfolio this() statment | <p>hey, i have problem on my site.
semangart.com.</p>
<p>go to portfolio page.
when your pointer go one of my page is show effect fadeTo right,</p>
<p>now the problem begin:</p>
<ol>
<li><p>When your pointer move to first img then go to next img(do it with fast), the animation with repeatedly show, are have suggestion? to fix it.</p></li>
<li><p>My jquery Script is to long. n not dinamic, i wanted to this but i dont know how to write it. this is my script.</p></li>
</ol>
<hr>
<pre><code>//portfolio
//1
$(document).ready(function(){
$(".1p").mouseenter(function(){
$(".1pF").fadeTo("slow",1);
$(".1i").fadeTo("slow",0.3);
});
$(".1p").mouseleave(function(){
$(".1pF").fadeTo("slow",0);
$(".1i").fadeTo("slow",1);
});
});
//2
$(document).ready(function(){
$(".2p").mouseenter(function(){
$(".2pF").fadeTo("slow",1);
$(".2i").fadeTo("slow",0.3);
});
$(".2p").mouseleave(function(){
$(".2pF").fadeTo("slow",0);
$(".2i").fadeTo("slow",1);
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,611,836 | 4,611,837 | Populate .data() with $.getJSON() | <p>I am trying to populate <code>$('div').data()</code> through JSON. It works fine with <code>JQuery.parseJSON</code> but not with <code>$.getJSON</code>.</p>
<pre><code>// works as expected
$('div').data('dat', { xmin: '-10', xmax: 40 });
$('div').data('dat', jQuery.parseJSON('{"bbx" : {"xmin" : "-10", "xmax" : "40"}}'));
// doesnt work
$('div').data('dat', $.getJSON("init.php", function(json) {return(json);}));
</code></pre>
| javascript jquery | [3, 5] |
3,033,577 | 3,033,578 | What's the console.log() of java? | <p>I'm working on building an Android app and I'm wondering what the best approach is to debugging like that of console.log in javascript</p>
| java android | [1, 4] |
1,315,966 | 1,315,967 | How to programmatically set the ForeColor of a label to its default? | <p>I'm using VS2010 C# ASP.NET</p>
<p>To programmatically change the ForeColor of an asp:Label named <code>lblExample</code> to 'Red', I write this:</p>
<pre><code>lblExample.ForeColor = System.Drawing.Color.Red;
</code></pre>
<p>After changing the ForeColor, how do I programmatically set the ForeColor of the label to its default (that comes from the css file)?</p>
<p>Remark:
the label has no CSS entry (class or ID specific style). The color is inherited.</p>
| c# asp.net | [0, 9] |
1,957,516 | 1,957,517 | how to call a javascript function from my controller? | <p>Hi
I have a form in my view page on submit a function in a controller called <code>function Login()</code> is called
This is my Login function</p>
<pre><code>function Login()
{
$EmailId = $this->input->post('mailId');
$Password = $this->input->post('password');
$res=$this->friendsmodel->CheckLogin($EmailId,$Password);
if($res==true)
{
$_SESSION['Authenticaton_user']="auth_user";
$this->session->set_flashdata('item', 'Thanks for logging in');
//I want to call javascript function from here
redirect('friends/Display_News');
}
else
{
$this->session->set_flashdata('item', 'Username Or Password is invalid');
redirect('friends');
}
}
</code></pre>
<p>Now want to call a javascript function named <code>topBar()</code> from my if and else statement
This is my script</p>
<pre><code> function topbar(message)
{
var alert = $('<div id="alert">'+message+'</div>');
$(document.body).append(alert);
var $alert = $('#alert');
if ($alert.length) {
var alerttimer = window.setTimeout(function() {
$alert.trigger('click');
}, 5000);
$alert.animate({ height: $alert.css('line-height') || '50px' }, 200).click(function() {
window.clearTimeout(alerttimer);
$alert.animate({ height: '0' }, 200);
});
}
}
</code></pre>
<p>How to call a javascript from here</p>
| php javascript | [2, 3] |
2,967,054 | 2,967,055 | jQuery - text field value change after jquery auto complete select event | <p>Simple text field change after jquery auto complete select event. I want to split the data and display it in other text fields. I am trying this. This doesn't change any values at all. What do I need to change here? </p>
<pre><code>$(function() {
$("#term").autocomplete({
source: function (request, response) {
$.post("/users/search", request, response);
},
minLength: 2,
select: function(event, ui){
$('#div2').html(ui.item.value); #doesn't populate with new text.
document.getElementById('#found').value="test"; #for test
} #doesn't populate with new text.
#I want selected data to go here in the 'found' element id
});
});
</code></pre>
<p>Ruby/html - </p>
<pre><code><%= text_field_tag :found, nil, :maxlength => 11, :size => 20%>
<input id="found" maxlength="11" name="found" size="20" type="text" />
</code></pre>
| javascript jquery | [3, 5] |
5,729,400 | 5,729,401 | Create voice recognition app | <p>I need to develop an App witch detects voice when it´s running (not what are they saying, just if someone speaks) and if so, I need to launch an especific mp3 from my sd.</p>
<p>I never developed for android/iphone but I need to especify my boss in how many hours it could be done.</p>
<p>Is there any easy way for voice recognition? and... I think that the answear could be yes but, is ther a way to listen a specified mp3 from my code?</p>
<p>(no plataform specified yet, it could be android or iphone)</p>
<p>Thanks very much in advance</p>
| iphone android | [8, 4] |
3,105,046 | 3,105,047 | A good way to pass information javascript? | <p>I have an asp.net website, but I need to pass stuff to javascript to do stuff there. At the moment, I am doing things like this:</p>
<pre><code><script type="text/javascript">
var userHasMicrositePhoto = '<%=hasMicrositePhoto%>';
</script>
</code></pre>
<p>But I've been told that putting lots of script tags in like this is bad, and also its annoying to have to keep writing Properties in my code behind.</p>
<p>What is a better way to do this?</p>
| javascript asp.net | [3, 9] |
2,644,158 | 2,644,159 | How to check/uncheck checkboxes by clicking a hyperlink? | <p>I have 11 checkboxes with individual ids inside a modal popup.I want to have a hyperlink called SelectAll,by clicking on which every checkbox got checked.I want this to be done by javascript/jquery.</p>
<p>Please show me how to call the function</p>
| javascript jquery | [3, 5] |
1,111,927 | 1,111,928 | Getter and Setter return null in Android | <p>so I've been working on a project that receives data from server, for example sessionKey. I created getter and setter method like this :</p>
<pre><code>public class sEngine
{
private static String sessionKey;
public static String getSessionKey() {
return sessionKey;
}
public static void setSessionKey(
String sessionKey) {
sEngine.sessionKey = sessionKey;
}
}
</code></pre>
<p>Then I have activity A. In this activity A, I insert a value into the setter method.</p>
<pre><code>public class A extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
sEngine.setSessionKey("Hello world")
}
}
</code></pre>
<p>I also have activity B. In this activity B, I call the getter method</p>
<pre><code>public class B extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState) {
String sessionKey = sEngine.getSessionKey();
}
}
</code></pre>
<p>It occurs to me, that Android sometimes wipes all the data in order to free some memory, for example when I let the program idle for too long, or I used Advanced Task Killer. The problem is if those happen, I will get null in activity B when I call the getter method although I've set the value in activity A. Is there any way for me to maintain the value stored via the setter method (other than using SharedPreference) so the value will still be there although Android wipes the memories/data?</p>
| java android | [1, 4] |
3,106,499 | 3,106,500 | Getting Missing ) argument from below script any suggestions why? | <pre><code> <form name="formone" id="optionsform">
<fieldset>
<label><input type="radio" name="group1" id="ac-yes" value="1">Yes</label>
<label><input type="radio" name="group1" id="ac-no" value="0">No</label>
<label><input type="radio" name="group2" id="bt-yes" value="2">Yes</label>
<label><input type="radio" name="group2" id="bt-no" value="0">No</label>
<a href="varible-address">CONTINUE</a>
</fieldset>
</form>
<script>
$(function(){
var urls = new Array();
urls[0]='http://myurl1/';// no + no
urls[1]='http://myurl2/';// yes + no
urls[2]='http://myurl3/';// no + yes
urls[3]='http://myurl4/';// yes + yes
$('input[type=radio]').click(fonction(){
var score = 0;
$('input[type=radio]:checked').each(function(){score+=parseInt($(this).val()});
$('a').attr('href',urls[score]);
}
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
3,949,134 | 3,949,135 | JQgrid in asp.net | <p>I wanted to write a code for JQgrid in asp.net .I have tried the same in asp.net MVC,but i want it now in asp.net .
In MVC we use Helper class,and return json data,so what to do in asp.net where helper class can not be used.
Serialization can be done with data to get it in json.,but what about Htmlhelper.
Suggest me and guide me.</p>
| asp.net jquery | [9, 5] |
4,277,857 | 4,277,858 | combining a method to hide or show content | <p>I was wondering how I can combine a hide function and show function into 1 toggle Function that either fades in content or fades it out, im guessing this argument would update the fade method:</p>
<p>This is my current effort of JS using jQuery from my object but is totally wrong:</p>
<pre><code>toggleAlertOverlay: function (state) {
var instance = this;
if (state === hide) {
instance.selector.fadeOut();
}
elseif(state === show) {
instance.selector.fadeIn();
}
},
toggleAlertOverlay(hide);
</code></pre>
| javascript jquery | [3, 5] |
5,317,328 | 5,317,329 | ASP.Net get an error when trying to adjust css in code behind | <p>I have this code in my code behind:</p>
<pre><code>if (Request.QueryString["category"] == "9")
{
HtmlControl downloadableProducts = (HtmlControl)Page.FindControl("downloadableProducts");
downloadableProducts.Style.Add("display", "none");
}
</code></pre>
<p>It is generating the following error:</p>
<p>System.NullReferenceException: Object reference not set to an instance of an object. on line 43 which is the this <code>downloadableProducts.Style.Add("display", "none");</code></p>
<p>My div looks like this:</p>
<pre><code><div id="downloadableProducts" runat="server">
<a href="#">Downloadedable Products</a>
</div>
</code></pre>
<p>What am I doing wrong?</p>
<p>If I remove this line from my code behind:</p>
<pre><code>HtmlControl downloadableProducts = (HtmlControl)Page.FindControl("downloadableProducts");
</code></pre>
<p>I get this error:</p>
<p>The name 'downloadableProducts' does not exist in the current context</p>
| c# asp.net | [0, 9] |
3,748,387 | 3,748,388 | Show/Hide DIV on ASP.NET dropdown value change | <p>I have the following dropdown on my ASP.NET page:</p>
<pre><code><asp:DropDownList ID="selectAttending" runat="server">
<asp:ListItem Value="Select One...">Select One...</asp:ListItem>
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No">No</asp:ListItem>
</asp:DropDownList>
</code></pre>
<p>I also have the following script: </p>
<pre><code>$(function (){
$("#selectAttending").change(function () {
ToggleDropdown();
});
ToggleDropdown();
});
function ToggleDropdown(){
if ($("#selectAttending").val() == "No") {
$("#ifAttending").hide();
}
else{
$("#ifAttending").show();
}
};
</code></pre>
<p>The DIV tag I would like to show if they are attending is:
#ifAttending</p>
<p>Do I need to add an attribute to the dropdown to show/hide on change or is the code just wrong?</p>
| c# jquery asp.net | [0, 5, 9] |
326,915 | 326,916 | How can I access my PHP variables when calling ajax in jQuery? | <p>I am attempting to create a simple comment reply to posts on a forum using the AJAX function in jQuery. The code is as follows:</p>
<pre><code>$.ajax({type:"POST", url:"./pages/submit.php", data:"comment="+ textarea +"& thread="+ currentId, cache:false, timeout:10000,
success: function(msg) {
// Request has been successfully submitted
alert("Success " + msg);
},
error: function(msg) {
// An error occurred, do something about it
alert("Failed " + msg);
},
complete: function() {
// We're all done so do any cleaning up - turn off spinner animation etc.
// alert("Complete");
}
});
</code></pre>
<p>Inside the submit.php file I have this simple if->then:</p>
<pre><code> if(System::$LoggedIn == true)
{
echo "Yes";
} else {
echo "No";
}
</code></pre>
<p>This call works on all other pages I use on the site, but I cannot access any of my variables via the AJAX function. I've tested everything more than once and I can echo back whatever, but anytime I try to access my other PHP variables or functions I just get this error:</p>
<blockquote>
<p>Failed [object XMLHttpRequest]</p>
</blockquote>
<p>Why am I unable to access my other functions/variables? I must submit the data sent into a database inside submit.php using my already made $mySQL variable, for example. Again these functions/variables can be accessed anywhere else except when I call it using this AJAX function. After hours of Googling I'm just spent. Can anyone shed some light on this for me? Many thanks.</p>
| php javascript jquery | [2, 3, 5] |
4,497,480 | 4,497,481 | How to check a set of radio buttons that all are selected? | <p>I've a list of radio buttons that are generated dynamically. The names of radio buttons are also generated dynamically. The first row of radio buttons has name 1, the second row radio buttons have name 2. Each row has three radio buttons with same name but different values.</p>
<p>How can I check using jquery that one radio button is selected in each row when submitting the form?</p>
<pre><code><tr>
<th>1</th>
<td> Please select one option </td>
<td class='selectable_cell'>
<input type="radio" name="2" value="1" />
</td>
<td class='selectable_cell'>
<input type="radio" name="2" value="2" />
</td>
<td class='selectable_cell'>
<input type="radio" name="2" value="3" />
</td>
</tr>
<tr>
<th>2</th>
<td> Please select another option </td>
<td class='selectable_cell'>
<input type="radio" name="3" value="1" />
</td>
<td class='selectable_cell'>
<input type="radio" name="3" value="2" />
</td>
<td class='selectable_cell'>
<input type="radio" name="3" value="3" />
</td>
</tr>
</code></pre>
| javascript jquery | [3, 5] |
1,365,780 | 1,365,781 | How to create flyout effect using jQuery | <p>See: <a href="http://www.obout.com/flyout/flyout.aspx" rel="nofollow">http://www.obout.com/flyout/flyout.aspx</a></p>
<p>How to create a flyout effect similar to the one shown in the page linked to above using jQuery? </p>
| javascript jquery | [3, 5] |
3,859,449 | 3,859,450 | Android notification showing some weird date in a corner | <p>I'm not sure why when I'm showing notification there is some 1/4/70 date displaying in a top right corner? What is that? How do I get rid of it?</p>
<p>Code:</p>
<pre><code>public static void showNotification(int id, String message, String title, String body)
{
int drawable = 0;
switch (id)
{
case NOTIFICATION_NEW_MAIL:
drawable = R.drawable.ic_notify_mail;
break;
case NOTIFICATION_AVAILABLE_TRIPS:
drawable = R.drawable.ic_notify_trip;
break;
}
NotificationManager notifyManager = (NotificationManager)MyApplication.Me.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(drawable, message, SystemClock.elapsedRealtime() + 1000);
notification.defaults |= Notification.DEFAULT_SOUND;
Intent notificationIntent= new Intent(MyApplication.Me, MailListActivity.class);
switch (id)
{
case NOTIFICATION_NEW_MAIL:
notificationIntent = new Intent(MyApplication.Me, MailListActivity.class);
break;
case NOTIFICATION_AVAILABLE_TRIPS:
notificationIntent = new Intent(MyApplication.Me, TripListActivity.class);
break;
}
PendingIntent contentIntent = PendingIntent.getActivity(MyApplication.Me, 0, notificationIntent, 0);
notification.setLatestEventInfo(MyApplication.Me, title, body, contentIntent);
notifyManager.notify(id, notification);
}
</code></pre>
<p>Screenshot:</p>
<p><img src="http://i.stack.imgur.com/fw1rh.jpg" alt="enter image description here"></p>
| java android | [1, 4] |
550,703 | 550,704 | c# .net - Question about multiple Projects under same solution in Visual Studio 2010 | <p>I have project 1 and Project 2. If using File Upload feature in some Project1's code file I want to save the uploaded files in Project 2's folder. What should be the save path??
Like I gave the physical address as D://Project2/images/products/</p>
<p>but it says, I cant give physical path and that only virtual path will be accepted. What should be my saving path?</p>
<p>Please help me out. Thanks.</p>
<p><strong>@Peyman
how exactly wil I refer to this folder in my c# code?</strong></p>
<p><strong>@ Peyman
I tried your solution..its creating the Upload folder in c:/inetpub or something and giving this error when I am running upload code "C:\inetpub\wwwroot\Upload\images\products\Product1\"</strong></p>
| c# asp.net | [0, 9] |
1,806,841 | 1,806,842 | DataGrid - Preventing Concurrent Access To Rows | <p>I need to write a simple datagrid form which allows users to edit cells - The problem is that different people can edit this at EXACTLY the same time so concurrency becoames an issue</p>
<p>I am using data backed by a database</p>
<p>I seem to have two options here:</p>
<p>1) Continually poll the database and refresh data in the datagrid before allowing editing - This means that updates to the database need to take place just after editing rather then the preffered way of allowing edits, then letting users review and then commiting.</p>
<p>2) Allow dirty edits and then prevent users from commiting to the database the changes they want</p>
<p>Can anyone describe a mechansim which allows users to edit rows concurrently which would make the implementation easy??</p>
<p>EDIT : My question is how to implement this in C# - I have added lock columns but this is still not sufficent - If usera tries to edit row1 and commits changes userB tries to edit a stale version of row1 this will not get caught which is a BIG problem</p>
| c# java | [0, 1] |
5,240,072 | 5,240,073 | Javascript code to read java variable value | <ul>
<li>I have a session variable in java file.(TestConnection.java)</li>
</ul>
<blockquote>
<p>session.setAttribute("CONNECTION_DBNAME", dbName);</p>
</blockquote>
<ul>
<li>How to read CONNECTION_DBNAME value into javascript file.(utility.js)</li>
</ul>
| java javascript | [1, 3] |
1,958,992 | 1,958,993 | How cpu intensive is opening a socket | <p>So, I have an application that communicates with a server quite frequently. I have the Socket creation done in a singleton class, to ensure that the work to create it is only done once. However, this is an Android application, and I can never guarantee that the code that cleans up when the application is destroyed will be executed. Therefore, I am currently opening and closing the socket every time I use it. </p>
<p>I have no idea how cpu intensive this is though, can anyone shed some light? </p>
| java android | [1, 4] |
322,218 | 322,219 | C# assign const member with function | <p>in java its possible to do something like this</p>
<pre><code>class {
final int x = Random.randomInt();
final int y = Random.randomInt();
}
</code></pre>
<p>...</p>
<pre><code>switch (intVariable)
{
case x: break;
case y: break;
}
</code></pre>
<p>as long as generateInt is final, this compiles.</p>
<p>is there an equivalent in C#?</p>
<p>edit: you might ask why i dont use concrete values or enums, but i have my reasons why the values are be random. ;)</p>
| c# java | [0, 1] |
1,942,785 | 1,942,786 | Call C++ library from Java in Android | <p>Is it possible to call a C++ library from an Android app? If yes, how?</p>
<p>I have zero experience in Android programming (some Java programming experience though) but I would still like to know if this is possible. Given the number of great C++ libraries out there, I would be surprised if it were not possible to call a C++ library from an Android app.</p>
| java android c++ | [1, 4, 6] |
3,800,194 | 3,800,195 | DbProviderFactories.GetFactoryClasses() do not work when I uninstall odp.net | <p>I am using DbProviderFactories.GetFactoryClasses() method to check odp.net exists or not. It works perfectly fine when odp.net is not installed or when it is installed. But when I unistall odp.net 10g then also it shows odp.net provider exists. I have checked registry it doesn't show odp.net. Please suggest a better way to check if odp.net exists or not.</p>
| c# asp.net | [0, 9] |
857,440 | 857,441 | the selector in JavaScript | <p>I want to get the object of this code ,</p>
<pre><code><input class="radio"
id="conversation_sub_kind_id_208"
name="conversation[sub_kind_id]"
onclick="set_department_name('department_name208')"
type="radio"
value="208" />
</code></pre>
<p>I want to use jQuery Framework to get the object, like the <code>document.getElementbyTagName("conv...");</code> what should i do in here?
Thank you, and best regards!</p>
| javascript jquery | [3, 5] |
3,798,671 | 3,798,672 | RegisterStartupScript and order of execution | <p>I am using <code>ScriptManager.RegisterStartupScript</code> to register calls to a large number of JS functions.</p>
<pre><code>ScriptManager.RegisterStartupScript(this, this.GetType(), "Script1", "SomeScript1", true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "Script2", "SomeScript1", true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "EndScript", "EndScript", true);
</code></pre>
<p>When the HTML is rendered, it's adding them in order.</p>
<pre><code><script type="text/javascript">
//<![CDATA[
other functions calls..
SomeScript1();SomeScript2();EndScript();
//]]>
</script>
</code></pre>
<p>However, when I step through in debug mode, the execution of scripts are not in order (Ex: <code>EndScript</code> executes first before <code>SomeScript1</code> or <code>SomeScript2</code>)</p>
<p>Doesn't <code>ScriptManager.RegisterStartupScript</code> gaurantee execution in the order it was added? If not, what are the alternatives (I want to always execute <code>EndScript</code> in the end)</p>
| asp.net javascript | [9, 3] |
1,137,295 | 1,137,296 | Is anything else added to the original context except $ and jQuery using jQuery? | <p>As I know, $ and jQuery are added to the global context when we use jQuery. </p>
<p>Is anything else added, like document property or event?</p>
| javascript jquery | [3, 5] |
818,061 | 818,062 | Weird margin issue with relative layout | <p>I am trying to have a TextView to fill the space between a button on the left and the edge of the layout on the right.</p>
<pre><code><TextView
android:id="@+id/welcomeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/setInfusionReminder"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="Welcome!" />
</code></pre>
<p>What I am seeing in the editor however is <code>android:layout_marginRight</code> is applied on the left. The end result is 40dp margin on the left and 0 margin on the right.</p>
<p><img src="http://i.stack.imgur.com/IwbAr.png" alt="enter image description here"></p>
| java android | [1, 4] |
1,276,897 | 1,276,898 | Does Java have heap and stack? | <p><a href="http://courses.washington.edu/css342/zander/css332/arch.html" rel="nofollow">http://courses.washington.edu/css342/zander/css332/arch.html</a></p>
<p>bottom of the page:</p>
<blockquote>
<p>The C++ memory model differs from the Java memory model. In C++,
memory comes from two places, the run time stack and the memory heap.</p>
</blockquote>
<p>This reads as if Java doesnt have a heap (or stack)?</p>
<p>I am trying to learn all the "under the bonnet" details for Java and C++</p>
| java c++ | [1, 6] |
1,342,131 | 1,342,132 | What's the Java's float.floatToRawIntBits equivalent method in C#? | <p>What's the Java's float.floatToRawIntBits method implementation in C# ?</p>
| c# java | [0, 1] |
4,207,054 | 4,207,055 | fading in hidden text using jquery on click event? | <p>im trying to fade in the <code>.example</code> element which is hidden using:</p>
<pre><code>.example {
display: none;
}
</code></pre>
<p>the javascript:</p>
<pre><code>$('.clickme').click( function() {
.....
....
$el.html(html).children().hide().each(function(i, e){
if($(this).hasClass('special')){
$(this).delay(i*600).show(0);
animateDiv(e.id);
}
else{
$(this).delay(i*600).fadeIn(900); // the problem is here its not fading in
}
</code></pre>
<p>working example is here: <a href="http://jsfiddle.net/6czap/19/" rel="nofollow">http://jsfiddle.net/6czap/19/</a></p>
<p>i cnt seem to find out what the problem is, i have tried this without the click event, and it works.</p>
| javascript jquery | [3, 5] |
5,534,593 | 5,534,594 | Move li elements with certain class into and div | <p>I am trying to use the .append function in jquery.
I have a div with li elements in it. They have different classes, lets say odds and evens.
I would like the li's with the class "odd" moved into another div with li's in it.
How can I do this?
Here is my setup:
<strong>Edit</strong>. This was in valid markup, I just didn't put all in. Fixed now for others. </p>
<pre><code><div id="col1">
<ul>
<li class="odd"></li>
<li class="even"></li>
<li class="odd"></li>
<li class="even"></li></ul>
</div>
<div id="col2">
<ul>
<li></li>
</ul>
</div>
</code></pre>
<p><strong>So then the output is:</strong> </p>
<pre><code><div id="col1">
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
</div>
<div id="col2">
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
</div>
</code></pre>
| javascript jquery | [3, 5] |
1,473,603 | 1,473,604 | Gridview getting value of a BoundField set to Visible=False | <p>How can i get the value of a field that is set to Visible=false? as follows:</p>
<pre><code> <asp:BoundField DataField="ItemID" HeaderText="Line Item ID" Visible="false"/>
</code></pre>
<p>but when i try to get it with</p>
<pre><code> int temID = Convert.ToInt32(row.Cells[0].Text);
</code></pre>
<p>It cant find it and throws an exception, but if I make it Visible="true" it works.</p>
<p>How can I retrieve the value if visible = false?</p>
| c# asp.net | [0, 9] |
4,562,112 | 4,562,113 | Use Javascript/Jquery to to strip down a dynamic URL | <p>I have this function:</p>
<pre><code>popstate = function(url){
$('#ajaxloadcontent').load(url+"#ajaxloadcontent > *");
}
</code></pre>
<p>I need it to get the current page URL, lets just call that: "http://www.pearlsquirrel.com/index.php"</p>
<p>I then need to somehow use jquery and strip down the URL to just what is after "http://www.pearlsquirrel.com/" and be left with "index.php." Is there any kind of jquery or javascript function that would be able to help me do this?</p>
<p>Also, if it were to just get "http://www.pearlsquirrel.com," I would need the function also set the URL to a default index.php.</p>
| javascript jquery | [3, 5] |
1,212,708 | 1,212,709 | how to add options menu to listview in android? | <p>I am trying an option menu in a class that extends ListAcitivity. How do I add an option menu to this activity, so when I click on the option button an options menu appears at the bottom of the screen. </p>
<p>I searched online but most tutorials refer to this function onCreateOptionsMenu() which is part of Activity class and it does not seem to work in the subclass of ListActivity.</p>
| java android | [1, 4] |
2,889,685 | 2,889,686 | Accessing html controls within an #include html file, from server side c# | <p>Following code is an example, I just want to know if this can be done.</p>
<p>I have an test.aspx file with this server side include tag;</p>
<pre><code><!--#include file="listOfCountries.htm" -->
</code></pre>
<p>Within listOfCountries.htm, I have:</p>
<pre><code><html>
<div>
<select id="countryList" runat="server">
<option></option>
...
</select>
</div>
</html>
</code></pre>
<p>Now, Is there a way to access "countryList" in test.aspx.cs file ?</p>
<p>On another note, say I didn't have the #include "Countries.htm" in test.aspx, is it possible to access the controls within Countries.htm from test.aspx.cs ? (i.e. accessing an external html file controls in cs)</p>
| c# asp.net | [0, 9] |
4,039,467 | 4,039,468 | Wrong app config file? | <p>I have a class library that has a function with this code:</p>
<pre><code>this.apikey = ConfigurationManager.AppSettings["ApiKey"];
</code></pre>
<p>When I call this function in a console application, it says AppSettings has no keys. also it states the connection string is aspnet... whereas mine is sqlserver. So it is certainly not reading my library app config even though Im calling that in a library function.</p>
<p>Is this normal or am I doing something wrong?</p>
<p>I was hoping to avoid having to make and parse an xml and reinvent the wheel.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
4,976,694 | 4,976,695 | JS Simulate button click using hover for x seconds | <p>Hi I'm trying to simulate a button click in js with mouse hover.. For example I have a calculator component (set of buttons in a div) in the html. What I am trying to accomplish is when the user moves the mouse pointer over a button and stays there for at least 3 seconds, the button will be "clicked" and if stays there, there will be another delay (not necessarily 3 seconds, could be 2secs or 1sec) and it will be "clicked" again.</p>
<p>I already made the Calculator component complete with click and keypress event handlers but still without the mouse over input handler..</p>
<p>What I have for that though looks something like:</p>
<pre><code> Calculator.mouseoverListener = function(e, calculatorObject){
setTimeout(function(){
value = $(e.target).val();
calculatorObject.handleInput(value);
} , 2000);
}
</code></pre>
<p>But this works like:
(1) Mouse moves over a button (2)Regardless how long it hovers over the button, it will wait 2 secs and simulate the "click"..</p>
<p>Any hint with the approach that I could use? </p>
| javascript jquery | [3, 5] |
4,078,929 | 4,078,930 | Android: Reading wav file and displaying its values | <p>Hi i'm trying to read the data in a wav file so that i can plot it as a waveform. Following is the code that i have tried:</p>
<pre><code> try {
RandomAccessFile file = new RandomAccessFile(myFile,"r");
while(file.read()>-1){
byte b1 = (byte) file.read();
byte b2 = (byte) file.read();
Log.d(TAG,"DATA:"+ (double) (b2 << 8 | b1 & 0xFF) / 32767.0);
}
file.close();
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
</code></pre>
<p>My output is a value that ranges between -1 and +1 initially but later it gives only DATA:0 it seems like an infinite loop and there is a force close. According to me the loop should terminate when the end of file is reached. Can anyone pls suggest some terminating condition for the loop. Please Help.... Thanks is advance...</p>
| java android | [1, 4] |
5,100,907 | 5,100,908 | How do I create a Multidimensional Array in Javascript? | <p>My goal is to iterate over a table with an ID of ajaxResponse1 and store each COLUMN'S values in a separate array. Each of the entries in valuesArr will be a column containing an array of individual values.</p>
<p>I tried using new Array instead of new Object, but I still don't seem to be getting any output alerted to my screen. Should I be using some combination of .push to get each new column value into the appropriate array? Hope that's clear. Any ideas? Thanks!</p>
<pre><code>var valuesArr = new Object();
$('#ajaxResponse1 tr').each( function() {
var colNum = 0;
$('th, td', this).each( function() {
valuesArr[colNum] = valuesArr[colNum].push( $(this).html() );
colNum++;
});
});
alert(JSON.stringify(valuesArr));
</code></pre>
| javascript jquery | [3, 5] |
3,261,483 | 3,261,484 | Javascript / Jquery functions | <p>Not sure if I am being totally wrong here but I want to do something like this:</p>
<ol>
<li>Have an external js page (on an external server)</li>
<li>Include the page - OK that is easy etc...</li>
<li>Have a Jquery function on the external page - well actually many functions</li>
<li>Call those functions directly onto the page.</li>
</ol>
<p>All a bit like this:</p>
<p>External js page:</p>
<pre><code>$(document).ready(function() {
function testit() {
$('#test').load('page.php');
}
function testit_1() {
$('#test_1').load('page_1.php');
}
function testit_1() {
$('#test_2').load('page_2.php');
}
});
</code></pre>
<p>Then on the actual page just call:</p>
<pre><code><script type="script/javascript">
testit();
</script>
<div id="test"></div>
</code></pre>
<p>Am I wrong or should that not work?</p>
| javascript jquery | [3, 5] |
1,764,993 | 1,764,994 | DropDownList in my masterpage gets bind every time childpage loads - How can I avoid that binding? | <p>I have a DropDownList in Masterpage that I fill on Page_Load() event but when child page loads , this DropDownList is binding again because its in Page_Load() event and selected value in this list is lost. Is there any way I can avoid this repeated binding in Masterpage?</p>
<p>I'm passing the selected value from DropDownList through QueryString and showing items according that value in child page.</p>
<p>I'm writing code in C# in ASP.Net using visual studio 2011.</p>
<pre><code> if (!IsPostBack)
{
ViewState["id"] = null;
if (drpdwnCategory.Items.Count < 1)
{
fillDropList();
}
}
if (Request.QueryString["catId"] != null)
{
drpdwnCategory.SelectedIndex = _drpdwnCategory.Items.IndexOf(drpdwnCategory.Items.FindByValue(enrpt.getdecrept(Request.QueryString["catId"])));
}
</code></pre>
| c# asp.net | [0, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.