Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,073,200
1,073,201
How would I go about expanding my PHP code library with Python code?
<p>I have a rather large API written in PHP that I've worked on for years. Some of the functionality needs to be upgraded to the extent where I should really just rewrite the classes. Since I need to scrap the old code anyway, I was thinking perhaps I could replace the old functionality with Python code.</p> <p>I came across <a href="http://www.csh.rit.edu/~jon/projects/pip/" rel="nofollow">PiP</a> while searching for answers, and it seems like an <strong>exellent</strong> solution (Since I can actually create Python class instances in PHP and call their methods etc.) but it seems it was abandoned in the Alpha stages for reasons unknown to me.</p> <p>I suppose the simplest solution would be a CLI one, meaning I could run a python instance from PHP and collect the results. I don't particularly like this solution though, considering the amount of Python code I'd have to write just to handle input from PHP and respond accordingly. Plus it's not very reusable.</p> <p>I don't know if this is a normal problem, Google certainly don't seem to think so, but what would be the best way of complementing a PHP code library with Python code?</p>
php python
[2, 7]
3,031,458
3,031,459
Java: constructing a file from a URI?
<p>I need to obtain a File object from a URI, working in Java, but keep getting a length of zero - though I know the file size is not zero. </p> <p>I need the File object to pass to <a href="http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/media/MediaFileSource.html#constructor_summary" rel="nofollow">another constructor</a>.</p> <p>I'm not sure if it's because I'm constructing it in the wrong way? Here's my code:</p> <pre><code> File videoFile = new File(videoURI.getPath()); if (videoFile == null) { Log.d(LOG_TAG, "File not found!"); return false; } Log.d(LOG_TAG, "about to upload, filepath: " + videoFile.getPath()); Log.d(LOG_TAG, "File length: " + String.valueOf(videoFile.length())); </code></pre> <p>The log output doesn't spit out 'File not found!', and prints a non-null path, but shows a length of 0. </p>
java android
[1, 4]
3,288,076
3,288,077
How to create simple javascript/jquery client side captcha?
<p>How to create simple javascript/jquery client side captcha? How it may be realize, thx.</p>
javascript jquery
[3, 5]
5,565,818
5,565,819
Passing data from intent to other using python server
<p>I have an application with an Android client and a Python server. The android package has three Activities, which access GPS and google maps. I send the GPS coordinates from the second activity to the (python) server using a socket. I want to receive the [changed] value back from the server and pass it to the third Activity via an Intent to open the received location in a MapView. </p> <p>What must be done in Android and on the server side to accomplish this.</p>
android python
[4, 7]
5,749,177
5,749,178
Jquery $().each method obscures 'this' keyword
<p>I am creating a Javascript object that contains a function that executes a jQuery <code>each</code> method like the following:</p> <pre><code>function MyClass { Method1 = function(obj) { // Does something here } Method2 = function() { $(".SomeClass").each(function() { // 1 2 this.Method1(this); }); } } </code></pre> <p>Which object is each <code>THIS</code> referring to? jQuery is referring to the item returned from the <code>each</code> iteration. However, I would like <code>This[1]</code> to refer to the containing class...</p> <p>How can I refer to the containing class from within the jQuery loop?</p>
javascript jquery
[3, 5]
417,239
417,240
execute mail function automatically on specified time, php-jquery
<p>I've a page with php script to list viewers info like browser,time they were viewing etc and save those details into a info.txt file which is stored in the server. I'd prefer to collect all the details from info.txt and mail me every day at specified time. I hope there should be a better way to do it with php-jquery.Thanks</p>
php jquery
[2, 5]
3,047,795
3,047,796
CSS and animate() in jquery
<p>I'm trying to make navigation with some effects but my jquery code dosen't works like I expected. Actually I want to pass this css statement background: #ccc url('image.jpg') no-repeat; to animate function.</p> <p>How to do that ?</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; $('ul li').hover(function() { $(this).animate({ 'background' : '#ccc' }, 'fast'); } }); </code></pre>
javascript jquery
[3, 5]
4,847,972
4,847,973
Disabling a button inside a gridview using jquery
<p>I have a gridview and on the 6th column there is a link button. I want to enable/disable the link button according to the value of 7th column.... Iam using the following code. but it wont work... </p> <pre><code>$('#&lt;%=xgvVisitersRegister .ClientID%&gt; tr').each(function() { if ($(this).find('td:eq(7)').text() != "") { $(this).find('td:eq(6)').attr("disabled", true); } else { $(this).find('td:eq(6)').attr("disabled", false); } }); </code></pre> <p>Pls Help me to correct it.. thanks in advance...</p>
javascript asp.net jquery
[3, 9, 5]
4,910,225
4,910,226
How to release or clear the value of variable or object?
<p>I have an application in which I have used some variables and I want to release or free the memory space used by them after using them or on application close. Is there any process of doing this?</p> <p>I have used:</p> <pre><code>int x = Integer.parseInt(edt.getText().toString()) * Integer.parseInt(edt1.getText().toString()); String z = String.valueOf(x); </code></pre> <p>edt - Stands For EditText which I have been used for entering the value. </p> <p>After entering the value into the EditText, whenever I'll switch to my next activity page and then get back on my previous page the value of EditText is still available on it. But I want to clear the value of the variable.</p> <p>How can I achieve this?</p>
java android
[1, 4]
3,085,736
3,085,737
Execute function on each item click, but also once on page load
<p>I have a page with boxes and I want a function to run on each box click. Additionally, I want the function to run ONCE on page load. </p> <p>(The idea is that the function "updates the state", and I want to update on each click, but also on page load - to initialize the state, so to speak.)</p> <p>Normally, I do this like so:</p> <pre><code>$('.box').click(function() { // do something }).first().click(); </code></pre> <p>So I attach the handler to each <code>.box</code> click event, and then I get the first <code>.box</code> element and trigger the click event on it. </p> <p>This approach works, but it feels kind-of clumsy. How do you tackle this problem?</p>
javascript jquery
[3, 5]
5,560,418
5,560,419
How to simulate clicks on <a href="javascript:dosomething(12345)">text</a> using python?
<p>I want to simulate such clicks without controlling web browsers to do the job. I don't know much about javascript and actually don't know where to start. Any ideas?</p>
javascript python
[3, 7]
742,714
742,715
Customizing Text in html based on javascript output
<p>I have a modal dialog box function that is set up with a javascript/jquery script that pops up when a user clicks a button. I pull data from the button to find out which button. But the text that pops up is set up in html with a div that calls the script function.</p> <p>My question is, how do I customize this text based on the data I pull in the script.</p> <p>Here is the relevant code below to give you an idea of what I'm trying to do:</p> <p>The script:</p> <pre><code>&lt;script&gt; $(function() { $( "#dialog-modal" ).dialog({autoOpen: false, height: 250, width: 400, modal: true}); $( "#opener" ).click(function() { $( "#dialog-modal" ).dialog( "open" ); $.get('/like_artist.php', {artist_id : $(this).data('artist_id')}, function(data) { alert("Data Loaded: " + data.artist_id); }, "json"); }); }); &lt;/script&gt; </code></pre> <p>It is called in this div:</p> <pre><code>&lt;div id="dialog-modal" title="Basic dialog"&gt; &lt;p&gt;You have just liked &lt;/p&gt; &lt;p&gt;This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.&lt;/p&gt; &lt;/div&gt; </code></pre> <p>The button a user clicks (one of many with different data-artist_id values):</p> <pre><code>&lt;div class="button_row"&gt; &lt;button type="button" id="opener" data-artist_id="1"&gt;Play My City&lt;/button&gt; &lt;/div&gt; </code></pre> <p>Basically I would like to have the artist_id inform the div to make the text in the dialog box customized for each button. </p> <p>Thank you very much for your help!</p>
php javascript jquery
[2, 3, 5]
4,677,307
4,677,308
jQuery change text case
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript">Convert string to title case with javascript</a><br> <a href="http://stackoverflow.com/questions/2017456/with-jquery-how-do-i-capitalize-the-first-letter-of-a-text-field-while-the-user">With jQuery, how do I capitalize the first letter of a text field while the user is still editing that field?</a> </p> </blockquote> <p>I need the jQuery or Javascript equivalent to a PHP function:</p> <pre><code>&lt;?php ucwords(strtolower('SOMETHING') ?&gt; //Outputs "Something" </code></pre> <p>I've seen <code>.toUpperCase()</code> in Javascript, but can't find a "capitalize first letter" function.</p>
javascript jquery
[3, 5]
1,484,445
1,484,446
jQuery showing script errorObject Expected
<p>I am getting script error <strong>Object Expected at line: 400 char:1</strong>. The error is on the 1st line of the script. Please suggest how to fix this error.</p> <pre><code>&lt;% taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page"%&gt; &lt;% taglib prefix="c" uri="http://java.sun.com/jso/jstl/core"%&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ // error pointing at this line }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
293,304
293,305
How can I select an element by id and class in javascript?
<p>I want to know if we can select an element by using its id and class at the same time. I know in css we can do that with <code>#x.y</code>, but but how can it be accomplished in javascript? I tried the following code and it worked fine but then all the controls with ui-slider-handle class got affected(which is obvious). I think I need a combination of id and class both so that only that particular element will be affected.</p> <p><strong>Javascript</strong>:</p> <pre><code>$(".ui-slider-handle").text(ui.value); </code></pre>
javascript jquery
[3, 5]
5,108,177
5,108,178
JQuery to help page act like a form
<p>I'm trying to do something similar to <a href="http://www.wanderfly.com" rel="nofollow">www.wanderfly.com</a> . Basically the end goal is to have the divs in my page act like a checkbox, so at the end when a submit button is clicked the user will be transferred to something like:</p> <p><strong>mysite.co.uk/City=1|4|5|9</strong> </p> <p>So in this example the user clicked on divs number 1,4,5 &amp; 9. if he would have clicked div 4 again then he would've been passed to:</p> <p><strong>mysite.co.uk/City=1|5|9</strong> </p> <p>I hope i'm clear, please help me with a right direction on how to handle this and if JQuery has already a library for something of this sort.</p>
javascript jquery
[3, 5]
3,529,474
3,529,475
Passing values between asp.net pages
<p>I have this code in EnterSession.aspx.cs</p> <pre><code>[System.Web.Services.WebMethod] public static string GetSessionName(string session_name, int SessionId) { string result = ""; try { SqlConnection thisConnection = new SqlConnection(@"data Source=ZOLA-PC;AttachDbFilename=D:\2\5.Devp\ASPNETDB.MDF;Integrated Security=True"); thisConnection.Open(); SqlCommand thisCommand = thisConnection.CreateCommand(); thisCommand.CommandText = " SELECT session_name FROM myApp_Session WHERE session_id = @SessionId;"; thisCommand.Parameters.AddWithValue("SessionId", SessionId); SqlDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { result = thisReader["session_name"].ToString(); } thisReader.Close(); thisConnection.Close(); return result; } catch (SqlException ex) { return ex.Message; } } </code></pre> <p>then I used these codes in EnterSession.aspx page</p> <pre><code>gaq.push(['pageTrackerTime._trackEvent', 'Fancy Running Session', document.getElementById('session_name').value, document.location.href, roundleaveSiteEnd]); </code></pre> <p>and the other part of the code is </p> <pre><code> &lt;input type="hidden" id="session_name" /&gt; &lt;script type="text/javascript"&gt; document.getElementById('session_name').value = '&lt;%= this.SessionName %&gt;'; &lt;/script&gt; </code></pre> <p>The idea behind is to fetch the session_name from the db based on the session_id passed from previous page and pass it to Google analytic server using get element by id.</p> <p>this implementation didn't work for me, where could be my mistake? thanx in advance </p>
c# javascript asp.net
[0, 3, 9]
3,355,161
3,355,162
Throwing an exception in JavaScript?
<p>My programming skills are not great, and I was hoping that someone would be able to guide me.</p> <p>I am trying to integrate a predicted search function into a website, and i am using a JQuery plug-in to do so. I have got the search feature to work (the hardest part), and I just want to define a condition saying, if there are no products is stock displays “No match found” or whatever message. I just can’t get the condition to work, and I am running into syntax issues because I can even get the basic if else structure right.</p> <p>Thank you for your time.</p> <pre><code>$().ready(function() { $("#name").hide(); if ($("#course").autocomplete("get_course_list2.php", { width: 260, })); $("#course").result(function(event, data, formatted) { $("#name").hide(); $("#course_val").val(data[1]); result = "&lt;strong&gt; Product ID: &lt;/strong&gt;" + data[1] + "&lt;strong&gt; Product Name: &lt;/strong&gt;" + data[0]+ "&lt;strong&gt; &lt;/strong&gt;"; result += "&lt;a href=\"http://restoftheurl?id="+data[1]+"\"&gt;Click Here to view the product&lt;/a&gt;"; $("#name").html(result); }); }); </code></pre>
javascript jquery
[3, 5]
639,101
639,102
How javascript "this" handles multiple selector returns from jquery?
<p>I was making a menu today, and I stumbled on this curious case, with the following HTML:</p> <pre><code>&lt;div id="list1"&gt; &lt;ul&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2 - Here is a Submenu &lt;ul&gt; &lt;li&gt;3&lt;/li&gt; &lt;li&gt;4&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>Then i used the following js:</p> <pre><code>$('#list1 li').click(function(){ $('.list-item').removeClass('list-item'); $(this).addClass('list-item'); }); </code></pre> <p>When I do this the class would only be applied to the outer <code>&lt;li&gt;</code>, but I wanted it to be applied to both the parent and child <code>LI</code>s. </p> <p>Now my question is, how can I handle this "returns" so I apply the classes to both the parent and child <code>LI</code>s?</p> <p>How does js handle these type of selectors? Is the event really running twice and removing the last class that was set?</p>
javascript jquery
[3, 5]
2,998,427
2,998,428
Need help on setting up decent local development environment for ASP.NET and C#
<p>I am experienced php developer and I have everything setup for design/development/testing etc and I can develop locally on my machine using wamp. My question is, what should I be looking into for setting up a professional local development environment for developing web applications?</p> <p>I have windows 7 btw.</p> <p>Appreciate any advice.</p>
c# asp.net
[0, 9]
3,625,437
3,625,438
Synchronous GET request with Javascript/jQuery
<p>I have a function that makes ajax GET request and based on the value returned sets one global JS variable. I use this variable (isCalculateTax in the code below) for further processing:</p> <pre><code>var isCalculateTax; function setCalculateTaxValue(taxStatementId) { $.get('/taxstatements/calculatetax/' + taxStatementId, function (data) { isCalculateTax = data.isCalculateTax; }); } $(document).ready(function () { // initially check the tax statements dropdown to see which one is selected // and set the isCalculateTax to the right value var taxStatementId = $('#taxStatements').val(); setCalculateTaxValue(taxStatementId); enumerateDocumentItems(isCalculateTax); }); </code></pre> <p>My problem is that when enumerateDocumentItems() is called and executed the isCalculateTax is not yet updated from the AJAX GET request, so I receive unpredictable results.</p> <p>How can I wait the necessary amount of time before executing enumerateDocumentItems() so that isCalculateTax will be correct?</p>
javascript jquery
[3, 5]
84,625
84,626
Clearing the field of File Upload Control
<p>Can any one pf you please tell me how to clear the File upload control value using javascript.</p>
asp.net javascript
[9, 3]
3,594,232
3,594,233
How to get a binary file from a remote php script response?
<p>I'm calling a script that gives me a binary file (12345.cl), with binary data. The script is done, and it's working, if i paste it on the nagivator i get the binary file.</p> <p>Now i have a problem: How i transform the response of the script into a binary resource to use it in my app?</p> <p>For the moment, i have this code:</p> <pre><code> public void decodeStream( String mURL ){ BufferedInputStream bis = new BufferedInputStream(new URL(mURL).openStream(), BUFFER_IO_SIZE); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedOutputStream bos = new BufferedOutputStream(baos, BUFFER_IO_SIZE); copy(bis, bos); bos.flush(); </code></pre> <p>Then, i have a BufferedOutputStream with the response, but i dont know how to transform it into a binary resource to use it</p> <p><strong>i need to obtain a datainputstream with the file</strong> but i dont know how to achieve it</p> <p>thanks</p>
java php
[1, 2]
5,521,722
5,521,723
ASP.NET dynamically insert code into head
<p>I'm working inside of a Web User Control (.ascx) that is going to be included in a regular web form (.aspx), but I need to be able to dynamically insert code into the head of the document from the User Control. In my Coldfusion days &lt;cfhtmlhead&gt; would do the trick. Is there an equivalent of this in ASP.NET or a similar hack?</p>
c# asp.net
[0, 9]
5,271,799
5,271,800
format which support flash
<p>I have an json which stored as toc.js for eg the json is like this</p> <pre><code>[{ "id":"205","name":"apple", "description":"fruit"}, {"id":"206","name":"radio","description":"Electronics"},] </code></pre> <p>and i am using <code>$.getJSON( url,callback)</code> in my code. but the result is in object format, i get the output in array format so it can be used in the flash. I'm trying to grab data from a JSON on an flash but the flash doesn't support JSON-P output.</p>
javascript jquery
[3, 5]
3,168,780
3,168,781
passing arguments and returns between c# application and c++ exe file
<p>I want to call an c++ exe file into my c# application that takes a command line argument and returns the result so that i can use it in my c# application but i don't know how to do it . </p> <p>here's the simple sample that i tried and failed : c++ code : returner.exe</p> <pre><code>#include&lt;iostream&gt; #include&lt;cstdlib&gt; using namespace std; int main(string argc , string argv) { int b= atoi(argv.c_str()); return b; } </code></pre> <p>c# code :</p> <pre><code> private void button1_Click(object sender, EventArgs e) { ProcessStartInfo stf = new ProcessStartInfo("returner.exe", "3"); stf.RedirectStandardOutput = true; stf.UseShellExecute = false; stf.CreateNoWindow = true; using (Process p = Process.Start(stf)) { p.WaitForExit(); int a = p.ExitCode; label1.Text = a.ToString(); } } </code></pre> <p>i expect to see 3 in the lable . but it's always 0 . what should i do ?</p>
c# c++
[0, 6]
3,132,487
3,132,488
php can't run command about android
<p>I would like to create an android project in PHP. I hv wrote a .bat file for PHP to execute:</p> <pre><code>cd C:\temp android create project -n test -t 1 -p ./testing -k com.examples.test -a Main exit </code></pre> <p>(I have tested that these commands are workable if I just type them in cmd.exe.)</p> <p>However, if I use PHP to run the .bat file with following code:</p> <pre><code>&lt;?php chdir("C:\\"); system("test.bat"); ?&gt; </code></pre> <p>It will be no response at all. Is PHP not able to execute any command about "android"? or any better solution for creating project in PHP?</p> <p>Thank you.</p>
php android
[2, 4]
3,232,144
3,232,145
Manipulation of Input checkbox
<p>Is there anyone who can help me how can for this logic using jQuery?</p> <p>I have two checkboxes in my form. Once I click the first checkbox, the second checkbox will also check and vice versa. I hope you can help me. Thank you!</p>
javascript jquery
[3, 5]
1,448,198
1,448,199
problem refreshing div containing php code using jquery
<p>I have read 3 posts on SO about how to do this, but its not working for some reason.</p> <p>On the page index.php, i have this script:</p> <pre><code>&lt;script type="text/javascript"&gt; function update() { $.get("index.php", function(data) { $("#uploadcount").html(data); window.setTimeout(update, 5000); }); } &lt;/script&gt; </code></pre> <p>and then this div, also in index.php</p> <pre><code>&lt;div id=uploadcount&gt; &lt;? $result = mysql_query("SELECT * FROM mydb"); $num_rows = mysql_num_rows($result); echo "&lt;h1&gt;$num_rows&lt;/h1&gt;&lt;h2&gt;rows&lt;/h2&gt;"; ?&gt; &lt;/div&gt; </code></pre> <p>The php is displaying the row count fine, but it wont refresh the number.<br /> (i have latest jquery build included in head of index.php)</p>
php jquery
[2, 5]
279,698
279,699
how can i do jquery's $.get in pure javascript? (without wanting to return anything)
<p>I want the mobile version of my site to be as snappy as possible, however i still want some basic analytics.</p> <p>I want to ping a php file (hit counter) after the mobile page has loaded to count the amount of hits from javascript enabled browsers.</p> <p>Jquery's a bit overkill for 1 ajax function so i'm keen to learn how to do the following in pure javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; Window.onload(function(){ $.get('mvc/assets/ajax/analytics/event_increment.php?id='+id'); }) &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,381,641
2,381,642
Extract last string of a URL
<p>I have a URL like this:</p> <blockquote> <p><code>http://www.url/name/something/#/venue</code></p> </blockquote> <p>I need to grab the 'venue' from each URL. I have:</p> <pre><code>var currentUrl = $(location).attr('href'); var urlParts = currentUrl.split( "/" ); </code></pre> <p>The split breaks up the URL.</p> <p>I'm not sure how to grab the last part of <code>urlParts</code>.</p>
javascript jquery
[3, 5]
2,208,646
2,208,647
Need suggestions to create a chat application
<p>This question may sound stupid. I need suggestions from you guys to create a chat application using asp.net. The thing where I am confused is that there are many techniques in asp.net such as MVC, AJAX and many more (I dont know about them, been aware through many tutorial sites). So I dont know which technique to use. I will just explain the chat application which I am creating to you guys so that you can give some suggestions:</p> <blockquote> <p>-- It should be just like gmail chat application<br> -- The chat messages should be stored in a Database<br> -- There should be two tabs, one for important chat and other for casual chat (Both should be store in database)<br> -- This chat application will be integrated to existing website.</p> </blockquote> <p>So, my question is simple which technique of asp.net should I use to make it more efficient(or simple to understand). I am a trainee and I have only visual studio 2010. (This is my main project) The things I know are Basics of ASP.net, ado.net, c#.net, jquery, css, html and javascript. </p>
c# asp.net
[0, 9]
3,673,457
3,673,458
Jquery Iterate over table and highlight cells that have changed
<p>I have a table that is a history of a mysql record.</p> <p>I want to add a button that will highlight the changes.</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;100&lt;/td&gt; &lt;td&gt;200&lt;/td&gt; &lt;td&gt;300&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;100&lt;/td&gt; &lt;td&gt;200&lt;/td&gt; &lt;td&gt;600&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>In this example the 600 would be highlighted as it was 300 and is now 600.</p> <p>UPDATE: Thanks, I should have said there would be more than 2 rows. could be upto 20 rows</p>
javascript jquery
[3, 5]
2,365,823
2,365,824
timer with 10milli second resolution android
<p>I am trying to display a countup timer with format 1.00 resolution. basically seconds and with hundredths of second or 10ms resolution. I have tried the chronometer function but still no luck, it seems it can only track 1 second resolution. here is some of my code:</p> <pre><code>public void stopwatch() { stopWatch.setOnChronometerTickListener(new OnChronometerTickListener(){ @Override public void onChronometerTick(Chronometer arg0) { countUpmilli = (Long) ((SystemClock.elapsedRealtime() -arg0.getBase())/ 100); countUpSec = (Long) ((SystemClock.elapsedRealtime() -arg0.getBase()) / 1000); //asText = (countUp / 60) + ":" + (countUp % 60); asText = (countUpSec / 1) + "." + (countUpmilli%100); timertext.setText(asText); } }); stopWatch.start(); } </code></pre>
java android
[1, 4]
4,904,545
4,904,546
Heap size of JVM in Android
<p>for a PC, the default heap size for Java is 258 MB. what is the default heap size allocated to an Android application, say an activity starts and its created, how much memory does it get? I was curious since, phone has a limited memory space, would Google have decided a default memory allocation. </p>
java android
[1, 4]
2,461,831
2,461,832
Sum the contents of divs when their corresponding checkbox is clicked
<p>I have the following code in a loop reading the contents of a folder:</p> <pre><code>&lt;div class="oddrow"&gt; &lt;span class="title"&gt;1 - 1215 - Magna Carta&lt;/span&gt;&lt;br/&gt; &lt;span class="size"&gt;size: 229.1 MB&lt;/span&gt; &lt;input name="1215 - Magna Carta" type="checkbox"&gt; &lt;div&gt; </code></pre> <p>When the checkbox gets checked I want to have the sizes of each record added up in a separate div:</p> <pre><code>&lt;div id="total&gt;total = &lt;/div&gt; </code></pre> <p>How can I do this?</p>
javascript jquery
[3, 5]
5,740,003
5,740,004
About GridView in asp.net
<p>I am having a gridview and i have binded some some datum from db as labels using template fields....Now i have to Insert a new row which can be 'N' number of rows...all these rows should contain only textboxes .....i should not use footer template....</p> <p>So, In a gridview, Datum from db should be shown as labels, and newly added row should contain only textbox so tat we can add some values in the textbox....datum from the DB should not be editable as well in the gridview...Help me to solve this!!!</p>
c# asp.net
[0, 9]
5,234,557
5,234,558
Jquery tablesorter plugin to sort format: 16-Jan-2010
<p>I'm using jQuery Tablesorter and I have a problem sorting tables with date values of format: 16-Jan-2010</p> <p>How do I make them sort properly?</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
1,873,515
1,873,516
add value to checkboxlist using javascript/jquery
<p>I want to add a value to a checkboxlist using javascript /jquery.The code below is my sample code</p> <pre><code>function getExpertise() { $.ajax({ type: "POST", url: "Sample.asmx/GetExpertiseBySpecialization", data: "{sId: '" + $('#&lt;%=ddlSpecialization.ClientID%&gt;').val() + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(response) { var expertise = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d; $('#&lt;%=chkExpertise.ClientID%&gt;').attr('disabled', false).removeOption(/./).addOption('-1', 'Please select expertise'); for (var i = 0; i &lt; expertise.length; i++) { var val = expertise[i].Id; var text = expertise[i].Expertise; $('#&lt;%=chkExpertise.ClientID%&gt;').addOption(val, text, false); } } }); } </code></pre>
javascript jquery
[3, 5]
975,659
975,660
Error when using event mousemove can't hidden value when mousemove on object swf?
<pre><code>&lt;script&gt; oj = ["a","img","object"]; jQuery(document).bind('mousemove', function(e) { jQuery("#arrow").css({ top : e.pageY - 10, left : e.pageX + 35 }) jQuery.each(oj, function(i, val) { jQuery(val).mouseover(function() { jQuery("div[id^=\'arrow\']").hide() }); jQuery(val).mouseout(function() { jQuery("div[id^=\'arrow\']").show() }) }) }); &lt;/script&gt; </code></pre> <p>And html (swf + a)</p> <pre><code>&lt;object height="90" width="380"&gt; &lt;param name="movie" value="banner.swf"&gt; &lt;param vmode="transparent" value="opaque" name="wmode"&gt; &lt;embed height="90" width="380" vmode="transparent" wmode="opaque" src="banner.swf"&gt; &lt;/object&gt; &lt;a href="index.html"&gt;test&lt;/a&gt; &lt;div id="arrow"&gt;arrow&lt;/div&gt; </code></pre> <p>When I mousemove on <code>a tag</code> is result hidden <code>&lt;div id="arrow"&gt;arrow&lt;/div&gt;</code>, But when mousemove on <code>object swf</code> is result not hidden value <code>&lt;div id="arrow"&gt;arrow&lt;/div&gt;</code>, How to fix it ? <a href="http://jsfiddle.net/trrc8/" rel="nofollow">demo mine here</a></p>
javascript jquery
[3, 5]
1,784,964
1,784,965
Is this a jQuery bug? $.post vs $.ajax
<p>UPDATE: my code may be confusing and contain errors. But here is what I'm trying to do with both $.ajax and $.post ----I want to send JSON to php and receive plain text. But $_POST is empty&lt;-why?-----</p> <p>I found the $_POST to be empty if I use $.ajax, but contains the right content when using $.post Update: Requirement-- I need to use a JSON request. But problem is $_POST is empty in php, see Var_dump This is my script</p> <pre><code> &lt;script&gt; $(document).ready(function(){ $("#submit").click(function(){ $.ajax({ type: "POST", url: "Ajax_example.php", data: {"field": $("#field").val()}, contentType: "application/json; charset=utf-8", success: function(msg){ alert("NEW DATA:"+msg); } }); /* $.post("Ajax_example.php", {"field": $("#field").val()}, function(msg){ alert("NEW DATA:"+msg); });*/ return false; }) }); &lt;/script&gt; </code></pre> <p>This is my php</p> <pre><code> &lt;?php echo var_dump($_POST); ?&gt; </code></pre> <p>With the above, $.post portion are comments. With the $.ajax portion running, it alerts out only "NEW DATA:" But If I do it the other way around, I will get whatever I put in #field</p>
php javascript jquery
[2, 3, 5]
5,128,519
5,128,520
Using variables in object property names
<p>I have a variable called direction that stores either: <code>left</code>, <code>right</code>.</p> <p>I need to change the affected margin based on that variable.</p> <p>Right now I'm using conditions, is it possible to replace "left" with the output of the variable <code>direction</code>?</p> <pre><code>$("#map").animate({"margin-left": "+=50px"}, 500); </code></pre>
javascript jquery
[3, 5]
3,820,615
3,820,616
How to returns a string representation of the integer argument as an unsigned integer in base 16
<p>What is the C# equivalent of Integer.toHexString() from Java?</p>
c# java
[0, 1]
1,638,064
1,638,065
Show alert on browser close but don't show alert while closing from logoff
<p>In my application when user logs out the browser is closed. And on browser close I am throwing an alert. Now what I want is if I directly close the browser window alert should come but if window is closed through logout alert should not come as I have shown another confirm message of logout.</p> <pre><code>function closeEditorWarning(){ for (var i=0;i&lt;childWindow.length;i++) { if (childWindow[i] &amp;&amp; !childWindow[i].closed) childWindow[i].close(); if(i==0) { alert("This will close all open e-App applications"); } } window.close(); } window.onbeforeunload = closeEditorWarning; </code></pre> <p>And this is my logout code </p> <pre><code> $('#'+id).click(function(event){ event.preventDefault(); $('#centerContent').load('&lt;%=request.getContextPath()%&gt;/'+target); }); } else { $('#'+id).click(function(event){ event.preventDefault(); var r=confirm("logout"); if (r==true) { flag=true; for (var i=0;i&lt;childWindow.length;i++) { if (childWindow[i] &amp;&amp; !childWindow[i].closed) childWindow[i].close(); } window.close(); } else { } }); } </code></pre>
javascript jquery
[3, 5]
5,768,605
5,768,606
How we add the querying string in the URL dynamically in asp.net
<p>i want to add the query string in the URL dynamically how could it possible on client side. I can to it through location.href and response.redirect but i don`t want to do with this</p> <p>Thanks</p>
jquery asp.net
[5, 9]
5,839,812
5,839,813
iPhone, iPad style plugins for web app: JQuery
<p>In one of my app, am trying to get iphone or ipad style slide option or parallel options. Please take look at below screen shot.</p> <p><img src="http://i.stack.imgur.com/1kz9U.png" alt="Iphone-Ipod style UI"></p> <p>Is there any plugin avail for this kind of UI in jquery?</p>
javascript jquery iphone
[3, 5, 8]
6,016,591
6,016,592
jQuery - Get cell values and update cell values with result
<p>I'm working on a simple jQuery function that will grab the values of some input fields from 2 cells from a table and then perform some simple math to work out the difference, then update another cell value with the difference.</p> <p>Here's my function:</p> <pre><code>$(document).ready(function(){ $('#Calculate').click(function(){ var nextYearTotal = $("#textfield6").text(); var lastYearTotal = $("#textfield1").text(); nextYearTotal = Number(nextYearTotal); lastYearTotal = Number(lastYearTotal); var updatedTotal = nextYearTotal - lastYearTotal; $('#textfield7').html(updatedTotal); }); }); </code></pre> <p>No matter what the values in the textfield6 and textfield1 input fields are I'm getting "0" as the result in the textfield7 cell. </p> <p>I'm new to jQuery - would greatly appreciate it if someone can point out my error. This function is called when I click a button in a row of the table.</p>
javascript jquery
[3, 5]
1,321,271
1,321,272
Call a JavaScript function using <select> name
<p>I have a grid in asp.net. In this grid I am adding paging. In the paging footer I am showing a dropdown dynamically. The drop down contains the values (10,25,50,100). Now I want to capture the dropdown value and according to that value I want to do some change page styles. But here I am not getting any id of the dropdown list.</p> <p>Here is my select code</p> <pre><code>&lt;select style="text-align:right;" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$dgBatting$ctl13$ctl26\',\'\')', 0)" name="ctl00$ContentPlaceHolder1$dgBatting$ctl13$ctl26"&gt; &lt;option value="10" selected="selected"&gt;10&lt;/option&gt; &lt;option value="20"&gt;20&lt;/option&gt; &lt;option value="50"&gt;50&lt;/option&gt; &lt;option value="100"&gt;100&lt;/option&gt; &lt;/select&gt; </code></pre>
javascript jquery
[3, 5]
1,808,220
1,808,221
if there is already an 'onchange' event on a dropdown, if I bind another, when will it fire?
<p>There is an 'onchange' event, using inline javascript on a dropdown list which I have no control over.</p> <p>In the onready event, if I bind another onchange event, which one will fire first? And will this be a gauranteed order?</p> <p>I want mine to fire AFTER the inline js onchange event.</p>
javascript jquery
[3, 5]
282,422
282,423
Crossing out a literals text
<p>This might be a really newbie question but i can not find how to do it, I have a literal that shows a number say <code>4.00</code>, what i want to do is to put a line accross it like when you scratch something because it is wrong. I am doing this because i need to update it to a new price but show the old price crossed like</p> <pre><code>old 16.00 (with a line through) new 14.95 (normal). </code></pre> <p>This what i have, but not sure how to implement that? is this possible?</p> <pre><code> string myPrice = "16.00"; litMyPrice.Text = myPrice.ToString("c") </code></pre>
c# asp.net
[0, 9]
2,302,727
2,302,728
How to update "complex" data stored with jQuery's .data()?
<p>It seems to me that jQuery's <code>.data()</code> function is more of a write-once store than true read-write-storage.</p> <p>There does not seem to be a comfortable way of updating complex values.</p> <p>Let's suppose one wants to use some elements in a double-linked list (not my use case, illustrative purpose only).</p> <p>It would be easy if I would do:</p> <pre><code>$elem.data('prev', $prev); $elem.data('next', $next); </code></pre> <p>But I feel it is bad practice to pollute the "global" <code>.data()</code> namespace of an element.</p> <p>So I would rather do:</p> <pre><code>$elem.data('list', {prev: $prev, next: $next}); </code></pre> <p>But how do I now update <code>prev</code>?</p> <p>In the first example, I would just do:</p> <pre><code>$elem.data('prev', $newPrev); </code></pre> <p>But in the in my opinion "nicer" way of doing things the only thing I can think of is something like this:</p> <pre><code>$elem.data('list', {prev: $newPrev, next: $elem.data('list').next}); </code></pre> <p>This seems a lot more cumbersome to me and I suspect there is a better way, but so far I was unable to find anything.</p> <p>How should I go about this?</p>
javascript jquery
[3, 5]
4,556,453
4,556,454
Binding an existing javascript function in JQuery
<p>Using JQuery I want to bind an existing function to a button. I've been through the documentation and have found the bind method but the examples on the JQuery bind newly created functions where as I want to bind a function thats already hard coded, e.g:</p> <pre><code>function fHardCodedFunction(){ //Do stuff } function fBindFunctionToElement(){ $("#MyButton").bind("click", fHardCodedFunction()); } </code></pre> <p>Is this possible? Or am I going about this the wrong way?</p>
javascript jquery
[3, 5]
3,765,484
3,765,485
Hide the parent DIV when an Anchor Text contains a certain Keyword
<p>In the anchor text of the second link of the code below, the text "KEYWORD" can be found.</p> <p>What I would like to do is to HIDE the entire very first DIV (the one containing al the other code) whenever "KEYWORD" can be found in the anchor text of the link.</p> <p>(I don't have control over the HTML - the code is coming from a different website)</p> <pre><code>&lt;div&gt; &lt;div&gt;1. &lt;/div&gt; &lt;div&gt;&lt;a href="#nogo"&gt;buy now&lt;/a&gt;&lt;/div&gt; &lt;div&gt;More&lt;/div&gt; &lt;div&gt;&lt;a href="#nogo"&gt;bla bla KEYWORD bla bla&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Can anyone tell me how to do this. In javascript or jquery I guess.</p> <p><strong>Update</strong></p> <p>I removed the href link and changed it to "nogo" for privacy reasons.</p> <p>The href is a real link that changes all the time</p> <p>Sorry I should have mentioned that.</p>
javascript jquery
[3, 5]
5,897,461
5,897,462
Asp.net C# Encryption/Decryption on Client and server Side
<p>Sir, I have the jquery solution to encryption on the client side but it create "MD5" only.</p> <p>I want Salted Md5 Encryption on the Clientside and Decrypt it at the Server Side in Asp.net 4.0 and C#</p> <p>My Code for encryption are as follows:</p> <pre><code>&lt;script type="text/javascript"&gt; function chn() { var a = document.getElementById('txt1'); var b = document.getElementById('txt2'); var c = a.value; var d = $.md5(c); b.value = (d); } &lt;/script&gt; </code></pre> <p>I want that encryption must be change on every attempt..</p> <p>Example : first time encryption of abc is xyz</p> <p>and again if I will try with that name "Abc" then it should create another Encryption and check on server Side.</p> <p>Please Help me out</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,208,837
4,208,838
Passing variables with jQuery
<p>i'm relatively new to jquery and javascript and am trying to pass a unique id (number) into a flickr search function (jquery.flickr-1.0-js) like so, (number is the variable where i'm storing the unique id)</p> <pre><code>&lt;script type="text/javascript" src="javascripts/jquery.flickr-1.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery(function(){ jQuery(".btnRefresh").click(function(){ var number = $(this).attr("id"); $('#gallery_flickr_'+number+'').show(); jQuery('#gallery_flickr_'+number+'').html("").flickr({ api_key: "XXXXXXXXXXXXXXXXXXXXXXX", per_page: 15 }); }); }); &lt;/script&gt; </code></pre> <p>When i try to pass it in to the flickr-1.0.js function like so (abbreviated)</p> <pre> (function($) { $.fn.flickr = function(o){ var s = { text: $('input#flickr_search_'+number+'').val(), }; }; })(jQuery); </pre> <p>i get a error</p> <p>number is not defined [Break on this error] text: $('input#flickr_search_'+numbe...] for type=='search' free text search</p> <p>please help, what do i need to do to pass the variable between the two scripts?</p> <p>Thanks,</p>
javascript jquery
[3, 5]
1,108,762
1,108,763
Why onNewIntent(Intent intent) called twice?
<p>I start new activity with two params:</p> <pre><code>Intent intent = new Intent(WebTestActivity.this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); Uri uri = Uri.parse(url); intent.setData(uri); startActivity(intent); </code></pre> <p>And catch uri in onNewIntent method:</p> <pre><code>@Override public void onNewIntent(Intent intent) { //calls twice super.onNewIntent(intent); Uri uri = intent.getData(); new AsynkTask().execute(uri); } } </code></pre> <p>But onNewIntent method called twice and it not good for my application.</p>
java android
[1, 4]
2,788,371
2,788,372
How to adjust 3 ImageViews in a LinearLayout
<p>I defined a LinearLayout:</p> <pre><code>&lt;LinearLayout android:id="@+id/top_menu" android:layout_width="fill_parent" android:orientation="horizontal" android:background="@drawable/backrepeat" android:layout_height="wrap_content" &gt; &lt;ImageView android:id="@+id/topLeft" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="left" android:src="@drawable/library_top_left"&gt; &lt;/ImageView&gt; &lt;ImageView android:id="@+id/topMiddle" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:src="@drawable/library_top_middle"/&gt; &lt;ImageView android:id="@+id/topRight" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="right" android:src="@drawable/library_top_right"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>I'd like that one image is on the left side of the screen, one in the middle, and one on the right side. However all of them are on the left side. How can I fix that?</p>
java android
[1, 4]
2,481,615
2,481,616
Menu hover effect in Joomla Script
<p>i need script sucha as here: <a href="http://demo.opensourcecms.com/joomla/administrator/index.php" rel="nofollow">http://demo.opensourcecms.com/joomla/administrator/index.php</a></p> <p>Admin Username: admin</p> <p>Admin Password: demo123</p> <p>Script as menu hover effect. </p> <p>Where I find this script?</p>
javascript jquery
[3, 5]
4,069,307
4,069,308
Any Idea for Android app development
<p>Just wondering if anyone can help me in andriod app development. I'm new to this one and I dont know where to start. </p> <p>Andriod app has extension name .apk and im thinking if it uses different language to develop or I can use PHP, JAVA or c++ to create an app then save the app as <code>.apk</code>.</p>
java php android c++
[1, 2, 4, 6]
619,276
619,277
How to call many times "animate" from class?
<p>I have method in class:</p> <pre><code>function myClass(){ this.showTab = function(){ $('#tab-image').stop().animate( { left: 500 + 'px' }, 500 , function(){ alert('end'); } ); } } </code></pre> <p>and I call this method twice:</p> <pre><code>var obj = new myClass(); obj.showTab(); $('#tab-image').css({ left: -500 + 'px' }); obj.showTab(); </code></pre> <p>This code works but in second time show without animate. How to do it well?</p>
javascript jquery
[3, 5]
3,545,148
3,545,149
Unable to start service in Android
<p>I made I widget for reading news-items. If I put one widget at my homescreen, everything is fine. But if I put a seconde one at my homescreen and I remove it, the service of the widget stops. So if the widget gets in the update methode, an error occurs.</p> <pre><code>java.lang.RuntimeException: Unable to start service news.WidgetActivity$UpdateService@405231d8 with Intent { flg=0x10000000 cmp=news/.WidgetActivity$UpdateService bnds=[26,97][79,151] }: java.lang.NullPointerException </code></pre> <p>A nullpointer is at this line:</p> <pre><code>RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); </code></pre> <p>Here the code:</p> <pre><code>public static class UpdateService extends Service { @Override public void onStart(Intent intent, int startId) { RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); remoteViews.setViewVisibility(R.id.WidgetRefresh_btn, View.GONE); remoteViews.setViewVisibility(R.id.progressWidget, View.VISIBLE); appWidgetManager.updateAppWidget(appWidgetId, remoteViews); WidgetActivity.Widget.onUpdate(context, appWidgetManager, appWidgetIds); } @Override public IBinder onBind(Intent arg0) { return null; } } </code></pre>
java android
[1, 4]
5,164,163
5,164,164
Browse Full Screen Mode in .Net
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/464332/internet-explorer-full-screen-mode">Internet Explorer full screen mode?</a> </p> </blockquote> <p>I am working in C#.Net web application. I am having Login.aspx and Menu.aspx. My requirement is, i will give the login credentials and will click the Login Button, the page will be redirected to Menu.aspx Page. At that time, the Menu.aspx should be in Full Screen ( like, F11 Keypress in Keyboard ). </p> <p>I had tried with Window.Open in Login Button click event. The Menu.aspx opens in full screen mode, but in the background the login.aspx is in opened state. Once Login button is clicked, the Login.aspx should be closed and the Menu.aspx should be there.</p>
c# asp.net
[0, 9]
3,245,215
3,245,216
Dynamically create controls in aspx?
<p>I try several ways to create a few control in an .aspx page's code-behind. I have these problems: </p> <p>1) name of each component<br> 2) place of these components<br> 3) access to these components in method event or totally in code behind</p> <p>I want to create a few <code>&lt;asp:textbox&gt;</code> and put them in table rows. I'd like to then get value of these textboxes and do somthing with them.</p>
c# asp.net
[0, 9]
484,217
484,218
How to set Progress bar for loading activity with data in android
<p>This is my first class doing Url loading .</p> <pre><code>public class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } </code></pre> <p>This is my Activity Class where data is displacing in web view.</p> <pre><code>public class detailedview extends Activity { WebView mWebView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detailedview); GetSet gs = new GetSet(); String title = gs.getTitle(); String desc = gs.getDesc(); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setBuiltInZoomControls(true); mWebView.getSettings().setSupportZoom(true); mWebView.getSettings().setTextSize(TextSize.SMALLER); mWebView.loadDataWithBaseURL("", "&lt;p align=\"justify\"&gt;&lt;b&gt; " + title+"&lt;/p&gt;&lt;/b&gt;&lt;p align=\"justify\"&gt;&lt;br&gt;"+ desc + "&lt;/p&gt;&lt;/br&gt;", "text/html", "utf-8", ""); mWebView.setWebViewClient(new HelloWebViewClient()); } } </code></pre> <p>I want to put progress bar for loading data in my activity, I have tried a lot but I can't do it.</p> <p>Can you please write code or post code so that I can have a progress bar while loading data according to my code.</p>
java android
[1, 4]
5,672,765
5,672,766
ClickTale and ClickTaleExec
<p><a href="http://wiki.clicktale.com/Article/JavaScript_integration" rel="nofollow">Here</a> i've found how to implement ClickTale for DHTML pages, and now i need to do so ClickTale execute this code </p> <pre><code>item.next().css('display', 'none'); item.css('background', '#D6E9D6'); </code></pre> <p>the problem - i dont know how to write right a function which will run this code so i am planning to use ClickTale like this:</p> <pre><code>if(typeof ClickTaleExec=='function') { ClickTaleExec("item.next().css('display', 'none');"); ClickTaleExec("item.css('background', '#D6E9D6');"); } </code></pre> <p>And i have a question is it correct? Logically will it work?</p>
javascript jquery
[3, 5]
2,359,294
2,359,295
categorizing data in in to hash map
<p>I have a javascript object in the following format and I am trying to categorize it</p> <pre><code>var inputFacetArray=[ { category: "Company" , name: "nokia" }, { category: "Persons" , name: "ben affleck" }, { category: "Persons" , name: "daniel craig" }, { category: "Persons" , name: "george clooney" }] </code></pre> <p>I am trying to get it in to the output format</p> <pre><code>[{Persons:["george clooney", "daniel craig", "ben affleck"]}, {company:["nokia"]}] </code></pre> <p>My code is following</p> <pre><code>var facetCategorizedArray=[]; for(var k=0; k&lt;inputFacetArray.length; k++){ var l={}; inputFacetArray[k]["name"].push(l[inputFacetArray[k].category]); facetCategorizedArray.push(l); } </code></pre> <p>above code is not working.</p>
javascript jquery
[3, 5]
3,789,348
3,789,349
binding multiple events to one selector in jQuery
<pre><code>$("#action_button").click(function() { </code></pre> <p>How would I bind an onEnter event with a different selector to the same code above?</p>
javascript jquery
[3, 5]
3,682,334
3,682,335
Comparing C# and Java
<p>I learned Java in college, and then I was hired by a C# shop and have used that ever since. I spent my first week realizing that the two languages were almost identical, and the next two months figuring out the little differences. For the most part, was I noticing the things that Java had that C# doesn't, and thus was mostly frustrated. (example: enum types which are full-fledged classes, not just integers with a fresh coat of paint) I have since come to appreciate the C# world, but I can't say I knew Java well enough to really contrast the two so I'm curious to get a community cross-section.</p> <p>What are the relative merits and weaknesses of C# and Java? This includes everything from language structure to available IDEs and server software.</p>
c# java
[0, 1]
2,482,728
2,482,729
Date comparision in javascript + jquery
<p>I have this script piece in an javascript function to validate some fields in my form</p> <pre><code>var situacao = $("select[name='situacaoCRC']").val(); var dta_emissao = $("input[name='dtaEmissao']").val(); var dta_validade = $("input[name='dtaValidade']").val(); if (situacao == -1) { alert('Selecione um estado para o CRC.'); return false; } if (dta_emissao === undefined || dta_emissao === "") { alert('Data de emissão do CRC inválida.'); return false; } if (dta_validade === undefined || dta_validade === "") { alert('Data de validade do CRC inválida.'); return false; } if (dta_validade &lt;= dta_emissao) { alert('A data de validade do CRC deve ser posterior à data de emissão.'); return false; } </code></pre> <p>The fields dta_validade and dta_emissao are both dates in the format DD/MM/YYYY</p> <p>When i put in this fields, let's say, dta_validade = 01/12/2011 and dta_emissao = 01/01/2012 and, with this data, i get the alert in the 4th IF</p>
javascript jquery
[3, 5]
3,776,686
3,776,687
Error: uncaught exception: Syntax error, unrecognized expression: $
<p>I need help on this.</p> <p>This is my code:</p> <pre><code>function addEntrance(ent) { ent.parent('tr').after($('.entrance.default').clone().removeClass('default')); } $('.add-entrance').click(function() { addEntrance($(this)); }); </code></pre> <p>And this is the error when I click <code>&lt;a href="#" class="add-entrance"&gt;</code>:</p> <pre><code>Error: uncaught exception: Syntax error, unrecognized expression: $ </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
5,845,485
5,845,486
waiting until two values have changed in jquery
<p>I have two form fields and would like to post those values using jquery only when both have a value. I have tried this but there must be a better way. I think this way could lead to errors</p> <pre><code>$('#RFID').change(function(e){ if($(this).val() != '' &amp;&amp; $('#STATION_ID').val() != ''){ } }); </code></pre>
javascript jquery
[3, 5]
3,285,929
3,285,930
Using server tags to display text on the Master page
<p>I have a master page where I have below code:</p> <pre><code> &lt;div class="Version"&gt; &lt;label&gt;&lt;%System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();%&gt;&lt;/label&gt; &lt;/div&gt; </code></pre> <p>But this doesn't end up with the version information on the final rendered page.</p>
c# asp.net
[0, 9]
2,559,189
2,559,190
JQuery SHow Hide clarifcation please
<p>I've a following div:</p> <pre><code>&lt;div id="someDIV" style="display: none"&gt; bla bla bla &lt;/div&gt; </code></pre> <p>I've a jquery as below:</p> <pre><code> $(document).ready(function () { if (condition==true) { $("#someDIV").show(); } }; </code></pre> <p>For some reason someDiv is not showing up if condition is true. Am I doing something weird here, please?</p> <p>Thank you.</p>
javascript jquery
[3, 5]
4,008,931
4,008,932
how to set border color on textbox focus using javascript?
<p>In my form five textboxes ..when click on textbox its border color has to be changed.(on textbox focus event the border color will get change)</p>
javascript asp.net
[3, 9]
2,326,958
2,326,959
android: fade in animation
<p>I try to fade in a buttons in a specific order. Each time one button fades, but the buttons fade in all together after the code is finished. I tried to use Thread.sleep after each fade order but it doesn't help at all. Does someone have an idea?</p> <p>the code:</p> <pre><code> for(int i=0;i&lt;counter;i++) { switch (entered[i]) { case 1: ImageView myImageView1= (ImageView)findViewById(R.id.red_button); Animation myFadeInAnimation1 = AnimationUtils.loadAnimation(this, R.anim.fadein); myImageView1.startAnimation(myFadeInAnimation1); //Set animation to your ImageView break; case 2: ImageView myImageView2= (ImageView)findViewById(R.id.yellow_button); Animation myFadeInAnimation2 = AnimationUtils.loadAnimation(this, R.anim.fadein); myImageView2.startAnimation(myFadeInAnimation2); //Set animation to your ImageView break; case 3: ImageView myImageView3= (ImageView)findViewById(R.id.green_button); Animation myFadeInAnimation3 = AnimationUtils.loadAnimation(this, R.anim.fadein); myImageView3.startAnimation(myFadeInAnimation3); //Set animation to your ImageView break; case 4: ImageView myImageView4= (ImageView)findViewById(R.id.blue_button); Animation myFadeInAnimation4 = AnimationUtils.loadAnimation(this, R.anim.fadein); myImageView4.startAnimation(myFadeInAnimation4); //Set animation to your ImageView break; default: //finish(); break; } try { Thread.sleep(3000); // one second } catch (Exception e) {} } </code></pre>
java android
[1, 4]
4,796,922
4,796,923
jQuery.fn - Why isn't this working?
<p>What is the problem here? (Besides having redundant code). <code>$.getJSON</code> works as expected. However <code>$.postJSON</code> isn't working. I can inspect <code>$.fn</code> via firebug and sure enough postJSON is listed. However if I try to call it, I get a no function defined error. </p> <pre><code>jQuery.fn.getJSON = function(path, opts){ this.extend(opts, { url: path, dataType: 'json', type: 'GET' }); var invalid = opts.error; opts.error = function(xhr, status){ var data = $.httpData(xhr, 'json'); if (invalid) invalid(data); } this.ajax(opts); }; jQuery.fn.postJSON = function(path, data, opts) { this.extend(opts, { url: path, data: data, dataType: 'json', type: 'POST' }); var invalid = opts.error; opts.error = function(xhr, status){ var data = $.httpData(xhr, 'json'); if (invalid) invalid(data); } this.ajax(opts); }; </code></pre>
javascript jquery
[3, 5]
2,410,015
2,410,016
static variables Vs application variables
<p>I just want to see what you guys might think the difference (in terms of usage, efficiency, or even good practice) with regard to android development.</p> <p>If I use a static variable in one of my base activity (so its single instance and be access everywhere), as opposed to using a non static variable in my application subclass (which is a single application class for all the activities).</p> <p>Both will achieve the same end results if you try to use a global variable.</p> <p>I was using the static one then I moved to use the application subclass (in case you guys wonder "what is it I am using for", I wanted to play background music and control it from everywhere and I don't wish to use service for certain reasons).</p> <p>Any help clarifying the best way to ?</p>
java android
[1, 4]
5,919,659
5,919,660
How to determine which page opened a class in another project?
<p>I use a separate project for my data layer and call one class within it clsData.cs. I'd like to know which page from the Presentation Layer (in another project within the solution) has referenced it from the clsData side, if that's possible</p>
c# asp.net
[0, 9]
2,849,880
2,849,881
What's proper jQuery plugin practice?
<p>Don't be afraid to use any technical jargon or low-level explanations for things, please. I'm savvy enough with computer architecture and low-level programming languages to comprehend any optimizations or memory management techniques, as well as complex structures (classes, member variables, etc.)</p> <p>My primary focus of code is web-based applications. I work with PHP a lot and I've been learning CSS quickly. Javascript is currently my bottleneck, however. I know enough Javascript to do just about anything sans frameworks (DOM manipulation, AJAX queries, etc.). I also know that I can make my code run quicker, optimize it for specific cases, and I can shrink the over-all size of my code (no external script to include) by manually coding everything. However for ease of reading by other programmers and for speed of coding I'm trying to learn at least one Javascript framework.</p> <p>After reading through the documentation on a number of frameworks and looking at some tutorials, I preferred jQuery. It allowed for very powerful iterative code in a single line and it had a very small chance of global variable namespace collision. From what I could tell, the ONLY global variable declared is the $ variable and everything else happens within this namespace, and there were even ways to access the namespace without this variable if you wanted to have two frameworks side-by-side. It also had a very small file to include (24 kilobytes gzipped) which means less server load.</p> <p>My question is what are good practices in creating a jQuery plugin? If I were to start coding websites in jQuery, how should I go about it for the best interoperability and design? I want to ensure that my code can run along-side any other jQuery without interference, it's possible to build plugins off of my code, and I minimize use of the jQuery namespace so that I don't steal variables that might be used by another script.</p>
javascript jquery
[3, 5]
16,456
16,457
How do I set the value of an input-element via jQuery, when I only know it's "name"-attribute
<p>I need to reset some text-boxes which only have an unique name (not an unique id). I tried it with jQuery, but my code seems to do nothing:</p> <pre><code>$('input[name=customergroupname]').value=""; </code></pre>
javascript jquery
[3, 5]
720,729
720,730
How can I use WifiManager in a non-activity class?
<p>I have two classes: one of these is an activity class and the other is non-activity. And I call a method which is inside the non-activity class for returning mac Adress.</p> <p>activity class:</p> <pre><code>public class Control extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); deneme d = new deneme(this); // i has tried (getApplicatonContext) String x = d.macadress(); Toast.makeText(getApplicationContext(), x, Toast.LENGTH_LONG).show(); }} </code></pre> <p>and non-activity class:</p> <pre><code>public class deneme { Context mcontext ; WifiManager wm; public deneme(Context mcontext){ this.mcontext = mcontext; } public String macadress(){ wm = (WifiManager)mcontext.getSystemService(Context.WIFI_SERVICE); String m_szWLANMAC = wm.getConnectionInfo().getMacAddress(); return m_szWLANMAC; }} </code></pre> <p>but the method return null. I have the permission ACCESS_WIFI_STATE.</p>
java android
[1, 4]
1,509,497
1,509,498
How to read the width and the height of a flash file in C# or JS?
<p>What will i do to read the width and the height of a flash file (*.swf) in C# or JS?</p> <p>I tried a solution in CodeProject.com but return value of height is incorrect.</p>
c# javascript
[0, 3]
5,041,982
5,041,983
Javascript variable to PHP using Jquery AJAX
<p>I have the following javascript function</p> <pre><code>function success_callback(p) { lat = p.coords.latitude.toFixed(2); lon = p.coords.longitude.toFixed(2); } </code></pre> <p>Now I want to transfer both the variable to PHP using Jquery AJAX, I am pretty new to Jquery, I am not able to figure out how to do it. I want to transfer the variables to the same PHP file where this JS code resides. Is that possible ?</p>
php jquery
[2, 5]
4,706,886
4,706,887
Slding form does not show one form at a time
<p>I'm creating a sliding form with jQuery, but the forms aren't being shown one at a time, they show all at once. Yet, jsfiddle corrects the problem. Not sure how.</p>
javascript jquery
[3, 5]
2,015,931
2,015,932
Executing C# code on first page load
<p>I have a public static method <code>string SomeMethod(string message)</code> inside a <code>SomeClass</code> class which gets a string as input and returns something like</p> <pre><code>&lt;div&gt;message&lt;/div&gt; </code></pre> <p>Of course this is over-simplificated, but the idea is just like this. Now I would like to do something like</p> <pre><code>&lt;script language="javascript"&gt;var string = &lt;% $SomeClass.SomeMethod('asdada');&gt;&lt;/script&gt; </code></pre> <p>the first time the page is loaded, but I don't really know how can I do it. That just gives me an "object expected" error in JavaScript. Can anyone please help me out with this?</p>
c# javascript
[0, 3]
327,465
327,466
How to Compile projects in another console application
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3297427/place-all-output-dlls-in-common-directory-from-visual-studio">Place all output dlls in common directory from Visual Studio</a> </p> </blockquote> <p>I have a solution which is having 15 projects. Now i want to compile all these project and save dlls into another location using another console application.</p>
c# asp.net
[0, 9]
1,373,447
1,373,448
Jquery load php file into div doesnt seem to work
<p>So i got this script: </p> <pre><code>$(document).ready(function(){ $("#feedback").load('check.php'); }); </code></pre> <p>And i would like to load the check.php file. Into the div with the id feedback. It wont work. Do i miss something?</p>
php jquery
[2, 5]
776,360
776,361
Redirect according to roles
<p>I have two roles: administrator and users. In my login page, how do I redirect each of these two roles to a different page? For example, once an administrator has logged in they should be redirected to Page A while a user should be redirected to Page B. I have created the login control in login page and I used forms authentication.</p>
c# asp.net
[0, 9]
3,829,235
3,829,236
class accessible from all other classes
<p>I have some database functions and would like to make those database functions accessible too all of my other classes. I would like to keep the functions in one place so they are easy to modify. What is the best way to achieve this goal? My application is running on android and is using threading and events.</p> <p>Thanks in advance, if you need more information let me know.</p>
java android
[1, 4]
1,959,116
1,959,117
Image size validation
<p>is it possible to validate file image size with jquery class orjavascript ? </p> <p>Can i do that ? I made some research but did not reach anything</p> <p>Thank you</p>
javascript jquery
[3, 5]
3,608,866
3,608,867
Example of use GetRolesForUser();
<p>I need to check in conditional logic if a user has more that one role associated. Script should work like: If a user has 1 role CODE OK If a user has more that 1 role CODE ERROR</p> <p>The method is GetRolesForUser();</p> <p>But I do not know how to use it, could you please give me a sample of code? how to implement it, arrays?</p> <p>Thanks guys</p>
c# asp.net
[0, 9]
3,115,988
3,115,989
jquery unobtrusive validation attributes reference?
<p>Where i can find the reference for <strong>Unobtrusive jquery validation attributes</strong> like </p> <p><code>data-val-length</code> , <code>data-val-required</code> etc..I want the full list of these attributes. Is </p> <p>there any single place where i can find this?</p>
javascript jquery
[3, 5]
5,263,005
5,263,006
$(window).click(function(e) - identifier of currently clicked element
<pre><code>$(window).click(function(e) { alert(e.???); }); </code></pre> <p>How can I check how id, class or other identifiers of the current click?</p>
javascript jquery
[3, 5]
1,958,168
1,958,169
Sorting a dynamic table using jQuery
<p>Using javaScript I am populating the table headers and table data dynamically. I would like to sort the rows of table based on which header cell is clicked. </p> <p>NOTE: Main requirement is I don't want to use any jQuery plugins such as tablesorter, jqGrid etc.,</p>
javascript jquery
[3, 5]
5,023,830
5,023,831
Add Date & Time and Convert to UTC
<p>I have two dates. Date1 and Date2</p> <p>Date1 contains "10/12/2010 12:00:00AM". Date2 contains "10/10/2010 03:00:00PM"</p> <p>I want to extract only the date from Date1 and extract only the time from Date2 and join them.</p> <p>Example "10/12/2010 03:00:00PM".</p> <p>Any ideas?</p> <p>Thanks</p>
c# asp.net
[0, 9]
960,137
960,138
php and server side javascript
<p>I am dealing with a problem where I need to do few thing at the SERVER SIDE using JAVASCRIPT (I am using php + apache combination )-</p> <ol> <li>read source of url using curl</li> <li>run it through some server side JavaScript and get DOM out of it</li> <li>traverse and parse the DOM using pre-existing java script code.This code works fine in a browser.</li> </ol> <p>I goggled and found <a href="http://pecl.php.net/package/spidermonkey" rel="nofollow">http://pecl.php.net/package/spidermonkey</a> , which allows us to run java script at server.is there any better way to achieve this? can we use Mozilla engine to get DOM out of HTML source code and process it using java script ? </p> <p>Thanks in advance</p>
php javascript
[2, 3]
5,415,137
5,415,138
What does putting code in a curly brace block mean
<p>IN php, and some other languages i can have a code block without any entry conditions such as if, or for or function call:</p> <pre><code> echo "Hello World"; { echo "What does this mean"; } </code></pre> <p>What does this signify exactly. If I am not wrong, I can also do this in java. What exactly does this signify?</p>
java php
[1, 2]
1,217,835
1,217,836
Why do I have a shared cache when I `jQuery.extend` two objects with the same caching object?
<p>I can explain the problem best with this simple code snippet:</p> <pre><code> var child1 = {name: 'child1'}; var child2 = {name: 'child2'}; var parent = { _cache: [], // storage var writeCache: function(key, val) { console.log('writing cache::'+this.name); this._cache[key] = val; }, readCache: function(key) { if(this._cache[key] == undefined) { return false; } return this._cache[key]; }, }; jQuery.extend(child1, parent); jQuery.extend(child2, parent); child1.writeCache('myKey', 123); console.log(child1.readCache('myKey')); // returns 123 as expected console.log(child2.readCache('myKey')); // returns 123 unexpectedly (for me at least) </code></pre> <p>See this last line:</p> <pre><code> console.log(child2.readCache('myKey')); </code></pre> <p>Now why does it return 123 when we've accessed only child1's writeCache()?</p>
javascript jquery
[3, 5]
454,718
454,719
calculate data transfer download+uploaded data
<p>I want to calculate the total data download and upload in a particular interval of time, and store it to a database so that it can be viewed later on. Thus, this particular user logged in at this time and downloaded and uploaded this much data.</p> <p>I want to do this in C#.</p>
c# asp.net
[0, 9]
5,359,968
5,359,969
get selected text's html in div
<p>i have a div with contentEditable set to true. I have to find selected text html.I am able to get selected text in FireFox by</p> <pre><code> window.getSelectioin(); </code></pre> <p>I case of IE i am able to get selected text html by using</p> <pre><code>document.selection.createRange(). </code></pre> <p>But, how can i find selected text html in FireFox. How can in do this.Please help.</p>
javascript jquery
[3, 5]