Questions

What is the difference between a URI, a URL, and a URN?

What is the difference between a [URL](http://en.wikipedia.org/wiki/Uniform_Resource_Locator), a [URI](http://en.wikipedia.org/wiki/Uniform_Resource_Identifier), and a [URN](http://en.wikipedia.org/wi...

6 Aug at 23:46

How do I encode and decode a base64 string?

1. How do I return a base64 encoded string given a string? 2. How do I decode a base64 encoded string into a string?

31 Jul at 15:6

Run Command Prompt Commands

Is there any way to run command prompt commands from within a C# application? If so how would I do the following: ``` copy /b Image1.jpg + Archive.rar Image2.jpg ``` This basically embeds an RAR f...

15 Feb at 21:14

How do I modify a specific commit?

I have the following commit history: 1. HEAD 2. HEAD~ 3. HEAD~2 4. HEAD~3 `git commit --amend` modifies the current `HEAD` commit. But how do I modify `HEAD~3`?

11 Jul at 06:50

Create a tag in a GitHub repository

I have a repository in GitHub and I need to it. I tagged in a shell, but on , it is not showing up. Do I have to do anything else? The command I used in the shell is: ``` git tag 2.0 ``` And no...

19 Apr at 17:22

How to set input type date's default value to today?

Given an input element: ``` <input type="date" /> ``` Is there any way to set the default value of the date field to today's date?

16 May at 05:47

How do I get started with Node.js

Are there any good resources to get started with Node.JS? Any good tutorials, blogs or books? Of course, I have visited its official website [http://nodejs.org/](http://nodejs.org/), but I didn't thi...

13 Jan at 16:5

Convert a String representation of a Dictionary to a dictionary

How can I convert the `str` representation of a `dict`, such as the following string, into a `dict`? ``` s = "{'muffin' : 'lolz', 'foo' : 'kitty'}" ``` I prefer not to use `eval`. What else can I u...

13 Jun at 16:51

How do I create a folder in a GitHub repository?

I want to create a folder in a GitHub repository and want to add files in that folder. How do I achieve this?

10 Nov at 13:56

How to remove spaces from a string using JavaScript?

How to remove spaces in a string? For instance: ``` '/var/www/site/Brand new document.docx' ``` ``` '/var/www/site/Brandnewdocument.docx' ```

19 May at 03:40

java.net.ConnectException: Connection refused

I'm trying to implement a TCP connection, everything works fine from the server's side but when I run the client program (from client computer) I get the following error: ``` java.net.ConnectExceptio...

27 Dec at 06:31

What is the difference between String and string in C#?

What are the differences between these two and which one should I use? ``` string s = "Hello world!"; String s = "Hello world!"; ```

12 Sep at 10:35

Remove empty array elements

Some elements in my array are empty strings based on what the user has submitted. I need to remove those elements. I have this: ``` foreach($linksArray as $link) { if($link == '') { u...

6 Jul at 19:43

How to run a function when the page is loaded?

I want to run a function when the page is loaded, but I don’t want to use it in the `<body>` tag. I have a script that runs if I initialise it in the `<body>`, like this: ``` function codeAddress() ...

8 Apr at 08:34

How to force child div to be 100% of parent div's height without specifying parent's height?

I have a site with the following structure: ``` <div id="header"></div> <div id="main"> <div id="navigation"></div> <div id="content"></div> </div> <div id="footer"></div> ``` The navigation ...

3 Jan at 20:20

How to install Java 8 on Mac

Editors note: This question was asked in 2014, and the answers may be outdated. --- I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS...

28 Feb at 16:26

How to sort a List/ArrayList?

I have a List of doubles in java and I want to sort ArrayList in descending order. Input ArrayList is as below: ``` List<Double> testList = new ArrayList(); testList.add(0.5); testList.add(0.2); te...

Open URL in same window and in same tab

I want to open a link in the same window and in the same tab that contains the page with the link. When I try to open a link by using `window.open`, then it opens in new tab—not in the same tab in th...

10 Dec at 05:15

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64. ``` C:\cygwin\home\XPherior\Cod...

1 Apr at 23:31

When to use static methods

I am wondering when to use static methods? Say if I have a class with a few getters and setters, a method or two, and I want those methods only to be invokable on an instance object of the class. Does...

5 Nov at 10:36

How do I check if an object has a specific property in JavaScript?

How do I check if an object has a specific property in JavaScript? Consider: ``` x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } ``` Is that the best way to do it?

29 Sep at 23:33

How do you select a particular option in a SELECT element in jQuery?

If you know the Index, Value or Text. also if you don't have an ID for a direct reference. [This](https://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-de...

23 May at 12:10

Align image in center and middle within div

I have following div ``` <div id="over" style="position:absolute; width:100%; height:100%> <img src="img.png"> </div> ``` How to align the image so as to be located in the middle and center of div...

19 Jul at 00:11

Using cURL with a username and password?

I want to access a URL which requires a username/password. I'd like to try accessing it with curl. Right now I'm doing something like: ``` curl http://api.somesite.com/test/blah?something=123 ``` I...

1 Feb at 18:55

How do I find the duplicates in a list and create another list with them?

How do I find the duplicates in a list of integers and create another list of the duplicates?

17 Jul at 09:28