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 |
---|---|---|---|---|---|
4,806,898 | 4,806,899 | Javascript variable problem | <p>I have a variable in javascript:</p>
<pre><code>var activeSearchButton = document.getElementById('<%=btnSearch.ClientID %>');
</code></pre>
<p>I want to set it like this:</p>
<pre><code><asp:TextBox ID="WFTo" runat="server" onchange="activeSearchButton = document.getElementById('<%=btnWFSearch.ClientID %>');"></asp:TextBox>
</code></pre>
<p>When I am trying to use the varible in javascript function, it is null. And the source shows:</p>
<pre><code>onchange="activeSearchButton = document.getElementById('&lt;%=btnSearch.ClientID %>');"
</code></pre>
<p>I noticed '& lt;' instead of "<". Is this the reason of my problem? Why does this happen? Or maybe there is another reason?</p>
<p>Thank you very much.</p>
| javascript asp.net | [3, 9] |
1,983,309 | 1,983,310 | toggle an input field | <p>i am trying this code:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$('#individual,#company').hide();
$('input[name=radios]:radio:checked').change(function() {
$('#individual').toggle(this.selectedIndex === 0);
$('#company').toggle(this.selectedIndex === 1);
});
});
</script>
<div class="radio-toolbar">
<input type="radio" name="radios">
<input type="radio" name="radios">
</div>
<div id="x">
<form method="post" id="customForm" action="">
<div id="individual">
<input name="individual" type="text" />
</div>
<div id="company">
<input name="company" type="text" />
</div>
</form>
</div>
</code></pre>
<p>basically i want to show only an input field. if i choose the first radio btn, then, i want display the div individual. If i choose the second radio, should be showed the company content.</p>
<p>thanks</p>
<p>demo <a href="http://jsfiddle.net/S5sEv/2/" rel="nofollow">here</a></p>
| javascript jquery | [3, 5] |
3,245,978 | 3,245,979 | Writing to a label from a static function | <p>I'm trying to do something that I thought would be easy but can't figure out how to write to a label inside my stating function.</p>
<pre><code>public static void StartProcessing(object data)
{
lblError.Text = "Blah Blah"
}
</code></pre>
<p>I get the error "An object reference is required for the non-static field, method, or property..."</p>
<p>So I tried creating a new instance of the label and adding it to a new instance of a control (Panel) but the lblError isn't getting displayed</p>
<pre><code> public static void StartProcessing(object data)
{
Panel Panel1 = new Panel();
Label lblError= new Label();
Panel1.Controls.Add(lblError);
lblError.Visible = true;
lblError.Text = "Blah Blah";
}
</code></pre>
<p>there must be an easy way to do this? Which i've overlooked..</p>
<p>The function is getting called as follows: If I change the above to not be static I get an error message on the second line below saying the same "An object reference is required for the non-static field, method, or property..." When this function isn't static?</p>
<pre><code>public object LaunchNewProcess(object data)
{
ThreadPool.QueueUserWorkItem(
new WaitCallback(ProcessStatuses.StartProcessing),
new object[] {newProcess, allProcesses}
);
</code></pre>
| c# asp.net | [0, 9] |
2,389,256 | 2,389,257 | Do I need to tell jslint about functions that have not yet been defined inside another function? | <p>I have code like this:</p>
<pre><code>function dialog($link) {
"use strict";
function doDialogAjax() {
$.ajax({
cache: false,
url: url,
dataType: 'html'
})
.done(onDialogDone)
.fail(onDialogFail);
}
function onDialogDone(data) {
content = data;
// ...
}
}
</code></pre>
<p>jslint complains that the onDialogDone has not yet been defined. Do I really need to define it as a global at the top of my code. The reason I am asking is because I don't think the function onDialogDone is a global. It's just a function not yet defined within the outer function. </p>
<p>Also am I correct in saying that a function defined this way should not have a semicolon at the end after the last curly brace?</p>
| javascript jquery | [3, 5] |
4,439,933 | 4,439,934 | I want Pause and Resume for this jquery animation | <pre><code>$(document).ready(function() {
setTimeout("wave()", 0);
});
function wave(){
$("#wave1")
.animate({left:"100px", top:"400px" },2000)
.animate({left:"200px", top:"0px" },2000)
.animate({left:"300px", top:"400px" },2000)
.animate({left:"400px", top:"0px" },2000)
.animate({left:"500px", top:"400px" },2000)
.animate({left:"600px", top:"0px" },2000)
.animate({left:"500px", top:"400px" },2000)
.animate({left:"400px", top:"0px" },2000)
setTimeout("wave()")
}
</code></pre>
<p>Is there a way I could somehow Pause/Resume my animation in jQuery?</p>
| javascript jquery | [3, 5] |
5,586,864 | 5,586,865 | After each times click an increasing number? | <p>I want after each times click value <code>2011</code> an increasing number, how is it?</p>
<p><strong><a href="http://jsfiddle.net/6ydUR/1/" rel="nofollow">Example:</a></strong></p>
<pre><code>$('button').click(function() {
var num = '2011';
var out = num ++1;
alert(num); // i want this output: 2012
});
</code></pre>
| javascript jquery | [3, 5] |
5,244,264 | 5,244,265 | Create multiple labels on fly in asp.net | <p>I want to create multiple labels on fly based on the number entered by user. For example if user writes 10 in textbox, 10 labels should be created with id label1 - label10 and i want to put separate text in those labels. Any idea how to do it in asp.net with c# sharp code ?</p>
| c# asp.net | [0, 9] |
5,923,454 | 5,923,455 | Dynamically add some text and text boxes to existing web page | <p>I am trying to create a number of text boxes with specific captions in front of each text box, dynamically.</p>
<p>I want the actual jquery code to create the textboxes and labels to lie within the following for loop---</p>
<pre><code>function addelements(){
jQuery('<form action="test" id="data-form" name="data-form" method="POST" onsubmit="senddatafinal();"> <p> This is a new form </p><br />First name: <input type="text" name="firstname" /><br />Last name: <input type="text" name="lastname" />').appendTo('body');
for(i=0; i<=3; i++)
{
textmessage= "This is element # " + (i+1);
fieldname= "field_" + (i+1);
//now add code to show label stored in 'textmessage'
//to the form 'data-form'
//now add code to show text box with name stored in 'fieldname'
//to the form 'data-form'
}
}
</code></pre>
| javascript jquery | [3, 5] |
2,401,841 | 2,401,842 | jQuery select all elements with a common class | <p>I want to handle a click event across a set of links so tried to approach this by adding a secondary class like following:</p>
<pre><code><a href="..." class="foo external">Test 1</a>
<a href="..." class="bar external">Test 2</a>
<a href="..." class="car external">Test 3</a>
<a href="..." class="dar">Don't handle this one</a>
</code></pre>
<p>Then tried this jquery selector to select the "external" class on links:</p>
<pre><code>$('a.external').click(function(e) {
do something here...
});
</code></pre>
<p>However this isn't working like I expected. What's the right way to handle this? Should I just use a wildcard selector like the following or is there a better way?</p>
<pre><code>$('[class^="someclass"]').click(function(e) {
....
});
</code></pre>
| javascript jquery | [3, 5] |
2,108,718 | 2,108,719 | Scroll to a specific position on a page using Javascript / Jquery | <p>It is possible to move to a certain position on a page using #elementId. How can I do the same thing using Javascript / Jquery. When a JS function is called, I want to scroll to the specific position on that page.</p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
3,856,820 | 3,856,821 | How can I add a script as code? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/148441/how-can-i-get-the-content-of-the-file-specified-as-the-src-of-a-script-tag">How can I get the content of the file specified as the ‘src’ of a <script> tag?</a> </p>
</blockquote>
<p>I want to print my "definition" of script, preventing it will be executed.</p>
<p>Tried with :</p>
<pre><code>var scriptWidget = document.createElement('script');
scriptWidget.type = 'text/javascript';
scriptWidget.src = "http://www.mywebsite.it/file.js";
$('#widget-html-codici').html(escape(scriptWidget));
</code></pre>
<p>but it prints <code>%5Bobject%20HTMLScriptElement%5D</code>.
How can I print the code as "code"?</p>
| javascript jquery | [3, 5] |
5,925,475 | 5,925,476 | javascript refreshing images every 5 seconds crashes web browser? | <p>I have a simple javascript code in an html page, refreshing an image every 5 seconds:</p>
<pre><code>function refresh() {
var unique = new Date();
document.images.EdwinImage.src = "http://192.168.0.125:8002/img?width=800&height=480&rnd=" + unique.getTime();
}
</code></pre>
<p>This code works fine on desktop browser, but on Android, it works only for some times then the browser closes without an error message and returns to the home screen.
After the crash, I look in the browser settings (via Settings->Applications->Manage Applications) I noticed the browser application has a 55MB cache... which seems to be the problem... even though I don't need the image to be cached since I request a new one every time. Yes, I have the correct html header to disable caching.</p>
<p>Here are the headers I'm using:</p>
<pre><code><meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="PRAGMA" content="no-cache">
<meta http-equiv="expires" content="0">
</code></pre>
<p>I'm using Android 2.2 on a Archos HT7V2 and the problems happens on all browsers I tried (stock browser, opera mini, dolphin hd).</p>
<p>How can I solve this problem? Or any ideas of what happened ?
Thank you,</p>
| javascript android | [3, 4] |
817,060 | 817,061 | Problems Installing Android SDK | <p>I have had to install Java and Android on my new machine. I've downloaded <code>jdk1.6.0_27</code>. It's installed in C:\Program Files\Java\jdk1.6.0_27. </p>
<p>I've set the classpath env var to C:\Program Files\Java\jdk1.6.0_27\lib and the path var to C:\Program Files\Java\jdk1.6.0_27\bin. in cmd java - version works fine. </p>
<p>When i try to download Android, it checks to see if java is installed first. It's stating java not installed on my machine. I can't proceed with the Android download. Is there a reason for this?</p>
<p>Thanks,<br>
Matt </p>
| java android | [1, 4] |
1,928,212 | 1,928,213 | jquery dynamic <tr><td> | <p>My webpage shows a list of 200 products. The user can use buttons to show and hide products. I would like to display 2 products per row. The problem is that the product may need to be on the left or right depending on what products are being shown.</p>
<p>Here is a basic JSFiddle to use as a starting point to explain what I am trying to do.</p>
<p><a href="http://jsfiddle.net/WABqU/" rel="nofollow">http://jsfiddle.net/WABqU/</a></p>
| javascript jquery | [3, 5] |
1,237,759 | 1,237,760 | C# ASP.NET PostBackUrl to an anchor | <p>I have this link button here</p>
<pre><code><asp:LinkButton ID="lnkButton" CssClass="Button" runat="server">Link Text</asp:LinkButton>
</code></pre>
<p>and I am assign it a PostBackURL in my code behind like so</p>
<pre><code>lnkButton.PostBackUrl = "#video";
</code></pre>
<p>but its not going to an anchor div video, instead I am getting a Page Not Found Error</p>
<p>What Am I doing wrong?</p>
| c# asp.net | [0, 9] |
4,794,874 | 4,794,875 | jQuery slicing and click events | <p>This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so...</p>
<p>I have a list of checkboxes, and I can get them with the selector <code>'input[type=checkbox]'</code>. I want the user to be able to shift-click and select a range of checkboxes. To accomplish this, I need to get the index of a checkbox in the list, so I can pass that index to <code>.slice(start, end)</code>. How do I get the index when the user clicks a box?</p>
| javascript jquery | [3, 5] |
2,517,331 | 2,517,332 | How can I change the image url of an image based on #var=test variable? | <p>I'm trying to change an image's imageurl on an aspx asp.net c# page based on a variable from #var=1` (or 2, or 3, or 4)</p>
<p>I know nothing about javascript unfortunately which is what I've been told I need. Can anyone point me at a novice based script I can try to learn via implementation?</p>
| c# javascript asp.net jquery | [0, 3, 9, 5] |
309,280 | 309,281 | Print both in Android and pure Java | <p>How to print both to Log.e/d/etc. and to System.out/err/etc.? I have some code that I test on desktop and sometimes I use it on Android and I want to see logs there too.</p>
| java android | [1, 4] |
772,760 | 772,761 | Page.User.Identity.Name returns empty string | <p>For some Page.User.Identity.Name always returns an empty string. Any ideas. I simply want to print it to the screen. IIS is set for integrated windows security.</p>
<p>Response.Write("Name = " + Page.User.Identity.Name);</p>
<p>Oops just noticed i hadnt set authentication to windows auth. Silly me</p>
| c# asp.net | [0, 9] |
3,760,043 | 3,760,044 | jquery returns two objects when only one exists | <p>given this HTML,</p>
<pre><code><div id="dd_container" class="dd dd_container">
<ul class="dd_deploy">
<li class="dd_deploy">
more options
</li>
</ul>
<ul class="dd">
<li class="dd">
el1
</li>
<li class="dd">
el2
</li>
<li class="dd">
el3
</li>
</ul>
</div>
</code></pre>
<p>why does this jquery function print to the console two times?</p>
<pre><code>$(document).on('click','.dd_deploy', function(){
console.log($(this).parents('.dd_container').children('ul.dd'));
});
</code></pre>
<p><a href="http://jsfiddle.net/mBPfG/" rel="nofollow">http://jsfiddle.net/mBPfG/</a></p>
| javascript jquery | [3, 5] |
4,638,109 | 4,638,110 | How to convert dateTime format in javascript | <p>How i could convert datetime <code>5/8/2011 12:00:00 AM</code> (m/d/yyyy) to dd-MMM-yyyy like <code>08-May-2011</code> in javascript.</p>
| javascript asp.net | [3, 9] |
1,753,962 | 1,753,963 | Is dynamic is same as Object | <p>In "CLR via C#" book it's mentioned that dynamic keyword corresponding FCL type is System.Object. please clarify this .</p>
| c# asp.net | [0, 9] |
3,056,446 | 3,056,447 | Which is the best file upload plugin for jquery? | <p>Which is the best file upload plugin available for jquery? I've read many problems occur with uploadify (the session id, etc) is not passed and it is not so much interoperable with SSL. If this is true which is the best file upload plugin for jquery?</p>
<p>Thanks in advance:)</p>
| jquery asp.net | [5, 9] |
26,804 | 26,805 | jQuery image gallary plugin | <p>I need to put image gallery jQuery similar to this, <a href="http://www.webdesign-flash.ro/p/html5_galery1/skinBlue.html" rel="nofollow">http://www.webdesign-flash.ro/p/html5_galery1/skinBlue.html</a> or can be better than this.</p>
| javascript jquery | [3, 5] |
3,645,136 | 3,645,137 | AJAX Closures and targeting 'this' | <p>In the code example below the success callback function logs 'input#04.update' four times rather than each individual input, which makes sense seeing how closures work but how would I go about targeting each individual input using this. </p>
<pre><code><input type="text" name="" id="01" class="update">
<input type="text" name="" id="02" class="update">
<input type="text" name="" id="03" class="update">
<input type="text" name="" id="04" class="update">
function updateFields(){
$('input.update').each(function(){
$this = $(this);
$.ajax({
data: 'id=' + this.id,
success: function(resp){
console.log($this);
$this.val(resp)
}
});
});
}
</code></pre>
| javascript jquery | [3, 5] |
5,576,589 | 5,576,590 | Replace Placeholder In Paragraph With Text Block jQuery | <p>I'm working on a snippet that will allow me to replace the placeholder in a paragraph with a text block of links. So it should look like this: <br /></p>
<pre>
Lorem Ipsum Some Text
weird
sound
happy ever after
funny
</pre>
<p>So the original paragraph look like this 'Lorem Ipsum Some * Text', where * is the placeholder. Now the difficulty I'm having is how to break the paragraph into two, insert the text block and maintain the styling.</p>
<p>Code snippet is available here <a href="http://jsbin.com/ixihej/1/edit" rel="nofollow">http://jsbin.com/ixihej/1/edit</a></p>
| javascript jquery | [3, 5] |
3,707,948 | 3,707,949 | How to cache/save custom class object in Android? | <p>I want to save <code>ArrayList<CustomClass></code>-object to somewhere in Android storage to retrieve quickly and display data in it.</p>
<p>Is this possible or not? If yes, then which technique will be suitable, SQLite or external storage?</p>
| java android | [1, 4] |
318,727 | 318,728 | Jquery-Binding each function with Live event does not work | <p>I have function </p>
<pre><code>$('table tr:gt(0)').each(function() {
if ($('td:contains("'+ pointName +'")', this).length == 0) $(this).hide();
});
</code></pre>
<p>i want this function to be bind with live(). </p>
<p>i have tried something like this which couldn't work.</p>
<pre><code> $('table tr:gt(0)').live('each', function (){
if ($('td:contains("'+ pointName +'")', this).length == 0) $(this).hide();
});
</code></pre>
<p>what is the correct way? </p>
| javascript jquery | [3, 5] |
3,675,761 | 3,675,762 | base64 encode audio file and send as a String then decode the String | <p>I have been stuck on this issue for a few hours now trying to get it working. Basically what I am trying to do is the following. Base64 encode an audio file picked up from an sdcard on an Android device, Base64 encode it, convert it into a String and then decode the String using Base64 again and save the file back to sdcard. It all sounds fairly simple and works great when doing it using a text file. For example if I create a simple text file, call it dave.text and inject some text it in say "Hello Dave" or something similar it works great, but fails when I try doing the same with a binary file, audio in this example. Here's the code that I am using.</p>
<pre><code>File file = new File(Environment.getExternalStorageDirectory() + "/hello-4.wav");
byte[] FileBytes = FileUtils.readFileToByteArray(file);
byte[] encodedBytes = Base64.encode(FileBytes, 0);
String encodedString = new String(encodedBytes);
Utilities.log("~~~~~~~~ Encoded: ", new String(encodedString));
byte[] decodedBytes = Base64.decode(encodedString, 0);
String decodedString = new String(decodedBytes);
Utilities.log("~~~~~~~~ Decoded: ", new String(decodedString));
try {
File file2 = new File(Environment.getExternalStorageDirectory() + "/hello-5.wav");
FileOutputStream os = new FileOutputStream(file2, true);
os.write(decodedString.getBytes());
os.flush();
os.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
</code></pre>
<p>At this point if I try to save the file, it becomes corrupted. The audio file hello-5.wav is larger in size then the original and it doesn't play.</p>
<p>Any ideas what I am doing wrong here? If I try to save decodedBytes using os.write(decodedBytes) it works but not when converted to a String and getBytes() is used.</p>
<p>Any ideas? Thank You!</p>
| java android | [1, 4] |
2,217,582 | 2,217,583 | Custom events vs callbacks for jQuery plugins | <p>What is better architectural solution for my own plugins to give ability to extend them -- callbacks (like many other plugins do) or custom events?</p>
| javascript jquery | [3, 5] |
4,139,852 | 4,139,853 | Retrieving and displaying dynamic content from SQL database into ASP.NET pages | <p>I am currently working on the development of news portal website in asp.net. I have created a table in sql server 2008 with parameters (NewsId, NewsTitle, NewsDetails, NewsCategory). I am now able to dynamically retrieve the NewsTitle from the database and displaying it in my aspx page.
Now I want to pass the NewsId for that particular NewsTitle and then retrieve the NewsDetails in a separate aspx page. What is the best thing to do this in ASP.NET? I don't want to create new aspx pages every time a link to the NewsTitle is clicked, rather I am interested to use the same Details page and pass different ID parameters?</p>
<p>regards,</p>
| c# asp.net | [0, 9] |
1,122,644 | 1,122,645 | Textbox enter, invokes linkbutton in firefox, not in IE | <p>i have a textbox on my form with a linkbutton next to it.
the textbox' id is textbox1 and the linkbutton is lbSearch</p>
<p>in the page_load event i add:</p>
<pre><code> this.TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13))
{
document.getElementById('" + this.lbSearch.ClientID + "').click();
return false;
}
}
else
{
return true
}; ");
</code></pre>
<p>and in firefox this works but in internet explorer it doesn't </p>
<p>this is because the linkbutton get's rendered as </p>
<pre><code> <a href="..."
</code></pre>
<p>how can i resolve this?</p>
<p>without changing the linkbutton to an imagebutton or regular button.</p>
<p>the linkbutton gets rendered like this:</p>
<pre><code> <a href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$zoeken1$lbSearch", "", true, "search", "", false, true))' id="ctl00_zoeken1_lbSearch">zoek</a>
</code></pre>
<p>edit: i tried the following and received the following message:</p>
<pre><code>function onkeydown does not always return a value
rule: 1, column: 243
source:
if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13))
{
var link = document.getElementById('ctl00_zoeken1_lbSearch');
__doPostBack(link.id.replace('_','$'),'');
return false;
}
else
{
return true;
}
}
else
{
return true;
};
</code></pre>
| asp.net javascript | [9, 3] |
3,131,868 | 3,131,869 | Can i Create the Paging user control for gridview? | <p>Hi please give me idea or reference to create Paging User control.</p>
<p>Thank You very much in advance.</p>
| c# asp.net | [0, 9] |
642,554 | 642,555 | CS0234 Error on runtime, for classes in the same assembly | <p>We have an ASP.NET 4 Web Application Project. This project contains a number of pages. After having made some changes I get an error at runtime (ASP.NET Compile time) that this or that namespace cannot be found.</p>
<p>At design time (in Visual Studio 2010) there is no problem for Intellisense to see these namespaces and classes, which are in the project assembly themselves. And there is no problems at compile time in Visual Studio either.</p>
| c# asp.net | [0, 9] |
1,090,692 | 1,090,693 | How can I make this jQuery "shrink text" function more efficient? With binary Search? | <p>I've built jQuery function that takes a text string and a width as inputs, then shrinks that piece of text until it's no larger than the width, like so:</p>
<pre><code>function constrain(text, ideal_width){
var temp = $('.temp_item');
temp.html(text);
var item_width = temp.width();
var ideal = parseInt(ideal_width);
var smaller_text = text;
var original = text.length;
while (item_width > ideal) {
smaller_text = smaller_text.substr(0, (smaller_text.length-1));
temp.html(smaller_text);
item_width = temp.width();
}
var final_length = smaller_text.length;
if (final_length != original) {
return (smaller_text + '&hellip;');
} else {
return text;
}
}
</code></pre>
<p>This works fine, but because I'm calling the function on many pieces of texts, on any browser except Safari 4 and Chrome, it's really slow.</p>
<p>I've tried using a binary search method to make this more efficient, but what I have so far brings up a slow script dialog in my browser:</p>
<pre><code>function constrain(text, ideal_width){
var temp = $('.temp_item');
temp.html(text);
var item_width = temp.width();
var ideal = parseInt(ideal_width);
var lower = 0;
var original = text.length;
var higher = text.length;
while (item_width != ideal) {
var mid = parseInt((lower + higher) / 2);
var smaller_text = text.substr(0, mid);
temp.html(smaller_text);
item_width = temp.width();
if (item_width > ideal) {
// make smaller to the mean of "lower" and this
higher = mid - 1;
} else {
// make larger to the mean of "higher" and this
lower = mid + 1;
}
}
var final_length = smaller_text.length;
if (final_length != original) {
return (smaller_text + '&hellip;');
} else {
return text;
}
}
</code></pre>
<p>Does anyone have an idea of what I should be doing to make this function as efficient as possible?</p>
<p>Thanks! Simon</p>
| javascript jquery | [3, 5] |
5,852,349 | 5,852,350 | dblclick not working as expected | <p>II have some code here <a href="http://jsfiddle.net/ggHwH/" rel="nofollow">http://jsfiddle.net/ggHwH/</a> that increases a box border by 1px each time an UP button is pressed and decreases the border by 1px each time a DOWN button is pressed. Now I'd like to sense a double-click on the down button and have that reduce the border immediately to 0. The problem I'm havng is that if you try to down click the border one px at a time, you can't help but trigger the double-click, even if you click the down button no faster than about once per second. It seems that I should have to do both clicks in less than about 250ms to trigger the double-click. Does anyone know what's going on?</p>
<p>Thanks.</p>
<pre><code> $('#up').click ( function() {
$('#box').css({'border-top-width' : '+=1px', 'borderRightWidth' : '+=1px','borderBottomWidth' : '+=1px','borderLeftWidth' : '+=1px'});
});
$('#down').click ( function() {
$('#box').css({'border-top-width' : '-=1px', 'borderRightWidth' : '-=1px','borderBottomWidth' : '-=1px','borderLeftWidth' : '-=1px'});
});
$('#down').dblclick ( function() {
$('#box').css({'border-top-width' : '0px', 'borderRightWidth' : '0px','borderBottomWidth' : '0px','borderLeftWidth' : '0px'});
});
</code></pre>
| javascript jquery | [3, 5] |
4,696,704 | 4,696,705 | How to add jQuery in JS file | <p>I have some code specific to sorting tables. Since the code is common in most pages I want to make a JS file which will have the code and all the pages using it can reference it from there. </p>
<p>Problem is: How do I add jQuery, and table sorter plugin into that .js file?</p>
<p>I tried something like this:</p>
<pre><code>document.writeln('<script src="/javascripts/jquery.js" type="text/javascript"></script>');
document.writeln('<script type="text/javascript" src="/javascripts/jquery.tablesorter.js"></script>');
</code></pre>
<p>but this seems to not work. </p>
<p>What is the best way to do this?</p>
| javascript jquery | [3, 5] |
4,256,368 | 4,256,369 | Problem while inserting html control in my database in Asp.Net | <p>My problem is that I'm inserting HTML control using Server.HtmlEncode() method <code><a href=''>Apply now!</a></code> in my database through text box but whenever I'm inserting it throws an exception. </p>
<p>My Code is Here</p>
<pre><code>textbox1.text=Server.Server.HtmlEncode("`<a href=''>Apply now!</a>`");
//Database entry
obj.html=textbox1.text;
</code></pre>
| c# asp.net | [0, 9] |
5,248,420 | 5,248,421 | jQuery Tooltip not working with detach(), appendTo, etc? | <p>I'm trying to use this jQuery Tools <a href="http://flowplayer.org/tools/tooltip/index.html" rel="nofollow">ToolTip widget</a>.</p>
<p>It works great in a situation like this:</p>
<pre><code> ...
<a id="A1">trigger</a>
<script>
$(document).ready(function () {
$("#trigger").tooltip({ effect: 'slide' });
});
</script>
...
</code></pre>
<p>But this will not work and it's what i want to do:</p>
<pre><code>$("<a id='trigger'>trigger</a>").appendTo("body");
//console.log(myTrigger);
$("#trigger").tooltip({ effect: 'slide' });
$("#trigger").tooltip().show();
</code></pre>
<p><strong>Can i dynamically add the trigger element so i can place the tooltip wherever i want? If so, how?</strong></p>
| javascript jquery | [3, 5] |
845,408 | 845,409 | jQuery - Many toggle sliders, only one visible at the time | <p>I have four jquery sliders in a page with these scripts:</p>
<pre><code>$(document).ready(function(){
$("#information").click(function(){
$("#information_show").slideToggle("medium");
});
});
$(document).ready(function(){
$("#menu").click(function(){
$("#menu_slide").slideToggle("medium");
});
});
$(document).ready(function(){
$("#books").click(function(){
$("#books_toggle").slideToggle("medium");
});
});
$(document).ready(function(){
$("#content").click(function(){
$("#content_div").slideToggle("medium");
});
});
</code></pre>
<p>So for example when I click on the div <code>#information</code> the <code>#information_toggle</code> is visible. I wounder if there is any way to make the sliders only show one at once.</p>
<p>Example: When click on <code>#books</code>, the <code>#books_toogle</code> show. Now when click on <code>#menu</code> the <code>#menu_slide</code> shows, at the same time the <code>#menu_slide</code> shows <code>#books_toggle</code> toogle/close automatic. So only one hidden div will show at once.</p>
| javascript jquery | [3, 5] |
2,512,118 | 2,512,119 | how to make a jquery hint password with asterisks | <p>example: <a href="http://jsfiddle.net/na2tD/" rel="nofollow">http://jsfiddle.net/na2tD/</a></p>
<p>currently the password is not asterisks as 'type' for password text field needs to be type="text" so it cannot be changed to type="password" which is needed if i want asterisks. How do I get both jquery hint and asterisks working together</p>
| javascript jquery | [3, 5] |
4,568,147 | 4,568,148 | Splitting code in to multiple files for easier management | <p>I am currently using jQuery to write an online application, that started off with a couple of lines of code, and have quickly now become over a 1000 lines.</p>
<p>My code's structure is simple. I have a window.load which wraps my javascript, and inside it I start adding my click event handlers, and the various functions that makeup my application.</p>
<pre><code>$(window).load(function(){
// Code goes here...
});
</code></pre>
<p>My code functions can definitely be grouped into categories; e.g. 5 functions perform animation, 12 are event handlers, etc.</p>
<p>I would like to group the functions in their own js files, and import them individually. I can later use my CMS engine to concatenate and compress the files on the fly.</p>
<p>What is the best way in doing so. I am thinking that maybe I can give some of my functions their own namespace for further clarity; e.g. all animation functions are prefixed with ANIMATION - ANIMATION.moveDiv1(), ANIMATION.moveDiv2, MYEVENT.div1Clicked, etc.</p>
| javascript jquery | [3, 5] |
4,343,330 | 4,343,331 | Paul Irish 'duck punching' pattern question | <p>Had a question about the 'duck punching' pattern I first encountered on Paul Irish's blog. I get the general premise... save a ref to an existing function, then replace the existing function with a conditional branch that will call a new function if condition is met, or the old version if not. My question is why do we have to use the "apply" with 'this' as the first param when we call the _old function? I understand how apply works, but I'm looking for some clarification on why it is necessary. </p>
<pre><code>(function($){
// store original reference to the method
var _old = $.fn.method;
$.fn.method = function(arg1,arg2){
if ( ... condition ... ) {
return ....
} else { // do the default
return _old.apply(this,arguments);
}
};
})(jQuery);
</code></pre>
| javascript jquery | [3, 5] |
2,249,247 | 2,249,248 | Accessing individual array elements using jQuery each() | <p>I can't seem to find the answer for this but how can you access an individual array element by it's index number in jQuery's each method?</p>
<p>Stright JS would do it like this:</p>
<pre><code>for(i=0; i<myArray.length; i++)
{
if(i === 1)
{
// do something
}
}
</code></pre>
<p>But I can't seem to figure out how to use find the index number in the each method...?</p>
<pre><code>myArray.each(function()
{
if(this[1])
{
// doesn't work?
}
}
</code></pre>
<p>Thank you for any help.</p>
| javascript jquery | [3, 5] |
1,663,323 | 1,663,324 | setting a background connection to a site | <p>i am doing a application now that is able to read a message from a site</p>
<p>now i am doing the part on deleting a message via a link</p>
<p>the text is stored on <a href="http://www.example.com/test/file.txt" rel="nofollow">http://www.example.com/test/file.txt</a>
i have a php script on <a href="http://www.example.com/test/delete.php" rel="nofollow">http://www.example.com/test/delete.php</a> which once the site is loaded, file.txt will become "" which is null</p>
<p>how do i create such a request to the site without alerting the user? it is working perfectly on the my comp browser</p>
<p>i have put this method into onLongClickListener</p>
<pre><code> public boolean onLongClick(View v)
{
String webURL = "http://example.net/test/delete.php";
URL url;
try
{
url = new URL(webURL);
/* Open a connection to that URL. */
HttpURLConnection ucon = (HttpURLConnection) url.openConnection();
Context context = getApplicationContext();
Toast toast = Toast.makeText(context, "Message Deleted!", Toast.LENGTH_SHORT);
toast.show();
}
catch (Exception e)
{
e.printStackTrace();
}
return true;
}
</code></pre>
| java android | [1, 4] |
4,683,439 | 4,683,440 | Using FontSelector to change font family | <p>I am using jQuery font selector plugin posted here</p>
<p><a href="http://www.fullfatcode.com/2011/04/10/jquery-font-selector-version-2/" rel="nofollow">http://www.fullfatcode.com/2011/04/10/jquery-font-selector-version-2/</a></p>
<p>It's all good, except, I want to do something when the actual font is selected. At the moment the plugin is called via</p>
<pre><code>$('input.font').fontSelector();
</code></pre>
<p>I guess what I'd like to be able to do is, capture the event when the font is selected and then do something. Maybe</p>
<pre><code>$('input.font').fontSelector(function(){
alert('hi');
});
</code></pre>
<p>Here's what I have been playing with</p>
<p><a href="http://jsfiddle.net/d7nQV/1/" rel="nofollow">http://jsfiddle.net/d7nQV/1/</a></p>
<p>I tried</p>
<pre><code>$('input.font').keyup(function(){
alert('hi');
});
</code></pre>
<p>But it doesn't like it. </p>
| javascript jquery | [3, 5] |
436,578 | 436,579 | Animating list item with more efficiency | <p>I want to bump up a li on hover and let it get to original state when the mouse leaves. This works but does the hover animat(up) another time when the mouse is leaving which gives me a delay and inefficient code. Do you guys have some suggestions for me to make this more efficient?</p>
<pre><code>function HoverListItem() {
var menuItem = $('#menu > li')
menuItem.on('hover', function(){
console.log('up');
$(this).animate({
'marginTop': '-10px'
}, 150);
});
menuItem.on('mouseleave', function(){
console.log('down');
$(this).animate({
'marginTop': '0px'
}, 150);
})
};
</code></pre>
| javascript jquery | [3, 5] |
665,142 | 665,143 | TinyMCE Editor: A potentially dangerous Request.Form value was detected from the client | <p>I have aspx in that I am calling a ascx user control in that i am using tinymce editor. When I am trying to save data i am getting the error..</p>
<p>A potentially dangerous Request.Form value was detected from the client (UserControl1$TextBox1="<p>fgh</p><p>fghj
<p>I already check <a href="http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the-client">A potentially dangerous Request.Form value was detected from the client</a></p>
<p>I tried:</p>
<p>web.config I set</p>
<pre><code><pages validateRequest="false">
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters=""/>
<compilation debug="true" targetFramework="4.0">
<@page validateRequest="false">
Server.HtmlEncode(TextBox1.Text)
encoding: "xml" // This is solving the prob. but Text is converting in HTML tag I don't want that
</code></pre>
<p>Please someone help me...</p>
| c# asp.net | [0, 9] |
4,674,413 | 4,674,414 | Why does Android use Java? | <p>OK, this should really be asked to someone from Google, but I just want other opinion.</p>
<p>Even Android supports Native code applications, the main development tool is Java. But why? I mean, isn't it too slow to interpret code on a mobile device? when introducing Froyo, Google said that new JIT compiler can achieve 2-5 times faster applications. This means, that using Java over native code is 2-x times slower.</p>
<p>Yes, I know that using managed code applications is safer in terms of system stability, since virtual machine has better control of program, but still, this performance drop is huge, and I don´t see any point why to use it. Please tell me some good reason. Thanks.</p>
| java android | [1, 4] |
4,983,760 | 4,983,761 | export a list of table to CSV file | <p>I am trying to export a list of table to comma-separated value(CSV) .but not getting the correct output .output coming from this code is in the form of html table.
Here is my code,Help Me ....
Thanks</p>
<pre><code> public void ExportToCsv()
{
DataClassesDataContext db = new DataClassesDataContext();
var employee = db.Employees.ToList();
var grid = new System.Web.UI.WebControls.GridView();
grid.DataSource = employee;
grid.DataBind();
StringBuilder strbldr = new StringBuilder();
for (int i = 0; i < grid.Columns.Count; i++)
{
strbldr.Append(grid.Columns[i].HeaderText + ',');
}
for (int j = 0; j < grid.Rows.Count; j++)
{
for (int k = 0; k < grid.Columns.Count; k++)
{
//separating gridview columns with comma
strbldr.Append(grid.Rows[j].Cells[k].Text + ',');
}
//appending new line for gridview rows
strbldr.Append("\n");
}
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=YourFileName.csv");
Response.ContentType = "text/csv";
StringWriter sa = new StringWriter(strbldr);
HtmlTextWriter ht = new HtmlTextWriter(sa);
grid.RenderControl(ht);
Response.Write(sa.ToString());
Response.End();
}
</code></pre>
| c# asp.net | [0, 9] |
2,628,633 | 2,628,634 | Using Regex to remove anything within "<!--" and "/-->" | <p>Hey guys, I have a string like this:</p>
<blockquote>
<p>Something useful (<strong>less than sign</strong>)!--?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office"
/--(<strong>greater than sign</strong>) Other useful stuff</p>
</blockquote>
<p>I need to remove anything within the "". Is there an easy way to remove this using regex or a similar method?</p>
| c# asp.net | [0, 9] |
3,945,719 | 3,945,720 | saving the canvas as a jpg | <p>Want to save the current state of my canvas as a picture, jpg file,
how do u do this? </p>
| java android | [1, 4] |
851,978 | 851,979 | Image animation keeps requesting the images | <p>I test the code in IE7, FF, Chrome, Safari and this problem occurs in Firefox only.</p>
<p><strong>I have checked that the problem only occurs in FF 3.5.x, but not FF 3.0.x.</strong></p>
<p>I want to make an image animation which has 10 images in total.</p>
<p>Currently, I use the following code to do it:</p>
<pre><code>for (var i=1;i<=10;i++){
img[i] = new Image();
img[i].src = "images/survey/share_f"+i+".jpg"
}
var cornerno = 0;
function imganimate(){
$("#surveyicon").attr("src",img[cornerno].src);
//some logic to change the cornerno
setTimeout("imganimate()",1000);
}
</code></pre>
<p>And then change an element's src to loop through the array "img".</p>
<p>however, firefox keeps requesting the images continuous (I expect it only requests each unique image just once).</p>
<p>What should I do?</p>
| javascript jquery | [3, 5] |
2,530,843 | 2,530,844 | Getting all HTML elements in the DOM where an attribute name starts with some-string | <p>I've stumbled upon a tricky one, that I haven't been able to find any references to (except one here on Stackoverflow, that was written quite inefficiently in Plain Old Javascript - where I would like it written in jQuery).</p>
<p><strong>Problem</strong></p>
<p>I need to retrieve all child-elements where the <strong>attribute-name</strong> (note: <strong>not</strong> the <em>attribute-value</em>) starts with a given string.</p>
<p>So if I have:</p>
<pre><code><a data-prefix-age="22">22</a>
<a data-prefix-weight="82">82</a>
<a href="#">meh</a>
</code></pre>
<p>My query would return a collection of two elements, which would be the first two with the <strong>data-prefix-</strong>-prefix</p>
<p>Any ideas on how to write up this query?</p>
<p>I was going for something like:</p>
<pre><code>$(document).find("[data-prefix-*]")
</code></pre>
<p>But of course that is not valid</p>
<p>Hopefully one of you has a more keen eye on how to resolve this.</p>
<p><strong>Solution</strong></p>
<p>(See accepted code example below)</p>
<p>There is <em>apparently</em> <strong>no direct way to query on partial attribute names</strong>. What you should do instead (this is just one possible solution) is </p>
<ol>
<li>select the smallest possible collection of elements you can</li>
<li>iterate over them</li>
<li>and then for each element iterate over the attributes of the element</li>
<li>When you find a hit, add it to a collection</li>
<li>then leave the loop and move on to the next element to be checked. </li>
</ol>
<p>You should end up with an array containing the elements you need.</p>
<p>Hope it helps :)</p>
| javascript jquery | [3, 5] |
107,678 | 107,679 | How to access Parent from child in JS | <p>I want to access an object's own function from a jQuery method which fails.</p>
<pre><code>function obj(){
this.send = function(){
$.get("send.php",null,function(data){
this.success();
}).error(function(){ this.fail(); });
}
this.fail = function(){
alert("fail");
}
}
var o = new obj();
o.send();
</code></pre>
<p>Gives this error: <code>TypeError: this.fail is not a function</code></p>
<p>How to access function <code>fail</code> inside jQuery?</p>
| javascript jquery | [3, 5] |
3,189,927 | 3,189,928 | How to get Host IP address in android? | <p>Q:-Now a days I am facing problem in getting IP address of android device using programming. Can any one give ma a code for solving that problem. I have already read lot of thread about it but not getting solid answer from that. Please give me any suggesting about it its appreciated.
Thanks in advance. </p>
| java android | [1, 4] |
2,632,669 | 2,632,670 | Jquery - multiple checkbox and multiple textbox | <p>I have 4 check box when i select anyone of the check box need to display the respective check box and text box.</p>
<p>input type="checkbox" id="acheck[]" value='name' </p>
<p>input type="textbox" id="productfield" value=' '</p>
<p>jquery Code:</p>
<pre><code> $(document).ready(function() {
$("#productfield").css("display","none");
$("#acheck").click(function(){
if ($("#acheck").is(":checked"))
{
$("#productfield").fadeIn("slow");
}
else
{
$("#productfield").fadeOut("slow");
}
});
});
</code></pre>
| javascript jquery | [3, 5] |
1,404,045 | 1,404,046 | Why do for loop executes before Jquery Selector in this code? | <p>In the code below the <code>for</code> loop executes always first, the jQuery selector comes later. But I want to run this for loop after changing the value of the selected sliders.</p>
<pre><code>$('div[name="FirstSliderselector"]').slider('value', $("#MasterSlider").slider("value"));
var FirstSliders = $('div[name="FirstSliderselector"]');
for (var i = 0; i < FirstSliders.length; i++) {
console.log('for loop executed');
}
</code></pre>
| javascript jquery | [3, 5] |
4,820,932 | 4,820,933 | Sort Arraylists according to Dates with particular format | <p>I have a problem that I want to sort multiple Arraylists with respect to Date Arraylist with a format as: 2011-07-18T10:39:32.144Z. How to that in java? Can anyone Help me out?</p>
<p>Thanks in advance.</p>
| java android | [1, 4] |
3,511,548 | 3,511,549 | Need help understanding code | <p>hi all i am new in jquery</p>
<p>this code in book jQuery in action page 219</p>
<p>why he use <code>.end()</code> method </p>
<p>and thanks :)</p>
<pre><code>(function($){
$.fn.setReadOnly = function(readonly) {
return this.filter('input:text')
.attr('readOnly',readonly)
.css('opacity', readonly ? 0.5 : 1.0)
.end();
};
})(jQuery);
</code></pre>
| javascript jquery | [3, 5] |
3,139,246 | 3,139,247 | How to use the ajax() function in JQuery? | <p>In my javascript file I have the following:</p>
<pre><code><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$.ajax({
type: 'post',
url: 'script.php',
data: '',
success: function(output) {
alert(output[0])
}
});
</script>
</code></pre>
<p>In my PHP file I have the following:</p>
<pre><code><?php
echo 'dog';
echo 'cat';
?>
</code></pre>
<p>Now I know I'm not passing any data through the ajax function, I just wrote the above to test one thing, that is:</p>
<p>When I alert <code>output[0]</code> I get the letter "d". Instead I want to be able to get "dog" and when I alert <code>output[1]</code> I want to be able to get "cat". How to achieve this?</p>
| javascript jquery | [3, 5] |
953,372 | 953,373 | Display 'Accept digital certificate' prompt using PHP and Javascript | <p>I'm developing a GIS: a web client to see some maps loaded from OGC servers.</p>
<p>The user can switch between use HTTPS connections and HTTP to load the maps, so I want to include some link to provide this funcionallity (because some maps can be loaded from an HTTPS url like this <a href="https://serverurl/ogc/" rel="nofollow">https://serverurl/ogc/</a>... and others can be loaded from a classical HTTP url).</p>
<p><strong>When the user click on the link, it should display 'Digital Certificate' prompt on browser (to allow the user accept or deny the certificate).</strong></p>
<p>Is there any way to display this message to the user using Javascript or PHP?</p>
<p>Thanks in advance!</p>
<p>PS: the URLs are external, so creating an IFRAME like this doesn't work:</p>
<pre><code><IFRAME style="border: 0px;" SRC="https://externalurl/" width="100" height="100" >
</code></pre>
<p>With this error inside it:</p>
<blockquote>
<p>This frame has been blocked because it
contains some unsecure content</p>
</blockquote>
<p>Only Chrome and IE show me that error. Firefox is able to load the prompt what I'm looking for, but only inside the frame.</p>
<p>I really appreciate if someone knows how to load this prompt at the entire webpage.</p>
| php javascript | [2, 3] |
2,890,327 | 2,890,328 | JavaScript compatibility issue in chrome | <p>I am using the javascript code for print that is working fine in IE and Firefox but not working good in Chrome.
Any one have some idea.
My code is below:</p>
<pre><code>$(document).ready(function() {
$("#hrf1").click(function() {
var win = window.open();
self.focus();
win.document.open();
win.document.write("<table id='tbl' width='216' height='180' align='left' style='border: dotted 4px black;'>");
win.document.write(document.getElementById("tbl").innerHTML);
win.document.write('</table>');
win.document.close();
win.print();
win.close();
});
});
</code></pre>
| javascript jquery | [3, 5] |
330,023 | 330,024 | Is it possible to intercept/handle/parse the HTML inside of the body tags before the browser? | <p>I'm wondering if it is at all possible to take whatever is inside of the tags, run it through Javascript and manipulate it before throwing it back for the browser to then parse.</p>
<p>I'm sure it can be done, however it may not be as straightforward as I am suggesting.</p>
<p>For instance, is there a way for the Javascript to take the entire source code of the HTML file and put it into a var as text?</p>
| javascript jquery | [3, 5] |
3,804,205 | 3,804,206 | DropDownList selected value set using jQuery is lost after page postback | <p>DropDownList selected value set using jQuery is lost after page postback. My question is how do I retain the value changed/selected using jQuery after the page postback? Please note that I have disabled my DropDownList on the client before posting back and my forms submitdisabledcontrols property set to true declaratively.</p>
| jquery asp.net | [5, 9] |
1,043,377 | 1,043,378 | Keep a JavaScript variables value after a page refresh? | <p>i am working with one project in which variable is assigned a value i need that value when browser is refreshed.Is there any way get that value? </p>
| javascript jquery | [3, 5] |
3,972,180 | 3,972,181 | embedded javascript that is based on jQuery | <p>I'm building a service that allows people to put a javascript code I gave them to their site.
The javascript code is based on jQuery.</p>
<p>My question is how to do this to be safe and optimized, cause I don't want to break certain users website.</p>
<p>The thing I'm looking for so far( you can update if you think I need to face other problems):</p>
<ol>
<li>what happens when the user already has jquery loaded on their page? should I load my jquery library using different namespace or should I use his jquery library.</li>
<li>in case I can use his jquery library, I think I'll need to check to see if the versions corespond, but again is this safe?</li>
<li>in case I want to use his jquery library, how do I check if he has jquery loaded and if he has the right version</li>
<li>this is related to 3. what happen if he changes his jquery library that doesn't correspond with the library I think it will be, leading to a bad result.</li>
</ol>
<p>Looking for your answers.
Thanks</p>
| javascript jquery | [3, 5] |
3,582,522 | 3,582,523 | Checking radio group either empty/null | <p>I want to check in android that radiogroup is empty or null i.e submitted without clicking on any radio button in that group??</p>
<p><strong>Xml Code</strong></p>
<pre><code><RadioGroup
android:id="@+id/lift"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<RadioButton
android:paddingRight="50dip"
android:textSize="20dp"
android:id="@+id/r91"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/yes" />
<RadioButton
android:paddingRight="50dip"
android:textSize="20dp"
android:id="@+id/r92"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no" />
</RadioGroup>
</code></pre>
<p><strong>Activity Code</strong></p>
<pre><code>RadioGroup radioGroup1 = (RadioGroup) findViewById(R.id.lift);
if(radioGroup1=='NULL')
{
Toast.makeText(getApplOicationContext(),"first radiogroup is null",Toast.LENGTH_LONG).show();
}
</code></pre>
| java android | [1, 4] |
2,246,456 | 2,246,457 | Is it possible to do this using java on android? | <p>How can I include this code snippet within each activity without explicitly copy and pasting the code in each activity? For example can I just place it in one place and all other activities would Reference this piece of code?</p>
<pre><code> @Override
public boolean dispatchTouchEvent(MotionEvent event) {
// do something
return super.dispatchTouchEvent(event);
}
</code></pre>
| java android | [1, 4] |
1,313,203 | 1,313,204 | Getting the width of an html element in percent % with jQuery | <p>If i <code>alert</code> the element which has a css selector set to <code>width:100%</code> I get it's with in <code>px</code>, does exists some way to get it in <code>%</code> as set from css, I need it to fix some script with fluid layouts;</p>
<pre><code>// css
.my-element {
width:100%;
}
// javascript
alert('width: '+$('.my-element').css('width'));
// this alerts "width: 1116px" instead of "width: 100%"
</code></pre>
<p>maybe something like this is always true?</p>
<pre><code>alert($('.my-element').outerWidth() == $('.my-element').parent().outerWidth());
</code></pre>
| javascript jquery | [3, 5] |
5,046,152 | 5,046,153 | how to eliminate space in forms in php | <p>how can i prevent a form to be submitted when it only contains a space? for example a user presses the space bar on a field, the space will be considered as a character so the forms submits. how can i prevent that in php?</p>
| php javascript | [2, 3] |
2,257,139 | 2,257,140 | jQuery hide() works, but show() does not | <p>I'm having trouble getting this script to work.</p>
<pre><code> <asp:DropDownList CssClass="workUnit" Width=80 ID="dropdownWorkUnit" runat="server" Visible="false" _clientId="comboboxWorkUnit" />
</code></pre>
<p>For some reason, the combobox will not become visible when I run this JavaScript.</p>
<pre><code>onPhaseChange: function(dropdown, row) {
var combobox = $(dropdown);
comboboxWorkUnit = row.find("select.workUnit");
comboboxWorkUnit.show();
},
</code></pre>
<p>But when I do this, it works:</p>
<pre><code>onPhaseChange: function(dropdown, row) {
var combobox = $(dropdown);
comboboxWorkUnit = row.find("select.workUnit");
comboboxWorkUnit.hide();
},
</code></pre>
| jquery asp.net | [5, 9] |
845,099 | 845,100 | Shift focus with arrow keys in JavaScript | <p>I want to be able to navigate through all the focusable elements on my webpage with the arrow key. So when the down-key is pressed the focus should shift to the focusable element beneath the current focussed element. You get the idea for the other arrow keys, when there is not a focusable element to shift to, the focus should remain the same.</p>
<p>This is what I got so far:</p>
<pre><code>$(document).keydown(function(e){
if (e.keyCode == 37) { //left
var offset = $("*:focus").offset();
var allElements = $("#container").find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]');
var arr = jQuery.makeArray(allElements);
var topLeft = offset.left
var minus = topLeft;
var currentElement = $("*:focus");
for(var i = 0; i < arr.length; i++)
{
if ( (arr[i].offset().left < offset.left) // This doesn't work for some reason
&& ((offset.left - arr[i].offset().left) < minus))
{
currentElement = arr[i];
minus = offset.left - arr[i].offset().left;
topLeft = arr[i].offset().left;
}
currentElement.focus();
}
alert( "left pressed" );
return false;
}
// Other Keys
</code></pre>
<p>});</p>
<p>the idea was to get all the focus-able elements and than pick select the one that is suited for the arrow and shift focus. </p>
<p>I'm not able to get this code to work (it contains a error) and I'm not completly sure it will even work.</p>
<p>Thnx in advance</p>
<p>[EDIT]: I guess I was a little vague. I do not only want to go left and right, but also up and down.</p>
| javascript jquery | [3, 5] |
5,143,293 | 5,143,294 | JQuery Check All/ Uncheck All not working on ASP.NET | <pre><code>$(document).ready(function() {
$('#chkRFI').click(
function() {
$("INPUT[type='checkbox']").attr('checked', $('#chkRFI').is(':checked'));
}); });
<div class="grid_3">
<div class="box">
<div class="boxheader">
<asp:CheckBox ID="chkRFI" runat="server" Text="RFI" />
</div>
<div class="boxbody">
<asp:CheckBoxList ID="chklstRFI" runat="server" CssClass="boxbodylist">
<asp:ListItem Text="RFI No" Value="RFI" />
<asp:ListItem Text="RFI Date" Value="RFI_Date" />
</asp:CheckBoxList>
</div>
</div>
</div>
</code></pre>
<p>How to solve? Please provide me any ideas...
Thanks</p>
| c# jquery asp.net | [0, 5, 9] |
5,391,375 | 5,391,376 | How to make callback from AsyncTask to fragment Activity? | <p>I have requests to web service implemented using AsyncTask. Normally callback to Activity i do using interface:</p>
<pre><code>public interface AsyncTaskComplete<T> {
public void onTaskComplete(T result);
public void onTaskFailed(T result);
}
</code></pre>
<p>In AsyncTask:</p>
<pre><code>private AsyncTaskComplete<String> callback;
public AsyncTaskAbout(AsyncTaskComplete<String> cb) {
this.callback = cb;
}
protected void onPostExecute(String result) {
if(result == null){
callback.onTaskFailed(result);
}else{
callback.onTaskComplete(result);
}
}
</code></pre>
<p>But if i want to give callback FragmentActivity compiler suggest me to change AsyncTask constructor to:</p>
<pre><code>public AsyncTaskAbout(FragmentActivity faActivity) {
this.callback = (AsyncTaskComplete<String>) faActivity;
}
</code></pre>
<p>Where is warning:</p>
<pre><code>Type safety: Unchecked cast from FragmentActivity to AsyncTaskComplete<String>
</code></pre>
<p>So what i need to change ?</p>
<p>Or how to make callback in this case ?</p>
<p>Thanks.</p>
| java android | [1, 4] |
5,461,647 | 5,461,648 | Switched from singleton to application object, still getting null pointer exceptions | <p>I switched from a singleton to an application object to store application data because as I understood it, there was a much better chance of my cached data surviving in an application object, than in a regular singleton. </p>
<p>I am still having issues however. If I switch to several other apps, and come back to my app, the call to load my event after i've loaded <code>getApplication()</code> is throwing an null pointer exception. </p>
<p>What I find even more bizarre, is that the bundle from my original intent, is still active and has survived the application switching. </p>
<p>How can I keep data, which doesn't necessarily need to be persisted in a permanent way (if the entire application were killed, and reloaded, it would just pull it down from the webservice and start fresh, this is why I thought switching to an application object would be ok )</p>
| java android | [1, 4] |
4,518,871 | 4,518,872 | how dynamically Delete or reset an element from a javascript object | <p>I am trying to delete an object from its parent object without success... When i use 'delete' directly it works, but when i am in a loop over multile objects, i can't get it to work? What am i doing wrong in that $.each loop below:</p>
<pre><code><script>
rc = { oc: { 'Amt': 30, 'mpA': 3000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 },
tb: { 'Amt': 2000, 'mpA': 100000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 },
bl: { 'Amt': 300, 'mpA': 100000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 } }
var carObj = {}
carObj['name'] = 'carObj';
console.log ( ' when created: carObj: ', carObj);
carObj['rc'] = rc;
console.log ( 'when rc Loaded: carObj: ', carObj);
delete carObj['rc'];
console.log ( 'when rc deleted: carObj: ', carObj);
// up till here delete works as expected.
// create two objects
var carObj1 = {}
var carObj2 = {}
// load objects with the 'rc' object
carObj1['name'] = 'carObj1';
carObj1['rc'] = rc;
console.log ( 'when rc Loaded: carObj1: ', carObj1);
carObj2['name'] = 'carObj2';
carObj2['rc'] = rc;
console.log ( 'when rc Loaded: carObj2: ', carObj2);
// !!! Here is where delete doe not work. i don;t get any errors, only rc not deleted from c
$.each([carObj1, carObj2], function (index, c){
console.log('before deleting rc', c);
delete c[rc];
console.log('After deleting rc', c);
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
1,745,702 | 1,745,703 | Are those dangerous idioms/usages in C++ avoidable in C#? | <p>In this Herb Sutter's article '<a href="http://www.gotw.ca/publications/advice97.htm" rel="nofollow">Write What You Know, and Know What You Write</a>', he warns about the dangerous idioms in C++.</p>
<pre><code>T& T::operator=( const T& other )
{
if( this != &other )
{
this->~T();
new (this) T(other);
}
return *this;
}
</code></pre>
<p>Does C# solve this kind of dangerous cases? Is C# a better programming language than C++ in terms of having less dangerous idioms?</p>
| c# c++ | [0, 6] |
3,991,704 | 3,991,705 | Binding a TreeView control | <p>I am using ASP.NET and C# to bind a tree view control in my application. The following code is used in WinForms, but it's not working in WebForms. Can someone help to convert this to WebForms?</p>
<pre><code>private TreeNode AddNode(TreeNode node, string key)
{
if (node.Nodes.ContainsKey(key))
{
return node.Nodes[key];
}
else
{
return node.Nodes.Add(key, key);
}
}
</code></pre>
<p>I want to implement the same logic. In WebForms we do not have method <code>node.nodes</code>, or <code>node.nodes.Containskey()</code>.</p>
| c# asp.net | [0, 9] |
4,479,260 | 4,479,261 | Mappath and FileStream in external class doesn not work correctly on server | <p>This is my code that is written in a class in a sub-folder of a main directory:</p>
<pre><code>string c = global.RandomCode(32) + "." + ext;
using (FileStream fs = new FileStream(HttpContext.Current.Server.MapPath(@"..\adimgs\"+c),FileMode.CreateNew,FileAccess.Write))
{
byte[] a = Convert.FromBase64String(img);
fs.Write(a, 0, a.Length);
}
</code></pre>
<p>this works great in localhost but not in server side. as I use jquery and a page with lots of posted data calls the function in this class I don't see an error to identify the problem.</p>
<p>I wrote a code that saves HttpContext.Current.Server.MapPath(@"..\adimgs\"+c) in the database and the result was as expected. there must be something wrong with filestream (that works in localhost), some access authorization problem may be. Can anyone tell me what is the problem with this code? </p>
| c# asp.net | [0, 9] |
3,096,986 | 3,096,987 | How to access Hidden Field of Parent page from child page | <p>In my ASP.NET main page I have one hidden field and and one button. When the user clicks the button I am showing the pop up (child page). I need to access a Hidden field while the pop up is loading. How could I access the Hidden field using c#?</p>
| c# asp.net | [0, 9] |
3,468,845 | 3,468,846 | Check if checkbox is checked | <p>Why does the following code not work?</p>
<p><strong>Example:</strong> <a href="http://jsfiddle.net/ZZe5X/18/" rel="nofollow">http://jsfiddle.net/ZZe5X/18/</a></p>
<pre><code>$('.submit').submit(function () {
e.preventDefault()
if ($('input[type="checkbox"]').is(':checked')) {
alert('ok')
} else {
alert('no')
}
})
</code></pre>
| javascript jquery | [3, 5] |
4,388,818 | 4,388,819 | Is there anything I can do to optimize the tab loading in javascript? | <p>My colleagues have create a website and there is a webpage which contains a Tab.
He Implement the tab with the following method: </p>
<p>1.Load all content of the page<br>
2.Use javascript to display those group content as block and organize them into tabs.<br>
3.when user click one tab, then acitve it, and hide all other tabs. </p>
<p>And these functions works very well, but the performance is bad:<br>
1.Load all contents cost lots of time<br>
2.It will show all content at first, and then shrink to a tab control. When the user see this, it might think this is a bug of our system. </p>
<p>And These code are ready to deploy, is there any quick fix to handle these problems ?<br>
Thanks in advance !</p>
| javascript asp.net | [3, 9] |
5,042,981 | 5,042,982 | javascript jquery checkbox | <p>I'm working on a piece of JavaScript. I'm completely new to JS, But I have a group of checkboxes part of the domainchkb class and with the name, all with different values. I am trying to group those into an array to format into JSON. When executing the code the debugger stops at <code>return this.parent().text();</code>. What am I doing wrong here? Any help would be appreciated.</p>
<pre><code>function format4Cart(){
var domains;
var values = $('input[name=domainchkb]:checked').map(function(){
return this.parent().text();
}).get();
domains = "{\"type\" : \"single\", \"data\" : [";
$.each(values, function(domainIndex,selected_domain){
domains += "{\"id\" : \""+selected_domain+"\", \"domain\" : \""+whois_response.data.domain+"\"},";
});
$(domains).text().replace(/(\s+)?.$/,"");
domains += "]}";
domains=encodeURIComponent(domains);
ajaxAdd2Cart(domains);
}
</code></pre>
| javascript jquery | [3, 5] |
4,978,710 | 4,978,711 | Can set the div content with jquery | <p>Why can't I put dynamic text on a div called foo? The following is on a metho in the asp.net codebehind.</p>
<pre><code>StringBuilder script = new StringBuilder();
script.Append("<script type='text/javascript'>");
script.Append(" $(document).ready(function () {");
script.Append(" $('<div id=foo></div>').appendTo('body');");
script.Append(" var dlg = $('#foo');");
script.Append(" dlg.dialog({");
script.Append(" autoOpen: true,");
script.Append(" resizable: false,");
script.Append(" draggable: false,");
script.Append(" modal: true,");
script.Append(" title: 'Información',");
script.Append(" width: 400,");
script.Append(" height: 200,");
script.Append(" buttons: {");
script.Append(" 'Cerrar': function () {");
script.Append(" $(this).dialog('close');");
script.Append(" }");
script.Append(" }");
script.Append(" });");
script.Append(" $('#foo').html(<p>"+info+"</p>);");
script.Append(" });");
script.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "launchModalWindow", script.ToString());
</code></pre>
<p>The problem is in this line:</p>
<pre><code>script.Append(" $('#foo').html(<p>"+info+"</p>);");
</code></pre>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
1,875,338 | 1,875,339 | javascript / jquery - map a range of numbers to another range of numbers | <p>In other programming languages such as processing, there is a function which allows you to convert a number that falls within a range of numbers into a number within a different range. What I want to do is convert the mouse's X coordinate into a range between, say, 0 and 15. So the browser's window dimensions, while different for every user, might be, say, 1394px wide, and the current X coordinate might be 563px, and I want to convert that to the range of 0 to 15. </p>
<p>I'm hoping to find a function of jquery and javascript that has this ability built in. I can figure out the math to do this by myself, but I'd rather do this in a more concise and dynamic way.</p>
<p>I'm already capturing the screen dimensions and mouse dimensions with this code:</p>
<pre><code>var $window = $(window);
var $document = $(document);
$document.ready(function() {
var mouseX, mouseY; //capture current mouse coordinates
var screenW, screenH; //capture the current width and height of the window
var maxMove = 10;
windowSize();
$document.mousemove( function(e) {
mouseX = e.pageX;
mouseY = e.pageY;
});
$window.resize(function() {
windowSize();
});
function windowSize(){
screenW = $window.width();
screenH = $window.height();
}
});
</code></pre>
<p>Thanks for any help you can provide.</p>
| javascript jquery | [3, 5] |
3,616,988 | 3,616,989 | Pass uploaded file as a parameter to javascript method | <p>I am passing the uploaded file as a parameter in the JavaScript method. Then Firebug is throwing error like <code>SyntaxError: illegal character</code>.</p>
<pre><code><input type="file" id="fileUpload" name="employerLogoUpload" />
<a id="_fileUploadLink" href="#" onClick="javascript:ajaxFileUpload(" +document.getElementById('fileUpload').value+ ");">Upload</a>
</code></pre>
<p>Please help me out.</p>
| javascript jquery | [3, 5] |
1,987,671 | 1,987,672 | Javascript confirmation or other type of confirmation | <p>Hello I have a c# application that has a button "Submit" and in the code behind i am evaluating some stuff when it is clicked. But now, I have a FileUpload in the same page, the one that comes with the standard "Browse" button which I can not code against (and company rules, can not change it to a regular button).</p>
<p>So the thing is that when the "Submit" button is clicked, I still want to evaluate what I need to evaluate but I also want a Javascript or any other type of confirmation that prompts the user if the image file selected in the upload has the same name as the previous one then it should pop up "This image file already exists, do you want to replace it?.</p>
<p>But now, see how I want to use the back end On_Submit(Object o, EventArgs e) and also be able to ask the question IF anf only IF the image chosen has the same name as the previous one.</p>
<p>Now, I can check this in the same On_Submit button whether the new file name is the same as the old one but how can I do this? from within the On_Submit event? something like</p>
<pre><code>public void On_Submit(Object o, EventArgs e)
{
//using pseudo code
if(oldImagename == newImageName)
pop message to alert if replacement
do other stuff here
else
do other stuff here
}
</code></pre>
<p>Thank you guys</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,081,785 | 5,081,786 | target both android and iphone | <p>I want to develop an application targeting both android and iphone. I guess they use Java and Objective-C. Can I use single language like Python? Is it the best route? Will I lose performance, features, etc. by using Python. Are there any limitations that I will run into?</p>
| iphone android python | [8, 4, 7] |
3,704,389 | 3,704,390 | Is there a Util to convert US State Name to State Code. eg. Arizona to AZ? | <p>I need to convert full state name to its official state address code. For example from the String New York, I need to produce NY. Now I could put this all in a hashmap, but it seems there must be a utility for this? I am in an Android environment. I don't want to import a large library just for this one util however. Thanks</p>
| java android | [1, 4] |
520,380 | 520,381 | How do I get URL query parameters into an object literal? | <p>When looking at location.search, what's the best way to take the query parameters and turn them into an object literal? Say I've got a URL that looks like this:</p>
<blockquote>
<p><a href="http://foo.com?nodeId=2&userId=3&sortOrder=name&sequence=asc" rel="nofollow">http://foo.com?nodeId=2&userId=3&sortOrder=name&sequence=asc</a></p>
</blockquote>
<p>What I'd like to wind up with is an object literal that looks like this:</p>
<pre><code>var params = {
nodeId : 2,
userId : 3,
sortOrder: name,
sequence: asc
}
</code></pre>
<p>So I'd like to do something like this:</p>
<pre><code>var url = location.search;
url = url.replace('?', '');
var queries = url.split('&');
var params = {};
for(var q in queries) {
var param = queries[q].split('=');
params.param[0] = param[1];
</code></pre>
<p>};</p>
<p>But this line:</p>
<pre><code>params.param[0] = param[1]
</code></pre>
<p>generates an error. How do you iterate through those keys if you don't know the key names?</p>
<p>We're using jQuery, and I'm sure there's a plugin to do this, but I'd like to understand how to program this anyway.</p>
| javascript jquery | [3, 5] |
3,397,366 | 3,397,367 | Need to save a high score for an Android game | <p>It's quite simple, all I need to do is save a high score (an integer) for the game. I'm assuming the easiest way to do this would be to store it in a text file but I really have no idea how to go about doing this.</p>
| java android | [1, 4] |
2,131,282 | 2,131,283 | class and interface | <p>I wonder 3 things.</p>
<p>1: If I have implemented an interface (with a method) in a superclass where im declaring that method, and then I extend that superclass in another class. Then I don't have to redeclare that method right?</p>
<p>2: But if I don't declare that method in the superclass but in the child class then I instantiate the superclass. What happens then? It didn't contain any method from the instance.</p>
<p>3: Could you use implement in a class and then not declaring that method? Maybe it will be used as a superclass only for other classes to extend. And then just declare that method in the child classes or do you have to declare it in the current class you are implementing the interface?</p>
| java php | [1, 2] |
432,312 | 432,313 | how to fill navigation bar dynamically using jquery |
<li>Home
</li>
<li>Company
<li>Departments</li>
<li>Users</li>
<li>Departments</li>
<li>Page Info</li>
<li>Agreements</li>
<li>Inquiries</li>
</li>
<p>HOME and Company are the li's under main ul,and Company has Departments,Users etc as child li's
I need to fill this unordered list using jquery(calling stored procedure)
can any1 solve my prob</p>
| jquery asp.net | [5, 9] |
4,634,282 | 4,634,283 | how to pass a php values to javascript? | <p>here is the code??</p>
<p>posting code:</p>
<pre><code>$.post('get.php',{selected:"aaaa"},function(return){alert(return);});
</code></pre>
<p>when i check the values of "selected" value using </p>
<pre><code><?php
$r=$_POST['selected'];
echo $r;
?>
</code></pre>
<p>is displays the value "aaaa" correctly..</p>
<p>this code works fine...</p>
<pre><code><?php
$r=$_POST['selected'];
?>
var answer="<?php echo "welcome" ?>";
</code></pre>
<p>when we echo the value"welcome" it is stored in the variable answer.and i could print that...</p>
<p>but when i put like this....</p>
<pre><code><?php
$r=$_POST['selected'];
?>
var answer="<?php echo $r ?>";
</code></pre>
<p>an empty value is stored in answer... and nothing gets displayed.... </p>
<p>whether specifying $r inside " " is not right... how to specify that......</p>
| php javascript jquery | [2, 3, 5] |
2,586,297 | 2,586,298 | Path Problem in ASP.net | <p>Hi
I am trying to do the following
I am building asp.net website with c# language
I want to read a text file from my project(the file is inside the project)
I tried to get the file Path by this way :</p>
<pre><code>string path=Request.PhysicalApplicationPath+"filename.txt";
</code></pre>
<p>but I can't use The "Request" object from separated C# file ??
note: separated C3 file,I mean it's not related with aspx file
can you help me with my way or do you have another way ??
thx</p>
| c# asp.net | [0, 9] |
48,913 | 48,914 | Updating Android Application | <p>I was wondering if there is a way I can update my Android application which is not listed on the Android Market. I mean, maybe thorough my website? Any ideas? Many Thanks!</p>
| java android | [1, 4] |
3,742,076 | 3,742,077 | perform function after x number of calls with setInterval | <p>In <a href="http://stackoverflow.com/a/2956980/1252748">this article</a>, the following function is given to perform an operation <em>x</em> times with setInterval()</p>
<pre><code>setIntervalX(function () {
animateColor();
//or something
}, 3000, 4);
function setIntervalX(callback, delay, repetitions) {
var x = 0;
var intervalID = window.setInterval(function () {
callback();
if (++x === repetitions) {
window.clearInterval(intervalID);
}
}, delay);
}
</code></pre>
<p>what does the callback() do here? I'm trying to do a function after the specified number of repetitions is complete. but this</p>
<pre><code>setIntervalX(function () {
animateColor();
}, 3000, 4, function(){
completeFunction();
});
</code></pre>
<p>does not work. Perhaps that syntax is very wrong. I was under the impression that using jquery, you could string together functions like that..</p>
<p>Much grateful for any insight. Thanks!</p>
| javascript jquery | [3, 5] |
310,927 | 310,928 | Ajax jquery returns blank page | <p>I have this JavaScript code:</p>
<pre><code>$(document).ready(function(){
$('#sel').change(function(){
$.ajax({
type: "POST",
url: "modules.php?name=TransProject_Management&file=index",
data: "&op=index_stat&stat="+$(this).val(),
cache: false,
success: function(data) {
//alert(data);
$("#ajax_results").html(data);
}
});
});
});
</code></pre>
<p>On status change i need to refresh a div without page reload. But it returns blank page. If i try alert the result on success, i get the response, also i checked with inspect element, its ok. The problem is that it returns blank page.</p>
<p>The file i'm working on, is the same( modules.php?name=TransProject_Management&file=index ) i called in ajax.</p>
<p>the html:</p>
<pre><code><body>
//...
<div id="ajax_results">
//.....
//somewhere here is the select option <select id="sel">......</select>
//.....
</div>
</body>
</code></pre>
<p>Any help, would be very appreciated.</p>
| php jquery | [2, 5] |
622,960 | 622,961 | Why does this simple JQuery code throw an error? | <pre><code><script type="text/javascript">
$(function(){
for(var i=0;i<7; i++){
var guy_html = '<div class="aname"><input type="text" class="chatter_input autofriend" name="guy'+String(i) + '" /></div>';
$("div#guy_boxes").append(guy_html);
}
});
</script>
<div id="guy_boxes"></div>
</code></pre>
<p>I just want 7 input boxes created and put into the div.</p>
<pre><code>Uncaught Syntax error, unrecognized expression: #
</code></pre>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.