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
5,980,960
5,980,961
c# where to place "using" for every page?
<p>If I have a </p> <pre><code>using MyProject.language; </code></pre> <p>literary needs to place on every single page.</p> <p>My question is, is there a place that I can place the "using" just once, for every page of the project.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
821,399
821,400
jQuery attribute selector unrecognized expression error
<p>I'm using the following code to select the list item for current page from a navigation unordered list, but I keep getting an unrecognized expression error on <code>'a[href$="{server-relative URL}"]'</code></p> <p>I've checked matching quotes/brackets that other questions mention, and the link will not contain characters beyond the usual <code>/ &amp; ? %</code> The code I'm using is:</p> <pre><code>$(document).ready(function() { var pathname = window.location.pathname; var selector = "'a[href$=\"" + pathname + "\"]'"; var listItem = $(selector).parent().parent(); listItem.addClass('selected'); }); </code></pre> <p>I'm using jQuery 1.8.2 (latest version). Thanks!</p>
javascript jquery
[3, 5]
5,815,243
5,815,244
How can i pass checkbox data to Textarea using javascript
<p>This is my javascriptcode</p> <pre><code>function AddContactPhoneNo() { $("input[name='contact_id[]']:checked").each(function(){ var opt_value = $(this).parent().parent().children('.contacts_firstname_01_contacts').text(); var opt = "&lt;option value='" + opt_value + "'&gt;" + opt_value + "&lt;/option&gt;"; if (opt_value != "") { alert(opt_value); } });} </code></pre> <p>This is my HTML Code</p> <pre><code>&lt;div class="contacts_headings_01"&gt; &lt;div class="contacts_checkbox_01"&gt;&lt;input name="contact_id[]" id="contact_id" type="checkbox" value="'.$contacts_row['contact_id'].'" style="margin-top:0px ; margin-left:-3px;" /&gt;&lt;/div&gt; &lt;div class="contacts_firstname_01_contacts"&gt;'.$firstname.'&lt;/div&gt; &lt;div class="contacts_firstname_01"&gt;'.$lastname.'&lt;/div&gt; &lt;div class="contacts_firstname_01"&gt;'.$company.'&lt;/div&gt; &lt;div class="contacts_group_01_contacts_page"&gt;'.$groups1.'&lt;/div&gt; &lt;div class="contacts_firstname_01_contactdateofbirth"&gt;'.$birth_date.'&lt;/div&gt; &lt;div class="contacts_gender_01"&gt;'.$gender2.'&lt;/div&gt; &lt;div class="ncontacts_mobile_nmbr_01"&gt;'.$phone1.'&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I Got Error like This</p> <pre><code>$ is not defined $("input[name='contact_id[]']:checked").each(function(){ </code></pre>
php javascript
[2, 3]
3,909,116
3,909,117
Asp.net Source Code Compare Software
<p>I want to compare two asp.net sources and find different could you introduce me a software inside or outside of visual studio ? </p>
c# asp.net
[0, 9]
2,998,542
2,998,543
how to convert byteArray into bitmap image to show in an imageview in android?
<p>i have the following code for this purpose in my app but it do nothings and halts the application</p> <pre><code>bmImage.setImageBitmap(BitmapFactory.decodeByteArray(byteImage2, 0, byteImage2.length)); </code></pre>
java android
[1, 4]
1,795,905
1,795,906
Periodically check an element of a web page
<p>How to implement a web service that periodically checks if an element of a web page (say, <code>&lt;div id="contentlist"&gt;</code>) has changed; then if there is a change, send a notification to an email address?</p> <p><strong>Update</strong></p> <p>There is one issue. The web page is dynamically generated, so if I look at the HTML source, there is nothing in the targe element.</p> <p>And I want to implement this as a web service. Can I do that in cron?</p>
php javascript
[2, 3]
3,020,562
3,020,563
Unable to get value of textarea
<p>Here is my code:</p> <pre><code>&lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;div id="container"&gt; &lt;textarea name="message' id="myarea"&gt;This is it&lt;/textarea&gt; &lt;br/&gt; &lt;input type="button" id="savebutton" value="Go" /&gt; &lt;p id="fuck"&gt;&lt;/p&gt; &lt;/div&gt; &lt;script&gt; $('#savebutton').click(function() { var text = $('#myarea').value(); alert(text); }); &lt;/script&gt; </code></pre> <p>On click I get error: Uncaught TypeError: Object [object Object] has no method 'value'</p>
javascript jquery
[3, 5]
2,515,901
2,515,902
Passing parameters to another domain website's page in javascript without opening it
<p>i am trying to develop a website in .net which will generate ads images. and i can place that images link in any website.then i want to track the no.of views and clicks on that image with the url and other information of the websites where i have placed the ads. now i want to integrate the javascript code to third party websites which will automatically send the information of their site to my domain's page that will accept those values and will save in the database. how can i pass the values from the javascript and get those values in my domain without opening the my domain page in window.Please help me if any one have knowledge about this.Thanks</p>
javascript asp.net
[3, 9]
1,506,460
1,506,461
I'm a beginner programmer , where to start?
<p>I have started learning programming for about 6 months , I used java , python and c. but I'm confused a little bit , don't know where to start . I'm sick of tutorials so I want to learn programming by building projects or to join a project where I can improve my programming skills . I tried to use the OpenCV library to build programs but I found it very hard for me. and by the way I'm a first year computer science and engineering major.</p> <p>thank you</p>
java python
[1, 7]
4,883,065
4,883,066
What technologies to use for Terminal-ish Text based RPG?
<p>I want to create an old school simplistic Text based RPG. No inventory, no fighting, just finding the right way through a dungeon.</p> <p>There will be a describing paragraph about each "room" and there will be choices depending on the room. IE, If there's two doors, you can choose which to go through, or if there's items you can use them and so on. As you progress, the story unfolds.</p> <p>I really want to use php for it, since I don't really know alot of programming and I hear that it's an relatively easy entrance for that. I already know enough php to develop for Wordpress, as well.</p> <p>I really want it to remind people about the old MUDs, designwise i want to be like a terminal or the cmd. The styling is certainly no problem with css, but i'm still not sure about what to use to make the typing feel good, but i'm currently eyeballing <a href="http://tryruby.org" rel="nofollow">tryruby.org</a> and <a href="http://goosh.org" rel="nofollow">goosh.org</a> to get the right feel.</p> <p>Any ideas on how to go forth with that? What Do I need to use? Javascript/jQuery? Any good resources for me to look at?</p> <p>EDIT: Ofcourse, it's online.</p>
php javascript jquery
[2, 3, 5]
3,761,481
3,761,482
"Controller" to Master Page (C#/MVC 4)
<p>I will have a user's menu that is present in all pages of my application. This menu will contain some logic and data from database. My question is: the navigation menu is on my shared _Layout.cshtml and I need to apply some logic behind this. So, how can I do this? Can I create a "MasterPageController"?</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
5,837,739
5,837,740
key arrow navigation on ul li not on input form
<p>I would like to add arrow key navigation for ul li item on my page using jquery, however on the same page there is a form with input text. Problem is the input text also catch the key arrow event. How to go about so only the ul li container catch these event, not others. Thanks in advance.</p>
javascript jquery
[3, 5]
5,404,051
5,404,052
remove rows of a table except the first 2
<p>How can i do that?</p> <p>thanks</p>
c# asp.net
[0, 9]
5,979,729
5,979,730
one button two actions
<p>i want to submit data from one button in the databse and the same button should export the CSV of the databse, i tried but it doesn't work only dat is being sent i have two buttons </p> <pre><code>&lt;div class="mws-form-item large"&gt; &lt;input type="submit" class="button" name="submit1" value="Generate Serials" /&gt; &lt;a href="get_csv.php" style="text-decoration:none"&gt; &lt;input type="button" name="get_csv" value="Export CSV"/&gt;&lt;/a&gt; &lt;/div&gt; and tried the in the following way &lt;div class="mws-form-item large"&gt; &lt;a href="get_csv.php" style="text-decoration:none"&gt; &lt;input type="submit" class="button" name="submit1" value="Generate Serials" /&gt; &lt;/a&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
5,769,294
5,769,295
Multiple autosuggest fields, filters depending on previous results
<p>I'm trying to figure out a method to see if it is possible to have one text field value (the result of a mysql query of an autosuggest field) be used as a filter for another mysql query for another autosuggest field. As in first field autosuggests a country, and the second field would autosuggest a city based in that country, reading from the mysql results.</p> <p>I've been using nodstrum's tutorial for the autosuggester, <a href="http://www.nodstrum.com/2007/09/19/autocompleter/" rel="nofollow">http://www.nodstrum.com/2007/09/19/autocompleter/</a>, and everything seems to be working, but the only method for multiple fields I can think of is having several "rpc.php" files that have different queries within. Any suggestions?</p>
php javascript
[2, 3]
1,452,900
1,452,901
allow only .25, .50 and .75 in a text box
<p>I am working on a web application and using javascript to restrict or round off a value. Whenever I enter any decimal value in a textbox, it should be rounded off to .25, .50, .75, or .00. any idea how to do that? Even if am able to enter only .25, .50, .75 and .00 is also fine... but how to restrict for only these specific values?</p>
javascript jquery
[3, 5]
2,340,899
2,340,900
How to add my custom View to layout in xml?
<p>There is the following xml:</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="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;com.ulnda.calendarapplication.MyCalendarView android:id="@+id/calendarView" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>MyCalendarView:</p> <pre><code>public class MyCalendarView extends CalendarView { public MyCalendarView(Context context) { super(context); } @Override public void setOnClickListener(OnClickListener listener) { // View v; // v.setOn } @Override public boolean performClick() { Log.e("event", "perform_click"); return true; } } </code></pre> <p>All is good, but when I'm trying to execute this application I'll have got the following message:</p> <pre><code>10-19 12:59:30.037: E/AndroidRuntime(30968): FATAL EXCEPTION: main 10-19 12:59:30.037: E/AndroidRuntime(30968): android.view.InflateException: Binary XML file line #7: Error inflating class com.ulnda.calendarapplication.MyCalendarView </code></pre> <p>How can I fix it?</p>
java android
[1, 4]
5,773,985
5,773,986
sorting xml in javascript/jquery
<p>I was trying to sort some xml with jquery, but this code doesn't affect the actual xml or not returning a sorted result.</p> <p>Anything wrong with this code?</p> <pre><code>$(xml).find('Tag').get().sort(function(a, b) { return $(a).find('Name').text() &lt; $(b).find('Name').text() ? -1 : 1; }); </code></pre>
javascript jquery
[3, 5]
5,581,924
5,581,925
How to get a server-side variable into JavaScript
<p>I want to pass a value to this JavaScript from the database (using datareader in asp.net(C#)).</p> <p>The script is from <a href="http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm" rel="nofollow">http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm</a></p> <p>I need to set a pass value in the below line:</p> <pre><code>leftrightslide[cnt] = '&lt;a href="MYWEBPAGE"&gt;&lt;img src="MYIMAGE FRM DATABASE.gif" border=1&gt;&lt;/a&gt;'; cnt++; </code></pre> <p>So the value of the datareader would be passed into the JavaScript array.</p>
asp.net javascript
[9, 3]
1,438,159
1,438,160
Sitemap node link not working?
<p>Not sure why, but this is how the sitemap is setup (top portion of it for brevity). All of the child links work fine, but the main one (default.aspx) doesn't do anything when clicked on. Hovering shows the proper link however.</p> <pre><code> &lt;siteMapNode url="~/" title="MainTitle"&gt; &lt;siteMapNode url="~/default.aspx" title="Home" &gt; &lt;siteMapNode url="~/Login.aspx" title="Login" /&gt; &lt;siteMapNode url="~/AccessDenied.aspx" title="Access Denied" DisplayInSiteMap="false" /&gt; &lt;/siteMapNode&gt; </code></pre> <p>And as an aside, it doesn't matter what link I put in there, it simply doesn't fire.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
298,487
298,488
Whats wrong with my site's code?
<p>I may be a bit burned out, but is there something wrong with where I put the code on my site?</p> <p>Live on my site, not working at all <a href="http://japaneselanguagefriend.com/apptest.html" rel="nofollow">http://japaneselanguagefriend.com/apptest.html</a></p> <p>Here it is on JSfiddle working just fine. <a href="http://jsfiddle.net/adeneo/PT523/3/" rel="nofollow">http://jsfiddle.net/adeneo/PT523/3/</a></p> <p>Thanks to Adeneo for helping with this code!</p>
javascript jquery
[3, 5]
164,294
164,295
How can I view an object with an alert()
<p>I tried to do a debug but I am having problems. Now I try with <code>alert()</code>. For example I want to see the value of:</p> <pre><code>var product = { ProductName: $('!Answer_Response[0]').val(), UnitPrice: $('#Price').val(), Stock: $('#Stock').val() }; </code></pre> <p>When I say <code>alert(product)</code> it just gives me <code>[object Object]</code>. How can I make alert show what's really there?</p>
javascript jquery
[3, 5]
2,714,111
2,714,112
Detecting if a listener has be registered
<p>how can i detect if a new listener has been registered for any widget in my android app. Is there a place where i can intercept the listener when its being registered ?</p>
java android
[1, 4]
1,700,630
1,700,631
jQuery append not completing before next statement?
<p>I have a survey-type form that's being populated from a web database on the client. I can populate the questions fine, but then I try to go through and trigger the click event where there is an existing answer (edit scenario), I'm finding that the new elements are not yet in the DOM so this doesn't work. Here's the code:</p> <pre><code>$(function() { var db = openDatabase(...); db.transaction(function(tx) { tx.executeSql("select ....", [surveyId], function(tx, results) { var items = "", answers = []; for (var i = 0; i &lt; results.rows.length; i++) { var id = results.rows.item(i).id; items += "&lt;div&gt;&lt;input type='radio' name='q-" + id + "' id='q-" + id + "-1' /&gt;&lt;label for='q-"+id+"-1'&gt;Yes&lt;/label&gt;&lt;input type='radio' name='q-" + id + "' id='q-" + id + "-2' /&gt;&lt;label for='q-"+id+"-2'&gt;No&lt;/label&gt;&lt;/div&gt;"; if (result.rows.item(i).answer) { answers.push('#q-'+id+'-'+results.rows.item(i).answer); } } $('#questions-div').append(items); $.each(answers, function(i, e) { $(e).click(); }); }); }); }); </code></pre> <p>Any tips how I can make this work, or better generally?</p>
javascript jquery
[3, 5]
239,472
239,473
Design pattern to support last-in callbacks (e.g. handling hashchange)
<p>On my web page, I have multiple independent plug-ins (for lack of a better word) that all interact with the <code>location.hash</code> of the browser. (I have a bit of code that keeps their work separated, but that's irrelevant to this question.) For example, I have:</p> <pre><code>// file1.js $(window).bind('hashchange', function(){ ... } ); // file2.js $(window).bind('hashchange', function(){ ... } ); </code></pre> <p>The above works as desired when the hash changes after the page loads. However, I also need this code to process whatever hash the page initially loads with. If I write this code:</p> <pre><code>// file1.js $(window).bind('hashchange', function(){ ... } ).trigger('hashchange'); // file2.js $(window).bind('hashchange', function(){ ... } ).trigger('hashchange'); </code></pre> <p>...then the first set of code will be run twice. Not desirable.</p> <p>What's a good pattern for triggering the <code>hashchange</code> event only once, after all event handlers have been put in place?</p>
javascript jquery
[3, 5]
2,005,432
2,005,433
clear interval if criteria not met
<p>In a nut shell, I need to clear an interval for a function called <code>newsCheck</code> if the users not on the home page. Seems simple enough, i thought so too. This is causing me huge problems. I use a history api which is why the interval would not clear on page reloads and changes.</p> <p>Here's what I have with the unimportant scripting left out </p> <pre><code>//only run if on home page if (url == 'Home' || url == '' || url == 'home' || url == 'home.html' || url == 'Home.html'){ //set up interval handler for cancellation when not on home var handle=self.setInterval(function(){newsCheck()},1000); // ... }//close if Home clause else { handle = self.clearInterval(handle); } </code></pre> <p>Okay, <code>newsCheck</code> is a function that checks for new information from the database via ajax query (polling). This needs to be cancelled when not on home as theres no need for it.</p> <p><strong>Extra info on history api</strong></p> <p>I need to cancel the interval because I use a history API script to load in new pages therefore the function keeps on running even if we are not on the Home page.</p> <p>To combat this I put this in the <code>loadContent</code> function of the history API.</p> <pre><code>$.ajax({ type: "GET", url: "AJAX/request_feed.js", dataType: "script" }); </code></pre> <p>As you can see it runs whatever page we're on so that the <code>newsCheck</code> function can be cancelled. This is why I have the url check in the script above.</p> <p>In the script with the <code>newsCheck</code> function I have put the url variable before the <code>(document).ready</code> so that the url is retrieved when the url has changed to the new url so it doesn't fetch the url of the previous page instead. Then we check for URL and run script if on <code>Home</code> and if not we clear the interval.</p>
javascript jquery
[3, 5]
1,229,854
1,229,855
null is null or not an object javascript error
<p>I have a div which has flash(Open flash chart) inside it . When I try to remove child divs with <code>$("#mydiv").children().remove()</code> it shows a javascript error in IE 8:</p> <blockquote> <p>null is null or not an object javascript error</p> </blockquote> <p>If the same div when there is no flash works fine without any issue .</p> <p>Any suggestion on how to fix this ?</p>
javascript jquery
[3, 5]
5,940,484
5,940,485
How do I create an object in TimerTask in Android?
<p>I'm trying to make the canvas draw some pictures in a fixed period of time. It's like an item showing on the screen and it disappears after 5 seconds. Then after another 3 seconds, a new item is drawn and last for another 5 seconds. I used Timer and TimerTask as below</p> <pre><code> public class PowerUpMaking extends TimerTask{ public void run() { test = 1; powerUp = new Powerup(players.get("player1"),getHeight()); } } </code></pre> <p>I declared powerUp in the constructor. Whole thing is in a class that extends View. What I want to do is just to create a new object for the reference variable. It turns out the first line is working but the second line is not by checking the log. How am I supposed to deal with this situation? Many many thanks if anyone can help. First time to ask a question here actually.</p>
java android
[1, 4]
2,917,036
2,917,037
Trouble with .attr('title')
<p>I am trying to retrieve the title attribute and replace the current paragraph text with it. Everything else about my script is working perfectly. The title attribute is coming back as "undefined". I am new to javascript and I have looked all over for answers... nothing that I am seeing so far. </p> <p><strong>JS:</strong></p> <pre><code>$(document).ready(function(){ $('.thumbnails a').click(function(e){ e.preventDefault(); $('.thumbnails a').removeClass('selected'); $('.thumbnails a').children().css('opacity','1'); $(this).addClass('selected'); $(this).children().css('opacity','.4'); var photo_caption = $(this).attr('title'); var photo_fullsize = $(this).attr('href'); var photo_preview = photo_fullsize.replace('_large','_preview'); $('.preview').html('&lt;a href="'+photo_fullsize+'" title="'+photo_caption+'" style=background-image:url('+photo_preview+')&gt;&lt;/a&gt;'); $('.caption').html('&lt;p&gt;&lt;a href="'+photo_fullsize+'" title="'+photo_caption+'"&gt;View larger&lt;/a&gt;&lt;/p&gt;&lt;p&gt;'+photo_caption+'&lt;/p&gt;'); }); }); </code></pre> <p><strong>HTML:</strong></p> <pre><code>&lt;li&gt; &lt;a href="images/webdesign/indiePantry_large.jpg" target="_blank"&gt; &lt;img src="images/webdesign/indiePantry_thumbnail.jpg" width="160" height="160" title="Indie Pantry" /&gt; &lt;/a&gt; &lt;/li&gt; </code></pre>
javascript jquery
[3, 5]
2,861,302
2,861,303
javascript: how to loop through date object
<p>I'm not sure how to ask this, but is there a way to get the current local full year and then create a loop to get the last 18 years and print them to the screen?</p> <p>Here is what I've tried...</p> <pre><code>function allYears(){ var d = new Date(); var y = d.getFullYear(); var years = ''; for(var i=0; i&gt;18; i++){ years += '&lt;option value="'+y+'"&gt;'+y+'&lt;/option&gt;'; y = y-1; } return(years); } </code></pre>
javascript jquery
[3, 5]
648,729
648,730
Android using data out of datepicker
<p>Im trying to get the Day / Month / Year from my datepicker. I have the problem that the Month en the day never is correct. I give you the code below. The month is correct but it fails when the month is december. The day is never correct.</p> <pre><code> public class myOnDateChangedListener implements OnDateChangedListener { public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) { if (view.getId() == R.id.datePicker1) { startDay = view.getDayOfMonth(); if(view.getMonth() == 11){ startMonth = 12; }else{ startMonth = (view.getMonth() + 1); } startYear = view.getYear(); } if (view.getId() == R.id.datePicker2) { endDay = view.getDayOfMonth(); if(view.getMonth() == 11){ endMonth = 12; }else{ endMonth = (view.getMonth() + 1); } endYear = view.getYear(); } } } </code></pre>
java android
[1, 4]
5,151,517
5,151,518
Hide/show a icon depending upon the location.search?
<p>Let us say i have a page <a href="http://www.abc.com/xyz.html" rel="nofollow">http://www.abc.com/xyz.html</a> and i am going to access this page in two ways</p> <ol> <li>simple as it is </li> <li>I will append some stuff to the url e.g. <a href="http://www.abc.com/xyz.html?nohome" rel="nofollow">http://www.abc.com/xyz.html?nohome</a> by just putting the value ?nohome manually in the code.</li> </ol> <p>Now i will add some javascript code something like this </p> <pre><code>$(document).ready(function () { if (location.search=="?value=nohome") { // wanna hide a button in this current page } else { // just show the original page. } }); </code></pre> <p>Any help will be appreciated. </p>
javascript jquery
[3, 5]
4,331,245
4,331,246
Get image size using JQuery/ javascript
<p>please tell me how to get image size of all images in the page using jquery or javascript</p>
javascript jquery
[3, 5]
1,298,890
1,298,891
How to upload files to ftp using asp.net and C#?
<p>I tried to upload image through ftp using asp.net &amp; c# but it doesn't work. Please guide me to solve the issue asap.</p> <pre><code>try { //host name //string ftphost = "fubar.walnut.com"; string ftphost = "fubar.walnut.com"; //file path string ftpfilepath = "/ProductImages/" + FileUpload1.FileName; string ftpfullpath = "ftp://" + ftphost + ftpfilepath; //create ftp request FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(ftpfullpath); //userid and password for the ftp server ftp.Credentials = new NetworkCredential("username", "password"); ftp.KeepAlive = true; ftp.UseBinary = true; ftp.UsePassive = true; //select method as upload file (STOR command) ftp.Method = WebRequestMethods.Ftp.UploadFile; FileStream stream = File.OpenRead(Server.MapPath("~/" + FileUpload1.FileName)); byte[] buffer1 = new byte[stream.Length]; stream.Read(buffer1, 0, buffer1.Length); stream.Close(); //get request stream Stream ftpstream = ftp.GetRequestStream(); ftpstream.Write(buffer1, 0, buffer1.Length); ftpstream.Close(); ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('Image uploaded successfully.'); window.location.href = 'UploadZipXML.aspx?ProductIsOpen=true';", true); return; } catch (Exception ex) { string excp = ex.Message; ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('Image not uploaded successfully." + excp + "')", true); return; } </code></pre>
c# asp.net
[0, 9]
4,629,626
4,629,627
How to enable javascript in asp.net webforms
<p>i am trying to use javascript events in asp.net webforms. but events for input controls like textfield, such as onClick, onFocus,onBlur, dont appear. do i need to change my directive:</p> <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/YourGuruMaster.master" AutoEventWireup="true" CodeFile="AskQuestion.aspx.cs" Inherits="AskQuestion" %&gt; </code></pre> <p>i want to be able to do this:</p> <pre><code>//code page protected void Page_Load(object sender, EventArgs e) { QuestionTextBox1.Attributes["onfocus"] = "ClearSearchText()"; //Markup page function ClearSearchText() { var searchUserName = document.getElementById('&lt;%=QuestionTextBox1.ClientID%&gt;'); if (searchUserName.value = searchUserName.defaultValue) { searchUserName.value = ""; } return false; } &lt;p dir="rtl" style=""&gt; &lt;asp:TextBox ID="QuestionTextBox1" runat="server" Width="702px" Text="פרטים עד 5000 תווים"&gt;&lt;/asp:TextBox&gt; </code></pre> <p></p></p>
c# javascript asp.net
[0, 3, 9]
3,643,508
3,643,509
javascript: how to judge a function name exists?
<p>Is it possible to judge if a function names exists before calling it?</p>
javascript jquery
[3, 5]
1,930,957
1,930,958
Stop executing JavaScript
<p>I have:</p> <pre><code>$('body').data('data1', '&lt;script type="text/javascript"&gt;console.debug('execute');&lt;/script&gt;&lt;div&gt;example&lt;/div&gt;'); </code></pre> <p>and:</p> <pre><code>&lt;div id="content"&gt;&lt;/div&gt; </code></pre> <p>when I do:</p> <pre><code>$(document).ready(function () { $('#content').html($('body').data('data1')); }); </code></pre> <p>then JavaScript is executed. How to prevent executing? Is it possible?</p>
javascript jquery
[3, 5]
2,630,119
2,630,120
Possible defect with jQuery ':checked' selector (finding checked checkbox when there are none)
<p>Found a strange thing. The following code is supposed to set a default value for a UI element based on whether one of a group of checkboxes (all having attribute name="privacy") is checked (in say, a form postback). If there is no value in the HTML sent by the server (the form is not a postback), the default value should be firstMenuItemKey. Otherwise, it should be the one checked in the underlying HTML.</p> <p>However, while this works on the first call to the URL that includes the form, a refresh of the page will set the value of defaultPrivacyValue to one of the privacy checkboxes'. I've checked that the server isn't checking the checkbox before the script runs (it's not). I've also checked whether somewhere else in the script is checking the checkbox (it's not).</p> <pre><code>var defaultPrivacyValue = firstMenuItemKey; $('input[name=privacy]:checked').each(function() { defaultPrivacyValue = $(this).next().find('.name').text(); }); selectMenuItem(defaultPrivacyValue); </code></pre> <p>When I chaged the selector to 'input[name=privacy][checked=checked]' it worked as expected. Is this a defect in the jQuery implementation of DOM retrieval based on the ':checked' selector???? I'm using jQuery 1.4.2.</p> <p>Thanks for any help you can give.</p>
javascript jquery
[3, 5]
2,858,160
2,858,161
what is sprintf in c#?
<p>what does this c++ code look like in c#?</p> <pre><code> sprintf(ff, "\\\\.\\%s", device); </code></pre>
c# c++
[0, 6]
3,510,637
3,510,638
Can I make the force open select in save/download dialog box?
<p>I use ASP.NET and C# to create file content from binary value</p> <pre><code>FileStruct currentFile = null; File file = new File(); currentFile = file.GetFile(FileID, strTableCode); Response.ContentType = currentFile.ContentType; Response.OutputStream.Write(currentFile.FileContent, 0, currentFile.FileContent.Length); Response.AddHeader("content-disposition", string.Format(@"attachment;filename=""{0}""", currentFile.FileName)); Response.Flush(); </code></pre> <p>I put this content in an <code>iframe</code> with jquery. After this an open/save dialog is shown. How can I force to open the file directly without open/save dialog?</p>
c# asp.net
[0, 9]
5,917,966
5,917,967
Custom Query Dynamic Data Application
<p>I am trying to use a Dynamic Data Application and having issues with customizing a query. Everything scaffolds wonderfully, however, I want to be able color code the main Parent table when a Child Objects Property is a certain value. Normally I would just iterate over the data using LINQ however, all the information I've researched always filters and color codes items in the grid based on the Parent level data. Any ideas on how to do this on Child Data?</p>
c# asp.net
[0, 9]
5,622,027
5,622,028
How to set focus on a view when a layout is created and displayed?
<p>Currently, I have a layout which contains a Button, a TextView and an EditText. When the layout is displayed, the focus will be automatically put on the EditText, which will trigger the keyboard to show up on Android phone. It is not what I want. Is there any way that I can set the focus on TextView or on nothing when a layout is displayed? Thanks.</p>
java android
[1, 4]
4,088,587
4,088,588
disabled control being reenabled but still not posting back contents to server
<p>I have a couple of radio buttons that are controlling text entry into a textarea.</p> <pre><code>&lt;tr id="trTextNote" runat="server"&gt; &lt;td colSpan="2"&gt;&lt;/td&gt; &lt;td class="IndentedCell" noWrap colSpan="2"&gt; &lt;asp:textbox id="txtIncludeNote" runat="server" Width="352px" Height="46px" TextMode="MultiLine" MaxLength="250"&gt; &lt;/asp:textbox&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>during the .ready, the textarea is being disbled with this</p> <pre><code>var textNote = $("[id$='txtIncludeNote']"); $(textNote).attr("disabled", "disabled"); $("[id$='lblHeaderNote']").addClass("disabledFont"); </code></pre> <p>Also, in the .ready I am attaching this to the click handlers of the radio buttons ...</p> <pre><code>$("input[id*='optIncludeNoteYes']").click(function() { $("[id$='lblHeaderNote']").removeClass("disabledFont"); $("[id$='txtIncludeNote']").removeAttr("disabled"); }); $("input[id*='optIncludeNoteNo']").click(function() { $("[id$='lblHeaderNote']").addClass("disabledFont"); $("[id$='txtIncludeNote']").attr("disabled", "disabled"); }); </code></pre> <p>On the client side, this all seems to be working perfectly, the text area is disbled when it should, and enabled/disabled when the clicks of the radio buttons happen. The issue is that when the user clicks the optIncludeNoteYes radio button, types in some data, and submits the page ... that data is not available on the server side. If they immediately post back again (with no changes) that data is then available. I put the autopostback = true on the radio buttons, just playing around, with no code behind it, and that fixes the issue as well.</p> <p>What am I missing?</p>
javascript asp.net jquery
[3, 9, 5]
3,546,238
3,546,239
How can I determine if a string only contains spaces, using javascript?
<p>How can I determine if an input string only contains spaces, using javascript?</p>
javascript jquery
[3, 5]
3,043,465
3,043,466
how to decode url param with c#
<p>how to decode url param to string with c#, e.g. my.aspx?val=%2Fxyz2F</p>
c# asp.net
[0, 9]
4,989,715
4,989,716
null reference with and if statement c#
<p>I am just want to check for empty text boxes and change the text the boxes if they are null in RowEditing event. I just can't figure this out. Of course the some of the boxes will be empty when the Grid is populated. The other question is am I placing this in the right event? </p> <p>Here is the row editing event :</p> <pre><code>protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { fill_grid(); //Set the edit index. GridView1.EditIndex = e.NewEditIndex; //Bind data to the GridView control. check_grid_boxes(); GridView1.DataBind(); } </code></pre> <p>Here is the check_grid_boxes Method : </p> <pre><code>protected void check_grid_boxes() { if (gtxtLane.Text == "") { gtxtLane.Text = "0"; } else if (gtxtCarriers.Text == "") { gtxtCarriers.Text = "0"; } else if (gtxtREV.Text == "") { gtxtREV.Text = "0"; } return; } </code></pre> <p>Before you mention Java Script or Jquery. This is a web control and my attempts at using java has not worked. </p> <p>I changed my code to this : </p> <pre><code> protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { fill_grid(); GridView1.EditIndex = e.NewEditIndex; var lane = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtLane"); var car = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtCarriers"); var badcar = (TextBox)GridView1.Rows[e.NewEditIndex].FindControl("gtxtBadCarriers"); if (String.IsNullOrEmpty(lane.Text)) { lane.Text = "0"; } else if (String.IsNullOrEmpty(badcar.Text)) { badcar.Text = "0"; } else if (String.IsNullOrEmpty(car.Text)) { car.Text = "0"; } GridView1.DataBind(); } </code></pre>
c# asp.net
[0, 9]
1,650,672
1,650,673
How can I browse the local network from a web client using C#?
<p>Our web client needs a way to browse the local network and select location for file storage. This will then be returned to the webpage as a UNC name.</p> <p>On a native client this easily accomplished by using Shell32 functions.</p> <p>I've looked at ASP FileUpload, but that returns the file vs. a specific directory.</p> <p>EDIT: Another option would be to execute this on the clientside using javascript.</p>
c# javascript
[0, 3]
1,965,475
1,965,476
Should we refer to objects by their interfaces in Android platform
<p>I use to the advice given by Joshua Bloch's Effective Java, <code>Item 52: Refer to objects by their interfaces</code>.</p> <p>However, in most of the sample code comes with Android, I realize the following code is quite common.</p> <pre><code>private ArrayList&lt;Integer&gt; mPhotos = new ArrayList&lt;Integer&gt;(); </code></pre> <p>I understand this is due to performance optimization purpose, as the following code will be slower.</p> <pre><code>private List&lt;Integer&gt; mPhotos = new ArrayList&lt;Integer&gt;(); </code></pre> <p>However, is such optimization technique still valid? As if I read from <a href="http://developer.android.com/guide/practices/design/performance.html" rel="nofollow">http://developer.android.com/guide/practices/design/performance.html</a></p> <blockquote> <p>On devices without a JIT, it is true that invoking methods via a variable with an exact type rather than an interface is slightly more efficient. (So, for example, it was cheaper to invoke methods on a HashMap map than a Map map, even though in both cases the map was a HashMap.) It was not the case that this was 2x slower; the actual difference was more like 6% slower. Furthermore, the JIT makes the two effectively indistinguishable.</p> </blockquote> <p>Do we need to assume our devices are without JIT, and refer objects without interfaces? Or, shall we just adopt to Joshua Bloch's advice?</p>
java android
[1, 4]
2,300,686
2,300,687
Which one is better approach window.parent.location.href or window.top.location
<p>I am working in a project where I have to redirect on Error Page in a particular scenario. For that I have created Error.aspx page. Right now I am using window.top.location.href = "../Error.aspx" and it generate <a href="http://localhost/app_web/Error.aspx" rel="nofollow">http://localhost/app_web/Error.aspx</a> and its working fine except once (which shows Message <a href="http://xyz/ErrorPage.aspx" rel="nofollow">http://xyz/ErrorPage.aspx</a>' does not exist. ). So can anyone suggest which is the better option for this.</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,424,231
2,424,232
Gridview itemTemplate control enable/disable using jQuery
<p>here is my code in asp.net... when it renders the code i have a <code>[checkbox]</code> with <code>[dropdownlist]</code> by default all the dropdownlist disabled when the page loads by doing like this:</p> <pre><code>var $ddls = $('select'); $ddls.prop("disabled", true); </code></pre> <p><strong>my question</strong> is: how to enabled the dropdown only when the checkbox is checked? and if the checkbox is unchecked then disabled the dropdown </p> <pre><code>&lt;asp:GridView ID="routePlanGridView" runat="server" AutoGenerateColumns="False" &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Reason"&gt; &lt;ItemTemplate&gt; &lt;div class="selectreason"&gt; &lt;asp:CheckBox CssClass="selectme" ID="chkReject" runat="server" Checked="false"&gt; &lt;/asp:CheckBox&gt; &lt;asp:DropDownList runat="server" ID="detail" &gt; &lt;asp:ListItem Selected="True" Value="0"&gt;Select me&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="1"&gt;one&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2"&gt;two&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="3"&gt;three&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="4"&gt;four&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre>
jquery asp.net
[5, 9]
3,599,109
3,599,110
the 'username' does not exist in the current context
<p>I am making a Login Page with ASP.Net using C#... and i have put my html code in <strong>Login.aspx</strong> page . that contains a textbox named username but when I give reference of my textbox in Login.aspx.cs to make the validations on this text box ... as </p> <pre><code>if(string.IsNullOrEmpty(username.Text)) { ... ... } </code></pre> <p>i am getting an error that is saying ...-<code>"The 'username' doesn't exist in the current context"</code>...... how can i get rid of this error .... it is making me mas .... Help will be appreciable towards this error ... please help me .... </p> <pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %&gt; &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; </code></pre>
c# asp.net
[0, 9]
5,903,130
5,903,131
id for each element showing undefined or 0 not being assigning different id's
<p>I'm trying to assign a id to each link in my list like this,</p> <pre><code>for (var j = start; j &lt; stop; j++) { link = linkBase + json[j].relatedItemId; $('#citations').append('&lt;li&gt;&lt;a href="' + link + '" id="num" + j&gt;' + json[j].title + '&lt;/a&gt;&lt;/li&gt;'); alert($('a').attr('id')); } </code></pre> <p>it keeps giving me undefined or 0? Should I use $.each outside of the for loop instead?</p> <p>I was trying to use the for loop for two purposes but maybe that's not such a great idea?</p> <p><em><strong></em>*EDIT***</strong></p> <p>If I put my for loop inside of a function like,</p> <pre><code>// Loop function for each section var loopSection = function(start, stop) { // Http setup for all links var linkBase = "http://www.sciencebase.gov/catalog/item/"; // Link for citation information var link = ""; for (var j = start; j &lt; stop; j++) { link = linkBase + json[j].relatedItemId; var $anchor = $("&lt;a&gt;", { href: link, id: "id" + j, text: json[j].title }) // .parent() will get the &lt;li&gt; that was just created and append to the first citation element $anchor.appendTo("&lt;li&gt;").parent().appendTo("#citations"); } } </code></pre> <p>I'm not able to access the id from outside of the function</p> <pre><code>$('#citations').on('click', function (e) { e.preventDefault(); var print = ($(this).attr('id')); alert(print); }); </code></pre>
javascript jquery
[3, 5]
3,636,924
3,636,925
Is there a way to shorten this code?
<p>Is there a shorter way (cleaner way really) to do the following code of mine?</p> <pre><code>if (whichToCheck == 1) { if ($('#input_3').val().length) { $('#error1').css('display', 'none'); $('#error1').css('visibility', 'hidden'); hasErrors = false; } else { $('#error1').css('display', 'block'); $('#error1').css('visibility', 'visible'); hasErrors = true; } } else if (whichToCheck == 2) { if ($('#input_4').val().length) { $('#error2').css('display', 'none'); $('#error2').css('visibility', 'hidden'); hasErrors = false; } else { $('#error2').css('display', 'block'); $('#error2').css('visibility', 'visible'); hasErrors = true; } } else if (whichToCheck == 3) { if ($('#input_5').val().length) { $('#error3').css('display', 'none'); $('#error3').css('visibility', 'hidden'); hasErrors = false; } else { $('#error3').css('display', 'block'); $('#error3').css('visibility', 'visible'); hasErrors = true; } } else if (whichToCheck == 4) { if ($('#input_7_0').is(':checked')) { $('#error4').css('display', 'none'); $('#error4').css('visibility', 'hidden'); hasErrors = false; } else { $('#error4').css('display', 'block'); $('#error4').css('visibility', 'visible'); hasErrors = true; } } else if (whichToCheck == 5) { if ($('#input_6').val().length) { $('#error5').css('display', 'none'); $('#error5').css('visibility', 'hidden'); hasErrors = false; } else { $('#error5').css('display', 'block'); $('#error5').css('visibility', 'visible'); hasErrors = true; } } </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
1,912,534
1,912,535
Add control/event dynamically doesn't work
<p>Any help would be appreciated --</p> <p>here is my aspx code -</p> <pre><code>&lt;div id="div_Detail" class="div_det" runat="server" /&gt; </code></pre> <p>and in my code behind -</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { LoadDetail(); } private void LoadDetail() { HtmlTable tbl = new HtmlTable(); HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); Button bUpdate = new Button(); bUpdate.Text = "Update"; bUpdate.Click += this.Update_Click; cell.Controls.Add(bUpdate); row.Cells.Add(cell); tbl.Rows.Add(row); div_Detail.Controls.Add(tbl); } private void Update_Click(object sender, EventArgs e) { //Do something } </code></pre> <p>I see the button on the page with the correct text. But on clicking that button, Update_Click never gets called.</p> <p>Am I missing something?</p>
c# asp.net
[0, 9]
2,096,343
2,096,344
How to make the image bounce from all the sides of the emulator screen
<pre><code> public class GraphicsView extends View implements OnTouchListener{...} public void onDraw(Canvas canvas){ Paint pint = new Paint(); pint.setColor(Color.BLUE); pint.setStrokeWidth(5); canvas.drawBitmap(pic,an.getX2(),an.getY2(),null); //canvas.drawBitmap(pic,another.getX(),another.getY(),null); //canvas.drawPoint(another.getX(), another.getY(), pint); invalidate(); } } class AnotherPosition implements Runnable { int x,y; Random rnd = new Random(); public int getX(){return x;} public int getY(){return y;} public int setX(){return x;} public int setY(){return y;} public void start(){ Thread t = new Thread(this); t.start(); //calls run method } public void run(){ while(true){ y+=13; if (y&gt;400){ y=5; x=rnd.nextInt(240); } try{ Thread.sleep(100); }catch(Exception ex){ } } } </code></pre> <p>What algorithm should i use to complete my code? The ball should bounce in all corners of the screen. Thank you for your time.</p>
java android
[1, 4]
1,806,309
1,806,310
Get Checkbox Value Using jQuery
<p>I want to display an error message or success message depending whether a textbox value is empty or has a value.</p>
javascript jquery
[3, 5]
1,810,922
1,810,923
java.lang.outofmemoryerror on create bitmap
<p>I receive big image (png, >30Mb) and create bitmap for it. And get java.lang.OutOfMemoryError. I try to catch such exception:</p> <pre><code>try { Bitmap bmp = BitmapFactory.decodeStream(someStream); } catch (OutOfMemoryError e) { ; } </code></pre> <p>With 2.2 SDK it works well. But with 2.3 app fails with uncatched exception. I don't understand, why?</p> <p>Thanks!</p>
java android
[1, 4]
590,131
590,132
Select all elements except a div and its contents
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1467226/jquery-target-all-except">jQuery: Target all except ___?</a> </p> </blockquote> <p>I've got a script that detects clicks on every element on the page. I'd like that to run on everything except a specific div and its children.</p> <p>I've tried doing this using the :not selector, but don't really understand how to use that effectively, so I'm not sure if that's the right way to go or not.</p> <p>Here's some sample code:</p> <pre><code>&lt;div id="clickme"&gt;This is good stuff&lt;/div&gt; &lt;div id="dontclickme"&gt;This should not get selected&lt;/div&gt; </code></pre> <p>I'm currently using <code>$("*")</code> for my selector. Is there a way to use that to detect if it's the second div, or any of its children?</p>
javascript jquery
[3, 5]
989,125
989,126
call c++ function from javascript function
<p>I am developing a IE plugin using ATL/COM using C++ in VS10. I successfully inserted JavaScript code in page. My Script runs on click event. It works fine. Now, I want when the method in javascript called(on click), I want it call C++ function passing argument.</p> <p>Thanks in advance.</p>
javascript c++
[3, 6]
1,544,615
1,544,616
How to get current time for different time server in java?
<p>i have three time server,time-nw.nist.gov, time1.ucla.edu ,time.ien.it now how can i get current time for all this server in java/android?</p>
java android
[1, 4]
4,614,668
4,614,669
JQuery click event not working correctly after class change
<p>I have JQuery script similar to this:</p> <pre><code>$('.follow_link').click(function(){ // Do some stuff $(this).removeClass(); $(this).addClass("unfollow_link"); }); $('.unfollow_link').click(function(){ // Do some stuff $(this).removeClass(); $(this).addClass("follow_link"); }); </code></pre> <p>My problem is that after I change the class the link is still refering to it's old class' click event. Is there a way of rebinding? Or am I doing this a bad way?</p>
javascript jquery
[3, 5]
4,005,568
4,005,569
How to get UL's if child attribute using jquery?
<p>i want to know how to get Unorderedlist's first child className. I know the UL's ID. How can i find it with jQuery?</p> <p>Thanks in Advance!!</p>
javascript jquery
[3, 5]
5,779,477
5,779,478
How to change WebView Height?
<p>I load in WebView some table from res. These tables have a different size. How do I change the size of the height of the WebView content?</p> <p>I tried:</p> <pre><code>LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); myWebView.setLayoutParams(params); </code></pre> <p>after load content but it doesn't work...</p>
java android
[1, 4]
2,198,433
2,198,434
Panel set to hidden and then visible loses textbox values
<p>I hope I can explain this properly.</p> <p>I have a grid that is part of our 3rd party shopping cart software. This grid has a row of quantity text boxes into which the customer enters how many of each thing they want to buy.</p> <p>I put this grid inside a panel so I can set it on or off with</p> <pre><code>myPanel.Visible=true; </code></pre> <p>I also have a button to show and one to hide using the above code method. </p> <p>If I enter a value into a textbox and then click the hide button and then click the show button, when the panel reappears the values are zero. If I then reload the page (browser reload) then the value returns as it was originally. It's a pretty good magic trick but not what I need. What am I doing wrong?</p> <p>Eventually I want to select a date from a calendar while it is hidden but that is not in play yet... just the show/hide buttons. </p> <p>Thanks</p>
c# asp.net
[0, 9]
5,637,363
5,637,364
Webview - spaces in IMG SRC
<p>I have a ton of HTML files that have roughly 1000 images combined. Most have spaces in their names.</p> <p>I am loading these HTML files with </p> <pre><code>webView.loadDataWithBaseURL(url, data, "text/html", "UTF-8", null); </code></pre> <p>Also, the "Src" attribute is prepended with</p> <pre><code>file:///android_asset/images/ </code></pre> <p>Image files without spaces in their name work ie: </p> <pre><code>src="file:///android_asset/images/my_test_image.jpg" </code></pre> <p>However, images with spaces do not load the image ie:</p> <pre><code>src="file:///android_asset/images/my test image.jpg" </code></pre> <p>Is there any way to get the web view to load these images? Or, do some type of regex to replace spaces inside all "SRC" items with %20 (if that would even work)?</p> <p>My background in java is pretty limited, I am a C#/Obj-C programmer. So please help!!</p> <p>Thanks!</p> <p>ps: Most common answer will probably be "rename the images without spaces, and fix all the src tags", but obviously, 200 or so HTML files, and 1000's of images might take awhile.</p> <p>edit:</p> <p>I wrote this, but still doesnt work. I guess java/android doesnt handle %20?</p> <pre><code>Pattern p=null; Matcher m= null; String word0= null; p= Pattern.compile(".*&lt;img[^&gt;]*src=\"([^\"]*)",Pattern.CASE_INSENSITIVE); m= p.matcher(data); while (m.find()){ word0=m.group(1); String originalString = word0.toString(); data = data.replaceAll(originalString, originalString.replaceAll(" ", "%20")); } </code></pre>
java android
[1, 4]
2,062,867
2,062,868
'$' is undefined javascript error
<pre><code>&lt;script type="text/javascript"&gt; $(function() { $('#WaterMark').draggable( { start: function(e, ui) { }, cursor: 'move', zIndex: 2700, revert: 'invalid', containment: '#OriginalImageContainer' }); $('#OriginalImage').droppable({ hoverClass: 'DroppableOver', drop: InitializeWaterMark }) }); var InitializeWaterMark = function() { var position = $('#WaterMark').position(); var imgPosition = $('#OriginalImageContainer').position(); document.getElementById('xpos').value = position.left - imgPosition.left; document.getElementById('ypos').value = position.top - imgPosition.top; } &lt;/script&gt; </code></pre> <p>this is a sample javascript code i got regarding drag and drop of images in a asp.net webpage...But it returns a error stating <strong>'$' is undefined</strong>..please help me out</p>
jquery asp.net
[5, 9]
46,219
46,220
Detect which dropdown selected and return its value and ID
<p>I have few drop-down boxes. Is there any way to detect which dropdown was changed using jquery ?</p> <pre><code>&lt;form id="products"&gt; &lt;select id="Ram"&gt; &lt;option value="0"&gt;4 GB&lt;/option&gt; &lt;option value="1"&gt;8 GB&lt;/option&gt; &lt;/select&gt; &lt;select id="Hdd"&gt; &lt;option value="0"&gt;300 GB&lt;/option&gt; &lt;option value="1"&gt;500 GB&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre> <p>Javascript/Jquery</p> <pre><code>$(document).ready(function() { $('#products').change(function() { var value = $(this).val(); //In here I want to detect and return the value. alert(value); // Want to return dropdown ID and its selected value }); }); </code></pre>
php javascript jquery
[2, 3, 5]
1,071,847
1,071,848
How to acces a flag set in sql server into business logic
<pre><code>public int InsertCompanyDetailsInformation(int companyId, int bankId, int accountNo, string accountType) { int rowsAffected = -1; int returnValue; try { SqlConnection con = DBProvider.GetDbConnection(); using (con) { con.Open(); SqlCommand objCmd = new SqlCommand("dbo.sp_InsertCompanyDetailsInformation", con); objCmd.CommandType = CommandType.StoredProcedure; objCmd.Parameters.AddWithValue("@companyId", companyId); objCmd.Parameters.AddWithValue("@bankId", bankId); objCmd.Parameters.AddWithValue("@accountNo", accountNo); objCmd.Parameters.AddWithValue("@accountType", accountType); rowsAffected = objCmd.ExecuteNonQuery(); SqlParameter sqlParam = objCmd.Parameters.Add("@insert_flag", SqlDbType.Int); objCmd.Parameters["@insert_flag"].Direction = ParameterDirection.ReturnValue; returnValue = int.Parse(objCmd.Parameters["@insert_flag"].Value.ToString()); con.Close(); } } catch (Exception ex) { throw ex; } return rowsAffected; } </code></pre> <p>and stored procedure</p> <pre><code>USE [SGTime_Development] GO /****** Object: StoredProcedure [dbo].[sp_InsertCompanyDetailsInformation] Script Date: 01/04/2011 14:31:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[sp_InsertCompanyDetailsInformation] ( @companyId int, @bankId int, @accountNo int, @accountType varchar(50)) AS BEGIN SET NOCOUNT ON; declare @insert_flag int; if not exists(select AccountNo from [Company_Account_Details] where AccountNo=@accountNo) begin INSERT INTO [Company_Account_Details] ( Company_Id, BankID, AccountNo, AccountType) values (@companyId, @bankId, @accountNo, @accountType) set @insert_flag=1; END else begin set @insert_flag=-1; end return @insert_flag; end </code></pre> <p>I am getting error in the code i want return returnValue in InsertCompanyDetailsInformation Please help how we can return returnValue</p>
c# asp.net
[0, 9]
3,595,163
3,595,164
Mismatch data within intents
<p>I have an issue with mismatch data between putting data to intent and reading it. In my service I'm creating notification and adding parameters to the intent. When i see the notification the paramters is ok. But when I open the notification the parameters act wired. I get true parameters in my system but no the once i sent. is this problem because I'm creating notification in my service?</p> <pre><code>public void createNotification(ChatMessage message) { Notification notification = new Notification(R.drawable.ic_action_sm, "Message From" + " " + message.getSenderName(), System.currentTimeMillis()); notification.flags |= Notification.FLAG_AUTO_CANCEL; Intent intent = new Intent(this, ChatActivity.class); intent.putExtra("userProfile", message.getReciverChatProfile()); intent.putExtra("friendProfile", message.getSenderChatProfile()); PendingIntent activity = PendingIntent.getActivity(this, 0, intent, 0); notification.setLatestEventInfo(this, message.getSenderName(), message.getMessage(), activity); notification.number += 1; notification.iconLevel = 3; notificationManager.notify(0, notification); } </code></pre>
java android
[1, 4]
2,677,117
2,677,118
Executing Java programs through Python
<p>How do I do this?</p>
java python
[1, 7]
2,966,872
2,966,873
What will decode "email%2540yahoo.com" value in PHP?
<p>My variable with javascript looks like this:</p> <pre><code>var email = encodeURIComponent($('input[name=\'email\']').val()) </code></pre> <p><code>email</code> is clearly being encoded and is producing this when sent to server: <code>email%2540yahoo.com</code></p> <p>What function in PHP will decode this value properly?</p> <p>I've tried using <code><a href="http://php.net/manual/en/function.html-entity-decode.php/%20%22html_entity_decode" rel="nofollow">html_entity_decode</a></code></p>
php javascript
[2, 3]
16,648
16,649
translation did not work with ajax poupup extender
<p>I had translation solution in my website and I added code to translate datalist headers to arabic language this in dealer list page, also I added popup extender that ask user to register to see the dealer list data, If user put username and password the datalist worked well and headers translated well, but when user logged from home page the popup disappeared as user logged to website and the dealer list headers did not translate to arabic language. so please how can I do?</p> <p>if you want to see that online see this link <a href="http://beta.elarabygroup.com/DealerList.aspx" rel="nofollow">http://beta.elarabygroup.com/DealerList.aspx</a></p> <p>username:aaa password: 111</p> <pre><code> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { string LanguageID = Globals.GetSuitableLanguage(Page); sDirection = Globals.GetDirection(LanguageID); if (LanguageID == "ar") { foreach (DataControlField column in GridView1.Columns) { switch (column.HeaderText) { case "Name": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Telephone": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Address": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Mobile": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Location": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Category": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; case "Area": { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; default: { column.HeaderText = Globals.Translate(column.HeaderText, LanguageID); } break; } } } } </code></pre>
c# asp.net
[0, 9]
971,477
971,478
JQuery/javascript how do I get the ID of an object?
<pre><code>function cat() { this.getMyID = function() { alert(this.id); } ; } var bob = new cat(); // I want it to say 'bob' bob.getMyID(); </code></pre> <p><a href="http://jsfiddle.net/n7eHj/" rel="nofollow">http://jsfiddle.net/n7eHj/</a></p> <p>alerts undefined, any ideas?</p> <p>I'll elaborate, this is what I want to do - insert into an onclick method of a button something that calls another function, eg:</p> <pre><code>function cat() { this.render = function() { $('#myButton').attr('onclick', 'this.meow()'); }; } var bob = new cat(); bob.render(); </code></pre> <p>However this will fail because 'this.meow' is nonsense. If I knew the ID, ie. bob, then I could change it to do <code>.attr('onclick', theID + '.meow()'); };</code></p>
javascript jquery
[3, 5]
1,872,862
1,872,863
Check anchor tags color
<p>If I have anchor tags as follows:</p> <pre><code>&lt;a href="link1.html" class="none_standard_links"&gt;link one&lt;/a&gt;&lt;br /&gt; &lt;a href="link2.html" class="none_standard_links"&gt;link two&lt;/a&gt;&lt;br /&gt; &lt;a href="link3.html" class="none_standard_links"&gt;link three&lt;/a&gt;&lt;br /&gt; &lt;a href="link4.html" class="none_standard_links"&gt;link four&lt;/a&gt;&lt;br /&gt; &lt;a href="link5.html" class="none_standard_links"&gt;link five&lt;/a&gt;&lt;br /&gt; &lt;a href="link6.html" class="none_standard_links"&gt;link six&lt;/a&gt;&lt;br /&gt; &lt;a href="link7.html" class="none_standard_links"&gt;link seven&lt;/a&gt;&lt;br /&gt; &lt;a href="link8.html" class="none_standard_links"&gt;link eight&lt;/a&gt;&lt;br /&gt; &lt;a href="link9.html" class="none_standard_links"&gt;link nine&lt;/a&gt;&lt;br /&gt; &lt;a href="link10.html" class="none_standard_links"&gt;link ten&lt;/a&gt;&lt;br /&gt; </code></pre> <p>How do I loop through the entire set and alert the url of the link if it has a style sheet color of red?</p> <p>I have tried making a start with the script, but don't know how to finish off:</p> <pre><code>$(document).ready(function(){ $('#button1').click(function() { $(".none_standard_links").each(function (i) { if (this.style.color = "red") { alert("not sure what to do here?"); } }); }); }); </code></pre> <p>If the approach I am attempting is not the best way to go about doing this, please feel free to make changes.</p>
javascript jquery
[3, 5]
4,131,999
4,132,000
How can I notify my application that one file was deleted from the SDCard (Android)?
<p>I am saving a few songs in a playlist (in my application database). When a particular song is deleted from the SDCard which already exists in the playlist, how can I reflect the changes in my database?</p>
java android
[1, 4]
1,038,173
1,038,174
Dynamically change the HTML <img> src attribute using Java Script or JQuery
<p>I need to change the html img src value dynamically from the value from hidden text field using Jquery or Java script.</p> <pre><code>&lt;p&gt;&lt;img id="yui_img" height="333" width="345"&gt;&lt;/p&gt; function onImgChange() { document.getElementById('yui_img').src=document.getElementById('addProductLinksCreateForm:addProductLinkUrlValue').value; } </code></pre> <p>I got the value in the DOM but it is not getting reflected in it. Old image is maintained. </p>
javascript jquery
[3, 5]
3,862,622
3,862,623
javascript find value from array based on associative array key value
<p>I have an associative array:</p> <pre><code>var array1 = { a1: { id: "box1", title: "box 1" }, a2: { id: "box2", title: "box 2" }, a3: { id: "box3", title: "box 3" } }; </code></pre> <p>I then have another array which has references to the first array:</p> <pre><code>var array_order = ["a3:positionA", "a2:postitionB", "a1:positionC"]; </code></pre> <p>I want to loop through the first list and then use the second list to find the position text</p> <p>I am using jQuery so I have</p> <pre><code>$.each(array1, function(i,o) { something in here where I can use i to find out what position. e.g. if a1 I would get positionC } </code></pre>
javascript jquery
[3, 5]
5,285,214
5,285,215
Get value from GridView when a button is clicked
<p>I have a GridView , and the GridView has an item template. Now I need to get the value of the first cell which contains the value I need but I have tried the following and does not work, it eturns a ""</p> <pre><code> int id = Convert.ToInt32(GridView.Rows[index].Cells[0].Text); </code></pre> <p>Here is the code I have in the gridview</p> <pre><code>&lt;Columns&gt; &lt;asp:TemplateField HeaderText="ID"&gt; &lt;ItemTemplate&gt; &lt;asp:Label runat="server" ID="lblDepartmentID" Text='&lt;%#DataBinder.Eval(Container.DataItem,"DepartmentID")%&gt;' /&gt; &lt;/ItemTemplate&gt; &lt;HeaderStyle HorizontalAlign="Left" /&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>I have to emphazise that I do not want to use the GridView_RowCommand or other GridView events.. I need to pull this value upon clicking a button on the same page.</p> <p>How can I do this?</p>
c# asp.net
[0, 9]
5,070,203
5,070,204
Editing globals inside of a jquery request
<p>I'm using JQUERY to parse a XML file, while at it, I'm writing into multipple arrays. Now my big troubles is to pass the results of the arrays outside the script.</p> <pre><code>&lt;script type="text/javascript"&gt; //.... var ProjectList = new Array(); var N = 0; var ID = []; var A = []; $.get("urlaub.xml", function(GetList) { $(GetList).find("u").each(function() { var $U = $(this); ID.push($U.attr("id")); $(this).A.push($U.find("A").text()); N++; }); alert(N); //not 0! }); alert(N); //allways 0 // ......​​​ &lt;/script&gt; </code></pre> <p>So, I need to find a method to make the arrays and the variable N accessable from outside, and im failing at it.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
5,696,471
5,696,472
How to send bufferedImage from JAVA to PHP
<p>I am kinda noob with JAVA. Here's my problem :</p> <p>I am trying to take a screenshot of my JAVA application and send it to a PHP page. With the code i Have, The img file of the screenshot is created by the PHP but when you open it it's all black minus a small line of gibberish white/black;</p> <p>Did i miss something or what did i do wrong?</p> <p>JAVA code</p> <pre><code>File f = File.createTempFile("support", ".png"); this.imageFileName = f.getAbsolutePath(); Robot r = new Robot(); this.snapshot = r.createScreenCapture(this.frame.getBounds()); BOSHTTPClient http; http = newBOSHTTPClient(this.config.getHttpUrlName()+"?filename="+JBOSupportGlassPane.this.imageFileName); ImageIO.write(this.snapshot, ImageFormat.PNG, http.getOutputStream()); </code></pre> <p>PHP CODE</p> <pre><code>$fileData=file_get_contents('php://input'); $filename = substr($_REQUEST['filename'], strrpos($_REQUEST['filename'], '/')+1); $fhandle=fopen("screenshots/".$filename, 'wb'); fwrite($fhandle, $fileData); fclose($fhandle); echo("Done uploading"); </code></pre>
java php
[1, 2]
3,589,713
3,589,714
How to find the elapsed time between send and receive data?
<p>I am using the System.Timers.Timer class. And I enable when I send a message and disable when I receive the message. How do I calculate how much time has elapsed. I have set the interval as 1 sec </p> <p>Basically I retransmit data after 1000 sec again if I do not recive an ACK. I retransmit 5 times max until I get a Ack. If I receive and something before 150ms then I stop retrnsmission. </p> <p>Here's the code:</p> <pre><code>timer1.interval = 1000; port.Write(data) timer1.enabled = true; </code></pre> <p>event handler for the received data.</p> <pre><code>timer1.enabled=false; </code></pre>
c# asp.net
[0, 9]
1,078,332
1,078,333
Using FontSelector to change font family
<p>I am using jQuery font selector plugin posted here</p> <p><a href="http://www.fullfatcode.com/2011/04/10/jquery-font-selector-version-2/" rel="nofollow">http://www.fullfatcode.com/2011/04/10/jquery-font-selector-version-2/</a></p> <p>It's all good, except, I want to do something when the actual font is selected. At the moment the plugin is called via</p> <pre><code>$('input.font').fontSelector(); </code></pre> <p>I guess what I'd like to be able to do is, capture the event when the font is selected and then do something. Maybe</p> <pre><code>$('input.font').fontSelector(function(){ alert('hi'); }); </code></pre> <p>Here's what I have been playing with</p> <p><a href="http://jsfiddle.net/d7nQV/1/" rel="nofollow">http://jsfiddle.net/d7nQV/1/</a></p> <p>I tried</p> <pre><code>$('input.font').keyup(function(){ alert('hi'); }); </code></pre> <p>But it doesn't like it. </p>
javascript jquery
[3, 5]
5,293,759
5,293,760
socket Exception..Bad file number
<p>I have made an client server programe(Socket connection) to transfer images in android,when client connect to server socket than it write image bytes to client output stream,whent i read<br> client input stream and convert input stream to bitmap,it returns null or skia decoder return null,when i check bytes are receved or not ,it is received and when i write these bytes to sd card it creats the proper image,but i am not able to create bitmap from these byte....</p> <p>Any suggetion...thanks in advance</p>
java android
[1, 4]
1,365,875
1,365,876
How to assign null value to Hidden variable in javascript?
<p>I have a hidden input variable called str.</p> <p>I am assigning "abc" value to it.</p> <p>Then I try to assign null value or let's say null reference to it. But I couldn't.</p> <p><strong>Edit</strong></p> <p>part of code.</p> <p>Hidden Field...</p> <pre><code>&lt;input id="str" name="str" type="hidden" value="" /&gt; </code></pre> <p>I also use jQuery.</p> <pre><code>if ($(str).val() == "abc") { $("#str").val(null); } </code></pre>
javascript jquery
[3, 5]
955,916
955,917
Fetching javascript output using php
<p>For example i have this code in js.php</p> <pre><code>&lt;script type="text/javascript"&gt; document.write(Math.random()); &lt;/script&gt; </code></pre> <p>This gives output the random number, forexample: <code>0.123123123123</code></p> <p>Now, I have fetch.php I tried this code:</p> <pre><code>&lt;? echo file_get_contents("js.php"); ?&gt; </code></pre> <p>this gives output as:</p> <pre><code>&lt;script type="text/javascript"&gt; document.write(Math.random()); &lt;/script&gt; </code></pre> <p>But, I want output as <code>0.123123123123</code> -- which is the output generated by javascript. I don't want the source code, but the output of that code. How can I do this using PHP? </p> <p>Note: Random number is just a sample. I have something else to work on.</p>
php javascript
[2, 3]
3,012,435
3,012,436
Moving a Div to the Y position of a hovered Div (JQuery)
<p>My question is simple..</p> <p>I have a grid of images on the left, and on the right, I have a "slider box".</p> <p>When I hover over an image on the grid, I want the slider box to move to the Y position of the image I've hovered over, so they line up horizontally. What would be the best way to achieve this?</p>
javascript jquery
[3, 5]
3,963,957
3,963,958
how to get 1 hidden field among several within div
<p>i have 3 hidden fields in 1 div. when I have reference to this div, how to get 1 of the hidden fields in this div.</p>
javascript jquery
[3, 5]
5,007,839
5,007,840
Combine jQuery object with new selector
<p>How would you do a similar function as rsplak's answer here <a href="http://stackoverflow.com/a/7079032/1330629">http://stackoverflow.com/a/7079032/1330629</a> but include a defined variable in this? For example, I have a variable defined so that I'm not querying the DOM repeatedly, such as: <code>var $StartDateTime = $("#StartDateTime");</code></p> <p>and would like to include it with another selector, which I haven't defined as a variable.</p> <p>Is this possible? I'm thinking along the lines of:</p> <pre><code>$($StartDateTime,link,#upload_link2,#upload_link3").each(function(){ $(this).upload({ //whateveryouwant }); }); </code></pre> <p>But obviously that's not going to work..</p>
javascript jquery
[3, 5]
4,145,316
4,145,317
Best way to control page titles on a large website in ASP.NET
<p>We have a fairly large website with several master pages. Right now the titles are being controlled by Session variables in individual pages and set by the master page. The code is bad and needs to be redone. With the current system, since the master page is executed last, we can't completely overwrite the page title when needed from the page. What is the best way to create breadcrumbed page titles across a large site in ASP.NET with several master pages, without using Sessions variables? Session variables are bad for page titles mmmkkayy.</p>
c# asp.net
[0, 9]
3,163,884
3,163,885
What is the best way to remove/skip an item from collection
<p>what is the best way to remove/skip an item from collection object</p> <pre><code>List&lt;Person&gt; personList = new List&lt;Person&gt;() personList = dao.GetData(123); personList = personList.Select(x =&gt; x.Comment... ???? </code></pre> <p>resultset:</p> <pre><code>"GCE" Not available "" //comments "RES" 9.97000000 9.99000000 ........ ........ ........ </code></pre> <p>so, i am targeting the field called "comments" and if the comments are empty then dont render.</p> <p>i could have do that in <code>foreach</code> loop with an <code>if condition</code> but i am looking for the best practice</p>
c# asp.net
[0, 9]
2,989,456
2,989,457
Update contents of a comment thread without disturbing 'add comment'
<p>how do i refresh the contents of a div 'comment thread' without disturbing users input on the text field.Like in <code>Facebook</code> comment section ? I am using <code>Php</code>, <code>Jquery</code>, <code>Javascript</code>.</p> <pre><code>var auto_refresh = setInterval( function autorefresh() { var ipo = document.getElementById('commentarea'); $('#commentarea').load('processing.php'); }, 100); </code></pre> <p>The processing.php includes a while loop where all the div i.e. main content,like,comment is present.What i want to do is when user clicks on comment a div comes under it where other's comment are displayed and text field is displayed for users comment,similar to Facebook's comment view. How do I refresh the contents of the comments without disturbing the user's comment field.</p>
php javascript jquery
[2, 3, 5]
3,911,683
3,911,684
$(window).scroll not accurate, when scrolling fast
<p>I'm trying to manipulate element's position, so between certain page scroll position, his css is changed. Take a look at this simple example: <a href="http://jsfiddle.net/6RtTX/8/" rel="nofollow">http://jsfiddle.net/6RtTX/8/</a></p> <p>The problem is - <code>$(window).scroll</code> is not so accurate, so if i scroll very fast, it becomes really messy.</p> <p>Is there any way around for this problem? Can I queue those operations in $(window).scroll method?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
4,074,971
4,074,972
How do I from a JSON object convert to form of elements?
<p>I have a JSON object as <code>{a: 1, b: 2, c: [4, 5, 6], d: {x: 7, y: 8, z: [9, 0]}}</code>, how do I convert it to a form of elements?</p> <p>I want to convert to this:</p> <pre><code>&lt;input type="hidden" name="obj[a]" value="1"/&gt; &lt;input type="hidden" name="obj[b]" value="2"/&gt; &lt;input type="hidden" name="obj[c][]" value="4"/&gt; &lt;input type="hidden" name="obj[c][]" value="5"/&gt; &lt;input type="hidden" name="obj[c][]" value="6"/&gt; &lt;input type="hidden" name="obj[d][x]" value="7"/&gt; &lt;input type="hidden" name="obj[d][y]" value="8"/&gt; &lt;input type="hidden" name="obj[d][z][]" value="9"/&gt; &lt;input type="hidden" name="obj[d][z][]" value="0"/&gt; </code></pre> <p>Any ideas?</p>
javascript jquery
[3, 5]
2,200,651
2,200,652
JQuery inline dialog
<p>Is there an easy way to convert a standart popup dialog into an inline dialog?</p>
javascript jquery
[3, 5]
1,627,385
1,627,386
Selecting radiobuttons populated within asp.net RadioButtonList with jQuery
<p>Hello and thanks in advance for the communal help I always find here. I have been tinkering around with what should seem a pretty straight forward task even for a jQuery newb as myself. I have a radiobuttonlist control bound to a collection:</p> <pre><code>&lt;asp:RadioButtonList ID="radBtnLstPackageSelector" runat="server" CssClass="PackageS"&gt; &lt;/asp:RadioButtonList&gt; </code></pre> <p>My form does have several other controls of the same type; Now, the challenge is to select and wire up a on Click event for every radiobutton from the radBtnLstPackageSelector.<br> I have tried several approaches such as:</p> <pre><code>var results1 = $(".PackageS").children("input"); var results1 = $(".PackageS").children("input[type=radiobutton"); var results1 = $("table.PackageS &gt; input[type=radiobutton"); </code></pre> <p>with no luck... Your help would be great right now! ~m</p>
asp.net jquery
[9, 5]
2,496,761
2,496,762
Going from PHP to C/C++ & Java & beyond
<p>I've been a LAMP developer for 5+ years. I have learned quite a bit on my own, but I feel like my "context" as a software developer is limited (ie. I can only create scripts &amp; web applications). Ultimately I'd like to be able to create a range of applications from daemons to desktop apps. Additionally I'd like to learn more about the "internals" of programming (ie. PHP is a wrapper for c, perhaps I should learn more c?)</p> <p>I'd like to know what resources &amp; methods that have helped people further their knowledge of computer science / software creation. Unfortunately I don't think I'll be able to go back to school and get another degree :-P</p>
java php c++
[1, 2, 6]
3,810,862
3,810,863
Safari doesn't notice site change/back button doesn't change page
<p>I have a Drupal website which also has a mobile section. I even tried linking the back button to a whole new website and it still doesn't do what it should. I'm sure the code is correct though:</p> <pre><code>&lt;a id="backButton" class="button" href="http://www.stackoverflow.com"&gt;&lt;/a&gt; </code></pre> <p>Does anyone have any idea where the issue is, please?</p> <p>Done. I set the href to history.go(-1); and it works flawlessly.</p>
php javascript
[2, 3]
2,132,167
2,132,168
How to use an int from another class?
<p>Im trying to use an integer, that Im using in one class and also use the SAME int in a different class. I forgot, what do I have to do for that?</p> <p>static? implements? extends? what?</p> <p>Best regards,</p> <p>For simplicity:</p> <pre><code> public class ETBetaActivity extends Activity implements View.OnClickListener { public static int anInt = 50; </code></pre> <p>Another class</p> <pre><code> public class GUI extends Activity implements View.OnClickListener { public static int anInt_2 = 5+anInt; </code></pre>
java android
[1, 4]
2,573,312
2,573,313
How to remove an element slowly with jQuery?
<p><code>$target.remove()</code> can remove the element,but now I want the process to be down with some feel animation,how to do it?</p>
javascript jquery
[3, 5]
5,318,519
5,318,520
Get the upload progress
<p>My upload method as below:</p> <pre><code>private void upload(String Server, String FilePath, String SavePath, String NewName) { String end = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; try { URL url = new URL(ActionUrl); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestMethod("POST"); con.setRequestProperty("Connection", "Keep-Alive"); con.setRequestProperty("Accept", "text/*"); con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); ds = new DataOutputStream(con.getOutputStream()); ds.writeBytes(twoHyphens + boundary + end); ds.writeBytes("Content-Disposition: form-data;" + "name=\"folder\"" + end + end); ds.write(SavePath.getBytes("UTF-8")); ds.writeBytes(end); ds.writeBytes(twoHyphens + boundary + end); ds.writeBytes("Content-Disposition: form-data;" + "name=\"Filedata\"; filename=\""); ds.write(NewName.getBytes("UTF-8")); ds.writeBytes("\"" + end); ds.writeBytes(end); FileInputStream fStream = new FileInputStream(uploadFile); int bufferSize = 1024; byte[] buffer = new byte[bufferSize]; int length = -1; while((length = fStream.read(buffer)) != -1) { ds.write(buffer, 0, length); } ds.writeBytes(end); ds.writeBytes(twoHyphens + boundary + twoHyphens + end); fStream.close(); ds.flush(); InputStream is = con.getInputStream(); int ch; StringBuffer b = new StringBuffer(); while((ch = is.read()) != -1) { b.append((char)ch); } System.out.println("UPLOAD" + "SUCCESS"); ds.close(); } catch(Exception e) { e.printStackTrace(); } } </code></pre> <p>I found the line <code>InputStream is = con.getInputStream();</code> spend most time. But how to get the progress of it send? Or how to modify my method to upload file "by parts"?</p>
java android
[1, 4]