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,459,782
3,459,783
add class to regex jquery
<p>I have this</p> <pre><code>if( window.location.href == "http://localhost:3000/categories") { $("#container ul #all_categories a.categories-menu").css("font-weight","bold"); } }); </code></pre> <p>but I have a url with:</p> <pre><code>http://localhost:3000/username/boards </code></pre> <p><strong>username</strong> is dynamic username e.g.</p> <pre><code>http://localhost:3000/michael-21/boards http://localhost:3000/Richard_10/boards http://localhost:3000/Mary.50/boards </code></pre> <p>and change for each user.</p> <p>How can do the same functionality but with this last url?</p> <p>Thank you</p>
javascript jquery
[3, 5]
2,850,378
2,850,379
Returning to previous page
<p>If a user is making an edit and clicks cancel, how can i return them to the page before the edit was made? Not jus refering them back to the previous page, but referring them back to how it was before they decided to edit.</p> <p>If i need to me more thorough please ask.</p> <p>I used this code but it just refers back to the previous page. I had a previous thread about a problem but couldnt find the solution.</p> <p>When a user clicks add new row button it opens up the new row in a edit and cancel form. If the user clicks cancel it automatically adds the row as blank, I dont want that I want the row to be deleted. I was thinking if I could set it to return to its orginal form before the new row was created oit would work the same way.</p> <pre><code> protected void gv_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Insert") //- this is needed to explain that the INSERT command will only work when INSERT is clicked { dbcon.Execute("INSERT INTO PROJ_ASP (TRANS_CD) VALUES('')", "ProjectASPConnectionString"); gv.DataBind(); gv.EditIndex = gv.Rows.Count - 1; gv.DataBind(); } } protected void gv_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { ///When cancel is clicked, redirect page to orginal page Response.Redirect("Default.aspx"); </code></pre> <p>I actually think I understand what my issue is, the way I setup it up is anytime the user clicks INSERT it automatically adds a blank row into the database REGARDLESS if its empty. What can i do to not allow it to insert it into the database until all rows are complete? Im assuming its a code i would be placing under gv_RowCommand</p>
c# asp.net
[0, 9]
376,274
376,275
How to get the date time of client PC in asp.net C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/274826/how-to-get-client-date-and-time-in-asp-net">How to get client date and time in ASP.NET?</a> </p> </blockquote> <p>I have a ASP.NET web application. My hosting server is in USA. Database is present there. Anyone can browse the site. Now I want to get the date time of client PC. I will store it in DB and will show it in browser. I have a label. I will show it in that label I have searched it in Google. But did not found proper code. Please give me the C# code. [I am using asp.net, C#] Thanks in advance Rashed</p>
c# asp.net
[0, 9]
3,034,650
3,034,651
email data from a form to an email address
<p>I have a very simple form. All i want to do is email the data to an email address. Is there a way I could do that just using JQuery or javascript? Can I do this without php or any other server side language? Is it doable or I am just thinking out loud</p>
javascript jquery
[3, 5]
337,635
337,636
Override Asp.Net Button mutators
<p>I need to trigger an event when Asp.Net button <code>visible</code> property is changed. For this purpose I am using <code>INotifyPropertyChanged</code>. The task remaining is to override getters and setters of button.</p> <p>How do I achieve this?</p>
c# asp.net
[0, 9]
417,274
417,275
Create jQuery Animation Plugin and use Deferred Object
<p>I've created a plugin for jquery. Now i want to implement jquery deferred object to use when, then with my plugin functions. I like to return the query chain with the deferred functionality... It have to work like $.fadeIn() etc.</p> <p>My plugin functions look like these:</p> <pre><code>(function( $ ){ $.fn.imgDoSomething = function( amount ) { return this.each(function() { //this is an image element var deferred = jQuery.Deferred($(this)); //..... do something and resolve deferred return deferred; }); }; })(jQuery); </code></pre> <p>I get these error</p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'call' </code></pre>
javascript jquery
[3, 5]
2,916,821
2,916,822
Element objects vs HTML string
<p>My question is pretty simple, and it may be subjective. For the most part when I am manipulating the DOM, I create HTML text and append it to an element. Sometimes, if the data is small enough, I will create elements and append those to the parent element.</p> <pre><code>$("#p").html("&lt;p&gt;My Paragraph&lt;/p&gt;"); </code></pre> <p>OR</p> <pre><code>$("&lt;p/&gt;").html("My Paragraph").appendTo("#p"); </code></pre> <p>Which of these should be used and why?</p>
javascript jquery
[3, 5]
1,177,161
1,177,162
Does the surfaceview in android scale to whatever size it needs to be?
<p>If I have a surface view and in that surface view I place a 50x50 image at the coordinates of 0 and 0 and then put that surface view inside of a relative layout and place it at the top left hand corner what will happen? </p> <p>What will happen if I place that surface view at another position?<br> Also, since I am programming with a 480x800 device as my core emulator, what will happen if I used a device that is smaller?</p> <p>Basically, how can I create something in a surface view and have the items in it increase or decrease in size proportionally to the device size?</p>
java android
[1, 4]
2,583,512
2,583,513
jQuery listview plugin
<p>Is there any ListView widget plugin for jQuery? With resizable columns, sorting helpers, odd-even rows styles etc. Something like ListView class from Ext library but for jQuery (NOT table/grid).</p> <p><strong>UPDATED</strong> Have switched to ExtJS so question is not topical anymore.</p>
javascript jquery
[3, 5]
3,494,074
3,494,075
Moving an object towards a point android
<p>I have this in the initialization of a bullet object:</p> <pre><code> x = startX; y = startY; double distance = Math.sqrt(((endX - x) ^ 2) + ((endY - y) ^ 2)); speedX = (6 * (endX - x)) / distance; speedY = (6 * (endY - y)) / distance; </code></pre> <p>It goes to where I touch on the screen, but the further away I touch, the faster it goes. This works fine on paper, I've tried it with different lengths and it should work, but bullets need to move 6 pixels on the line from the player to the point touched every step. And its update method moves of course. But why do bullets move at different speeds?</p>
java android
[1, 4]
1,727,926
1,727,927
Can i Create the Paging user control for gridview?
<p>Hi please give me idea or reference to create Paging User control.</p> <p>Thank You very much in advance.</p>
c# asp.net
[0, 9]
30,433
30,434
How do you configure SWFUpload to work with an ASP.NET C# WebService?
<p>I'm trying to use SWFUpload with an ASP.NET Web Forms project. I need to get at Request.Files[0] But I can't do that in my WebService! </p> <p>Anyone know a way around this?</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
2,820,478
2,820,479
Falling through a switch case?
<p>I was in the process of writing a switch case when I read on the PHP site: </p> <p><code>Thus, it is important not to forget break statements (even though you may want to avoid supplying them on purpose under certain circumstances).</code></p> <p>A switch case without break statements was perfect for what I wanted to do. I want all the cases below the matched one to execute. Why is this wrong, and what is the best way to do it differently?</p> <p>Is it bad for all languages, or just PHP? Why?</p> <p>edit: Whether it is or isn't a problem, is there a way to do the same thing without a switch case?</p>
php javascript
[2, 3]
4,435,414
4,435,415
How can I include a javascript file using php echo?
<p>How can I include a javascript file using php echo ?</p> <p>I am creating a html page using php ---</p> <pre><code>echo "&lt;html&gt;&lt;head&gt;&lt;link rel='stylesheet' type='text/css' &lt;script src="Calculation.js"&gt; &lt;/script&gt; href='style.css' &lt;/head&gt;&lt;body&gt;"; </code></pre> <p>I have included script code in the above line and then in form tag ---</p> <pre><code>&lt;form action='/workdonecalculation/index.php?_pagination_off=1' method='post' class='form' onSubmit='return workdone();'&gt; </code></pre> <p>But my php code doesn't call my javascript file (Calculation.js)</p>
php javascript
[2, 3]
4,249,626
4,249,627
C# DateTimeKind.Local in JavaScript
<p>I just want to know that what is equivalent of C# DateTimeKind.Local in JavaScript and how can I set it in JavaScript</p>
c# javascript
[0, 3]
3,496,480
3,496,481
Python-spidermonkey: How to get a line num. of error
<p>How to retrieve the line number in which a error occured?</p> <p>In the next script the line outputs (as the result of the last <strong>raise</strong>) but there is no line num. in JSError object.</p> <pre><code>from spidermonkey import Runtime, JSError runtime = Runtime() context = runtime.new_context() try: context.execute( "function test(){ return 'OK' }; \n\ntest2()" ) except JSError as e: print "ERROR!" print "args = {0}".format( e.args ) print "message = {0}".format( e.message ) print "__dict__ = {0}".format( e.__dict__ ) raise </code></pre> <p>The result:</p> <pre><code>ERROR! args = ('ReferenceError: test2 is not defined',) message = ReferenceError: test2 is not defined __dict__ = {} Traceback (most recent call last): File "test.py", line 7, in &lt;module&gt; context.execute( "function test(){ return 'OK' }; \n\ntest2()" ) File "&lt;anonymous JavaScript&gt;", line 3, in JavaScript code spidermonkey.JSError: ReferenceError: test2 is not defined </code></pre>
javascript python
[3, 7]
5,099,296
5,099,297
Different Chart Axis Values
<p>I am creating a StepLine chart in ASP.NET and C#. Chart works great and shows what I want, but I want to be able to show X Axis Values at the top as well as the bottom. Now the issue is that I want it to show values for one of my data points at the top and different values for a second data point down the bottom. Is this possible? Only thing I've been able to to in VS2010 is to just display the X Axis values at the top but they are identical.</p>
c# asp.net
[0, 9]
4,189,566
4,189,567
remove/restore elements, maintaining their events and element's children
<p>I came to a situation where I need to edit the following in a way that, on some event (lets assume the 'click' event in this case) I need to remove (or unwrap?) the <code>.container</code> and the <code>.header</code> and have the <code>.itemlist</code> still visible/available on the page. And then, I need to restore <code>.container</code> and <code>.header</code> back again on some other event, while still maintain the event listeners on the <code>a</code> tags, and if possible, without removing the said items from the DOM. Is this possible?</p> <pre><code>&lt;ul class="container"&gt; &lt;li class="header"&gt;&lt;a href="#"&gt;delete&lt;/a&gt; | &lt;a href="#"&gt;edit&lt;/a&gt;&lt;/li&gt; &lt;ul class="itemlist"&gt; &lt;li&gt;some item&lt;/li&gt; &lt;li&gt;some other item&lt;/li&gt; &lt;/ul&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
2,722,736
2,722,737
ToolTip on button click
<p>I need to show a tooltip onClick (Instead of hover) and it should fade out after 200ms </p> <p>Any help ? </p>
javascript jquery
[3, 5]
5,450,833
5,450,834
FancyUpload timeout issue?
<p>I am using FancyUpload with asp.net page.</p> <p>It is working fine but when I try to upload a little heavy file say 5 MB it shows timeout error. Can u please guide where time limit can be increased or what else I should do to fix this issue ?</p>
javascript jquery asp.net
[3, 5, 9]
3,982,100
3,982,101
Finding the td associated to its table onclick event
<p>I have a table like below</p> <pre><code>&lt;table onclick="dosomething()"&gt; &lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; </code></pre> <p>After I click on the table, I need to find the td on which the click happened. I cannot have onclick event written on tr or td.</p>
javascript jquery
[3, 5]
85,028
85,029
jquery.countdown.js giving really off results.
<p>I am really pressed for time so I am going to ask on here. The time of writing this is 2012-10-06. I am trying use a a jquery plugin called /jquery.countdown.js". It seems pretty straight forward. Can Anyone see what I am doing wrong? I am just trying test a countdown till tomorrow.</p> <pre><code> &lt;script&gt; $(function(){ var d = new Date(2012, 10, 07, 15, 4); $('#compact').countdown({until:d , compact: true, description: ''}); }); &lt;/script&gt; </code></pre> <p>it returns 32 days ++ thanks in advance</p>
javascript jquery
[3, 5]
2,677,511
2,677,512
Jquery: slideToggle() multiple divs independently using one function
<p>Markup:</p> <pre><code>&lt;div&gt; &lt;h3 class = "trigger"&gt;Heading 1&lt;/h3&gt; &lt;ul class = "toggle"&gt; &lt;li&gt;Line One&lt;/li&gt; &lt;li&gt;Line Two&lt;/li&gt; &lt;li&gt;Line Three&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3 class = "trigger"&gt;Heading 2&lt;/h3&gt; &lt;ul class = "toggle"&gt; &lt;li&gt;Line One&lt;/li&gt; &lt;li&gt;Line Two&lt;/li&gt; &lt;li&gt;Line Three&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>and the JQuery:</p> <pre><code>$(".toggle").slideUp(); $(".trigger").click(function(){ $(".toggle").slideToggle("slow"); }); </code></pre> <p>I'd like to be able to toggle these <code>&lt;ul&gt;</code>s independently. Currently, when either <code>&lt;h3&gt;</code> title is clicked both divs toggle...</p> <p>code is at: <a href="http://jsfiddle.net/CPvCZ/4/" rel="nofollow">http://jsfiddle.net/CPvCZ/4/</a></p>
javascript jquery
[3, 5]
375,074
375,075
@Override in Android
<p>I am new to Java and Android programing. The issue that I am having is that after surfing several books, forum and websites, I do not have clear understanding of what the @overide annotation does. I understand it signifies when a meathod is being over ridden. but why is it needed in android. I see it rarely in source code for java, but all the time in android.</p>
java android
[1, 4]
2,271,990
2,271,991
Using list of serialized objects
<p>I'm learning Android/Java programming, but I'm confused about persistant data. After a lot of research it seems that the best way to store objects is to serialize them in a file, but I couldn't find a simple way to retrieve these objects.</p> <p>If I create two objects and save their serialized versions, how can I retieve and list both of them? Do I need to create a file for each object with a specific ID in the filename so I can list them with a <code>getFilesDir</code>?</p>
java android
[1, 4]
5,695,197
5,695,198
jscript/jquery: fade in divs 1 by 1, with pause inbetween
<p>I am totally stumped here.</p> <p>I have a bunch of messages, each within a div "msg_feed_frame_$i" which increases, so message 1 is in div "msg_feed_frame_1", msg 2 is in "msg_feed_frame_2", etc etc. I want to fade these messages in one by one using jquery, but for some reason no matter what I do with settimeout and setinterval, the code immediately fades them all in simultaneously.</p> <p>This is what i've got so far:</p> <pre><code>function feed(i) { var div = "#msg_feed_frame_"; var fader = div.concat(i); $(fader).fadeIn(2000); } function timefade() { var num = 1; for (num=1; num&lt;=10; num++) { var t=setTimeout(feed(num),1000); } } $(document).ready(function(){ timefade(); }); </code></pre>
javascript jquery
[3, 5]
3,911,532
3,911,533
Retrieving scalar data using .xsd dataset object?
<p>Can someone suggest the best way to retrieve a scalar value when the site uses .xsd files for the data sets? I have such site where before I commit to a insert task I need to verify duplicates. </p> <p>Back in the day one would just instantiate a new connection and command object and run the query through BLL/DAL - easy job. With this prepackaged xsd file that the Studio creates for you I have no idea how to do it.</p> <p>Thanks,</p> <p>Risho</p>
c# asp.net
[0, 9]
514,712
514,713
noob question about function ()
<p>I am not sure about this code. This structure is correct?</p> <pre><code> success: function(data, data1, data3, .... ) { switch (data.livre) { case 'x': break; } switch (data1.livre1) { case 'y': break; } } </code></pre> <p>thanks</p>
javascript jquery
[3, 5]
620,058
620,059
How do I combine the best of two Apps into one?
<p>I have two similar iPhone and Android Apps (2 each) in the near future we will be combining/merging the best of these two Apps into one App. The App does have a user login that would need to be combined, but a common data file, so authentication should not be an issue. How do I deploy the combined App via the App Store and Google Market for users of the existing Apps? How can I phase the old out and let users know about the new merged App? I thought we could build the MOTHER App and deploy it as a version release in the App Store and Market, but can I deploy the same App version for two separate Apps? For the sake of an example, think of it as Bank of America merging their Apps with CitiBank under a single brand (CitiMobile is now BofA Mobile)</p> <p>Thanks in advance your your valuable insight. </p>
iphone android
[8, 4]
5,692,154
5,692,155
Render C# class as javascript
<p>I'm looking for a way to render a C# class object to javascript. For instance this class definition:</p> <pre><code>public class Foo { public string Bar1 { get; set; } public string Bar2 { get; set; } } </code></pre> <p>should render (an object of class Foo with values filled) as:</p> <pre><code>foo: { bar1: 'bar1value', bar2: 'bar2value' } </code></pre> <p>I know my way around reflection, but before reinventing the wheel all over again I was wondering if there are any libraries already doing these kind of things.</p>
c# javascript
[0, 3]
3,284,426
3,284,427
.show() not showing HTML element
<p>Here the problem: the layer gets sucessfully hidden, but when I click the button again, it won't re-appear. Any ideas?</p> <pre><code>&lt;head&gt; ... &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; function action() { var status; status = 1; if( status == 1 ) { $("#Layer1").hide( "slow" ); $("#close").attr( "src", "open.jpg" ); status = 0; } else if( status == 0 ) { status = 1; $("#Layer1").show( "slow" ); $("#close").attr( "src", "close.jpg" ); } } &lt;/script&gt; &lt;style type="text/css"&gt; body { background-color: #000000; } #Layer1 { position: absolute; width: 200px; height: 115px; z-index: 1; left: 179px; top: 3px; } #Layer2 { position: absolute; width: 101px; height: 80px; z-index: 2; left: 570px; top: 473px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="Layer1"&gt;&lt;img src="body.jpg" width="842" height="554" /&gt;&lt;/div&gt; &lt;div id="Layer2"&gt;&lt;img src="close.jpg" id="close" width="63" height="64" OnClick="action()"/&gt;&lt;/div&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
1,257,911
1,257,912
on doing bulk process in window service got stucked up by throwing this memory exception error
<p>my window service will generate some text files and it will be placed in some mentioned folder on during process suddenly service gets stop and thrown this error</p> <p><strong>Error Text :Exception of type 'System.OutOfMemoryException' was thrown.</strong></p> <p>how to come out off this issue ...</p> <p>NOTE: it was going for volume of 2000 - 3000 files </p> <p>issue was receiving when about volume of 5000 means ... the above error was receiving </p>
c# asp.net
[0, 9]
2,733,309
2,733,310
Color Dodge Blend Bitmap
<p>I have two bitmaps topBitmap and bottomBitmap and I need to blend the two bitmaps using color dodge in android. I could not find color dodge in PorterDuffXfermode. Is there any way to do it with ot without the use of a Canvas? </p> <p>Kindly let me know how to blend two bitmaps using color dodge mode in android.Thanks in advance.</p>
java android
[1, 4]
1,133,421
1,133,422
Ajax request cross domain json data and display?
<p>I have a function to get JSON data from another domain, but I don't know what is wrong with it. It never fires the success function and and no errors are returned.</p> <pre><code>$.ajax({ url: "http://other-domain.com/sample/Json.aspx", dataType: "jsonp", type: 'get', crossDomain: true, jsonp: 'jsonp_callback', success: function() { alert('abc'); //when success take json data string but i din get in here } }); </code></pre> <p>Does anyone know what's wrong here?</p>
javascript jquery
[3, 5]
4,840,963
4,840,964
Search function to add & remove options from select dropdown
<p>Here is my crazy code:</p> <pre><code>t.config.searchSpanInput.keyup(function () { var searchCriteria = t.config.searchSpanInput.val(); $.each (t.config.promoInput, function (i, v) { $.each ($(v + " option"), function (j, v) { if (optObj[i][j].text().toLowerCase().indexOf(searchCriteria.toLowerCase(), 0) === -1) { $(v).remove(); } if (optObj[i][j].text().toLowerCase().indexOf(searchCriteria.toLowerCase(), 0) &gt; -1) { if (optObj[i][j].length === 1) { $(v).append(optObj[i][j][0]); } } if (! optObj[0][0]) { $(v).prepend(optObj[0][0]); } }); }); }); </code></pre> <p>So... All of that is trying to do a somewhat simple task.</p> <ul> <li>On page load get all of the select boxes and all of their options and store them in an array. (this part of the code isn't shown in my example)</li> <li>On keyup of the search box iterate through all of the select dropdowns and their options. - If the text entered in the search box matches any of the text stored in the options in the array then leave those matching options in the select dropdown.</li> <li>If the text entered does not match any options, remove those options from the select dropdown.</li> <li>If the text entered in the search box matches any of the text stored in the options in the array, but it does not exist in the DOM, add it back in.</li> <li>Lastly, keep the top option in all the select boxes always on top. This option says "(All)".</li> </ul> <p>Any help would be appreciated. I'm currently getting a <code>Node cannot be inserted at the specified point in the hierarchy</code> on line 3 of jquery.min.js. :(</p>
javascript jquery
[3, 5]
3,686,834
3,686,835
JQuery frontend with Java and C# backends: design choices
<p>I have to build a multibrowser web app which should be able to be installed in both Windows and Linux servers.</p> <p>I've thought of using a single client-side frontend built with JQuery, and two different backends, built with java and c# respectively. The client then would use ajax calls with json to communicate with MVC frameworks on the server (ASP.net MVC for the C# version and Struts for the java one).</p> <p>Is it wise? Is it viable? What other choices do I have?</p>
c# java jquery
[0, 1, 5]
1,228,229
1,228,230
sending parameters from ASP.NET to javascript
<p>I want to call a javascript function from my ASP.NET (C#) code, I want to pass a variable (string) with another string like below:</p> <pre><code>tag_label.Attributes.Add("onmouseover", "tooltip.show('my text'+'"+myString+"'&lt;br/&gt;'another text);"); </code></pre> <p>how should I pass these values? also I want to have new line in my tooltip (<code>&lt;br/&gt;</code>), what should I do? I've tried several ways (using <code>'</code>, <code>+</code> and other methods) to send all these values but I get javascript error, is there any sample? please help me thanks</p>
javascript asp.net
[3, 9]
3,810,279
3,810,280
jQuery Plugin: Limiting script tag references to other libraries
<p>I am about to create a jQuery plugin but I was thinking of using a few other libraries. Now for it to be easy to use I was wondering if there are ways to limited the amount of script tag references I have to add. </p> <p>Few options I was considering:</p> <p>1: Include the library code into the plugin code. Not sure if this is viable? It will increase the size of the plugin.</p> <p>2: I just read about google.loader so I don't know a lot about it yet. Seems like a way you can load libraries from inside your code using Google API. It does require an API key though so this might not be for everybody.</p> <p>So StackOverflow, how do you deal with this problem?</p>
javascript jquery
[3, 5]
1,396,190
1,396,191
How to fix this jQuery Scope mistake?
<p>Something I'm not able to figure out in this code, I think it's a scoping issue.</p> <p>I have the following javascript snippet</p> <pre><code>&lt;javascript language="javascript&gt; $(function() { $("#dialog").dialog({ autoOpen: false }); function getMessage(direction, msgId) { return "This is an " + direction + " message with ID: " + msgId; } function showMessage(direction, msgId) { $("#dialog").text(getMessage(direction, msgId)); $("#dialog").dialog('open'); } }); &lt;/script&gt; </code></pre> <p>That I want to call it like the following</p> <pre><code>&lt;div id="dialog" title="Message Info"&gt;&lt;/div&gt; &lt;input type="button" id="btnCommand1" value="Command 1" onclick="javascript: showMessage('Outgoing', 1000487874')" /&gt; &lt;input type="button" id="btnCommand2" value="Command 2" onclick="javascript: showMessage('Incoming', 2000237851')" /&gt; </code></pre> <p>I understand that I can bind the click event through jQuery also but because I create those buttons dynamically I need to call it like mentioned above. The problem I get an error that showMessage() is not defined. I found that, in general, methods defined within jQuery scope $(function(){}) are not accessible from outside this scope! how to solve this?</p>
javascript jquery
[3, 5]
5,023,612
5,023,613
Count elements that the id begins with a certain string
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/897025/jquery-return-elements-where-id-begins-with-a-certain-string">jQuery Return elements where ID begins with a certain string</a> </p> </blockquote> <p>Ok, let's say I have the following elements:</p> <pre><code>&lt;select id="state_id" value="20"&gt;test1&lt;/select&gt; &lt;select id="state_id1" value="21"&gt;test2&lt;/select&gt; &lt;select id="state_id2" value="22"&gt;test3&lt;/select&gt; </code></pre> <p>How can I get the <code>length()</code> of the select tags that the id begins with <code>state_id</code> in this case?</p> <p>I have tried: <code>$("^#state_id").length();</code> but no success.</p> <p>Any hint?</p>
javascript jquery
[3, 5]
4,031,362
4,031,363
calll click event of a button of aspx page from usercontrol
<p>i have a button in an usercontrol.</p> <pre><code> &lt;asp:Button ID="btnCompare" CssClass="new_btn" runat="server" Text="Compare" /&gt; </code></pre> <p>i need to call a click event of a button which is in another aspx page on "btnCompare" button click.</p> <p>is it possible ?</p>
javascript asp.net
[3, 9]
477,980
477,981
How to raise the button command event from JavaScript ?
<p>How can we fire the button command event from the JavaScript.</p> <p>Not the BUTTON onclick event.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
3,135,318
3,135,319
System.Web.HttpException: This is an invalid script resource request
<p>I get this error when pushing our website to our clients production server however the page works absolutely fine on their dev / test servers. What causes this error (considering I am not using any web resources myself, though I am using the asp.net ajax toolkit).</p>
c# asp.net
[0, 9]
4,724,366
4,724,367
remove php tags from a string with python
<p>I want to remove php tags from a string </p> <pre><code>content = re.sub('&lt;\?php(.*)\?&gt;', '', content) </code></pre> <p>seems to work OK on single line php tags but when a php tag closes some lines after , it cannot catch it. can anybody help?</p>
php python
[2, 7]
4,988,095
4,988,096
set intervals between per click
<p>I have a working adding/removing numbers that I just created for showing the number of current page attached to the content slider which is not a feature of the slider ( please take a look <a href="http://sneakyrascal.com/coupon2" rel="nofollow">http://sneakyrascal.com/coupon2</a> )</p> <p>slider changes each content per second when the arrow is clicked but the number will be changed immediately so when the user clicks on it 5 times quickly the content won't reach the number for example the page may be in the third page but the number is 5!</p> <p>I've tried to use .delay it it didn't work... is there a way to add to the script so the click won't be immediate effect on the current number? For example more than one click on the arrow will effect only once per second, that should do the trick I think...</p> <pre><code>$(function(){ $(".jcarousel-next-horizontal").click(function(){ var currentValue = $(".pages").text(); var five = "5"; var newValue = parseInt(parseFloat(currentValue)) + 1; $(".pages").text(newValue); if (currentValue==five) { $(".pages").text("5"); } }); $(".jcarousel-prev-horizontal").click(function(){ var currentValue = $(".pages").text(); var newValue = parseInt(parseFloat(currentValue)) - 1; var one = "1"; $(".pages").text(newValue); if (currentValue==one) { $(".pages").text("1"); } }); }); </code></pre>
javascript jquery
[3, 5]
4,673,726
4,673,727
Javascript Equating Varaible .value
<p>This is the code im working from: <a href="http://jsfiddle.net/9B84H/26/" rel="nofollow">http://jsfiddle.net/9B84H/26/</a></p> <pre><code>function autosuggest() { var input = document.getElementById('location'); var options = {types: [],}; var autocomplete = new google.maps.places.Autocomplete(input, options); } function getLatLng() { var geocoder = new google.maps.Geocoder(); var address = document.getElementById('location').value; geocoder.geocode({ 'address': address }, function (results, status) { if (status === google.maps.GeocoderStatus.OK) { $('#lat').val(results[0].geometry.location.lat()); $('#lng').val(results[0].geometry.location.lng()); } else { alert("Geocode failed: " + status); } }); } </code></pre> <p>There are two variables which ar pretty much the same​:</p> <pre><code>var address = document.getElementById('location').value; var input = document.getElementById('location'); </code></pre> <p>Is there any opportunity to combine this into one line as a global variable?</p>
javascript jquery
[3, 5]
3,813,927
3,813,928
ASP.NET Custom authentication handler
<p>We have a web app written by a third party in ASP.NET, we don't have access to the source code but do have access to the server it runs on. We now have had a new public website developed for us in PHP and need to add a login to the homepage that will allow users to access out ASP>NET app. Any ideas on the best way this can be achieved? Can we write a custom authentication handler to do this?</p>
php asp.net
[2, 9]
1,145,386
1,145,387
passing array via query string
<p>I am passing a javascript array via <code>Request.QueryString["cityID"].ToString()</code>, but it shows me an error of "invalid arguments":</p> <pre><code>blObj.addOfficeOnlyDiffrent(Request.QueryString["cityID"].ToString(), Request.QueryString["selectTxtOfficeAr"].ToString()); </code></pre> <p>The method declaration looks like:</p> <pre><code>public string addOfficeOnlyDiffrent(string[] cityID, string selectTxtOfficeAr) { } </code></pre>
c# asp.net
[0, 9]
2,298,482
2,298,483
Is there any api which give suggestion words?
<p>I want to ask is there any api which return list of suggestions of words on giving input in any text control in any platform.</p> <p>For example when we type in EditText in android through soft keyboard , keyboard returns some suggestions so my question is that is there any api which gives the suggestions of corresponding input words(Platform does not matter).</p> <p>I am clearing it by a example suppose i type ab in EditText then the keyboard gives suggestions like Ab abc anita ashima etc. Please guide me. Thanks in advance</p>
iphone android
[8, 4]
5,962,183
5,962,184
Dip to pixel conversion results in the exact same value
<p>I am trying to convert dips to pixels using the following function. I’ve tried low, medium, and high density emulators and regardless of the emulator I use, the pixel value remains the same value as the dip value I pass into the function.</p> <pre><code>private int ConvertDips(float dips) { int pixels = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float) dips, getResources().getDisplayMetrics()); return pixels; } </code></pre> <p>What the heck am I doing wrong here?</p>
java android
[1, 4]
3,377,578
3,377,579
Create my own "URL Manager"
<p>I'm writing a http API, and I need a bit more flexibility than I'm used to in asp.net. It's pretty simple problem I have, and just need some help getting on the right track.</p> <p>My problem is, that I want to create a response object based on the request. F.x a user can get a xml document when requesting: "myapi/images/5/xml". Or get it as a json if it had ended with json. I have no problems creating the right response objects. I just need a way to collect all the request in some object, then parse the URL with a regex and create the right response on that.</p> <p>But how do I collect all requests on a web application?</p>
c# asp.net
[0, 9]
3,625,436
3,625,437
asp.net auto generated textboxes ID on webform
<p>I am using <strong>C#</strong> on <strong>Visual Studio</strong>. I want to generate a <strong>webform</strong> with auto numbered <code>Textboxes</code> depending on the input from the previous page. What is the best way to do this loop?</p> <p>For example:</p> <p>Input is 4</p> <p>The next page should generate textboxes with ID of </p> <ul> <li>"name1"</li> <li>"name2" </li> <li>"name3"</li> <li>"name4"</li> </ul> <p>Something like this :</p> <pre><code>&lt;asp:TextBox ID="name1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name2" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name3" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name4" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>Part 2 of my question is that if I want to call them when a <code>Button</code> is click, how should I use a loop the get those ID?</p>
c# asp.net
[0, 9]
620,022
620,023
Jquery-Image-Gallery-issue
<p>I am trying to create a jquery image gallery but I am facing a problem in next and prev and I should follow the structure which i am using in fiddle demo. Initially I need to show two images on click of next the other images/video should visible</p> <p>Here it is what I have tried.</p> <p>I should not use any plugins</p> <p><a href="http://jsfiddle.net/T657N/41/" rel="nofollow">http://jsfiddle.net/T657N/41/</a></p>
javascript jquery
[3, 5]
2,350,451
2,350,452
Android Toast.makeText() not showing up
<p>When the user presses a button, I'd like a small <code>Toast.makeText()</code> message show up saying something like <code>Contacting server...</code> while the app gets some information from my web server.</p> <p>The problem is that Java's HttpClient.Execute() method is synchronous, so it blocks the Toast from showing up until the request has completed.</p> <p>Is there way to have the Toast show up while the request is being sent?</p> <p>e.g.</p> <pre><code>Toast.makeText(myContext, "Contacting server...", Toast.LENGTH_SHORT).show(); String result = WebServer.Contact("www.mywebsite.com"); //A wrapper method Toast.makeText(myContext, "Result: " + result, Toast.LENGTH_SHORT).show(); </code></pre> <p>This code simply flashes the first Toast really fast <strong>after</strong> the request completes and then it shows the second Toast.</p>
java android
[1, 4]
3,308,632
3,308,633
Login is not working
<p>I have written the code below for a login page, but doesn't seem to work.<br> The variable <code>temp</code> takes a value of <code>0</code>.</p> <pre><code>protected void ButtonSbmt_Click(object sender, EventArgs e) { //if (IsPostBack) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString); conn.Open(); string cmdstr = "select count(*) from Registration where username='" + TextBoxUsername.Text + "'"; SqlCommand checkuser = new SqlCommand(cmdstr, conn); int temp = Convert.ToInt32(checkuser.ExecuteScalar().ToString()); if (temp == 1) { string str = "select password from Registration where username='" + TextBoxUsername.Text + "'"; SqlCommand pass = new SqlCommand(str, conn); string pass1 = pass.ExecuteScalar().ToString(); conn.Close(); if (pass1 == TextBoxPassword.Text) { Session["new"] = TextBoxUsername.Text; Response.Redirect("secure.aspx"); } else { Label1.Visible = true; Label1.Text = "invalid password"; } } } </code></pre>
c# asp.net
[0, 9]
1,142,830
1,142,831
fileupload path is missing
<p>I am using a file upload control to upload the files if the user browse and upload the file. after uploading the path gets disappears. i should be maintain there itself. how?</p>
c# asp.net
[0, 9]
3,142,486
3,142,487
Selecting an element by a class using javascript or jQuery
<p>I have the following html snippit;</p> <pre><code>&lt;input name='first' class="foo" /&gt; &lt;input name='second' class="foo bar" /&gt; &lt;input name='third' class="foo" /&gt; </code></pre> <p>I want to set the value of a specific element, but i'm unable to select the right one. This is whar i've tried:</p> <pre><code>jQuery('.bar').val('selected'); </code></pre>
javascript jquery
[3, 5]
5,853,794
5,853,795
document.selection.createRange() not working in chrome and safari
<p>I am using a textbox with textmode as multiline option its working fine in IE,Mozilla problem occurs in Chrome and safari. Sample code folows</p> <pre><code>&lt;asp:TextBox ID="txtRootDescription" onpaste="DoPaste(this);" Width="600px" Rows="10" Columns="72" MaxLength="500" TextMode="MultiLine" runat="server"&gt;&lt;/asp:TextBox&gt; function DoPaste(control) { maxLength = control.attributes["maxlength"].value; if (maxLength) { var oTR = control.document.selection.createRange(); }} </code></pre> <p>in chrome it gives me an error as "Cannot read property 'selection' of undefined"</p>
c# javascript asp.net
[0, 3, 9]
3,607,666
3,607,667
how to remove first two segments of a url string in java?
<p>if I have a url string like "http://www.google.com" how can I convert that to just "google.com" in java? Im assuming there is a way to parse this using a function in java, any help will go a long way thanks!</p>
java android
[1, 4]
5,296,390
5,296,391
how to get the asp.net drop down list items in javascript
<p>I have one dropdownlist in my c# code behind page like `DropDownList dl = new DropDownList(); dl.Items.Add("Item 2");</p> <pre><code> dl.Items.FindByText("Item 2").Value="2"; dl.Items.Add("Item 3"); dl.Items.FindByText("Item 3").Value="3";` </code></pre> <p>I like to get that drop down list items in client side java script. one important think note that I like to get values of dropdownlist in the c# code behind page and not the asp.net page. Can anyone know the solution for that problem?</p> <p>Thank you...</p>
c# asp.net
[0, 9]
5,837,811
5,837,812
Change the background of all the activities in the app
<p>I'm trying to define a background as default for all the activities in the app. So I have used:</p> <pre><code>&lt;style name="testStyle" parent="@android:style/Theme.NoTitleBar"&gt; &lt;item name="android:background"&gt;@color/app_background_color&lt;/item&gt; &lt;/style&gt; </code></pre> <p>and then in the manifest </p> <pre><code>&lt;application android:icon="@drawable/icon" android:theme="@style/testStyle" ..... </code></pre> <p>But that way the background is applied to other elements like Dialogs title and Toasts backgrounds. How can I make that style only affect the background of the activities?</p> <p>Thanks</p>
java android
[1, 4]
423,123
423,124
How do I remove a clickable link from asp:Gridview column?
<p>I want to remove a clickable link from asp:Gridview column when some condition is true.</p> <p>I tried this:</p> <pre><code>Gridview.attributes["disabled"] = "disabled"; </code></pre> <p>But the hyperlink is still clickable. I don't want clickable hyperlinks when the grid is disabled. How can I do it in C#.net?</p>
c# asp.net
[0, 9]
3,663,941
3,663,942
How to read a text file from the last line to the first
<p>I need this to run in reverse so that the lines appear in the reverse order of this. Is there a quick way to flip a TextView or something like that? Thanks for any help.</p> <pre><code>try { // Create a URL for the desired page URL url = new URL("text.txt"); // Read all the text returned by the server BufferedReader MyBr = new BufferedReader(new InputStreamReader(url.openStream())); String line; line = MyBr.readLine(); TextView textview1 = (TextView) findViewById(R.id.textView1); StringBuilder total = new StringBuilder(); while ((line = MyBr.readLine()) != null) { total.append(line + "\r\n");} textview1.setText(total); Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/wonderfull.ttf"); TextView tv = (TextView) findViewById(R.id.textView1); tv.setTypeface(tf); MyBr.close(); } catch (MalformedURLException e) { } catch (IOException e) { } </code></pre>
java android
[1, 4]
5,173,831
5,173,832
Java Android No more background processes
<p>I want to understand some things that take place in JAVA application while application is loading. First of all then I launch my application it start to load more then 180MB of libraries to the RAM of the phone and I can see </p> <blockquote> <p>12-12 19:05:05.478: DEBUG/dalvikvm(12579): GC_EXPLICIT freed 53K, 48% free 3513K/6727K, external 1625K/2137K, paused 471ms<br> 12-12 19:05:22.181: INFO/ActivityManager(115): Process com.google.android.apps.maps (pid 12875) has died.<br> 12-12 19:05:22.181: INFO/ActivityManager(115): Low Memory: No more background processes.<br> 12-12 19:05:23.814: INFO/ActivityManager(115): Process com.android.launcher (pid 12563) has died.<br> 12-12 19:05:23.857: INFO/WindowManager(115): WIN DEATH: Window{407fcdf8 SurfaceView paused=false}<br> 12-12 19:05:23.931: INFO/WindowManager(115): WIN DEATH: Window{407dacf8 com.android.launcher/com.android.launcher2.Launcher paused=false}<br> 12-12 19:05:23.931: INFO/ActivityManager(115): Low Memory: No more background processes.</p> </blockquote> <p>such logs in my LogCat, some processes <strong><em>has died</em></strong>.</p> <p>I want to know the meaning of this messages </p> <ul> <li><em><strong>Low Memory: No more background processes.</em></strong></li> <li><em><strong>Process com.android.launcher (pid 12563) has died.</em></strong></li> </ul> <p>Why this processes died and how I can fix this problem ?</p>
java android
[1, 4]
3,026,109
3,026,110
How to give user defined validation in asp.net?
<p>I have a grid to which there are edit/delete/insert buttons, there is a column in the grid say SR_NO ,the user can simply add a number in this field and append/edit to the grid.</p> <p>but the thing is I want to validate this field such that there is no other entry in the entire SR_NO column having same SR_NO,how can do this?</p> <p>The only validations I have used till now are required field and reg-ex format validator ,so little dim on this aspect please help....</p>
c# asp.net
[0, 9]
3,857,057
3,857,058
JavaScript 'beforeunload' event not working in ie
<p>I need to open a pop-out window, then after close pop-out window (refresh a parent page)</p> <p>jquery 'beforeunload' event not working in internet explorer 8,9.</p> <p>my code is:</p> <pre><code> /* * events * add tallyman */ $("div.main form div.tallymanlist").click(function() { if(gencargo.show_confirm('Add new tallyman?')) { var windowObject = gencargo.windowOpener(600,1400, "Tallyman",$(this).children().attr("url")); gencargo.windowParentRefresh(windowObject); } }); </code></pre> <p>gencargo object is content (window open):</p> <pre><code> /* * open window */ windowOpener : function (windowHeight, windowWidth, windowName, windowUri) { var centerWidth = (window.screen.width - windowWidth) / 2; var centerHeight = (window.screen.height - windowHeight) / 2; newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + ',height=' + windowHeight + ',left=' + centerWidth + ',top=' + centerHeight); newWindow.focus(); return newWindow; }, </code></pre> <p>and also window close:</p> <pre><code> windowParentRefresh : function(object) { $(object).bind('beforeunload', function () { object.opener.location.reload(); }); } </code></pre> <p>Close window event is not working in ie. Only in FireFox, Chrome, Opera.</p>
javascript jquery
[3, 5]
909,271
909,272
Calculating degrees for bouncing ball
<p>I'm doing a simple breakout game and I have some problem how to calculate the angle when the ball hit the top border. When the ball moves upwards in an angle of 180 degrees, then it bouncing back downwards in an angle of 0 degrees. But when the ball is moving upwards in an angle of 170 degrees, then it should be bouncing back downwards in a mirrored angle, like 10 degrees. I can calculate this like <code>180-170 = 10</code> degrees, but what if the ball is moving upwards in an angle of 190 degrees!? Then it should be bouncing back downwards in an angle of 350 degrees, but I don't know how to calculate this!?</p> <p>Is there a simple way to calculate or mirror the value of the upwards moving angle of the ball? Preciate some help because I'm not good in math! Thanks!</p> <p>EDIT: I'm moving the ball like this:</p> <pre><code>xPos += speed * Math.sin(Math.toRadians(direction)); yPos += speed * Math.cos(Math.toRadians(direction)); </code></pre>
java android
[1, 4]
1,638,999
1,639,000
make jquery use min-height not just height
<p>The code:</p> <pre><code>function setEqualHeight(columns) { var tallestcolumn = 0; columns.each( function() { currentHeight = $(this).height(); if(currentHeight &gt; tallestcolumn) { tallestcolumn = currentHeight; } } ); if (tallestcolumn &lt;= 1000) { columns.height(tallestcolumn + 4); } } $(document).ready(function() { setEqualHeight($("#main-content-bottom-bg &gt; div")); }); </code></pre> <p>I know its probably simple, but I just cannot figure out what I give. I would think something like this:</p> <pre><code>columns.minheight(tallestcolumn + 4); </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
5,934,004
5,934,005
how to save a file at the server in asp.net?
<p>i have a log file which needs to be written to the server . If i had the code in a code behind file for a web form i would have done this </p> <pre><code>File.WriteAllText(Server.MapPath("/ErrorLogFile/ErrorLogFile.log"),json); </code></pre> <p>Now, since my code sits inside the App_Code folder i have no access to the Server class ...so i have to tell it to go find the folder and then write it to the disk. I can accomplish this by telling it the full path and it will work . but i want to tell it to go look for the ErrorLogFolder in the directory you are in and then write the file there . Is there a way to do that ?</p>
c# asp.net
[0, 9]
4,112,314
4,112,315
How to write a file in Android to the raw folder?
<p>I think this is a pretty basic question. </p> <p>I am currently writing a file like this:</p> <pre><code>File output = new File("exampleout.mid"); </code></pre> <p>Now, I want to write the file to ../myproject/res/raw</p> <p>I read I could do it by putting the complete url in the "". BUT. Since this is an Android app. What is the full url? I don;t have to write /home/.../myproject/...?</p> <p>Is the solution: </p> <pre><code>File output = new File("/res/raw/exampleout.mid"); </code></pre> <p>Or do I need a higher url structure?</p> <p>Sorry about asking this simple question, but since I use an Android emulator, I cannot check if the file is actually in the right place.</p>
java android
[1, 4]
3,960,562
3,960,563
How to unload C++ DLL in C#
<p>I load a C++ DLL using DLLImport in my C# ASP.Net web application. The DLL basically reads some CSV files, and manipulates them and creates new files.</p> <p>After I ran the method successfully, and run it again then I get C++ exception back. </p> <p>I want to unload the C++ DLL from the website so a user can re- load the DLL and re run the method. Do you know how to either eliminate this error or get rid of this error message so the DLL can be unloaded after its run?</p>
c# asp.net c++
[0, 9, 6]
1,711,934
1,711,935
Why invalidate must be called by UI thread
<p>Anyone know why <a href="http://developer.android.com/reference/android/view/View.html#invalidate%28%29" rel="nofollow">invalidate</a> must be called by UI thread? </p> <p>As in Java Swing, the <code>repaint</code> function can be called by both non-UI thread and UI thread. <code>repaint</code> is performing a very similar task as <code>invalidate</code> <em>(this method causes a call to this component's paint method as soon as possible. Otherwise, this method causes a call to this component's update method as soon as possible.)</em>.</p>
java android
[1, 4]
1,010,033
1,010,034
Cannot crop Bitmap
<p>I'm trying to crop and scale given bitmap,But only scaling works.<br> What am I doing wrong?</p> <pre><code>private Bitmap CropAndShrinkBitmap(Bitmap io_BitmapFromFile, int i_NewWidth, int i_NewHeight) { int cuttingOffset = 0; int currentWidth = i_BitmapFromFile.getWidth(); int currentHeight = i_BitmapFromFile.getHeight(); if(currentWidth &gt; currentHeight) { cuttingOffset = currentWidth - currentHeight; Bitmap.createBitmap(i_BitmapFromFile, cuttingOffset/2, 0, currentWidth - cuttingOffset, currentHeight); } else { cuttingOffset = i_NewHeight - currentWidth; Bitmap.createBitmap(i_BitmapFromFile, 0, cuttingOffset/2, currentWidth, currentHeight - cuttingOffset); } Bitmap fixedBitmap = Bitmap.createScaledBitmap(i_BitmapFromFile, i_NewWidth, i_NewHeight, false) ; return i_BitmapFromFile; } </code></pre> <p>The description say that: "createBitmap Returns an immutable bitmap ".<br> What is that mean? and is it the cause to my problem?</p>
java android
[1, 4]
559,277
559,278
Passing Eval from ASPX to Javascript function as Parameter
<pre><code>&lt;a id="lblShowTimings" runat="server" title='&lt;%# Eval("SHOW_Name") %&gt;' onclick='PopulateTicketDiv(&lt;%#Eval("SHOW_ID") %&gt;)'&gt; &lt;-- this is the problem %#Eval("SHOW_Time") %&gt; &lt;/a&gt; </code></pre> <p>Can Eval be passed as an argument to a javascript function? If so whats the syntax?</p>
c# asp.net javascript
[0, 9, 3]
1,070,592
1,070,593
Java math conversion
<p>I have this code in C++</p> <pre><code>float result = -log(result)/0.5231-1.0; </code></pre> <p>And I converted that into Java code like this</p> <pre><code>float result = (float) (-Math.log(result)/0.5231-1.0); </code></pre> <p>Is this correct way to convert the c++ code?</p>
java c++
[1, 6]
757,982
757,983
Handler to grab variable values from another function
<p>This is what I have so far </p> <pre><code>//file uploader /////////////////////////// function uploader(){ var file = $(this).val() var error = $(this).next('.req-error') var fileLimit = $(this).attr('maxlength')-1 var uploadedFiles = $(this).siblings('.uploaded-file').length //make uploaded file label if(error.length ==1){ $(this).next().after('&lt;div class="uploaded-file"&gt;&lt;span&gt;X&lt;/span&gt;'+file+'&lt;/div&gt;') }else { $(this).after('&lt;div class="uploaded-file"&gt;&lt;span&gt;X&lt;/span&gt;'+file+'&lt;/div&gt;') } //count uploaded files if(uploadedFiles &gt;= fileLimit ){ $(this).attr('disabled', true) }else{ $(this).removeAttr('disabled') } //clear input field $(this).val('') }; $(".input-file").change(uploader) function removeFile(uploader){ $(this).remove() } $('.uploaded-file').live('click',removeFile) </code></pre> <p>I made a limit for how many files can be uploaded. Once the limit is reached, the input gets disable but, when a file is removed I want it to enable again if its under the limit. Im just not sure how to get the removeFile function to read the if statement from the uploader function.</p>
javascript jquery
[3, 5]
1,102,531
1,102,532
Binding javascript to new rows
<p>I have a simple table which has a some information displayed. To view the details of that row i have a javascript function:</p> <pre><code>$('#production tr').bind("click", function(){ reviewProductionOrder(this); }); </code></pre> <p>This lets me select the row and display information appropriately. However i have a date picker on top which filters the results accordingly</p> <pre><code>$('#view').bind("click", function(){ var from_date = $('#from_date').val(); var to_date = $('#to_date').val(); $.ajax({ type : "post", url : "data.php", data : "from_date=" + from_date + "&amp;to_date=" + to_date, success : function(data) { if(data != '') $('#production tbody').html(data); } }); }); </code></pre> <p>The function above lets me add the data to the table. Now i thought that <code>bind</code> would let me bind the javascript function to the newly generated rows. However when i click on those rows, i am unable to do so.</p>
javascript jquery
[3, 5]
1,060,874
1,060,875
How to add opacity to a div?
<p>I am trying to add opacity to a div.</p> <p>Here is my Jquery:</p> <pre><code>$('.redDiv').fadeIn(0, 0.5); </code></pre> <p>My HTML:</p> <pre><code>&lt;div class="redDiv" style="background:red;width:20px;height:20px;"&gt; &lt;/div&gt; &lt;div class="divBlue;" style="background:blue;width:20px;height:20px;"&gt; &lt;/div&gt; &lt;div class="divBlack;" style="background:black;width:20px;height:20px;"&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,637,467
4,637,468
jquery search each table row for a particular td
<p>Consider there's a table with rows to which a <code>td</code> with class <code>x</code> is added by jqeury on the fly (during DOM manipulation). Later when the user sumbit's this table (table being part of a form), i want to search all the rows for existence of this particular <code>td</code>. If this <code>td</code> is found then the function should return false, else true. However this piece of code does not work, any suggestions?</p> <pre><code>function validate(){ $('form#newuser table tr').each(function(){ if($(this).find('td.x')){ return false; } }); return true; } </code></pre>
javascript jquery
[3, 5]
4,900,791
4,900,792
DetailsView when DECODE data
<p>Hi I have a DetailsView control that should display data from a DataBase. This data it is Encoded.</p> <p>Which is the best way to DECODE this data before visualize the result in the DetailsView.</p> <p>DataBound event handler? DataBinging Event Handler?</p> <p>Could you give me an example of code. </p> <p>Thanks for your time</p>
c# asp.net
[0, 9]
4,649,446
4,649,447
jquery attribute selector problem: Dynamic attribute selector
<p>My code is here</p> <pre><code>$("a[href=$.jqURL.url()]").hide(); </code></pre> <p><code>$.jqURL.url()</code> return current page url. </p> <p>But this code don't work</p> <p>Is it possible to select dynamically?</p>
javascript jquery
[3, 5]
2,996,562
2,996,563
php javascript form validation for upload file <input>
<p>want to get a validation script to validate the file upload box onsubmit.</p> <p>check the extension of the file and validate accordingly to the extension of file loaded</p>
php javascript
[2, 3]
3,710,067
3,710,068
How to Move up and down in ASP.NET Gridview Using Arrow Keys
<p>I Have A Grid view control in that grid view controls ItemTemplate i have taken textboxes now i want to do is that on pressing down arrow key the cursor which is in first textbox of first row will go to the first textbox of second row</p> <p>This is the Grid view which i want to do the up down </p>
javascript asp.net
[3, 9]
5,792,541
5,792,542
Is there a way to randomly apply css properties from a list to a bunch of elements?
<p>More exactly could i apply to my 20 divs, 10 background-images that i have, so there are two elements with same background?<br> I want to reproduce a game and i didn't start beacause i don't know if it's possible. I have 20 cards faced upside down. When i click one they flip and show their image. But they are in pairs. So when you clicked the second and their image don't match they flip back. So you have to keep their position in mind until you match them all. If, you fliped first and the second you fliped have the same background-image, they remain with face up. But for now i want just to know if that manner of applying css it's possible. The ideea is to have background-images at different positions at every reload.</p>
javascript jquery
[3, 5]
3,753,533
3,753,534
how to read twice a file using fileupload
<p>I am trying to read the same file twice.</p> <p>I have been using a <code>FileUpload</code> to look up the file. I was successful in the first read where I find out how many lines the file have, using the next code in C# ans asp.net:</p> <pre><code>Stream data_file; data_file=FileUpload1.PostedFile.InputStream; string line; int elements; StreamReader sr = new StreamReader(data_file); line = sr.ReadLine(); while (line != null) { elements = elements + 1; line = sr.ReadLine(); } sr.Close(); </code></pre> <p>With this number I can now create an array of array by setting fist how many elements the array is going to hold. The array this time is going to hold the number from the file something like this:</p> <p>datafile:</p> <p>1,1</p> <p>2,3</p> <p>arrayL[0][0]=1</p> <p>arrayL[0][1]=1</p> <p>arrayL[1][0]=2</p> <p>arrayL[1][0]=3</p> <p>so the code to do this is the next:</p> <pre><code>double [][] dime= new double [elements][]; string[] div; string line2; int nn=0; StreamReader ssr = new StreamReader(data_file); line2 = ssr.ReadLine(); while (line2 != null) { dimen[nn] = new double[2]; for (int m2 = 0; m2 &lt; 2; m2++) { div=line2.Split(new Char[] { ' ', ',', '\t' }); dimenc[nn][m2] = Convert.ToDouble(div[m2]); } nn=nn+1; line2 = ssr.ReadLine(); } ssr.Close(); </code></pre> <p>However, the array says that it is empty but I know if I used the second part of the code in a complete diferrent method/ second button but if it is in the same method it does not work so my question is: </p> <p>What's wrong? Why the second streamreader is not working?</p>
c# asp.net
[0, 9]
522,027
522,028
Java -> Python?
<p>Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?</p>
java python
[1, 7]
1,037,304
1,037,305
Need to loop through two loops and use delayed iterations in the inner loop
<p>What I'm trying to do is build a way to loop through two <code>for</code> loops, but the inner loop needs to have a delay on each iteration, but it can't be a queued animation. </p> <p>The way I'd like for this to work is, on start it would trigger each of the elements at an interval but not wait for their animations to finish. Then it goes to the next row of items (first loop iterating) and starts that row before all items are faded out in the previous row.</p> <pre><code> var colLeng = Layout.columns, elemLeng, columnElements; // get number of columns for (var i = 0; i &lt; colLeng; i++) { columnElements = $('.prvwImg[data-col="' + i + '"]'); elemLeng = columnElements.length; for (var t = 0; t &lt; elemLeng; t++) { columnElements.eq(t).delay(500 * t).fadeOut(400); //columnElements.eq(t).delay(500 * t).stop().fadeOut(400); } } </code></pre> <p>Edit: With this code it loops through fine, but the delay doesn't actually work so they fade out all at the same time.</p>
javascript jquery
[3, 5]
5,669,656
5,669,657
JQuery Detecting Hover on Flash Object
<p>I am having problem with the following JQuery code:</p> <pre><code>$("object").hover(function(e){ alert('Flash Here'); }); </code></pre> <p>I just want jquery to detect if I hover on top of the flash object.</p> <p>Here is the flash embed code:</p> <pre><code>&lt;object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="320" height="240" quality="HIGH"&gt;&lt;param name="movie" value="test.swf"&gt;&lt;param name="quality" value="high"&gt; &lt;embed src="rdream.swf" quality="high" width="320" height="240" name="Test" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"&gt; &lt;/object&gt; </code></pre> <p>I'm not getting the alert as expected.</p>
javascript jquery
[3, 5]
1,751,523
1,751,524
Why is my PHP variable not changing when my Javascript code runs?
<p>I have a counter timer and I tried to block a simple bypass to download without waiting.</p> <p>so in main class I declared the boolean</p> <pre><code>$allow_download = false; </code></pre> <p>and in <strong>Javascript</strong> when the time is elapsed </p> <pre><code>else { textDLShow.style.display = 'none'; divDLShow.style.display = ''; "&lt;?php $allow_download = true;?&gt;"; } </code></pre> <p>and in the second class </p> <pre><code>if($allow_download == false) echo "Test"; </code></pre> <p>well, when time is elapsed the boolean is not set with positive value. Any suggestions ??</p> <p>Thanks for your time !!</p>
php javascript
[2, 3]
6,028,300
6,028,301
ListView exception for Images + Text
<p>I am trying to create a simple Icon+Text ListView but it does not work. I am using 2.1 Android SDK.</p> <p>My main class is very small slightly modified from the tutorial:</p> <pre><code>public class Stuffs extends ListActivity { static final String[] COUNTRIES = new String[] {"A", "B","C"}; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.title, COUNTRIES)); } } </code></pre> <p>and my list_item.xml file is this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation = "horizontal"&gt; &lt;ImageView android:id = "@+id/icon" android:src="@drawable/icon" /&gt; &lt;TextView android:id = "@+id/title" android:padding="10dp" android:textSize="16sp" &gt; &lt;/TextView&gt; &lt;/LinearLayout&gt; </code></pre> <p>I have also created a "drawable" directory in my res directory and copied a "icon.png" into it.</p> <p>But any time I try to run this the application hangs up unexpected in my android emulator. Am I missing something?</p>
java android
[1, 4]
5,486,921
5,486,922
Image Zoom effect using Cloud Zoom jQuery plugin
<p>I am trying to apply cloud zoom on a single image as in the below Fiddle </p> <p><a href="http://jsfiddle.net/7HDbz/" rel="nofollow">http://jsfiddle.net/7HDbz/</a></p> <p>But it does not seems to be working. Someone have a look at this. Here is another fiddle with working effects </p> <p><a href="http://jsfiddle.net/tuHuZ/1/" rel="nofollow">http://jsfiddle.net/tuHuZ/1/</a></p> <p>The original plugin usage is here.... <a href="http://www.professorcloud.com/mainsite/cloud-zoom.htm" rel="nofollow">http://www.professorcloud.com/mainsite/cloud-zoom.htm</a></p>
javascript jquery
[3, 5]
1,922,979
1,922,980
Intercept Sent text messages android
<p>I'm creating a Text Encryption app, but I don't want to make a whole new text app, I just want it to handle the encryption/decryption. So I was wondering, is there a way I can somehow intercept text messages sent from an app, encrypt it, and then send it?</p> <p>I know I can get the received messages, that's the easy part. But does anybody have any ideas how to get the sent messages BEFORE they are sent?</p> <p>Thanks for any help!</p>
java android
[1, 4]
1,642,859
1,642,860
Get all values of array elements
<p>I have an array with HTML elements from a selector. Looks like this:</p> <pre><code>var selection = $('.features_items'); // selection = [div.features_item, div.features_item]; </code></pre> <p>The div looks like this:</p> <pre><code>&lt;div class="features_item selected" value="2"&gt; </code></pre> <p>Now I want to get all values from the div's in the array: [2,3]</p>
javascript jquery
[3, 5]
2,118,306
2,118,307
Converting a javascript function to pass in an object
<p>I have this javascript which is working great - </p> <pre><code>var employeename = $("#employeename"); var employeenameInfo = $("#employeenameInfo"); employeename.blur(validateEmployeename); function validateEmployeename(){ //if it's NOT valid if(employeename.val().length &lt; 4){ employeename.addClass("error"); employeenameInfo.text("We want names with more than 3 letters!"); employeenameInfo.addClass("error"); return false; } //if it's valid else{ employeename.removeClass("error"); employeenameInfo.text("Full Name."); employeenameInfo.removeClass("error"); return true; } } </code></pre> <p>However instead of having a big list of this functions for all my different fields I want to pass a field in e.g.</p> <pre><code>function validateGeneric(field){ </code></pre> <p>However whatever I try just gives me errors and I'm really stuck. Any help appreciated. This also brings up another problem with the info field, any way I can store the orginal text and just restore that instead of a new string?</p>
javascript jquery
[3, 5]
215,493
215,494
jQuery calculation inside loop
<p>How can i make a loop and add some values for the next iteration together like these in jQuery ?</p> <pre><code>var currLength = length; for (var i = 1; i &lt; dotCount -1; i++) { $("#myElement" + i).css("width", currLength); currLength += length + margin; } </code></pre> <p><strong>Edit: These is just an example. I just wanted to know how to use the .each function of jQuery because i had some different idea of usage. I doesn't make any difference in relation to a for loop</strong></p>
javascript jquery
[3, 5]
5,105,398
5,105,399
how to create a dynamic variable in android
<p>I am creating a card game (blackJack) in android. the first two cards are easy card1 and card2, however i want to press a Hit me button and deal a new card and assign it to card3, card4 etc is there any way to do this without essentially creating the maximum number of variables you would need and using if then statements to check if they have been assigned a value or not?</p>
java android
[1, 4]
3,995,801
3,995,802
Handling double quotes in mailto:
<p>I am working on Visual Studio 2008 and ASP.net.. I want to preview email that is created in the web page. I have problems in handling double quotes in the email body. </p> <pre><code>string emailbody = "\"some text\""; btPreviewEmail.OnClientClick = "javascript:location.href='mailto:?subject=Chalk Pushcast Software Order Agreement&amp;body=" + emailbody + "';"; </code></pre> <p>I have left the recipient's field blank because I just have to preview the email. </p> <p>At runtime, I get a Microsoft Outlook error like, "The command line argument is not valid. Verify the switch you are using"</p>
javascript asp.net
[3, 9]
4,480,737
4,480,738
jQuery accordion header
<p>I want to add some toolbar icons in header of accordion but when i add onclick event handler is in header also nad its toggling accordion. How can i define toggle accordion only for part of header. Header property does not help because then it minimizes the width of accordion depending of the header width ?</p>
javascript jquery
[3, 5]
3,434,201
3,434,202
C# DateTime.Ticks equivalent in Java
<p>What is the Java equivalent of DateTime.Ticks in C#?</p> <pre><code>DateTime dt = new DateTime(2010, 9, 14, 0, 0, 0); Console.WriteLine("Ticks: {0}", dt.Ticks); </code></pre> <p>What will be the equivalent of above mentioned code in Java?</p>
c# java
[0, 1]
3,610,569
3,610,570
retrieve window.location.hash url in php
<p>I am using a jquery tabbed interface here <a href="http://www.imashdigital.com/#2" rel="nofollow">http://www.imashdigital.com/#2</a> and would like to return the tab number in php.</p> <p>Ideally I would like to run a javascript function (on a timer) that continually updates a global <strong>php variable</strong> with the current tab.</p> <p>Based on this php value, 1 through to 4, I will then load a different sidebar.</p> <p>I would be grateful for any help and some code examples as I am a novice.</p> <p>Kind regards</p> <p>Jonathan</p>
php javascript jquery
[2, 3, 5]