Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,782,059 | 3,782,060 |
how to make my application support for all devices resolution
|
<p>I have develop an app which runs very well in my emulator and in my Samsung device. But when I test it in the Motorola emulator, which I have downloaded in my android SDK, it doesn't work. Can anyone help me out to figure this problem of supporting multiple devices?</p>
|
java android
|
[1, 4]
|
5,160,500 | 5,160,501 |
How to keep an animation consistant after page load
|
<p>i have a project that should feel like a super smooth ajax driven page which loads content dynamically but is in reality a normal answer with a page load.</p>
<p>In this project its important to have a sliding effect of the left sidebar. It slides out if the mouse leaves the sidebar and slides in if the mouse enters...</p>
<p>So far everything is good but when it comes to a new pageload after a link was being clicked the sidebar has sometimes a slide-in status and sometimes a slide-out status (depends on what the mouse did after link was clicked)</p>
<p>What i can do is to put the status (visible/invisible) of the sidebar into a session and save it. But that is not smooth enough. Sometimes the sidebar slide effect completed 50% and then the new page loads...so this is not granular enought to look smooth.</p>
<p>What i did then was to get the status of the animation via :step but it just saved the end-state of the animation and not the current state...</p>
<p>Does someone has a trick to keep the animation relatively consistent after page load?</p>
<p>And no: I don't want to use ajax in this case ;-P</p>
<p>Thanks a lot </p>
|
javascript jquery
|
[3, 5]
|
2,702,331 | 2,702,332 |
$_SESSION not available when using jqUploader
|
<p>I am using PHP and jQuery for an uploader. I am having a huge problem though and would like some input as to how best handle these two together.</p>
<p>I am using a PHP session variable that I am using to change the filename after the jquery uploader has finished. The jquery "url" is pointing to a PHP function that handles the actual upload. When I use the jquery uploader to upload an image, the session variable is never available. I'm assuming because the uploader itself is not using a session.</p>
<p>How can I resolve this issue? I need to have that session variable to change the filename.</p>
<p><strong>EDIT: I am using jqUploader</strong></p>
<p>Here is the code</p>
<pre><code>function jqUploadPhoto( ){
$picSize = '50550500';
$picDir = '/photos';
$temp = $_FILES['uploadfile']['name'];
... substr()... convert old name to new name
$file = $_SESSION['name'].$ext; // This is set and can be echoed when this func is used from a browser. Not available in JQ
if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file) == false){ // This dies because the filename isn't available.
echo 'NOTOK';
}
}
</code></pre>
|
php jquery
|
[2, 5]
|
3,273,299 | 3,273,300 |
How to escape quotes inside an inline javascript function
|
<p>My function is running perfectly without using class in appended <code>div</code> but when I try to add a <code>class</code> on the element it is not working.</p>
<pre><code><head>
<script type="text/javascript">
function showt(id){
$('body').append(id)
}
</script>
</head>
<body>
<a href="#" id="hidemain" onmouseover='showt("<div class='sdf'>appended</div>")'>show detail</a>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,393,857 | 1,393,858 |
jQuery - :nth-child() or eq() pattern possible?
|
<p>I need to select 1st, 4th, 7th, 10th, 13th, 16th etc</p>
<p><a href="http://jsfiddle.net/caRxA/" rel="nofollow">http://jsfiddle.net/caRxA/</a></p>
|
javascript jquery
|
[3, 5]
|
1,164,204 | 1,164,205 |
How do I access an input field text with jQuery?
|
<p>I am trying to use the typeWatch plugin for jQuery. I have this javascript:</p>
<pre><code> <script type="text/javascript">
$(document).ready(function() {
var options = {
callback: function() { alert("a-ok! " + $(this).text); },
wait: 333,
highlight: true,
captureLength: 1
}
$("#customer").typeWatch(options);
});
</script>
</code></pre>
<p>And my view's HTML has this:</p>
<pre><code> Method B: <%= Html.TextBox("customer") %>
</code></pre>
<p>With this test, if I type "ABC" in the textbox, I am expecting an alert to popup with "a-ok! ABC". Instead the following shows up...</p>
<pre><code>a-ok! function (F) {
if (typeof F !== "object" && F != null) {
return this.empty().append((this[0] && this[0].ownerDocument ||
document).createTextNode(F));
}
var E = "";
o.each(F || this, function () {o.each(this.childNodes, function () {
if (this.nodeType != 8) {
E += this.nodeType != 1 ? this.nodeValue : o.fn.text([this]);}});});
return E;
}
</code></pre>
<p>I've tried changing the $(this).text to .val, and I've also tried referencing the input field more directly as $("#customer") but they yield similar results. How can I access just the entered text?</p>
|
javascript jquery
|
[3, 5]
|
3,830,947 | 3,830,948 |
data manipulate on tree structure by jQuery
|
<p>Below is tree structure and i want to have second tree structure by jquery.</p>
<pre><code><ul>
<li data-id="1">
<ul>
<li data-id="2">
<ul>
<li data-id="6"></li>
</ul>
</li>
</ul>
</li>
<li data-id="3"></li>
<li data-id="4"></li>
</ul>
</code></pre>
<p>this is destination structure that i want to have so how can i do that ?</p>
<pre><code><ul>
<li data-id="1" data-path="1">
<ul>
<li data-id="2" data-path="1,2">
<ul>
<li data-id="6" data-path="1,2,6"></li>
</ul>
</li>
</ul>
</li>
<li data-id="3" data-path="3"></li>
</ul>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,076,628 | 4,076,629 |
Android app development - Uri.parse - want not open browser
|
<p>I have an Android program. I want to send request to a website, after which I need the server to run a command without going to the browser. </p>
<p>Is this possible? For example, at some point, my code is something like this:</p>
<pre><code>Intent intent1 = new Intent(Intent.ACTION_VIEW,Uri.parse("http://xxxxxxx);
</code></pre>
<p>Which of course opens the browser. How can this be avoided?</p>
|
java android
|
[1, 4]
|
3,326,222 | 3,326,223 |
How to define function parameter with jQuery
|
<p>i have some syntax problem... This is my little script:</p>
<pre><code>$('.basket_details, .advanced_search_panel, .producers_major_panel').hover(function () {
mouse_is_inside = true;
}, function () {
mouse_is_inside = false;
});
$("body").mouseup(function () {
if (mouse_is_inside) {
$('.advanced_search_panel, .producers_major_panel').fadeOut('slow');
$('.basket_details').slideUp('slow');
}
});
</code></pre>
<p>everything's fine but my chrome console screaming that i have syntax errors, and <code>mouse_is_inside</code> is not define, how to correct this mistake?</p>
|
javascript jquery
|
[3, 5]
|
464,392 | 464,393 |
how to set a variable for external javascript file after the js file is defined?
|
<p>I'm using jQuery Mobile Ajax navigation feature, And I need to change a variable that is defined inside external js file, So I <strong>can't</strong> put my definition <strong>before</strong> I load that js file...</p>
<p>So, How to change value of a variable for external javascript file after the js file is defined?</p>
<p>(That external js file includes events)</p>
<hr>
<p><em>So this question is <strong>not</strong> duplicate of <a href="http://stackoverflow.com/q/2357472/942659">that question</a>.</em></p>
<hr>
<h2>Update</h2>
<p>My JS File contains events, something like this: <code>$(document).on('mousemove','#main',function() { /*something*/} );</code></p>
<p>And I need that variable. Is it possible to pass variable to that?</p>
<p>I have tried simply changing that variable <code>i = 5;</code>, but I'm getting undefined error.</p>
<hr>
<h2>Update 2</h2>
<p>The external JS file is something for some pages that are almost same, but a little different, just one or two parameters.</p>
<p>And I simply want to pass the parameters to that JS file. Is it possible? How?</p>
|
javascript jquery
|
[3, 5]
|
4,789,446 | 4,789,447 |
How would you program a form filling helper
|
<p>My work often requires to fill out forms, so I would like to program a "form filling helper". Something that fills out formfields which it recognizes with data from a database. </p>
<p>I thought about a solution with javascript. So my system calls a webpage and devides it into 2 frames. The first gives me the data from the database and the second is the form I want to fill out. Would that be possible? Or how would you do it?</p>
<p>Thanks for any suggestions!</p>
|
php javascript
|
[2, 3]
|
4,480,404 | 4,480,405 |
How to show milliseconds in count down timer javascript
|
<p>I have a javascript code that displays a count down timer from 5 minutes.</p>
<p>This is the code</p>
<pre><code>var mins
var secs;
function cd() {
mins = 1 * m("05"); // change minutes here
secs = 0 + s(":00"); // change seconds here (always add an additional second to your total)
redo();
}
function m(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(0, i));
}
function s(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(i + 1, obj.length));
}
function dis(mins,secs) {
var disp;
if(mins <= 9) {
disp = " 0";
} else {
disp = " ";
}
disp += mins + ":";
if(secs <= 9) {
disp += "0" + secs;
} else {
disp += secs;
}
return(disp);
}
function redo() {
secs--;
if(secs == -1) {
secs = 59;
mins--;
}
var timerStr = dis(mins,secs);
$("#countDownTimer").text(timerStr); // setup additional displays here.
if((mins == 0) && (secs == 0)) {
} else {
cd = setTimeout("redo()",1);
}
}
function init() {
cd();
}
window.onload = init;
</code></pre>
<p>How can i change the script to show milliseconds too</p>
<p>or is there any simple script to show the count down timer including minutes:seconds:milliseconds</p>
|
javascript jquery
|
[3, 5]
|
298,748 | 298,749 |
Check the value of the field in HH:MM format
|
<p>I have a field which should take input in format HH:MM (it can be <code>00:01</code>, <code>01:19</code>, <code>25:00</code>, <code>99:34</code>, <code>123:12</code>) </p>
<p>So before submitting the form I need to check whether the value is in any of the above formats else throw an error message .</p>
<p>The field:</p>
<pre><code><input type="text" value="" name="totalDuration" id="total_duration" class="" />
</code></pre>
<p>Validation code goes here</p>
<pre><code>function validate(){
var totalDuration = $("#total_duration").val();
// Rest of the code which checks value is in given format
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,934,326 | 2,934,327 |
Converting C# function to PHP
|
<p>Is there anyone of you who could help me a bit with this?
I have a small method in C#, that I would like to convert to PHP.
Unfortunately my knowledge of PHP is very limited.
I'm hoping someone could give me some clues of how to do this.
Just to say it, I am not looking for someone to do it for me, just help me get started.</p>
<p>This is the C# method.</p>
<pre><code> private static string decode(string str1, string str2)
{
StringBuilder builder = new StringBuilder(str1);
StringBuilder builder2 = new StringBuilder(str2);
StringBuilder builder3 = new StringBuilder(str1.Length);
int num = 0;
Label_0084:
while (num < builder.Length)
{
int num2 = 0;
while (num2 < p1.Length)
{
if ((num == builder.Length) || (num2 == builder2.Length))
{
goto Label_0084;
}
char ch = builder[num];
char ch2 = builder2[num2];
ch = (char)(ch ^ ch2);
builder3.Append(ch);
num2++;
num++;
}
}
return builder3.ToString();
}
</code></pre>
<p>The two things I'm not at all sure about, and not even sure what to search for, is an equivialent of StringBuilder. Is there an equivialent? Or is it even needed?
And then this part:</p>
<pre><code>char ch = builder[num];
char ch2 = builder2[num2];
ch = (char)(ch ^ ch2);
builder3.Append(ch);
</code></pre>
<p>How would I replicate this in PHP?</p>
<p>Hope someone could help me shed some light over this.
Best regards,
/Rick</p>
|
c# php
|
[0, 2]
|
646,646 | 646,647 |
How to update time using JS client side
|
<p>I want to update the time shown on the records li or divs on a page.
I have put the time of creation of this record in a hidden field with each record.</p>
<p>example:</p>
<pre><code># Hi what are you doing?
5 minute ago. <hidden id='1' value='1345888475'>
# Akon song is good
10 minute ago <hidden id='2' value='1345888855'>
# I love the way you lie
15 minute ago <hidden id='3' value='1345889995'>
</code></pre>
<p>How can I update that time each mint? So after one minute the first div should say 6 minute ago
and second would say 11 minute ago? </p>
<p>Is that possible using JS. I dont want to go php for this. Just using JS.
Time in DB is stored like <code>strtotime(date("Y-m-d H:i:s"))</code></p>
<p>Thank you!</p>
|
php javascript
|
[2, 3]
|
4,840,748 | 4,840,749 |
Why does the browser get stuck in this javascript loop?
|
<p>I can't spot why the browser hangs and gets caught in the first for loop in this function, arguments.length doesn't print a console.log either.</p>
<p>Here is the click function passing the colorpicker's own id then the variable other properties to be changed:</p>
<pre><code>$('#colorSelector3').click(function(){
colorPickDynamic('#colorSelector3','h1','color');
});
</code></pre>
<p>Here is the function where the browser hangs in the first for loop:</p>
<pre><code>function colorPickDynamic(cp){
var i,
j,
x,
tag = [],
colorProperty = [];
for (x=0, i = 1, j = 2; x <= arguments.length; i+=2, j+=2, x++) {
tag[x]=arguments[i];
colorProperty[x]=arguments[j];
console.log(arguments.length);
console.log(colorProperty[x]);
}
$(cp).ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
$(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb) {
for (j = 2; j < arguments.length; j+=1) {
$(tag[0]).css(colorProperty[0], '#' + hex);
}
$(cp + ' div').css('backgroundColor', '#' + hex);
}
});
}
</code></pre>
<p>any help would be amazing! Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,204,270 | 4,204,271 |
Android execute code on variable change
|
<p>I alter a variable on different button clicks, (i.e. inside the onclick listener for multiple buttons) and I have a textview that is suppose to show this variable, but remains outside the listener code.</p>
<p>The textview doesnt update the variable, so I am thinking i possibly need an 'onclick' handler version for variables.</p>
<p>How would I go about doing this?</p>
|
java android
|
[1, 4]
|
4,247,139 | 4,247,140 |
How to detect/stop a user opening a new browser window?
|
<p>This is in context to an ASP.Net application. The application makes use of a specific data which is set for a page. After this data has been set all the operations from this page onwards use the set data. </p>
<p>The problem is that if the user opens another tab with a competing data it overwrites the older data for the same session and for the same user which invalidates the operations on the first tab. </p>
<p>I know the suggested way is to refactor the code to remove such coupling but that is not possible. Here's another thread that discussed this but didn't specify any solutions other than refactoring the code (http://stackoverflow.com/questions/632062/ways-to-detect-ctrl-n-or-when-a-user-opens-a-new-window)</p>
<p>So, how can I detect (and notify the user) or stop the user from opening another tab - through javascript/Jquery?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,312,955 | 4,312,956 |
How to extend list of objects to automatically update property based on position in list
|
<p>Let's say I have a class Car like this: </p>
<pre><code>class car
{
string model;
int position;
}
</code></pre>
<p>Position is a number from 1 to n, which basically reflects position in the list.
if I have two cars in list they will have positions 1 2.
Now, I'd like to reorder those cars in list in the UI and reflect change in the property for later uses.<br>
So I have a table with several rows: </p>
<pre><code>Car1 1
Car2 2
Car3 3
Car4 4
</code></pre>
<p>Now, If I want to reorder items I can drag Car4 and place it at position 2 (right after Car1).<br>
So, my positions will be as follows: </p>
<pre><code>Car1 1
Car4 2
Car2 3
Car3 4
</code></pre>
<p>So, what I want to do is to update one item in the list, and all other items will be automatically updated.</p>
|
c# asp.net
|
[0, 9]
|
4,528,429 | 4,528,430 |
unbound prefix error on animation list
|
<p>I get a unbounded prefix error from this xml file named rm_anim.xml. It is for a background resource for using an AnimationDrawable.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<resources>
<animation-list android:id="ram_anim" android:oneshot="false">
<item android:drawable="@drawable/krnl1" android:duration="150" />
<item android:drawable="@drawable/krnl2" android:duration="150" />
<item android:drawable="@drawable/krnl3" android:duration="150" />
</animation-list>
</resources>
</code></pre>
<p>This is following the tutorial on AnimationDrawable. Any ideas?</p>
|
java android
|
[1, 4]
|
3,387,968 | 3,387,969 |
updating second updatepanel using checkbox in first updatepanel
|
<p>I have two UpdatePanels. One <code>UpdatePanel</code> has a <code>CheckBox</code> and a <code>UserControl</code>. UserControl has some <code>TextBoxes</code>. In other updatepanel, there are few <code>Labels</code>. </p>
<p>I have added javascript function to checkbox to hide/show it. I am using Javascript to avoid partial postbacks to server. </p>
<p>I also want to update the second UpdatePanel when checkbox is checked/unchecked or some data is changes in user control's textboxes. </p>
<p>Can I call javascript function as well as server side function on same checkbox ? I tried adding triggers to second updatepanel but they are not fired. </p>
<pre><code>updatepanel1
checkbox
usercontrol
textbox1
texbox2
updatepanel2
label1 (updated on change of textbox 1)
label2 (updated on change of textbox 1)
</code></pre>
<p>my checkbox markupd looks like this</p>
<pre><code> <asp:CheckBox ID="chkShippingSameAsBilling" runat="server"
Text=" Ship to same address"
AutoPostBack="true" Checked="true"
onclick="return ShowShippingAddress();"
/>
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,269,165 | 5,269,166 |
selectall() property in C# for textbox control
|
<p>I know, there is a property for textbox control in windows form, called selectall().</p>
<p>I am trying to achieve the same in my web app, for a textbox, once it recieves the focus(), i am trying to select all the text in the textbox.</p>
<p>I know, i can write some jquery for this, but, is there any other easier way to achieve this?</p>
<p>Regards,
Ron.</p>
|
c# asp.net
|
[0, 9]
|
930,877 | 930,878 |
jQuery class: append html with a call to a function in the class
|
<p>Greetings fellow stackoverflowers,</p>
<p>I'm working on a jQuery class where I have a function that appends some html code to a container.</p>
<pre><code>this.displayOptions = function(property, container) {
for (var i = 0; i < this[property + 'Count']; i++) {
$(container).append('<a href="#" onclick="' + call_a_function_from_this_class + '; return false"></a>');
}
}
</code></pre>
<p>So far, no problem.
In this same class I have another function</p>
<pre><code>this.setProperty = function(property, index) {
this[property] = index;
this.update();
}
</code></pre>
<p>I want the appended HTML to call this function <code>setProperty</code> function when I click on it.
How can I do this?</p>
<p>For what's it worth, I initialize my class like this</p>
<pre><code> var myVariable = new MyPlugin();
</code></pre>
<p>I know I could do <code><a href="#" onclick="myVariable.setProperty('', '')"></code> but the plugin can't know the variable.</p>
<p>Any help is appreciated!</p>
|
javascript jquery
|
[3, 5]
|
4,100,459 | 4,100,460 |
login page in sql server 2005
|
<p>Am running asp.net applications with c#.I have developed a login page and gave database connection with sql server 2005.Now I want to check the usename and password in my databse.Only if that both matches my page have to redirects to the next page.Can some suggests the code?</p>
|
c# asp.net
|
[0, 9]
|
5,132,978 | 5,132,979 |
Converting some c++ array code to c#
|
<p>I'm having some trouble converting the following code from c++ to c# because of pointers.</p>
<p>Basically I have a </p>
<pre><code>STATE** State;
States = new STATE* [max_states];
for (int i=0; i < max_states; i++) {
States[i] = new STATE(max_symbols);
}
</code></pre>
<p>If this was some double array I would say</p>
<pre><code>STATE[][] States;
States = new STATE[max_states][];
for (int i = 0; i '<' max_states; i++) {
States[i] = new STATE[max_symbols];
}
</code></pre>
<p>But the problem is the c++ code is not working "as" I expected it to.</p>
<pre><code>States[i] = new STATE(max_symbols);
</code></pre>
<p>Has some strange behavior that for example allows</p>
<pre><code>States[cur_state]->set_recur_out(k);
</code></pre>
<p>what exactly am I not seeing? This might be a beginner c++ question. Sorry if I don't make any sense at all =)</p>
|
c# c++
|
[0, 6]
|
2,375,147 | 2,375,148 |
jQuery calendar, doesn't work properly
|
<p>I try to implement jQuery calender at my homepage: This is the way I do it:</p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<script src="jquery-1.7.1.js"></script>
<script src="jquery.ui.core"></script>
<script src="jquery.ui.widget.js"></script>
<script src="jquery.ui.datepicker.js"></script>
<script src="core.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<div class="demo">
<p>Date: <input type="text" id="datepicker"></p>
</div>
</body>
</html>
</code></pre>
<p>In the same folder I have all the javascripts that are required. But when I try to click inside the form, no calendar is showing. Why? Thanks!</p>
|
javascript jquery
|
[3, 5]
|
710,746 | 710,747 |
How to display a page only for the first time in asp.net
|
<p>I am developing an application using Asp.Net.My question is whether there is any solution to display a page only for the first time.i.e when the user logs in for the first time it should ask to change the password but when the user logs in after changing the password it should not display the changepassword page instead it should redirect to another page.I have used session variables to do this but after the session expires its again showing the change password page.Can anyone help me to solve this problem.</p>
|
c# asp.net
|
[0, 9]
|
2,764,000 | 2,764,001 |
What is more efficient: listeners or functions in jquery
|
<p>I have been using Jquery alot lately an was wondering if I should use listeners or functions for my clicks.</p>
<p>Normally I do the following:</p>
<pre><code><head>
<script type="text/javascipt">
function buttonclicked() {
alert("You Clicked it");
}
</script>
</head>
<button onclick="buttonclicked()">Click Me</button>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,568,806 | 2,568,807 |
javascript search and replace prefix zero
|
<p>i have few numbers like </p>
<p>0011,0101,0123,1234,5245,0052,3265,0047,0124</p>
<p>How replace prefix zero only,</p>
<p>like no number should start with zero ,</p>
<p>exactly like </p>
<p>0011 should be 11 ,
0101 should be 101 ,
0123 should be 123</p>
<p>How to do this ?</p>
<p>Is ther any javascript function there ,</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,181,816 | 2,181,817 |
Media Gallery realisation in php
|
<p>need to provide an "add from existing" functionality for uploaded images. What is a basic approach to do that? Thought of displaying a modal window but thought that if there will be a lot of images it will definitely pull back the performance. Had anybody a similar task? Thanks.</p>
|
php jquery
|
[2, 5]
|
749,146 | 749,147 |
How to swap element on screen with JavaScript
|
<p>I have multiple 'li' elements:</p>
<pre><code>$(".my_lis")
</code></pre>
<p>with on the page I want to shuffle them around with JavaScript (I'm using JQuery). How to do that?</p>
|
javascript jquery
|
[3, 5]
|
5,775,524 | 5,775,525 |
Add an attribute on focus
|
<p>What is the best way to add an attribute to an <code><input /></code> on focus using js / jQuery?</p>
<p>Right now, off the top of my head, I would think</p>
<pre><code>$(document).ready(function(){
$('input').focus(function(){
$(this).attr(attributeHere);
});
});
</code></pre>
<p>Is that correct? Does the attribute have to have quotes around it? </p>
<p>Right now, it is just going to be an attribute with no value. Value will be added later.</p>
|
javascript jquery
|
[3, 5]
|
3,073,892 | 3,073,893 |
Caps and Shift key using jquery/javascript
|
<p>I am facing a problem. I have to identify my Caps Lock is on or not?</p>
<p>If my caps lock on then i have to tell user that your caps on. but the problem is if some one press <kbd>shift</kbd> + <kbd>A</kbd> then it should behave normally.i think key events of <kbd>Caps Lock</kbd> on + <kbd>a</kbd> equal to <kbd>Shift</kbd> + <kbd>a</kbd>.</p>
<p>How can i identify only my Caps Lock key on. i have seen some example in stackoevrflow but these are not working fine.</p>
<p>This all should be using javascript or jquery.</p>
|
javascript jquery
|
[3, 5]
|
4,204,720 | 4,204,721 |
fading a paragraph in word by word using jquery?
|
<pre><code> <p class="example">i want to split this paragraph into
words and fade them in one by one</p>
</code></pre>
<p>the jquery/js:</p>
<pre><code>$(document).ready(function() {
var $txt = $(".example")
,$words = $txt.text()
,$splitWords = $words.split(" ");
$txt.hide();
for(i = 0; i < $splitWords.length; i++){
// i want fade in each $splitWords[i]
//$splitWords[i].fadeIn(.... - i tried this doesnt work
}
});
</code></pre>
<p>im trying to split the paragraph into words, and fade them in one by one, thier might be an easier way to do this without splitting the words, please shed some light on this. thanks</p>
|
javascript jquery
|
[3, 5]
|
4,718,384 | 4,718,385 |
scroll page when scroll on div
|
<p>I have a div, when I scroll on div, page should scroll, how can I achieve this?
Div has z-index higher than other page elements, it's on top of all page elements</p>
<p>Using javascript or jQuery, anything?</p>
<p>Edit: DIV is the top most element, other elements have lower z-index. Now top DIV is longer than viewport, so I need to scroll</p>
|
javascript jquery
|
[3, 5]
|
4,194,974 | 4,194,975 |
Removing READONLY attribute from textbox using client side code
|
<p>I have a multiline textbox that by default, is set to ReadOnly. I would like a button on the page to change the control to allow it to be edited. I would like this code to run on the client side because the page renders slowly and I'd like to avoid the post back. </p>
<p>The problem I'm having is the javascript code that I wrote to remove the readonly attribute appears to have no effect. I posted a stripped down example that illustrates the problem for your review. </p>
<pre><code><%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript" language="javascript">
function EnableEditing() {
var e = document.getElementById("<%=TextBox1.ClientID%>");
var result = e.removeAttribute("readonly");
alert(result);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div> </div>
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True" TextMode="MultiLine">test</asp:TextBox>
<input id="Button1" onclick="EnableEditing()" type="button" value="Remove RO" />
</form>
</body>
</html>
</code></pre>
|
asp.net javascript
|
[9, 3]
|
2,947,635 | 2,947,636 |
How to load a javascript file and run a javascript method in java?
|
<p>I'm using <a href="https://github.com/chjj/marked" rel="nofollow">marked</a> on the client side to render markdown code to html.</p>
<p>But now I need to do the same thing on the server side which is Java. In order to get the exact same html code, I have to use marked other than other java markdown libraries.</p>
<p>How can I load the "marked.js" file in java and run the javascript code?</p>
<pre><code>marked.parser(marked.lexer("**hello,world**"));
</code></pre>
|
java javascript
|
[1, 3]
|
4,717,481 | 4,717,482 |
Symbol cannot be resolved
|
<p>Android Java project, minimal code to reproduce the problem:</p>
<p><code>Constants.java</code>:</p>
<pre><code>package alex.restaurantfinder;
public class Constants {
public static final String LOGTAG = "...";
}
</code></pre>
<p><code>ReviewCriteria.java</code>:</p>
<pre><code>package alex.restaurantfinder;
import android.app.Activity;
public class ReviewCriteria extends Activity {
static String s = Constants.LOGTAG; // error
}
</code></pre>
<p>Error message: </p>
<blockquote>
<p>Constants.LOGTAG cannot be resolved. </p>
</blockquote>
<p>Where is my error?</p>
<p><strong>Edit</strong>.
The problem was, when I pressed Ctrl+Shft+O in Eclipse, it added this line:</p>
<pre>
import android.provider.SyncStateContract.Constants;
</pre>
<p>It prevented compiler to work with my own Constants class.</p>
|
java android
|
[1, 4]
|
5,034,187 | 5,034,188 |
Manually resetting jquery stars plugin after ajax form submit
|
<p>I am currently using the <a href="http://www.fyneworks.com/jquery/star-rating/" rel="nofollow">jQuery Stars plugin</a> on my rails application. I am using ajax to submit a form that includes these stars so after a successful submit the page does not reload and the stars do not reset. How can I clear these persistent stars so the form is completely reset and ready for the next submit?</p>
|
javascript jquery
|
[3, 5]
|
2,742,406 | 2,742,407 |
Jump to an anchor link on function complete in jQuery?
|
<p>I have a simple slidetoggle function that opens onclick. What I'd like to do is jump the user down to the bottom of the page following the opened div. Basically, wait for the slidetoggle to complete - then imagine clicking my jump link to pull the viewport down. Here's my code.</p>
<pre><code> $('#clickme').click(function() {
$('#form-area').slideToggle('slow', function() {
// Animation complete
// what can i put here that's like my standard jumpto?
});
});
<a href="#form-bottom" id="clickme">Click here</a>
<div class="main" id="form-area" >
Stuff
</div>
<a name="form-bottom"></a>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,569,524 | 4,569,525 |
Creating dynaimc controls in c# and placing them in html
|
<p>I have an datatable which I would like to use to generate controls i.e.
<strong>textbox, checkbox, dropdown</strong></p>
<p>From the datatable I need to create those controls using c#, can any one help me out in syntax. How do I go ahead and bind these controls in HTML tags?</p>
|
c# asp.net
|
[0, 9]
|
4,694,350 | 4,694,351 |
Trying to create a select option
|
<p>Im not sure if this site is only with asp, but I am trying to create a form in which the child fields are disabled or enabled based on whether you chose one or the other. I was able to do it with a checkbox, but i want it to work with the drop down select value. here is the link and the script below:</p>
<p><a href="http://www.rfdesignstudio.com/newsite/paypal.html" rel="nofollow">http://www.rfdesignstudio.com/newsite/paypal.html</a></p>
<p>Here is the select script:</p>
<pre><code><select name="type" class="input" id="type" onchange="type()">
<option value="General">General</option>
<option value="Walk-a-thon">Walk-a-thon</option>
</select>
</code></pre>
<p>and here is the function script:</p>
<pre><code>function type(){
if (document.getElementById('type').value=='Walk-a-thon') {
document.getElementById('child').disabled = false;
document.getElementById('teacher').disabled = false;
document.getElementById('room').disabled = false;
}
else {
document.getElementById('child').disabled = true;
document.getElementById('teacher').disabled = true;
document.getElementById('room').disabled = true;
document.getElementById('child').value = "";
document.getElementById('teacher').value="";
document.getElementById('room').value="";}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,034,435 | 3,034,436 |
jQuery .live and page refresh issue
|
<p>Why this code fails to prevent a page refresh?</p>
<pre><code>$('a').each(function() {
var me = $(this);
var mytarget = me.attr('href');
var is_link_to_self = mytarget.indexOf("index.php");
if(is_link_to_self !== false) {
me.live('click', function() {
$('#content').load(mytarget);
return false;
});
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,339,339 | 4,339,340 |
javascript ClearTimeout with jquery droppable out
|
<p>I have this code </p>
<pre><code> var expandTimerId=0;
$(".droppable").droppable({
tollerance : 'pointer',
greedy : true ,
hoverClass : 'dropHover',
drop : _onDropItem,
over: _onDragOver,
out: function(event,ui){
clearTimeout ( expandTimerId );
}
});
function _onDragOver(event, ui){
var expandNode = $(this).children(".expandNode");
expandTimerId = setTimeout(function(){
$(expandNode).trigger("click");
}, 2000);
}
</code></pre>
<p>What i wanted to do is, When an object is drag on top of droppable for 2second or a period of time the droppable will expand itself. droppable is a tree with branch.</p>
<p>If i didnt add cleartimeout on out. The branch would expand. But when i add cleartimeout, the branch wouldnt expand even though i didnt move the drag, out.</p>
<p>Did i have any mistakes in the code? or is the out event trigger even though im not moving the object out of droppable?</p>
|
javascript jquery
|
[3, 5]
|
2,083,624 | 2,083,625 |
Encode and Decode in c# asp.net?
|
<p>i am using Encoding and decoding :</p>
<p>For Encoding:</p>
<pre><code>private string EncodeServerName(string ServerName)
{
byte[] NameEncodein = new byte[ServerName.Length];
NameEncodein = System.Text.Encoding.UTF8.GetBytes(ServerName);
string EcodedName = Convert.ToBase64String(NameEncodein);
return EcodedName;
}
</code></pre>
<p>and Decoding:</p>
<pre><code> public string DecoAndGetServerName(string Servername)
{
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder strDecoder = encoder.GetDecoder();
byte[] to_DecodeByte = Convert.FromBase64String(Servername);
int charCount = strDecoder.GetCharCount(to_DecodeByte, 0, to_DecodeByte.Length);
char[] decoded_char = new char[charCount];
strDecoder.GetChars(to_DecodeByte, 0, to_DecodeByte.Length, decoded_char,0);
string Name = new string(decoded_char);
return Name;
}
</code></pre>
<p>I am sending ServerName:<code>DEV-SQL1\SQL2008</code></p>
<p>It is encoded:<code>REVWLVNRTDFcU1FMMjAwOA==</code></p>
<p>Again i want to decode but getting Exception:in line:</p>
<p><code>byte[] to_DecodeByte = Convert.FromBase64String(Servername);</code></p>
<p>Exception IS:</p>
<p>`The input is not a valid Base-64 string as it contains a non-base 64 character, </p>
<p>more than two padding characters, or a non-white space character among the padding characters.`</p>
<p>How to solve this issue.</p>
<p>Please Help Me</p>
|
c# asp.net
|
[0, 9]
|
287,955 | 287,956 |
How to make an image x% bigger in JavaScript (with jQuery)
|
<p>I thought this ought to be a straightforward thing to do, but I don't see a clear way to do it.</p>
<p>I would like to make it so that when a user hovers the mouse over an image, the image becomes 10% bigger and then returns to its original size when the user moves the mouse away.</p>
<p>I think that I will want to use the jQuery <code>hover</code> function, but I don't know what functions to pass into <code>hover</code>.</p>
<pre><code>$('.resizableImage').hover(makeBigger, returnToOriginalSize);
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,443,311 | 1,443,312 |
I want my program to do what android does when on call and close to face.
|
<p>I know that this is similiat to this question
<a href="http://stackoverflow.com/questions/3018716/android-turn-off-screen-when-close-to-face">android: turn off screen when close to face</a>
and many others. But I could't find any working solution. </p>
<p>So I have a program that plays audio. I listen to proximity sensor:</p>
<pre><code>@Override
public void onSensorChanged(SensorEvent event) {
if(event.values[0] == 0.0){
//phone close to face
playAudio();
}else{
//phone away
stopAudio();
}
</code></pre>
<p>I have used this code to disable creen when close to face:</p>
<pre><code>WindowManager.LayoutParams params = getWindow().getAttributes();
params.screenBrightness = 0;
getWindow().setAttributes(params);
</code></pre>
<p>But I don't know how to get it back :)
I tried:</p>
<pre><code>WindowManager.LayoutParams params = getWindow().getAttributes();
params.screenBrightness = 1f; //tried all (1, 100, -1, 0)
getWindow().setAttributes(params);
</code></pre>
<p>And some suggested: </p>
<pre><code>PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
WakeLock wakeLock = pm.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "TAG");
wakeLock.acquire();
</code></pre>
<p>But nothing works. The audio is stopped when I move phone away from face. So activity is not paused.</p>
|
java android
|
[1, 4]
|
3,544,247 | 3,544,248 |
Save an arraylist to cache file and retrieve it
|
<p>I want to create two methods. The one should store and arraylist to the cache and the other should retrieve the arraylist from the cache. The code that I've tried is the following:</p>
<pre><code>public class ByteConverter<T> {
public byte[] write_to_byte_array(ArrayList<T> list,File file){
// write to byte array
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
} catch (FileNotFoundException e1) {
Log.d("file not found", "file not found", e1);
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(baos);
for (T element : list) {
try {
out.writeUTF((String) element);
} catch (IOException e) {
Log.d("Error converting List to byte array", "Error converting List to byte array", e);
}
}
byte[] bytes = baos.toByteArray();
int len1 = 0;
while (len1 < bytes.length) {
try {
fos.write(bytes, 0, len1);
len1++;
} catch (IOException e) {
e.printStackTrace();
}
}
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
return bytes;
}
public String read_to_byte_array(byte[] bytes) throws IOException{
// read from byte array
String element = null;
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
DataInputStream in = new DataInputStream(bais);
while (in.available() > 0) {
element = in.readUTF();
}
return element;
}
}
</code></pre>
<p>However the aforementioned methods doesn't write anything to the file. I don't know why. Can anyone help me? Also I'm taking a ClassCastException at this line: </p>
<pre><code> out.writeUTF((String) element);
</code></pre>
|
java android
|
[1, 4]
|
3,163,980 | 3,163,981 |
clone & live function with context parameter jquery 1.4
|
<p>I have few div HTML elements and i am cloning it with a <code>clone(true)</code> option as i want to copy the events also.</p>
<p>Now the case there are certain click events in my HTML div blocks and while crating events i use context parameter also like</p>
<pre><code>var $block ="<div class='task-create-content' >"+
"<div class='task-create-preview'>"+
"<div class='items'>" +
"<div><input type='text' class='edit wtp'/></div>" +
"<div><input type='text' class='edit wtp'/></div>" +
"</div>"+
"</div>");
$(".wtp", $block).live('click',function() {
alert("hi");
})
</code></pre>
<p>Now , when i clone this block using <code>clone(true)</code>, click event doesn't get fire even if i am assigning context parameter.</p>
|
javascript jquery
|
[3, 5]
|
381,081 | 381,082 |
call a javascript method in another .js file
|
<p>what is the rule around calling functions from one js to another ? I thought that this worked but i am not running into issue (figured it out through firefox) that a function in another js file doesn't seem to be recognized in my first js file.</p>
<p>Is there some rule around ordering or some trick you have to do to get this to work?</p>
|
javascript jquery
|
[3, 5]
|
5,144,998 | 5,144,999 |
delete table row with effect
|
<p>On <a href="http://summer-festivals.cloudfoundry.com/artistSubscription/list" rel="nofollow">this page</a>, if you click the unsubscribe button on the first row (Madonna), the rows beneath slide up reasonably nicely. But if you then delete the new first row (Radiohead), the image on the remaining row (U2) jumps unpleasantly to the left after the row moves into position. The function that's called to perform the table row deletion is:</p>
<pre><code>SF.deleteRow = function(selector) {
$(selector)
.children('td, th')
.animate({ paddingTop: 0, paddingBottom: 0 })
.wrapInner('<div />')
.children()
.slideUp('slow', function() {
$(this).closest('tr').remove();
});
};
</code></pre>
<p>If I remove all the padding in the table cells, this problem disappears, but then I have no padding.....</p>
<p>Is there any way to fix this problem? Alternatively, is there another effect I can apply when deleting a table row that avoids this problem (I don't want the row to just disappear instantly when the Unsubscribe button is clicked).</p>
|
javascript jquery
|
[3, 5]
|
902,725 | 902,726 |
How to set the function to make user click the table header to change sorting order
|
<p>I want to let user click the table header to sort the table, but can just set the ascending order, can not set the descending order in the same table header. following is the function I used, </p>
<pre><code>function sortBy(sKey)
{
document.sortResultsForm.sSortBy.value=sKey;
document.sortResultsForm.submit();
}
function sortDistrictNamedescend($a, $b)
{
if ($a->DistrictName == $b->DistrictName)
{
return 0;
}
return ($a->DistrictName < $b->DistrictName) ? 1 : -1;
}
function sortDistrictNameascend($a, $b)
{
if ($a->DistrictName == $b->DistrictName)
{
return 0;
}
return ($a->DistrictName < $b->DistrictName) ? -1 : 1;
}
if($sSortBy=="District")
{
usort($tempArr, 'sortDistrictNameascend');
}
</code></pre>
|
php javascript
|
[2, 3]
|
4,998,393 | 4,998,394 |
What doen $f mean in jquery scripts?
|
<p>I see the function $f being used in a number of jquery related scripts, but I can't find a description of what this means anywhere.</p>
<p>Example</p>
<pre><code>var iframe = document.getElementById(iframe_id);
this.player = global.$f(iframe);
</code></pre>
<p>Can anyone point me to documentation?</p>
|
javascript jquery
|
[3, 5]
|
1,342,270 | 1,342,271 |
When are ALL the cases when the onSaveInstanceState() method called?
|
<p>All the sources I read have all mentioned couple of cases and concluded with "a few other cases". What are ALL the cases when the onSaveInstanceState method called in a View/Activity? </p>
|
java android
|
[1, 4]
|
3,295,862 | 3,295,863 |
How can I add dashes (custom formatting) inside a string of numbers?
|
<p>I have a site where users enter a numeric code of 10 numbers:</p>
<pre><code>xxxxxxxxxx
</code></pre>
<p>When displaying this value (read from the database), I want it to display in this format:</p>
<pre><code>xxxx-xxxx-xx
</code></pre>
<p>How can I do this with PHP or jQuery?</p>
|
php jquery
|
[2, 5]
|
49,722 | 49,723 |
focus div element
|
<p>Concept: Focus the div when user click the Comment link. There was two link in my php page. one is <code>comment link</code> and another one is <code>readmore link</code>. The two link goes to the same page but i want to <code>focus the div element</code> when click comment link .</p>
|
javascript jquery
|
[3, 5]
|
1,161,305 | 1,161,306 |
using sha1prng in both android and windows giving different sequences
|
<p>I have used sha1prng in both my android program and java program as the pseudo ramdom number generator algorithm. I seeded both of them with the same value. <br><br>
But the sequesnce generated in android is different from the one generated in java. Why is this happening and what is the solution to this problem?</p>
|
java android
|
[1, 4]
|
3,220,519 | 3,220,520 |
showing new window pop up to center
|
function open1() {
window.open('http://www.pageresource.com/jscript/jex5.htm','ddsfa','width=400,height=200');
}
<p>Hello</p>
<p>I want show this popup to center when click on "Hello"</p>
|
php javascript
|
[2, 3]
|
4,711,168 | 4,711,169 |
Trying to port python code to Java but getting different results
|
<p>I'm sure I'm making a rookie mistake with java(this is actually my first program). I am trying to port some working python code I made into java(as a learning/testing exercise to learn a bit of the differences) but I'm getting different results between the two. </p>
<p>My program takes a list of data and generates another list based on it(basically sees if a value can be broken down by a sum). Python correctly gives 2,578 results while Java only gives 12. I tried to find the same commands in java and thought I did but can't seem to figure out why the results differ(the difference between the two I have experienced problems with multi threading and syncing of variables, wasn't sure if Java was doing anything behind the scenes so I had a while loop to keep running until the results stabilize, but it didn't help). Any suggestions would be helpful.</p>
<p>Here's the offending code(java at the top, python and pseudo code commented out in the bottom as reference):</p>
<pre><code> for (int c = 0; c <= max_value; c++){
String temp_result = (s - c * data.get(i) + "," + i);
if( results.contains( temp_result ) ){
String result_to_add = (s + "," + i+1);
if( results.contains( result_to_add ) ){
System.out.println("contains result already");
} else {
results.add(result_to_add);
} print len(T)
#Here's the basic pseudo code(I added a few control variables but here's a high level view):
for i = 1 to k
for z = 0 to sum:
for c = 1 to z / x_i:
if T[z - c * x_i][i - 1] is true:
set T[z][i] to true
*/
</code></pre>
|
java python
|
[1, 7]
|
4,458,186 | 4,458,187 |
Difference between jQuery code structures
|
<p>What is the difference between these jQuery code structures, or is there no difference.
Are they both an alias for <code>$(document).ready(function(){</code> and if so, why the dollar in the first code snippet?</p>
<pre><code>jQuery(function($){
// stuff
});
</code></pre>
<p>AND</p>
<pre><code>$(function() {
// stuff
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,808,302 | 4,808,303 |
Embedding server side javascript frameworks in a Java desktop application?
|
<p>I've read that it's possible to embed Rhino into your Java application. Narwhal is also built on top of it by default and I was directed to <a href="http://narwhaljs.org/" rel="nofollow">http://narwhaljs.org/</a> which actually no longer exists.</p>
<p>I would love to know of anything similar to nodejs,ringojs which can be embedded into my Java desktop application.</p>
|
java javascript
|
[1, 3]
|
5,519,217 | 5,519,218 |
Set each data id and assign it to href
|
<p>I am running the following code as I am trying to get each <code>.fotorama</code> id first and then assign each of them as each <code>.nav</code> link href. </p>
<pre><code>$(".fotorama").each(function(){
id = $(".fotorama", this).data("id");
$(".nav li a").attr("href", '#'+ id);
});
</code></pre>
<p>This is giving me <code>#undefined</code> to each <code>.nav</code> link tho</p>
<p>How should I do to set same href as each <code>.fotorama</code> id?</p>
<p>html, just an example, ids and menu items are dynamically generated on the site*</p>
<pre><code><ul class="nav">
<li><a href=" "></a></li>
<li><a href=" "></a></li>
<li><a href=" "></a></li>
</ul>
<div class="fotorama" id="p1"></div>
<div class="fotorama" id="p2"></div>
<div class="fotorama" id="p2"></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,283,427 | 5,283,428 |
The most optimized way to load a big table through javascript
|
<p>Basically I am looking for loading a 1000 row X 100 column table through javascript most effciently .<a href="http://jsfiddle.net/zAVLV/2/" rel="nofollow">This fiddle</a> uses the DomDocumentFragment to achieve this. It works fast enough in chrome and FireFox but is slow in IE . Can some one spot the reason of being slow in IE ? Also is there a better solution ? The solution can be using jquery.</p>
|
javascript jquery
|
[3, 5]
|
382,885 | 382,886 |
Jquery group by td with same class
|
<p>I have the current table data:</p>
<pre><code><table>
<tr class="Violão">
<td>Violão</td>
<td class="td2 8">8</td>
</tr>
<tr class="Violão">
<td>Violão</td>
<td class="td2 23">23</td>
</tr>
<tr class="Guitarra">
<td>Guitarra</td>
<td class="td2 16">16</td>
</tr>
</table>
</code></pre>
<p>What I want to do is groupby the TDs which are the same, and sum the values on the second td to get the total. With that in mind I´ve put the name of the product to be a class on the TR (don't know if it is needed)</p>
<p>and I've coded the current javascript:</p>
<pre><code>$(".groupWrapper").each(function() {
var total = 0;
$(this).find(".td2").each(function() {
total += parseInt($(this).text());
});
$(this).append($("<td></td>").text('Total: ' + total));
});
</code></pre>
<p>by the way the current java scripr doesn't groupby.</p>
<p>Now i'm lost, I don't know what else I can do, or if there is a pluging that does what I want.</p>
|
javascript jquery
|
[3, 5]
|
1,746,549 | 1,746,550 |
How does this order page work?
|
<p><a href="https://markup-service.com/order/create" rel="nofollow">https://markup-service.com/order/create</a></p>
<p>How does that form work ? The javascript source code is compressed and cant be decompressed at least as far as i know.</p>
<p>I need help building a similar page, and any insight on how to replicate the result we see on that link is a b ig help for me.</p>
<p>What intrigues me the most, is the part where the price gets updated all the time, reading the value from the tag maybe ?</p>
|
javascript jquery
|
[3, 5]
|
4,361,516 | 4,361,517 |
How to handle both Quick Search Box results and recent suggestions for search?
|
<p>I'm trying to implement both <a href="http://d.android.com/guide/topics/search/adding-recent-query-suggestions.html" rel="nofollow">recent suggestions</a> and <a href="http://d.android.com/guide/topics/search/adding-custom-suggestions.html" rel="nofollow">custom suggesions</a> in global search in the same application. They both use the same path in the provider so it doesn't seem like it is possible to return different results for them. For example just recent searches for suggestions and real search results in the Quick Search Box.</p>
<p>Any idea on how to do this?</p>
|
java android
|
[1, 4]
|
3,816,518 | 3,816,519 |
Nothing being added to generic List<string> Add method
|
<p>Code for Property in JobQuote class:</p>
<pre><code> public class JobQuote
{
// Properties
private List<string> _jobfilenames;
public List<string> JobFileNames
{
get
{
if (_jobfilenames != null)
return _jobfilenames;
else
{
_jobfilenames = new List<string>();
return _jobfilenames;
}
}
set { _jobfilenames = value; }
}
</code></pre>
<p>Code for Property in User Control</p>
<pre><code>public JobQuote quote
{
get
{
if (ViewState["Quote"] != null)
return (JobQuote)ViewState["Quote"];
else
{
JobQuote newQuote = new JobQuote();
return newQuote;
}
}
set { ViewState["Quote"] = value; }
}
</code></pre>
<p>Code in try block of UserControl where the string is not being added to the generic list of strings:</p>
<pre><code>try
{
string filename = System.IO.Path.GetFileName(FileUploader.FileName);
quote.JobFileNames.Add(filename);
}
</code></pre>
<p>What am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
5,975,164 | 5,975,165 |
create a custom asp.net control
|
<p>how do i create an asp.net list box with a click event?</p>
|
c# asp.net
|
[0, 9]
|
1,273,187 | 1,273,188 |
Show field if true, hide field if false?
|
<p>Want to have a notification box displayed if amount in fieldA is higher than amount in fieldB.</p>
<p>Currently have some code working but the notification box toggles on and off not depending on the actual amount.</p>
<p>What am I missing?</p>
<p>jquery:</p>
<pre><code>
$(document).ready(function() {
$('#fieldA').change(function(){
if($(this).val()>$('#fieldb').val()){
//display it on the form
$('.labelNotification').toggle();
$('.labelNotification').append('Not recommended to have <em>FieldA</em> figure higher than <em>FieldB.</em>');
}
})
});
</code></pre>
<p>HTML:</p>
<p><code>< p style="display: none;" class="error labelNotification"></code></p>
|
javascript jquery
|
[3, 5]
|
3,198,522 | 3,198,523 |
Parsing JSON key with colon in it
|
<p>Consider this JSON string:</p>
<pre><code>{
"title": "value1",
"link": "value2",
"media:info": "value3"
}
</code></pre>
<p>I know how to parse title and link, but the parser isn't accepting media info because of the colon in the middle I think. Does anyone have any ideas?</p>
|
java android
|
[1, 4]
|
5,585,976 | 5,585,977 |
jQuery click(function() not working but plain Javascript working just fine
|
<p>THIS IS THE FULL SCRIPT</p>
<p><a href="http://goo.gl/HoCxk" rel="nofollow">http://goo.gl/HoCxk</a></p>
<p>I have a problem with this function:</p>
<pre><code> $('.message').click(function(){
alert("it works");
var clicked_msg=$(this);
$('#current_message').html(clicked_msg.attr("id"));
});
</code></pre>
<p>If instead of the above I add an onclick="msgClicked()", and then do something like this:</p>
<pre><code>function msgClicked(){
var x=document.getElementById("current_message");alert("it works");x.innerHTML("test");}
</code></pre>
<p>The jQuery library is obviously imported as literally everything else is done using the jQuery framework and all the other functions implemented on the messaging system are jQuery. Everything works perfect there but for some reason I can't figure out what is wrong with this one.</p>
<p>If any of you are willing to help out and you need to see what is actually going on, please let me know and I will create an account for you on my website. Removing all the protection from the content would take a looong long time.</p>
|
javascript jquery
|
[3, 5]
|
455,519 | 455,520 |
Javascript in browser bar vs in content script - 'die' doesn't work
|
<p>I'm trying to run a javascript command in a content script using Personalized-Web (a Chrome extension). I'm new to javascript & jquery, but I've found that entering this code:</p>
<pre><code>javascript:jQuery("div.photo-container").die();
</code></pre>
<p>into my browser bar on a particular page achieves the desired result: it undoes a <code>.live</code> call performed in one of the page's javascripts.</p>
<p>However, if I include that same code or <code>$("div.photo-container").die();</code> in a content script, it does not work. I've also attempted including this script tag in the page context:</p>
<pre><code><script type="text/javascript">
$("div.photo-container").die();
</script>
</code></pre>
<p>and chrome claims that <code>$</code> or <code>jQuery</code> are not defined. However, the page's own javascripts don't <code>include</code> or refer to the jQuery source at any point, as far as I can tell.</p>
<p>So, what's the difference between the browser bar, the content script, and the in-page <code><script></code> tag? How can I use one of the 'automatic' methods (i.e., not paste it into the browser bar)?</p>
|
javascript jquery
|
[3, 5]
|
2,195,017 | 2,195,018 |
jQuery set initial speed of fadein
|
<p>I want this div to load instantly on page load (or thereabouts) and then automatically refresh every 10 seconds.
This is what I have, which refreshes every 10 seconds but doesn’t load instantly.</p>
<p>Can I set the initial refresh to say 100ms and then after that refresh every 10 seconds?</p>
<pre><code><script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#now-playing').load('now-playing-info.php').fadeIn("fast");
}
, 10000); // refresh every 10000 milliseconds
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
977,126 | 977,127 |
Remove Attributes onmouseover and onmouseout
|
<p>I am trying to make use of JQuery's remove attribute like this:</p>
<pre><code>$('#rom-img_1').removeAttr('mouseover');
$('#rom-img_2').removeAttr('mouseout');
</code></pre>
<p>However, it does not remove the effects of the events as the events are still triggered on mouseover and on mouseout. I have tried adding "on" before the events names too but JQuery doesn't use it like that.</p>
<p>Why isn't this working and how can I remove those attributes.</p>
<p>This is a bit of the HTML:</p>
<pre><code><div onmouseout="$('#heart_401').css({'display':'none'});" onmouseover="$('#heart_401').css({'display':'block'});" id="row-img_11"></div>
</code></pre>
<p>Thanks all for any help</p>
|
javascript jquery
|
[3, 5]
|
2,710,112 | 2,710,113 |
How does Omegle work?
|
<p>Sorry for the vague question, but Omegle has exactly what I want for my site. It's the bare chat system. You send and receive messages instantly. I've spent today looking for a shoutbox method, but all I could find were people saying to use MySQL and javascript intervals to keep checking. Omegle updates instantly with new messages though. How does it all work?</p>
|
php javascript
|
[2, 3]
|
875,484 | 875,485 |
How to restart an AsyncTask or avoid if RUNNING
|
<p>I am Developing an App that parses data from HTML. One of the data that is parsed is an integer that increases over time and rather than constantly requesting the data I would like to have a task that intervals the integer. Due to the fact that I need the value updated into a TextView I decided to go with an AsyncTask rather than a Timer.</p>
<p>My issue is I want to be able to restart my task once I know that it has finished, or if it is currently RUNNING simply avoid manipulating it.</p>
<p>Here is my AsyncTask:</p>
<pre><code>class TurnsUpdate extends AsyncTask<Void, Integer, Exception>
{
protected void onPreExecute()
{
turns = Integer.parseInt(DATABASE.getValue("turns").replaceAll(" T", ""));
}
protected Exception doInBackground(Void...voids)
{
while (turns < maxTurns)
{
try
{
Thread.sleep(sleep);
}
catch (InterruptedException e)
{
return e;
}
turns++;
publishProgress(turns);
}
return null;
}
protected void onProgressUpdate(Integer... turns)
{
infoTurns.setText(Integer.toString(turns[0]) + " T");
}
protected void onPostExecute(Exception e)
{
vibrator.vibrate(500);
}
}
</code></pre>
<p>My attempt to start or avoid:</p>
<pre><code> if ((HOME.updateTurns == null || HOME.updateTurns.getStatus() == AsyncTask.Status.FINISHED) && HOME.updateTurns.getStatus() != AsyncTask.Status.RUNNING)
{
HOME.updateTurns = (UpdateTurns) new UpdateTurns();
HOME.updateTurns.execute();
}
</code></pre>
<p>Am I going about this correctly?</p>
|
java android
|
[1, 4]
|
1,272,711 | 1,272,712 |
Recording video from camera Java Android
|
<p>I require the abilty to record MP4 video at High (720 x 480) or Low (360 x 240) on the devices running Android 2.2 (or above) or Android 3.0 and above.Currently I can record on all devices but the resolution varries on each device and I can not figure out how to force each device to record at the resolutions stated above. Give me an example of code please. </p>
|
java android
|
[1, 4]
|
369,028 | 369,029 |
Polymorphic function as event callback
|
<p>I need to pass this function as a callback to DOM event</p>
<pre><code>var fooo = function() {
$(this).append("foo");
fooo = function() {
$(this).append("bar");
};
};
$("#hover").hover(fooo);
</code></pre>
<p>This example should append "foo" and then "bar"s, however it doesn't work. What am I doing wrong?</p>
<p><a href="http://jsfiddle.net/tNBx9/" rel="nofollow">JSFiddle</a></p>
|
javascript jquery
|
[3, 5]
|
361,985 | 361,986 |
Best way to package a class for use in another app?
|
<p>I've written an Android app wich various abstract classes that perform useful functions. These functions could be leveraged in other apps.</p>
<p>I want to share a class module with another programmer, but I don't want to share the source code. I would like to share a .class file but I'm not sure how to do the following:</p>
<ul>
<li>Compile an Android .java file into .class</li>
<li>What does the receiver of the .class file have to do to use that .class in their project? (using Eclipse environment)</li>
</ul>
<p>Thank you very much</p>
|
java android
|
[1, 4]
|
1,746,522 | 1,746,523 |
android how to create event with google account you want?
|
<p>i want to create a calendar event in my application, here is the code</p>
<pre><code>public class GoogleCalendarsActivity extends Activity {
/** Called when the activity is first created. */
private static final String ACCOUNT_NAME = "[email protected]";
private static final String INT_NAME_PREFIX = "priv";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Calendar calendar = new GregorianCalendar(2012, 6, 19);
addCalendar(calendar, this.getContentResolver());
}
private static Uri buildCalUri() {
return CalendarContract.Events.CONTENT_URI
.buildUpon()
.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,
"true")
.appendQueryParameter(Calendars.ACCOUNT_NAME, ACCOUNT_NAME)
.appendQueryParameter(Calendars.OWNER_ACCOUNT, ACCOUNT_NAME)
.appendQueryParameter(Calendars.ACCOUNT_TYPE,"com.google").build();
}
private static ContentValues buildContentValues(Calendar calendar) {
final ContentValues cv = new ContentValues();
cv.put("calendar_id", 1);
cv.put(Events.TITLE, "testing");
cv.put(Events.DTSTART, System.currentTimeMillis());
cv.put(Events.DTEND, System.currentTimeMillis());
cv.put(Events.EVENT_TIMEZONE, "Asia/Taipei");
return cv;
}
public static void addCalendar(Calendar calendar, ContentResolver cr) {
if (calendar == null)
throw new IllegalArgumentException();
final ContentValues cv = buildContentValues(calendar);
Uri calUri = buildCalUri();
cr.insert(calUri, cv);
}
}
</code></pre>
<p>this will work find if [email protected] is 1st add account in my phone, now i got add second account [email protected] and i change ACCOUNT_NAME to [email protected] and try to created event, the event still show that this event is created by xxx, and will not appear in yyy calendar.</p>
<p>i also try change </p>
<pre><code>CalendarContract.Events.CONTENT_UR
</code></pre>
<p>to </p>
<pre><code>CalendarContract.Calendars.CONTENT_UR
</code></pre>
<p>and will get error, is that got anyway can create event with account i want?</p>
|
java android
|
[1, 4]
|
4,749,860 | 4,749,861 |
How can I get date and time formats based on Culture Info?
|
<p>What I want is..
If culture is en-US then</p>
<pre><code>string dateFormat="MM/dd/yyyy";
string timeFormat="24.00 hrs";
</code></pre>
<p>If culture is en-GB then</p>
<pre><code>string dateFormat="dd/mmyyyy";
string timeFormat="24.00 hrs";
</code></pre>
<p>and so on for other countries..</p>
<p>Now how do I get these date and time format values ? What are the standards? Like which all countries use similar date/time formats and which ones don't ?</p>
<p><strong>ok I tried this :-</strong></p>
<pre><code> DateTime myDate = new DateTime();
string us = myDate.ToString(new CultureInfo("en-US"));
</code></pre>
<p>string us gets value =1/1/0001 12:00:00 AM</p>
<p>Now how do I extract "dd/mm/yyyy" and "24.00 hrs" out of this...in my Dateformat column in my Table... I want to store STRINGS such as dd/mm/yyyy or mm/dd/yyyy NOT dates..In my TimeFormat column in the table, the values to be stores are STRINGS too, like I need to store either "24:00hrs" or "12:00hrs"</p>
<p>How do I do this now ?</p>
<p>**using ShorTimePattern returns these values as </p>
<pre><code>h:mm tt and HH:mm
</code></pre>
<p>If I want to store the values in my DB exactly as "24:00hrs" and "12:00hrs", how do I use these values..h:mm tt and HH:mm
which one is for 24 hr format and which for 12 hr format ?**</p>
<p><strong>ok now there's another problem too...I want the information about Decimal Separator and Thousand Separator too based on the CultureInfo...whats the property for that ?</strong> </p>
|
c# asp.net
|
[0, 9]
|
3,356,672 | 3,356,673 |
reference asp server controls from client side
|
<p>this question might sound silly to some but i just had to make sure.</p>
<p>iv'e got a control which is not visible (visible = false)
i want it to become visible under certain conditions for instance onmoueover of a certain textbox ,</p>
<p>can i perform client side events such as this on server controls ?</p>
<p>iv'e noticed that i can't even give the onmouseover event if the control is set to run at server.</p>
<p>to summarize , is there a way the make a server control visible from the client side with out
having to post back to the server . </p>
<p>thanks for the answer from before but i came across a new problem :</p>
<p>my control is a calendar which is placed inside a content page ,</p>
<p>when i click on a textbox i want it to appear but when it is set to Visible=false
the client side script isn't able to locate it :</p>
<pre><code> function Show_Calander() {
debugger;
var c = document.getElementById('<%= calander1.ClientID %>');
c.visible = true;
}
<input type="text" id="txt_date" runat="server" onclick="Show_Calander();"/>
<asp:Calendar ID="calander1" runat="server" Visible="False"></asp:Calendar>
</code></pre>
<p>i can do this form the server side but i just want to increase performance by not going to the server for every little thing.</p>
<p>any ideas how i could make this happen ? </p>
|
javascript asp.net
|
[3, 9]
|
5,923,147 | 5,923,148 |
'Object doesn't support this property or method' IE8 throwing jquery error
|
<p>I get this error on the page when I load my website on IE8,</p>
<p>Message: Object doesn't support this property or method
Line: 1025
Char: 5
Code: 0
URI: <a href="http://www.domain-name.com/../default/js/jquery.wt-rotator.js" rel="nofollow">http://www.domain-name.com/../default/js/jquery.wt-rotator.js</a></p>
<p>i.e this particular line of code</p>
<pre><code> $innerText.width(textWidth).html($p.html());
</code></pre>
<p>this is the complete block of code </p>
<pre><code>var initTextData = function($item, padding)
{
var $p = $item.find(">div:hidden"); var textWidth = getPosNumber(parseInt($p.css("width")) - padding, 300);
var textHeight = getPosNumber(parseInt($p.css("height")) - padding, 0); $innerText.width(textWidth).html($p.html());
if (textHeight < $innerText.height())
{ textHeight = $innerText.height();
}
$item.data("textbox", {x:$p.css("left"), y:$p.css("top"), w:textWidth + padding, h:textHeight + padding, color:$p.css("color"), bgcolor:$p.css("background-color")});
}
</code></pre>
<p>Jquery image rotator is not displayed or loaded in IE8, opera whereas in firefox it loads and works perfect.</p>
|
javascript jquery
|
[3, 5]
|
325,147 | 325,148 |
Android unzip not a directory issue
|
<p>I am trying to unzip a zip file which is stored in the raw folder. Code is as follows</p>
<pre><code>try
{
File myDir = new File(getFilesDir().getAbsolutePath());
File newFile = new File(myDir + "/imageFolder");
if(!newFile.exists())
{
newFile.mkdir();
}
ZipInputStream zipIs = new ZipInputStream(con
.getResources().openRawResource(R.raw.images));
ZipEntry ze = null;
while ((ze = zipIs.getNextEntry()) != null)
{
Log.v("Name", ze.getName());
Log.v("Size", "" + ze.getSize());
if(ze.getSize() >0)
{
FileOutputStream fout = new FileOutputStream(newFile
+ "/" + ze.getName());
byte[] buffer = new byte[1024];
int length = 0;
while ((length = zipIs.read(buffer)) > 0)
{
fout.write(buffer, 0, length);
}
zipIs.closeEntry();
fout.close();
}
}
zipIs.close();
} catch (Exception e)
{
e.printStackTrace();
}
</code></pre>
<p>But I keep getting this error</p>
<blockquote>
<p>01-18 11:24:28.301: W/System.err(2285): java.io.FileNotFoundException:
/data/data/com.example.ziptests/files/imageFolder/TestImages/background.png
(Not a directory)</p>
</blockquote>
<p>I have absolutely no idea why it is causing this, it finds the files, but when it comes to writing them out, it brings up that error. Originally I found a problem that was caused by having the zip file zipped up on the mac, so I zipped up the file on my windows machine instead, that got rid of one problem (when you zip on a mac, it adds these extra folders and files such s store.ds which causes an error when trying to unzip), but this not a directory error keeps coming up. </p>
<p>Any ideas why this is happening? </p>
|
java android
|
[1, 4]
|
3,838,649 | 3,838,650 |
How to launch email intent with an attached image
|
<p>I am trying to launch an email intent with an attached jpg.</p>
<p>I did:</p>
<pre><code>Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "[email protected]", null));
startActivity(intent4);
</code></pre>
<p>this launches the email activity.</p>
<p>But when I try to add DataAndType (my jpeg attachment). It fails with
android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.SENDTO data=file:///data/data/com.mycompany.mypackage/files/temp-picture type=JPEG </p>
<pre><code>Intent intent4 = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", "[email protected]", null));
intent4.setDataAndType(Uri.parse("file://"+ mTempFilePath),
Bitmap.CompressFormat.JPEG.name());
startActivity(intent4);
</code></pre>
|
java android
|
[1, 4]
|
3,170,410 | 3,170,411 |
jquery OnHoverOver and OnHoverOut
|
<p>I have an asp.net animation extendeer like this:</p>
<pre><code>aspext:AnimationExtender ID="extender" TargetControlID="Panel1" runat="server">
Animations>
OnLoad>StyleAction Attribute="backgroundColor" Value="red" />/OnLoad>
OnClick>StyleAction Attribute="backgroundColor" Value="blue" />/OnClick>
OnMouseOver>StyleAction Attribute="backgroundColor" Value="pink" />/OnMouseOver>
OnMouseOut>StyleAction Attribute="backgroundColor" Value="yellow" />/OnMouseOut>
OnHoverOver>StyleAction Attribute="color" Value="orange" />/OnHoverOver>
OnHoverOut>StyleAction Attribute="color" Value="purple" />/OnHoverOut>
/Animations>
/aspext:AnimationExtender>
</code></pre>
<p>I want to perform OnHoverOver and OnHoverOut using jquery. what are the events for these. I tried hover but it is not working. Basically I am calling jquery triggerevent and I need to pass event name. I am not sure what will be events names for these two. I tried others like click etc and they worked.</p>
|
jquery asp.net
|
[5, 9]
|
2,869,925 | 2,869,926 |
Find text between two characters and for each, do something
|
<p>I have a file full with text in the following format:
(ignoring the fact that it is CSS) I need to get the string between the two | characters and each time, do something:</p>
<pre><code><div id="unused">
|#main|
#header|
.bananas|
#nav|
etc
</div>
</code></pre>
<p>The code I have is this:</p>
<pre><code>var test_str = $('#unused').text();
var start_pos = test_str.indexOf('|') + 1;
var end_pos = test_str.indexOf('|',start_pos);
var text_to_get = test_str.substring(start_pos,end_pos);
//I want to do something with each string here
</code></pre>
<p>This just gets the first string. How can I add logic in there to do something for each string? </p>
|
javascript jquery
|
[3, 5]
|
2,925,737 | 2,925,738 |
jquery: how to ignore immediate children() and go deeper until match specified element?
|
<pre><code>$(this).parent().parent()
.children(this.attr("tagName").toLowerCase())
.css("background-color", "yellow");
</code></pre>
<p>xpath: </p>
<pre><code>/html/body/div/table/tr/td/b/a
</code></pre>
<p><code>$(this).tagName</code> is Anchor <code><a></code></p>
<p>the problem with this is that children() looks at the immediate children of <code>$(this).parent().parent()</code>. Hence it will highlight <code><b></code> instead of <code><a></code></p>
<p>i need a way to ignore this immediate children restriction, and select <code><a></code> not `</p>
|
javascript jquery
|
[3, 5]
|
5,761,544 | 5,761,545 |
Preview Image without Upload to my server
|
<p>Hello how i can preview Image without upload to my server in asp.net C# and when i see the image i should press upload to upload to server.</p>
|
javascript asp.net
|
[3, 9]
|
4,966,251 | 4,966,252 |
How do I make a div slide up and disappear in JQuery?
|
<p>And just...poop, HTML gone. How do I do that? thanks.</p>
<p>I know about .hide() , but..I want permanently gone (for that one page), and slide up.</p>
|
javascript jquery
|
[3, 5]
|
1,453,117 | 1,453,118 |
jquery.grep unexpected behavior
|
<p>I've run into an interesting discovery using jquery.grep and was wondering if anyone knows why this is happening. In my code, I am using grep to filter out certain items from an array and then assign the results back to the original array for more filtering. </p>
<p>E.g. </p>
<pre><code>orderedGroups = jquery.grep(orderedGroups, function{}` ...)
</code></pre>
<p>The desired outcome is that items who's parent id is the id of another item in the array are filtered out -- leaving only the unmatched (parent) items.</p>
<p>What I've discovered is that this actually creates a separate object by the same name. In other words, doing a <code>console.log(orderedGroups[1])</code>, displays a value not displayed in <code>console.log(orderedGroups)</code></p>
<p>Here is my code:</p>
<pre><code>var a = ['a', '1', '0']; // represents [name, id, parent id]
var b = ['b', '2', '1'];
var c = ['c', '3', '0'];
var d = ['d', '4', '2'];
var e = ['e', '5', '0'];
var f = ['f', '6', '2'];
var groups = [a, b, c, d, e, f];
var orderedGroups = groups;
for (var i = 0; i < groups.length; i++) {
for (var sg = 0; sg < groups.length; sg++) {
if (groups[i][1] == groups[sg][2]) {
orderedGroups = jQuery.grep(orderedGroups, function(value) {
return value != groups[sg];
});
}
}
}
console.log(orderedGroups)
console.log(orderedGroups[1])
</code></pre>
<p>Has anyone seen this before, and if so can you explain why this is happening?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,605,251 | 4,605,252 |
How to manage phone settings like text to speech settings with your code
|
<p>i am developing a Text-to-Speech application. in my application i have settings which allows user to select language, manage the volume and speech rate..
i was able to manage the volume by using the <code>AudioManager</code>..
now my only problem is the language and speech rate, i dont have any idea how to manage them using my application..</p>
<p>can someone give me an example code of this??</p>
|
java android
|
[1, 4]
|
1,000,895 | 1,000,896 |
TrackballGestureDetector instantiation
|
<p>I am developing some location-based apps on android and using google maps, currently struggling for how can I obtain an object instance for the TrackballGestureDetector class which is part of the google maps API?</p>
<p>Appreciating any help in that regard;
Hass.</p>
|
java android
|
[1, 4]
|
5,685,673 | 5,685,674 |
javascript if else statement
|
<p>i'm trying to make images on my site a bigger size if you click on them. <br/>i want to undo the enlarged view if you click on the picture again.</p>
<pre><code>$("img").click(function(){
var grown = 'false';
if (grown == 'true') {
$(this).animate({width: 300, height: 200}, 1000 );
var grown = 'false';
console.log(grown);
}
else if (grown == 'false') {
$(this).animate({width: 600, height: 400}, 1000 );
var grown = 'true';
console.log(grown);
}
});
</code></pre>
<p>enlarging works, but the <code>grown</code> variable seems to always be stuck on <code>true</code>, so it won't ever shrink back.
is my logic flawed? any help greatly appreciated!</p>
|
javascript jquery
|
[3, 5]
|
4,381,880 | 4,381,881 |
what is the difference between the below two syntaxes?
|
<p>1.</p>
<pre><code> $(function () {
function foo() { return true; }
log(bar()); // getting error
var bar = function() { return true; };
});
</code></pre>
<p>2.</p>
<pre><code>$(function () {
function foo() { return true; }
log(bar()); // working
function bar() { return true; };
});
</code></pre>
<p>in above snippets <strong>log</strong> is my custom function to log the result.</p>
|
javascript jquery
|
[3, 5]
|
1,820,995 | 1,820,996 |
Android open specific folder with gallery
|
<p>I've tried to open android 4.1 gallery with following code:</p>
<pre><code>String folderPath = Environment.getExternalStorageDirectory().toString() + "/" + GalleryHelper.FOLDER_NAME;
// Uri targetUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI.buildUpon().appendQueryParameter("bucketId", GalleryHelper.BUCKET_ID).build();
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setData(Uri.fromFile(new File(folderPath)));
intent.setClassName("com.android.gallery3d", "com.android.gallery3d.app.Gallery");
startActivity(intent);
</code></pre>
<p>Gallery opened, but it shows only default page, not folder. How can I change my code to open the folder?</p>
|
java android
|
[1, 4]
|
3,981,023 | 3,981,024 |
Why is the label not changing color using RegisterClientScriptBlock?
|
<p>I have an aspx page defined as follows:</p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" language='javascript'>
function changecolor() {
var lbl = document.getElementById('lblDisplayDate');
lbl.style.color = 'red';
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblDisplayDate" runat="server"
Text="Label"></asp:Label><br />
<asp:Button ID="btnPostBack2" runat="server"
Text="Register Client Block Script"
onclick="btnPostBack2_Click" />
</div>
</form>
</code></pre>
<p>
</p>
<p>Here is the btnPostBack2 Click event:</p>
<pre><code>protected void btnPostBack2_Click(object sender, EventArgs e)
{
if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(),
"JSScriptBlock",
"changecolor();",
true);
}
}
</code></pre>
<p>Even though, I put the script in a function to change the color, it is still not doing it and why do I need to add the script tags to true if the function is already enclosed in script tags?</p>
<p>lblDisplayDate is in the Page Load where it is set to the current time on every page reload.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
4,008,758 | 4,008,759 |
How do I grab several elements and wrap them in a div using jquery?
|
<p>I am familiar with <code>wrap()</code> and <code>innerWrap()</code>, which grabs every div and individually wraps each instance of the div in a <code>wrap()</code> parameters. IE:</p>
<pre><code><div class="wrap me"></div>
<div class="wrap me"></div>
<div class="wrap me"></div>
</code></pre>
<p>Becomes</p>
<pre><code><div class="wrapped"><div class="wrap me"></div></div>
<div class="wrapped"><div class="wrap me"></div></div>
<div class="wrapped"><div class="wrap me"></div></div>
</code></pre>
<p>I want it to be </p>
<pre><code><div class="wrapped">
<div class="wrap me"></div>
<div class="wrap me"></div>
<div class="wrap me"></div>
</div>
</code></pre>
<p>How do I do that?</p>
|
javascript jquery
|
[3, 5]
|
529,499 | 529,500 |
what are the advantages of C# over Python
|
<p>I like Python mostly for the great portability and the ease of coding, but I was wondering, what are some of the advantages that C# has over Python?</p>
<p>The reason I ask is that one of my friends runs a private server for an online game (UO), and he offered to make me a dev if I wanted, but the software for the server is all written in C#. I'd love to do this, but I don't really have time to do multiple languages, and I was just after a few more reasons to justify taking C# over Python to myself.</p>
<p>I'm doing this all self-taught as a hobby, btw</p>
|
c# python
|
[0, 7]
|
1,734,812 | 1,734,813 |
object Key in javascript class/dictionary?
|
<p>I have a Javascipt object which I use as dictionary</p>
<pre><code>var obj={
xxx:'1'
yyy:'2'
}
</code></pre>
<p>However -
xxx and yyy should be a jQuery <strong>object</strong>.</p>
<p>something like :</p>
<pre><code>var obj =
{
$('#div1'):'1' ,
$('#div2'):'2'
}
</code></pre>
<p>is it possible ? </p>
<p>also, How can I <strong>get</strong> the "<code>value</code>" for key <code>$('#div2')</code> ?</p>
<p>p.s.
I the $.data cant help me here since its also a key value
and i need in the key - object Type also.</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.