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 |
---|---|---|---|---|---|
2,967,442 | 2,967,443 | How can I use a dropdown select box to trigger this javascript instead of onClick? | <p>I currently have this JS at the bottom of a page that enables a user to sort elements with the class "grid-product-box" by various attributes the element is tagged with.</p>
<p>Works great but at the top of my page I have buttons for "Sort by price (low-high)", "Sort by name" etc which have IDs (#pricelh, #productname etc) and when clicked trigger the function you see below.</p>
<p>How could I create a dropdown select which would trigger this instead of a click? It could be as soon as the option is chosen from the dropdown or after a click of a "sort" button.</p>
<p>I have played around with the onChange handler but just end up breaking the script.</p>
<pre><code><SCRIPT>
var t;
(function($) {
$("#pricelh").click(function() {
$(".grid-product-box").qsort({attr: "productprice", digits: true});
});
$("#pricehl").click(function() {
$(".grid-product-box").qsort({attr: "productprice", digits: true, order: "desc"});
});
$("#productname").click(function() {
$(".grid-product-box").qsort({attr: "productname", ignoreCase: true});
});
$("#manufacturername").click(function() {
$(".grid-product-box").qsort({attr: "manufacturername", ignoreCase: true});
});
$("#sortOptions").click(function() {
clearTimeout(t);
$("#selectList option:gt(0)").qsort();
showSortMessage();
});
$("#sortOptionsDesc").click(function() {
clearTimeout(t);
$("#selectList option:gt(0)").qsort({order: "desc"});
showSortMessage();
});
})(jQuery);
</SCRIPT>
</code></pre>
| javascript jquery | [3, 5] |
2,044,039 | 2,044,040 | binding in Repeater control with restricted records and ohter data on background process from database | <p>I have repeater control under the marquee tag. I want to bind only 10 record first from database and other data on background process so user can not fill that data is loading and my page also get load fast.</p>
<p>As marquee pass 10 records then next 10 records is loaded and so on. Is it possible to do so ? </p>
| c# asp.net | [0, 9] |
357,826 | 357,827 | jQuery click() event; how to prevent this event on right mouse btn click? | <pre><code><img src="" width="200" height="200" id="test_img" />
<script>
$("#test_img").click(function() {
alert("Hello");
});
</script>
</code></pre>
<p>But it doesn't matter what mouse button I'm pressing - right or left. I see absolutely the same result. I want alert to be shown only on left mouse button click.</p>
<p>Thank you and sorry; I'm little new to javascript.</p>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
4,276,212 | 4,276,213 | cookie produced based on select list | <p>Ok so I have this jsFiddle I have worked on to produce a slide down effect on a div based on the select. I need to produce a cookie when the selection is made so when the page is reloaded, the div remains open. Not sure how to produce this effect in the code. Any help is really appreciated!</p>
<p>Heres the link for a working example : <a href="http://jsfiddle.net/J9uuL/1/" rel="nofollow">http://jsfiddle.net/J9uuL/1/</a></p>
| javascript jquery | [3, 5] |
1,891,218 | 1,891,219 | Android activity inner class - change reference to parent | <p>I have an inner class inside an activity.</p>
<p>In the onSaveInstanceState method I save an instance of the inner class in the bundle as a serializable object. When the activity resumes, the object gets restored.</p>
<p>In the inner class uses some of the outer class methods, findViewById for example.
The problem is that the resumed activity is now a different instance, but MyActivity.this still references the old one, thus for example returning me wrong views in the case of findViewById.</p>
<p>I know I could just pass to the inner class the new reference and use that but I was wondering if there's a way to change the reference so that it points to the new instance.</p>
| java android | [1, 4] |
4,560,328 | 4,560,329 | How to create a div with jQuery accordion | <p>Im using this: </p>
<pre><code><script>
$(function() {
$( "#accordion" ).accordion();
});
</script>
</code></pre>
<p>To get the effect of expand/collapse. (If you know a better plugin or method, pls notice me)</p>
<p>I have this div: <code><div id ="accordion"></div></code></p>
<p>And this code to create a button inside that div. (dont worry about the content of button)</p>
<pre><code>$('#button_submit').click(function()
{
$("#accordion").append(
$("<button id=saved"+j+">").click(function() {
drawChart.apply(null, myArray);
}).html("<b>Start date:</b>"+""+myArray[0]+"\n<b>End date:</b>"+myArray[1]+"\n<b>Chart type:</b>"+myArray[2]+"")
);
</code></pre>
<p>My question is, how to create/format div accordion to have this effect <a href="http://jqueryui.com/accordion/" rel="nofollow">accordion effect jquery</a> . </p>
<p>being that the <code><button id=saved"+j+"></code> should appear inside the <code>sections</code>.</p>
<p>Cheers</p>
| javascript jquery | [3, 5] |
4,784,323 | 4,784,324 | Unexpected resume of com.android.launcher while already resumed in | <p>In my application when I do something (for example switch between activities or grab items of listview) application is closing. There is no crashes and exceptions. In logcat appears only this warning:</p>
<blockquote>
<p>11-22 18:08:00.604: W/UsageStats(86): Unexpected resume of com.android.launcher while already resumed in com.nixsolutions.upack
11-22 18:08:00.684: W/InputManagerService(86): Got RemoteException sending setActive(false) notification to pid 2590 uid 10033</p>
</blockquote>
<p>I run the application on an htc with android 1.6. This issue does not appear when I tried to run the app on emulator 1.6. Maybe something with device? But other apps on this device are working fine.</p>
| java android | [1, 4] |
3,717,023 | 3,717,024 | Sorting column with check boxes. Doesn't work. I am stuck | <p>I would like that the Signed button in this JSfiddle sorts the column with the check boxes, like it actually does perfectly.</p>
<p><a href="http://jsfiddle.net/littlesandra88/DSRmg/" rel="nofollow">http://jsfiddle.net/littlesandra88/DSRmg/</a></p>
<p>I noticed that <code>tinySort</code>, the library used to sort the tables, can't sort the column with just the check boxes, so I added a <code>&nbsp;</code> (or X in the JSfiddle for visability) for those <code><td></code>'s that have the check box checked, and it could sort the column.</p>
<p><strong>Problem</strong></p>
<p>The problem is, that when Save is clicked the <code>&nbsp;</code> or X in this case, should be added, so when Signed is clicked, the column is sorted correctly.</p>
<p>In <a href="http://stackoverflow.com/questions/6343524/want-to-add-element-whats-wrong">this</a> post learned I how to add and remove <code>&nbsp</code> or X.</p>
<p>It seams to me that JQuery can't find the <code><label></code>, because it is inside a <code><td></code>.</p>
<p><strong>How to reproduce problem</strong></p>
<p>Try un-checking one of the checkboxes and click Signed. Now the check box column is not sorted correctly any longer.</p>
<p><strong>Question</strong></p>
<p>How do I get the Save buttons to add a <code>&nbsp;</code>, so the column can be sorted?</p>
<p><strong>Update</strong></p>
<p>In <a href="http://jsfiddle.net/littlesandra88/DSRmg/4" rel="nofollow">this</a> have I implemented Rakesh's answer of tablesort. But I still can't get it to work.</p>
| javascript jquery | [3, 5] |
4,959,108 | 4,959,109 | Why use .on() for adding event instead of directly adding event? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8601482/jquery-on-vs-click-methods">jquery on vs click methods</a> </p>
</blockquote>
<p>From API:</p>
<p>.on() : Attach an event handler function for one or more events to the selected elements.</p>
<p>Example code:</p>
<pre><code>$("#dataTable tbody tr").on("click", function(event){
alert($(this).text());
});
</code></pre>
<p>We can just write something like: </p>
<pre><code>$("#dataTable tbody tr").click(function() {
alert($this).text();
});
</code></pre>
<p>Why bother wrapping the event inside .on() ? </p>
<p>Thanks. </p>
| javascript jquery | [3, 5] |
686,108 | 686,109 | onerror=string . $varible - fails | <p>Why it fails? It works when onerror=is not a varible but just a hadrtyped string.</p>
<pre><code><?php
$error = "onerror='this.src = \'http://userlogos.org/files/logos/pek/stackoverflow2.png\'';";
for ($i = 1; $i <= 10; $i++) {
echo "<img src='http://services.runescape.com/m=itemdb_rs/3716_obj_sprite.gif?id=" . $i . "' alt='ID " . $i . "' title='ID " . $i . "'" . $error . "/>";
}
?>
</code></pre>
| php javascript | [2, 3] |
3,224,075 | 3,224,076 | Accessing JS data from PHP | <p>A remote site is supplying a data structure in a js file.</p>
<p>I can include this file in my page to access the data and display it in my page.</p>
<pre><code><head>
<script type="text/javascript" src="http://www.example.co.uk/includes/js/data.js"></script>
</head>
</code></pre>
<p>Does anyone know how I use PHP to take this data and store in it a database?</p>
| php javascript | [2, 3] |
4,286,310 | 4,286,311 | assign data from table with different id to labels using c# | <p>Hy all.I want to assign data from a table to some labels.For example: If I have 3 records with ID=1,ID=2 and ID=3 I want this records to be assigned to 3 different labels.so label1=data with ID=1, label2=data with ID=2 and so on.How can I achieve that?</p>
| c# asp.net | [0, 9] |
3,115,357 | 3,115,358 | Syntax higlight in codemirror | <p>I have:</p>
<pre><code><script type="text/javascript">
$(function() {
var id = '<%=txtEditor.ClientID%>';
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
mode: "application/xml",
lineNumbers: true,
buttons : ['undo','redo'],
onCursorActivity: function() {
editor.setLineClass(hlLine, null);
hlLine = editor.setLineClass(editor.getCursor().line, "activeline");
}
});
var hlLine = editor.setLineClass(0, "activeline");
});
</script>
</code></pre>
<p>Code works fine but unable to highlight syntax and button is not appear.Am i missing something.Thanks.</p>
| jquery asp.net | [5, 9] |
4,952,677 | 4,952,678 | android: how to cleanup application when it is killed | <p>I'm working on an android application, my application turns on some HW on the phone.
I want to close the HW in case anyone kills my application.
how can i "catch" the kill command/event/signal and do a cleanup before application exit?</p>
<hr>
<p>Some update what I found.
You can't protect your application from being killed in all cases.
onDestroy() is not guaranteed to be called (in case of OOM killer for example, or user calling killall -9 xxx).
Best you can do is implement the onDestroy() function, add handler for sig_term and register your application as out of scope for the OOM killer.</p>
<p>This should handle 90% of the cases.
All other cases are from specific user activity - so he will get what we wanted i guess...</p>
| java android | [1, 4] |
2,913,423 | 2,913,424 | Javascript window.open Calling Twice | <p>I'm using this code in a php conditional if/else statement to open a new window.</p>
<pre><code>echo("<script type=\"text/javascript\">
<!--
window.open(\"http://www.example.com/index.php?$var\");
//-->
</script>
");
</code></pre>
<p>It's opening 2 windows instead of one, but only on my live site (on a dedicated server) and not on the test site (shared server).</p>
<p>EDIT: From zebediah49's suggestion, I appended a random int variable after the new window url. It changes the variable with each new window instance, so I assume that means that it runs the conditional twice. I probably should mention that it's using Joomla and a 3rd-party community app, JomSocial.</p>
<p>Alright, as I was editing this and after ~5min of the same window being open, it opened a brand new instance of the window.open window. So obviously it automatically refreshes once as soon as it lands. I'll have to pry into that. Still any suggestions are welcome.</p>
<p>Thank you for your tips regarding language and best practices.</p>
| php javascript | [2, 3] |
2,464,630 | 2,464,631 | How to check for the presence of an element? | <p>I'm using the <code>.length</code> method in a conditional statement that polls the page for the presence of an externally-loaded object (I can't style it with jQuery until it exists):</p>
<blockquote>
<pre><code>function hackyFunction() {
if($('#someObject').length<1)
{ setTimeout(hackyFunction,50) }
else
{ $('#someObject').someMethod() }}
</code></pre>
</blockquote>
<p>Is <code>length</code> the best way to do this?</p>
| javascript jquery | [3, 5] |
621,048 | 621,049 | posting a parameter to a jquery dialog box | <p>i have a small problem
well i'm using a jquery dialog box, and i want to post a parameter to this dialog box</p>
<p>this is how i'm using it :</p>
<pre><code>$(document).ready(function() {
$("#dialogShare").dialog({
resizable: true,
width:400,
modal: true,
autoOpen: false
});
});
$("#share").click(function(){
$.post(
"/accueil.php",
{ name: $("#idPubToPreview").val() }
);
$("#dialogShare").dialog('open');
});
</code></pre>
<p>in the div that display the content of the dialog box "#dialogShare" i do a var_dump of $_POST but it seems to be empty !</p>
<p>any help please ?</p>
| php jquery | [2, 5] |
4,638,225 | 4,638,226 | Is there a way to designate some HTML content as not managed by jQuery? | <p>In <a href="http://stackoverflow.com/questions/2923987/">another question</a>, I asked why it takes so long to remove HTML content from a page with jQuery. </p>
<p>Apparently when removing HTML content from an element, jQuery has to march through each element and do... <em>something</em>.. I don't know exactly what. And this can take a vvery long time for large-ish HTML content. </p>
<p>In an effort to side-step the problem, I'm wondering:<br>
Is there a way to add dynamic HTML content to a page, that uses jQuery, but NOT allow jquery to "adopt" the content? </p>
<p>In other words I want some subset of the HTML content in a page to be outside of the purview of active management by jQuery. </p>
<p>In this particular case, the content is within a jQuery accordion. So I want the accordion to work, but for everything beneath the divs for the accordion panels, I want jQuery to not be aware of those things. The goal is to short-circuit the very lengthy process it takes to remove that content, later. </p>
<p>Does this make sense? </p>
<p>possible? </p>
<p>What if, instead of doing something like <code>$('#elementid').html(content)</code>, I just used the innerHTML property on the element itself, using <code>document.getElementById()</code> Would that keep jQuery out of the subcontent?</p>
<p>I guess I'll try it, but if anyone has any insight, I'd appreciate it.</p>
| javascript jquery | [3, 5] |
3,699,798 | 3,699,799 | JS plugin to detect user's browser, OS, language, geolocation...? | <p>I could have sworn that I saw this on Hacker News a few weeks ago: a simple JS plugin that gives you access to every common bit of information about your user - their OS, browser, language setting, etc.</p>
<p>I'm pretty sure it was a commercial product that was then immediately copied and open-sourced by someone on HackerNews.</p>
<p>But I now can't for the life of me remember what either the commercial product, or the open source plugin, were called. </p>
<p>Can anyone suggest either? </p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
3,713,237 | 3,713,238 | Get the file Attributes (client side) using Javascript | <p>In my application, I need to calculate the size of the file in <strong>client</strong> side (before uploading to server). </p>
<p>I want to restrict the file being uploaded if it doesn't satisfy my requirements like file <strong>size</strong>, file <strong>type</strong>..</p>
<p>Is it possible to achieve this in client side using JavaScript?</p>
| javascript jquery | [3, 5] |
4,433,451 | 4,433,452 | Need advises how to make authentication in asp.net | <p>Im developing asp.net c# web site where i want to make user authentication. without any roles or something. </p>
<p>i have database with user table where i store all user data, this table have relationship with many other tables.</p>
<p>I like asp.net from authentication controls, but problem is that it have her custom database lots of tables, views and stored procedures, i need more simpler solution for my problems. All i want is to make secure remember me and any time check if user is logged in and get user name or id. Of course i tried custom relationship provider but i could not changed asp users table to my user table .</p>
<p>So I just need secure remember me function and to get user id any time.</p>
| c# asp.net | [0, 9] |
2,858,749 | 2,858,750 | How to call javascript postback codebehind with same submit button | <p>I have a asp.net application display file names with treeview structure on the page.
After the user click on the checkbox to select the download files on the treeview then they can click the submit button.
First, I need to retrieve the checked(selected) node path value.
Second, pass all the node path with folder/file names to client javascript to downloading the files to local machine. (we are using third party Softartisans XFile download which are using javascript function).</p>
<p>I was able to retrieve the nodepath value with onclick at codebehind, but have problem to pass the value to javascript function.</p>
<p>My question is "There is any way I can call javascript function and pass the values AFTER the postback. I have used ReisterArrayDeclaration, the codes as ..</p>
<pre><code>if (!IsPostBack)
{
dnlFile = getDownloadFile();
ClientScriptManager csm = Page.ClientScript;
csm.RegisterArrayDeclaration("dnlFile", dnlFile);
btnDownLink.Attributes.Add("OnClick", "btnFileDown_Click('" + dnlFile + "')");
}
protected void btnDownLoad_Click(object sender, EventArgs e)
{
TreeView tv = tvFileDown;
if (tv.CheckedNodes.Count > 0)
{
foreach (TreeNode node in tv.CheckedNodes)
{
string strFilePath = Server.MapPath(initFolderPath + node.ValuePath);
if (Directory.Exists(strFilePath))
{
lblSelectedNode.Text = node.ValuePath + ", ";
}
else
{
if (File.Exists(strFilePath))
{
dnFile.Add(node.ValuePath);
}
}
}
dnlFile = getDownloadFile();
}
}
private string getDownloadFile()
{
string downLoadFile = "";
if (dnFile.Count > 0)
{
for (var i = 0; i < dnFile.Count; i++)
{downLoadFile += dnFile[i].ToString() + ", ";}
}
lblFinalFilePath.Text = downLoadFile;
return downLoadFile;
}
</code></pre>
<p>Thans advance for your help!!</p>
| javascript asp.net | [3, 9] |
2,338,193 | 2,338,194 | Android SDK: How do you set the screen brightness | <p>I have been looking around and I could only find code that will set the brightness on that one Activity. I am trying to change the actual phone settings. The code I have tried is:</p>
<pre><code>public class AutoPowerManagerActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
adjustBright();
} catch (SettingNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void adjustBright() throws SettingNotFoundException {
// TODO Auto-generated method stub
int brightnessMode = Settings.System.getInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE);
if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
Settings.System.putInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
}
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.screenBrightness = 0.5F;
getWindow().setAttributes(layoutParams);
}
}
</code></pre>
| java android | [1, 4] |
656,971 | 656,972 | How to apply javascript on checkbox with value total? | <p>I try to print total value which is checked checkbox.
It is already work with <code>input type="checkbox"></code>
but It have made code with asp:checkbox/>.</p>
<p>I try but it is print NaN.</p>
<p>following code:
four checkbox</p>
<pre><code><asp:CheckBox runat="server" ID="CheckBox1" Text="Mobile" Value="70" onclick="checkcount(this);" />
<asp:Label ID="lbltotal" runat="server" ClientIDMode="Static"></asp:Label>
int amount=0;
function checkcount(item)
{
amount += parseInt(document.getElementById(item.id).value);
alert(amount);
document.getElementById("lbltotal").innerHTML = amount;
}
</code></pre>
| javascript asp.net | [3, 9] |
5,826,267 | 5,826,268 | split not working | <p>How do i split decimal numbers? The variable <code>bidnumber</code> is <code>10.70</code>.</p>
<pre><code>var bidnumber = $(this).parent('div').siblings('.advert-details').find('tr:eq(3)').find('.advert-details-col-2').attr('data-bid');
bidnumber.toString().split('.');
var first = bidnumber[0];
var second = bidnumber[1];
alert(bidnumber[0]);
second.substr(0, 1);
var finalnumber = first + '.' + second;
</code></pre>
<p>When i alert <code>bid[0]</code>, it should alert <code>10</code>.. Instead <code>1</code> is alerted. I don't get where i've gone wrong?</p>
| javascript jquery | [3, 5] |
1,976,621 | 1,976,622 | Order of jquery and javascript functions | <p>I have a feeling I'm missing something obvious, but...</p>
<p>All my neat jQuery functions are being forced to wait by a particularly slow-moving javascript api call from within the body of the page. I'd like to have the jQuery run first, and then the api when that's done. Is there a standard way of imposing the order?</p>
| javascript jquery | [3, 5] |
5,124,709 | 5,124,710 | How to port a J2ME application to Android platform? | <p>I have heard that there are soft wares for converting an existing J2ME app to Android? But I was doing a manual conversion till now. Am I doing a silly job/is it possible to do convert any J2ME application?</p>
| java android | [1, 4] |
140,940 | 140,941 | Can we pass datatable from Business layer to presentation Layer? | <p>I am working on a project to make a 3-tier architecture, i need to ask if we can pass a data table directly to presentation layer as it comes from data layer,is it a good practice ?</p>
| c# asp.net | [0, 9] |
2,084,362 | 2,084,363 | Query generates an error | <p>I am doing the request, it writes an error
id - INTEGER PRIMARY KEY
help</p>
<pre><code>cur = db.query("Sales_region_table t1, region_table t2 join region_table t2 on t1.id_region = t2.id ", null, " id_region = " + id_region + " and id_category = " + id_category + " and id_product = " + id_product + " ", null, null, null, null);
</code></pre>
<p>11-01 08:28:10.600: I/Database(1251): sqlite returned: error code = 1, msg = ambiguous column name: t2.id</p>
| java android | [1, 4] |
2,059,216 | 2,059,217 | Retrieving item from List collection when each index have a set of items | <p>I am trying to create a form application with asp.net C# that display question and hint. I was going to put the two in a separate list collection but there could be a possibility that questions and hints can become disjointed so I decided to create a class where it takes ID, Q, and Hint and then put them in a list collection as a set. </p>
<p>Here is the code in QHint.cs file:</p>
<pre><code>public QHint (int ID, string Q, string Hint)
{
this.ID = ID;
this.Q = Q;
this.Hint = Hint;
}
public int ID { get; set; }
public string Q { get; set; }
public string Hint { get; set; }
</code></pre>
<p>Here is the code in the form1.cs file:</p>
<pre><code>List<QHint> QHintList = new List<QHint>;
QHintList.add(new QHint(1, "quesiton1 blah blah?", "hint1 blah blah"));
QHintList.add(new QHint(2, "quesiton2 blah blah?", "hint2 blah blah"));
.... and so on....
</code></pre>
<p>My question is how can I specify what item to retrieve from the list such as just the hint1? I tried to retrieve a set (ID, Q, and Hint) with QHintList[0] but was not even able to do that. However, ultimately I want to be able to display question1 and then when the user hit a hint button I can display the corresponding hint1. Also, is using class and list the best way logically to accomplish what I want?</p>
<p>This might be some basic knowledge and I tried looking it up like how to use a list, how to retrieve data from list, and so on but had no luck. </p>
<p>Any help will be much appreciated.</p>
| c# asp.net | [0, 9] |
3,570,505 | 3,570,506 | jQuery or JS: Select input fields with 2 level brackets? | <p>I have a dynamic form that adds users to the site, made so you can duplicate the fields to add several users on one go.</p>
<p>So, my looks like</p>
<pre><code><input name="user[1][name]" value="" />
<input name="user[1][username]" value="" />
<input name="user[1][password]" value="" />
</code></pre>
<p>And then the number is changed on the duplicated fields, eg:</p>
<pre><code><input name="user[2][name]" value="" />
<input name="user[2][username]" value="" />
<input name="user[2][password]" value="" />
</code></pre>
<p>and so on.</p>
<p>On PHP I can handle each user since it has it's own array.
But I would like to validate, for example, the username on each user via jQuery.</p>
<p>The closest I got to is</p>
<pre><code>$(this).find('input[name="user[][username]"]').each(function() {
</code></pre>
<p>But for it to work I need to explicitly write the number on the first [], eg:</p>
<pre><code>$(this).find('input[name="user[1][username]"]').each(function() {
</code></pre>
<p>Is there a way to select ALL of them? I tried putting * and * between the [] but it didn't work.</p>
<p>Thanks for your help!</p>
| javascript jquery | [3, 5] |
3,586,446 | 3,586,447 | jQuery - Setting background position from variables | <p>Im getting the X and Y co-ordinates or a selected area, Im then using that to set the position of an image in another DIV.</p>
<p>Vars: </p>
<pre><code>selection.x1 (This will need to be a negative value)
selection.y2
</code></pre>
<p>I need to write using Javascript or jQuery the following:</p>
<pre><code>div.css('background-position', -selection.xl selection.y2);
</code></pre>
<p>But this just give me an error, how can I add two background postion values to the CSS?</p>
| javascript jquery | [3, 5] |
546,006 | 546,007 | Reload html element | <p>I have a page which opens another page using window.open and does some work and refreshes whole parent page . Is it possible to refresh content of a div/table on parent page using JQuery/Javascript ?</p>
<p>FYI : Here the content of the div is not changing there is an image inside div which is edited by child window which I want to update but that image does not have unique id so I want to refresh whole div . </p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
5,616,745 | 5,616,746 | Managing JavaScript dependencies with CDN in ASP.NET | <p>Generally speaking, individual JavaScript files that a page uses should be combined into a single filed and minified. To this end, we have an <code>AssetController.ScriptTag()</code> that's used like this:</p>
<pre><code><%= ScriptTag
(
"/js/global.js",
"/js/accounts.js",
"/js/googmaps.js"
)%>
</code></pre>
<p>The output of this method is a single URL that returns a single, minified file from a GET. This worked great until we decided that we needed put our resources like .js and .css files on a CDN. Now, we need to generate these combined, minified JS files at build time, and push the results to the CDN.</p>
<p>How do most people accomplish this--how do they incorporate the generation of these files into their build and deploy?</p>
| c# javascript asp.net | [0, 3, 9] |
3,544,713 | 3,544,714 | Checking Number of Selected Checkboxes | <p>I saw the <a href="http://docs.jquery.com/Is" rel="nofollow">is</a> function in jQuery, and it returns me, for example, if any of the checkboxes are selected.</p>
<p>I need to do a check for how many checkboxes had been selected by the user, because my app requires something like "select two of these". Is there a quick way to do it?</p>
<p>Also, how can I catch when the user clicks the "submit" and then be able to decide whether to let the form send or not, according to checks?</p>
| javascript jquery | [3, 5] |
2,845,227 | 2,845,228 | Hide an ongoing notification | <p>I have the following code to create an <code>ONGOING_EVENT</code>:</p>
<pre><code>Notification notification = new Notification(R.drawable.icon, "someText" , System.currentTimeMillis());
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.flags |= Notification.FLAG_FOREGROUND_SERVICE;
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, Home.class), 0);
notification.setLatestEventInfo(this, "someTitle", "someText", contentIntent);
notificationManager.notify(SOME_ID, notification);
</code></pre>
<p>Now, I want to kill it later on:</p>
<pre><code>notificationManager.cancel(SOME_ID);
</code></pre>
<p>However, the notification remains. What could be the cause of this?</p>
| java android | [1, 4] |
4,791,066 | 4,791,067 | How do I create persistent socket connection on Android? | <p>First off, let me say that feel free to recommend me if long lived TCP persistent connections are the way to go or persistent HTTP connections are better. </p>
<p>I've also pre-read that instead of having a persistent connection, I can have a polling mechanism. </p>
<p>I'm just asking in the curious interest of how can I create a persistent connection from Android to a server?</p>
<p>Thanks!</p>
| java android | [1, 4] |
3,460,634 | 3,460,635 | populate radio button value after submit | <p>I try to implement the follwing code:</p>
<pre><code> <?php
$yesno1="";
$yesno2="";
$option1="";
$option2="";
$option3="";
if(isset($_POST['submit'])){
$yesno1=$_POST['yesno1'];
$yesno2=$_POST['yesno2'];
$option1=$_POST['option1'];
$option2=$_POST['option2'];
$option3=$_POST['option3'];
}
?>
<form method="POST" name="contact_form"
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<input type="radio" name="yesno1" value="yes" style="outline:0;"/>Yes
<input type="radio" name="yesno1" value="no" style="outline:0;"/>No
<input type="radio" name="yesno2" value="yes" style="outline:0;"/>Yes
<input type="radio" name="yesno2" value="no" style="outline:0;"/>No
<input type="checkbox" name="option1" value="Milk"> Milk<br>
<input type="checkbox" name="option2" value="Butter" checked> Butter<br>
<input type="checkbox" name="option3" value="Cheese"> Cheese<br>
<input type="submit" value="Submit" name='submit'>
</form>
</code></pre>
<p>Once I click submit button, normally the value I seleted in radio and marked in the checkbox are gone, so how can I keep the value even after the click the submit button or refrsh the page using php, javascript is fine as well, would be better if any one can help me with it on both php and javascript since I am not very good on both of them, thanks for kind help:)</p>
| php javascript jquery | [2, 3, 5] |
4,840,408 | 4,840,409 | How to use .html() with a timer in jQuery? | <p>I want to replace the contents of a div with the values found in an array. I want to keep each value within the div for 3 seconds each. Here's my code so far:</p>
<pre><code> var images = ['a.jpg', 'b.jpg', 'c.jpg'];
for (i = 0; i < images.length; i++) {
$('#slideShow').html("<img src='../"+images[i]+"' alt='' />");
}
</code></pre>
<p>This of course changes the images so fast that the human eye only sees one image being in the div at all times. I want to keep each image for 3 seconds before the next .html() is done on the div. How to do this?</p>
| javascript jquery | [3, 5] |
5,753,715 | 5,753,716 | jquery ready handler never executed | <p>I have a website about festivals, with a separate page for each festival. Normally, a festival's page should look something <a href="http://www.festivals.ie/festival/show/1" rel="nofollow">like this</a>, but <a href="http://www.festivals.ie/festival/show/30" rel="nofollow">one of the festival pages</a> has a few problems. These include:</p>
<ul>
<li>twitter and facebook buttons in header don't load</li>
<li>google map in top-right corner doesn't load</li>
<li>festival lineup is not laid out properly and blue background thereof doesn't appear</li>
</ul>
<p>After some debugging, I discovered that this is because the jQuery ready handler is not being executed. The handler I'm referring to is in an linine script that begins on line 3252 of the page.</p>
<p>I guess the reason this doesn't get executed is because a JavaScript error occurs earlier on in the page-loading process, but I can't see any evidence of errors in Firebug.</p>
| javascript jquery | [3, 5] |
2,359,849 | 2,359,850 | Call PHP function from android? | <p>I want to call specific php function on server from Android application and also to send some parameters. Till now I achieved that I can open php file using HttpClient and executed data transfer to Json and show that in my app. So, now I want to be able to call specific function and send parameter to it, how can I do that??
Thanks.</p>
| java android | [1, 4] |
5,981,051 | 5,981,052 | ASP.NET: Write a table (and checkboxes) to a word document | <p>I am writing an ASP.NET Application in c# and I'm trying to write a table to a word document.</p>
<p>I use currently the following code to write to a word doc:</p>
<pre><code> string strContent = "This content goes to the word document";
string attach = "attachment; filename=wordtest.doc";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/msword";
HttpContext.Current.Response.AddHeader("content-disposition", attach);
HttpContext.Current.Response.Write(strContent);
HttpContext.Current.Response.End();
HttpContext.Current.Response.Flush();
</code></pre>
<p>Now, my question is if anyone knows how I can write a table to a word document? </p>
<p>And second question is if anyone knows how to write checkboxes to a word doc (like you copy it from a website and paste it in word)</p>
<p>Thanks in advance! </p>
<p>Killerwes</p>
| c# asp.net | [0, 9] |
3,167,815 | 3,167,816 | Computer Science or Information Technology? | <p>Can someone help me realize what should I focus on more? I really like fixing computers, doing more physical interaction with hardware. But for some reason I want to see my self working in a Fortune 500 programming companies. Can someone help me? Am I the problem?</p>
| java c++ | [1, 6] |
4,276,880 | 4,276,881 | How to implement internet radio using java | <p>How to implement internet radio using java?
Is there any Java APIs for this?</p>
<p>I want to make a internet radio using Android / java. But I am not getting any APIs how to connect or how to receive the channel information for streaming the audio.</p>
<p>Please help me how to create that same and provide some code/API for that.</p>
| java android | [1, 4] |
4,115,503 | 4,115,504 | Maintaining application state in Android | <p>I'm trying to guess why, if I open my application, lock the device and some hours later resume the activity it crashes. I suppose thats why, after some time, Android destroy my app and then tries to resume and im not saving correctly the state of my activities.</p>
<p>How can I force Android to destroy my app as it does usually without having to wait hours?</p>
<p>Thanks in advance</p>
| java android | [1, 4] |
299,714 | 299,715 | invoking a third party app through asp.net/C# code- UI gets "stuck" | <p>Iam trying to write a webpage where iam invoking a third part app (.exe) from the code
using </p>
<pre><code>System.Diagnostics.Process.Start("app.exe")
</code></pre>
<p>The app fires and it starts to open up the GUI but gets "stuck" after about 3-4 seconds and just sits there.. Its not an app issue as it runs fine when I run it through the local admin account on the web-server. I also tried invoking this app through the admin account using </p>
<pre><code>Start(
string fileName,
string userName,
SecureString password,
string domain)
</code></pre>
<p>but that didnt help. Any help is appreciated.</p>
| c# asp.net | [0, 9] |
4,646,944 | 4,646,945 | Array of calendar objects | <p>Can one create an array of calendar objects?</p>
<p>If yes, how does one do so? This code surely gives error</p>
<pre><code>Calendar cal[length];
//loop for initialising all the objects in cal[] array
</code></pre>
<p>If no, what other way is there for getting "n" number of calendar objects?
I need this for a repeating alarm, set at different times.</p>
| java android | [1, 4] |
5,181,827 | 5,181,828 | ontouch - Switching positions of two views(images) in Android | <p>I've been looking for that 2 days long and haven't found anything related to it.</p>
<p>I'll give an example for my goal. Let's say I have 2 images positioned side by side horizontally. I want the user to be able to switch their positions onlongtouch listener. so let's say that the first image was on the left and the second was on the right side, after switching positions between them, the first image would be in the right and the second would be on the left side. </p>
<p><strong>Basically,</strong> it is just like in the launcher where you can switch apps positions.</p>
<p>Please, if anything is not clear for you, I would like to know, and I'll try to explain it better, thank you.</p>
| java android | [1, 4] |
4,042,196 | 4,042,197 | Facebook query Language | <p>Dear all,
How can i use FQl(facebook query language ) in my application to </p>
<p>1)GetOnline friends
2)Get Images
3Upload Photos
and more features </p>
| java javascript | [1, 3] |
4,895,640 | 4,895,641 | Run setTimeout only when tab is active | <p>Is there a way to stop <code>setTimeout("myfunction()",10000);</code> from counting up when the page isn't active. For instance,</p>
<ol>
<li>A user arrives at a "some page" and stays there for 2000ms</li>
<li>User goes to another tab, leaves "some page" open.</li>
<li><code>myfunction()</code> doesn't fire until they've come back for another 8000ms.</li>
</ol>
| javascript jquery | [3, 5] |
2,782,105 | 2,782,106 | how to check whether the number ends with 9 or not in numbers 1to 100 | <p>How can I to print the numbers from 1 to 100 in the following format?</p>
<pre><code>1-------------9
10------------19
20-------------29
30--------------39
40-----------49
50-----------59
60-----------------69
70---------------79
80---------------89
90-----------------99
</code></pre>
| c# c++ | [0, 6] |
4,218,456 | 4,218,457 | On mouseover change auto to false | <p>I have this code and i want the mouseover to change the variable auto from true to false.</p>
<pre><code>if ($featuredArea.length) {
$featuredArea.et_switcher({
useArrows: true <?php if (get_option($shortname.'_slider_auto') == 'on') { ?>,
auto: true,
autoSpeed: <?php echo(get_option($shortname.'_slider_autospeed')); ?>
<?php }; ?>
});
};
$("div.slide").mouseover(function(){
$featuredArea.et_switcher({
auto: false
});
});
</code></pre>
<p>The last part is where I am trying to do that where it stars with div.slide. However it is not working. </p>
| javascript jquery | [3, 5] |
5,230,672 | 5,230,673 | place cursor at the end of text in asp.net textbox using tab key | <p>I have a asp.net textbox which contains some predefined text by default.
when i move from one textbox to another using tabkey the cursor should place at the end of text. is it possible using jQuery or javascript ?
thank you</p>
| c# asp.net | [0, 9] |
2,727,771 | 2,727,772 | Setting Android wallpaper w/ scaled images for different resolutions/screens | <p>Im am trying to set the wallpaper where it scales correctly for all phones. Right now I have motorola droid size wallpapers packaged with my app, 960x854, and it works fine. The problem is that I ran my apk on a mytouch and the wallpaper was zoomed in big-time.</p>
<p>I was told to use "Bitmap.createScaledBitmap()" so I got some code together to do this:</p>
<pre><code>if (position == 0) {
try {
Bitmap img_0 = BitmapFactory.decodeResource(getResources(), R.drawable.a_0);
Bitmap resized;
Display display = getWindowManager().getDefaultDisplay();
int newHeight = display.getHeight();
int newWidth = display.getWidth();
resized = Bitmap.createScaledBitmap(img_0, (newWidth), (newHeight), true);
WallpaperManager wm = WallpaperManager.getInstance(GalleryExample.this);
wm.setBitmap(resized);
} catch (IOException e) {
e.printStackTrace();
}
}
</code></pre>
<p>The problem is that I cant get it to scale as this method isnt working that well where its similar to where it was before, not much has changed, the image still seems zoomed in on the mytouch phone. </p>
<p>Is there a method to scale properly? I get the feeling that Android is messing with the picture itself when the wallpapermanager is called.</p>
| java android | [1, 4] |
1,833,753 | 1,833,754 | jQuery + A function that returns clicked element | <p>I've been stuck on this for a long time now, I am looking for a bit of guidance ...
I want to turn the following, into something more dynamic. I want the 'selector' to change / be based on whichever element was clicked. </p>
<p>So this is kind of what I think needs to be done:</p>
<ol>
<li>figure out which element was clicked. (h1, p, ol)</li>
<li>with that element now in a variable, apply a similar function to the one i've created below.. </li>
</ol>
<p>Otherwise, I have to specify this same function for every element instance. (h1, h2, h3, p, ul, ol)</p>
<p>So far this is what I have: (which works, but evidently only for my h1 element)</p>
<pre><code>$("#content_body h1").click(function() {
$(this).hide(); //hide current element.
$(this).next().show(); //display next element.
var numofEl = $("#content_body h1").length;
if ($(this).next().index() == numofEl) { //if we're at last element,
$("h1:first-child").show(); //restart cycle.
}
});
</code></pre>
<p>Any help is always very much appreciated.. Thanks in advance!</p>
<p>*<strong><em>Update</em>**</strong></p>
<p>Another way of putting this / describe what I'm trying to get at: </p>
<p>Say you have many different elements in a container. (eg > #content_body)</p>
<ul>
<li>for each different element type (h1, h2, p) - only display one at a time. (starting by default with first of each el.)</li>
<li>when you click the element, it cycles through that same element sibling. (h1 will hide current h1, and display next h1, when it reaches end / last h1, it restarts cycle)</li>
</ul>
| javascript jquery | [3, 5] |
496,670 | 496,671 | jQuery extension is undefined in document.ready | <p>I'm just baffled on this one. I'm using linq.js, which is a great library that adds LINQ-style extension methods to js and jQuery. One of them is <code>$.Enumerable</code>, which is used to translate a jQuery list into another object that has the LINQ goodness. This has worked fine for weeks. </p>
<p>Today I did some refactoring, and this broke, but in a way that I can't figure out <em>at all</em>. Specifically, I've put debugging in and verified that <code>$.Enumerable</code> exists <em>until</em> document.ready is called, and in the ready callback rountine, <code>$.Enumerable</code> is undefined, even though it <em>was</em> defined until document.ready was called. So, something is resetting the global jQuery ($) object to a new one, or else unsetting the <code>$.Enumerable</code> property, but I can't figure out what. And whatever it is just started today, but I can't see how any of my changes would have caused this; I moved some stuff from one page to another, but AFAICT, everything is in the same order. Hoping this rings a bell for someone who can point me in the right direction.</p>
| javascript jquery | [3, 5] |
2,497,354 | 2,497,355 | Disable/Enable input:date on checkbox click doen't work properly? | <p>I'm trying to disable the Date field on uncheck checkbox and vice-versa. </p>
<p><a href="http://jsfiddle.net/MyNameIsSakthi/ZKw9x/2/" rel="nofollow">http://jsfiddle.net/MyNameIsSakthi/ZKw9x/2/</a></p>
<p>Also this works differently in different browsers! </p>
<pre><code>$('#certExpiry').click(function(){
if($('#certExpiry').is(':checked')){
alert('checked');
$('#expiryDate').removeProp('disabled');
}
else
alert('uncheck');
$('#expiryDate').prop('disabled',true);
});
</code></pre>
| javascript jquery | [3, 5] |
4,898,139 | 4,898,140 | jQuery getScript returns undefined | <p>For example i have script</p>
<pre><code>$.getScript('http://jquery.com/files/social/js/jquery.tabs.js',function(data){console.log(data)})
</code></pre>
<p>In returns <code>undefined</code>, but if i load in this way:</p>
<pre><code>$.getScript('/social/js/jquery.tabs.js',function(data){console.log(data)})
</code></pre>
<p>It will return me contents of my script. Is it possible to fix?</p>
| javascript jquery | [3, 5] |
2,489,947 | 2,489,948 | How to update the cookie value using jQuery? I don't want to update the cookie expire time? | <p>I have the cookie for delete Option. But when the user uses the undo feature, I want to update the cookie. The cookie is set to expire in 5 minutes when created.</p>
| php jquery | [2, 5] |
4,222,376 | 4,222,377 | JS: Check boxes Linked to Span & Background Color | <p>I have two checkboxes (see below) that when clicked, activate a change in background colour of a span. The problem is, I need it such that only ONE of these checkboxes can be activated, while the other one gets de-activated. I know all about radio buttons, the issue is that even when the radio button deactivates, it does not remove the background color of the span. I need a solution that allows ONLY ONE to be selected, and automatically removes the background colour when another option is selected.</p>
<p>Example:
<a href="http://eblacksmith.com/test/" rel="nofollow">http://eblacksmith.com/test/</a></p>
<p>Core code:</p>
<pre><code>$(document).ready(function() {
$("span[class='checkbox']").addClass("unchecked");
$(".checkbox").click(function(){
if($(this).children("input").attr("checked")){
// uncheck
$(this).children("input").attr("checked", false);
$(this).removeClass("checked");
$(this).addClass("unchecked");
}else{
// check
$(this).children("input").attr("checked", true);
$(this).removeClass("unchecked");
$(this).addClass("checked");
}
//alert($(this).children("input").attr("checked"));
});
});
</code></pre>
| javascript jquery | [3, 5] |
795,152 | 795,153 | Object reference not set to an instance when modifying an existing cookie in code behind | <p>In the line "Response.Cookies...", I get an object reference not set to an instance of an object. Is there a way to fix this and use a timer in my ASPX code behind?</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
object o = new object();
TimerCallback timercallback = new TimerCallback(StartCallback);
System.Threading.Timer timer = new Timer(timercallback, o, 0, 50000);
if (are.WaitOne())
{
Response.Redirect("Default.aspx");
}
}
public void StartCallback(object o)
{
//Request.Cookies["haspassed?"].Value = "";
Response.Cookies["haspassed?"].Expires = System.DateTime.Now.AddMonths(-1);
are.Set();
}
</code></pre>
<p>Thanks</p>
| c# asp.net | [0, 9] |
5,933,663 | 5,933,664 | Is there a way to make applications in C# for iphone | <p>I was wondering if you can make C#/.NET applications for iPhone? How would I start?</p>
| c# iphone | [0, 8] |
3,091,727 | 3,091,728 | Click location in image using JQuery | <p>is there an easy way to find where user clicked inside an image (div, ...), relative to top-left corner of the element? (using js/jquery)</p>
<p>Basic event.pageX/event.pageY does not take into account scrolling and element position. Combining Document.getScrollTop() and element.getAbsoluteTop ( <a href="http://stackoverflow.com/questions/1852921/mouse-click-location-on-an-image">Mouse click location on an image</a> ) does not look nice at all (may not even work on all browsers as far as I know).</p>
<p>Is there a simpler way to this?</p>
| javascript jquery | [3, 5] |
5,171,588 | 5,171,589 | JavaScript alert not working in Android WebView | <p>In my application I am using WebView and in that I am using JavaScript alert( ) method but its not working, no pop-up appears.</p>
<p>in my manifest file I have added </p>
<pre><code><uses-permission android:name="android.permission.INTERNET"></uses-permission>
</code></pre>
<p>and in activity file I have added </p>
<pre><code>mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/demo.html");
</code></pre>
<p>In layout xml file I have added</p>
<pre><code><WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</code></pre>
<p>Any clue how to enable full JavaScript in WebView.</p>
<hr>
<p><strong>Update</strong></p>
<p>Thanks mark<br>
the alert() method in the html file are working now :) .</p>
<p>Now there are two issues in WebView :
1: I am using a in the html file that i am loading in WebView , and trying to write in Hindi language font in it,
but when i try to write Hindi text it displays as symbols ( rectangle symbols like [] ) .</p>
<p>when i do the same in firefox browser on desktop it works fine.
any clue how to give support for multiple language in textarea in WebView ?</p>
<p>2: When I am clicking submit and trying to open the value of text in alert() method in another java script it doesn't work , does it mean even after using WebChromeClient
its applicable only for current loaded html page and not java scripts called from that page ? </p>
| javascript android | [3, 4] |
4,129,250 | 4,129,251 | javascript reversible pseudo hashing | <p>Are there any "reversible" pseudo hashing functions available in javascript? The reason I ask is because I'm bouncing a string around various parts of my application but the string contains characters that are incompatible with certain parts of the app. So I'd like to convert "152(/,blue-Test#" in to an alphanumeric string and then be able to convert it back to the original value later on.</p>
<p>Security etc is not important, it can be "crackable", the length of the hash can be variable, etc.</p>
<p>If the same function could be easily replicated in to a PHP function that would be perfect.</p>
| php javascript | [2, 3] |
5,379,434 | 5,379,435 | What's the equivalent of this in plain JavaScript? | <pre><code>$('<span class="pictos">j</span>').prependTo('li');
</code></pre>
| javascript jquery | [3, 5] |
5,050,756 | 5,050,757 | How should i get some value from javascript object and check for null | <p>I am getting the element as</p>
<pre><code> var minPricePerInputField = $("input#A"+indexNr);
</code></pre>
<p>The element can be present also or not also. I am getting some [object Object] thing. I have no idea what is this. I am receiving this [object Object] when the element is not there.</p>
| javascript jquery | [3, 5] |
108,394 | 108,395 | Does technology exist that could allow devices to access and use data without having to download or stream it? | <p>Say the data never has to be copied to the client device, but always remains locked in the server. Say all the requesting device does is "hack in" to the server using a special code and only downloads some kind of tiny-size alias that gives it access to the entire file(s) on the server? Does this technology already exist, or if not, does it sound possible?</p>
| php javascript asp.net | [2, 3, 9] |
7,145 | 7,146 | How to find out where this ConcurrentModificationException crashes? | <p>I am stuck with an <code>ConcurrentModificationException</code> and I Can't figure out where this happens in my code. All that Debug gives me is this:</p>
<pre><code>myApp [Android Application]
DalvikVM[localhost:8631]
Thread [<1> main] (Suspended (exception ConcurrentModificationException))
ViewRoot.draw(boolean) line: 1631
ViewRoot.performTraversals() line: 1329
ViewRoot.handleMessage(Message) line: 1944
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 126
ActivityThread.main(String[]) line: 3997
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 491
ZygoteInit$MethodAndArgsCaller.run() line: 841
ZygoteInit.main(String[]) line: 599
NativeStart.main(String[]) line: not available [native method]
Thread [<8> Binder Thread #2] (Running)
Thread [<7> Binder Thread #1] (Running)
Thread [<9> AsyncTask #1] (Running)
Thread [<10> AsyncTask #2] (Running)
Daemon Thread [<12> [email protected]@40770068] (Running)
Thread [<11> AsyncTask #3] (Running)
</code></pre>
| java android | [1, 4] |
3,169,457 | 3,169,458 | How to keep refreshing the page periodically while the user is away from the page? and not to refresh if on the page | <p>Is it possible to refresh a webpage, say, every minute when the user is NOT on the page? For example, if I am visiting a PageX and stay on the page it doesn't refresh but as soon as I navigate away from the page (that is, switch to another tab/window or a program, then the PageX refreshes every x minutes or seconds? How do I go about this? Thx.</p>
<p><strong>Update:</strong></p>
<p>"on the page" means the page is the current window i.e. it has focus. So if the PageX has a link to a pop window, say 100 x 100, clicking that opens the popup, while the page is still kind of visible behind that tiny popup window, it doesn't have a focus, hence needs refresh as stated above.</p>
<p>Any thing not clear please ask.</p>
<p><strong>Update 2</strong></p>
<p>As suggested by Mattk below .. Following seems to be working in Firefox (haven't checked in the latest), and Chrome. In the IE 8, if I switch to another tab or a program, it doesnt' refresh the page, but if I am on the page and click in the address bar, it starts refreshing the page. Any ideas how to get it working in IE?</p>
<pre><code>var pageFocused = false;
function onPageFocus(){
pageFocused = true;
//document.body.className = 'focused';
}
function onPageBlur() {
pageFocused = false;
//document.body.className = 'blurred';
};
function checkActivity() {
if(pageFocused == false){
location.reload(true);
}
}
setInterval("checkActivity()", 1 * 1000);
if (!+"\v1") { // check for Internet Explorer
document.onfocusin = onPageFocus;
document.onfocusout = onPageBlur;
} else if (/*@cc_on!@*/false) {
document.onfocusin = onPageFocus;
document.onfocusout = onPageBlur;
} else {
window.onfocus = onPageFocus;
window.onblur = onPageBlur;
}
</code></pre>
| javascript jquery | [3, 5] |
4,860,417 | 4,860,418 | Javascript to validate two text boxes | <p>I have two text boxes.</p>
<p>One text box is min and other text box is max. </p>
<p>I want to make sure that the user enters a greater value in the max text box compared to the min text box.Also the case might be handled if the user enters one text box is about to enter the next text box .How can i do this job effeciently.</p>
| javascript jquery | [3, 5] |
2,723,822 | 2,723,823 | Infragistic grid | <p>I am using Infragistic Webdatagrid to display data.
when ont of the column have null value,that row do not displayed in that grid.</p>
<p>Have any one has suggestion.?</p>
| c# asp.net | [0, 9] |
1,810,008 | 1,810,009 | How can i remove columns which contains 0 using lambda expression | <p>I have a list which contains suppose 4 columns i want to remove columns which contains 0 from first row to last row. In this case i want to remove 2nd & 4th column how can i achieve this using lambda expression c# 4.0</p>
<pre><code>c1 c2 c3 c4
1 0 10 0
2 0 20 0
3 0 30 0
</code></pre>
<p>o/p should be</p>
<pre><code>c1 c2
1 10
2 20
3 30
</code></pre>
| c# asp.net | [0, 9] |
2,392,324 | 2,392,325 | Is php very limited? | <p>I've tried asp.net and jsp...and the programming language was powerful enough to create both desktop and Windows apps.</p>
<p>Butwhat can I possibly do with php other than creating web applications? Does it have some kind of runtime or framework?</p>
<p>Thanks</p>
| java php asp.net | [1, 2, 9] |
5,913,553 | 5,913,554 | iPhone Date Field - Change Date Format | <p>I have this field that asks for a date in an iPhone HTML App:</p>
<pre><code><input type="date" name="DepartureDate" id="DepartureDate" placeholder="Date" value="" class="bookingField" />
</code></pre>
<p>This script:</p>
<pre><code>var ddate1 = $('#DepartureDate').val();
alert(ddate1);
</code></pre>
<p>returns this value: 2012-12-01 (when I select this date of course). Now can I can convert "ddate1" to look like 01/12/2012 ? </p>
| javascript jquery iphone | [3, 5, 8] |
202,320 | 202,321 | How to remove .aspx from url | <p>How can i remove .aspx from my urls as I used UrlRewritingNet and its giving me page not found error when i host the site to the server but its alright in the IDE browser. </p>
| c# asp.net | [0, 9] |
4,336,279 | 4,336,280 | window.history.pushState | <p>This code is working only with jquery 1.6 how do I make it run as jquery 1.9?
`
$(document).ready(function(){
var content = $('#conteudo');</p>
<pre><code> loading = new Image(); loading.src = 'http://wbruno.com.br/scripts/ico-loading.gif';
$('#menu a').live('click', function( e ){
e.preventDefault();
content.html( '<img src="http://wbruno.com.br/scripts/ico-loading.gif" />' );
var href = $( this ).attr('href');
$.ajax({
url: href,
success: function( response ){
//for?ando o parser
var response = $( '<div>'+response+'</div>' );
var data = response.find('#conteudo').html();
//apenas atrasando a troca, para mostrarmos o loading
window.setTimeout( function(){
content.fadeOut('slow', function(){
content.html( data ).fadeIn();
var title = response.find('title').text();
window.history.pushState( href, title, href );
document.title = title;
});
}, 500 );
}
});
});
});
</script>`
</code></pre>
| javascript jquery | [3, 5] |
1,176,415 | 1,176,416 | Change the Dialog style using a theme | <p>I was wondering whether there is a simple way to tell Android to always use a custom style to display <code>Dialogs</code>.</p>
<p>Using themes and styles you can change the look and feel of all, say, <code>TextViews</code> using this piece of code when defining a theme in themes.xml:</p>
<pre><code><item name="android:textViewStyle">@style/Blue.TextView</item>
</code></pre>
<p>with Blue.TextView being defined in styles.xml.</p>
<p>Is there some way to do so for <code>Dialogs</code> as well ?</p>
| java android | [1, 4] |
2,073,582 | 2,073,583 | Multiple Images in Container with Zoom In-Out button, Next Previous button, Image Count Same like Google Pdf Viewer | <p>I am looking for a Image Container with Zoom-In and Out Button, Next-Previous Button, Active Image with Total Count Same like Google Pdf Viewer... </p>
<p>Is There any Container like that in Jquery ?? Comments are welcomed :)</p>
| jquery asp.net | [5, 9] |
4,266,682 | 4,266,683 | How can convert ArrayList<Long> to String in Java (Android)? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/599161/best-way-to-convert-an-arraylist-to-a-string">Best way to convert an ArrayList to a string</a> </p>
</blockquote>
<p>I need your help! I have array of JSon (esponse from Facebook). ArrayList. How can convert this array to String? Thanks.</p>
| java android | [1, 4] |
2,701,099 | 2,701,100 | Get elements by class name inside another element with jQuery | <p>How can I get an element by id, and then inside this element get all elements by class name using jQuery? It's pretty easy to do this using the standard JS functions getElementById() and getElementsByClassName(), but unfortunately IE 7-8 do not support the latter.</p>
| javascript jquery | [3, 5] |
462,642 | 462,643 | asp.net new page on button click | <p>Trying to display a new page, in a new window when the user clicks on a button.
Trying to test it out with this but no luck so far:</p>
<pre><code>Label1.Text = "<form><input type=button name=print value='Print View' onClick='javascript:window.open('http://mylink','mywindow')'></form>";
</code></pre>
<p>I think it might be a formatting issue, but just can't see it.
For example this works just fine:</p>
<pre><code><input type=button name=close value='Close' onClick='javascript:parent.jQuery.fancybox.close()'>
</code></pre>
| c# asp.net | [0, 9] |
5,494,637 | 5,494,638 | Selecting session variable with an IF statement | <p>I have this code to send variables to a datagrid on another page</p>
<pre><code> protected void Button1_Click(object sender, EventArgs e)
{
int agent = int.Parse(txtAgencyCode.Text);
Session["para1"] = agent;
Button1.Attributes.Add("onclick", "window.open('http://localhost:50771/WebSite4/Datagrid.aspx'); return false;");
}
protected void btnTitleSearch_Click(object sender, EventArgs e)
{
Session["para2"] = txtTitleSearch.Text;
btnTitleSearch.Attributes.Add("onclick", "window.open('http://localhost:50771/WebSite4/Datagrid.aspx'); return false;");
}
</code></pre>
<p>and this code on the other page that uses the session variable from button one</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
int field1 = (int)(Session["para"]);
localhost.Service ws = new localhost.Service();
GridView1.DataSource = ws.GetJobsByAgencyID(field1);
GridView1.DataBind();
}
</code></pre>
<p>What i cannot figure out is how to make an if statement (or even if it will be an if statement that is used) to decide which parameter is passed to my datagrid. </p>
<p>For info there will be another 3- 4 controlos on the default page (Only one of which will be activated) and the parameters will take diffeent types.</p>
<p><strong>EDIT</strong>
So sorry you all found my question hard to understand, im not by any means a profesional or even what yuo may call a competent.
James Hill and Ravi gave me pretty much what I was after (need to test but looks like it). Thanks all for trying :D</p>
| c# asp.net | [0, 9] |
5,267,777 | 5,267,778 | ASP.NET 1.1 issue | <p>For some reason I cannot add a server control onto a specific asp.net form. If I make an attempt to do this, I get the following error when selecting from the datagrid: Index was out of range. Must be non-negative and less than the size of the collection </p>
<p>I have checked the values and they are all non negative and this exact select works if I restore the page back to the original form from source control. </p>
<p>How do server controls affect the index property of a datagrid? </p>
<p>here is where the code fails:</p>
<pre><code>int _indiv;
int _index;
index = e.Item.ItemIndex;
indiv = Convert.ToInt32(
(grd_associateSearch.DataKeys[e.Item.ItemIndex]).ToString());
</code></pre>
<p>I cannot get past the last line with an additional server control on the page and the code works flwlessly without it.</p>
| c# asp.net | [0, 9] |
3,216,905 | 3,216,906 | Javascript image height and other calculation | <p>I was having a problem on getting the height and also calculating other calculations.</p>
<p>I want to get the image height after it has loaded, so I put it on the onload attribute of <code><img></img></code> function, here's my code</p>
<pre><code><p class="test1" style="position:absolute;bottom:0px;">
<img src="'+getBaseURL()+'js/check/no-image.png" rel="fullname"
onload="verticalCenter()"/>
</p>
function verticalCenter(){
var imageHeight = jQuery(".test1 img").height(); //I get a result of 0
var total = imageHeight / 2 + 80
}
</code></pre>
<p>I already tried using setTimeout but it still fails.
What I was planning to do here is to set the css of <code><p class="test1"></code> into like this:</p>
<pre><code>jQuery(".test1").css("bottom","-"+total);
</code></pre>
<p>As I said, this isn't working because I don't get a result in total.</p>
<p>How would I do this, Is there a way to solve this problems, I'm already scratching my head on this.</p>
<p>Thanks in advance!</p>
| javascript jquery | [3, 5] |
4,775,385 | 4,775,386 | Opening a link in new tab | <p>In my website I use an imagebutton to send the ID of a project as a command argument.In a window, I only display one picture and that's the imagebutton. When that image is clicked I want to open the related project's all pictures in a new tab.</p>
<p>With this code on code behind,</p>
<pre><code>int ID = Convert.ToInt32(e.CommandArgument);
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", string.Format("yenipencere = window.open('Projeresim.aspx?ProjeID={0}','_blank'); ", ID), true);
</code></pre>
<p>I can manage this beautifully on mozilla firefox and internet explorer, but google chrome insists on opening it as a pop-up. Is there any way I can make this happen in chrome as well or is it a default chrome setting?</p>
<p>I know I could use other linking methods but I need to send an ID as a parameter.</p>
<p>Thanks in advance.</p>
| javascript asp.net | [3, 9] |
1,454,146 | 1,454,147 | Why you don't create objects in JAVA? | <p>I am watching some android tutorials and have one question. Why do you write your class and never create object/use methods like in cpp?</p>
| java android | [1, 4] |
3,727,874 | 3,727,875 | Did jQuery drop support to attr on some DOM properties? | <p>I had some old jQuery working code with:</p>
<pre><code>if ($element.attr('checked') === 'checked')
</code></pre>
<p>that was never rewriten to suggested:</p>
<pre><code>if ($element.prop('checked'))
</code></pre>
<p>yet it worked. </p>
<p>But now, I've updated to jQuery 1.9.1 and accessing checked with attr returns undefined. Does it mean that jQuery dropped support for some DOM properties like checked/disabled/selected ? </p>
| javascript jquery | [3, 5] |
357,234 | 357,235 | How to Scroll Down - JQuery | <p>I'm not a programmer, but I use the code below to scroll the page to the top.</p>
<p>How can I adapt it to make a scroll down?</p>
<pre><code><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<a class="btnMedio" href="javascript:;">
<img src="http://desmond.imageshack.us/Himg41/scaled.php?server=41&filename=deixeseuemail.png&res=landing"/>
</a>
<script>
$('.btnMedio').click(function(){
$('html, body').animate({scrollTop:1000},'50');
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
2,200,842 | 2,200,843 | Include jQuery document.ready() as an include file | <p>Am I able to include as an include, an external jquery.dialog.js file that consists of the following:</p>
<pre><code>$(document).ready(function(){
$(function() {
location.hash = 'PAGETOP';
});
$("#dialogou").dialog({
autoOpen: false,
closeOnEscape: false,
resizable: false,
modal: true,
draggable: true,
position: ["center", 100],
buttons: {
'Ok': function() {
$(this).dialog("close");
closeReq();
}
}
});
});
</code></pre>
<p>and then pass this in using the script include notation:</p>
<pre><code><script type="text/javascript" src="../jquery.dialog.js"></script>
</code></pre>
<p>Any help would be appreciated as it doesn't seem to work for me.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
5,486,677 | 5,486,678 | Response.Redirect URL with querystring error | <p>I am getting 'Resource cannot be found' error with the following URL Response.Redirect. If I use Response.Redirect("~/Orders/ViewOrders.aspx"), it works fine. What could be wrong? Thanks for any suggestions.</p>
<p>Here is the output of the URL string.</p>
<p>~/Orders/ViewOrders.aspx?url='http://servername/Reports/Pages/ReportViewer.aspx?/test/test_orders&rs:Command=Render'</p>
<p>Here is my code.</p>
<p>string url = string.Format("~/Orders/ViewOrders.aspx?url='{0}'", editItem.Cells[14].Text);
Response.Redirect(url);</p>
| c# asp.net | [0, 9] |
2,993,031 | 2,993,032 | posting rows of html table seperately to php | <p>I'm trying to store contents a tr in table #itemsTable, in array celValues and post it to php and repeat it (post next tr until last tr).
here is code:</p>
<pre><code>$('#save').click(function(){
//alert("hi");
var celValues= new Array();
$('#itemsTable tr').each(function() {
celValues[0] = $('td:nth-child(2)').find('input').val();
celValues[1] = $('td:nth-child(3)').find('input').val();
celValues[2] = $('td:nth-child(4)').find('input').val();
celValues[3] = $('td:nth-child(5)').find('input').val();
celValues[4] = $('td:nth-child(6)').find('input').val();
$.post("test.php", {celvalues: celValues},function(data){
document.write(data);
});
});
});
</code></pre>
<p>test.php:</p>
<pre><code><?php
$i=0;
$arr= array();
$arr = $_POST['celvalues'];
foreach($arr as $val)
{
echo " " .$arr[$i];
$i++;
}
?>
</code></pre>
<p>problem is it repeats first row instead of posting contents of all tr.</p>
<p>output for 3 row with differnt contents.but first row repeated 3 times:</p>
<p>1000 Website Design 1 100.5 100.5 1000Website Design1100.5100.5 1000 Website Design 1 100.5 100.5</p>
| php jquery | [2, 5] |
5,247,416 | 5,247,417 | Create a page that self executes in ASP.NET | <p>Hey guys, I'm trying to create a web app similar to a web crawler on my site. I have just about all the code done to do the crawling, but I still need to physically go to the web page to activate the code. Is there any way I could have my ASP.NET code execute automatically once every day on the server? (I'm using godaddy if that makes any difference)</p>
<p>Thank you</p>
| c# asp.net | [0, 9] |
3,521,587 | 3,521,588 | How to select option in jQuery using text of option tag | <p>I'm trying to select a certain option in a select box, but it's not working:</p>
<pre><code>var category = $(row + 'td:nth-child(4)').text();
$('#category_id', theCloned).load('/webadmin/video/get_categories',function(){
$('#category_id', theCloned).val(category);
});
</code></pre>
<p>There's no error thrown, but it doesn't change the select box. What am I doing wrong here?</p>
<p>Here is an example of the options loaded by the load() call:</p>
<pre><code><option value="1">Capabilities</option>
<option value="2">Application Focus</option>
<option value="5">Fun</option>
</code></pre>
<p>The value of the category variable is "Fun" or "Capabilities", etc.</p>
| javascript jquery | [3, 5] |
4,342,732 | 4,342,733 | iterate through class, creating a serializeable object | <pre><code>public partial class VALUES
{
public struct Status
{
public const long Registered = 5;
public const long Active = 6;
}
}
</code></pre>
<p>I would like to dynamically create an anonymous object which i can serialize to JSON based on this class. Is there any way to iterate through the properties of the class above, to create something like this:</p>
<pre><code>new JavaScriptSerializer.Serialize(new {
Values = new
{
Status = new
{
Registered = VALUE.Status.Registered,
Active = VALUE.Status.Active,
},
} ....
</code></pre>
<p>Not sure if the code above compiles, just wanted to give you an idea of what im trying to achieve. Instead of mapping each value manually i would like to create the values dynamically. Thanks</p>
| c# javascript asp.net | [0, 3, 9] |
295,096 | 295,097 | How to set up an onTouchListener that changes an ImageView image resource? | <p>I want to setup up an onTouchListener that changes an ImageViews image resource on ACTION_UP and ACTION_DOWN. Here is my code:</p>
<pre><code> // Setup a basic upDownListener that registers UP and DOWN actions and changes the
// view image resource accordingly
View.OnTouchListener upDownListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN) {
// Button was pressed, change button background
v.setImageResource(R.drawable.button_white_pressure);
return true;
} else if(event.getAction() == MotionEvent.ACTION_UP) {
// Button was released, reset button background
v.setImageResource(R.drawable.button_white);
return true;
}
return false;
}
};
</code></pre>
<p>This code does not compile because View does not have the method setImageResource, only ImageView. But how do I tell the listener that an ImageView is being used?</p>
| java android | [1, 4] |
5,527,162 | 5,527,163 | Calling Javascript on a page programmatically (in c#) and then submitting it back to the server | <p>I need to request a page (I'm using httpwebrequest at the moment), call some javascript ( e.g</p>
<p>function selected(id) {
document.getElementById("selected").value = id;
}</p>
<p>and then submit that back to the server . . . is this possible?</p>
<p><strong>EDIT</strong></p>
<p>Sorry for the vagueness.</p>
<p>The page I'm trying to interface with is already 100% working, all I need to do is find a way to trick the server into thinking that someone has loaded up the page, caused a piece of jScript to be run, and submit it back to the server, like a faux user. I'm trying to use the embedded webBrowser on a winForm at the moment, it's easiest to do it this way because the code that waits to be told when to make this request is already written, it just needs to be able to simulate the squishy human that's not in the middle.</p>
<p>Incase you can't tell I'm currently learning javascript so forgive me if I'm not too sure with something basic ^_^</p>
| c# javascript | [0, 3] |
4,536,643 | 4,536,644 | Add values from table cells | <p>I have a table with digit values it its cells.</p>
<p>My objective is that by clicking on table cells and getting their values but adding them up as I click at will. It should keep track of the sum and show it in a separate <code>div</code>.</p>
<p>I have written code which handles clicking the <code>td</code> and adds a class which, among other things, changes the background color, necessary so that the user can see what he has clicked so far. Because classes are being added on the fly, I use <code>live()</code>.</p>
<p>Then I want to check on the fly the <code>td</code> that have the new class (called <code>selecting</code>) and add them up.</p>
<p>This is the code I have so far, but, first it does not add them up, rather, appends one after the other, and also in some weird order:</p>
<pre><code>$(document).ready(function() {
total = '';
$('td').click(function() {
$(this).toggleClass('selecting');
$('.selecting').live( {
click: function() {
if ($('td').hasClass('selecting')) {
total += $(this).html();
}
}
})
$('#feedback').text(total);
});
})
</code></pre>
<p>A subsquent step would be that, on clicking again the <code>td</code> that were clicked, the sum is substracted for the value of the clicked again cell. So if newly clicked, adds, if clicked again, substracts, but that is like a second step, too difficult for me to do all at once first.</p>
| javascript jquery | [3, 5] |
3,669,253 | 3,669,254 | Hover on trigger expand distant element. But with multiple instances | <p><a href="http://jsfiddle.net/umbriel/CvhkM/1080/" rel="nofollow">http://jsfiddle.net/umbriel/CvhkM/1080/</a></p>
<p>In this fiddle I have managed to code so that when I hover on the red trigger the div expands accordingly. <strong>However I want multiple triggers that would expand their linked divs</strong>. But since I'm new with jQuery I cannot figure out a efficient way of doing that. Any help is appreciated! </p>
<p>To add some context I want to add these expanding divs over a photo with employees so that if you hover over the trigger by their name the div will expand by their head showing extra information about that person. Sort of like annotations on the image.</p>
| javascript jquery | [3, 5] |
1,140,241 | 1,140,242 | goes back to home page when refreshing jquery | <p>I have a website with functionality of jquery for navigation. I use the load() function of jquery that enables the website to be navigated without refresh. But when I hit f5 for refresh for example I am in the Contact Us page it will hit back on the index page which is the parent page. Is there a way in jquery or ajax to focus on the page loaded when hitting refresh rather than redirecting it to the index.php page?</p>
| php jquery | [2, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.