Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
4,050,921
4,050,922
Opening a specific node in an asp.net tree view dynamically
<p>Can any one help to expand a particular node according the value passed from a previous page..i.e:</p> <p>Page1: Value to pass : hyp1</p> <p>Page 2: Tree View--> if (val == hyp1) then</p> <p>SubNode in a node2 should open....</p> <p>Can any one help me in doin this using C# in asp.net?</p>
c# asp.net
[0, 9]
1,110,078
1,110,079
How can I create a file upload progress bar with PHP and jQuery?
<p>How can I create a file upload progress bar with PHP and jQuery? Please don't refer me to Flash stuff like Uploadify. I want to create my own.</p>
php jquery
[2, 5]
2,388,993
2,388,994
Simple javascript method issue
<p>I am trying to understand the different between the following codes..</p> <pre><code>Select.prototype.create = function(){ codes1...... } Search.prototype.create = function(){ codes2...... } </code></pre> <p>They both have different codes but the same method. I am not sure why and how it works. Can anyone helps me about it? Thanks alot.</p>
javascript jquery
[3, 5]
1,979,407
1,979,408
JQuery: How do I determine if a slideToggle has been toggled?
<p>How do I do the following pseudo code in JQuery?</p> <pre><code>$(document).ready(function(){ $(".btn-slide").click(function(){ $("#divToSlide").slideToggle("fast"); if ($(this).isToggled) { // &lt;---- DOESN'T WORK ------- // do something when toggled } else { // do something different when not toggled } }); }); </code></pre>
javascript jquery
[3, 5]
5,534,726
5,534,727
How to safely check for a attribute value with Jquery?
<p>If a clicked link has target="_blank" set as an attribute, I want to call window.open, otherwise I set a iframe to load the page.</p> <p>How do I check the attr and make sure it doesn't crash if the value is null etc.</p> <p>I have this so far:</p> <pre><code>if ($(that).attr("target") == "_blank") { window.open(linkHref, "_blank"); } else { document.getElementById(someFrame).src = linkHref; } </code></pre> <p>I am scared that if <code>$(that).attr("target")</code> is not set, or is empty, it will crash.</p>
javascript jquery
[3, 5]
3,495,259
3,495,260
Getting time in Germany - Android
<p>How can I get the current time in Germany regardless of the location of the user and current device time?</p> <pre><code> Calendar buttoncal = Calendar.getInstance(); String tdate = new SimpleDateFormat("dd.MM",Locale.GERMANY).format(buttoncal.getTime()); String tday = new SimpleDateFormat("EEEE",Locale.GERMANY).format(buttoncal.getTime()); one_date.setText(tdate.toString()); one_day.setText(tday); </code></pre>
java android
[1, 4]
3,933,375
3,933,376
Javascript Lazyload queue
<p>I am using jQuery LazyLoad plugin in my project to display large column of small pictures. The plugin helps really much, the only issue is that on page load it makes page/scrolling/.. so slow as it loads all the initial (visible) images (around 60 images of size 40x40) at once.</p> <p>It would be amazing if it loaded one after another with a time gap between loads, for example 800ms, because I don't really need them to appear straight away. I believe that would make user experience more comfortable.</p> <p>Unfortunately I am not too good with Javascript. I tried to use jQuery delay function, but it did not help. I would really appreciate any help.</p> <p>Related code:</p> <pre><code> $(self).one("appear", function() { if (!this.loaded) { $("&lt;img /&gt;") .bind("load", function() { $(self) .hide() .attr("src", $(self).attr("data-original")) [settings.effect](settings.effectspeed); self.loaded = true; }) .attr("src", $(self).attr("data-original")); }; }); </code></pre>
javascript jquery
[3, 5]
1,499,182
1,499,183
Designing a "pop-out" interface that automatically updates - even possible?
<p>So I developed this web application, which has several multiple select boxes on an admin page - each of these boxes contains multiple values, which we will call criteria.</p> <p>The criteria in these boxes are generated on a form on another page and stored separately in another table in the database. The big problem is that my boss wants to have a new criteria editing page pop out in a new window, or a different tab of the same browser, allow the user to add one or multiple criteria, and have these update in the main admin browser window in real-time.</p> <p>Now, if it was in the same window, my immediate thoughts would go to AJAX. However, because it will be in two separate browser windows, I don't believe this is a feasible solution.</p> <p>Is there anyway (other than some form of COM programming or other OS-y methods, which I don't want to get into) to pass a value between the two browser windows, without having to reload the main page? That is a critical issue here - the main page cannot be reloaded at all during this process.</p> <p>Would frames be the answer (thus getting rid of the dual browser window problem by not having two windows)? Something else? This is beyond my range of experience.</p>
php javascript
[2, 3]
2,100,059
2,100,060
Not violating "compareTo" contract in a changing list
<p>This is kind of a general java question and doesn't relate too much to Android.</p> <p>In my application I have a list of some objects of a medium complex class which implements <code>Comparable</code>. The <code>compareTo()</code> method's result depends on some of the fields. The method is consistent and doesn't violate the comparison contract, when the elements aren't modified during the comparison.</p> <p>Now to the problem. The list must be sorted once in a while. But simultaneously, some items may be updated by a background task, which means that the result of <code>compareTo()</code> changes. That's where the contract may be violated.</p> <p>I understand, that the easiest answer would be, not to update the list during the sorting at all. But it's a mobile application. It has to be responsive and the user may refresh the list whenever he wants.</p> <p>What would be an elegant approach to this problem? Using synchronizing or some kind of lock?</p> <p>Thanks in advance.</p>
java android
[1, 4]
1,556,800
1,556,801
Jquery and Java Script does not work an all pages
<p>My java script and jquery doesn't work on all of my pages. It works on the home page <a href="http://www.steadfastdesignfirm.com/rgw" rel="nofollow">http://www.steadfastdesignfirm.com/rgw</a> but not when I go to any other page like <a href="http://www.steadfastdesignfirm.com/rgw/#index.php" rel="nofollow">http://www.steadfastdesignfirm.com/rgw/#index.php</a> etc.</p> <p>I have a javascript function that loads content from another page into a div dynamically (the div is #ajax) and only the scripts run on items within that div are not working. For example, you'll see the text resize tool when you visit the main page and it works just fine, but when you click on another main tab, it's completely disabled. I think the ajax is causing the elements to become disabled because they only load on document.ready. What other approach can I take to keep these scripts working? </p>
javascript jquery
[3, 5]
1,740,339
1,740,340
Are there any Android development video tutorials?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4904560/where-can-i-find-android-video-tutorials">Where can I find Android video tutorials?</a> </p> </blockquote> <p>Are there any places that have Android development tutorials similar to the iPhone Stanford videos?</p>
iphone android
[8, 4]
1,924,732
1,924,733
Adding PostBackTrigger and AsyncPostBackTriggers to UpdatePanel for dynamically generated checkboxes with checkedChanged EventHandler
<p>For more clear explanation here's my code on <code>.asp</code> file:</p> <pre><code>&lt;asp:UpdatePanel ID="updPnlTabs" runat="server" &gt; &lt;Triggers&gt; &lt;asp:PostBackTrigger ControlID="btnSave" /&gt; &lt;/Triggers&gt; &lt;ContentTemplate&gt; &lt;asp:Panel ID="pnlCheckList" runat="server" style="margin-bottom: 10px;" CssClass="listingDummyTab"&gt; &lt;/asp:Panel&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>On my <code>.cs</code> code, I dynamically created checkeboxes to the pnlCheckList like this:</p> <pre><code> CheckBox chkModuleID = new CheckBox(); chkModuleID.ID = drNew[def.ID].ToString(); chkModuleID.AutoPostBack = true; chkModuleID.CheckedChanged += new EventHandler(chkID_OnRow_Check); pnlCheckList.Controls.Add(chkModuleID); </code></pre> <p>Now my problem here is when I change the check boxes the whole page have to load instead of the content of the <code>UpdatePanel</code>. Note that the EventHandler for the dynamically created checkboxes is firing but not inside the UpdatePanel.</p> <p>How can I add the <code>ID</code>'s of the dynamically created <code>Controls</code> in <code>&lt;Triggers&gt;</code> of the <code>UpdatePanel</code>?</p>
c# asp.net
[0, 9]
2,560,542
2,560,543
ASP.Net masterpage Response.Redirect before child call
<p>I have a masterpage and inside that masterpage I have to check if a session is null or not. If the session is null, then there has to be a redirect to a login page.</p> <p>That is no problem, but the problem is that the masterpage also have controls using the session and the child also uses the session so I get a nullreferenceexception.</p> <p>I now have this:</p> <pre><code>protected void Page_init(object sender, EventArgs e) { var session = (ServiceSession)Session["serviceSession"]; if (session == null) { Response.Redirect("login.aspx", false); } } </code></pre> <p>But the problem is that the controls on the masterpage are also called instead of redirecting immediatly.</p> <p>So the main question:</p> <p>How can I redirect immediatly, without loading further things. Because the page_init gets called as first method the redirect should solve my nullreferenceexception, but than I don't need to load all components etc.</p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
4,744,920
4,744,921
which solution will be faster on Android?
<p>Which solution will be faster on Android 2.1?</p> <p>1.</p> <pre><code>public void foo(String a, String b) { String msg = a + ": " + b; print(msg); } </code></pre> <p>2.</p> <pre><code>public void foo(String a, String b) { StringBuilder sb = new StringBuilder(a.length() + b.length() + 2); sb.append(a); sb.append(": "); sb.append(b); print(sb.toString()); } </code></pre> <p>Is android use internally StringBuilder for first solution?</p>
java android
[1, 4]
1,040,354
1,040,355
Is there a more efficient way to write this function?
<pre><code>function month(num) { if (num == 1) { return "January"; } else if (num == 2) { return "Feburary"; } else if (num == 3) { return "March"; } else if (num == 4) { return "April"; } else if (num == 5) { return "May"; } else if (num == 6) { return "June"; } else if (num == 7) { return "July"; } else if (num == 8) { return "August"; } else if (num == 9) { return "September"; } else if (num == 10) { return "October"; } else if (num == 11) { return "November"; } else if (num == 12) { return "December"; } else { return false; } } </code></pre> <p>jQuery/Javascript.</p>
javascript jquery
[3, 5]
5,839,042
5,839,043
How do I hide the ScrollView scrollbar faster than the default?
<p>How do I change the delay before the scrollbar on a ScrollView is hidden? I want it to hide instantly after scrolling. I tried android:scrollbarDefaultDelayBeforeFade="0" but it still sticks around and i have to either wait for it to disappear or click twice to click a button inside the ScrollView.</p>
java android
[1, 4]
98,617
98,618
This JavaScript Works Alone, But Not With Other JavaScript
<p>I got this code from my programmer (outsourcing) :</p> <pre><code>&lt;script type="text/javascript"&gt; $(function(){ $('#notif-icons &gt; li &gt; a, #top-menu &gt; li &gt; a').click(function() { var clicked = $(this).next('.popup-notif'); $('.popup-notif').not(clicked).fadeOut('fast'); clicked.slideToggle('fast'); }).toggle(function(){ $(document).click(function() { $('.popup-notif').fadeOut('fast'); }); $('.popup-notif').click(function(e) { e.stopPropagation(); }); }, function() { }); }); &lt;/script&gt; </code></pre> <p>that code works alone in plain HTML, but when I put into my codes, it won't work anymore and I think there's something wrong with that code. for example :</p> <pre><code>}, function() { }); }); &lt;/script&gt; </code></pre> <p>I have no idea what that empty function() used for... could you guys please help me. because I'm not expert in JavaScript things... thanks!</p> <p>**Update : this code used to display notifications. once "notif-icons" clicked, ".popup-notif" shows up and vice versa.</p>
javascript jquery
[3, 5]
547,198
547,199
jQuery: fadeout an image when clicking an ASP.NET ImageButton
<p>I'm building a photo gallery in ASP.NET. The user can browse thumbnails along the left and select one, which brings a preview-sized version into the right pane of the page.</p> <p>I'd like to fade between the images, so that the current one fades out and the next one fades in. I'm using jQuery to fade the preview image in after it is loaded, which works great. Unfortunately, I can't get the <code>fadeOut</code> script to run before the click event posts the page back to the server. The thumbnails are ASP.NET ImageButtons, which means they're <code>&lt;input&gt;</code> tags. </p> <p>Is there a way to get the postback to delay just long enough for the image to fade out? I've seen some tricks with the form onSubmit and <code>setTimeout()</code> but that would affect all the links and buttons on the page. I want to delay postback for the thumbnails only.</p> <p>TIA</p> <p><strong>EDIT</strong>: Based on my research, and trying the suggestions below, it <em>may</em> be possible to delay the postback to accomplish this but it's not the best approach on several levels. To get a clean fade transition between images, in the future I would not do any posting back at all. I would use jQuery exclusively for the fadeout, load, fadein.</p>
asp.net jquery
[9, 5]
928,367
928,368
Why isn't my ListView updating when I call notifyDataSetChanged()?
<p>I'm close to finishing my first Android app, but I'm fighting with an odd bug when I delete items from the SQLite DB that feeds a ListView in my app. The item gets deleted, and if I switch away from the ListView and back, it updates, but until I do that, the list doesn't update.</p> <p>I've posted most of the class in question here: <a href="https://gist.github.com/2025973" rel="nofollow">https://gist.github.com/2025973</a>, but here's the relevant callback starting at line 56 in the file:</p> <pre><code>builder.setPositiveButton(R.string.button_delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { databaseConnector.deleteSimpleDie(arg3); storedDiceAdapter.notifyDataSetChanged(); } }); </code></pre> <p>What am I doing wrong here? I'm sure it's something simple. I originally had the delete in an Async, but then I couldn't call the notifyDataSetChanged() at all, because it has to happen from the thread that created the Cursor.</p> <p><strong>UPDATE</strong></p> <p>Okay, this is pretty ghetto ( I think... ) but I've got it working, finally. Someone want to tell me how horribly wrong this is? Basically, I'm just re-instantiating the whole CursorAdapter inside the callback. It solves the problem, but I suspect it has some negative side effects I'm not aware of.</p> <pre><code>builder.setPositiveButton(R.string.button_delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { databaseConnector.deleteSimpleDie(arg3); String[] from = new String[] { "name", "description" }; int[] to = new int[] { R.id.dice_name, R.id.dice_description }; storedDiceAdapter = new SimpleCursorAdapter(StoredDice.this, R.layout.stored_dice_item, null, from, to); setListAdapter(storedDiceAdapter); } }); </code></pre>
java android
[1, 4]
1,842,799
1,842,800
how to randomly change the color of every pixel on the screen
<p>I want each pixel on the screen to flash between red, blue, green, white, and black but independently of each other. Is this possible? I have been searching everywhere with out any luck. Any help on where to start would be greatly appreciated.</p>
java android
[1, 4]
5,216,813
5,216,814
simple jQuery - I can't figure out why this isn't working
<p>I am trying to do 2 things: 1: append a div to the body 2: make all clicks to links class 'editlink' make a popup and not go to their href</p> <p>Doing just #2 is fine:</p> <pre><code>$(document).ready(function(){ // $(body).append("&lt;div&gt;Hello world&lt;/div&gt;"); $("a.editlink").click(function(event){ alert("Javascript-endabled users should see this"); event.preventDefault(); }); }); </code></pre> <p>but if i uncomment the part 1 thing such:</p> <pre><code>$(document).ready(function(){ $(body).append("&lt;div&gt;Hello world&lt;/div&gt;"); $("a.editlink").click(function(event){ alert("Javascript-endabled users should see this"); event.preventDefault(); }); }); </code></pre> <p>The div appears as expected but clicking editlink links no longer gives me a popup and navigates to the link's href.</p> <p>what's going on?</p>
javascript jquery
[3, 5]
1,892,214
1,892,215
jQuery: Set click from array loop
<p>I have a series of divs in a pattern of header/body, where a click on the header will show the body in question.</p> <p>This all happens with .click initialized on page ready...</p> <p>Rather than doing this (which works fine, but is a pain):</p> <pre><code>$('#show_fold_ping').click(function(){ ShowArea('#fold_ping') }); $('#show_fold_http').click(function(){ ShowArea('#fold_http') }); $('#show_fold_smtp').click(function(){ ShowArea('#fold_smtp') }); $('#show_fold_pop3').click(function(){ ShowArea('#fold_pop3') }); ... </code></pre> <p>I am trying to do this:</p> <pre><code>var Areas = ['ping','http', 'smtp', 'pop3']; for( var i in Areas ){ Area = '#show_fold_'+Areas[i]; $(Area).click(function(){ alert(Area); /* ShowArea(Area); */ }); } </code></pre> <p>The problem I'm having is that ALL of them seem to be initialized to the last one. IE: If pop3 is the last one, a click on #show_fold_[any] will alert '#show_fold_pop3'.</p> <p>This seems like it should be really simple. Am I missing something obvious, or is there an issue with passing a string to jQuery that I don't know about?</p> <p><strong>Edit:</strong></p> <p>Hey, these are all great. I have read up a bit on closures and self-invoking functions, and (kindasorta) get it.</p> <p>So far, I have this, but the click doesn't seem to be binding correctly. Area will alert with the correct value, but no click bind. Am I still having scope issues with Area, or am I just totally off mark?</p> <pre><code>$(function(){ Areas = ['ping','http', 'smtp', 'pop3', 'imap', 'ftp', 'dns', 'tcp', 'database', 'seo']; for( var i = 0; i &lt; Areas.length; i++ ){ (function (Area) { alert(Area); $("#show_fold_"+Area).click(function(){ alert('x'); }); })(Areas[i]); } }); </code></pre>
javascript jquery
[3, 5]
2,273,258
2,273,259
Javascript cookies vs php cookies
<p>Is there a difference between javascript cookies and php cookies?</p>
php javascript
[2, 3]
3,327,725
3,327,726
Set maximum row height in generated excel document
<p>In my web application users can get excel report. The problem is : when one of the cells in row contains long text, so all row is grow, and excel report looks bad. I need to set maximum row height for all rows in my excel document.</p> <pre><code> public bool UseOldFormat { get; set; } public ExcelFile GetExcelFile() { var excel = new ExcelFile(); if (!string.IsNullOrEmpty(SourceFileName)) { if (SourceFileName.EndsWith("xls")) { excel.LoadXls(SourceFileName); } else { excel.LoadXlsx(SourceFileName, XlsxOptions.PreserveMakeCopy); } } return excel; } public void GenerateReport(string fileName) { ExcelFile excel = GetExcelFile(); InsertDataInExcel(excel); if (UseOldFormat) { excel.SaveXls(fileName); } else { excel.SaveXlsx(fileName); } } </code></pre> <p>Can't find in excel options this function. Can anybody help?</p>
c# asp.net
[0, 9]
5,307,647
5,307,648
what is the c# equivalent to javascript's unescape()?
<p>I am trying to analyze some javascript, and one line is </p> <pre><code>var x = unescape("%u4141%u4141 ......"); </code></pre> <p>with lots of characters in form "%uxxxx".</p> <p>I want to rewrite the javascript in c# but can't figure out the proper function to decode a string of characters like this. I've tried </p> <pre><code>HttpUtility.HTMLDecode("%u4141%u4141"); </code></pre> <p>but this did not change these characters at all. How can I accomplish this in c#?</p> <p>Thanks!</p>
c# javascript
[0, 3]
2,789,355
2,789,356
jQuery object cast to string
<p>Can help me please with a jquery object problem.</p> <p>The problem is the following, I have this code:</p> <pre><code>url = '&lt;a href="http://url.com"&gt;Name&lt;/a&gt;'; otherValue = "Other Value"; x = jQuery(url).text(otherValue); console.log(x); console.log(typeof(x)); </code></pre> <p>This return :</p> <pre><code>[&lt;a href=​"http:​/​/url.com"&gt;​Other Value​&lt;/a&gt;​] object </code></pre> <p>How I make for cast this object and finally get a string?</p> <p>Thank's</p>
javascript jquery
[3, 5]
2,992,287
2,992,288
PHP Javascript variable help
<p>Is there any way I could get the value of a html text field without using GET or POST or REQUEST? Alternatively, is there any way to get the field value in the same form or page else where.</p> <p>This works with direct value such as "james", "system" and so on. the only problem is how do i make it work with html field values</p> <p>Like:</p> <pre><code>&lt;input type = "submit" onclick = " &lt;?php $username = "kut"; $result = checkname($username); if($result) { ?&gt; alert("success"); &lt;?php } else {?&gt; alert("failed"); &lt;?php }?&gt; "&gt; </code></pre> <p>How can i replace "kut" with the value of a text field with id = "username" ?</p> <pre><code>&lt;?php $username = "?&gt;document.getElementById('username').value;&lt;?php"?&gt; </code></pre> <p>or something like that...???</p> <p>In short, I need to get the value of a html field else where in the same page inside a javascript function, using PHP... like in the above javascriptFunction(), function</p>
php javascript
[2, 3]
743,240
743,241
Javascript height issue
<p>I'm using javascript to add either the class vertical or horizontal to all image articles on a page. I'm having the problem that the code is working, but it's ALWAYS adding .horizontal to the article class, even photos that should have .vertical (posts that contain images larger than 450px high). Any help would be appreciated.</p> <pre><code>$('img.photo').each(function(){ if($(this).height() &gt; 450) { $(this).closest('article').addClass('vertical'); } else { $(this).closest('article').addClass('horizontal'); } }); </code></pre> <p>Example: <a href="http://blog.jamescharless.com/" rel="nofollow">http://blog.jamescharless.com/</a> The first photo of the boy is way more than 450px tall but it doesn't have the class of vertical, instead it has horizontal.</p>
javascript jquery
[3, 5]
5,627,931
5,627,932
Convert string to Date in java
<p>I'm trying to parse a string to a date field in an android application but I can't seem to get it correct. Here is the string I'm trying to convert to a date "03/26/2012 11:49:00 AM". The function I'm using is:</p> <pre><code>private Date ConvertToDate(String dateString){ SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aa"); Date convertedDate = new Date(); try { convertedDate = dateFormat.parse(dateString); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return convertedDate; } </code></pre> <p>But I keep getting 3/1/112 11:49AM as the result.. Any help I would really appreciate. thanks</p>
java android
[1, 4]
510,785
510,786
jquery not working in IE6
<p>I have developed a dropdown category and sub category menu in jquery. The script is working n Firefox, chrome but not in IE6. could you please guide me to fix this problem</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('#loader').hide(); $('#show_heading').hide(); $('#search_category_id').change(function() { $('#show_sub_categories').fadeOut(); $('#loader').show(); $.post("get_chid_categories.php", { parent_id: $('#search_category_id').val(), }, function(response) { setTimeout("finishAjax('show_sub_categories', '"+escape(response)+"')", 400); } ); return false; }); }); function finishAjax(id, response){ $('#loader').hide(); $('#show_heading').show(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } function alert_id() { if($('#sub_category_id').val() == '') alert('Please select a sub category.'); else alert($('#sub_category_id').val()); return false; } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,691,740
3,691,741
replicate jQuery touch even binding
<p>I am trying to remove dependency on jQuery from a project. Currently I have something like this...</p> <pre><code>$("#input").ontouchstart = myFunction; </code></pre> <p>Now I want to use vanilla js like this</p> <pre><code>somehowBind('touchstart', document.getElementById('input'), myFunction) </code></pre> <p>I don't mind the syntax, just want the same functionality.</p>
javascript jquery
[3, 5]
3,567,072
3,567,073
Jquery select value passing
<p>How do I get current value of an html select then pass it to another html select after a "click" event via jquery? </p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,976,334
4,976,335
Installing live wallpaper on Android phone deletes half the existing apps on the phone
<p>I've got a strange bug with my Live Wallpaper app. When I set it as the phone background, half the apps on my phone suddenly vanished. I cannot find them anywhere. How can I undo this?</p>
java android
[1, 4]
3,067,821
3,067,822
Dynamic div tiling layout
<p>I want to split the divs vertically or horizontally indefinitely. Is there a javascript library to handle a dynamic tiling layout? If not can anybody point out a good way to do it? I've been trying to do one myself but so far it has been a mess.</p>
javascript jquery
[3, 5]
72,958
72,959
how to get selected column value or name from datagrid in asp.net using c#
<p>My code is like this : Now I have now idea how to get column name of selected row </p> <pre><code>protected void gv_imageslist_RowUpdating(object sender, GridViewUpdateEventArgs e) { string status; string sts; int result; lblerror2.Text = ""; //((label)gv.Rows.FindControl("lbl1")).Text; string str = gv_imageslist.c if (str == "Status") { status = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_Status")).Text; Gm.Gallery_Id = Convert.ToInt32(gv_imageslist.DataKeys[e.RowIndex].Value.ToString()); if (status == "True") { Gm.Is_Active = false; } else { Gm.Is_Active = true; } result = Gm.Change_Image_Status(); if (result == 1) { Build_ImageGalleryList(); } else { lblerror2.Visible = true; lblerror2.Text = "Unable to Change Status !"; } } else //------For Checking of cover pic { sts = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_Cover")).Text; Gm.Gallery_Id = Convert.ToInt32(gv_imageslist.DataKeys[e.RowIndex].Value.ToString()); string sp = ((Label)gv_imageslist.Rows[e.RowIndex].FindControl("lbl_category_Id")).Text; Gm.Category_Id = Convert.ToInt32 (sp); if (sts == "False") { Gm.Is_Cover = true; } else { Gm.Is_Cover = false; } result = Gm.Change_Gallery_Cover(); if (result == 1) { Build_ImageGalleryList(); } else { lblerror2.Visible = true; lblerror2.Text = "Unable To Change Cover Pic !!"; } } } </code></pre>
c# asp.net
[0, 9]
1,693,173
1,693,174
using document.images.src property in javascript i want to get list of images source
<p>I am able to get it when hardcoding but throwing error while trying it with for loop.</p> <pre><code>for(i=0;i&lt;document.images.length;i++) { document.writeln(document.images[i].src); } </code></pre> <p>actually after printing first index value loop is terminating error:cannot read object property src....</p> <p>but below hardcoded one is working fine:</p> <pre><code>document.write(document.images[0].src); document.write(document.images[1].src); document.write(document.images[2].src); document.write(document.images[3].src); </code></pre>
javascript asp.net
[3, 9]
2,490,143
2,490,144
Javascript Date Validation
<p>How to validate particular format date string using Javascript? I have one date picker which has the display format like "dddd MMMM dd, yyyy"(displaying like this:"Wednesday February 03, 2010".) So i have to validate this format using javascript. Please help me for implementing this..</p>
asp.net javascript
[9, 3]
787,337
787,338
JQuery - Pass value of variable to index value of class
<p>I'm new to js and have only been learning for about a week so be kind. The script below alters the src of an iframe to match the custom data-attribute of the same iframe when a link with a class of .thumb is clicked. </p> <p>This works fine but its currently changing the iframe src of all classes of all iframes with a parent div class of .gallery. I just want to change the iframe src of the .gallery with the same index value as the variable 'clicked'.</p> <pre><code>//When an link with a class of .thumb is clicked $(document).on('click', '.thumb', function () { //variable index is the index of the links parent 'li' var clicked = $(this).parent('li').index(); // Find iFrames of all .comm-gallery elements and alter their src to iframes data-src value $('.gallery').find("iframe").prop("src", function(){ // Set their src attribute to the value of data-src return $(this).data("src"); }); }); </code></pre> <p>I've tried numerous loop solutions over the past few hours but none have worked and, as I know little about js at this point, I imagine that I am the lowest common denominator in this. Any help would be greatly appreciated!</p>
javascript jquery
[3, 5]
4,285,196
4,285,197
this.is(":checked") not working
<p>I'm using the following code to loop through all the checkboxes in my form. The boxes are gerenated dynamicaly from a php script so I won't know the names or the number of check boxes. </p> <p>I need to find out which checkboxes have been ticked so I only pass those ones to the php script that handles the form.</p> <pre><code> $("#panelform input:checkbox").each(function () { if(this.is(":checked")){ fields = fields+"&amp;"+this.name+"="+this.value; } }); </code></pre> <p>When the script gets to the this.is(":checked") it errors but being jquery my console doesn't show me any error messages just stops. </p> <p>if I alert or console.log "this" after the first line I get the form field so I know that that much works. </p>
javascript jquery
[3, 5]
3,874,920
3,874,921
Automatic redirection to start page-C# asp.net
<p>In gridview ,there is a templatefield which is imagebutton.i'm binding imageurl at runtime(on pageload) based on the document type.if i'm not binding the image,on next postback it loads the startup page.can somebody give the reason for this?</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,443,535
5,443,536
Extract dynamically created form data
<p>I've just started using jQuery. One thing I've been using it for is adding rows to a table that is part of a form.</p> <p>When I add a new row, I give all the form elements names like <code>'name_' + rowNumber</code>. I increment <code>rowNumber</code> each time I add a row.</p> <p>I also usually have a Remove Row Button. Even when a row is removed, the <code>rowNumber</code> count stays the same to keep from repeating element names.</p> <p>When the form is submitted, I set a hidden element to equal the <code>rowNumber</code> value from jQuery. Then in PHP, I count from 1 to the <code>rowNumber</code> value. Then for each value, I perform an <code>isset($_REQUEST['name'_ . index])</code>. This is how I extract the form elements that remained after deleting rows in jQuery.</p> <p>Does anyone here have a better technique for accounting for deleted rows?</p>
php jquery
[2, 5]
711,073
711,074
Settings Selector Dynamically in JQuery
<p>I have a table whose values are being generated dynamically with PHP, including the id and name attributes (e.g. id="question_".</p> <p>How can I set an element attribute with this in mind? For example, I have a div whose text will change after a successful ajax call, but the id is dynamic. </p> <p>I have tried making the following test function, and calling it on an onclick event:</p> <pre><code>function approve(question_id) { var div = 'suggestion_status_' + question_id; $('#div').html('test'); } </code></pre> <p>But that does not work. How can make the value of variable 'div' the selector?</p>
php jquery
[2, 5]
1,915,407
1,915,408
Get the number of weeks between two Dates.
<p>Im working in a project and I got two types in Date. I want to calculate the number of weeks between these two dates. The dates can be in diffrent years. Is there any good solution for this? </p> <p>I have tried to implemenent this with Joda-time which was suggested in other topics.. </p> <p>Im not familar with this library, but I tried to do something like this:</p> <pre><code>public static int getNumberOfWeeks(Date f, Date l){ Calendar c1 = Calendar.getInstance(); Calendar c2 = Calendar.getInstance(); c1.setTime(f); c2.setTime(l); DateTime start = new DateTime(c1.YEAR, c1.MONTH, c1.DAY_OF_MONTH, 0, 0, 0, 0); DateTime end = new DateTime(c2.YEAR, c2.MONTH, c2.DAY_OF_MONTH, 0, 0, 0, 0); Interval interval = new Interval(start, end); Period p = interval.toPeriod(); return p.getWeeks(); } </code></pre> <p>But this is completely wrong... any suggestions ? </p>
java android
[1, 4]
1,747,137
1,747,138
JQuery Dialog while PHP requesting
<p>I have this php files:</p> <p>index.php</p> <pre><code>echo '&lt;a href="./edit.php?id=1"&gt;Edit&lt;/a&gt;'; </code></pre> <p>and the edit.php</p> <pre><code>&lt;?php $id = $_REQUEST['id']; if ($icao != NULL) { header("Location: ./index.php?id=$id"); } ?&gt; </code></pre> <p>When I click in the Edit link PHP redirect you to index.php. How I can put a JQuery Dialog when the PHP request and redirect is doing? I know the code to do a JQuery Dialog but I don´t know where I need to put the dialog.</p>
php jquery
[2, 5]
4,995,243
4,995,244
How to add a Drawable to WebView
<p>Json</p> <pre><code> { "text": " «Le président du Bloc du Changement et de la Réforme", "imagepath": "http://www.example.com/dori%20chamoun-saidaonline.jpg" } </code></pre> <p>I get the text and fetch image from url as drawable </p> <pre><code> introtext = jArray.getString("introtext"); </code></pre> <p>and</p> <pre><code> InputStream is = bufferedHttpEntity.getContent(); Drawable image = Drawable.createFromStream(is, "src"); </code></pre> <p>My problem is, i want to display both the image and text in same WebView.</p> <p>any help?</p>
java android
[1, 4]
4,914,216
4,914,217
Javascript or jQuery: Download and redirect
<p>Currently some guys programmed this in a HTML page:</p> <pre><code>&lt;script&gt; location='http://example.com/downloadable.zip'; &lt;/script&gt; </code></pre> <p>They want to redirect the user to another page once the file has started downloading. I can only modify this page but not the destination page.</p> <p>What would be a good and clean javascript solution for making a user download the file and once he had accepted (or rejected) it, redirect him to another location? The solution may be jQuery code</p> <p>NOTE: The downloading and redirection must be done automatically when accessing the page</p>
javascript jquery
[3, 5]
1,882,357
1,882,358
Prevent interval being queued on multiple clicks
<p>I have created simple script with setInterval function and it is working fine on <b>first</b> button click, but if I click my button couple of times my interval is <b>queued up</b>! I have tried to solve this using <b>one</b> function with Jquery but then I cannot set my Intereval again. <br/>Is there a way to prevent this? Thank you!! <br/><a href="http://jsfiddle.net/K7pEG/" rel="nofollow">Fiddle example</a> <br/>My code:</p> <pre><code> var changeClass=function(){ if($('ul li.active').length==0){ $('ul li:first').addClass('active'); } else if($('.active').next().length==0){ $('.active').removeClass('active'); $('ul li:first').addClass('active'); } else{ $('.active').removeClass('active').next('li').addClass('active') } } $(document).ready(function() { var intervalID; $(".button").click(function(){ intervalID=setInterval(changeClass,1000); }); $(".clear").click(function(){ clearInterval(intervalID); }); }); </code></pre>
javascript jquery
[3, 5]
2,341,847
2,341,848
div tag to show on expand and hide on collapse usi ng xslt
<p>I have list of hyperlinks on a webpart and i would like to show a plus sign next to each link and when i click on it should expand and would like to show the description and when i click on the -ve sign it should collapse and description should be hidden. How can i acheive this using xslt. Plz privide me some suggestions. Let me know if something is not clear.</p> <p>Thanks</p>
javascript jquery
[3, 5]
860,008
860,009
Hacking RadioInfo.java to work
<p>I have been looking at the android source and developing some apps. However for my next app, I need information about the cell phone. Similar to what you see when you go into "Field Test" mode. However I have not been successful to get RadioInfo.java to work. Is there a way to hack RadioInfo.java so that I can use it in my app OR is there a way to get the data that is displayed in "Field Test" Mode. I have looked at the telephony api include the telephony.internal but so far they do not provide as much grained information as I would want. I have been asking around on the net but so far I can't find this information.</p>
java android
[1, 4]
5,858,467
5,858,468
Getting the a text from EditText (but a Number)
<p>I know that you can get a normal text like this:</p> <pre><code>EditText input = (EditText) findViewById(R.id.input); String value = input.getText().toString(); </code></pre> <p>but now I need a to an input like this: 0xFFFFFF (a Hex-Color), an Integer... But value is only a String and I don't know how to convert it... I'm using view.setBackgroundColor(color);</p> <p>Thanks a lot! </p>
java android
[1, 4]
2,994,859
2,994,860
Pre-processing Emulator for JavaScript ( Timing / Debug Example )
<p>In C++ you can omit compiling debug code by using pre-processing directives in order to keep your compiled code fast and not hindered by debug code not needed in production.</p> <p>Is there a correlative way to do this in JavaScript? What I have been doing in the past is commenting out debug code, but I want a cleaner way to do it.</p> <p>An example below shows 4 if statements that activate if debug is set to true. However in production I don't want this checked 4 times when I know it will be set to false. As I mentioned I could cram it into one line and comment it out...but I want a clean way to do it? </p> <pre><code>/** ** cType */ function cType( o_p ) { if( debug ) { var t1, t2, t3, t4, i1, i2, i3; t1 = new Date().getTime(); } o_p = MType[ o_p.model ].pre( o_p ); if ( o_p.result !== 'complete' ) { if( debug ) { t2 = new Date().getTime(); console.log( '---------------Send to Server - object_pipe: \n ' + o_p.toSource() ); } var string_pipe = JSON.stringify( o_p ); cMachine( 'pipe=' + string_pipe , function( string_pipe ) { if( debug ) { console.log( '---------------Receive from Server - object_pipe: \n ' + string_pipe ); t3 = new Date().getTime(); } MType[ o_p.model ].post( JSON.parse( string_pipe ) ); if( debug ) { t4 = new Date().getTime(); i1 = t2-t1 ; i2 = t3-t2 ; i3 = t4-t3; console.log( '---------------Pre, Transit, Post = ', i1, i2, i3 ); } } ); } } </code></pre>
javascript c++
[3, 6]
3,602,267
3,602,268
403 - Forbidden: Access is denied
<p>I have created a folder inside my asp.net solution named admin. I have created few pages inside it like categories.aspx, users.aspx. I uploaded code to my hosting and when i try to access it using:</p> <pre><code>www.mydomain/admin/ </code></pre> <p>I get:</p> <pre><code>403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. </code></pre> <p>I looks like that hosting is looking for default.aspx inside this folder. How can I make users.aspx as default page for this folder ?</p> <p>Please suggest.</p>
c# asp.net
[0, 9]
291,383
291,384
Set value of a dropdown in ANOTHER webpage
<p>I have two web pages open. How can I change the value of a dropdown in PAGE 2 from within PAGE 1? </p> <p>I have searched and searched. Any help will be much appreciated.</p>
javascript jquery
[3, 5]
3,526,177
3,526,178
jQuery: add and remove contents to another div
<p>Is there any jQuery &amp; PHP tutorial available which is having functionalities like:</p> <ol> <li>Add or remove contents from one tab to another.</li> <li>Save those in sessions.</li> </ol> <p>Please have a look at <a href="http://myfav.es/settings/sites/#/all-sites/" rel="nofollow">this website</a>.</p> <p>Looking for the same functionalities.</p>
php jquery
[2, 5]
2,478,056
2,478,057
how to receive data from server to android
<p>I am trying to make an Android application about cars tracking using GPS.</p> <p>Like this "the system is having GPS and send a data (Longitude and Latitude) to Web Server GPS, and then Web Server will send it (Latitude and Longitude) to client (android)"</p> <p>My question is how the client (android) to receive packet data from server that include (longitude and latitude) to display position car in google maps (android).</p>
java android
[1, 4]
5,732,610
5,732,611
executing a c# function after each 24 hours
<p>I have a c# function for producing thumbnail images, these images are displayed on web-page i.e ASP.net So how would i programtically call this back-end function let say everyday at 16:00 or at 3:00.</p>
c# asp.net
[0, 9]
3,421,096
3,421,097
how to open a file on android
<p>I am new to android and programming. I am using the android touchpaint api, and using the following code to save a drawing, but obviously saving is useless without being able to open the file.</p> <p>I was wondering if anyone could help me with some code for it.</p> <pre><code> // Function saves image to file public String save(Bitmap mBitmap, boolean showMsg) { String filename; Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); filename = sdf.format(date); try { String path = Environment.getExternalStorageDirectory().toString() + "/modTouchPaint/"; File file1 = new File(path); file1.mkdirs(); OutputStream fOut = null; File file = new File(path, filename + ".jpg"); fOut = new FileOutputStream(file); mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut); fOut.flush(); fOut.close(); if (showMsg) Toast.makeText(this, "Picture saved to " + path + filename + ".jpg", 9000).show(); return path + filename + ".jpg"; } catch (Exception e) { e.printStackTrace(); Toast.makeText(this, "Please make sure that SD card is installed", 5000).show(); return null; } } </code></pre>
java android
[1, 4]
6,029,552
6,029,553
Drag from the ListView and Drop on to the Button
<p>I would like to know if its possible to drag an item from the ListView and drop onto the Button. After dropping onto the button the text on the button will be changed.</p> <p>Is it possible to drop an item onto the Button?</p>
java android
[1, 4]
986,316
986,317
seperate validation of two forms with jquery
<p>I have two forms in one page and i would like to validate each form seperatly DEPENDING on what the user fills. So basically the user must fill only ONE form and NOT both of them...SO basically if the user fills up form number 1, the validation will be on form 1 ONLY..</p> <p>Below please find the code of both forms:</p> <pre><code> &lt;form action="/registration.flow" method="post" id="formElem1" name="formElem1" autocomplete='off'&gt; &lt;label for="Name_First"&gt;First Name:&lt;/label&gt; &lt;input type="text" name="Name_First" id="Name_First" value="" class="required" maxlength="128" /&gt; &lt;label for="Name_Last"&gt;Last Name:&lt;/label&gt; &lt;input type="text" name="Name_Last" id="Name_Last" value="" class="required" maxlength="128" /&gt; &lt;button id="registerButton" type="submit"&gt;Register&lt;/button&gt; &lt;/form&gt; &lt;form action="/registration.flow" method="post" id="formElem2" name="formElem2" autocomplete='off'&gt; &lt;label for="Name_First"&gt;First Name:&lt;/label&gt; &lt;input type="text" name="Name_First" id="Name_First" value="" class="required" maxlength="128" /&gt; &lt;label for="Name_Last"&gt;Last Name:&lt;/label&gt; &lt;input type="text" name="Name_Last" id="Name_Last" value="" class="required" maxlength="128" /&gt; &lt;button id="registerButton" type="submit"&gt;Register&lt;/button&gt; &lt;/form&gt; </code></pre> <p>Can someone help me please?? THANKS</p>
javascript jquery
[3, 5]
4,978,157
4,978,158
how to get checked chekbox while update from gridview
<p>in my project i use chekbox list...but while m get update from gridview i can't get chek chekbox...can any one help me</p> <pre><code> SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ims"].ConnectionString); Conn.Open(); DataSet ds1 = new DataSet(); string querry = "Select po_tax from purchase_order where po_id='" + Request.QueryString["po_id"] + "'"; // ds1 = obj1.SelectQuery(querry); SqlCommand cmd = new SqlCommand(querry,Conn); cmd.ExecuteNonQuery(); SqlDataReader rdr; rdr = cmd.ExecuteReader(); if (rdr.Read() == false) { //No Records rdr.Close(); Conn.Close(); Label3.Text = "No record found"; return; } else { CheckBoxList chkbx = (CheckBoxList)form1.FindControl("CheckBoxList1"); rdr.NextResult(); if (rdr.IsClosed == false) { while (rdr.Read() == true) [problem ocures here. it does not executes i.e does not go inside curly braces. why?] { ListItem currentCheckBox = chkbx.Items.FindByValue(rdr["po_id"].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; } } } rdr.Close(); //string[] items = returned_value_from_db.Split(','); string[] items = sb.ToString().Split(','); for (int i = 0; i &lt;= items.GetUpperBound(0); i++) { ListItem currentCheckBox = chkbx.Items.FindByValue(items[i].ToString()); if (currentCheckBox != null) { currentCheckBox.Selected = true; } } } Conn.Close(); </code></pre>
c# asp.net
[0, 9]
3,356,986
3,356,987
new windows cannot find path in javascript
<p>I m facing problem with javascript new window.<br/> when i run start.aspx file which is in temp folder.<br/> temp folder has also download.aspx file. When I click a download button then I write a javacript code. The code is </p> <pre><code>new win = window.open("download.aspx", "new window", param); </code></pre> <p>download.aspx file exist in same folder where start.aspx exist.<br/></p> <p>following error is return </p> <pre><code> "'win' is null or not an object". </code></pre> <p>Note: This error return after deploy the file. On local it is running fine.</p> <p>Is there any body help me whats the problem is here??</p>
javascript asp.net
[3, 9]
4,765,155
4,765,156
jquery selector help
<p>I have a div with an id="my_div". How can I find a <code>&lt;select&gt;</code> by <em>name</em> (i.e. <code>name="my_select"</code>) assuming that the <code>&lt;select&gt;</code> can be at any level underneath the div? I.e. it can be a child, grandchild etc. Ultimately I need to get the value of the selected option.</p>
javascript jquery
[3, 5]
851,533
851,534
Dropdownlist Selected value in postback
<p>I have 2 dropdownlists(ddl1,ddl2) and a gridview with 2 dropdown lists(gddl1,gddl2). On <code>SelectedIndexChanged</code> event of ddl1 am changing <code>SelectedIndex</code> of gddl1 in postback.</p> <p>My problem is ddl1.databind() occurs at a <strong>button's click event</strong>. So once selectedindex of ddl1 changes, the selected value losts and returns back to initial value.</p> <p>I cant use <code>!IsPostback</code> because am binding ddl1 on button click. How can I retain ddl1 and ddl2 selected index.?</p> <pre><code>protected void btnProceed_Click(object sender, EventArgs e) { if(ddlLocation.SelectedIndex &gt; -1) { empDS = ws_service.GetEmpList(ddlLocation.SelectedValue, ((ddlDept.SelectedValue == "All") ? "" : ddlDept.SelectedValue), ((ddlGrade.SelectedValue == "All") ? "" : ddlGrade.SelectedValue)); appraiserDS = ws_service.GetAppList(); grdDetails.DataSource = empDS.Tables[ 0 ].DefaultView; grdDetails.DataBind(); ddlAppraiserAll.DataSource = appraiserDS.Tables[ 0 ].DefaultView; ddlAppraiserAll.DataTextField = "APPRAISER_NAME"; ddlAppraiserAll.DataValueField = "APPRAISER_ID"; ddlAppraiserAll.DataBind(); } } protected void ddlAppraiserAll_SelectedIndexChanged(object sender, EventArgs e) { foreach(GridViewRow gvRow in grdDetails.Rows) { Control ctrl = gvRow.FindControl("ddlAppraiserId"); DropDownList ddl = ctrl as DropDownList; if(ddl != null) ddl.SelectedIndex = ddlAppraiserAll.SelectedIndex; } } </code></pre>
c# asp.net
[0, 9]
1,269,532
1,269,533
Cloned row requesting same function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12877232/call-same-function-by-a-cloned-list-row">Call same function by a cloned list row</a> </p> </blockquote> <p>I am trying to make a simple calculation to work.</p> <p>I have the following running:</p> <p><a href="http://jsfiddle.net/vSyK6/41/" rel="nofollow">http://jsfiddle.net/vSyK6/41/</a></p> <p>Basically, the way it works now is this: When you select an option on the drop down list it will display the content based on the option selected. Then when you select the same option again it will add, basically clone the same row. Now, when the second option is selected "Option2" it will display an empty textbox. When you enter a number it will or should call the a function where we make a basic calculation. The function is already in the script.<br><br> However, when we have two empty textboxes it should call the same calculation function but calculate seperately and puts it in a different div. The div# where we display the amount is a called "amount"<br><br> Basically, it should work like this:</p> <pre><code>First Empty textbox -&gt; 100 -&gt; 100 * 22.38 = display result in div#1 Second Empty textbox -&gt; 230 -&gt; 230 * 22.38 = display in div#2 </code></pre> <p>any idea on how to accomplish that ?</p>
javascript jquery
[3, 5]
591,192
591,193
Convert jQuery to javascript (hide block after click on blank space)
<p>Hello dear programmers Stack Overflow. I started to learn javascript and for a while (until you learn to write complex programs) would do without frameworks to understand the principles of the "native" code. I ran into the problem and found its realization ... but jQuery that difficult to understand deeper processes.</p> <p><a href="http://jsfiddle.net/P6YeA/25/" rel="nofollow">http://jsfiddle.net/P6YeA/25/</a></p> <p>Can someone help analyze this example into its component? I would be extremely grateful for such a kind person help! :) Sorry for the broken English.</p>
javascript jquery
[3, 5]
5,464,016
5,464,017
Didn't do too well on a Java IKM test, advice?
<p>I did an IKM Java test recently and got quite a low score. I only graduated a year ago and I dont have commercial experience in Java (i do web development in my current job).</p> <p>I thought reading up a lot on Java would help me prepare, but when I sat the IKM test i got ripped to pieces. I didn't know much about how the garbage collection actually works, names of other java compilers (i know about javac?), using .dll with Java etc etc. I know a wide range of the basics, but to the extent wether 'int(5L)' produces an integer or not, I really didnt know.</p> <p>My question is that many of the IKM questions I have never come across, yet I have read many of the wider-known Java programming books (Deitel, O'Reilly etc). Am i reading the wrong books??? </p> <p>Could anyone recommend a good plan of action to allow me to go away and self-study and be able to know these really tough java questions?</p>
c# java
[0, 1]
5,114,563
5,114,564
Problem with animate jquery div with different pace
<p>While I was animating two boxes with jQuery at same pace with setting marginTop, the second box will move faster than the first box.</p> <pre><code>&lt;div id="box1" style="width:500px;height:80px;background-color:blue;"&gt;box 1&lt;/div&gt; &lt;div id="box2" style="width:500px;height:80px;background-color:green;margin-left:510px;"&gt;box 2&lt;/div&gt; &lt;script type="text/javascript"&gt; jQuery("#box1").animate({marginTop:"-=80px"}, {duration: 1500}); jQuery("#box2").animate({marginTop:"-=80px"}, {duration: 1500}); &lt;/script&gt; </code></pre> <p>However, when I apply the same setting Top, both box move at same pace. </p> <pre><code>&lt;div id="box1" style="width:500px;height:80px;background-color:blue;position:relative;"&gt;box 1&lt;/div&gt; &lt;div id="box2" style="width:500px;height:80px;background-color:green;margin-left:510px;position:relative;"&gt;box 2&lt;/div&gt; &lt;script type="text/javascript"&gt; jQuery("#box1").animate({top:"-=80px"}, {duration: 1500}); jQuery("#box2").animate({top:"-=80px"}, {duration: 1500}); &lt;/script&gt; </code></pre> <p>Any idea why this happening this way?</p>
javascript jquery
[3, 5]
3,789,976
3,789,977
Convert php array_sum to java
<pre><code>$a = array(2, 4, 6, 8); echo "sum(a) = " . array_sum($a) . "\n"; //==20 </code></pre> <p>how i can do this in java?</p>
java php
[1, 2]
1,772,233
1,772,234
Tree Menu Method
<p>I'm creating a menu with the following structure in the database:</p> <pre><code>MenuItems id menu_text id_parent </code></pre> <p>Where <code>id_parent</code> is null, this is a menu root, and if <code>id_parent</code> is not null, this is a part of submenu. I need to create a method to return an tree of this contenxt, and then return a string with <code>&lt;UL&gt; &lt;LI&gt;</code> sctructure to render in my webpage.</p> <p>I cannot figure out the query to select all of the menus and their direct sub menus at once.</p>
c# asp.net
[0, 9]
806,102
806,103
Access to hyperlink in listview in Itemtemplate
<p>I'm trying to access a <code>hyperlink</code> on my <code>listview</code>. When the user logs in, the hyperlink will show on my homepage. It doesn't show.</p> <pre><code>protected void lvtop6_ItemCommand(object sender, ListViewCommandEventArgs e) { ListView hlBuy = (ListView)lvtop6.FindControl("hlBuy"); if (User.Identity.IsAuthenticated==true) { hlBuy.Visible = true; } else { hlBuy.Visible = false; } } </code></pre> <p>Please somebody advise me to figure out what is wrong with my code behind</p>
c# asp.net
[0, 9]
4,994,648
4,994,649
change name of class name when clicked in jquery
<p>I have a div with class name: .sel-display-on. When clicked, I want to change it to .sel-display-off with jquery. Is this possible at all? Will the css properties of this new class name be applied?</p> <pre><code>$('.sel-display-on').click(function (e) { e.stopPropagation(); // change class name to .sel-display-off }); </code></pre>
javascript jquery
[3, 5]
1,868,841
1,868,842
jQuery access to this event in new object
<p>I want to get access to the data-global-id value in the following markup and I am not sure how to do this due to scoping.</p> <p>For example:</p> <pre><code>&lt;div data-global-id="168" class="remove-as-favorite"&gt;remove as favorite&lt;/div&gt; $('.remove-as-favorite').on('click',function(){ var global_id=$(this).data('global-id'); // this works alert('here i am in something: ' + global_id); // this doesn't work event_handler.remove_as_favorite(); }); // want to access the data-global-id value in here; how to get access to this? event_handler={ remove_as_favorite: function(){ // how to get access to this here; assuming this refers to event_handler var global_id=$(this).data('global-id'); alert("here i am global_id:" + global_id); } } </code></pre> <p>thx</p> <p>** edit 1 ** <img src="http://i.stack.imgur.com/BmOtP.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
3,998,743
3,998,744
Building your own sources on Android
<p>I have coded a new provider and now want to get this into android working. I changed security.properties and Security.java files in android under libcore directory.</p> <p>Now how do I build the files?</p> <p>I simply did a make on android sources and I already see the main provider file that I have written.</p> <p>However the class files are missing. I know that I have to tweak some make files to include my sources in the classpath but dunno which one to tweak :(</p> <p>I also see the /out/target/common/obj/JAVA_LIBRARIES/core_intermediates/ has to have my classes....</p> <p>Please HELP</p>
java android
[1, 4]
1,137,377
1,137,378
jQuery Accordion Menu Items Remain Open Until Clicked
<p>I have made a jQuery accordion menu but it doesn't seem to be acting in the default manner. Basically, when I click on a menu item the item opens as expected. However, when I click on a different menu item it also opens as expected but the first menu item remains open. The jQuery documentation states:</p> <p>"An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that."</p> <p>I promise it took very little effort to break this default functionality ;). Anyway, I have posted my JS, HTML and CSS on JSFiddle and am hoping someone can point me in the right direction. Other than opening and closing it works fine, even though it doesn't appear to on JSFiddle. Here's the link: <a href="http://jsfiddle.net/stringman/9Jrqq/" rel="nofollow">JSFiddle Post</a></p> <p>Thanks in advance.</p> <p>Ken</p>
javascript jquery
[3, 5]
2,462,224
2,462,225
jquery: simple animate question
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor">jQuery animate backgroundColor</a> </p> </blockquote> <p><a href="http://johanberntsson.se/dev/fysiosteo/" rel="nofollow">http://johanberntsson.se/dev/fysiosteo/</a></p> <p>If you hover the menu, i would like the main menu to fade out its backbgroundcolor to #fff over 1 second. But i cant get it to work. My code:</p> <pre><code> $('#menu-main-menu').children('li').mouseout(function () { $(this).css('background', '#AFFFAF').animate({ 'background' : '#fff' }, 1000); }); </code></pre> <p>I never use animate(), so ive probably missed something obvious. Thanks.</p>
javascript jquery
[3, 5]
5,790,361
5,790,362
Padding on Shape in Progressbar
<p>I'm using xml file to define progress bar. I defined padding on background shape. But this setting will be sometimes displayed correctly, sometimes not. So If I start my application or Activity with progressbar inside, there will be correctly displayed progressbar with background and 'padded' progress. Then I close my application and start it again, and, progressbar is displayed without padded background, on next start will be displayed correctly and son on ... Could you please advice possible reasons for this?</p> <p>xml file: </p> <pre><code>&lt;item android:id="@android:id/background" &gt; &lt;shape&gt; &lt;corners android:radius="15dip" /&gt; &lt;padding android:left="1dp" android:top="6dp" android:right="1dp" android:bottom="6dp" /&gt; &lt;solid android:color="#00000000" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item android:id="@android:id/progress" &gt; &lt;clip android:clipOrientation="horizontal" android:gravity="left" &gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt; &lt;corners android:radius="15dip" /&gt; &lt;stroke android:width="1px" android:color="#ffffffff" android:dashWidth="2px" android:dashGap="0px"/&gt; &lt;solid android:color="#ff0000ff" /&gt; &lt;/shape&gt; &lt;/clip&gt; &lt;/item&gt; </code></pre> <p> </p>
java android
[1, 4]
4,620,319
4,620,320
Session State Issue
<p>When visiting a page, I am storing a value in session state. When I click back on the browser, the value in session reverts to its original value. Why does this happen? I am not resetting the value when i go back.</p> <p>This happens on iPhone and iPad - all other browsers do NOT roll back the session state value.</p> <p>Thanks in advance.</p> <p>I am using this javascript code (code in both pages is identical):</p> <pre><code>function pageLoad() { // Get the current url path var url = document.URL; PageMethods.IsNavigatingBackward(url, handleCallback); } function handleCallback(isBackward) { if (isBackward) { // Go back to previous page history.back(); } else { // Set the current url in the session var url = document.URL; PageMethods.SetCurrentPage(url, getLocation); } } </code></pre> <p>And the code behind:</p> <pre><code>[WebMethod] public static bool IsNavigatingBackward(Uri url) { string currentPath = url.LocalPath; string lastPath = (string)HttpContext.Current.Session["LastPage"]; bool isBackward = false; NavigationList table = NavigationList.GetInstance(); if (table.IsBackwardNavigation(currentPath, lastPath)) { isBackward = true; } return isBackward; } [WebMethod] public static void SetCurrentPage(Uri url) { HttpContext.Current.Session["LastPage"] = url.LocalPath; } </code></pre>
iphone asp.net
[8, 9]
266,534
266,535
jquery anonymous function declaration meanings
<p>Are the following assumptions accurate?</p> <p>1) execute immediately</p> <pre><code>(function(){ })(); </code></pre> <p>2) execute on document ready</p> <pre><code>$(document).ready(function(){ }); </code></pre> <p>3) shorthand for on document ready</p> <pre><code>$(function(){ }); </code></pre> <p>4) alternative shorthand for on document ready for avoiding cross script conflicts</p> <pre><code>(function($) { })(jQuery); </code></pre>
javascript jquery
[3, 5]
2,234,136
2,234,137
receiving response from page method using jquery
<p>I am calling page method using jquery. In examples every one receives a reply using result.d</p> <p>for example:</p> <pre><code> function onSuccess(msg) { alert("suc" + msg.d); } </code></pre> <p>Please guide me what is this .d ? </p>
jquery asp.net
[5, 9]
543,109
543,110
jquery Ajax URl issue
<p>I have looked around quite a bit and it seems absolute urls is the way to go here. I have no problem in chrome but firefox and IE IE still wants to redirect fully to the wrong page.</p> <p>my states:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $('#page_submit').click(function () { event.preventDefault(); $('.standard span').hide(); var pw = $("input#pw").val(); if (pw == "") { $("span#pw_err").show(); $("input#pw").focus(); return false; } var pw2 = $("input#pw2").val(); if (pw2 == "") { $("span#pw2_err").show(); $("input#pw2").focus(); return false; } if (pw != pw2) { $("span#match_err").show(); $("input#pw2").focus(); return false; } var data = 'pw=' + pw + '&amp;pw2=' + pw2; $('.standard input').attr('disabled','true'); $('.loading').show(); $.ajax({ url: "/members/includes/change.php", type: "GET", data: data, cache: false, success: function (html) { //hide the form $('#pw_form').fadeOut('slow'); //display results $('#pw_form_result').fadeIn('slow'); $("#pw_form_result").html(html); } }); return false; }); }); &lt;/script&gt; </code></pre> <p>the structure of the file I am trying to access is:</p> <blockquote> <p>www.site.com/members/includes/change.php</p> </blockquote> <p>Not sure what the cause is really. I know the jquery initiator is working because i can summon alert calls to and from the function itself.</p> <h2>edit</h2> <p>after commenting out</p> <blockquote> <p>event.preventDefault();</p> </blockquote> <p>it seems to function right? everything I had read before said this was a necessary piece however.</p>
php javascript jquery
[2, 3, 5]
4,233,387
4,233,388
Trying to start with google translate API and using ready()
<p>I have this code:</p> <pre><code>&lt;script language="javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; $(document).ready(function() { } ); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form onsubmit="return false"&gt; &lt;input type="button" value="Translate" onclick="gtrans(this.form)" /&gt; &lt;p id="translation" style="border:1px solid #00f;padding:5px;width:400px"&gt;-&lt;/p&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>When I add inside <code>ready(){}</code> the line <code>google.load ("language", "1");</code> the form is not showed, why?</p> <p>Regards</p> <p>Javi</p>
javascript jquery
[3, 5]
3,560,492
3,560,493
get POST data in C#/ASP.NET
<p>-Edit- Jon Skeet and darin togther answered my question 100%</p> <p>I am trying to get POST data but i have no luck whatsoever. By code is below, when i click the form button NOTHING happens. I expected at least my IDE to snap at A.Ret() but nothing happens whatsoever.</p> <p>Test.cs</p> <pre><code>using System.Web; public class A { public static string ret() { var c = HttpContext.Current; var v = c.Request.QueryString; //&lt;-- i can see get data in this return c.Request.UserAgent.ToString(); return c.Request.UserHostAddress.ToString(); return "woot"; } } </code></pre> <p>Default.aspx</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="aspnetCSone._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server" method="post" action="Default.aspx"&gt; &lt;input type=hidden name="AP" value="99" /&gt; &lt;input type=button value="Submit" /&gt; &lt;div&gt; &lt;a id="aa"&gt;a&lt;/a&gt; &lt;% = A.ret() %&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
c# asp.net
[0, 9]
1,739,713
1,739,714
How to return duration soundmanager2
<p>I'm using.</p> <pre><code>function item_duration(link,name) { soundManager.createSound({ id: ''+name+'', url: ''+link+'', volume: 100, autoLoad: true, onload: function(){ if (this.readyState == 3) { return this.duration; } } }); //sound_duration.load(); //sound_duration.stop(); // soundManager.unload(''+name+''); } </code></pre> <p>But it is not returning the duration it gives me 0, i tried to alert the duration and there is not 0 the alert shows different, but it takes time before the alert appear.I don't thing that is the problem because i have statement .</p>
javascript jquery
[3, 5]
210,663
210,664
Accessing a JSON var wthout using item.item = string
<p>Here is the array</p> <pre><code>var weekdayColor = { sunday : 'red', // sunday monday : 'blue', // monday tuesday: 'white', // tuesday wednesday: 'black', thursday: 'green', friday: 'yellow', saturday: 'orange' } </code></pre> <p>I want to be able to do something along the lines of <code>weekcayColor[0]</code> to get <code>sunday</code>:</p> <p>Here is the JavaScript I wrote for an interview which was already turned in.. I know there is an easier way to do this. The first var <code>weekdayColor</code> CANNOT BE CHANGED; also <code>weekdayColor.sunday</code> returns <code>red</code>.</p> <p>Perhaps I am using the wrong date method or accessing the var incorrectly?</p> <pre><code>var weekdayColor = { sunday : 'red', // sunday monday : 'blue', // monday tuesday: 'white', // tuesday wednesday: 'black', // wednessday thursday: 'green', // thursday friday: 'yellow', // friday saturday: 'orange' // saturday } var weekday=new Array(); weekday[0]="sunday"; weekday[1]="monday"; weekday[2]="tuesday"; weekday[3]="wednesday"; weekday[4]="thursday"; weekday[5]="friday"; weekday[6]="saturday"; d = new Date; day = d.getDay(); console.log(weekday[day]); a = weekday[day]; function change(){ var x = document.getElementById("weekday"); x.innerHTML = a; x.style.color = weekdayColor[a]; } </code></pre>
javascript jquery
[3, 5]
3,306,672
3,306,673
How to change names of files in String[]
<p>I have such code... </p> <pre><code> File fileDir = new File("/mnt/sdcard/dd"); if(!fileDir.exists() || !fileDir.isDirectory()){ return; } String[] files = fileDir.list(); </code></pre> <p>So, I have an array of files' names...<br> But I want to GET an array of <code>"path to each file"+fileDir.list()</code> </p> <p>For example<br> I have - <code>"/09.jpg"</code><br> I want - <code>"/mnt/sdcard/dd/09.jpg"</code></p> <p>How can I do it? Thanks</p>
java android
[1, 4]
4,231,975
4,231,976
jquery - checking for inline javascript on attribute
<p>Is there a way to test if a custom attribute is a function? I've tried using jquery's isFunction method, but it doesn't seem to work with this scenario. </p> <p>For example:</p> <pre><code>&lt;input id="test" class='date' oncomplete="function() { alert('i am a function'); }" type="text" /&gt; &lt;script&gt; $(".date").livequery(function () { var onComplete = $(this).attr("oncomplete"); if ($.isFunction(onComplete)) { $(this).mask("99/99/9999", { completed: onComplete }); } else { $(this).mask("99/99/9999"); } }); &lt;/script&gt; </code></pre> <p>I have several date fields. I'm trying to give a couple of them special behavior. I know I can just have a separate jquery selector to set them up with the behavior they need. But wanted to see if there was an inline way of doing this.</p>
javascript jquery
[3, 5]
6,005,203
6,005,204
Browse verify this field blank
<p>Good afternoon, I have a doubt. I have a div with two input button and a div, to send data via $ ajax More event just prior to sending $ ajax, I have to validate these two field Check that this blank. Most do not know how to do it for him not enable the sending if it receives false answer;</p> <p>Example of my code,</p> <pre><code>&lt;div id="fields"&gt; &lt;input type="text" name="u" class="input" id="u" size="42" /&gt; &lt;input type="text" name="s" class="input" id="s" size="10" /&gt; &lt;/div&gt; &lt;input type="submit" class="bt" value="my user" /&gt; </code></pre> <p>jquery of my code,</p> <pre><code> $("input.bt").click(function() { var da = $("#u").val(); var dc = $("#s").val(); //check this fields blank. //Resport true //$ ajax send data below .. $.ajax({ ...POST... }); </code></pre> <p>I would be very grateful for the help. :)</p>
javascript jquery
[3, 5]
4,526,113
4,526,114
js jQuery, always have a number display at least two digits 00
<p>I'm using the following to add one to number:</p> <pre><code>&lt;div id="count"&gt;00&lt;/div&gt; &lt;div id="count"&gt;03&lt;/div&gt; &lt;div id="count"&gt;08&lt;/div&gt; &lt;div id="count"&gt;12&lt;/div&gt; $('#count').text(function(i,txt) { return parseInt(txt, 10) + 1; }); </code></pre> <p>I always want there two be 2 places, 00 even if the number is under 10. How can I get the func above, with JS, to always return the 2 00 places? So if the number computes to 3, it injects 03 into #count?</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,275,475
2,275,476
How to access a calling element's id in a jQuery click() function
<p>So I am binding a .click() function to a css class, but I want to be able to access the calling element's id from inside this function when it is called. What is the best way to do this?</p>
javascript jquery
[3, 5]
1,957,450
1,957,451
ASP.net disable refresh when dropdownlist is open
<p>i have a webpage that loads data into a gridview and refreshes the gridview every few seconds. I do this via a asp:Timer which runs a C# function every few seconds to requery the database and databind the gridview.</p> <p>I also have a few dropdown lists to filter data from the gridview. These dropdown lists get their data from the same dataset as the gridview (e.g. if the gridview shows the stats of all apples being plucked from trees, then the list may contain e.g. all distinct apple types). How i refresh these dropdown lists is again to requery the dataset and reset the selected index to be one selected at time of refresh. So this causes a problem where the timer is up when the dropdown list is open - the index on the dropdown list is selected and refreshes the gridview, the dropdown list also refreshes with the current selected index and closes.</p> <p>So the question i have how to disable my timer refresh from going off while the dropdown lists are active - or maybe how do i do this better?</p> <p>edit: forgot to mention that i'm using ajax / UpdatePanel for the refresh</p>
c# asp.net
[0, 9]
2,260,231
2,260,232
in asp.net how can I dynamically hide one field based off anothers value?
<p>I have 4 asp:Textbox fields on a form. IDs being A1, A2 and B1, B2 for simplicity. If any one of the As or Bs is populated, I need to hide the other one. So I enter something in A1, hide A2, enter something in B2, hide B1.</p> <p>I thought I could use a javascript OnBlur event to do this but it doesn't do anything unfortunately. I'm trying to get the fields to appear/disappear without having to do a postback.</p> <p>Any suggestions or examples would be great.</p> <p>thanks, Q</p>
javascript asp.net
[3, 9]
3,271,994
3,271,995
jQuery setting of radio button using eq fails
<p>In the code below, <code>plane.posFile</code> is a string array of length 3 that identifies 3 radio buttons, and the buttons display correctly.</p> <p>If <code>oSource.posfile</code> is a blank string, the 0th button gets checked correctly.</p> <p>If <code>oSource.posfile</code> is not blank, it is one of the three in <code>plane.posFile</code> except that the file extensions have to be stripped for the comparison. </p> <p>What happens is that the code correctly (using Firebug to step through it) chooses which index to use. </p> <p>It goes through into the break statement and then out with <code>i=1</code>. </p> <p>However, the attempt to set when <code>eq(i)</code> the <code>attr('checked',true)</code> files. I don't see why. It's the same statement as previously when <code>eq(0)</code> was used. I've been staring at it for a couple of hours trying things with no luck. </p> <p>Any ideas are greatly appreciated, including comments on the approach.</p> <pre><code>$wb.pcPosCfg.empty(); for (i=0; i&lt;plane.posFile.length; i++) $wb.pcPosCfg.append("&lt;input type='radio' style='width:11px' name='rbnLoadCfg' value=" + i + "&gt;" + plane.posFile[i] + "&lt;br&gt;"); if (oSource.posfile=='') { $('input[name="rbnLoadCfg"]:eq(0)').attr('checked',true); } else { for (i=0; i&lt;plane.posFile.length; i++) { if (oSource.posfile==plane.posFile[i].substring(0,plane.posFile[i].length-5)) break; } $('input[name="rbnLoadCfg"]:eq(i)').attr('checked',true); } } </code></pre>
javascript jquery
[3, 5]
2,041,421
2,041,422
jQuery nested filter
<p>I'd like to have the first 6 columns of a GridView perform an action, but I need to highlight the entire row when it is clicked. The entire row highlighting is working, but I can't quite get the capturing of the first 6 columns. How do I capture the first 6 columns click in the following where the testing variable is located?:</p> <pre><code>$("#&lt;%= JobStreamSelectedDealsGridView.ClientID %&gt; tr").filter(function() { return $('td', this).length &amp;&amp; !$('table', this).length }) .bind('click', function(e) { if (_activeRow) _activeRow.removeClass('gridviewrow-highlighted'); _activeRow = $(this).addClass('gridviewrow-highlighted'); var testing = $('td:lt(6)', this); }); </code></pre>
asp.net jquery
[9, 5]
5,947,035
5,947,036
How to link to specific anchor in table with jquery
<p>I am using this jquery plugin:</p> <p><a href="http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx" rel="nofollow">http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx</a></p> <p>I have anchors in the code such as:</p> <pre><code>&lt;a name="art" id="art2"&gt;&lt;/a&gt; Articles </code></pre> <p>How can I open that particular row then? In other words, when a user clicks a link from another page to this landing page I would like the appropriate row to open up based on the anchor tag.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
1,838,658
1,838,659
Is this correct syntax for a C# statment
<p>Is this the correct syntax for a C statment. I recieve the following error message in Visual Studios when trying to use it.</p> <pre><code>intResult = Convert.ToInt32(cmdSelect.Parameters("RETURN_VALUE").Value); </code></pre> <pre><code>non-invocable memeber of System.Data.SqlClient.SqlCommand.Parameters can not be used as a method. </code></pre> <p>Can anyone help clear this up.</p> <p>I am using the following namespaces as well</p> <pre><code>using System; using System.Data; using System.Configuration; using System.Web.Configuration; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Web.Security; </code></pre>
c# asp.net
[0, 9]
727,482
727,483
PHP and Javascript: EURO sign taking more character length in php than javascript
<p>I got my message text as </p> <blockquote> <p>Available for order in Cologne of 05/16/2012 6:45 to 05/26/2012 ? payment 10 € Per day</p> </blockquote> <p>I think Euro symbol is villain</p> <p><strong>When checking with the Euro sign:</strong></p> <p>JavaScript char count= 86 PHP char count = 88</p> <p><strong>When checking without Euro sign</strong></p> <p>JavaScript char count= 84 PHP char count = 84</p> <p>Why this is happening , anybody could explain ?</p>
php javascript
[2, 3]
3,986,874
3,986,875
javascript/jquery how to set more than one attributes
<p>I have this for loop which will append options to that "optlist"; the value will be set to manSel[i][0] and the text to manSel[i][1]; I would also like to set the attribute selected="selected" to all of them. Can I do that in the same loop or should I iterate again throug the options and add that attribute to each one of them. Thanks in advance!</p> <pre><code>for(var i = 0 ; i&lt;manSel.length; i++){ optlist.append($('&lt;option/&gt;').attr('value', manSel[i][0]).text(manSel[i][1])); } </code></pre>
javascript jquery
[3, 5]
4,352,360
4,352,361
Best way to wrap elment in a technical selector
<p>In a project, I often manipulate the DOM by adding / replacing elements from an HTML string :</p> <pre><code>$("#myDiv").html("&lt;ul&gt;&lt;li&gt;foo&lt;/li&gt;&lt;li&gt;bar&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This is a list&lt;/p&gt;"); </code></pre> <p>I would like to wrap those in "something with a technical id attached" so that my jQuery selectors can be targetted to these specific fragmeents of the page.</p> <p>Something like that :</p> <pre><code>var techId = ...; $("#myDiv").html(wrap(techId, "&lt;ul id="myList"&gt;&lt;li&gt;foo&lt;/li&gt;&lt;li&gt;bar&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This is a list&lt;/p&gt;")); $(document).on("click", "#"+techId+" #myList", function(event){ alert("List clicked"); }); </code></pre> <p>What should be the content of the "wrap" function knowing that the wrapper cannot have any visual impact one the page, in any situation.</p> <p>Calling .remove() on the wrapper should remove the wrapped element but there should be a way of removing the wrapper without modifying the elements inside (at the expense of breaking the selectors).</p>
javascript jquery
[3, 5]
5,268,020
5,268,021
Adding comma separated strings to an ArrayList c#
<p>How to add a comma separated string to an ArrayList? My string could hold 1 or many items which I'd like to add to ArrayList, each item combine with it's own id value separated by underscore (_) so it must be separated arraylist items..</p> <p>e.g :</p> <p><code>string supplierIdWithProducts = "1_1001,1_1002,20_1003,100_1005,100_1006";</code></p> <p><code>ArrayList myArrayList= new ArrayList();</code><br> <code>myArrayList.Add("1001,1002"); // 1</code><br> <code>myArrayList.Add("1003"); // 20</code><br> <code>myArrayList.Add("1005,1006"); // 100</code></p> <p>After the ArrayList has been populated, I'd like pass it to a web service that part is ok for me<br> <code>foreach (string item in myArrayList){}</code></p> <p>How could i do this...</p> <p>Thanks..</p>
c# asp.net
[0, 9]
4,586,626
4,586,627
set clock of multiple county by java script
<p>I want to set clock of multiple country by JavaScript:</p> <p>Example :</p> <pre><code> U.S.A India Australia Spain 10:20:23 15:32:23 19:36:41 15:63:20 </code></pre> <p>I want set this clock live in a page.</p> <p>I use PHP in My page</p>
php javascript jquery
[2, 3, 5]