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,101,549
1,101,550
How to do in place editing using jquery/javascript
<p>Is there an in place editing plugin that will save the changes locally rather than send each update to the server?</p> <p>Edit: Suppose I have an html section as </p> <pre><code>&lt;div class="editable"&gt; &lt;p&gt; Name&lt;/p&gt; &lt;p&gt; Address&lt;/p&gt; &lt;/div&gt; </code></pre> <p>I am looking for a editor such that I can edit <strong>Name</strong> and <strong>Address</strong> when I click on them. However I don't want to send the updated values to the server immediately, rather I would like to have them locally and send it to the server at a later time. </p>
javascript jquery
[3, 5]
4,299,510
4,299,511
Android How to Zoom into Grid View or Gallary View
<p>I am currently developing my first android app. I need to be able to zoom into a gridview with 225 images. From what i have come across it is not possible to do horizontal scrolling with a GridView. It is possible to make Gallarys to be scrollable both vertical and horizontal. I have the ability to detect when a user wants to zoom but i am at a lost on how to zoom into one. What would be the best viewgroup to use and any advice on how to zoom would be greatly appreciated</p>
java android
[1, 4]
6,022,802
6,022,803
ASP.NET - Setting CssClass of a CheckBox
<p>The following code</p> <pre><code>((CheckBox)e.Row.FindControl("exportCb")).CssClass = "enabledExport"; </code></pre> <p>Creates html</p> <pre><code>&lt;span class="enabledExport"&gt;&lt;input id="_ctl0_ContentPlaceHolder1_gridviewName__ctl2_exportCb" type="checkbox" name="_ctl0:ContentPlaceHolder1:gridviewName:_ctl2:exportCb" /&gt;&lt;/span&gt; </code></pre> <p>For the asp.net gridview column</p> <pre><code>&lt;asp:TemplateField HeaderText="Export"&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox runat="server" ID="exportCb"/&gt; &lt;/ItemTemplate&gt; &lt;ItemStyle/&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>I need to use jquery</p> <pre><code>$('.enabledExport').toggle() </code></pre> <p>to check/uncheck (as a toggle) the checkboxes. Because the <code>CssClass</code> is marked on the <code>&lt;span&gt;</code> the code is going to try to toggle a <code>&lt;span&gt;</code> instead of the <code>&lt;input&gt;</code>. How can I fix this? </p> <p>I don't mind if the solution is on jquery or asp.net side as long as it works. I'd love it if the code just marked the input like its supposed to...</p>
jquery asp.net
[5, 9]
830,932
830,933
jquery clone only element's content
<p>It there a way in jquery to clone an element's content. Not the entire element, only the content(children). Something similar to what <code>.html()</code> is doing but I'm also interested in cloning the events attached to the content. I was looking at <code>.clone</code> but it seems that is cloning the entire element.</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,634,280
2,634,281
Two submit event handlers on a form. One must stop the other
<p>I have to event handlers attached to a form. The first one that fires should stop the other event if a condition is not met.</p> <p>The code below does not work, as both events will be triggered. Can you help me?</p> <p>Thanks!</p> <pre><code>//fires first $("#myform").submit(function(){ if (some validation) { alert("You need to make the form valid"); return false; } }); //fires second $("#myform").submit(function(){ //ajax stuff return false; }); </code></pre> <p>p.s. I have to this as the ajax stuff is in a plugin that is not changeable. I cannot avoid two event handlers</p>
javascript jquery
[3, 5]
842,576
842,577
ASP button Colors not shown in the Mobile?
<p>I am using ASP and MySQL in my project. I am trying to make Mobile Software works in WiFi. I have put MySQL in Server. And Asp.Net Deployment Package in System IIS. </p> <p>In that I have Created buttons in running time and gave colors to buttons. When I test it in System Browsers, Its perfectly Working. </p> <p>But in Mobile its not shows colors and perfect sized. I am very Confused. Mobile Model is NOKIA c3 - 01. Its connected to WiFi and I have tested in Mobile Browser.(Not Mini Opera).</p> <p>Browser Shows this Output. <img src="http://i.stack.imgur.com/GDGve.png" alt="enter image description here"></p> <p>And Mobile Browser not show the Button Colors and button sizes are different. panel Also missing,...</p> <p>Like below</p> <p><img src="http://i.stack.imgur.com/PaVqi.png" alt="enter image description here"></p> <p>Why this Happens? How to Solve this. Asp Coding are worked correctly.</p>
c# asp.net
[0, 9]
5,412,954
5,412,955
Retrieve size of background image after scaling with jQuery?
<p>I have the following simple code to get me the background-image dimensions, but it grabs the size of the original image, not the scaled one I have in my div. I want to get pixel dimensions after scaling, is there any way to do that?</p> <pre><code>var actualImage = new Image(); actualImage.src = $("#chBox").css('background-image').replace(/"/g, "").replace(/url\(|\)$/ig, ""); actualImage.onload = function () { width = this.width; height = this.height; } </code></pre> <p>EDIT:</p> <p>The CSS to scale the background-image:</p> <pre><code>#chBox { height:100%; width:100%; background-repeat:no-repeat; background-image: url(../content/frog/1.jpg); background-position: center; -webkit-background-size: contain; /*for webKit*/ -moz-background-size: contain; /*Mozilla*/ -o-background-size: contain; /*opera*/ background-size: contain; /*generic*/ } </code></pre>
javascript jquery
[3, 5]
5,965,535
5,965,536
iframe source problem with Safari
<p>I have a problem with Safari</p> <p>Whenever the source of the iframe changes the new source is not displayed it instead shown as a download file.</p> <p>Here is a sample of the code:</p> <pre><code>&lt;?php echo "&lt;iframe id='myframe' width='600' height='200' src='image3.php?id=$content' style='margin-left:25; background-color:#ffffff'&gt;&lt;/iframe&gt;";?&gt; </code></pre> <p>and in JS:</p> <pre><code>function refreshConsole() { var url = "image3.php?id=&lt;?php echo $content; ?&gt;"; document.getElementById("myframe").src=url; setInterval("refreshConsole()", 15000); } $(document).ready(function() { refreshConsole(); }); </code></pre> <p>It works fine with FireFox and Chrome but not in Safari.Is the problem with code or with the browser</p> <p>Editted:</p> <p>Here is image3 file</p> <pre><code>&lt;?php require("db.php"); db_connect(); $id=addslashes($_REQUEST['id']); $image3=mysql_query("select * from image where id=$id"); $image2=mysql_fetch_array($image3); $content2=$image2['image']; header('Content-type: image/jpg'); echo $content2; ?&gt; </code></pre>
php javascript
[2, 3]
828,052
828,053
invoke javascript function on tabindex change
<p>I want have link on click of that link a javascript function is called. Now i want to invoke that function using tab key. so when the focus goes to the link using tab key, the javascript function should be called.</p> <p>How to implement this?</p>
javascript asp.net
[3, 9]
2,529,356
2,529,357
How do I border an image by selecting a part of the title?
<p>hope you can help me solving my problem.</p> <p>These two images are linked somewhere on a site.</p> <pre><code>&lt;a href=&quot;?FRUIT=banana&gt;&lt;img height=&quot;40&quot; src=&quot;../../banana.jpg?format=raw&quot; title=&quot;Banana - yellow&quot;&gt;&lt;/a&gt; &lt;a href=&quot;?FRUIT=apple&gt;&lt;img height=&quot;40&quot; src=&quot;../../apple.jpg?format=raw&quot; title=&quot;Apple - green&quot;&gt;&lt;/a&gt;</code></pre> <p>I want to border them to start writing a function.</p> <p>As you can see the title of each image contains the fruit and a color which should be associated by hearing the fruit.</p> <p>I started creating an array.</p> <pre><code>var colors = ['yellow','green'];</code></pre> <p>Each element of the array should be bordered by 3px dotted green.</p> <pre><code>for(var i = 0;i &lt; colors.length;i++){ .css('border','3px dotted green'); }</code></pre> <p>But how do I get the title of the image containing the color to border it with 3px dotted green?</p> <p>Thank you in advance.</p>
javascript jquery
[3, 5]
1,270,041
1,270,042
how to disable asp.net menu with javascript
<p>I am using asp menu.I want to disable it and enable it using javascript. Please help</p> <pre><code> &lt;asp:Menu ID="MainMenu" runat="server" Orientation="Horizontal" DataSourceID="HAPSMainMenu" MaximumDynamicDisplayLevels="3" DynamicEnableDefaultPopOutImage="true" StaticEnableDefaultPopOutImage="false" CssClass="mainMenu" DynamicVerticalOffset="1" DynamicHorizontalOffset="0" OnMenuItemDataBound ="mainMenu_DataBound" Height="18pt" Width="100%" &gt; &lt;StaticMenuItemStyle CssClass="menuItem" Width="125" /&gt; &lt;DynamicMenuStyle CssClass="subMenu" /&gt; &lt;DynamicMenuItemStyle CssClass="subMenuItem" Width="120pt" /&gt; &lt;DynamicHoverStyle CssClass="subMenuItemHover" /&gt; &lt;DynamicSelectedStyle CssClass="dynamicselectedStyle" /&gt; &lt;StaticHoverStyle CssClass="menuHover" ForeColor="midnightblue"/&gt; &lt;/asp:Menu&gt; </code></pre> <p>I want to disable the whole menu bar with Javascript and I have the menu Id by using firefox...I was hoping for a statement that would disable the whole menu.</p>
javascript asp.net
[3, 9]
5,819,447
5,819,448
Unable to retrieve value of the gridview column after making it invisible
<p>I have a gridview say gv1 . Which has 5 columns. I bind the gridview on the change of a dropdown selection. After binding I make the 4th(gv1.column[3]) and 5th(gv1.column[4])column visible false.</p> <pre><code>gv1.Columns[3].Visible = false; gv1.Columns[4].Visible = false; </code></pre> <p>I am unable to access the column value(these are id's) later. I tried making it visible before accessing still in vain.</p> <pre><code>{ gv1.Columns[3].Visible = True; gv1.Columns[4].Visible = True; int id = Convert.ToInt32(row.Cells[4].Text.ToString().Trim()); } </code></pre> <p>I get the error at 'id' "Input string was not in a correct format." I found ,All the column for each value is having null value.</p>
c# asp.net
[0, 9]
1,951,502
1,951,503
want to show place on google map when input lat,longitude value
<p>I want to show place on google map, when input latitude , longitude value. I want to write that with C#. If anyone has sample, please share me.. thanks in advance...</p>
c# asp.net
[0, 9]
2,289,122
2,289,123
Browse dialog for custom server control
<p>I have created a custom server control that inherits from Hyperlink. The output html after control is rendered is a nice looking css button with an icon. For the icon I have a string property.</p> <p>What i would like to do is on the source code to open "browse file dialog" for the icon similar to NavigateUrl property dialog see screen below </p> <p><img src="http://i.stack.imgur.com/XKlOo.png" alt="enter image description here"></p> <p>How this can be done? </p>
c# asp.net
[0, 9]
366,899
366,900
jQuery remove an object and replace in same spot
<p>How would I go about removing an object say from an unordered list and add it to another list while keeping its location? I know i can set the original item to hide() but then that leaves a small space where the item use to appear. Say i have a list A and B, if a user clicks on an item in A it needs to be added to B and removed from A. If they now click on a button to remove it from B and back to A, i want to have it displayed in the same spot it originally did. I know i can add it via append() but that won't put it in the same location. Thoughts anyone?</p>
javascript jquery
[3, 5]
538,948
538,949
Access phonebook from android to c# desktop application
<p>Can any one help me to create a .net c# desktop application that can get details of phone book from android phone. I want to just access phonebook details.</p>
c# android
[0, 4]
4,483,473
4,483,474
Dialog Box is not close after i update the button in dialogbox
<p>i am trying to close the dialog box automatically after i update the button in dialogbox, but it will not close automatically, is there any proper solution to resolve this issue? this is my code.</p> <pre><code>&lt;script&gt; jQuery(function () { var jQuerydialog = jQuery("#view_dialog").dialog({ autoOpen: false, title: 'Schedule', height: 200, width: 350, resizable: true, modal: true, }); jQuery(".view_dialog").click(function () { jQuerydialog.load(jQuery(this).attr('href'), function () { jQuerydialog.dialog('open'); }); return false; }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
637,373
637,374
Cast Long[] to long[]
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/564392/converting-an-array-of-objects-to-an-array-of-their-primitive-types">Converting an array of objects to an array of their primitive types</a> </p> </blockquote> <p>I making a <code>Parcel</code> for Android and I'm trying to package an <code>ArrayList&lt;Long&gt;</code> (toArray gives me <code>Long[]</code>) by converting it to <code>long[]</code>, is there a simple way to do this? </p> <p>I realize I can loop through but I guess I'm looking for a more elegant solution.</p>
java android
[1, 4]
5,777,678
5,777,679
Don't show if it is empty, how to do with Javascript or jQuery
<p>I am very new to Javascript and jQuery. I managed to make a dialog box with jQuery, it is giving a warning before submitting. </p> <p>The problem is I don't want to show the label and field on the warning page if it is empty. I can't do this with PHP because form is not submitted. I need to do with jQuery or Javascript.</p> <pre><code>&lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/thickbox-compressed.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ // jQuery UI Dialog $('#dialog').dialog({ autoOpen: false, width: 400, modal: true, resizable: false, buttons: { "Submit Form": function() { document.testconfirmJQ.submit(); }, "Cancel": function() { $(this).dialog("close"); } } }); $('form#testconfirmJQ').submit(function(){ $("p#dialog-email").html($("input#emailJQ").val()); $('#dialog').dialog('open'); return false; }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="testconfirmJQ" name="testconfirmJQ" method="post"&gt; &lt;fieldset&gt; &lt;label for="email"&gt;E-mail:&lt;/label&gt; &lt;input id="emailJQ" type="text" name="emailJQ" value="" /&gt; &lt;input id="submitJQ" name="submitJQ" type="submit" value="Submit" /&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;div id="dialog"&gt; &lt;p&gt;E-mail&lt;/p&gt; &lt;p id="dialog-email"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
3,443,558
3,443,559
Drop down menu disappearing before I get to the links
<p>Take a look at the <strong>tour</strong> link in the menu on <a href="http://bethhaim.spin-demo.com/contact" rel="nofollow">this page</a>. When I hover over tour, it's supposed to show the menu and let me choose which of the sub menus I wish to click on but it's disappearing too fast.</p> <p>Here's the code of the menu:</p> <pre><code>$('.menu &gt; li &gt; a').filter(function(){ if( $(this).siblings('ul').length ){ return true; } }).hover(function(){ $(this).siblings('ul').fadeIn(150); },function(){ $(this).siblings('ul').fadeOut(150); } ); </code></pre> <p><br><br>Anyone know why this is happening?</p>
javascript jquery
[3, 5]
3,256,730
3,256,731
How to call setListAdapter for ListView contained in a Fragment
<p>All the examples I see of <code>ListView</code>'s tend to be either implementations of <code>ListActivity</code> or <code>ListFragment</code>, where <code>setListAdapter()</code> is called in the <code>onCreate()</code> event.</p> <p>However, I want to have a <code>ListView</code> contained within another <code>Fragment</code>, I don't want to have the <code>ListView</code> as the <code>Fragment</code> itself...if you know what I mean.</p> <p>I want to know if I have xml for my <code>Fragment</code> like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff" android:textSize="40sp" &gt; &lt;ListView android:id="@+id/left_menu" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;/ListView&gt; &lt;/LinearLayout&gt; </code></pre> <p>How do you call <code>setListAdapter</code> for the list view in the fragment class? I have seen an example where a <code>ListView</code> is contained in an <code>Activity</code> and you call <code>findViewById()</code> to get the <code>ListView</code> object and then call <code>setListAdapter()</code>.</p> <p>However, the <code>Fragment</code> class doesn't have the <code>findViewById</code> method so how do you get a reference to the <code>ListView</code> object?</p>
java android
[1, 4]
4,173,158
4,173,159
Object required?
<pre><code>$(document).ready(function(){ function openEditor(){ $("#editor").show().animate({width: 965, height: 380}, 1500); $("#editor textarea").show(); } function closeEditor(){ $("#editor").animate({width: 985, height: 1}, 1500, function(){ $("#editor").hide(); $("#editor textarea").hide(); }); } function setedit(){ $.ajax({ type: "POST", url: "engine.php", data: "title="+ $('#editorTitle').attr('value') +"&amp;text="+ $('#editorText').html(), beforeSend: function(){ $('#mainField').html('&lt;img src="data/images/loader.gif" alt="Loading..."&gt;'); }, success: function(msg){ alert(msg); closeEditor(); search(); } }); } function search(){ // Row 138 $('#editorTitle').val($('#search').val()); $('#mainField').html('&lt;img src="data/images/loader.gif" alt="Loading..."&gt;'); $.get('engine.php?search='+ $('#search').val() , function(data) { $('#mainField').html(data); }); $.get('engine.php?raw=true&amp;search='+ $('#search').val() , function(data2) { $('#editorText').html(data2); }); $.get('engine.php?title=true&amp;search='+ $('#search').val() , function(data2) { $('#h1').html(data2); // Row 152 $('#editorTitle').html(data2); }); } $("#ready").html('Document ready at '+ event.timeStamp); // Row 157 }); </code></pre> <p>Hello,</p> <p>At row 138 and row 157 i get some strange error that an object (?) is required? I've been working on it all day and it still isn't working...</p> <p>Help! Please!</p> <p>Greetings!</p>
javascript jquery
[3, 5]
4,782,155
4,782,156
Calling a java script function with php on click
<p>Ok so i have paid a coder to code me a walk around map script were users can press up and down on the keyboard and walk aroud a map using jquery. But now im trying to make it so i have a up and down image and then on click it will call the up and down function. So the suer can use the up and down keys plus clicking the images. </p> <p>Here is the up function im using for when the user presses the up key on the keyboard. But now some how i need to call the same function when a image is clicked..</p> <pre><code>function move(d) { if(d == "UP") { var top = (parseInt(document.getElementById('move').style.top) - 10); var left = parseInt(document.getElementById('move').style.left); if(canMove(new xy(left,top))) { document.getElementById('move').style.top = (parseInt(document.getElementById('move').style.top) - 10) + 'px'; document.player.src = "maps/sprites/playerUp.png"; //if(lastStep != "UP") clearTimeouts(); //setTimeout('document.player.src="playerUp.png"', 500); //lastStep = "UP"; reloadF(); } } </code></pre> <p>How would i do about doing that ??</p> <p>Im guessing i just need to call function move(d) and set it to up some how ?? On click of image ?</p>
php javascript
[2, 3]
5,180,339
5,180,340
Create new window using jquery
<p>I'm working on a little project in JavaScript/jQuery. </p> <p>In order to display results from a calculation done in javascript, I'd like to open a new window with some predefined content and modify this content in order to display the results: Im using code like this:</p> <pre><code>var resultwindow = window.open('result.html') var doc = $('body', resultwindow.document); doc.append("&lt;p&gt;Result&lt;/p&gt;") </code></pre> <p>This is not working since the result document is not yet loaded when I append the content, so it is overwritten with the contents of 'result.html'.</p> <p>I also tried</p> <pre><code>$(resultwindow.document).ready(function() { // ... Fill result document here }) </code></pre> <p>and</p> <pre><code>$(resultwindow.document).load(function() { // ... Fill result document here }) </code></pre> <p>but <code>ready()</code> works only on the current document (it is called immediately, if the current document is already loaded), and <code>load</code> doesn't get called at all.</p> <p>Perhaps someone can point me to the right direction. Thanks in advance!</p>
javascript jquery
[3, 5]
726,666
726,667
Capture printStackTrace() output in Android
<p>I'm debugging an existing library that was not coded explicitly for Android. It works, but contains lots of <code>ex.printStackTrace()</code> calls. In Android, these are not written to the logcat by default.</p> <p>My question is: without the possibility to modify the code, is it possible to somehow see the stack traces generated by <code>printStackTrace()</code> calls?</p>
java android
[1, 4]
1,512,718
1,512,719
static variables in asp.net/C#
<p>I'm using extensively static variables in my web application project. Now I have read from some articles that it is a global variable for the whole project and the data that is in the static variables can be shared or overwritten by other users (I mean it is not user specific or session specific).</p> <p>So is it general programming practice not to use static variables in the normal web application development?</p> <p>Are static variables not used at all just like GOTO statement/keyword meaning there are extensive restrictions to use them and preferably not used at all? Then in what cases do we use the static key word?</p> <p>Then i have this requirement that a particular variable has to be initialized only once in a particular webform.aspx.cs and the scope has to be restricted to only to that particular .aspx.cs and to that particular user who has logged in ? How do i meet this requirement ? If possible can any one illustrate this with code ?</p>
c# asp.net
[0, 9]
2,522,653
2,522,654
Can you filter an existing jquery object by context?
<p>I've got some elements cached in a jquery object. I now want to filter them by context. Can I do this or do I need to create another jquery object with my selector while also using the second context param?</p> <p>Here's an example:</p> <pre><code>var cached = $('.elements'); </code></pre> <p>later I want to filter this array by context without creating another selector. If I was to just create another selector to do what I want it would look like this:</p> <pre><code>//in event listener var parent = $(this).closest('.parent'); $('.elements', parent).removeClass('class'); </code></pre>
javascript jquery
[3, 5]
3,002,979
3,002,980
Can I change a asp control from image handler?
<p>I have an asp page with a button on it that uses an image handler to show a jpg. Can I disable a button on the page from the image handler base on what image is loaded. for example if c:/x.jpg is loaded, disable the button.</p> <p>Thanks Charles</p>
c# asp.net
[0, 9]
1,610,683
1,610,684
published asp.net web application pointing to local machine
<p>I have a published asp.net application. I sometimes run into a "Object reference not set to an instance of an object" Because it is pointing to my development machine(C:\Users\Dropbox\etc). I made sure that the build is on release before I release. I am not sure why it calling my dev machine. Below is the session Property I am trying to read from. Anything I need to do on my machine to fix this problem? Thank you for any help.</p> <pre><code> public static User User { get { User userLogin = null; object sessionVar = Session[USERLOGIN]; if (sessionVar != null) { userLogin = (User)sessionVar; } return userLogin; } set { Session[USERLOGIN] = value; } } </code></pre>
c# asp.net
[0, 9]
4,548,906
4,548,907
How to deal with errors in function nesting and calling functions within other functions
<p>Scenario:<br> I have to check for user input (a string) that shouldn't contain <code>&lt;.%?/</code> symbols and if it does I remove them. I have 20 different places where I've to check it, actually, 20 different pages with each 20 different controls.</p> <p>So I wrote a function like the following shortened example:</p> <pre><code>public string MyFunction (string userinput) { return userinput.replace("&lt;"," "); } </code></pre> <p>Now if I want to call this function from within another function and there's an error in this function's <code>try catch</code> block I want it to write an error to a <code>Label</code> on the main page, without interrupting the second function. Also i am thinking of implementing conditional statement function calls too. </p>
c# asp.net
[0, 9]
3,490,415
3,490,416
how to print part of rendered html page in javascript?
<p>javascript code window.print() can print the current html page. </p> <p>My question is: if I have a div in an html page(for example, a page rendered from ASP.NET MVC view), then I want to print the div only.</p> <p>Is there any JQuery Unobtrusive javascrpt or normal javascript to implement this request?</p> <p>Make it more clear. Suppose the rendered html page like:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head id="Head" runat="server"&gt; &lt;title&gt; &lt;asp:ContentPlaceHolder runat="server" ID="TitleContent" /&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="div1" class="div1"&gt;....&lt;/div&gt; &lt;div id="div2" class="div2"&gt;....&lt;/div&gt; &lt;div id="div3" class="div3"&gt;....&lt;/div&gt; &lt;div id="div4" class="div4"&gt;....&lt;/div&gt; &lt;div id="div4" class="div4"&gt;....&lt;/div&gt; &lt;p&gt; &lt;input id="btnSubmit" type="submit" value="Print" onclick="divPrint();" /&gt; &lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Then I want to click on the Print button only printing div3. </p>
javascript jquery
[3, 5]
4,377,204
4,377,205
IE 8 specific bug looking for ideas JavaScript
<p>Unfortunately I can't dump my code here currently as a majority of it is propitiatory based. However I am just looking for ideas on what could cause this issue in a specific version of IE. This code is tested and works in FF, Safari, Chrome, Opera, IE 7, IE 9, but does not and refuses to work in IE 8. And any fixes I attempt to apply will break it on all browsers.</p> <p>In IE 8 the error is "Expecting '}'" which I know what that should obviously mean. But myself and 3 others have crawled this code from line one all the way down looking for any broken brackets, parentises, or just bad syntax. And other than some miss useage of HTML (this project was handed down to me). I see no issues, as I said all other browsers treat this code fine with no errors as a result.</p> <p>Anyone have a guess at whats up with IE 8? cause I for one am stumped.</p>
javascript jquery
[3, 5]
4,619,983
4,619,984
I have a substring error on start index
<p>I keep getting this error in my app small snippet of how simple this code is suppose to work</p> <pre><code>String lang = "Language.en-US".ToString(); appPath.Text = lang.Substring(2, lang.Length);// </code></pre> <p>Error</p> <pre><code>System.ArgumentOutOfRangeException: Index and length must refer to a location within the string </code></pre> <p>i get an error each time i change the start index but if i set it to 0 it works but i can't change the start index to a higher number than zero is there anything i can download like an update to fix this Im sure it my system thats wrong im using .Net 4.0.</p>
c# asp.net
[0, 9]
3,268,467
3,268,468
How to show DialogFragment from within the onLoadFinished method of LoaderCallbacks
<p>I receive an exception when trying to show a DialogFragment from within the onLoadFinished method of a Fragment that implements the LoaderCallbacks interface. Basically I am using the LoaderCallbacks to get some data from a rest service and then on the onLoadFinished I am trying to show a custom DialogFragment that contains a ListVeiw to allow the user to make a selection. Everything works great except when I try to launch the dialog from within the onLoadFinished. How can I accomplish this..and is this the correct approach to the problem.</p> <p>Here is an example of what I am trying to do:</p> <pre><code>public class EventFragment extends Fragment implements LoaderCallbacks&lt;someresponse&gt; { @Override public void onLoadFinished(Loader&lt;someresponse&gt; arg0, someresponse data) { //an exception is generated when trying to launch a dialog fragment from //within the onLoadFinished FragmentManager manager = getFragmentManager(); ListViewDialogFragment dialog = ListViewDialogFragment.newInstance(data); dialog.show(manager, "event_list_dialog"); } } </code></pre> <p>Thanks!</p>
java android
[1, 4]
5,620,181
5,620,182
jquery hide li tag
<p>I've html like this. I want to only show first <code>li</code> tags and don't want to show span. How to do this with jquery?</p> <pre><code> &lt;div id="div1"&gt; &lt;ul class="class2"&gt; &lt;li class="class3"&gt;&lt;span class="sfBreadcrumbNodeSeparator"&gt;/&lt;/span&gt; &lt;/li&gt; &lt;li class="class3"&gt; &lt;/li&gt; &lt;li class="class3"&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,112,257
1,112,258
Problems when assigning values via JavaScript to Asp.net labels and then passing via C# session object
<p>I am assigning variables to asp labels via javascript with a simple innerHTML call</p> <p>example:<br/></p> <p><code>document.getElementById('labelName').innerHTML = parseFloat(var).toFixed(2);</code></p> <p><br/> It appears in the label fine, and I am able to continue to manipulate it via javascript.</p> <p>I then set it up so that that variable is put into a session object via C# codebehind buttonClick event. </p> <p>example:<br/></p> <pre><code>protected void btnConfirm_Click ( object sender, EventArgs e ) { Session["sessionName"] = labelName.Text; } </code></pre> <p><br/> The buttonConfirm_Click method fires it Response.Redirects to another page and populates asp labels with the session object via the c# codebehind page_load method.</p> <p>example:<br/></p> <blockquote> <p>lblResult.Text = Session["sessionName"].ToString();</p> </blockquote> <p><br/> When doing this, <strong>the label is empty, no errors or 'null'.</strong> I have tried to narrow down the issue by trying various things. When I assign the text explicitly in the c# code behind of the first page and the recieve and assign it to the label on the next page, it shows correctly.</p> <p>example:<br/></p> <pre><code>Page 1: Session["sessionName"].ToString() = "Test"; Page 2: lblResult.Test = Session["sessionResult"].ToString(); </code></pre> <p><br/> I have tried several other things, such as casting the variables in javascript and in the codebehind, and checking to make sure I had runat="server" within each applicable label.</p> <p>Anyways, is there something here I am missing? Is asp.net unable to detect the changes that javascript has made to the labels? Are there some incompatibility issues when using innerHTML or anything like this that maybe be causing such a thing to occur?</p> <p>Thanks in advance!</p>
c# javascript asp.net
[0, 3, 9]
2,950,273
2,950,274
How to Separate Image tag from Rss?
<p>In my <a href="http://expolinkfairs.com" rel="nofollow">website</a> , i am using 3rd party RSS for <a href="http://expolinkfairs.com/all_news.aspx" rel="nofollow">news</a> section.</p> <p>The Description tag mixed with html tag including image url and news.</p> <p>Now I have to separate news and image.</p> <p>Please suggest me reguler expression or method for this.</p> <p>please help me.</p> <p>Thanks in advance &amp; sorry poor english.</p>
c# asp.net
[0, 9]
5,812,042
5,812,043
How to prioritize two change events in select element
<p>I have two change events handler for one select elemet. Let's call the functions Func1 and Func2. When I initialize these handlers I do the Func1 and then Func2 but when the change event happens in select element the Func2 get called before Func1.</p> <p>Is there any way to prioritize this two functions. Just to let you know the initializations for each function is in different scripts.</p> <p>This is the layout of my code</p> <p>Script1:</p> <pre><code>$("select#myDropdownlist").change(function(){ $(this).parents('form:first').submit(); // form submit sends post request to update an object which is in session } </code></pre> <p>Script2:</p> <pre><code>$("select#myDropdownlist").change(function(){ Send an ajax request and return json result based on the changes happened to the object in script1 function } </code></pre> <p>Although I initialized these by sequence it doesn't call the function in order. Because it calls Func2 first the object is not updated yet so result is not correct, it will then call Func1 and object will be updated which is too late as the Func2 has already returned the result based on previous version of object.</p> <p>Please also note that Script1 is very generic and it's supposed to work for any form data entry page, where the Script2 is specific to a particular page and I want to do an extra thing once the select element is changed only in a page. This means I cannot call Func2 inside Func2.</p> <p>Any help would be highly appreciated</p> <p>Regards</p> <p>Behnam Divsalar</p>
javascript jquery
[3, 5]
3,786,734
3,786,735
Email date parser when right click on browser
<p>[EDIT] I rewrote the question to mention specifically the context menu. Thanks for the remark.</p> <p>I'm looking to create a date parser for email, so that in case of text selection and right click, there will be an option in the context menu to identify the selected text (say <code>7/6/2011 10:30 meeting with John</code>) and add to my calendar (I'm using Google's calendar).</p> <p>I was thinking of developing such a thing in Javascript, is there a way to hook up to the right-click context menu of the browser without the use of extensions? Or it's better to create desktop application that hooks up to the "copy" event? Is there a library for date parsing on Javascript or others?</p> <p>Thanks in advance.</p>
c# javascript
[0, 3]
1,462,749
1,462,750
Is it possible to use a VB master page to cover an entirely separate directory written in C#?
<p>I have a company website written in vb.net. There are 5 master pages.</p> <p>I recently began utilizing a forum application, also asp.net 4.0, but this one is written in C#. My forum directory is domain.com/knowledgebase/.</p> <p>Is there any possible way to take one of my vb.net master pages and somehow integrate into the /knowledgebase/ directory? Here's what's currently </p> <p>This is what's in the top of every page in my site:</p> <pre><code>&lt;%@ Page Title="USS Vision Inc." Language="VB" MasterPageFile="~/homepage.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" Debug="true" %&gt; </code></pre> <p>This is what's in my /knowledgebase/ directory:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" Inherits="YAF.ForumPageBase" culture="auto" uiculture="auto" %&gt; &lt;%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %&gt; &lt;script runat="server"&gt; </code></pre> <p>Is it somehow possible to use, for instance, homepage.master in the /knowledgebase/ directory? If so, how would I accomplish this? Thanks for any guidance anybody can offer!</p>
asp.net c#
[9, 0]
1,360,174
1,360,175
No launcher activity found!, yet I've specified one
<p>When I specify the .main class as the launcher, it crashes on launch. So I made a new activity called launch that will be used to open the .main class. When I specify .launch as the LAUNCHER, the console tells me that no launcher activity was found.</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.my.homework" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;application android:label="@string/app_name" android:theme="@style/AppTheme" android:allowBackup="true"&gt; &lt;activity android:name=".launch" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.LAUNCH" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".menu" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".list" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.LIST" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
java android
[1, 4]
5,573,040
5,573,041
handle error of javascript
<p>Following error is occurring in my web page on browser</p> <pre><code>script may be busy or not responding </code></pre> <p>I want to avoid it from occurring so how can i do it, </p> <p>please give me a solution about that</p>
javascript jquery
[3, 5]
4,944,379
4,944,380
How do you get a javascript function to only be running one instance at any one point?
<p>I have some code that I'd like to run on a page. My problem is that I don't want it to be run more than once at any one point. It can run multiple times, but just not while another instance of itself is running. I'm using jQuery and loading ajax content.</p> <p>I just need something that prevents users from clicking hundereds of times and building up the que and pinging my server heaps.</p> <p>Is this possible?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
3,250,774
3,250,775
Detect if input has focus
<p>One of my web app's page consists of a grid and a search box. I capture the keypress event to select through each of the grid's rows using the space bar. However, this creates a problem for when someone wants to look up a phrase in the search box.</p> <p>I know that jQuery has a <code>.focus</code> method to bind an event handler to an input or give focus to an element. But how do I get a boolean value to determine if the search input has focus or not?</p>
javascript jquery
[3, 5]
3,912,100
3,912,101
How to change content of div using jquery or js?
<p><strong>HTML</strong></p> <pre><code>&lt;a href="/home/" id="one"&gt;&lt;img src="images/img1.png"/&gt;&lt;/a&gt; </code></pre> <p><strong>JS</strong></p> <pre><code>&lt;script&gt; $(document).ready(function(){ $('#one'). }); &lt;/script&gt; </code></pre> <p>How to change anchor tag to <code>&lt;a href="/home/" id="one"&gt;&lt;img src="images/img2.png"/&gt;&lt;/a&gt;</code> ?</p>
javascript jquery
[3, 5]
4,812,658
4,812,659
How to add text above a marker on Google Maps?
<pre><code> try { JSONArray jArray = new JSONArray(result); for(int i=0;i&lt;jArray.length();i++) { JSONObject json_data = jArray.getJSONObject(i); //Retrieve data from db. lat &amp; long = double / name = String latMarker = json_data.getDouble("latitude"); lonMarker = json_data.getDouble("longitude"); nameMarker = json_data.getString("name"); List&lt;Overlay&gt; mapOverlays = mapView.getOverlays(); Drawable drawable = this.getResources().getDrawable(R.drawable.ic_launcher); CustomItemizedOverlay itemizedOverlay = new CustomItemizedOverlay(drawable, this); markers = new GeoPoint ( (int) (latMarker * 1E6), (int) (lonMarker * 1E6)); //Happens when a marker is clicked OverlayItem overlayitem = new OverlayItem(markers, "Tapped", "Name: " + nameMarker); itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedOverlay); } } catch(JSONException e) { Log.e("log_tag", "Error parsing data. " + e.toString()); } } </code></pre> <p>I made an android application and integrated Google Maps to it. I also added markers on places that are located around my city. And my problem is, I dont know how to add text above these markers. Can anyone help me, please?</p>
java android
[1, 4]
4,656,506
4,656,507
How to find a particular string in a paragraph in android?
<p>In my project the data is stored in html format along with image tag. For example the following data is stored in html format and it contains 2 to 3 images.</p> <p>Mother Teresa as she is commonly known, was born Agnes Gonxha Bojaxhiu. Although born on the 26 August 1910, she considered 27 August, the day she was baptized, to be her "true birthday". “By blood, I am Albanian. By citizenship, an Indian. By faith, I am a Catholic nun. As to my calling, I belong to the world. As to my heart, I belong entirely to the Heart of Jesus." <strong>img ----- src="image1.png" ----></strong> Mother Teresa founded the Missionaries of Charity, a Roman Catholic religious congregation, which in 2012 consisted of over 4,500 sisters and is active in 133 countries.<strong>img ----- src="image2.png" ----></strong>. She was the recipient of numerous honours including the 1979 Nobel Peace Prize. She refused the conventional ceremonial banquet given to laureates, and asked that the $192,000 funds be given to the poor in India. <strong>img ----- src="image3.png" ----></strong></p> <p><strong>Now from the above data I need to find how many images the paragraph has and need to get all the image names along with the extensions and should display them in android. Tried with splitting but did not work. Please help me regarding this.</strong></p> <p>Thanks in advance </p>
java android
[1, 4]
2,869,968
2,869,969
asp.net mvc C# displaying \
<p>how can i display \ by using c# in a textbox .</p>
c# asp.net
[0, 9]
2,341,302
2,341,303
Port of php str_word_count to c#
<p>I'm migrating a legacy PHP application to .net, and one of the requirements is that the URLs stay exactly as before. </p> <p>To generate friendly URLs the legacy application uses <a href="http://php.net/manual/en/function.str-word-count.php" rel="nofollow"><code>str_word_count</code></a>, I was wondering if there is a port of this function to C#?</p>
c# php
[0, 2]
3,977,334
3,977,335
Using split function in javascript want to split the url at the time of page load?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript">Get query string values in JavaScript</a> </p> </blockquote> <p>I have a URL like below</p> <pre><code> http://domain_name/?act=SiteVisit </code></pre> <p>I want to split this URL and want to take act value in one variable at the time of page load.</p> <pre><code>$('document').ready(function(){ var mail_link = window.location; var arrURL = mail_link.split('='); alert(arrURL[1]); return false; }); </code></pre> <p>I used the above code but its not working.But if I print and assign the variable which i get in alert message its working</p> <p>So tell me how to get the SiteVisit in a variable</p>
javascript jquery
[3, 5]
2,517,788
2,517,789
BadImageFormatException
<p>i was working with invoking C++ Dlls into C# and ran into a problem</p> <p>C++ function:</p> <pre><code> int _declspec(dllexport) CompressPacket(unsigned char *buff, int offset, int len); </code></pre> <p>C# function:</p> <pre><code> [DllImport("HuffCompress.dll")] private static extern unsafe int HuffCompress(ref byte[] buff, int offset, int len); ... private unsafe byte[] CompressPacket(byte[] packet) { int len = HuffCompress(ref packet, 12, packet.Length-12); byte[] compressed = new byte[len]; for (int i = 0; i &lt; len; i++) compressed[i] = packet[i]; return compressed; } </code></pre> <p>when</p> <p><code>int len = HuffCompress(ref packet, 12, packet.Length-12);</code></p> <p>is run, i get a BadImageFormatException</p> <p>As the C# editor is the VSC# Express, it doesn't compile 64 bit programs, so i'm unsure to the problem Any ideas would be great</p>
c# c++
[0, 6]
5,931,461
5,931,462
auto Focus (Hit Enter) Javascript function is working good in IE7 but not working in IE8
<p>I used a javascript FocusChange() in my aspx page. I have couple of controls and I need Hit enter key need to move next control based on tab index. It is working good in IE7 but not working in IE8... Please help me on this..</p> <p>Thanks for your help in advance. The java script is given below.</p> <pre><code>function FocusChange() { if (window.event.keyCode == 13) { var formLength = document.form1.length; // Get number of elements in the form var src = window.event.srcElement; // Gets the field having focus var currentTabIndex = src.getAttribute('tabindex'); // Gets its tabindex // scroll through all form elements and set focus in field having next tabindex for (var i = 0; i &lt; formLength; i++) { if (document.form1.elements[i].getAttribute('tabindex') == currentTabIndex + 1) { for (var j = i; j &lt;= formLength; j++) { if (document.form1.elements[j].disabled == false) { document.form1.elements[j].focus(); event.returnValue = false; event.cancel = true; return; } } } } } } </code></pre>
asp.net javascript
[9, 3]
2,253,670
2,253,671
how do I iterate over the results of a jquery selector
<p>When I'm trying to store all <code>&lt;a&gt;</code> elements as objects in array (using <code>$('a')</code>), and then get the position of each of them, it doesn't work. </p> <pre><code>years = $('a'); for(i=0;i&lt; years.length;i++){ if(years[i].position().top &gt; year.position().top){ } else{ } } </code></pre> <p>Console says:</p> <blockquote> <p>Uncaught TypeError: Object file:///Users/.../index.html# has no method 'position'</p> </blockquote> <p>When I do it with single element selected by class name instead of tag name, everything works fine.</p> <p>What am I doing wrong ?</p>
javascript jquery
[3, 5]
5,580,146
5,580,147
jQuery: setting checkbox values from array
<p>I am working on a script for setting checkboxes according to values stored in an array (part of a larger script for allowing the user to revert a form to its initial values). The code is basically this:</p> <pre><code>$("#myForm :checkbox[name='myName[]']").each(function(){ if($.inArray($(this).val(),initValues)!=-1){ $(this).prop("checked",true); } else { $(this).prop("checked",false); } }); </code></pre> <p>initValues contains the value attributes of the boxes that were initially checked.</p> <p>The script checks the first element in <code>$("#myForm :checkbox[name='myName[]']")</code> but subsequent elements all appear to be unchecked. Firebug shows that the <code>checked</code> attribute is being changed but the box itself is unchecked.</p> <p>I have tried verious permutations of <code>attr()</code> in place of <code>prop()</code> all with the same results, and the script behaves the same way in Firefox 11.0 and Chrome 18.0 on OS X.</p>
javascript jquery
[3, 5]
1,167,953
1,167,954
What is the equivalent to ASP.NET controls in PHP?
<p>I find it easy to put controls such as buttons, labels in a Wizard control which is inside a Panel control. I can easily control the visibilty of the Panel control. I would like to know how to accomplish the same thing in PHP. I mean is it as easy as ASP.NET to hide some elements like buttons or group of elements in PHP? </p>
php asp.net
[2, 9]
3,976,532
3,976,533
Vertical centre a div on a page
<p>I have a question. I want to align a div on the vertical centre off the browser viewport. I understand how to do this and have written some code myself. But there is one thing that does not work:</p> <pre><code>// fetch al info I need var windowHeight = $(window).height(); var pageTop = $(window).scrollTop(); var modalHeight = "98"; // Get the centre of the window var divTop = (windowHeight - modalHeight) / 2; // Add the scrollTop so the div will align in the middle of my current browser viewport var divTop = divTop + pageTop; var divTop = divTop + "px"; $('#modal_placeholder').css('top',divTop); </code></pre> <p>Now, the problem is that it will not get the correct scrollTop value ... it always says it's 0, like you are currently at the top of the page.</p> <p>Can you help me out??</p>
javascript jquery
[3, 5]
1,429,413
1,429,414
Javascript, load onclick at pageload, whats broken?
<p>I'm a dizzy designer. I can't can't see why this isn't working:</p> <pre><code> &lt;head&gt; &lt;script type="text/javascript"&gt; $().ready(function() { $('#test').trigger("click"); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a id="test" href="http://www.dartworks.net" &gt;click here&lt;/a&gt; &lt;/body&gt; </code></pre> <p>what am i doing wrong?</p>
javascript jquery
[3, 5]
863,094
863,095
Javascript storing value in key value form
<p>i want to store value like key and value pair in javascript </p> <p>So far i am doing like this </p> <pre><code>var list_of_addressbook_entries = {}; list_of_addressbook_entries.guest_name = name ; for(key in list_of_addressbook_entries) { alert("key " + key + " has value " + list_of_addressbook_entries[key]); } </code></pre> <p>In the above code guest_name is a variable which value is coming from a onclick<br> so when i am doing the above it showing me the result like </p> <pre><code> key guest_name has value M </code></pre> <p>it is not printing the value of guest_name </p> <p>i want the result like </p> <pre><code>key guest_name_variable value has key M </code></pre> <p>Please suggest me what to do here ?</p>
javascript jquery
[3, 5]
692,635
692,636
Checkbox onChange submit problem if checked
<p>The purpose is to have a checkbox, that if clicked, will send via post where I will update the db. The user can check back and forth to set or unset active status.</p> <p>This works perfectly:</p> <pre><code>&lt;form name='form".$value['id']."' action='./filter_edit.php' method='post'&gt;&lt;input type='checkbox' name='checkbox[".$value['id']."]' value='".$newActive."' onclick='document.form".$value['id'].".submit();' /&gt;&lt;/form&gt; </code></pre> <p>However, using the code above, the box never appears checked.</p> <p>With the below code, once the field is set to active where the box will be checked, clicking to uncheck the box does submit but sends no post variables.</p> <pre><code>&lt;form name='form".$value['id']."' action='./filter_edit.php' method='post'&gt;&lt;input type='checkbox' name='checkbox[".$value['id']."]' value='".$newActive."'"; if($value['active'] == 1) echo " checked='checked'"; echo" onclick='document.form".$value['id'].".submit();' /&gt;&lt;/form&gt; </code></pre>
php javascript
[2, 3]
853,044
853,045
easiest way to search a javascript object list with jQuery?
<p>What is the easiest way to search a javascript object list with jQuery?</p> <p>For example, I have the following js config block defined:</p> <pre><code>var ProgramExclusiveSections = { "Rows": [ { 'ProgramId': '3', 'RowId': 'trSpecialHeader'}, { 'ProgramId': '3', 'RowId': 'trSpecialRow1' }, { 'ProgramId': '3', 'RowId': 'trSpecialRow2' }, { 'ProgramId': '1', 'RowId': 'trOtherInfo' } ] } </code></pre> <p>The user has selected Program ID = 3 so I want to get only the "rows" that I have configured in this js config object for Program ID = 3. This will get me the javascript object list:</p> <pre><code>var rows = ProgramExclusiveSections.Rows </code></pre> <p>but then I need to filter this down to only where RowId = 3. What's the easiest way for me to do this with jquery?</p>
javascript jquery
[3, 5]
1,448,340
1,448,341
Android multiple labels
<p>I'm a new android programmer so pardon me for the basic question, I already found a valid answer but to be more efficient and use a better method I want to ask on the forum.</p> <p>I want to place about 30 labels on one page. These might contain about 1-2sentences, what is the most efficient way to scroll through these without making them clickable like a button. Its also better if I can make this in java, right? Because I could use an array to store the different sentences.</p> <p>Thanks, to all.</p>
java android
[1, 4]
2,022,328
2,022,329
Error : Could not find HelloAndroid.apk
<p>I am very new to Android development. I followed every steps from developer.com to install ADK. Now my issue is, when I tried to run HelloAndroid application, I get an error as I mentioned in the title. I hav JRE1.6 installed. Is tat enuf? Because I read tat ether jdk or jre is ok. I am clearly blank about the concept of this apk error. And I am using Eclipse Ganymede. Kindly give a solution for my issue. Thank You. :)</p>
java android
[1, 4]
2,671,930
2,671,931
Does Handler work between processes?
<p><strong>In RemoteService (separate process)</strong></p> <pre><code> catch (ConnectException c) { TweetViewActivity.h.sendEmptyMessage(0); } </code></pre> <p><strong>TweetViewActivity</strong></p> <pre><code> static public Handler h; class LooperThread extends Thread { public Handler mHandler; public void run() { Looper.prepare(); h = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { Log.e("TAG", "handleMessage"); return true; } }); Looper.loop(); } } </code></pre> <p>While does this code doestn't get control?</p> <pre><code>Log.e("TAG", "handleMessage"); </code></pre>
java android
[1, 4]
5,104,793
5,104,794
How to make PHP more Javatized (aka strongly typed, more robust)?
<p>I really love PHP because:<br> _ easy to develop web applications (you set up LAMP in 10 minutes and you are ready to go)<br> _ easy to learn<br> _ easy to deploy (you just need Apache with the PHP module) </p> <p>I really love Java because:<br> _ it is strongly typed</p> <p>I was amazed by developing with Java and Netbeans. Any time there was a type mismatch I was alerted by the IDE while developing and the IDE itself was suggesting the fix.</p> <p>I think <strong>strong typing is a bliss</strong>. That's true: PHP arrays that can contain anything speed up your development, but then you have to spend time finding bugs while with a little more work ahead you have the IDE that points out the problems for you. That makes me feel more confidence also during refactoring.</p> <p>So, my question is: is it possible to use types in PHP (including for the return value of a method)? Do you know of a project, a fork, anything that would allow me to do that?<br> It could be just a pre-parser that checks some comments before the actual PHP parser (i.e. <code>public function /*ConfBuilders[]*/ getConfBuilders(/*int*/ confId)</code>).<br> Please anything that would introduce a concept of type and, thus, in my opinion, would make a PHP application more robust and, eventually, quicker to implement (right now I think it is quicker to develop software in Java than in PHP, thanks to the IDE's help).</p> <p>Thanks,<br> Dan</p> <p>EDIT: This is the only thing I have found on the web:<br> <a href="http://cstruter.com/blog/44" rel="nofollow">http://cstruter.com/blog/44</a> but I don't like it, mainly because you can't declare the object properties in a standard way and for sure make the execution of the script slower. I would like a method that works offline, while developing...a sort of compilation.</p>
java php
[1, 2]
2,797,784
2,797,785
Missing query string paramets after submitting form via JQuery
<p>I want to submit a form whenever the selected value is changes, and add query string parameter. It can only submit, but the parameter is lost. For example, when submitted, I want to sumit the form to this url:</p> <p><a href="http://www.a.com/myblog?year=2012" rel="nofollow">http://www.a.com/myblog?year=2012</a></p> <p>But the url below is actually submitted, with parameter missing:</p> <p><a href="http://www.a.com/myblog" rel="nofollow">http://www.a.com/myblog</a></p> <p>It works if I change to submit to google.com.</p> <p>Any idea?</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $('#newsArchiveDropDown').change(function () { var selectValue = $(this).val(); var form = $('#newsArchiveForm'); form.attr('action', form.attr('action') + '?year=' + selectValue); form.submit(); }); }); &lt;/script&gt; &lt;form id="newsArchiveForm" method="GET" action="http://www.a.com/myblog" novalidate="novalidate"&gt; &lt;select id="newsArchiveDropDown" name=""&gt; &lt;option value="2012" class=""&gt;2012&lt;/option&gt; &lt;option value="2011" class=""&gt;2011&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre>
javascript jquery
[3, 5]
6,007,216
6,007,217
Run (remote) php script from (local) python script
<p>How do I make python (local) run php script <strong>on a remote server</strong>? </p> <p>I don't want to process its output with python script or anything, just execute it and meanwhile quit python (while php script will be already working and doing its job).</p> <p>edit: What I'm trying to achieve:</p> <ul> <li>python script connects to ftp server and uploads php script (I already have this part of code)</li> <li>it runs php script (that's part of code i'm asking about)</li> <li>python script continues to do something else</li> <li>python script quits (but probably php script still didn't finished its work so i don't want it to end when it'll exit python)</li> <li>python script quit, php script still continues its task</li> </ul> <p>(I <em>don't</em> plan to do anything with php output in python - python just has to upload php script and make it start working)</p> <p>Hope I'm more clear now. Sorry if my question wasn't specific enough.</p> <p>another edit: Also please note that I don't have shell access on remote server. I have only ftp and control panel (cpanel); trying to use ftp for it.</p>
php python
[2, 7]
2,945,107
2,945,108
Keep value of input which is generated by Javascript after submitting
<p>I have this code to append the input panel <code>#yearPanel</code> after the select box <code>#before</code> changed.</p> <pre><code>$("#before").change(function() { var selected = $('#before option:selected').text(); if(selected == bankShowYear) { $(yearPanel).insertAfter("#yearAnchor"); var value = $("#yearHiden").val(); $("#year").val(value); } else { $("#yearPanel").remove(); } }); </code></pre> <p>I want to keep the input value of <code>#year</code> in <code>#yearPanel</code> after submitting by PHP. I tried to store the value in <code>#yearHidden</code> and assign it to <code>#year</code> after all the input are rendered but it doesn't work.</p> <p>How to keep the input value?</p>
php jquery
[2, 5]
3,516,449
3,516,450
jQuery Confirm Before Submit
<pre><code>&lt;form action ="/submit-page/" method='post' class="editable"&gt; &lt;fieldset&gt; &lt;select name="status" id='status'&gt; &lt;option value="Submitted"&gt;Submitted&lt;/option&gt; &lt;option value="Canceled"&gt;Canceled&lt;/option&gt; &lt;option value="Application"&gt;Application&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" name="submit" value="SAVE"&gt; &lt;/form&gt; </code></pre> <p>I have a form above: When I click on the drop down value "Canceled" and hit the Save button I want to give alert box with a warning message with a Yes and No button. </p> <p>If the user cicks on Yes, take him to the submit-page as desired in the form action parameter. if the user clicks No, stay on the same form page without refreshing the page. Can this be done in jQuery?</p>
php javascript jquery
[2, 3, 5]
3,591,546
3,591,547
Standard way of prompting user to select folder to write a file to?
<p>My goal is to have a button that, when clicked, pops open a 'Select Folder' window. I'd like to work with the path they selected afterwards.</p> <p>I did a bit of reading around on this and I kept coming up with the FolderBrowserDialog class from Windows.Forms. Is this still the accepted means of capturing the path for ASP.NET AJAX? If so... will this work on non-windows computers?</p> <p>Thanks </p>
c# asp.net
[0, 9]
2,608,083
2,608,084
How to extend ListItem to be able to have childs inside BulletList
<p>Using asp.net C#. I have BulletList, and I would like to add ListItem that will render with childs. That is, inside every <code>&lt;li&gt;</code> I can add more controls to be rendered.</p> <p>How can I achieve that?</p> <p>thanks</p>
c# asp.net
[0, 9]
1,349,329
1,349,330
Disable access to pages after logout (Session.Abandon) in C#/ASP.NET
<p>I'm interested in disallowing the following after logout:</p> <p>-- no back button</p> <p>-- no direct access to pages via URL - for example: if the user logs out then they should not be allowed to see a cached page using some URL (e.g., replacing the URL with a valid URL in the site <a href="http://mysite.com/Gotothispage.aspx" rel="nofollow">http://mysite.com/Gotothispage.aspx</a>)</p> <p>I've seen similar questions like this one: <a href="http://stackoverflow.com/questions/589285/how-to-disable-back-button-in-browser-when-user-logout-in-asp-net-c">http://stackoverflow.com/questions/589285/how-to-disable-back-button-in-browser-when-user-logout-in-asp-net-c</a></p> <p>I know that I can set no cache on the master page, but then I lose the ability to use the back button when the user is actually logged in. Am I correct in this understanding?</p>
c# asp.net
[0, 9]
2,153,680
2,153,681
How can I create a file upload progress bar with PHP and jQuery?
<p>How can I create a file upload progress bar with PHP and jQuery? Please don't refer me to Flash stuff like Uploadify. I want to create my own.</p>
php jquery
[2, 5]
3,124,188
3,124,189
How to replace link with list element and then add new link in IE7/8 with jQuery?
<p>I can't control how the HTML is generated and need to put a string of links into a list and then add new links for each item.</p> <p>I have simplified the code at <a href="http://jsfiddle.net/jhASu/" rel="nofollow">http://jsfiddle.net/jhASu/</a> and it works in Chrome/Firefox and IE9 but not in IE 7 and 8 (no new links are generated). What could be the cause of this?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
522,666
522,667
Is there any library out there for c# that has the equivalent to "Unpack" in PHP and what is "Unpack"
<p>I just want to convert a piece of PHP code to C# so I need it's equivalent.</p> <p>And what does unpack really do? I'm very interested in this function.</p>
c# php
[0, 2]
3,621,686
3,621,687
jquery get id of table closest to key press
<p>I am creating tables on button click and that works great. I then have have a hotkey to add extra rows to those tables. I need to get the parent id of the table where the cursor is but it keeps giving me undefined. I can get the parent div id ok but when I put table in it gives me undefined. Any help would be appreciated</p> <pre><code>$(document).ready(function() { $("#divNarrative1").keypress(function(e){ alert(e.target.id); var msgId = $( this ).closest( 'table' ).attr( 'id' ); alert(msgId); }); }); </code></pre>
javascript jquery
[3, 5]
5,371,873
5,371,874
jQuery : Append text after an input field
<p>I have a simple input field :</p> <pre><code>&lt;input type="text" id="someid" name="somename" class="someclass"&gt; </code></pre> <p>I'm trying to append some link right after this; so i'll get : </p> <pre><code>&lt;input type="text" id="someid" name="somename" class="someclass"&gt; - &lt;a href="#"&gt;..&lt;/a&gt; </code></pre> <p>i tried : </p> <pre><code>$("input#someid.someclass").append(' - &lt;a href="#"&gt;Are you sure ?&lt;/a&gt;'); </code></pre> <p>Without success, must be stupid but i can't find out what's wrong.</p>
javascript jquery
[3, 5]
3,662,894
3,662,895
Javascript Variable outside of function?
<pre><code>1| &lt;script type="text/javascript"&gt; 2| function more() { 3| $("#innerSub2").animate({ scrollTop: "+=240px" },1000); 4| var count = 1; 5| document.getElementById("dot" +count).style.color="#c7c9e9"; 6| var count = count + 1; 7| document.getElementById("dot" +count).style.color="#6464c1"; 8| } 9| &lt;/script&gt; </code></pre> <p>Helo, I am pretty new to javascript. So sorry if this is a stupid question.<br> On the first click event the variable works as i need it to( line 5, count=1)(line 7, count=2)<br> But on second click event i need ( line 5, count=2)(line 7, count=3) but as you can see it resets to 1 with line 4.<br> So the question is, how can I declare | var count = 1; | outside of function more() so it won't reset my variable? or if there is any other way to do this..<br> Also if there is a way to stop variable count from exceeding 3, please share<br> Thank you</p>
javascript jquery
[3, 5]
4,504,098
4,504,099
How to set size of background image?
<p>I need some help to set the size on android Java source for a background image, here is the code on what i want to add: <code>setBackgroundResource(R.drawable.slider_bg_right);</code> is the line i have been added to add the background, but the image size is too small and I want to edit the size of the backgrounds.</p> <pre><code>switch (action) { case MotionEvent.ACTION_DOWN: { mTracking = true; mTriggered = false; vibrate(); if (leftHit) { mCurrentSlider = mLeftSlider; mOtherSlider = mRightSlider; mThreshold = isHorizontal() ? THRESHOLD : 1.0f - THRESHOLD; setGrabbedState(OnTriggerListener.LEFT_HANDLE); ----- setBackgroundResource(R.drawable.slider_bg_right); ------- } else { mCurrentSlider = mRightSlider; mOtherSlider = mLeftSlider; mThreshold = isHorizontal() ? 1.0f - THRESHOLD : THRESHOLD; setGrabbedState(OnTriggerListener.RIGHT_HANDLE); ------ setBackgroundResource(R.drawable.slider_bg_left); ------- } mCurrentSlider.setState(Slider.STATE_PRESSED); mCurrentSlider.showTarget(); mOtherSlider.hide(); break; } } </code></pre>
java android
[1, 4]
145,399
145,400
add server side table content to div of aspx page
<pre><code>//ASPX PAGE &lt;div id="nonPrintable"&gt; &lt;table width="98%" border="0" cellspacing="2" cellpadding="0" align="center"&gt; -- --&lt;/table&gt; &lt;/div&gt; &lt;br/&gt; &lt;div id="printReport" runat="server"&gt; &lt;/div&gt; </code></pre> <p>I am writng table from server side</p> <pre><code>Response.Write("&lt;table width='95%' border='0' cellpadding='0' cellspacing='0' align='center'&gt;"); Response.Write("&lt;tr class='tdcolbg'&gt;"); Response.Write("&lt;td&gt;");***SOME CONTENT*** Response.Write("&lt;/td&gt;"); Response.Write("&lt;/tr&gt;"); Response.Write("&lt;/table&gt;"); </code></pre> <p><strong>I have add server side table content to div printReport How can i add it.</strong></p>
c# asp.net
[0, 9]
1,884,864
1,884,865
Tab to beginning of text input
<p>I have a login form:</p> <pre><code>&lt;form&gt; &lt;div class="username"&gt; &lt;label for="username"&gt;Email&lt;/label&gt;&lt;br /&gt; &lt;input type="text" class="field" value="Enter your email" name="email" id="id_email"&gt; &lt;/div&gt; &lt;div class="password"&gt; &lt;label for="password"&gt;Password&lt;/label&gt;&lt;br /&gt; &lt;input type="password" class="field" name="password" id="id_password"&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>I want to make it such that when a user tabs from one field to another it sets the selection at the beginning of the field, instead of highlighting the entire field's text. An example can be seen on the login form here: <a href="https://squareup.com/" rel="nofollow">https://squareup.com/</a>.</p> <p>I have a function that sets the cursor at the beginning of the text input, <code>setCursorAtBeginning</code>, how would I accomplish the above using js or jQuery (preferable, if it can be done in it)?</p>
javascript jquery
[3, 5]
1,859,977
1,859,978
Transfer a byte[] via TCP Socket in android
<p>I need to transfer a byte[] via TCP Socket in android -client side.<br> i tried to use the following code :</p> <pre><code>public static int readBytes(byte[] myByteArray) throws IOException { InputStream in = socket.getInputStream(); DataInputStream dis = new DataInputStream(in); int len = dis.readInt(); //&lt;-here i get the error byte[] data = new byte[len]; if (len &gt; 0) { dis.readFully(data,0,len); } myByteArray=data; return data.length; } </code></pre> <p>but I get the following error:</p> <blockquote> <p>12-23 17:30:49.814: E/AndroidRuntime(11717): java.lang.OutOfMemoryError: array size too large(Heap Size=5699KB, Allocated=3403KB, Bitmap Size=78KB)</p> </blockquote>
java android
[1, 4]
4,762,333
4,762,334
Generics, ToArray etc
<p>We have a C# code base that we have to deploy on Java.</p> <p>We are creating a migration engine that reads C# and writes Java.</p> <p>We have created stub class for the classes from system that are used in our code, and are implementing them.</p> <p>When I came to do <code>List&lt;T&gt;</code> in Java, I ran into problems while implementing <code>ToArray</code>.</p> <p>For what I understand, because of the major deference between Java and C# in terms of generics, there is no way of knowing the type of the generic class, and thus no way of creating a typed array.</p> <p>Is this final, or any of you know of some clever way of doing <code>ToArray</code> in a generic class without passing an array or a type as a parameter here or in the constructor.</p>
c# java
[0, 1]
4,746,251
4,746,252
Send data from javascript to code behind at first load
<p>I am actually buidling a web application and I need to get data of the local environment of the machine viewing the application.To do this, I use a little javascript script such as:</p> <pre><code>&lt;script language="javascript"&gt; function GetUserName() { //Permits to get username of client machine var wshell = new ActiveXObject("WScript.Shell"); var arpege = wshell.ExpandEnvironmentStrings("%USERNAME%"); document.getElementById("arpege").value=arpege; } &lt;/script&gt; &lt;input type=hidden id="arpege" runat=server /&gt; </code></pre> <p>My problem is that this script is executed after the page is loaded and so I can't use it on the page load...</p> <p>My code on the page load is:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { myConnection.ConnectionString = ActionSource.ConnectionString; myConnection.Open(); String account = arpege.value; ... } </code></pre> <p>But i just get "" in account...</p> <p>Thanks for your help,</p> <p>Quentin</p>
c# javascript asp.net
[0, 3, 9]
2,648,478
2,648,479
jQuery plug-in to remap numeric keypad
<p>Is there a jQuery plug-in to remap the "dot" key in the numeric keypad? The purpose is to make it print a decimal separator, rather than a dot, in languages that use commas or other characters. I'd like to mimic the behaviour of some desktop applications like MS Excel.</p> <p>(It's okay to hard-code the output character.)</p>
javascript jquery
[3, 5]
17,297
17,298
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]
4,393,420
4,393,421
What is the most widely used feed-parsing library for Android
<p>I want to make an app which (amongst other things) can parse feeds loaded via the network. Given that the standard Anrdoid + Core Java libraries do not provide a feed parser service and I dont want to write a one myself, can you nominate a Java feed parser which will work on a low-spec Android device. </p> <p>I'm just starting out learning Android, having completed the Hello World examples I'd like to move onto my first app. I want to make something which prarses some ATOM or RSS feeds and displays some content in a GridView. </p> <p>The UI stuff seems to be very well documented in Android, and Sun have plenty of examples of how to retrieve a URL, however I'm not so how to do the feed parsing. </p> <p>Previously when I've done this sort of thing in Pythion I use a general purpose feed parser which can parse pretty much anything (e.g. RSS, ATOM). There are plenty of good Python implementations of this sort of thing, however I've not found anything like this as part of the standard Android library. </p> <p>At work I've done (light) maintenance on corporate java apps. The general practice seems to be to take whatever classes you like (e.g. the Jakarta Commons feed-parser) and simply bundle them into the CLASSPATH. Desktop apps do not care how big the dependancies are, however I'm sure that's a big issue when compiling an APK bundle for use on a device with limited meory. Surely I have to be very picky about what kind of Jars I depend on, right? Can I just go ahead and use the same classes that I'd use for desktop apps?</p> <p>Notes: </p> <ul> <li>My background is in Python (with only light Java experience) </li> <li>Ideally I'd like to use something popular (not neccecarily the best) so I can get support on it. </li> <li>Even better, I'd like to use built in library functionality so I dont have to add any 3rd party Jars to bloat my app.</li> <li>Currently targeting Android 1.5 (because that's what my device runs)</li> </ul>
java android
[1, 4]
1,964,175
1,964,176
Is there any unobtrusive way to hook into jQuery methods for triggers?
<p>I was wondering if there was any unobtrusive way to hook into methods such as attr, data, css, etc and call custom triggers?</p> <p>Ideally, I could do something like this:</p> <pre><code>$(".friend a").bind("attr.changed", changed /* data */, function(e) { alert("The " + changed.attribute + " attribute changed from " + changed.from + " to " + changed.to + "!"); }); $(".friend").append( $("&lt;a/&gt;"). attr("href", "#"). html("Friend 1"). click(function() { alert('I was clicked!'); }); // creates the element, doesn't execute since element didn't exist $(".friends a").each(function() { var $this = $(this); $this.attr("rel", "friend"); // triggers "attr.changed" }); </code></pre> <p>Ideally this would be able to be triggered on any element and pass the attr changed, from and to in an object to the trigger call from inside each jQuery method.</p>
javascript jquery
[3, 5]
934,127
934,128
How to open popup windows in background using javascript?
<p>Is it possible to open pop-up windows BEHIND the current active screen using java script?</p> <pre><code> var win= window.open(value,'_blank'); </code></pre> <p>the above script opens pop windows in browser tab but I loss active page from my sight.</p> <p>any suggestion?</p> <p>Thanks in advance</p> <p>Solution:</p> <p>As per <strong>@Brian</strong> advised,</p> <pre><code>var win=window.open(value,null,"height=400,width=600,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no"); win.blur(); </code></pre> <p>Its works in IE,FireFox and safari but <strong>not in Chrome browser</strong>. </p> <p><strong>Can any one suggest how to open multiple popup boxes in IE browser?</strong> The above script will open only one pop up in IE.</p>
javascript jquery
[3, 5]
5,009,432
5,009,433
how to use Local resource file in client side
<p>In my application I want to use a local resource file string on client side without any jquery and javascript etc.</p> <p>Currently I'm using code behind but would like to use in client side</p> <pre><code>awec.Text= Localization.GetString("ReqLodgeName.Text", LocalResourceFile); </code></pre> <p>like this. How do I use this resource file on client side for ASP control like</p> <pre><code>&lt;asp:Label Id="awec" runat="server" Text='I want to access here' /&gt; </code></pre>
c# asp.net
[0, 9]
2,188,837
2,188,838
Fadeout on hover effect in iPad
<p>I tried to use the fadeIn and fadeOut effect as you can see in this page: <a href="http://www.lifetime-watches.com/gal-w.html" rel="nofollow">http://www.lifetime-watches.com/gal-w.html</a></p> <pre><code>var titleString = $(this).find('a').attr("title"); $("#title").html(titleString).fadeIn(100); ; </code></pre> <p>So when they run the script the title of the image would fade in in a div. </p> <p>But the problem is when this page is opened in iPads, the hover function doesn't work (because obviously they don't have hover) and the div wouldn't fade out. </p> <p>What are the alternatives to this? Any help is appreciated. Thank you.</p>
javascript jquery
[3, 5]
7,639
7,640
Python's Equivalent of "public static void main"
<p>What is Python's equivalent of "public static void main(String[] args) { ... }"? I remember having used it in the past and then forgot.</p> <p>What I'm basically trying to remember is a function which I think included some underscores (__)...</p> <p>thx</p>
java python
[1, 7]
3,905,197
3,905,198
android.os.StrictMode instances=2; limit=1
<p>I use the <code>StrictMode</code> in my application , the api android 4.0.3, in my <code>BaseApp</code> i detect all.</p> <pre><code> builder.detectAll(); builder.penaltyLog(); StrictMode.VmPolicy vmp = builder.build(); StrictMode.setVmPolicy(vmp); StrictMode.ThreadPolicy.Builder builder1= new StrictMode.ThreadPolicy.Builder(); builder1.detectAll(); builder1.penaltyLog(); StrictMode.ThreadPolicy tdp=builder1.build(); StrictMode.setThreadPolicy(tdp); </code></pre> <p>then. I just call the <code>this.finish()</code> , in my activity : always show this error. why? whether I use the android:launchMode="singleInstance" in my Manifest.xml,they always show this error why?</p> <pre><code>06-27 14:47:34.725: E/StrictMode(18592): class com.onecard.ui.business.AllBusinessActivity; instances=2; limit=1 06-27 14:47:34.725: E/StrictMode(18592): android.os.StrictMode$InstanceCountViolation: class com.onecard.ui.business.AllBusinessActivity; instances=2; limit=1 06-27 14:47:34.725: E/StrictMode(18592): at android.os.StrictMode.setClassInstanceLimit(StrictMode.java:1) </code></pre>
java android
[1, 4]
2,018,593
2,018,594
How to have custom object listen for child custom object's events?
<p>I am trying to create a couple of custom objects in JavaScript and I am unsure if I am going about things the proper way.</p> <p>I have two objects: 'UserInterface' and 'VolumeSlider'. Up until a moment ago these two objects were independent, but coupled through methods. I decided that UserInterface should instead 'have' a VolumeSlider.</p> <p>So:</p> <pre><code>UserInterface = { _volumeSlider: null, initialize: function () { this._volumeSlider = VolumeSlider; //TODO: Should this be a new volumeSlider(); this._volumeSlider.initialize(); //I want to setup a listener for VolumeSlider's change-volume events here. } } VolumeSlider = { _volumeSlider: null, initialize: function () { this._volumeSlider = $('#VolumeSlider'); var self = this; this._volumeSlider.slider({ orientation: 'horizontal', max: 100, min: 0, value: 0, slide: function (e, ui) { self.passVolumeToPlayer(ui.value); }, change: function (e, ui) { self.passVolumeToPlayer(ui.value); } }); }, passVolumeToPlayer: function (volume) { if (volume != 0) UserInterface.updateMuteButton(volume); else UserInterface.updateMuteButton('Muted'); } } </code></pre> <p>Question is two-fold:</p> <ul> <li>Is this an alright way to be creating my objects and setting up children?</li> <li>I would like UserInterface to be able to respond to VolumeSlider._volumeSlider's change and slide events instead of having to be explicitly told. How can I go about accomplishing this?</li> </ul>
javascript jquery
[3, 5]
2,908,893
2,908,894
How to make checkbox checked by default in php
<p>I am working in a form in which there are check boxes now i want to check one by default in admin panel which is checked by the user in fromt end while he submitted form.Form is same in both the panel but in admin panel the form is already filled with values entered by the user at the time of submitted in front end.</p>
php javascript
[2, 3]
1,498,826
1,498,827
Form post doesn't contain textbox data [ASP.NET C#]
<p>I have several "ASP:TextBox" controls on a form (about 20). When the form loads, the text boxes are populated from a database. The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determined by some business logic). All but 1 of the text boxes work as intended.</p> <p>The odd box out, upon postback, does not contain the updated value that the user typed into the box. When debugging the application, it is clear that <strong>myTextBox.Text</strong> reflects the old, pre-populated value, not the new, user-supplied value. Every other box properly shows their respective user-supplied values.</p> <p>I did find a workaround. My solution was to basically extract the text box's value out of the Request.Form object: <strong>Request.Form[myTextBox.UniqueID]</strong>, which does contain the user-supplied value.</p> <p>What could be going on, here? As I mentioned, the other text boxes receive the user-supplied values just fine, and this particular problematic text box doesn't have any logic associated to it -- it just takes the value and saves it. The maindifference between this text box and the others is that this is a multi-line box (for inputting notes), which I believe is rendered as an HTML "textarea" tag instead of an "input" tag in ASP.NET.</p>
c# asp.net
[0, 9]
2,907,892
2,907,893
javascript capture and display php variable
<p>I have standard text links which all say "Full View". When clicked these links send out php in this form: <a href="http://mysite.com/fullview.php?myimage=30" rel="nofollow">http://mysite.com/fullview.php?myimage=30</a></p> <p>Basically there's thumbnailed images and text links that say full view. I'd like for fullview.php to capture the myimage variable, and display it as a full sized image. Meaning, a blank page (fullview.php) displaying the image. Sounds likes javascript to me.</p> <p>How do you put the javascript into fullview.php to capture the variable and display it as a full sized image?</p> <p>Thanks for any help, Darrell</p>
php javascript
[2, 3]
4,893,247
4,893,248
Make a path for create a file in Java (Android)
<p>Given a File object how can I create the path for saving it?</p> <p>I tried file.mkdirs() but for example if the file's path is:</p> <pre><code>/mnt/sdcard/downloads/myapp/temp/song.mp3 </code></pre> <p>it also creates a folder named "song.mp3" inside temp.</p> <p>How can I do it correctly?</p>
java android
[1, 4]
1,008,343
1,008,344
Find the time after 15 minutes of given time in javascript
<p>Find the time after 15 minutes of given time in javascript Example : given time is 2012-01-10 5:50 and I need to get like 2012-01-10 6:05</p>
javascript jquery
[3, 5]
5,919,259
5,919,260
JQuery Retrieving Data from aspx page
<p>I want retrieve data from aspx page. But, waiting data in static field if filling.</p> <p><strong>JQuery :</strong></p> <pre><code> $.ajax({ url: "Services/JSON/GetMessage.aspx", type: "GET", dataType: "json", success: function (response) { alert(response.Text); }, error: function (x, t, m) { if (t === "timeout") { alert("got timeout"); } else { alert(t); } } }) </code></pre> <p><strong>Services/JSON/GetMessage.aspx</strong></p> <pre><code>&lt;%@ Page Language="C#" %&gt; &lt;% Response.Clear(); Response.ContentType = "text/json"; int tryCount = 0; while (1 == 1) { if (ClsStaticFields.Messages.Count &gt; 0) { foreach(string message in ClsStaticFields.Messages) { Response.Write("{ Text:'" + message + "' }"); } } tryCount ++; if (tryCount &gt; 29) break; // 1 Minute wait and exit System.Threading.Thread.Sleep(2000); // 2 Second wait } Response.End(); %&gt; </code></pre> <p><strong>I was curious:</strong></p> <ul> <li>is this waiting period affects other users? </li> <li>is this cause locks on IIS or pages ?</li> <li>is this usage effecting badly to CPU ?</li> </ul>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,181,487
1,181,488
How to reduce the image pixels in android but not the size?
<p>After capturing an image from starting of default camera via <code>Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE)</code>, I want to reduce the resolution (pixels) of the image. I know that image quality will get disturbed but no worries to me.</p> <p>While searching in JAVA, we can use JAI (<code>JAVA ADVANCED IMAGING API</code>) library to do the required job. Actually I'm not aware about using of this library. Basically I want to store, send and want to process on that image, that's why I want reduce pixels from the image. </p> <p>Any suggestion guys.. Valuable help appreciated... </p>
java android
[1, 4]