Questions

How to get the ASCII value of a character

How do I get the [ASCII](http://en.wikipedia.org/wiki/ASCII) value of a character as an `int` in Python?

9 Apr at 09:49

Open link in new tab or window

Is it possible to open an `a href` link in a new tab instead of the same tab? ``` <a href="http://your_url_here.html">Link</a> ```

15 Sep at 11:14

How can I see the changes in a Git commit?

When I do `git diff COMMIT` I see the changes between that commit and HEAD (as far as I know), but I would like to see the changes that were made by that single commit. I haven't found any obvious op...

11 Apr at 09:19

Combine two columns of text in pandas dataframe

I have a 20 x 4000 dataframe in Python using pandas. Two of these columns are named `Year` and `quarter`. I'd like to create a variable called `period` that makes `Year = 2000` and `quarter= q2` into ...

13 Aug at 23:27

Preview an image before it is uploaded

I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image. How can I do this?

6 Sep at 10:49

Show a number to two decimal places

What's the correct way to round a PHP string to two decimal places? ``` $number = "520"; // It's a string from a database $formatted_number = round_to_2dp($number); echo $formatted_number; ``` Th...

No connection could be made because the target machine actively refused it?

Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too. --- --- ``` ServicePointManager.CertificatePolicy = new TrustAllCertificate...

CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

I have the following page (deadlink: `http://www.workingstorage.com/Sample.htm` ) that has a footer which I can't make sit at the bottom of the page. I want the footer to - - The CSS is inherited and...

7 Sep at 13:6

How can I print variable and string on same line in Python?

I am using python to work out how many children would be born in 5 years if a child was born every 7 seconds. The problem is on my last line. How do I get a variable to work when I'm printing text eit...

17 Jun at 17:58

Convert int to string?

How can I convert an `int` datatype into a `string` datatype in C#?

9 Jun at 04:33

How do I clone all remote branches?

My `master` and `development` branches are tracked remotely on [GitHub](http://en.wikipedia.org/wiki/GitHub). How do I clone both these branches?

Syntax for creating a two-dimensional array in Java

Consider: ``` int[][] multD = new int[5][]; multD[0] = new int[10]; ``` Is this how you create a two-dimensional array with 5 rows and 10 columns? I saw this code online, but the syntax didn't mak...

17 Jan at 00:44

How do I remedy "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?

A C# desktop application (on the Visual Studio Express edition) worked, but then it didn't work 5 seconds later. I tried the following: - - - - I have two Windows Forms projects in the solution. One ...

How to set java_home on Windows 7?

I went to the Environment Variables in 'System' in the control panel and made two new variables, one for user variables and one for system variables. Both were named JAVA_HOME and both pointing to > ...

How to get URL parameter using jQuery or plain JavaScript?

I have seen lots of jQuery examples where parameter size and name are unknown. My URL is only going to ever have 1 string: ``` http://example.com?sent=yes ``` I just want to detect: 1. Does sent...

Download File Using JavaScript/jQuery

I have a very similar requirement specified [here](https://stackoverflow.com/questions/1296085/download-file-using-jquery). I need to have the user's browser start a download manually when `$('a#some...

24 Jun at 23:8

How do I detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this...

4 Jan at 19:7

How can I update npm on Windows?

I tried [this](http://davidwalsh.name/upgrade-nodejs): ``` sudo npm cache clean -f sudo npm install -g n sudo n stable ``` ...but it didn't work. How do I do this on Windows?

12 Jan at 15:28

Check if element exists in jQuery

How do I check if an element exists if the element is created by `.append()` method? `$('elemId').length` doesn't work for me.

8 Sep at 16:10

How do I create a Java string from the contents of a file?

I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited. Is there a better/different way to read a file into a string in Java? ...

12 Sep at 17:54

'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

I'm trying to get data from an Excel file on a button click event. My connection string is: ``` string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\source\\SiteCore65\\Individual-D...

12 Mar at 08:2

jQuery get value of selected radio button

The problem statement is simple. I need to see if user has selected a radio button from a radio group. Every radio button in the group share same id. The problem is that I don't have control on how t...

24 Dec at 02:43

How do I escape a single quote in SQL Server?

I am trying to `insert` some text data into a table in SQL Server 9. The text includes a single quote `'`. How do I escape that? I tried using two single quotes, but it threw me some errors. eg. `inse...

How can I read input from the console using the Scanner class in Java?

How could I read input from the console using the `Scanner` class? Something like this: ``` System.out.println("Enter your username: "); Scanner = input(); // Or something like this, I don't know the...

21 Mar at 17:41

Get list from pandas dataframe column or row?

I have a dataframe `df` imported from an Excel document like this: ``` cluster load_date budget actual fixed_price A 1/1/2014 1000 4000 Y A 2/1/2014 12000 10000 Y A 3/1/2014 ...

22 Sep at 03:38