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 |
---|---|---|---|---|---|
3,632,234 | 3,632,235 | Keep Checking until True | <p>Basically, I have a form that is handled by a CMS which I cannot edit it's javascript, but I more or less want to add in a "Loading" or "Sending" message to my users. For example. </p>
<p>Currently, the default form once submitted, will append a html success message to a div called 'success' once sent, but basically, I want to run a function on the submit button that keeps checking the 'success' for anything other than '' and once it isn't empty, turn off the loading symbol. </p>
<p>Something like this perhaps:</p>
<pre><code>$('#submitBtn').click(function(){
$('#loadingDiv').show();
while (!$('#success').html() == ''){
$('#loadingDiv').hide();
}
});
</code></pre>
<p>Any help would be greatly appreciated. I'm just not quite sure how to write it, I'm not great with jquery or javascript</p>
<p>Kind regards,
Shannon</p>
| javascript jquery | [3, 5] |
2,930,461 | 2,930,462 | Event Handlers not working after DOM manipulation | <p>On page load I bind Event Handlers with content which is hidden on at the time of page load. </p>
<p>If users clicks on the button, the hidden content is pulled and replaces the main content of the page, Now the event Handlers which were initially binded do not work.</p>
<p>HTML code on Page load </p>
<pre><code><p> Initial content of the page </p>
<button id="button"> Click Here to change content</button>
<div class="show-later" style="display: none;"> Some Hidden content </div>
</code></pre>
<p>After the user clicks a button the new dom looks some thing like this</p>
<pre><code><p>
<div>Some Hidden content</div>
</p>
</code></pre>
<p>After the manipulation the event handlers binded to the div element do not work any more. Please notice that the div goes into the P element after DOM Manipulation.</p>
<p>jQuery Code:</p>
<pre><code> $('#button').click(function(){
var show_later = $('.show-later').html();
$('p').html(show_later);
});
$(document).ready(function(){
$('.show-later').click(function(){
// Do something.....
});
});
</code></pre>
| javascript jquery | [3, 5] |
6,369 | 6,370 | to copy folders from local machine to folder in server | <p>to copy folders from local machto copy the complete files and folders , from local machine , i.e,
folder/directory path which is selected by user has to be completely[all
files within the path is be selected] is to be pasted/copied into
folder which is in webserver where the web application has been hosted.
ine to folder in server</p>
| c# asp.net | [0, 9] |
5,082,145 | 5,082,146 | Jquery - check to see if selector ends with number | <p>How can I check selector to see if he is ending with number?
JS code:</p>
<pre><code>if(!$(this).val())
{
$('label[for^=image], input[id^=image], input[name=time]').remove();
}
</code></pre>
<p>I tried adding <strong>/d/</strong>, but it does not work (</p>
<blockquote>
<p>$('label[for^=image' + /d/ +'], ....</p>
</blockquote>
<p>)</p>
| javascript jquery | [3, 5] |
138,792 | 138,793 | How do I get user input into an EditText field | <p>I am building a larger app and I made this small one just to figure out how to accomplish getting text from user input however it is not working. If I create a string reference at the Text property of my EditText field it works ok. If I leave it blank and enter the text into the field when the application runs in my emulator it does not work. Any ideas. </p>
<pre><code>package com.example.stringtest;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.Button;
public class Main extends Activity {
EditText display;
EditText displayTwo;
String displayContents;
Button displayText;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainlayout);
display = (EditText) findViewById(R.id.editText1);
displayContents = display.getText().toString();
displayTwo = (EditText) findViewById(R.id.editText2);
displayText = (Button) findViewById(R.id.button1);
displayText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
displayTwo.setText(displayContents);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.mainlayout, menu);
return true;
}
}
</code></pre>
| java android | [1, 4] |
3,911,682 | 3,911,683 | Routable Url in asp.net with .HTML gives 404 error in hosted server | <p>I have Routable url for my site <a href="http://www.indiatimepass.info" rel="nofollow">http://www.indiatimepass.info</a> it works fine in url is without any "." (dot) but if i add a "." (dot) in url it gives me no page found error.</p>
<p><a href="http://www.indiatimepass.info/link/11/welcome.html" rel="nofollow">http://www.indiatimepass.info/link/11/welcome.html</a> gives error</p>
<p><a href="http://www.indiatimepass.info/tags/asp.net" rel="nofollow">http://www.indiatimepass.info/tags/asp.net</a> also give error</p>
<p><a href="http://www.indiatimepass.info/tags/free" rel="nofollow">http://www.indiatimepass.info/tags/free</a> bse tips works fine</p>
<p>Thanks in advance.</p>
| c# asp.net | [0, 9] |
197,083 | 197,084 | store selected value of multiple list box items in asp.net | <p>I have a listbox control data bound to a data source and I want to be able to get the value of each selected item so that I can use that information to form an insert query for another table. In other words be able to select a few items out of the returned list and get the selected value of each. I tried using a for each statement but came up with some strange numbers.</p>
| c# asp.net | [0, 9] |
5,780,832 | 5,780,833 | If a nested element fires an event, dont let the container handle it | <p>I have a div that contains another div.
If the user clicks the inner div I only want the eventhandler attached to this element get executed. Right now first the eventhandler of the inner element and then that of the outer element gets executed. Is there a way to change this?</p>
<pre><code> <html>
<head>
<meta charset="utf-8">
<title>Demo</title>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#containerElement").click(function(event){
alert("This comes from container");
});
$("#innerElement").click(function(event){
alert("This comes from inner element");
});
});
</script>
<div id="containerElement" >
This is the container
<div id="innerElement" >
This is the inner element
</div>
</div>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
3,840,434 | 3,840,435 | How do I add validation to a GridView field? | <p>I have gridview as follows:</p>
<pre><code><asp:GridView runat="server" ID="gvOverrideData" AutoGenerateColumns="false" AlternatingRowStyle-BackColor="LightGreen" Width="800" OnRowEditing="OverrideGrid_OnRowEditing" OnRowCancelingEdit="OverrideGrid_OnRowCancelingEdit" OnRowUpdating="OverrideGrid_RowUpdating">
<HeaderStyle BackColor="LightGray" />
<Columns>
<asp:TemplateField HeaderText="Path">
<ItemTemplate>
<%# GetOverrideTemplatePath(DataBinder.Eval(Container.DataItem, "Path").ToString())
%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FileName" HeaderText="File Name" />
<asp:BoundField DataField="Extension" HeaderText="File Extension" />
<asp:BoundField DataField="FileType" HeaderText="File Type" />
<asp:BoundField DataField="Iteration" HeaderText="Iteration" />
<asp:CommandField ButtonType="Link" ShowEditButton="true" ShowDeleteButton="true"
ShowCancelButton="true" />
</Columns>
</asp:GridView>
</code></pre>
<p>I would like to validate the <code>FileType</code> field, so that it only accepts an InDesign, XML, CorelDraw, StaticImage file type, where the extension should be one of </p>
<blockquote>
<p>.indd, .tif, .wmf, .idms, .eps, .pdf, .xml, .inds, .emf, .jpg, .cdr, .gif, .ai, .u01</p>
</blockquote>
<p>How can I perform this validation check when a user adds/edit?</p>
| c# asp.net | [0, 9] |
1,945,859 | 1,945,860 | does python gives interactivity as javascript? | <p>I want to add interactivity like clicks, hover, onpage load() to a webpage, if i use python for generating xhtml, will python give essential flavors like javascript??</p>
<p>I'm bit confused and starter in python for web development, so is there need to include old javascript into python or the python only can handle interactivity, events as javascript?</p>
| javascript python | [3, 7] |
2,352,514 | 2,352,515 | Page_load in asp.net | <p>In asp.net, when working on web app, there is a function called 'Page_Load', which is empty. Is this called everytime the page is loaded? What if I remove this function? Essentially what is the main purpose of Page_Load? </p>
<p>Many Thanks.</p>
| c# asp.net | [0, 9] |
2,986,968 | 2,986,969 | how to get expiration date of local windows account? | <p>I need to create C# method like this :</p>
<pre><code> void deleteExpiredAccounts(String Account,dateTime expirationDate)
{
if(expirationDate == DateTime.Now)
{
DirectoryEntry localDirectory = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
DirectoryEntries users = localDirectory.Children;
DirectoryEntry user = users.Find(Account);
users.Remove(user);
}
}
</code></pre>
<p>any idea will be appreciated..thanks in advance!</p>
| c# asp.net | [0, 9] |
5,758,725 | 5,758,726 | Dynamic Slidedown effect using jQuery reading data from a table | <p>I want to list some records from the table in a ASP.NET page. For each record, I want to display some data and at the same time, provide a button for them to click. I want to show a “CLICK TO VIEW BUTTON” If they click on the button, I want to have a box slide down (using jQuery) to display the other details for the record. An example of what I am looking for can be found here. </p>
<p><a href="https://www.starwoodhotels.com/preferredguest/search/results/standard.html?localeCode=en_US&iATANumber=&city=los+angeles&stateCode=CA&countryCode=US&numberOfRooms=1&numberOfAdults=1&arrivalDate=12%2F30%2F2008&departureDate=12%2F31%2F2008" rel="nofollow">Sample of drop down</a></p>
<p>I would prefer to have one function to handle the details. I would like the box to appear right underneath each record and not at the bottom of the page. Is there a way to do this using jQuery? I was looking at the wrap, append but was not sure on how to go about implementing this.</p>
| asp.net jquery | [9, 5] |
736,245 | 736,246 | How to set the calendar dates unselectable accordingly to the dropdownlist users select? | <p>How do i set the calendar dates unselectable accordingly to the name in the DropDownList the users select? In other words, each name in the DropDownList will have different unselectable dates set and i tried to use the following codes to execute my program but it seems to be not working. How do i do so?</p>
<pre><code>protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedItem.Text == "WeddingPlanner1")
{
if (e.Day.Date.Month == 7 || e.Day.Date.Month == 9 || e.Day.Date.Month == 12)
{
if (e.Day.Date.Day == 5 || e.Day.Date.Day == 14 || e.Day.Date.Day == 18)
{
e.Day.IsSelectable = false;
e.Cell.ForeColor = System.Drawing.Color.Black;
e.Cell.BackColor = System.Drawing.Color.White;
e.Cell.Font.Bold = true;
}
}
}
</code></pre>
| c# asp.net | [0, 9] |
1,555,390 | 1,555,391 | read values from form post in jquery or javascript | <p>i have a form which when submitted goes to login page of another site and After the authentication is verified, the user is redirected back to my site and i receive from post values of: TOKEN and Address information.</p>
<p>I want to get the TOKEN and address information sent in post on the page to which i am redirected after login. How can i get those values through jquery or javascript.</p>
| javascript jquery | [3, 5] |
3,196,794 | 3,196,795 | Use set values not random ones for these variables in JQuery? | <p>This demo creates markers at random points on map:
<a href="http://gmap3.net/examples/pan-to-markers.html" rel="nofollow">http://gmap3.net/examples/pan-to-markers.html</a></p>
<p>Whats the smallest modification I can make to the demo code so I can specify the longitude and latitude of the points instead of having them random? </p>
<p>NOTE The exact code I have is slightly different to the demo in the link: </p>
<pre><code> $('#test1').gmap3(
{ action: 'init',
center:{
lat:44.797916,
lng:-93.278046
},
onces: {
bounds_changed: function(){
$(this).gmap3({
action:'getBounds',
callback: function (bounds){
if (!bounds) return;
var southWest = bounds.getSouthWest(),
northEast = bounds.getNorthEast(),
lngSpan = northEast.lng() - southWest.lng(),
latSpan = northEast.lat() - southWest.lat(),
i;
for (i = 0; i < 10; i++) {
add($(this), i, southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random());
}
}
});
}
}
}
);
});
</code></pre>
<p>Here is the code im actually using. I know its hacky but this is just for a demo.
<a href="http://smartpeopletalkfast.co.uk/gmap/demo/overlay.html" rel="nofollow">http://smartpeopletalkfast.co.uk/gmap/demo/overlay.html</a></p>
| javascript jquery | [3, 5] |
3,989,633 | 3,989,634 | Authentication token storage | <p>I want to secure every call to my web service via a token.</p>
<p>first the user is authenticated and a authentication token is generated then the token is added to the http runtime and finally the token is then sent to the client (asp.net c# pages)</p>
<p>here is the problem: i want to send the token to every subsequent service call i make. so the question is how do i find out where the token is stored on the client or could i somehow make it store on the client.</p>
<p>any help with be highly appreciated.</p>
| c# asp.net | [0, 9] |
1,788,001 | 1,788,002 | JavaScript - return false from function is not working? | <p>I m calling a javascript function on asp.net button client click and want to prevent post back. function works but it do not stop to be posted back. My Javascript is:</p>
<pre><code>function User2Check()
{
var user2id=document .getElementById("txtP2UserName");
var user2password=document .getElementById("txtP2Password");
if(user2id.value=='' & user2password.value!='')
{
alert("User name is required");
user2id=document .getElementById("txtP2UserName").foucs();
e.preventDefault();
return false;
}
if(user2id.value!='' & user2password.value=='')
{
alert("Password is required");
user2id=document .getElementById("txtP2UserPassword").foucs();
e.preventDefault();
return false;
}
}
</code></pre>
<p>The I am calling this function is:</p>
<pre><code><asp:Button runat="server" ID="btnSubmit" OnClientClick="return User2Check();" TabIndex="12" Text="Submit" onclick="btnSubmit_Click" />
</code></pre>
<p>plz guide.</p>
| javascript asp.net | [3, 9] |
589,684 | 589,685 | Jquery .live function suddenly not working anymore | <p>I was using jquery .live function to detect when the user was pressing some special keys (arrows, etc.): </p>
<pre><code>$('.TextBox1').live('keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 40) {
e.preventDefault();
...
}
});
</code></pre>
<p>I was working fine for a couple of months when suddenly yesterday it stopped working, preventing every line of js code below it from executing. What could have happened?</p>
<p>I have to replace it with the <code>.keyup</code> function.</p>
| javascript jquery | [3, 5] |
1,242,966 | 1,242,967 | eval objects property | <p>i have the following two objects</p>
<pre><code>public partial class ProgramObj
{
public int id;
public PersonObj myPerson;
}
public class PersonObj
{
public int id;
public string full_name;
}
</code></pre>
<p>I am assigning a list of ProgramObj's to a repeater from a SqlDataReader</p>
<pre><code>program_list.DataSource = reader;
program_list.DataBind();
</code></pre>
<p>What I want to do, is access the full_name property of the PersonObj in each ProgramObj
I've tried multiple things, the only thing that gets me an output value is </p>
<pre><code><%# DataBinder.Eval(Container.DataItem, "id") %>
</code></pre>
<p>which gets me the id of the ProgramObj, but I would like to get the name of the PersonObj, I thought </p>
<pre><code><%# DataBinder.Eval(Container.DataItem, "myPerson.full_name") %>
</code></pre>
<p>would work, but it doesn't appear to get me anywhere. </p>
<p>I also tried an ItemDataBound with </p>
<pre><code>PersonObj myPerson = (PersonObj)e.Item.DataItem;
lblUserName.Text = myPerson.Full_Name_RFL;
</code></pre>
<p>and</p>
<pre><code><%# DataBinder.Eval(Container.DataItem, "myPerson") %>
</code></pre>
<p>but i get an error that it cannot cast an object of type DataRecordInternal to PersonObj. thoughts?</p>
| c# asp.net | [0, 9] |
1,683,973 | 1,683,974 | Dynamically change an element's top position based on height | <p>I have three divs that are set to popup on li:hover using CSS. I want these divs to hover at the same level above their parent li regardless of the height of their content. In order to do so, I'm trying to use jquery to calculate the div's height, then set a negative top value equal to the height of the div. Here's what I have so far:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
var pHeight = $('footer ul ul').height(); //Get height of footer popup
var nHeight = pHeight + "px"; //Calculate new top position based on footer popup height
$('footer ul ul').css({ //Change top position to equal height of footer popup
'top' : "-nHeight",
});
});
</script>
</code></pre>
<p>Firebug keeps telling me that there was an error parsing the value for top and the declaration was dropped. Any thoughts?</p>
| javascript jquery | [3, 5] |
5,300,281 | 5,300,282 | jQuery: Adding HTML inside a dynamic list | <p>Hi I have a piece of jquery that dynamically creates an unordered list:</p>
<pre><code>var get_url = "<?php echo base_url(); ?>index.php/notes/get/"+<?php echo $id;?>;
$.get(get_url, function(data) {
$.each(data,function(index, arr)
{
var opt = $('<li />');
opt.text(arr['body']);
$('#notes-list').append(opt);
});
});
</code></pre>
<p>This produces the correct list but I want to add < pre> tags around the text in the list item.</p>
<p>Can someone point me in the right direction?</p>
<p>I've tried opt.innerHTML = "< pre />"; but no luck.</p>
<p>Thanks,</p>
<p>Billy</p>
| javascript jquery | [3, 5] |
4,932,494 | 4,932,495 | Creating a JQuery Modal Form | <p>I am new to JQuery. I am looking through the documentation and demos, but can't find an answer to what I'm looking for.</p>
<p>I have a button. Onlick, I would like to pass a 2 passes to a modal form. Onload, I would like the an AJAX call to start in the form. The AJAX call will return a json object from a PHP script. The json response will serve as the content for the modal form.</p>
<p>Like I said, I'm a JQ newbie. I don't expect anyone to hold my hand through here, but it would be nice to have some ground to stand on as far as how I can go about this. I guess the main things I need to figure out are: how to pass arguments to a modal form; how to start ajax when the form loads (using the values passed); and how to parse the json to form the content.</p>
<p>Any help is greatly appreciated.</p>
| javascript jquery | [3, 5] |
3,159,838 | 3,159,839 | Uncaught TypeError: Cannot read property 'top' of undefined | <p>I have some jQuery code like this</p>
<pre><code>$(document).ready(function(){
$('.content-nav a').on('click',function(){
var str = $(this).attr("href");
var the_id = str.substr(1);
$("#container").animate({ scrollTop: $(the_id).offset().top }, 1000);
});
});
</code></pre>
<p>When I click the link i'm getting error like <code>Uncaught TypeError: Cannot read property 'top' of undefined</code></p>
<p>Can someone tell me whats wrong?</p>
<p>I'm using jQuery 1.8.3 which is loaded from google api.</p>
| javascript jquery | [3, 5] |
1,284,392 | 1,284,393 | Problems with php var_dump | <p>I am trying to var_dump a string just to cross check that it contains all the checked options from a checkbox list. here is my code</p>
<pre><code> var checked = '';
$('.tblEmailSettings input:checkbox:checked')
.each(function(index,value){
checked += $(this).val() + ",";
<?php var_dump($checked); ?>
</code></pre>
| php javascript jquery | [2, 3, 5] |
2,868,914 | 2,868,915 | why get unexpected error? | <pre><code><?php
$title = $_POST['title'];
$date = $_POST['date'];
$time = $_POST['time'];
$channel = $_POST['channel'];
mysql_connect("localhost","root","");
mysql_select_db("imammuda");
$sql=mysql_query("insert into Program (ID, Title, Date, Time, Channel) values ('NULL', $title, $date, $time, $channel);
mysql_close();
?>
</code></pre>
<p>this is my POST to insert data</p>
<pre><code>private void adddataintophp(String title, String date, String time, String channel){
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//http post
try{
nameValuePairs.add(new BasicNameValuePair("title", title));
nameValuePairs.add(new BasicNameValuePair("date", date));
nameValuePairs.add(new BasicNameValuePair("time", time));
nameValuePairs.add(new BasicNameValuePair("channel", channel));
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://10.0.2.2/insertprogram.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}catch(Exception e){
Log.e("log_tag", "Error in http connection"+e.toString());
}
}
</code></pre>
<p>when run the php, it gave me </p>
<pre><code>Parse error: syntax error, unexpected $end in C:\wamp\www\InsertProgram.php on line 10
</code></pre>
<p>i don't know why it cannot end. </p>
<p>please help me in the POST there too, i think got some errors there that i did not found it.</p>
| java php android | [1, 2, 4] |
71,988 | 71,989 | I have created a login for my asp applocation but evertime I login it does not redirect me to the secure folder | <p>When I login in my asp App I configured that it should take me to the Forms- Secure area. I added the role in the membership so that only Admin can see this option. But when I login with admin it requiers me to login again. Its like not recoginizing Im logged in.</p>
<p>THanks!!!!</p>
| c# asp.net | [0, 9] |
2,041,587 | 2,041,588 | Using JavaScript to Modify a Page on the Fly based on <select> contents | <p>So, I've got a form and within that form is a <code><select></code>. Based on what that select is(what <code><option></code> is selected), I want the contents of the form to change on the fly(i.e. before the user clicks anything else).</p>
<p>For example, if the user selects the <code>Photo Upload</code> option, a file upload box will appear, and if they select <code>Text Entry</code>, a text box will appear in place of that file upload box.</p>
<p>Thanks.</p>
| php javascript | [2, 3] |
4,547,923 | 4,547,924 | ASP.NET Default.aspx | <p>The resource cannot be found.</p>
<p>Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. </p>
<p>Requested URL: /Customer/Reservation/Default.aspx</p>
<p>How should i fix this? If I add Default.aspx to Folder Reservation that will fix my problem but is there any way to fix this error? :)</p>
<p>Thanks in advance!</p>
| c# asp.net | [0, 9] |
1,057,797 | 1,057,798 | jQuery + setTimeout() + clearTimeout() not working in IE7 & 8 | <p>This works in Firefox and Chrome but not in IE.</p>
<p>In Internet Explorer the timers are not being cleared out and it appears each time update_slideshow() is called a new timer is created.</p>
<pre><code>// slideshow params
var currentSlide = 1;
var numSlides = 4;
var pause = false;
function pause_show(bool){
pause = bool;
}
// transitions the slides
function update_slideshow(slide){
if(slide > numSlides) slide = 1;
//is user tyring to pause/play this slide
if(currentSlide == slide){
switch(pause){
case false:
$("#ssbut" + slide.toString()).removeClass('pause').addClass('play');
pause = true;
break;
case true:
$("#ssbut" + slide.toString()).removeClass('play').addClass('pause');
pause = false;
break;
}
}else{ //user clicked on a button other than the current slide's
clearTimeout(slideTimer);
function complete() {
$("#slide" + slide.toString()).fadeIn(500, "linear");
if(!pause)
$("#ssbut" + slide.toString()).removeClass('inactive').addClass('pause');
else
$("#ssbut" + slide.toString()).removeClass('inactive').addClass('play');
}
$("#ssbut" + currentSlide.toString()).removeClass('play').addClass('inactive');
$("#slide" + currentSlide.toString()).fadeOut(300, "linear", complete);
currentSlide = slide;
if (typeof(slideTimer) != 'undefined') clearTimeout(slideTimer);
slideTimer = setTimeout("slideshow()",4000);
}
}
function slideshow(){
if (typeof(slideTimer) != 'undefined') clearTimeout(slideTimer);
if(!pause){
update_slideshow(currentSlide + 1);
}
slideTimer = setTimeout("slideshow()",4000);
}
var slideTimer = setTimeout("slideshow()",4000);
</code></pre>
| javascript jquery | [3, 5] |
3,040,068 | 3,040,069 | java.lang.NoClassDefFoundError on android | <p>i am doing an application-email sending without user interaction. so that i got coding from the following <a href="http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a/2033124#2033124">link</a>. here i got <strong>java.lang.NoClassDefFoundError</strong>: com.murali.email.GMailSender. i got this error at </p>
<pre><code>GMailSender sender = new GMailSender("[email protected]", "password");
sender.sendMail("This is Subject",
"This is Body",
"[email protected]",
"[email protected]");
</code></pre>
<p>in the MailSenderActivity Class. i added all external jars in referenced library and no error found at compile time. i spent more time to solve the issue but failed. i know it is possible of duplicate question but the other answers were not used for me. i guess me or eclipse miss some jar or class path for GMailSender class. please help me. i do not know how to solve it. </p>
| java android | [1, 4] |
5,664,928 | 5,664,929 | boost::python: compilation fails because copy constructor is private | <p>i use boost::python to wrap a C++ class. This class does not allow copy constructors, but the python module always wants to create one. </p>
<p>The C++ class looks like this (simplified)</p>
<pre><code>class Foo {
public:
Foo(const char *name); // constructor
private:
ByteArray m_bytearray;
};
</code></pre>
<p>The ByteArray class is inherited from boost::noncopyable, therefore Foo does not have copy constructors.</p>
<p>Here's the Python module stub:</p>
<pre><code>BOOST_PYTHON_MODULE(Foo)
{
class_<Foo>("Foo", init<const char *>())
;
}
</code></pre>
<p>When compiling the boost::python module, i get errors that a copy constructor for Foo cannot be created because ByteArray inherits from boost::noncopyable.</p>
<p>How can i disable copy constructors in my python module?</p>
<p>Thanks
Christoph</p>
| c++ python | [6, 7] |
2,027,784 | 2,027,785 | Develop an application Module wise in asp.net? | <p>How to develop an application in asp.net module wise In which we can add new module and remove existing module dynamically? Or
Suppose we create an asp.net web application. how to convert that application in an module so that the application will work as a module of another application. </p>
| c# asp.net | [0, 9] |
4,972,697 | 4,972,698 | 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] |
4,964,307 | 4,964,308 | Android horizontal text scroll - automatic and by gesture | <p>I'm relatively new to Android programming, and I need a control that holds text and scrolls automatically. Now, I know about the "marquee" in the TextView control and it works fine for what it's intended, but that approach has two problems.</p>
<p>1) I need the text to scroll regardless of its length, i.e. if the text is only "Hello", and the control is set to match parents width, it needs to scroll.</p>
<p>2) The control needs to respond to user scroll - by flicking/dragging it left/right, the text should also scroll.</p>
<p>And naturally, when the text is "gone" to the left side, it should reappear on the right side and continue scrolling. For now, it should be a single line text.</p>
<p>Does anything like that exist, and if not, what would be the best approach guidelines to implementing it?</p>
| java android | [1, 4] |
3,854,754 | 3,854,755 | How may I obtaining value of label element using substring in label's for attribute using jQuery? | <p>I am trying to obtain the value of label elements using jQuery (or javascript). The only search term I have is a substring of the label element's for attribute. In the example code shown below, this would be 'Okuku'.</p>
<pre><code><label class="required" for="Nigeria-Osun-Okuku">The Township of Okuku</label>
</code></pre>
<p>The Script:</p>
<pre><code>$("label[for='Nigeria-Osun-Okuku']").text();
</code></pre>
<p>would return </p>
<blockquote>
<p>The Township of Okuku</p>
</blockquote>
<p>but I don't have the complete 'for' value: Nigeria-Osun-Okuku <strong>but the last substring of it: 'Okuku'</strong>. </p>
<p>How can I script to search, match and <strong><em>return: The Township of Okuku</em></strong> ? Thanks</p>
| javascript jquery | [3, 5] |
5,349,369 | 5,349,370 | ImageView getLocationtOnScreen android | <p>I am trying to get the coordinates of the image on the screen. I currently have an ImageView within an activity. I understand that the getLocationOnScreen() method can only be called once the layout has been created, so calling this method within the oncreate function would return [0,0]. But I do not know how to get this method to return the correct values. I have tried overiding various superclass methods, like the onstart method or the onTouchEvent method and it still returns [0,0] to me. The code I currently have is as follows:</p>
<pre><code>@Override
public void onCreate(Bundle savedInstanceState)
{
// Some code here after which ..
image = (ImageView) findViewById(R.id.imageVfi);
image.setImageBitmap(imageData.entrySet().iterator().next().getValue());
}
</code></pre>
<p>Then I have the onStart method which I have overriden</p>
<pre><code>@Override
public void onStart()
{
super.onStart();
image.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
int[] dim = new int[2];
image.getLocationOnScreen(dim);
new AlertDialog.Builder(DisplayPicture.this)
.setIcon(R.drawable.icon)
.setTitle("Touch coordinates : " +
String.valueOf(dim[0]) + "x" + String.valueOf(dim[1]))
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
}
}).show();
// image calculations go here
return true;
}
});
}
</code></pre>
<p>This returns 0X0 to me. Any help is much appreciated.</p>
| java android | [1, 4] |
1,495,642 | 1,495,643 | How to add using keyword to multiple assignments | <p>My code is </p>
<pre><code> SqlDataAdapter adapter;
if (string.IsNullOrEmpty(Lk_proc))
{
using (adapter = new SqlDataAdapter("SELECT *fromtbl, _sqlConn))
{
adapter.SelectCommand.CommandType = CommandType.Text;
}
}
else
{
using (SqlCommand sqlCmd = new SqlCommand("usp_test", _sqlConne))
{
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlPar = new SqlParameter("@test_e", SqlDbType.NVarChar, 255);
sqlPar.Value = value;
sqlCmd.Parameters.Add(sqlPar);
adapter = new SqlDataAdapter(sqlCmd);
}
}
using (DataTable dt = new DataTable())
{
adapter.Fill(dt);
}
</code></pre>
<p>My requirement is: I want to add <code>using</code> keyword for the <code>DataAdapter</code> in <code>else</code> condition in order to solve warnings while debugging. i.e to the </p>
<pre><code> using(adapter = new SqlDataAdapter(sqlCmd))
{
}
</code></pre>
<p>How can I achieve this?</p>
| c# asp.net | [0, 9] |
3,549,426 | 3,549,427 | can not read object property in javascript | <p>Trying to hide the left / right navigation text by listening to object & its properties.</p>
<p>working example : <a href="http://jsfiddle.net/ylokesh/9EyEu/29/" rel="nofollow">http://jsfiddle.net/ylokesh/9EyEu/29/</a></p>
<p>But, getting following error " Uncaught TypeError: Cannot call method 'hide' of undefined "</p>
<pre><code>if(!scroller) { var scroller = {}; }
scroller = {
next : "#leftControl",
prev : "#rightControl",
videos : {
hideButtons : function() {
var obj = this;
obj.next.hide();
obj.prev.hide();
},
init : function() {
var obj = this;
obj.hideButtons();
}
},
init : function() {
var obj = this;
obj.videos.init();
}
}
scroller.init();
</code></pre>
| javascript jquery | [3, 5] |
2,031,620 | 2,031,621 | jQuery keeps adding display: block to my table row | <pre><code>var str = '<tr class="task_row"><td>data.name</td><td>data.description</td></tr>';
$(str)
.hide()
.insertAfter($(clicked_item)
.parent()
.parent()
.parent()
.next()
.find('.header_row')
)
.fadeIn("slow");
</code></pre>
<p>For some reason, when jQuery shows the new row, it gives the <code><tr></code> a <code>display: block</code> style which makes the entire row only take up one cell. Is there any way to keep it from behaving this way?</p>
| javascript jquery | [3, 5] |
2,593,002 | 2,593,003 | how to add and remove a class in jquery every 4 seconds | <p>for some reason, this isn't adding and removing a new class on elements with the class of post, every 4 seconds. jquery loads correctly, as does this. chrome shows no errors with the code.</p>
<pre><code>$(document).ready(function(){
$('.post').addClass('display').delay(4000).removeClass('display');
});
</code></pre>
| javascript jquery | [3, 5] |
5,422,138 | 5,422,139 | Insert data into report viewer dynamically from code | <p>I have reportviewer control and want to insert data through c# code, how can i insert?</p>
| c# asp.net | [0, 9] |
2,676,748 | 2,676,749 | Pre load images from an ajax request before displaying them? | <p>I'm using jQuery to load html content which contains images, the problem is that i don't want the effect of blinking on images due to loading, to achieve that i need to pre load images inside the response body before inserting it to guarantee a smooth update.</p>
<p>Current Code:</p>
<pre><code>$.ajax({
url: 'hello.php',
method: 'GET',
data:'id='+id,
success: function(data) {
$('#section').html(data);
}
});
</code></pre>
<p>Any Solutions?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,824,297 | 2,824,298 | How to pass multiple condition to find function in Jquery | <p>I want to pass multiple conditions to Jquery find function
e.g</p>
<pre><code>$(selector).find("input[type='text',id='txtId']") //this is not a right way
</code></pre>
<p>what is the solution? </p>
| jquery asp.net | [5, 9] |
3,677,106 | 3,677,107 | Checkbox won't change value with javascript | <p>I have 2 check boxes where only one or none may be checked.
Since I can't do a postback I tried this with Javascript.
The Javascript finds the element (tested it with an alert).
But the value won't change.</p>
<p>Any Idea how I can do this with Javascript?</p>
<p>The Javascript:</p>
<pre><code>function mrcAndNbbFilterChanged(mrcOrNbb)
{
alert("er in");
if(mrcOrNbb == 0)
{
document.getElementById("ctl00_contentHolder_cb_mrcFilter").checked=true;
document.getElementById("ctl00_contentHolder_cbNoBackBilling").checked=false;
alert(document.getElementById("ctl00_contentHolder_cbNoBackBilling"));
alert("0");
}
else
{
if(mrcOrNbb == 1)
{
alert("1");
document.getElementById("cb_mrcFilter").checked=false;
document.getElementById("cbNoBackBilling").checked=true;
}
}
}
</code></pre>
<p>The ASP code:</p>
<pre><code><asp:CheckBox ID="cb_mrcFilter" runat="server" Text="Only MRC" OnClick="mrcAndNbbFilterChanged(0)" />
<asp:CheckBox ID="cbNoBackBilling" runat="server" Text="No back billing" OnClick="mrcAndNbbFilterChanged(1)" />
</code></pre>
| javascript asp.net | [3, 9] |
2,131,870 | 2,131,871 | jQuery trigger action when a user scrolls past a certain part of the page | <p>Hey all, I need a jQuery action to fire when a user scrolls past certain locations on the page. Is this even possible with jQuery? I have looked at .scroll in the jQuery API and I don't think this is what I need. It fires every time the user scrolls, but I need it to fire just when a user passes a certain area.</p>
| javascript jquery | [3, 5] |
1,084,532 | 1,084,533 | Confused about global variable not updating | <p>I have the following code:</p>
<pre><code>var clickCount = 1;
var slideCount = $('div.slide').length;
$('a#next-button').click(function() {
if(clickCount < slideCount) {
$('div.slide').animate({"left":"-=" + slideWidth}, 'slow');
clickCount = clickCount + 1;
}
});
$('p').text(clickCount);
</code></pre>
<p>It has a global variable called <code>clickCount</code>.</p>
<p>The <code>$('a#next-button').click(function() { …</code> updates the global variable with an increment of 1, each time the <code><a></code> element is clicked.</p>
<p>So, my question is, why does: <code>$('p').text(clickCount);</code>
not show me the updated clickCount on the page everytine the <code><a></code> tag is clicked. Instead it just shows 1 (the original assigned value).</p>
| javascript jquery | [3, 5] |
2,992,394 | 2,992,395 | jQuery tab and tab content show up when clicked ? | <p>My webpage is at <a href="http://www.sarahjanetrading.com/js/resume" rel="nofollow">http://www.sarahjanetrading.com/js/resume</a></p>
<p>All the HTML, CSS and jQuery code + images are available there for anyone to access.</p>
<p>My issue is that currently my jQuery code makes the tabs show the tab-content when I click on the achor tag of the tab. But the tab doesnt change into the clicked tab.(tab name remains the same).</p>
<p>And the tab changes into the clicked tab when i click on the respective li of the tab. What I want is that both the tab changes and the content of the tab shows when I click on the either the li of the tab or the anchor of the tab.</p>
| javascript jquery | [3, 5] |
4,459,827 | 4,459,828 | how to use update in detail view | <p>There is button Update in detail veiw which automatically transform the column to textbox can any body tell me where to code the update code;in .aspx or in .aspxcs</p>
| c# asp.net | [0, 9] |
2,162,002 | 2,162,003 | Change MenuItem text in ASP.NET / C# | <p>I have an ASP Menu like this:</p>
<pre><code><asp:Menu ID="NavigationMenu" runat="server"
EnableViewState="False" IncludeStyleBlock="False"
Orientation="Horizontal" meta:resourcekey="NavigationMenuResource1">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="<% MenuItemResource1 %>" meta:resourcekey="MenuItemResource1"/>
<asp:MenuItem NavigateUrl="~/Products.aspx" Text="Products" meta:resourcekey="MenuItemResource2" />
</Items>
</asp:Menu>
</code></pre>
<p>What I want to do, is to change the MenuItem text based on the user language selection (CultureInfo). For example, the "Products" section should be called "Produits" in french.</p>
<p>I added a .resx file for english and french. If I use a < div> element with an Id, this works fine. The problem is that the asp MenuItem doesn't seem to have an ID, so I'm not able to access it. Like the example, I tried to set the first MenuItem text with to a "Resource" item, but when I change the language, the text is not changing.</p>
<p>How can I change that text?</p>
| c# asp.net | [0, 9] |
5,634,694 | 5,634,695 | javascript working in firefox or crome not ie | <p>I have the following lines of code in my .js file</p>
<pre><code>$(triggers.restart).live('click', function (e) {
e.preventDefault();
plugin.method.startQuiz(this);
});
</code></pre>
<p>The code is working fine in firefox or chrome but not in ie. Any points??</p>
<p>Thanks in advance...</p>
| javascript jquery | [3, 5] |
5,862,510 | 5,862,511 | Converting toggleClass('hidden') to .toggle() with animation | <p>My first implementation of my personal learning project of dynamically generated webpages and JQuery project utilized checkboxes and toggle("slow") and toggle("fast"). However, being new to CS altogether, managing the state of checkboxes got q bit complex for my first project. So I switched solely to <code><label></code>s and <code>.on('click', function(){...})</code> and <code>$('*').click(function(){...})</code> with <code>.toggleClass('hidden')</code> to handle my UX. The CSS for the hidden class is :</p>
<pre><code>.hidden {
display: none;
}
</code></pre>
<p>The problem now is that the toggling of the class happens instantaneously, and I would like the user to be able to see the <code>.toggle()</code> just as <code>.toggle('slow')</code> or <code>.toggle('fast')</code>. how would I convert the following line to achieve this visual feedback?</p>
<pre><code>$(this).toggleClass('hidden');
</code></pre>
<p>I have reviewed the APIs for toggle, toggleClass, and slideToggle, and was curious if a certain combination would work. If I have to rewrite it to toggle(), how do I include the showOrHide parameter, along with the "show" or "fast" duration, as I need to verify current state, similar to <code>.toggleClass()</code>'s [switch] parameter. </p>
| javascript jquery | [3, 5] |
29,848 | 29,849 | Can we get the return value of a PHP file from ASP.NET? | <p>My company currently has a Linux server setup with a basic site that uses PHP to process some files and return data to the user.</p>
<p>Eventually, my boss wants me to remake it in .NET. But first, he wants me to just create a frontend for the PHP files.</p>
<p>It looks like all of the PHP files take parameters and return an HTML document.</p>
<p>What would be the best way to get this data so I can display it in an ASP.NET page?</p>
| php asp.net | [2, 9] |
2,341,386 | 2,341,387 | jQuery value to name | <p>In jQuery I have a dropdown called <code>#selected_studio</code>. In that drop one I have a <code><option></code> with <code>value="studio_17</code> and says <code>Testing...</code> if you look at the drop down in the browser. I want to read the "Testing..." text no matter if selected or not, just by knowing the value. I attempted to write some JS but it failed and not sure how it should be.</p>
<pre><code>$("#selected_studio option:studio_17").text();
</code></pre>
<p>Any ideas on how to do this? I think it's possible. I'm using jQuery 1.7 if that's any helpful.</p>
<p>The full HTML:</p>
<pre><code><select id="selected_studio">
<option value="me">Kevin</option>
<option value="studio_17">Testing...</option>
<option value="null" disabled="disabled">------------------------</option>
<option value="new_studio">Studio Application</option>
</select>
</code></pre>
| javascript jquery | [3, 5] |
5,167,389 | 5,167,390 | how to read javascript array in php | <p>I'm trying post a javascript array using jquery $.post method to php and use array values in mysql query.</p>
<pre><code>$.post("test.php", { 'celvalues[]': celValues }});
</code></pre>
<p>where values for array celvalues is assigned.
So how to read this array in php?</p>
| php jquery | [2, 5] |
4,396,745 | 4,396,746 | Scan a file folder in android for file paths | <p>So i have a folder at "mnt/sdcard/folder" and its filled with image files. I want to be able to scan the folder and for each of the files that is in the folder put each file path in an arraylist. Is there an easy way to do this?</p>
| java android | [1, 4] |
3,631,373 | 3,631,374 | detect new notification jquery | <p>JS:</p>
<pre><code>$(function() {
$('.click_hide li').click(function() {
var $list = $("ul.system_messages"),
$this = $(this);
$this.slideUp('fast', function() {
$this.remove();
});
});
$('.click_show li').click(function() {
if ($('.click_hide li').is(":visible")) {
$('.click_hide li').slideUp('fast', function() {
$('.click_hide li').hide();
});
}
if ($('.click_hide li').is(":hidden")) {
$('.click_hide li').slideDown('fast', function() {
$('.click_hide li').show();
});
}
});
});
</code></pre>
<p>HTML:</p>
<pre><code><ul class="notification click_hide">
<li>New product has been purchased</li>
<li>Product out of stock</li>
</ul>
<ul class = "click_show">
<li>Show Notifications</li>
</ul>
</code></pre>
<p>CSS:</p>
<pre><code>ul{
border: 1px solid;
cursor: pointer;
}
</code></pre>
<p>I have this sample notification script that show/hide notifications and delete the field whenever the notification is clicked.</p>
<p>What i want to do is that when new <code><li></code> field was inserted dynamically. I want to detect that new field and highlight it for example change the color of the field to red. or produce a text saying the there's a new notification.</p>
<p>jsfiddle: <a href="http://jsfiddle.net/tmL7m/4" rel="nofollow">http://jsfiddle.net/tmL7m/4</a></p>
| php jquery | [2, 5] |
3,593,512 | 3,593,513 | Some rendering issues with jQuery's .animate() | <p>I have some CSS that renders correctly normally when it's not being animated but doesn't render correctly when animated. Some clipping that should occur does not during the animation but snaps back as soon as it finishes.</p>
<p><img src="http://i.stack.imgur.com/cD8Rp.png" alt="enter image description here"></p>
<p>The last frame is what it looks like after it animates.</p>
<p>It only happens when I select the elements by class (i.e. <code>$('[class="chatbubble"] :first')</code>).</p>
<p>If I attach an id to the div and select it via <code>$('#id')</code>, it animates perfectly.</p>
<p>Here is my animation code:</p>
<pre><code>function animate() {
var dom = $('[class="chatbubble"] :first');
var chatmessage = dom.find('[class="chatmessage"]');
var speed = 1500;
soundManager.play('bloop');
var wd = dom.width();
var ht = dom.height();
var fs = chatmessage.css('fontSize');
dom.css('width',0);
dom.css('marginTop',parseInt(ht/9));
dom.animate({ width:wd, marginTop:0 },speed).css('overflow', 'visible');
chatmessage.css('font-size',0);
chatmessage.animate({ fontSize:fs },speed).css('overflow', 'visible');
}
</code></pre>
<p>I'm not very familiar with jQuery so I don't know what could be causing it.</p>
<p>Can anyone help?</p>
| javascript jquery | [3, 5] |
4,802,085 | 4,802,086 | Splitting text file in android | <p>I am developing an android app and i need it to read a text file. Once it has read the text file I need to <code>save certain parts</code> to a database.
The text file contains the following:</p>
<pre><code>Title - Hello
Date - 03/02/1982
Info - Information blablabla
Title - New title
Date - 04/05/1993
Info - New Info
</code></pre>
<p>I thought that I need to split the text file in two by using the blank line as a <code>separator</code>. Then I need to get the individual info like the Title and save it into the database as a title. Is there some way to do this? I know how to read all of the text file. I am using this to read the <code>complete</code> text file. </p>
<pre><code> TextView helloTxt = (TextView) findViewById(R.id.hellotxt);
helloTxt.setText(readTxt());
}
private String readTxt() {
InputStream inputStream = getResources().openRawResource(R.raw.hello);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int i;
try {
i = inputStream.read();
while (i != -1) {
byteArrayOutputStream.write(i);
i = inputStream.read();
}
inputStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return byteArrayOutputStream.toString();
}
</code></pre>
<p>I was just wondering about the splitting event of this.
Thank you </p>
| java android | [1, 4] |
2,933,081 | 2,933,082 | Copy File in local Network | <p>This is a web application
I have 2 pc's: A: 192.168.1.200 and B: 192.168.1.201, I want copy from A to B, this code working is single pc, but it's not working in network.</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
string sourcePath = @"D:\Source\";
string[] filePaths = Directory.GetFiles(sourcePath, "*.txt");
foreach (string a in filePaths)
{
CopyFiles(a, a.Replace("D:\\Source\\", "D:\\Source1\\New\\"));
//CopyFiles(a, a.Replace("D:\\Source\\", "192.168.1.201\\Source1\\New\\"));
}
}
private bool CopyFiles(string Source, string Destn)
{
try
{
if (File.Exists(Source) == true)
{
File.Copy(Source, Destn);
return true;
}
else
{
Response.Write("Source path . does not exist");
return false;
}
}
catch (FileNotFoundException exFile)
{
Response.Write("File Not Found " + exFile.Message);
return false;
}
catch (DirectoryNotFoundException exDir)
{
Response.Write("Directory Not Found " + exDir.Message);
return false;
}
catch (Exception ex)
{
Response.Write(ex.Message);
return false;
}
}
</code></pre>
| c# asp.net | [0, 9] |
2,261,089 | 2,261,090 | jQuery fadeIn/fadeOut race conditions? | <p>I'm trying to handle a menu, where when you hover over an item, a box fades in, another item, another box fades in:</p>
<pre><code>$( '.all' ).fadeOut( 'fast', function() { $( '#item' ).fadeIn( 'fast' );
</code></pre>
<p>but sometimes when you use the mouse too fast, multiple things show up or everything goes bye and usch.. how do I handle the race gracefully?</p>
| javascript jquery | [3, 5] |
2,254,430 | 2,254,431 | android:how to get javascript executed html on javacode? | <p>I want to get html from web-site to parse. But i don't have any good ways. I tried
selenium, but it can't run on android without erroring.</p>
<p>htmlunit/ is also. Webview/ i want not to appear the browser. so i set view.GONE to webview.
then how to get html from webview?</p>
<p>Please teach me good way to get executed html on android/java.</p>
| javascript android | [3, 4] |
1,954,268 | 1,954,269 | ~ 'MachineToApplication' beyond application level ~ What does this error means? | <p>What should i do when this error prompt my screen</p>
<p>In VS2008 Express Edition</p>
<ol>
<li>C:\Users\ami\Desktop\MyAddressBookasd\MyAddressBook\UpdateTheRecord.aspx: ASP.NET runtime error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. </li>
</ol>
<p><img src="http://i.stack.imgur.com/ozVpu.jpg" alt="enter image description here"></p>
<p>In Web Browser</p>
<ol>
<li>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. </li>
</ol>
<p>Parser Error Message: It is an error to use a section registered as Definition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.</p>
<p>Source Error: </p>
<p>Line 36: ASP.NET to identify an incoming user.
Line 37: -->
Line 38:
Line 39: section enables configuration</p>
<p><img src="http://i.stack.imgur.com/uxYtJ.jpg" alt="enter image description here"></p>
| c# asp.net | [0, 9] |
5,381,428 | 5,381,429 | Object ... has no method 'append' -Need help quick | <p>I am currently attempting to write a function that applies unique ids to list item dynamically by ticking checkboxes, though I have encountered a problem, when appending the unique id to the list item I get the following error message in the console:</p>
<pre><code>Uncaught TypeError: Object SpTU 4, 183:false<br /> has no method 'append'
</code></pre>
<p>Here is the code that is causing the error:</p>
<pre><code>strng += name+":"+val+"<br />";
var i = 1;
strng.append($({ type: "text", id:+i }));
</code></pre>
<p>I need help with this quickly so any help would be greatly appreciated!
Thanks in advance</p>
<p>-------EDIT----------
Here is the whole function so it is easier to understand, I am new to programming to it may be very messy and unproffesional.</p>
<pre><code>var dataToShow = {};
function check(tickbox){
dataToShow[tickbox.value] = tickbox.checked == true;
showDataOnScreen(dataToShow);
function showDataOnScreen(dataToShow){
var $strng = "";
jQuery.each(dataToShow,function(name,val){
$strng += name+":"+val+"<br />";
var i = 1;
$strng.append($({ type: "text", id:+i }));
});
jQuery("#list").html(strng);
</code></pre>
| javascript jquery | [3, 5] |
4,238,339 | 4,238,340 | Get jQuery slider values from DB | <p>I have a database with these tables</p>
<pre><code>company
==========
id | name |
==========
1 | C1 |
2 | C2 |
3 | C3 |
position
=================
id | level | name |
==================
1 | 1 | SE |
2 | 2 | SE1 |
3 | 3 | SE2 |
4 | 1 | SA |
5 | 2 | SA1 |
3 | 3 | SA2 |
company_position
==========
cid | pid |
==========
1 | 1 |
1 | 2 |
1 | 3 |
2 | 1 |
2 | 2 |
2 | 3 |
3 | 1 |
3 | 2 |
3 | 3 |
</code></pre>
<p>In the UI, I have a <code><select></code> for displaying Company names. There is a corresponsding slider that should display Position range. onChange on the <code><select></code>, I would like the slider the receive new values for range (min, max, name of Position instead of value). How do I go about solving this? jQuery getJSON? I am not looking for code, rather an approach!</p>
<p><strong>UPDATE</strong>
I realized that my problem is that I am unable to imagine the structure of JSON callback data.</p>
| javascript jquery | [3, 5] |
5,289,559 | 5,289,560 | A jQuery 'if' condition to check multiple values | <p>In the code below, is there a better way to check the condition using jQuery?</p>
<pre><code>if(($('#test1').val() == 'first_value')||($('#test2').val() == 'second_value') && ($('#test3').val()!='third_value')|| ($('#test4').val()!='fourth_value'))
</code></pre>
| javascript jquery | [3, 5] |
4,654,558 | 4,654,559 | Finding CheckBox control in Gridview | <p>I have two template fields in my data gridview. One template field is a CheckBox with ID="AttendanceCheckBox" and the other template field is a Label which is bind to the StudentID field in the Student Table.</p>
<p>What is the C# code for finding the CheckBox in the Gridview?
Also I need to add the value (StudentID) in the Template Field Label to a different database table how would I go about achieving this?</p>
<p>Appreciate all the help. Thanks in advance! </p>
| c# asp.net | [0, 9] |
996,953 | 996,954 | Hover over image to get popup with Flash player embedded with .NET | <p>Not sure if this is possible but here is what I would like to do:</p>
<p>I have a dropdown list and when a user selects an item i would like to show a thumbnail of document. Easy enough.</p>
<p>Now when a user hovers over the document I would like to show a small popup that could display the actual document. The popup would be small and similar to the intext advertising popups. The size is nice and unobtrusive. I could embed an object from DocStoc or I could convert my PDFs to Flash.</p>
<p>Anyone have recommendations for this or experience doing something similar?</p>
| asp.net jquery | [9, 5] |
5,800,889 | 5,800,890 | How should I convert Java code to C# code? | <p>I'm porting a Java library to C#. I'm using Visual Studio 2008, so I don't have the discontinued Microsoft Java Language Conversion Assistant program (JLCA).</p>
<p>My approach is to create a new solution with a similar project structure to the Java library, and to then copy the java code into a c# file and convert it to valid c# line-by-line. Considering that I find Java easy to read, the subtle differences in the two languages have surprised me.</p>
<p>Some things are easy to port (namespaces, inheritance etc.) but some things have been unexpectedly different, such as visibility of private members in nested classes, overriding virtual methods and the behaviour of built-in types. I don't fully understand these things and I'm sure there are lots of other differences I haven't seen yet.</p>
<p>I've got a long way to go on this project. What rules-of-thumb I can apply during this conversion to manage the language differences correctly?</p>
| c# java | [0, 1] |
687,912 | 687,913 | How to access a string using a dynamic string name in android (similar to eval in javascript)? | <p>I'm trying to access string variables using dynamic names depending on what position my gallery is at. To get the value of a string using a fixed name I use the following which is fine (the string is called pic1info):</p>
<pre><code>String strTest = getResources().getString(R.string.pic1info);
</code></pre>
<p>My strings are named pic1info, pic2info, pic3info etc and I want to replace the static definition of pic1info to include the position so pass the contents of the following string in place of pic1info above so that it returns a different string depending on the current position:</p>
<pre><code>String strDynamicStringName= "pic" + position + "info";
</code></pre>
<p>In javascript the equivalent would be eval, i'm sure there's a simple way to do this but i can't work out how!</p>
<p>Thanks so much for your help as ever!</p>
<p>Dave</p>
| java android | [1, 4] |
2,173,166 | 2,173,167 | Compare jQuery Arrays with multiple DOM elements | <p>Consider this:</p>
<pre><code><div class="test">one</div>
<div class="test">two</div>
<script>
var i1 = $('.test');
var i2 = $('.test');
console.log( i1 == i2 );
console.log( i1 === i2 );
console.log( i1.is(i2) );
</script>
</code></pre>
<p>They all print <strong>false</strong> although they contain the same elements. One would think that <code>.is()</code> would work for comparing but it doesnt. How would you compare two jQuery objects?</p>
| javascript jquery | [3, 5] |
2,654,010 | 2,654,011 | jQuery bind all events on object | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5848598/how-all-events-of-dom-element-can-be-bind">How all events of dom element can be bind?</a> </p>
</blockquote>
<p>I have an object that gets events triggered against it.</p>
<p>How do I bind all the events and console.log the event name?</p>
| javascript jquery | [3, 5] |
43,849 | 43,850 | Closing Navigation onClick of any area of the screen | <p>I have a dropdown navigation which opens onClick.</p>
<p>What I want to happen is, that once the ul is open, I want it to close whenever the user goes to open any of the other dropdowns or clicks anywhere away from the dropdown.</p>
<p>At the moment, You have to specifically click the parent li to close the dropdown.</p>
<p>See demo</p>
<p><a href="http://jsbin.com/icotef#" rel="nofollow">http://jsbin.com/icotef#</a></p>
<p>B</p>
| javascript jquery | [3, 5] |
1,922,177 | 1,922,178 | Escaping single-quotes javascript | <p>I think the below problem is something to do with escaping strings, but i'm hoping someone will confirm that.</p>
<p>i need to append event.id to the submit value like so: /Events/Edit/ + event.id. There is definitely content in the event.id property as it displays correctly the second time i use it.</p>
<pre><code>$('.ui-dialog div.ui-dialog-buttonpane')
.append('<button type="submit" value="/Events/Edit/"'
+ event.id
+ ' class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" ><span class="ui-button-text">'
+ event.id + '</span></button>');
</code></pre>
| javascript jquery | [3, 5] |
4,314,180 | 4,314,181 | adding two ranges with range number to Drop Down List | <p>I am getting Range1 and Range2 from database. Dataset is like below.</p>
<p>Range1 Range2 </p>
<p>AB100 XY200</p>
<p>AB300 XY400</p>
<p>AB500 XY600</p>
<p>I have to bind these ranges to a Drop Down List as list items includung range number in my application.</p>
<p>So list item should be like ==> 1 AB100 XY200 . When user selects a range I have to pass Range1 and Range2 to database.</p>
<p>How can I bind the two ranges with range number to Drop Down List.</p>
<p>Regards,</p>
<p>JN</p>
| c# asp.net | [0, 9] |
3,059,061 | 3,059,062 | Check if first time someone goes to asp.net website? | <p>Hello I am creating a basic counter that adds +1 everytime someone accesses the website. The problem is it adds 1 everytime someone goes to another page on the site, not when the person goes to the site for the first time, making the data very inaccurate (ex. One user that accesses the site may go to 8 different pages, therefore adding 8 to the counter, insead of 1). Is there a way to detect when a user is accessing the site on the first initial load?</p>
<p>I'm using asp.net 3.5 in C#.</p>
| c# asp.net | [0, 9] |
3,215,237 | 3,215,238 | JQuery : Add row after the third row of a table | <p>I have a string as 'new row'.I have a table which as 5 rows.I want to add this string after the third row of my table.How i do this using jQuery or javasript. </p>
| javascript jquery | [3, 5] |
5,431,823 | 5,431,824 | How do I bind a "data appended" event in js / jquery? | <p>At the moment, I have a piece of code looking like this:</p>
<pre><code>$("#somediv").append(data);
somethingToDoAfterDataAppended();
</code></pre>
<p>It seems that the data is appended asynchronously, therefor the next function is not necessarily invoked after data is actually appended.</p>
<p>I was thinking about a way to bind this function with 'data appended' event - is it possible?</p>
<p>Any other solution would be equally useful.</p>
| javascript jquery | [3, 5] |
5,392,847 | 5,392,848 | how do i use a class without instantiating it? | <p>I have class:</p>
<pre><code>static class GetRole
{
public static string OfUser(string username)
{
string result="None";
foreach (string key in WebConfigurationManager.AppSettings)
{
if (WebConfigurationManager.AppSettings[key].Contains(username))
{
result = WebConfigurationManager.AppSettings[key];
break;
}
}
return result;
}
}
</code></pre>
<p>i would like to use it lik ethis</p>
<pre><code>string role = GetRole.OfUser(username);
</code></pre>
<p>or like this even better:</p>
<pre><code>string role = GetRole(username);
</code></pre>
<p>how do i do this?</p>
| c# asp.net | [0, 9] |
3,081,107 | 3,081,108 | ASP.NET c# get screen width in pixels | <p>I am trying to retrieve width of my browser in pixels but for some reason I am getting back 640, my resolution is at 1240.</p>
<p>Code I am using is <code>Request.Browser.ScreenPixelsWidth</code></p>
<p>Does anyone knows why it returns 640 always or if there is another way for me to get the width of the browser upon page load?</p>
| c# asp.net | [0, 9] |
2,114,149 | 2,114,150 | Pass 2 arguments to check box | <p>In <a href="http://www.cleancode.co.nz/blog/279/checkbox-repeater-event-handling-argument" rel="nofollow">this</a> example they are passing only 1 argument. Wat if I wanna pass two ?</p>
<p>When I was using Link Button I was using the two Command arguments like <a href="http://stackoverflow.com/questions/4263489/need-help-with-repeater">this</a></p>
<p>Plz check the ItemCommand event in the code above</p>
<p>Now I am clueless how pass 2 args to CheckBox in the repeater! HElp!</p>
| c# asp.net | [0, 9] |
4,749,974 | 4,749,975 | Custom System.Collections.Generic.Contains For Testing Custom Object | <p>How can I rewrite or is there a way to writing my own custom function that simulates the Custom System.Collections.Generic.Contains but only factors in certain Public Properties of a Custom Object?</p>
<p>For example if I have a custom Object with Properties Name and ID, I would like my Unique Value List to contain all the DISTINCT Names. The ID in this case is irrelevant.</p>
<p>List allvalues = new List ({0, "Burger"}, {1, "Pizza"}, {2, "burger"})</p>
<p>I would like it to return me a List which contains the first Object of 0, Burger and 1, Pizza... Irrespective of the ID and the Case of the Name.</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
3,107,068 | 3,107,069 | jquery how to observe any change in the dom for a specific selector | <p>I have a function that looks for the existence and count of the class .dirty on a webpage. It would have to start at a certain point but at that point, I'd like for jQuery to observe for css changes in the DOM and rerun this function. Is this possible? Could I use <code>on()</code> for this? Like:</p>
<pre><code>$(document).on('change','.dirty', dosomething);
</code></pre>
<p>although I know that's different than what change is used for. Basically, the change I want is any <code>addClass</code> or <code>removeClass</code> for '<strong>dirty</strong>'.</p>
<p><strong>sample markup</strong></p>
<p>looking for observing both adding / removing .dirty on 'top-level-menu' so that I can propogate change</p>
<pre><code><div class="top-level-menu dirty" data-menu-global-id="12828">
<input id="menu-name-global-id-12828" size="30" type="text" value="Some value here">
</div>
</code></pre>
| javascript jquery | [3, 5] |
3,357,775 | 3,357,776 | Pre render event in asp.net | <pre><code>protected void rgStateTax_PreRender( object sender, EventArgs e )
{
if( rgStateTax.MasterTableView.IsItemInserted )
{
foreach( GridItem item in rgStateTax.Items )
{
item.Visible = false;
}
}
if( rgStateTax.EditItems.Count > 0 )
{
foreach( GridDataItem item in rgStateTax.Items )
{
if( item != rgStateTax.EditItems[0] )
{
item.Visible = false;
}
}
}
}
</code></pre>
<p>Here, rgStateTax is a Rad grid control. Is there any reason for marking the items as invisible? PreRender is the event before the page is actually displayed on the screen, right?. </p>
| c# asp.net | [0, 9] |
4,169,123 | 4,169,124 | Radio button does not return selected value | <p>i am using radio button list control in asp.net.
i m trying to get selected value on button click Event
but,i m getting <code>Empty string</code> and i want it without javascript.</p>
<p>How can i do this?</p>
<pre><code><asp:RadioButtonList ID="RadioButtonList1" EnableViewState="true" runat="server"
Width="287px">
<asp:ListItem Value="Single" runat="server" Text="Single"></asp:ListItem>
<asp:ListItem Value="Jointly" runat="server" Text="Married Filing Jointly/Widower"></asp:ListItem>
<asp:ListItem Value="Separately" runat="server" Text="Married Filing Separately"></asp:ListItem>
<asp:ListItem Value="Household" runat="server" Text="Head Of Household "></asp:ListItem>
</asp:RadioButtonList>
</code></pre>
<p>C# code </p>
<pre><code>protected void btnCalculate_Click(object sender, EventArgs e)
{
string selectedValue = RadioButtonList1.SelectedValue;
}
</code></pre>
| c# asp.net | [0, 9] |
3,301,448 | 3,301,449 | my simple animate function not working | <p>my html is:</p>
<pre><code><html>
<body>
<button id="widthPlus">increase </button>
<div id="bod"> hai </div>
<img id="tree" src="http://www.rangde.org/newsletter/nov11/images/real_tree.png" width="350"/>
</body>
</html>
</code></pre>
<p>my script is:</p>
<pre><code>$(document).ready(function() {
$("#widthPlus").click(function(){
var currentwidth = $('#tree').attr('width');
var currentwidthNum = parseFloat(currentwidth, 350);
var newwidth = currentwidthNum+5;
$('#tree').animate({'width', newwidth}, 5000);
return false;
});
});
</code></pre>
<p>i am trying to increase(5px) the image width when click a button <a href="http://jsfiddle.net/sureshpattu/XjaD5/2/" rel="nofollow">my jsfiddle is here</a></p>
| javascript jquery | [3, 5] |
473,560 | 473,561 | Scrolling to bottom of the page when link clicked? | <p>I am opening jQuery dialog when a link is clicked. Dialog is opening fine, but the page is scrolling down to page so I can't see the dialog until I scroll up. How to can I avoid this?</p>
<pre><code><script language="javascript" type="text/javascript">
$(document).ready(function () {
jQuery("#waitDialog").dialog({
autoOpen: false,
modal: true,
height: 375,
position: 'center',
width: 400,
draggable: true,
closeOnEscape: false,
open: function (type, data) {
$(".ui-dialog-titlebar-close").hide();
$(this).parent().appendTo("form");
}
});
});
function showDialog(id) {
$('#' + id).dialog("open");
}
</script>
<div id="waitDialog" style="display:none; cursor: default">
<table class="ms-authoringcontrols" style="border-top:1px black solid; border:1px black solid; height:70px " >
<tbody>
<tr>
<td class="ms-sectionheader ms-rightAlign">
Please wait.
</td>
</tr>
</tbody>
</table>
</div>
<map name="Map">
<area shape="rect" coords="225,16,287,33" href="/_layouts/MyAlerts.aspx" onclick="javascript:showDialog('waitDialog');" alt="My Alerts">
</map>
</code></pre>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
1,460,900 | 1,460,901 | How to replace preview of post with full content using jQuery / Javascript? | <p>In a php variable <code>$preview</code> I save about 4 lines of a post without any tags. In the <code>$full</code> I save full of the post with tags.</p>
<p>This is what I used to have, an expand/collapse toogle <a href="http://fiddle.jshell.net/r4F8Q/22/" rel="nofollow">http://fiddle.jshell.net/r4F8Q/22/</a> when I was saving the entire post. But it doesn't look good without tags so I need to go one step forward.</p>
<p>My question is how to change it, so it shows <code>$preview</code> until the user clicks on expand and show the <code>$full</code> post?</p>
<p>Thank you</p>
| javascript jquery | [3, 5] |
3,436,431 | 3,436,432 | Not able to load certain part of page using jquery | <p><p>Hi, I have a html page with a div tag that is being populated dynamically using javascript. Now, I have to open only the contents of the div tag in another page and I am not able to do that. I have tried using iframes, jquery load etc. but nothing is working.<br/>Either the whole page is displayed or the empty div (before execution of javascript)is displayed. </p> So, is there anyway to make sure that when the required page is loaded on different page , the javascript is already executed, so that when the contents of div are captured, it is already populated. </p>
| javascript jquery | [3, 5] |
471,710 | 471,711 | ASP.net saving hidden divs state | <p>I have a hacked up drop down box which displays and hides certain divs.</p>
<pre><code><div id="dropDownMenu" onclick="showMenu();">Option 2
<ul>
<li onclick="showDiv('div1');">Option 1</li>
<li onclick="showDiv('div2');">Option 2</li>
<li onclick="showDiv('div3');">Option 3</li>
</ul>
</div>
</code></pre>
<p>This works perfectly fine, except when my asp form button is clicked it reloads the page to the default load view (show Option 2 and div2). How do I make it so the combobox does not reset to default every time I click the asp form button?</p>
<p><strong>Edit:</strong> Okay I was able to add the hidden field no problem but I've never used the clientID property. Help me out?</p>
<p>html: </p>
<pre><code><asp:HiddenField ID="currentSelection" value="div2" runat="server" />
</code></pre>
<p>javascript:</p>
<pre><code>document.getElementById('currentSelection').value=divName;
</code></pre>
<p>Then I want to add </p>
<pre><code>showDiv(document.getElementById('currentSelection').value)
</code></pre>
<p>to the end of my button click.</p>
| javascript asp.net | [3, 9] |
2,156,818 | 2,156,819 | What's the opposite of jQuery `.get()`? | <p><code>.get()</code> converts a jQuery object to a DOM element that Javascript can use without jQuery.</p>
<p>If I have a DOM element, how can I convert it to a jQuery object?</p>
| javascript jquery | [3, 5] |
5,307,239 | 5,307,240 | Access an asp:hiddenfield control in JavaScript | <p>What is the best way to access an ASP.NET HiddenField control that is embedded in an ASP.NET PlaceHolder control through JavaScript? The Visible attribute is set to false in the initial page load and can changed via an AJAX callback.</p>
<p>Here is my current source code:</p>
<pre><code><script language="javascript" type="text/javascript">
function AccessMyHiddenField()
{
var HiddenValue = document.getElementById("<%= MyHiddenField.ClientID %>").value;
//do my thing thing.....
}
</script>
<asp:PlaceHolder ID="MyPlaceHolder" runat="server" Visible="false">
<asp:HiddenField ID="MyHiddenField" runat="server" />
</asp:PlaceHolder>
</code></pre>
<p><b>EDIT:</b> How do I set the style for a div tag in the ascx code behind in C#? This is the description from the code behind: CssStyleCollection HtmlControl.Style</p>
<p><b>UPDATE:</b> I replaced the asp:hiddenfield with an asp:label and I am getting an "undefined" when I display the HiddenValue variable in a alert box. How would I resolve this.</p>
<p><b>UPDATE 2:</b> I went ahead and refactored the code, I replaced the hidden field control with a text box control and set the style to "display: none;". I also removed the JavaScript function (it was used by a CustomValidator control) and replaced it with a RequiredFieldValidator control. </p>
| asp.net javascript | [9, 3] |
615,515 | 615,516 | How do i split into a block of 3? | <p>I want to separate a set of 3 numbers with a comma and set the value to a textarea, i have tried this but it just brings the values concatenated like this "5.685.685.85", i want it to appear like this "5.68, 5.68, 5.85"</p>
<pre><code>var once = window['tma'+kj].toFixed(2);
for (var li=0; li<once.length; ++li) {
$('#comments').append(once[li]); //div tag, it shows concateneted
$('#com').val(once[li]); //textarea id, brings blank
}
</code></pre>
| javascript jquery | [3, 5] |
4,191,996 | 4,191,997 | How does Android accelerometer (Java in general) handles call back listeners? | <p>This question is basic for Java, not android. If the code that is inside listener interface does some complex calculations, what happens for callbacks given by the system. In Android accelerometer readings are collected in onSensorChanged(SensorEvent event).
If I want to process "event" data and that its called around 30-40 times a second. What happens ? </p>
<p>Does this reduces the calls to function?
Or Does this lags the output but all call will finally get executed ?</p>
<p>I know this should be handled in separate thread, but if large number of threads keep generating , this may be a problem.
Also I cannot rely on Java System.currentTimeMillis(); for pinging every say 500 milliseconds as this is never reliable (in a way it guarantees the function will not called before 500 ms but not maximum time like it may be even after 1000 second, which in my case would be a problem as I need data atleast in 500ms).</p>
<p>Or should I consider TimerTask instead for collecting data every 500 ms?</p>
| java android | [1, 4] |
4,759,550 | 4,759,551 | Can't seem to access image files and other files in an ASP.net solution | <p>I have a page file with an Ultrawebgrid that has an image on its cell. The source of that image is located on a folder which is still part of the solution. However, when I have set its location and execute the program, all it displays is the error image (x). I have checked and validated that the image is still on the specific folder. I have also tried adding '~/' on the start of the source thinking that it would fix the issue. And when I tried accessing other files, same error occurs. This only happens on a specific web page. All other pages seems to be working fine. Here is how I attach the image to a cell in a grid:</p>
<pre><code>e.Row.Cells.FromKey("DataCollectionName").Value = "Tester Summary " + "<img alt='' id='btnView' runat='server' src='Scripts/CSS/Images/view-icone-6308-32.png' style='cursor: Hand' onclick='openWindow(\"" +
searchFilter.LotToSearch + "\",\"" + e.Row.Cells.FromKey("fromspecid").Value + "\",\"" + e.Row.Cells.FromKey("fromspecname").Value + "\",\"" + e.Row.Cells.FromKey("wiptrackinggroupkeyid").Value + "\");'></button>";
</code></pre>
<p>Thanks for helping again guys.</p>
| c# asp.net | [0, 9] |
2,312,083 | 2,312,084 | How would you tackle this php/mysql | <p>I am building a dynamic (food) menu system for a website. Users will be able to add and remove menu items as they like and alter price etc. If the menus were static then I would have a static form for example </p>
<pre><code><form id="order_form" action="order.php" method="POST" class="form">
<ul>
<li>cheese burger<input type="text" name="cheese_burger_items" /></li>
<li>bacon burger<input type="text" name="bacon_burger_items" /></li>
<li>steak burger<input type="text" name="steak_burger_items" /></li>
<li>fish burger<input type="text" name="fish_burger_items" /></li>
<li>lamb burger<input type="text" name="lamb_burger_items" /></li>
<input type="submit" value="Submit" />
</form>
</code></pre>
<p>Then the order.php would start out like</p>
<pre><code><?php
$cheese_burger_items = $_POST['cheese_burger_items'];
$bacon_burger_items = $_POST['bacon_burger_items'];
$steak_burger_items = $_POST['steak_burger_items'];
$fish_burger_items = $_POST['fish_burger_items'];
$lamb_burger_items = $_POST['lamb_burger_items'];
?>
</code></pre>
<p>This is obviously a grossly simplistic view of it.</p>
<p>The amount of items would vary also. What would be the dynamic approach to doing this? I guess for the input 'name' I could use the index name in the database but that doesn't really help me in order.php as I will need to have a POST for each uniqe item. </p>
| php javascript | [2, 3] |
2,477,361 | 2,477,362 | How to handle AsyncTask failure | <p>Is there a specific way to handle failure in an AsyncTask? As far as I can tell the only way is with the return value of task. I'd like to be able to provide more details on the failure if possible, and null isn't very verbose.</p>
<p>Ideally it would provide an onError handler, but I don't think it has one.</p>
<pre><code>class DownloadAsyncTask extends AsyncTask<String, Void, String> {
/** this would be cool if it existed */
@Override
protected void onError(Exception ex) {
...
}
@Override
protected String doInBackground(String... params) {
try {
... download ...
} catch (IOException e) {
setError(e); // maybe like this?
}
}
}
</code></pre>
| java android | [1, 4] |
5,024,078 | 5,024,079 | Which one is better performance to use for .click in the below list | <blockquote>
<p>Please vote for me which one in the below list is better?</p>
</blockquote>
<p>I have HTML:</p>
<pre><code><div id="container">
<button class="btn">Click Here 1</button>
<button class="btn">Click Here 2</button>
<button class="btn">Click Here 3</button>
<button class="btn">Click Here 4</button>
<button class="btn">Click Here 5</button>
<button class="btn">Click Here 6</button>
<!-- A lot of buttons -->
<button class="btn">Click Here n - 2</button>
<button class="btn">Click Here n - 1</button>
<button class="btn">Click Here n</button>
</div>
</code></pre>
<p>And Javascript with jQuery is:</p>
<h3>Case 1.1:</h3>
<pre><code>$(".btn").click(function(e){
//@todo something here
});
</code></pre>
<h3>Case 1.2:</h3>
<pre><code>var doSomething = function(e)
{
//@todo something here
}
$(".btn").click(doSomething);
</code></pre>
<h3>Case 2:</h3>
<pre><code>$("#container").click(function(e){
if( $(e.target).is(".btn") )
{
//@todo something here
}
});
</code></pre>
<p>I am confused a litle bit what are different between them?</p>
| javascript jquery | [3, 5] |
4,729,768 | 4,729,769 | JS/jQuery: how many character occurance in textarea | <p>Assuming:
str value = 'This is some text';</p>
<p>I want to count how many 't' occurrences, how to do that?</p>
| javascript jquery | [3, 5] |
4,064,160 | 4,064,161 | android post https request through HtttpClient apache | <p>I've created complete method that executes https and returns an answer as a string.</p>
<pre><code> public static String makeHttpsRequest(String url) throws ClientProtocolException, IOException {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
HttpParams params = new BasicHttpParams();
params.setParameter("name", "Arthur");
SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry);
HttpClient client = new DefaultHttpClient(mgr, params);
HttpPost httppost = new HttpPost(url);
HttpResponse response = client.execute(httppost);
BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = in.readLine()) != null) {
// System.out.println(line + "[break]");
sb.append(line);
}
return sb.toString();
}
</code></pre>
<p>There are no errors returned, but neither a string result?
May be something wrong in my code?
Please, help.</p>
| java android | [1, 4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.