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,333,316 | 1,333,317 | using single quote or double quote | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/242813/when-to-use-double-or-single-quotes-in-javascript">When to Use Double or Single Quotes in JavaScript</a><br>
<a href="http://stackoverflow.com/questions/3149192/difference-between-single-quotes-and-double-quotes-in-javascript">Difference between single quotes and double quotes in Javascript</a> </p>
</blockquote>
<p>When I started learning jQuery, I frequently found examples using single quote or double quote as jQuery selector:</p>
<p><code>$('#myDiv');</code> or <code>$("#myDiv");</code></p>
<p>They are basically the same. But which one is used prefer and fast execute please let me know.</p>
| javascript jquery | [3, 5] |
1,830,730 | 1,830,731 | mysql_real_escape_string() -> stripslashes() -> jquery.append() | <p>im letting my users type in texts, then take them to server side php and process them, and if everything goes as it should, i just append the text with jquery without the page having to load all over again.</p>
<p>This is the procedure:</p>
<pre><code>$post_text = htmlspecialchars(mysql_real_escape_string($_POST['post_text']));
</code></pre>
<p>some logic...</p>
<p>everything ok!</p>
<pre><code>stripslashes(str_replace("\\n", "", $post_text))
</code></pre>
<p>and then i send all the nessesary data witj json</p>
<pre><code>echo json_encode($return);
</code></pre>
<p>on the client side i append the html chunk saved in a variable from the server side.</p>
<p>this seems to work on localhost, it removes all the slashes and so on, but online it just doenst remove the slashes, and they keep coming up, when i hit refresh they dissapear becouse then its a </p>
<pre><code>stripslashes($comment['statusmsg_text'])
</code></pre>
<p>written out with php straight from the database. Is it the json that adds some extra stuff? i dont get it becouse it works perfectly on localhost.</p>
<p>best of regards,
alexander</p>
| php jquery | [2, 5] |
4,460,275 | 4,460,276 | $ undefined error | <p>I'm developing a Chrome extension and I've got the following...</p>
<pre><code> $(document).keypress(function(event){ resizeDialogIFrame(overlaydiv, iFrame.contentWindow); });
</code></pre>
<p>But when executed I'm getting the following error...</p>
<p><code>Uncaught ReferenceError: $ is not defined</code></p>
<p>However, <code>$('form[name="gs"]').attr('action');</code> is working fine elsewhere in the page.. What's going wrong?</p>
| javascript jquery | [3, 5] |
1,611,365 | 1,611,366 | Javascript & ASP .NET problem | <p>I'm having some problems with implementing javascript controls in my asp.net page. I would like to have a set of variables get their values based on some asp button controls. Then I manipulate those buttons based on how they are clicked. I'm having some issues though:</p>
<ol>
<li>Any global variables I define and give a value to are coming back as null</li>
<li>I can't run a onload event, because all my variables come back as null. </li>
<li>I can't use the asp.net tags of visible="false" because then the javascript can't show the control for some reason. </li>
<li>the javascript style.visibility="visible" doesn't really work as you can still see where the button would be - it just isn't visible. </li>
</ol>
<p>So here is my code. The TL,DR is I'd like to run some behavior to conditionally show/hide buttons via js on load, and then hide/show buttons on different button clicks. I know it is a scope issue, as the global variables return "null" when I test them, but I don't know a good workaround for that and the onload issue. Thanks!</p>
<pre><code>var btnEdit = document.getElementById("<%= cmdEdit.ClientID %>");
var btnSave = document.getElementById("<%= cmdSave.ClientID %>");
var btnCanvel = document.getElementById("<%= cmdCancel.ClientID %>");
var btnConfirm = document.getElementById("<%= cmdConfirm.ClientID %>");
function HideEdit(){
$(btnEdit).hide();
$(btnSave).show();
$(btnCancel).show();
$(btnConfirm).hide();
document.getElementById("<%= pnlWhy.ClientID %>").style.visibility = "visible";
document.getElementById("<%= pnlRequest.ClientID %>").style.visibility = "visible";
}
function testme() {
alert(btnEdit)
}
function loadpage(newwine){
if (newwine==true){
$(btnEdit).hide();
$(btnSave).show();
$(btnCancel).show();
}
else{
$(btnEdit).show();
}
$(btnConfirm).hide();
}
</code></pre>
| javascript asp.net | [3, 9] |
992,721 | 992,722 | to get a list of bools, .contain() | <p>how do i do a list for bools in javascript. im doing a validation so i can have a list of bools and at the end i want to check that list if it contains any errors. im not sure how to add to the varable <code>validations_errors</code> (like a list). Plus i dont know how i can check if that list contains any true values.</p>
<p>what i got so far is this</p>
<pre><code>var validation_errors;
if (!validateForm($(this))) {
validation_errors = false; //here i want to add the it to a list
var $input_container = $(this).parents('.input');
$input_container.removeClass('success').addClass('error');
}
//this is something what i want to do like (this code is c# based)
if (validation_errors.contains(true)){
// do some actions
}
</code></pre>
<p><strong>EDIT</strong><br />
list of bools = list of true & false</p>
| javascript jquery | [3, 5] |
1,710,733 | 1,710,734 | Background Won't Turn Black with jQuery | <p>The code that I have is as follows:</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<script src="javascript/jquery.js" type="text/Javascript"> </script>
</head>
<body>
<div id="demo"></div>
<script type="text/javascript">
document.getElementById("demo").innerHTML="Hi";
</script>
<script type"text/javascript">
$(function()
{
$("#demo").css("background", "#000000");
}
</script>
</body>
</html>
</code></pre>
<p>The issue that I'm having is that the second block of JS/Jquery doesn't turn the background of the div black. What am I doing wrong?</p>
| javascript jquery | [3, 5] |
3,581,725 | 3,581,726 | Loading Value of Input into Slider Options | <p>I need the variable "value" in my slider plugin to be the integer value of a input in the form:</p>
<pre><code>$(function () {
$("#calcSlider").slider({
min: 0,
max: 90,
step: 5,
value: /* ACCESS HERE!!!!!! */,
slide: function (event, ui) {
$("#calcSup").val(ui.value);
}
});
});
</code></pre>
<p>I need <code>value:</code> to be the value in <code>calcSup</code> or <code>${form.calcSup}</code>, but that is a string. I need it parsed to a int:</p>
<pre><code><input type="text"
id="calcSup"
name="calcSup"
value="${form.calcSup}"
size="3"
readonly="readonly" />
</code></pre>
| javascript jquery | [3, 5] |
3,878,553 | 3,878,554 | How to toggle checkbox selection rather than only selecting? | <p>I currently am using this JavaScript code snippet to select 3 checkboxes at a time</p>
<pre><code>$(document).ready(function() {
var $cbs = $('input:checkbox[name="select[]"]'),
$links = $('a[name="check"]');
$links.click(function() {
var start = $links.index(this) * 3,
end = start + 3;
$cbs.slice(start,end).prop("checked",true);
});
});
</code></pre>
<p>Currently this code only selects the checkboxes, however I was wondering if anyone knew how to modify it so that it toggles the checkbox selection on and off?</p>
<p>Here's an example of my current code: "<a href="http://jsfiddle.net/ShZNF/" rel="nofollow">jsfiddle</a>" - click the 1-3, 4-6 links etc to check the checkboxes.</p>
| javascript jquery | [3, 5] |
2,257,715 | 2,257,716 | Gradually change colour of a bitmap? | <p>I've got several bitmaps on the screen that gradually need to change colours depending on values they are set. I've looked into LightingColorFilter, PorterDuffColorFilter and ColorMatrix but the problem is the colours change constantly (tens of times a second and many objects). The problem with the 2 above is they create memory leaks and performance problems.</p>
<p>Can anyone suggest a way of gradually changing the colour of the bitmap (without creating a new bitmap or storing the canvas temporary? - also performance hinders). I've looked around and it doesn't seem possible without OpenGL (Something I have no clue about).</p>
| java android | [1, 4] |
3,334,748 | 3,334,749 | How to show some progress animation in my textbox | <p>I want to show some progress animation in my textbox. Becoz when i click on save button .Records added to the gridview are inserted in the database which return a unique id. This id i want to display in the textbox. But this process takes some time meanwhile i want to show some progress animation inside the textbox. what is the simplest way that i have?</p>
| javascript asp.net | [3, 9] |
5,117,308 | 5,117,309 | How to extend list of objects to automatically update property based on position in list | <p>Let's say I have a class Car like this: </p>
<pre><code>class car
{
string model;
int position;
}
</code></pre>
<p>Position is a number from 1 to n, which basically reflects position in the list.
if I have two cars in list they will have positions 1 2.
Now, I'd like to reorder those cars in list in the UI and reflect change in the property for later uses.<br>
So I have a table with several rows: </p>
<pre><code>Car1 1
Car2 2
Car3 3
Car4 4
</code></pre>
<p>Now, If I want to reorder items I can drag Car4 and place it at position 2 (right after Car1).<br>
So, my positions will be as follows: </p>
<pre><code>Car1 1
Car4 2
Car2 3
Car3 4
</code></pre>
<p>So, what I want to do is to update one item in the list, and all other items will be automatically updated.</p>
| c# asp.net | [0, 9] |
3,302,480 | 3,302,481 | Asp.net detailsview - get data after update | <p>I have a web page with an editable DetailsView. After it is (successfully) edited, I need to use some of the edited fields to update some other tables in the database (in the code behind). I tried to use the DetailsView.DetailItem in the DetailsView_ItemUpdated event code, but the DetailItem isn't available any more - it is null. What's the best way to get at the updated field information?</p>
| c# asp.net | [0, 9] |
750,416 | 750,417 | How to find a parent's child with jQuery? | <p>I have a menu that looks like this:</p>
<pre><code><ul class="menu">
<li><a href="#">zing</a></li>
<li>
<a href="#">page</a>
<ul>
<li>foo</li>
<li>bar</li>
</ul>
</li>
</ul>
</code></pre>
<p><br>
I'd like the sub menu to fadeIn when I hover over the <strong>page</strong> link.
This is my code so far but for some reason it's not working and I don't think this is the correct way to achieve this anyways:</p>
<pre><code>$('.menu li a:nth-child(2)').hover(function(){
$('.menu li ul').fadeIn(150);
}, function(){
$('.menu li ul').fadeOut(150);
});
</code></pre>
<p><br>Anyone know how I can reach my goal according to best standards to make the submenu of the 2nd li to appear when I hover over <strong>page</strong>?</p>
| javascript jquery | [3, 5] |
3,171,926 | 3,171,927 | how to set background color of title bar of popup window in jquery | <p>Can any one please tel me that how to set background color of title bar of popup window in jquery. </p>
<p>Title text is "Email Options".</p>
<pre><code> function showEmailDlg() {
var dlg = $('#dlgEmail').dialog(
{
draggable: true,
position: 'center',
modal: true,
width: 1028,
height: 568,
title: 'Email Options',
resizable: false
}
);
dlg.parent().appendTo($("form:first"));
}
</code></pre>
| jquery asp.net | [5, 9] |
3,608,357 | 3,608,358 | ASP:label and javascript getElementById | <p>I'm trying to get the value of the <code>Text</code> property of an <code>asp:label</code> with Javascript's <code>document.getElementById</code> method, using the following code</p>
<pre><code><asp:Label ID="lblThis" runat="server" Visible="False" Text="this is a label" />
<script type="text/javascript" language="javascript">
var lblThis = document.getElementById('<%= lblThis.ClientID %>')
var lblThisText = lblThis.innerText
alert(lblThisText)
</script>
</code></pre>
<p>When I open the page, nothing happens. I am not a javascript guy, so I have no idea where I'm going wrong. I also am not trying to set any properties here, just read the value of an <code>asp:label</code> into javscript.</p>
<p>Any tips, pointers, or help given is appreciated.</p>
<p>UPDATE</p>
<p>I have replaced <code>Visible="false"</code> with <code>style="display:none"</code> as per <a href="http://stackoverflow.com/a/11264150/312777">Mennan's answer</a>, and now get an alert with "undefined". The right direction, but I'm still not there yet.</p>
<p>UPDATE</p>
<p>I have a working chunk of code now. <code>innerText</code> had nothing, but <code>innerHTML</code> had the right string. Correct code:</p>
<pre><code><asp:Label ID="lblThis" runat="server" style="display:none" Text="this is a label" />
<script type="text/javascript" language="javascript">
var lblThis = document.getElementById('<%= lblThis.ClientID %>')
var lblThisText = lblThis.innerHTML
alert(lblThisText)
</script>
</code></pre>
| javascript asp.net | [3, 9] |
3,438,820 | 3,438,821 | jQuery toggle element style but pausing briefly inbetween | <p>I have an element which I am toggling the style of (like an on/off button). If it's currently 'on', change the style to 'off' and vice versa.</p>
<p>However, in some scenarios, I want to perform the above, but then revert to it's original state (cancelling out the toggle), but I want this to be reflected to the user by it's very brief change in style (so for 1/2 a second, it looks like it has changed style but then reverts back to it's original state.</p>
<p>I'm currently toggling the state of my button with the below code:</p>
<pre><code>myButton.toggleClass('button-off').toggleClass('button-on');
</code></pre>
<p>I've tried chaining a <code>delay(500)</code> between the above and a 'flip' of the above line, but that doesn't work.</p>
| javascript jquery | [3, 5] |
5,752,184 | 5,752,185 | Using javascript APIs in Java | <p>I am writing a standalone application in Java that needs to be able to call custom Javascript APIs? Is there a way to call custom Javascript APIs in Java?</p>
| java javascript | [1, 3] |
5,950,807 | 5,950,808 | Vertically centering child div in parent container with JavaScript on page load is not setting position? | <p>I am using JavaScript to vertically center a child div within a fluid container. I essentially accomplish this by calculating the height of the parent container and the height of the child div. I then absolutely positon the child div in the center of the parent div based on the height. The issue I am experiencing is that when the page loads, it does not set the position of the child div. I created a function out of this and call it when the window is resized so that when the viewport changes it recalculates dynamically. How would I go about initially setting this position on page load? </p>
<pre><code><div class="lead">
<div class="message"></div>
</div>
var homepageLead = function () {
var lead = $('.lead'),
message = $('.message'),
lead_height = lead.height(),
message_height = message.height(),
lead_center = .5 * lead_height,
message_center = .5 * message_height,
center = (lead_center - message_center);
message.css('bottom',center);
}
homepageLead();
$(window).resize(function () {
homepageLead();
});
</code></pre>
| javascript jquery | [3, 5] |
2,399,611 | 2,399,612 | What is the proper use of Jquery's $get to retrieve a control | <p>How might I reference a control in JQuery so that it wont throw an error if the control doesnt exist?</p>
<p>ie: this at the moment throws server error in asp.net</p>
<pre><code>if ($get('<%= Panel1.ClientID %>') != null) { <-- Fails with "The name 'Panel1' does not exist in the current context"
$get('<%= Panel1.ClientID %>').scrollTop = yPos;
}
</code></pre>
<p>which is present in a master page, but for certain content pages will exist, in those cases I have code to reset the scroll position.</p>
<p>Thanks</p>
| c# jquery asp.net | [0, 5, 9] |
2,599,417 | 2,599,418 | page method question | <p>I'm building an asp.net page that uses a page method call from jquery. This is a simple test page but I can't get it to work and I can't see why.</p>
<p>I added a script manager to the aspx. Here's the javascript function:</p>
<pre><code><script type="text/javascript">
function CallGetLoaded() {
var ConfirmLoad = "test string";
$.ajax({
type: "POST",
url: "../Pages/TestPage.aspx/GetLoaded",
data: ConfirmLoad,
contentType: "application/text; charset=utf-8",
dataType: "text",
success: successLoadLeads,
error: errorLoadLeads
});
};
function successLoadLeads(thereturn) { alert((thereturn)); };
function errorLoadLeads() { alert("problem getting return"); };
</script>
</code></pre>
<p>And here's the full code behind:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;
using System.Web.Services;
public partial class Pages_TestPage : System.Web.UI.Page
{
[WebMethod]
public static string GetLoaded(string ConfirmLoad)
{
string ResultString = "got test";
return ResultString;
}
}
</code></pre>
<p>Instead of getting back a simple string in the alert popup, I'm sometimes getting back the HTML of the whole page and sometimes the error function; not sure why it varies.
What am I missing?</p>
<p>Thanks for your suggestions.</p>
| c# asp.net | [0, 9] |
1,164,219 | 1,164,220 | Calling a PHP function from a JS function, using parameters | <p>I would like to use a JS function to call a PHP function using a parameter.<br><br>
So the JS function ipOpts() will call the PHP function getColumns() using the myField as a parameter.<br><br>
I have tried to do something but it's not working.<br><br>
<hr><br></p>
<p>JS file:</p>
<pre><code>var ipOptsArray= new Array({"label" : "a", "value" : "a"});
function ipOpts(myField){
ipOptsArray.splice(0,1);
$.ajax({
url: './get_fields.php?myField='+myField,
async: false,
dataType: 'json',
success: function (json) {
for(var a=0;a<json.length;a++){
obj= { "label" : json[a][0], "value" : json[a][1]};
ipOptsArray.push(obj);
}
}
});
return ipOptsArray;
}
</code></pre>
<p><br><hr><br>
PHP file:</p>
<pre><code><?php
function getColumns($myField){
$connection = mysql_connect('localhost', 'mbrconsu_un394x', 'y1cz9,rd+hf6') or die(mysql_error());
mysql_select_db('mbrconsu_mmx', $connection) or die(mysql_error());
$sql="SELECT * FROM treinamentos ORDER BY" '$myField' "ASC";
$result = mysql_query($sql);
$stack=array();
while($row = mysql_fetch_array($result))
{
array_push($stack,array($row[$_GET['myField']],$row[$_GET['myField']));
}
echo json_encode($stack);
}
?>
</code></pre>
| php javascript | [2, 3] |
2,366,978 | 2,366,979 | Setting a SELECT element by text, not value | <p>I'm sure this is relatively easy and straightforward, but I'm having no success figuring it out.</p>
<p>I am trying to set the selected option of a drop down list element using the following code:</p>
<pre><code> if ($(this).attr("tagName") == "SELECT") {
oldValue = $(this).parent().parent().find('span.displayField').text();
$(this).val(oldValue).attr("selected", "selected");
return;
}
</code></pre>
<p>But it is not changing the select element at all. The code is definitely running, and <code>oldValue</code> is being populated appropriately.</p>
<p>Can anyone see what I might be missing?</p>
<p>Thanks!</p>
<p>UPDATE:</p>
<p>For clarification, here is the HTML:</p>
<pre><code> <span class="displayField">Pending</span>
<span class="editField">
<select data-val="true" data-val-number="The field ProgramStatusId must be a number." data-val-required="The ProgramStatusId field is required." id="ProgramListViewModels_0__ProgramStatusId" name="ProgramListViewModels[0].ProgramStatusId">
<option value="1">Pending</option>
<option value="2">Tabled</option>
<option value="3">Approved</option>
<option value="4">Declined</option>
</select>
</span>
</code></pre>
| javascript jquery | [3, 5] |
5,586,611 | 5,586,612 | finding wrong characters in javascript | <p>Since I am about to write a small php-script I like to call to get all the javascript for my page, this leads to strange error on client side. The script does actually use an configuration xml-file and some xsl-stylesheets to generate an large Javascript string. Sometimes it happens that I get an 'unterminated String literal' error, sometimes an error rises that says: 'An attempt was made to use an object that is not, or is no longer, usable', just after the javascript executes an document.write operation.
Are there any resources, or is there any tutorial, just something that reveals about the traps of running into such problems when copying a bunch of javscript files into one String or file?</p>
<p>greetings philipp</p>
<p>EDIT::
the following error:</p>
<p><img src="http://i.stack.imgur.com/hqwM0.png" alt="the error message"></p>
<p>is thrown in an webpage that is delivered with content-type: 'application/xhtml+xml'. The actual generated Javascript looks like this:</p>
<p><a href="http://pastebin.com/8V302mz9" rel="nofollow">source code generated</a></p>
<p>The script itself runs until the first document.write command is triggered.</p>
| php javascript | [2, 3] |
123,940 | 123,941 | ASP.Net Maintain a list of objects for a button click event | <p>I am creating an asp.net page which loads data from a (SQL) visual studio database file (.mdf). </p>
<p>The data is loaded into a list of User objects (List) which contain the user data obtained from the database. This data is then displayed in a ASP.net table with a check box in column one. This allows the person viewing the webpage to in theory select users via the check boxes. </p>
<p>I have an ASP.net button also on the same page which when clicked will cause a post-back and go through the table row's and correctly identify which rows have and have not been checked. I am able to get the user data at this point as the Page_Load event is fired and the database contents are re-loaded for the second time.</p>
<p>Obviously this could become quite expensive obtaining the full list of users on each Page_Load so I have started investigating using the IsPostBack variable which allows me to identify whether it is a button click or standard page load.</p>
<p>The problem I have when using IsPostBack is the database contents loaded into the List on the initial Page_Load event would now be equal to null as the call into the database would never occur. This is understandable expected behavior and my question is what would be the best way to preserve the contents of the list so the button click can access the data loaded from the database on the initial Page_Load, without having to do another database query?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
2,317,030 | 2,317,031 | How to send data to another Android Aplication and receive the processed data back? | <p>I want to create two separate Android applications to behave like this:</p>
<p>MainAplication will call Aplication2 when a buttom is clicked, then the MainAplication will send some data to Aplication2, Aplication2 will open in front of the MainAplication(top of the screen), will process the information sent and then when a buttom inside Aplication2 is clicked it will disappear and the MainAplication will remain on the top the screen and receive the information procesed.</p>
<p>Can you please give me an idea on how to complete this approach. </p>
<p>A basic idea of what I want to create is this:</p>
<p><a href="http://imgur.com/bUCub" rel="nofollow">Apps Idea</a></p>
| java android | [1, 4] |
3,560,065 | 3,560,066 | getting error while replacing the single quotes from text | <p>I have a text box with tinyMCE editor, i am giving some text from that text box with single quotes, but in query it is showing syntax error</p>
<p>I am trying to remove the single quotes by this </p>
<pre><code>txbCaption.Text = txbCaption.Text.Replace("'", "''");
</code></pre>
<p>and my query</p>
<pre><code>public void UpdateCaptions(Hashtable hashtable)
{
if (hashtable != null)
{
foreach (int key in hashtable.Keys)
{
string query = "update Image set Description='" + hashtable[key] + "' where Id=" + key;
// in this query i am getting error
SqlHelper.ExecuteNonQuery(Conn, CommandType.Text, query);
}
}
}
</code></pre>
<p>first i am calling replace Text.Replace("'", "''");<br>
after that i am assigning this to </p>
<pre><code>if (ViewState["imgIdCapHtbl"] != null)
imgIdCapHtbl = (Hashtable)ViewState["imgIdCapHtbl"];
int index = Convert.ToInt32(ViewState["pSelecectedImgIndex"]);
if (imgIdCapHtbl != null && imgIdCapHtbl.ContainsKey(imgIds[index]))
imgIdCapHtbl[imgIds[index]] = txbCaption.Text;
</code></pre>
<p>and imgIdCapHtbl hashtable key i am sending to query for saving discription</p>
<p>when i am giving the single quotes in my text then in query 2 times single quotes is getting added.</p>
<p>I used regular exp. validation also but because of TinyMCE editor its not working for that.</p>
<p>some one plz tell me how to replace single quotes, I want if user wants to give single to with text then text box should accept the single quotes and my data gets save without any error, </p>
| c# asp.net | [0, 9] |
5,537,437 | 5,537,438 | how can i show string one activity to another activity on a 9*9 sudoku grid? | <p>i want to show string one activity to another activity another activity is the sudoku game class and want to show the string like a sudoku puzzle on the sudoku screen board on the sudoku game class.sudoku grid is 9*9.</p>
| java android | [1, 4] |
3,366,070 | 3,366,071 | Java and C# pass by value differences | <p>I think the code below will make my question clear. If they both pass by value, why are they different. </p>
<p>C# below:</p>
<pre><code>static void Main(string[] args)
{
var list = new List<int> {1, 2, 3,};
ChangeVars(list);
foreach (var i in list)
{
Console.WriteLine(i);
}
Console.Read();
}
private static void ChangeVars(List<int> list)
{
for(int i = 0; i < list.Count; i++)
{
list[i] = 23;
}
}
</code></pre>
<p>Returns 23, 23, 23, </p>
<p>Java below:</p>
<pre><code>public static void main(String[] args)
{
List<Integer> goods = new ArrayList<Integer>();
goods.add(1); goods.add(2); goods.add(3);
ChangeThings(goods);
for(int item: goods)
{
System.out.println(item);
}
}
private static void ChangeThings(List<Integer> goods)
{
for(int item: goods)
{
item = 23;
}
}
</code></pre>
<p>Returns 1, 2, 3.</p>
<p>I don't understand the discrepancy. </p>
| c# java | [0, 1] |
1,952,541 | 1,952,542 | strange Report VIewer Error: Could not load file or assembly 'App_WebReferences.e8ik1wuc | <p>I'm connecting to a MS NAV 2009 web service in my asp.net 4.0 web application...every other communication with the web service works fine but when i try to create a report with the report wizard i get the error below:</p>
<blockquote>
<p>"Could not load file or assembly 'App_WebReferences.e2c6mdeb,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. The system cannot find the file specified."</p>
</blockquote>
<p>Copying the assembly to the Bin folder resolves the problem but then another error occurs and the app can't compile. Error:</p>
<blockquote>
<p>"The type 'eOnline.LessonsClasses' exists in both
'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\cavendishwebonline\9db1de22\42dd86dd\App_WebReferences.zxqfnb5w.dll'
and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\cavendishwebonline\9db1de22\42dd86dd\assembly\dl3\048caf7e\caa8a704_c13fcd01\App_WebReferences.e2c6mdeb.DLL'"</p>
</blockquote>
<p>I would appreciate some assistance on this issue.</p>
| c# asp.net | [0, 9] |
1,006,849 | 1,006,850 | Using of custom typeface for drawing on canvas Java Android | <p>I have a custom typeface which I have loaded in Typeface object with Typeface.createFromAsset(...). I need to drawing 1 symbom from this typeface with char-code 37 on canvas. I use this code:</p>
<pre><code>String s=String.valueOf(((char)37));
Paint paint=new Paint();
paint.setTypeface(mNoteTypeface);
paint.setTextSize(30);
canvas.drawText(s, 20, 20, paint);
</code></pre>
<p>But result doesn't be good. I have the program for viewing fonts and one showed me that:
<a href="http://imagepost.ru/?v=qzvcgsbbxkldahdxuptuuvuyyugqlx.jpg" rel="nofollow">http://imagepost.ru/?v=qzvcgsbbxkldahdxuptuuvuyyugqlx.jpg</a> </p>
<p>Help me to create a code, I'm very upset. </p>
| java android | [1, 4] |
3,216,226 | 3,216,227 | C# equivalent to Java resource | <p>Is there an online resource or database that allows looking up the C# equivalent to a Java class and vice versa?</p>
<p>I have been porting code and have been Googling individual classes one at a time; it gets a little tedious. 8^j</p>
<p>Cheers</p>
| c# java | [0, 1] |
5,983,444 | 5,983,445 | The correct sytax for IF THEN with variables | <p>How does one code for a choice between two options?</p>
<pre><code>if ((one_spinner.getSelectedItem().toString()
.equals("one"))) {
double one_thing = new Double(one.getText()
.toString());
double two_thing = one_thing * 5;
} else {
double two_thing = new Double(one.getText()
.toString());
double one_thing = two / 5;
}
</code></pre>
| java android | [1, 4] |
2,942,989 | 2,942,990 | Align the texts center with the given position | <p>I need to draw a text using </p>
<p>canvas.drawText("1",x,y, paint);</p>
<p>But the problem is that the "text's center" doesn't match with the position I have given,Is there any way I can do the latter.I have done quite a lot of search on the topic,culdn't find any answer.Please help.</p>
<p>Thank You in advance</p>
| java android | [1, 4] |
3,624,979 | 3,624,980 | Prevent to navigate back in browser | <p>I want to prevent navigate back (prevent backspace key and back button in browser) using JavaScript or Jqurey. my language is coldfusion 8. </p>
| javascript jquery | [3, 5] |
626,200 | 626,201 | jQuery select change event | <p>I am trying to fire an alert depending on which value is selected from a <code><select></code> element using jQuery:</p>
<pre><code>$("#optiontype").change( function () {
var option = $("#optiontype").val();
if(option.Contains("Forward")){
alert("forward selected");
}
});
</code></pre>
<p>The alert never fires whenever I choose 'forward' from the <code><select></code> element.</p>
| javascript jquery | [3, 5] |
5,502,520 | 5,502,521 | How to combine two Javascripts | <p>These are the two javascripts that i am trying to combine in the header of my website, the first script is for my tab menu and the second is for my content slider. Any help would be appreciated.</p>
<pre><code> <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
$(function(){
$('#tabs').tabs();
$('#dialog_link, ul#icons li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
});
</script>
<script type="text/javascript" src="javascripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="javascripts/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="javascripts/jquery.coda-slider-2.0.js"></script>
<script type="text/javascript">
$().ready(function() {
$('#coda-slider-1').codaSlider();
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
1,726,390 | 1,726,391 | appending selected tree view node to another div | <p>I have an ASP.Net tree view control with checkboxes. my requirement is if any node(parent or child) is checked that node should be copied to another div. if the parent node is checked, that parent node with child nodes should be copied to the div.
anyone plz help me for this task.</p>
<p>Thanks.</p>
| javascript jquery asp.net | [3, 5, 9] |
2,838,033 | 2,838,034 | Checking when an XML File is uploaded with C# | <p>I manage a website that pulls data in from an XML file, the file is updated every night around midnight. I am trying to write a simple piece of code that says on the website, File Last Updated: something something. After poking around and trying several different solutions, (I tried several variations using FileInfo to no avail) I decided to post here. </p>
<p>I tried Both GetCreationTime and GetLastWriteTime with FileInfo but I keep getting back 12/30/1600 or something similar no where near the correct date. When the file gets uploaded it just overwrites the old one so I wasn't sure which method to use either.</p>
<p>Current Filinfo Code:</p>
<pre><code> FileInfo fileInfo = new FileInfo("feed/VEHICLES.XML");
DateTime timeOfCreation = fileInfo.CreationTime;
modifieddate.Text = timeOfCreation.ToString();
</code></pre>
<p>this returns 12/31/1600 7:00:00 PM but it should be 11/14/2011 1:41 AM</p>
| c# asp.net | [0, 9] |
1,073,152 | 1,073,153 | how to paint on an image and save the image to phone gallery in android | <p>** my intent is to save the painted image along with my background view to gallery** //</p>
<pre><code>public boolean onTouch(View view, MotionEvent event) {
// draw the new Points to our internal canvas / bitmap
System.out.println("onTouch(View vc) { IS CALLING11111111111");
if (event.getAction() == MotionEvent.ACTION_DOWN) {
paint.setColor(Color.RED);
path = new Path();
path.moveTo(event.getX(), event.getY());
} else
if (event.getAction() == MotionEvent.ACTION_MOVE) {
int historySize = event.getHistorySize();
for (int i = 0; i < historySize; i++) {
path.lineTo(event.getHistoricalX(i),
event.getHistoricalY(i));
}
path.lineTo(event.getX(), event.getY());
canvas.drawPath(path, paint);
}
else {
return super.onTouchEvent(event);
}
invalidate();
return true;
}
</code></pre>
| java android | [1, 4] |
4,796,236 | 4,796,237 | Method Undefined for the Type in Android | <p>I have an error stating something like:</p>
<blockquote>
<p>The method foo() is undefined for the type bar(){}</p>
</blockquote>
<p>Eclipse tells me that after entering this code:</p>
<pre><code>((application_variables) this.getApplication()).setSomeVariable("foo");
</code></pre>
<p>I'm not sure if this is the problem, but I have it located under....</p>
<pre><code>public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
</code></pre>
<p>I'm guessing it has a problem with "this."
I'm still learning about Android so I'm going pretty basic. What do I need to fix?</p>
| java android | [1, 4] |
2,823,852 | 2,823,853 | Click event ignoring if/else in Jquery | <p>I thought this would be simple: all I want is for JS to detect if the child img of the clicked link has a certain src attribute. If yes, do one thing. If no, do this other thing. But for some reason the click event is ignoring the if/else condition entirely. I can put any nonsense I want if the <code>.children()</code> selector and the event will still execute as if the condition is true. I don't know Jquery very well, so I'm at a loss. Any help would be appreciated.</p>
<pre><code>$('.addcomp').click(function(){
if($(this).children('img[src="add.png"]')){
$(this).parents("tr").find('.compcost').addClass('cost').end().find('td:last-child,td:nth-child(3)').addClass('addcompbg');
$(this).children("img").attr("src","forbidden.png");
}
else if ($(this).children('img[src="forbidden.png"]'))
{$(this).parents("tr").find('.compcost').removeClass('cost').end().find('td:last-child,td:nth-child(3)').removeClass('addcompbg');
$(this).children("img").attr("src","add.png");
}
});
</code></pre>
| javascript jquery | [3, 5] |
276,040 | 276,041 | Override DataBind() | <p>I have a page.</p>
<p>In the C#:</p>
<pre><code>public class myClass
{
protected void Page_Load(object sender, EventArgs e)
{
mydropdown1.DataSource = location_of_data;
mydropdown1.DataBind();
mydropdown2.DataSource = location_of_data;
mydropdown2.DataBind();
}
}
</code></pre>
<p>Let's assume that the aspx file has 2 dropdowns.</p>
<p>I would like to overwride the DataBind function, keeping the current string the same, but I want to change the values of each item that I want to Bind.</p>
<p>I googled a solution of DataBind override which looks as follows:</p>
<pre><code>public override void DataBind()
{
//...some implementation here...
base.DataBind()
}
</code></pre>
<p>but I am unsure if I should put thie override method in myClass. Also if I have two DropDowns and I want to treat their DataBinds differently, how should I approach this?</p>
| c# asp.net | [0, 9] |
3,504,891 | 3,504,892 | Fastest way to read file as a byte array | <p>What is the fastest way to read a file as a byte array (on Android)? The file is about 4 MB. It's inside the assets directory, which means that it's probably compressed.</p>
<p>Currently, I'm doing something like this:</p>
<pre><code>byte[] buffer = new byte[4 * 1024 * 1024];
context.getAssets().open(FILE_NAME).read(buffer);
</code></pre>
<p>On Android, creating the array takes about 40 ms, reading the file about 120 ms. I suspect that the 40 ms consist mostly of filling the array with zeroes. Can I avoid this?</p>
<p>The file is basically a list of about 100,000 items which need to be searched through quickly.</p>
| java android | [1, 4] |
1,325,676 | 1,325,677 | Sending parameter to jQuery function | <p>In a PHP page i have several rows of one table like this</p>
<pre><code>echo '<tr><td><a href="#" onclick="myFunction('.$id.')">Click</a></td></tr>';
</code></pre>
<p>The <code>$id</code> is dynamically generated from a database</p>
<p>So I want to define the function in jQuery but to pass the parameter to the jQuery function.</p>
<p>For each button I click there will be another parameter passed</p>
| php javascript jquery | [2, 3, 5] |
2,398,039 | 2,398,040 | add client script to asp.net page dynamically | <p>I want to add javascript to asp.net page dynamically.
can anybody point me towards working example?
i know it can be done by using <code>Page.ClientScript.RegisterClientScriptBlock</code>
but i have no idea to use it.</p>
| asp.net javascript | [9, 3] |
500,097 | 500,098 | SellectCommad.connection Property not initialized | <p>When i debug my application, it gives an error that SelectCommand.Connection Property is not been initialized. i dont know what am i doing here wrong :s. I actually want to add a filter over my search on the textchanged event of a textbox.</p>
<pre><code>public class ConnectionClass
{
static SqlConnection cn;
public static SqlConnection Connection()
{
string myConnection = ConfigurationManager.ConnectionStrings["_uniManagementConnectionString1"].ConnectionString;
if (cn != null)
{
cn = new SqlConnection(myConnection);
cn.Open();
}
return cn;
}
}
public class ClassDataManagement
{
SqlConnection cn = ConnectionClass.Connection();
public DataTable GetData(string SQL)
{
SqlCommand cmd = new SqlCommand(SQL, cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
protected void TextBoxFilterText_TextChanged(object sender, EventArgs e)
{
ClassDataManagement dm = new ClassDataManagement();
string query = "Select CourseCode from _Courses where coursecode like'%" + TextBoxFilterText.Text.TrimEnd() + "%'";
dm.GetData(query);
GridViewCourses.DataBind();
}
</code></pre>
| c# asp.net | [0, 9] |
4,169,605 | 4,169,606 | Tracking mouse movements | <p>This should be typically easy, I want to perform tracking of mouse movements. I'm capable of capturing the XY co-ords. </p>
<p>However, as far as I'm aware, this will vary according to the browser size, right ? </p>
<p>If so, can anyone recommend other things to track to ensure my results are accurate? </p>
<p>P.s I'm using the following Jquery example</p>
<pre><code>$("html").mousemove(function(e){
var pageCoords = "( " + e.pageX + ", " + e.pageY + " )";
var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
$("span:first").text("( e.pageX, e.pageY ) - " + pageCoords);
$("span:last").text("( e.clientX, e.clientY ) - " + clientCoords);
});
</code></pre>
| javascript jquery | [3, 5] |
4,176,846 | 4,176,847 | Colorbox problems in IE | <p>Here are the codes i used:
<a href="http://jsfiddle.net/6bmte/" rel="nofollow">http://jsfiddle.net/6bmte/</a></p>
<p>The colorbox works well in all browsers except IE. The js codes i used are just the same as the colorbox demo i downloaded except that i changed the url of the images. Then i also added position absolute inside the colorbox.css
(#cboxOverlay{background:gray; <strong>position:absolute</strong>;}). </p>
<p>The colorbox seemed to be cut when i view it in IE. The situation is shown below. The colorbox shows except the highlighted parts. I've also tried the suggestions to put the code present in <a href="http://stackoverflow.com/questions/5148833/colorbox-css-problem-in-ie">colorbox css problem in ie</a>. I still can't make the colorbox display the whole image.</p>
<p><img src="http://i.stack.imgur.com/EjUbb.jpg" alt="enter image description here"></p>
| javascript jquery | [3, 5] |
2,501,586 | 2,501,587 | Using ASP.NET in browsers that not support javascript | <p>Is there a way to use ASP.NET in browsers that javascript is not enabled?</p>
<p>Whereas all buttons/actions do a postback using javascript by default, i guess that isn't possible, but using ASP.NET MVC could be a solution?</p>
<p><strong>What do you think is the best way to deal if the user's browser is with javascript disabled?</strong> Block the page access telling that the user need enabled?</p>
<p><strong>So, is this really necessary?</strong></p>
<p>A lot of large sites do nothing to handle that.</p>
| asp.net javascript | [9, 3] |
5,347,597 | 5,347,598 | jQuery response is text string. How do I make this a PHP variable? | <p>I am using a file upload utility that renames files on the backend, then I use a jQuery script to append the file path to a div. </p>
<pre><code>'onComplete': function(event, queueID, fileObj, response, data) {
$('#filesUploaded').append(''+response+'');
}
</code></pre>
<p>I want to take this response and turn it into a PHP variable that I can use with a form submission. Any assistance is greatly appreciated.</p>
| php jquery | [2, 5] |
1,132,968 | 1,132,969 | javascript syntax error: uncaught expression | <p>I'm creating a web application, where I got a simple problem which I can't solve. I've put the code which creates the problem here: <a href="http://jsfiddle.net/rkumarnirmal/5w3FG/" rel="nofollow">http://jsfiddle.net/rkumarnirmal/5w3FG/</a></p>
<p>What's problem with the second alert() which should display this answer</p>
<pre><code>current
</code></pre>
<p>The problem is:</p>
<pre><code>var b = '.something';
var c = $(b).attr("id");
alert(c);
</code></pre>
<p>is not showing the id.</p>
<p>But, When I give </p>
<pre><code>var c = $('.something').attr("id");
alert(c);
</code></pre>
<p>It works. Have I done anything wrong with the selector?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
910,059 | 910,060 | using jquery for Calculate total images in <id> | <p>I have one div and inside it I have some images for example <code><img src= etc</code></p>
<p>I want to calculate total number of images in that div. Also I want to save these images ID into mysql using PHP...</p>
<p>Thanks</p>
| php jquery | [2, 5] |
4,975,287 | 4,975,288 | Calling Javascript Function in C# not working properly | <p>I wanna call a javascript function in c sharp code.
i wanna hide the specific Li tag whose id is c sharp variable"li_name".
For this i am calling a javascript function. </p>
<p>Cs Code:</p>
<pre><code> li_name = DSRolePermission.Tables[0].Rows[k]["MENUNAME"].ToString();
StringBuilder script = new StringBuilder();
script.Append("<script type=\"text/javascript\">");
script.Append("li_visibility('" + li_name + "')");
script.Append("</script>");
Page.ClientScript.RegisterClientScriptBlock(typeof(object), "JavaScriptBlock", script.ToString());
</code></pre>
<p>JS code:</p>
<pre><code> <script type="text/javascript">
function li_visibility('<%=li_name %>') {
document.getElementById('<%=li_name %>').style.display = 'hidden';
}
</script>
</code></pre>
<p>But this code is not working properly.</p>
| c# javascript asp.net | [0, 3, 9] |
5,082,540 | 5,082,541 | How can i know which class was selected via jQuery & JS | <p>I have a list with links:</p>
<pre><code><li class="link-1"><a href="#">One</a></li>
<li class="link-2"><a href="#">Two</a></li>
<li class="link-3"><a href="#">Three</a></li>
..
</code></pre>
<p>user clicks on any link, then with jQuery I want to display the content of the link.. somthing like:</p>
<pre><code>$(".link-??? a").click(function() {
alert($(".link-??? a").html());
})
</code></pre>
<p>something like this. I am not going to create X function (as the number of the links), so what can I do? I should replace the <code>???</code> in somtehing else..</p>
| javascript jquery | [3, 5] |
4,373,658 | 4,373,659 | Android java NullPointerException | <pre><code>public class Database extends Activity {
private TextView tvInfo = (TextView)findViewById(R.id.tvInfo);
private Button btnInfo = (Button)findViewById(R.id.btnInfo);
</code></pre>
<p>Hello guys, probably this is just an newbie error in java, but why is this throwing me a NPE? I'm just declaring those variables and it gives me an NPE.</p>
| java android | [1, 4] |
5,231,962 | 5,231,963 | Storing data Object coming from a response of jQuery ajax call | <p>I am calling a web method from <strong>asp.net 1.1</strong> site and getting a response.</p>
<p>I use this object to populate some data, Now I want to store this object so that I can also save this data in database while saving click event.</p>
<p>How can I achieve this.</p>
<pre><code> $(document).ready(function () {
$("#Ok").click(function () {
$.ajax({
type: "POST",
url: "/Service.svc/xyz",
data: JSON.stringify(jData),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (**msg**) {
// STORE THIS msg object.
},
error: function (jqXHR, textStatus, errorThrown) {
}
});
});
});
</code></pre>
| c# asp.net | [0, 9] |
3,532,972 | 3,532,973 | Robust way to save/load objects with dependencies? | <p>I'm writing an Android game in Java and I need a robust way to save and load application state quickly. The question seems to apply to most OO languages.</p>
<p>To understand what I need to save: I'm using a Strategy pattern to control my game entities. The idea is I have a very general Entity class which e.g. stores the location of a bullet/player/enemy and I then attach a Behaviour class that tells the entity how to act:</p>
<pre><code>class Entiy { float x; float y; Behavior b; }
abstract class Behavior { void update(Entity e); {}
// Move about at a constant speed
class MoveBehavior extends Behavior { float speed; void update ... }
// Chase after another entity
class ChaseBehavior extends Behavior { Entity target; void update ... }
// Perform two behaviours in sequence
class CombineBehavior extends Behavior { Behaviour a, b; void update ... }
</code></pre>
<p>Essentially, Entity objects are easy to save but Behaviour objects can have a semi-complex graph of dependencies between other Entity objects and other Behaviour objects. I also have cases where a Behaviour object is shared between entities. I'm willing to change my design to make saving/loading state easier, but the above design works really well for structuring the game.</p>
<p>Anyway, the options I've considered are:</p>
<ul>
<li><p>Use Java serialization. This is meant to be really slow in Android (I'll profile it sometime). I'm worried about robustness when changes are made between versions however.</p></li>
<li><p>Use something like JSON or XML. I'm not sure how I would cope with storing the dependencies between objects however. Would I have to give each object a unique ID and then use these IDs on loading to link the right objects together? I thought I could e.g. change the ChaseBehaviour to store a ID to an entity, instead of a reference, that would be used to look up the Entity before performing the behaviour. </p></li>
</ul>
<p>I'd rather avoid having to write lots of loading/saving code myself as I find it really easy to make mistakes (e.g. forgetting to save something, reading things out in the wrong order).</p>
<p>Can anyone give me any tips on good formats to save to or class designs that make saving state easier?</p>
| java android | [1, 4] |
3,275,536 | 3,275,537 | Get DataTable values from code behind to client side using javascript | <p>I need help on getting a particular datatable values from the server to the client using javascript. </p>
<p>Ex.
In my class which is Countries.aspx.cs I have this somewhere on my code say on the page load.</p>
<pre><code>DataTable dtbCountries = Repository.GetAllCountries;
</code></pre>
<p>my dtbCountries now contains this record</p>
<pre><code>ID Country
1 HongKong
2 Japan
3 Korea
</code></pre>
<p>In my webform I want to get the values of my dtbCountries using javascript</p>
<pre><code><script type="text/javascript">
// my code here to get the dtbCountries values
</script>
</code></pre>
<p>What should I do? Or what's the best thing to do to expose my dtbCountries in the client.</p>
<p>Thanks in advance!</p>
| c# javascript asp.net | [0, 3, 9] |
4,993,660 | 4,993,661 | Verify password contains letter | <pre><code>$('#password').val().indexOf(/[a-z]/) != -1)
</code></pre>
<p>Does this work? if so is there something wrong with it because its not working.</p>
| javascript jquery | [3, 5] |
2,095,378 | 2,095,379 | Parse string value pair in javascript | <p>I have an attribute of a list object in html like this:</p>
<pre><code><ul>
<li id="myID" add-param="{"type1":"myType1","type2":"myType2"}">Test</li>
</ul>
</code></pre>
<p>Having the list item with specified ID, how could I get the value myType1,myType2 by the key type, type2 ?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
2,086,191 | 2,086,192 | Want to create a multilingual javascript object, how to handle if lots of labels? | <p>I want to create a javascript file for multilingual functionality</p>
<p>i.e. display the error message in the correct language.</p>
<p>If I have allot of labels for a page, error messages, etc., what is a smart way of making this so the actual output on the page isn't huge?</p>
<p><strong>i guess the best way is to somehow output the labels that I need ONLY?</strong></p>
<pre><code>lang.getkey('username');
</code></pre>
<p>will output the correct label, depending on the language.</p>
| javascript jquery | [3, 5] |
1,933,189 | 1,933,190 | Convert ASP.net source code to PHP | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1291985/how-to-convert-php-source-code-to-asp-net-code">How to convert Php source code to Asp.net code</a> </p>
</blockquote>
<p>Can we convert ASP.net source code into PHP .</p>
<p>Any helpful answered much appreciated .</p>
<p>Thanks Regal Singh</p>
| php asp.net | [2, 9] |
2,585,229 | 2,585,230 | Using a C++ class in C# | <p>How can I use a C++ class in C#? I know you can use DllImport and have the class as IntPtr, but then how would I call the functions inside the class? And I don't want to create a new method for each method in the class and export that, then there is not point for me to use a class then...</p>
<p><strong>Without creating a COM app</strong></p>
<p>C++ Class:</p>
<pre><code>class MyCPPClass
{
public:
MyCPPClass();
~MyCPPClass();
void call_me();
}
extern "C"
{
extern __declspec(dllexport) MyCPPClass* __cdecl CreateClass()
{
return new MyCPPClass();
}
}
</code></pre>
<p>C#:</p>
<pre><code>class MyCSClass
{
[DllImport("MyCPPDll.dll")]
static extern IntPtr CreateClass();
public static void Main()
{
IntPtr cc = CreateClass();
// Now I want to call cc->call_me();
}
}
</code></pre>
| c# c++ | [0, 6] |
3,816,740 | 3,816,741 | Spherical Geometry library for Java/Python | <p>Is there a good Spherical Geometry library for Java/Python? I'm looking for something similar to this <a href="http://googlegeodevelopers.blogspot.com/2011/01/little-help-with-spherical-geometry.html" rel="nofollow">http://googlegeodevelopers.blogspot.com/2011/01/little-help-with-spherical-geometry.html</a>. I need to be able to perform distance, heading, area calculations; would be nice if I can also do intersection and union of areas. </p>
| java python | [1, 7] |
3,964,791 | 3,964,792 | Hiding divs when clicking outside an image | <p>I have a webpage with several hidden divs. I have them set up so that when an image is clicked, they will display and if the image is clicked again, they hide. The problem is, I need to hide them if they're visible and any part of the page is clicked. I've searched high and low and have found some suggestions but have yet to find one that works. Can anyone help?</p>
| javascript jquery | [3, 5] |
2,959,045 | 2,959,046 | javascript draggable slider that snaps back to middle position on mouseUp | <p>I would like to implement a jog-dial like behavior in a scrollbar/slider like so:</p>
<p>in the beginning the handle is positioned in the middle of the "scrollbar/slider" area. When you click on the handle and drag it to the left or right (while keeping clicked) some other actions (updating of another area on the page) are performed -- the more the slider is dragged to either the left or right end, the faster. As soon as the mouse button is released, the handle should snap back to the middle of the slider area.</p>
<p>is there anything basically like this available as jquery/ui plugin/component/script that can be utilized and extended for this behavior?</p>
<p>update to clarify:</p>
<p>I already have a slider like so <a href="http://jqueryui.com/demos/slider/" rel="nofollow">http://jqueryui.com/demos/slider/</a></p>
<p>I would like this slider to behave in the following manner:</p>
<ul>
<li>the handle of the slider should start out in the middle/center of the</li>
<li>slider when you click on the handle you can drag it to the left or right (as long as you keep the mouse button pressed)</li>
<li>when you release the mouse button, the handle of the slider should snap back to the starting position (center/middle)</li>
<li>depending on how far and which side the handle is currently, i'd like to scroll other content (that other content is not part of this question)</li>
</ul>
<p>hope this helps explain my intentions and question a bit better.</p>
| javascript jquery | [3, 5] |
3,133,785 | 3,133,786 | Show "loading" while a new image is loading | <p>I have </p>
<pre><code><img src="..." class="myImage">
<a href="..." class="changeImage">
$(function(){
$('a.changeImage').click(function(){
$('img.myImage').attr('src',NEWVALUE);
});
});
</code></pre>
<p>When I click the link, i inject a new src to <code>.myImage</code>. Is it possibile to show a loading image while the new src is loading?</p>
| javascript jquery | [3, 5] |
3,023,163 | 3,023,164 | jQuery: How to select all radio buttons with a name? | <p>I am trying to select all radio buttons with a name, but I can only select the checked ones. For example this works:</p>
<pre><code>$("input[@name='id']:checked").each(function() { // });
</code></pre>
<p>It selects all inputs with name id, which are checked (in this case one radio button). But I need all of them, as I need the not checked ones for this name, on this function.</p>
<p>This, for example, is not doing anything:</p>
<pre><code>$("input[@name='id']").each(function() { // });
</code></pre>
<p>What do I do?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
3,426,923 | 3,426,924 | How to load the colored text dynamically and fade out in jquery | <p>I want to display some text with red background color and white font color in top center of screen. and That should fade away after 6 seconds. any idea how to do it in jquery</p>
| javascript jquery | [3, 5] |
99,828 | 99,829 | How to fix dynamic added elements aren't dragging or sorting jquery | <p>I have one button, and when i click it it adds elements that are with same class, for example my class is <strong>image_class</strong>, the default added elements are being dragged, but when i add new element with the class i can't drag it or sort it.How can i fix that ?I want when dynamically added element shows up to be dragged or sorted .There is no problem with the default ones.</p>
<p>I'm using jquery ui</p>
| javascript jquery | [3, 5] |
2,290,825 | 2,290,826 | embed jquery themes in asp.net | <p>I have a DLL and I'm trying to wrap the jquery progress bar inside an asp.net server control with the jquery lightness theme.
I was able to embed the jquery into the control but the css isn't showing up. Do I have to embed each image into the assembly? Here's what I have right now</p>
<pre><code>[assembly: WebResource("MyNamespace.jquery-ui-1.8.13.custom.css", "text/css")]
[assembly: WebResource("MyNamespace.jquery-1.5.1.min.js", "text/javascript")]
[assembly: WebResource("MyNamespace.jquery-ui-1.8.13.custom.min.js", "text/javascript")]
</code></pre>
<p>The images are in a folder called /images/ in the root of the DLL. the jquery is referencing the images like this.</p>
<pre><code>.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
</code></pre>
<p>But none of the images show up. I feel like there should be an easier way then having to add a web resource for each image. What is the best way to do this?</p>
| jquery asp.net | [5, 9] |
5,694,091 | 5,694,092 | How can I set the background color in CSS by receiving the color value dynamically? | <p>I'm using the following code: </p>
<pre><code><style>
.color-3 {
background-color: <%= this.BckColor %>;
}
</style>
</code></pre>
<p>to receive a value from a C# page. My C# code receives a background image color from a page called 'settings' page, and the C# code is:</p>
<pre><code> string BckColor ="#" + Convert.ToString((Settings["DOTCOLOR"]));
</code></pre>
<p>but when I do this, the background color is missing. How can I solve this?</p>
| c# asp.net | [0, 9] |
2,694,815 | 2,694,816 | Is there a JavaScript or jQuery equivalent to Python's "sum" built-in function? | <p>Say I have an array-ish container of decimal numbers. I want the sum. In Python I would do this:</p>
<pre><code>x = [1.2, 3.4, 5.6]
sum(x)
</code></pre>
<p>Is there a similarly concise way to do this in JavaScript?</p>
| javascript jquery python | [3, 5, 7] |
4,870,380 | 4,870,381 | Get SelectedValue of dropdownlist which is created with javascript | <p>I am filling dropdownlist with javascript.</p>
<pre><code>for (var i = 1; i < array.length; i++) {
var optn = document.createElement("OPTION");
optn.text = array[i];
optn.value = array[i];
document.getElementById('<%=ddlProductModel.ClientID%>').(options.addoptn);
}
</code></pre>
<p>But I can't get selectedValue of dropdownlist on postback in codebehind(c#). Any solution pls? Thanks.</p>
<p>Yasin</p>
| javascript asp.net | [3, 9] |
3,191,581 | 3,191,582 | What is the most efficient way to access DOM elements in jQuery? | <p>I am writing a jQuery plugin and I am at the optimization stage.</p>
<p>I wonder which of these leads to a quicker script in general, and what sort of mitigating factors are important:</p>
<ol>
<li>Have the script generate lots of classes and ids at the start so finding elements in the dom is easier (quicker too?) later on.</li>
<li>Keep classes and ids to a minimum (so save time by not creating them), but then look for elements in more convoluted ways later (eg the nth item in an object), which I presume is slower than getting by id/class.</li>
</ol>
| javascript jquery | [3, 5] |
546,007 | 546,008 | 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><span class="enabledExport"><input id="_ctl0_ContentPlaceHolder1_gridviewName__ctl2_exportCb" type="checkbox" name="_ctl0:ContentPlaceHolder1:gridviewName:_ctl2:exportCb" /></span>
</code></pre>
<p>For the asp.net gridview column</p>
<pre><code><asp:TemplateField HeaderText="Export">
<ItemTemplate>
<asp:CheckBox runat="server" ID="exportCb"/>
</ItemTemplate>
<ItemStyle/>
</asp:TemplateField>
</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><span></code> the code is going to try to toggle a <code><span></code> instead of the <code><input></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] |
5,750,218 | 5,750,219 | Javascript JQuery Script click link by code (Sliding Form Script) | <p>I am using Fancy Sliding Form .. Demo <a href="http://tympanus.net/Tutorials/FancySlidingForm/" rel="nofollow">Click here</a>:</p>
<p>There are some tabs/buttons for navigation at the bottom.</p>
<p>I need to be able to tigger the different steps (auto clicking) when I click on a link not directly on the tab with my mouse.</p>
<p>I've tried adding an id to each step and then create a link: Next Tab
then the jquery below:</p>
<pre><code><script>
$("#mytrigger").click(function(e) {
e.preventDefault();
$("#step2").trigger("click");
});
</script>
</code></pre>
<p>but that didn't work.</p>
<p>UPDATE:</p>
<p>I put this together and it's not working ... I'm I not doing this right?</p>
<pre><code><a class="mytrigger" href="#">Click Here</a>
<script>
$('a.mytrigger').click(function(e){
$('#navigation li:nth-child(' + (parseInt(current)+1) + ') a').click();
e.preventDefault();
});
</script>
</code></pre>
<p>Here is my Nav:</p>
<pre><code><div id="navigation" style="display:none;">
<ul>
<li class="selected">
<a href="#">Step 1</a>
</li>
<li>
<a href="#">Step 2</a>
</li>
<li>
<a href="#">Step 3</a>
</li>
<li>
<a href="#">Step 4</a>
</li>
<li>
<a href="#">Step 5</a>
</li>
<li>
<a href="#">Step 6</a>
</li>
</ul>
</div>
</code></pre>
| javascript jquery | [3, 5] |
1,312,436 | 1,312,437 | How to reenable event.preventDefault? | <p>I have a web page which I have prevented the default action on all submit buttons, however I would like to re-enable default submit action on a button how can I do this?</p>
<p>I am currently preventing the default action using the following:</p>
<pre><code>$("form").bind("submit", function(e){
e.preventDefault();
});
</code></pre>
<p>I have successfully done this using the following: </p>
<pre><code>$(document).ready(function(){
$("form:not('#press')").bind("submit", function(e){
e.preventDefault();
});
</code></pre>
<p>But can I do this dynamically when the button is clicked?</p>
| javascript jquery | [3, 5] |
6,024,631 | 6,024,632 | Using jquery to determine if any elements within a div was clicked | <p>How can I tell using jQuery if an any element within a div (panel1) was clicked? I have this piece of code that I use to show/hide a popup:</p>
<pre><code>$('body').click(function (e) {
if ($(e.target).attr('id') == 'link1') {
$('#panel1').show();
} else {
$('#panel1').hide();
}
});
</code></pre>
<p>The problem is that the popup (panel1) gets dismissed if I click on any control/element within panel1. I'd like to keep panel1 open unless an area outside panel1 is clicked (or if link1 is clicked again). How can I revise this code to achieve this? Thanks...</p>
| javascript jquery | [3, 5] |
2,914,003 | 2,914,004 | Is there a rule of thumb for how many placeholders can be put on a web page? | <p>Using aspx and c# 3.5, vs2008. </p>
<p>Is there a rule of thumb for how many placeholders can be put on a web page before performance starts to deteriorate? </p>
<p>Any other concerns for using a lot of placeholders?</p>
<p>I am dynamically inserting controls (textboxes, checkboxes, expression validators, and buttons on to my page. </p>
| c# asp.net | [0, 9] |
5,942,889 | 5,942,890 | Javascript/jQuery "Gotchas" | <p>What are some of the common Javascript and/or jQuery "gotchas" that you have seen or been tripped up by?</p>
<p>As an example, it was pointed out to me this morning that you have to be careful with the radix when doing <code>parseInt()</code>, because if your string starts with a 0, the radix will default to 8.</p>
| javascript jquery | [3, 5] |
3,670,560 | 3,670,561 | why other web project show me logged in? | <p>I'm working on two separated web projects, but use same authentication scenario for both of them.
Here is a part of my login code:</p>
<pre><code>public void Login(string username, string password, bool staySignedIn)
{
if (this.IsLockedOut(username))
{
this._view.ShowMessage("Your account has been locked!");
return;
}
else if (!this.IsApproved(username))
{
if (!string.IsNullOrEmpty(this.webContext.CurrentUserID))
{
this.membershipService.ChangeApprove(this.webContext.CurrentUserIdFromQuery);
this.DoLogin(username, password, staySignedIn);
}
else
this._view.ShowMessage("Your account is not activated yet");
}
else
this.DoLogin(username, password, staySignedIn);
}
private void DoLogin(string username, string password, bool staySignedIn)
{
try
{
FormsAuthentication.SetAuthCookie(username, staySignedIn);
if (!string.IsNullOrEmpty(this.webContext.GetReturnUrl))
this.redirector.GotoUrl(this.webContext.GetReturnUrl);
else this.redirector.GotoProfileDefault();
}
catch (Exception ex)
{
this.logger.PrintToLogFile(ex, false);
this._view.ShowMessage("Some error code");
}
}
</code></pre>
<p>In project1, I have 3 users: user1, user2 and user3 and no user in project2 . My problem is: when I login to web project1 as user1, if web project2 is view in browser, it shows me logged in too as user1 with same user data in project1.Some thing like I login in both webs. and I don't know why. May you please give me any suggestion?</p>
| c# asp.net | [0, 9] |
4,790,443 | 4,790,444 | Arrays in Javascript | <p>I always had this silly doubt in mind but never had come up with the solution.</p>
<p>I have seen several kind of arrays but I don't know the difference between them. I don't know how to explain exactly but it's most when passing parameters with jQuery.</p>
<p>See:</p>
<p><code>{ 'choices[]': ["Jon", "Susan"] }</code> in <code>$("#objectID").load("test.php", { 'choices[]': ["Jon", "Susan"] } );</code></p>
<p>What's the {}? (does this mean it's an array?). Why is <code>choices[]</code> quoted? I have already seen unquoted ones, what's the difference? I presume that <code>choices</code> is the associative name and <code>["Jon", "Susan"]</code> is the value, is it right?</p>
| javascript jquery | [3, 5] |
1,627,425 | 1,627,426 | How to Display a keyboard in an Android Application? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2209131/how-to-trigger-the-soft-keyboard">How to Trigger the soft keyboard?</a> </p>
</blockquote>
<p>Any one please help me to display a keyboard in my app. I want to show my keyboard when i click on the textfield</p>
| java android | [1, 4] |
174,309 | 174,310 | ASP.net C# SQL count(*) | <p>I have a query that I'm running in C# .cs file:</p>
<pre><code>DataSet ds = db.ExecuteDataSet(System.Data.CommandType.Text, "SELECT count(*) as counter FROM [Table] where [Table].[Field] = 'test'");
</code></pre>
<p>I want to do is retrieve the value of "counter" in this query and "return" it as my functions return value.</p>
<p>How can I do that?</p>
| c# asp.net | [0, 9] |
4,739,384 | 4,739,385 | Sound Processing - Beat Matching Music Player on Android | <p>So I want to make a new music player for Android, it's going to be open source and if you think this idea is any good feel free to let me know and maybe we can work on it.</p>
<p>I know it's possible to speed up and slow down a song and normalize the sound so that the voices and instruments still hit the same pitch.</p>
<p>I'd like to make a media play for Android aimed at joggers which will;</p>
<ul>
<li>Beat match successive songs</li>
<li>Maintain a constant beat for running to</li>
<li>Beat can be established via accelerometer or manually</li>
<li>Alarms and notifications automatically at points in the run (Geo located or timer)</li>
</ul>
<p>Now I know that this will fall down with many use cases (Slow songs sounding stupid, beat changes within song getting messed up) but I feel they can be overcome. What I really need to know is how to get started writing an application in C++ (Using the Android NDK) which will perform the analysis and adjust the stream.</p>
<p>Will it be feasible to do this on the fly? What approach would you use? A server that streams to the phone? Maybe offline analysis of the songs on a desktop that gets synched to your device via tether?</p>
<p>If this is too many questions for one post I am most interested in the easiest way of analysing the wave of an MP3 to find the beat. On top of that, how to perform the manipulation, to change the beat, would be my next point of interest.</p>
<p>I had a tiny crappy mp3 player that could do double speed on the fly so I'm sure it can be done!</p>
<p>Gav</p>
| java c++ android | [1, 6, 4] |
3,120,007 | 3,120,008 | Using jQuery for alternating png transition | <p>Very basic question. I have a very simple web design utilizing a png with transparency, overlaying another base image. The idea here is that it cycles visibility continously, fading in quickly, displaying for a longer interval, fading out quickly, and remaining invisible for an equal longer interval, basically replicating the behavior of an animated GIF from back in the day. The png starts with display set to none.</p>
<p>My problem is jQuery doesn't seem to have a "pause" or "delay" event handler to help here. There are numerous plugins filling the gap, but I'd rather not include one if there's a simple way that I'm missing. That might require falling back on setInterval or setTimeOut, but I'm uncertain of the syntax to do that.</p>
<p>What I want schematically is something like:</p>
<pre><code>--loop start--
$("#pngOverlay").fadeIn(1000);
(5000 delay) // using setTimeout or setInterval if jQuery method unavailable
$("#pngOverlay").fadeOut(1000);
(5000 delay)
--loop repeat--
</code></pre>
<p>The following does the behavior once, so I guess if this could be wrapped in a loop it might work, but it doesn't strike me as elegant or the right way.</p>
<pre><code> setTimeout(function() {
$("#pngOverlay").fadeIn(1000);
}, 5000);
setTimeout(function() {
$("#pngOverlay").fadeOut(1000);
}, 10000);
</code></pre>
<p>Thanks for any suggestions. I would just use GIFs, but need the transparency for this. (In the old days, we used animated GIFs and we <em>liked</em> them...)</p>
| javascript jquery | [3, 5] |
4,158,394 | 4,158,395 | how to use Thick box to asp.net web site | <p>Hello friends I m new for this thick box so some one can help me ...........</p>
| c# asp.net javascript | [0, 9, 3] |
2,598,741 | 2,598,742 | To Print page content dynamically which includes multiline text box | <p>Can you please help me in implementing following functionality in Asp.net.</p>
<p>I have a page where the data is displayed dynamically.
In this data generation, i have multiline text box with many other controls in the page.
I want to implement print functionality where i can print entire page content including multiline text box complete data.</p>
| javascript asp.net | [3, 9] |
3,699,070 | 3,699,071 | Use jquery to show only the current option selected in the form | <p>I am very new to jquery.</p>
<p>Here is my code </p>
<pre><code><script>
$(document).ready(function(){
$('#bashing_title').change(function(){
if($(this).val() == 1)
$('#1').show();
else if($(this).val() == 2)
$('#2').show();
else if($(this).val() == 3)
$('#3').show();
else if($(this).val() == 4)
$('#4').show();
else if($(this).val() == 5)
$('#5').show();
else if($(this).val() == 6)
$('#6').show();
else if($(this).val() == 7)
$('#7').show();
else if($(this).val() == 8)
$('#8').show();
else if($(this).val() == 9)
$('#9').show();
else
$('#1').hide();
});
});
</script>
</code></pre>
<p>What I am trying to do is if the value is <code>1</code> it shows a specific text box, if its 2 then another one and so on. But here if the user has selected the option with value <code>1</code> at first and if the user selects <code>2</code> later, the one doesnt gets hidden.</p>
<p>how do i hide the previous value and only show the value that is curretly selection</p>
| javascript jquery | [3, 5] |
253,983 | 253,984 | How to add saved images to mediastore and generate thumbnails? | <p>I am writing an Android app which can take pictures and save them on the SD card. Later, I need to display the pictures in a GridView and the user can select one. This is my code to save pictures:</p>
<pre><code>Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera c) {
currentPictureName = (String) getResources().getText(R.string.username)
+ System.currentTimeMillis() + ".jpg";
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream(sdcardPath + currentPictureName);
outStream.write(data);
outStream.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
mCamera.startPreview();
}
}
</code></pre>
<p>However, none of the saved images have thumbnails to show in the GridView. How do I automatically generate thumbnails for all images that I save and add everything to <code>MediaStore</code> so that they can be accessed later?</p>
| java android | [1, 4] |
2,667,456 | 2,667,457 | jquery check variable values | <p>In jQuery I have the following 4 variables. </p>
<pre><code>var add
var city
var state
var zip
</code></pre>
<p>I need to check to see that any one of the above have a value.
If none have a value that is OK. If all of them have a value that is OK.</p>
<p>Just need to check that at least one of them do not have a value.
Not sure what is the most efficient way of doing this. </p>
| javascript jquery | [3, 5] |
2,282,045 | 2,282,046 | Index was outside the bounds of the array (500th?) | <p>Calling the function on load and the error is pointing to that. I don't get the index out of range error on debug only on publish.</p>
<pre><code> {
string strLogonUser = Request.ServerVariables["LOGON_USER"];
var credential = strLogonUser.Split(@"\".ToCharArray())[1];
cnn.Open();
SqlTransaction tran = cnn.BeginTransaction();
cmd.Connection = cnn;
cmd.Transaction = tran;
cmd.CommandText = "StoredProcedure";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@UserLogin", SqlDbType.NVarChar).Value = credential;
cmd.ExecuteNonQuery();
}
[IndexOutOfRangeException: Index was outside the bounds of the array.]
_Default.ReadUser() +357
_Default.Page_Load(Object sender, EventArgs e) +46
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
</code></pre>
| c# asp.net | [0, 9] |
44,657 | 44,658 | Javascript not affecting content that is loaded by another script | <p>I am using jQuery to load a php form and bootstrap.js for a datepicker element on that form; this code is in a file script.js:</p>
<pre><code>$(document).ready(function() {
// load form via ajax when button is clicked is submitted
$('.add-opportunity .open').on('click', function() {
// get form
$('.add-opportunity').load('add_opportunity.php');
});
// datepicker
$('#datepicker').datepicker();
});
</code></pre>
<p>With this format the datepicker does not function. If however, I put the jQuery in the php file, also in document(ready), it functions properly. I would like to keep all my javascript in separate files. Any ideas?</p>
| php javascript | [2, 3] |
1,296,612 | 1,296,613 | Validating Schema of pipe separated Csv file in c# | <p>I have a page where users can upload there <strong>pipe separated</strong> "|" csv file. I want to validate the schema & check whether that uploaded file is according to the schema or not ?</p>
<p>Currently I am checking <strong>using conditional operators</strong> whether it has columns name matching in the csv file for <strong>e.g</strong> If Col1 == Col1 then ok else bye. </p>
<p>But i feel this is not proper way to validate schema ? what are the possible options & better way to validate the csv schema.</p>
| c# asp.net | [0, 9] |
3,093,981 | 3,093,982 | trigger jquery with php? | <p>my php code will check after a condition. if the condition is true i want it to trigger a jquery code that displays a box.</p>
<p>i wonder how i can trigger a jquery code with php?</p>
| php jquery | [2, 5] |
5,403,812 | 5,403,813 | Find string in Haystack and display that particular paragraph where the string was found | <p>I have an sql resultset which is retrieved after searching through the database using the LIKE keyword. I want to display the result on a page but without showing the whole text. Just the paragraph where the result was found. Maybe even put that particular word in bold. Anyone with an idea of how best I can implement this?</p>
| c# asp.net | [0, 9] |
4,213,757 | 4,213,758 | Schedule a call to a method? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3072173/how-to-call-a-method-after-a-delay">How to call a method after a delay</a> </p>
</blockquote>
<p>When a user clicks a button, I want to doThis(myVar1);. 1 second later I want to doThis(myVar2);. How can I schedule that 2nd call?</p>
| java android | [1, 4] |
369,011 | 369,012 | dynamic tag count on keyup | <p>I have a div that contains many spans and each of those spans contains a single href.</p>
<p>Basically it's a tag cloud. I have a textbox with a keyup event that filters the tag cloud div (It actually just hides the tags if not in filter condition).</p>
<p>Is there a way to get a count of the tags shown as the keyup event occurs?</p>
<p>Thanks,
rodchar</p>
| javascript jquery | [3, 5] |
935,558 | 935,559 | changing some parts of location.href using js without redirecting the browser? | <p>hi here is the problem: my url is like this
<code>http://somesite.com?theSearch=someword&a=b&c=d</code></p>
<p>on this page search results are displayed and on this page i have put the functionality of ajax search i.e. the results are updated without the page reload but the problem is if the user clicks on any link on the page and then presses the back button he results on the page page with the search results of "someword" not the new word typed (i mean the word for which the ajax results were updated) the client complains it and i need to fix it anyone have a solution?</p>
<p>i am using jQuery</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.