Questions

Delete an element from a dictionary

How do I delete an item from a dictionary in Python? Without modifying the original dictionary, how do I obtain another dict with the item removed? --- [How can I remove a key from a Python diction...

12 Feb at 10:39

HTTP GET request in JavaScript?

I need to do an [HTTP GET](http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) request in JavaScript. What's the best way to do that? I need to do this in a Mac OS X dashcode wi...

28 Sep at 16:19

How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19. My node version is: ``` node -v v0.6.1-pre ``` NVM says this (after I install a version of node for ...

14 May at 10:49

Git refusing to merge unrelated histories on rebase

During `git rebase origin/development` the following error message is shown from Git: ``` fatal: refusing to merge unrelated histories Error redoing merge 1234deadbeef1234deadbeef ``` My Git versio...

5 Jun at 11:27

How can I get the ID of an element using jQuery?

``` <div id="test"></div> <script> $(document).ready(function() { alert($('#test').id); }); </script> ``` Why doesn't the above work, and how should I do this?

15 May at 14:16

How to remove focus border (outline) around text/input boxes? (Chrome)

Can anyone explain how to remove the orange or blue border (outline) around text/input boxes? I think it only happens on Chrome to show that the input box is active. Here's the input CSS I'm using: `...

19 Apr at 10:35

How to overlay one div over another div

I need assistance with overlaying one individual `div` over another individual `div`. My code looks like this: ``` <div class="navi"></div> <div id="infoi"> <img src="info_icon2.png" height="20"...

15 Jul at 23:35

IndentationError: unindent does not match any outer indentation level

When I compile the Python code below, I get > IndentationError: unindent does not match any outer indentation level --- ``` import sys def Factorial(n): # Return factorial result = 1 for i...

26 Nov at 22:35

How do I specify new lines in a string in order to write multiple lines to a file?

How can I indicate a newline in a string in Python, so that I can write multiple lines to a text file?

28 Aug at 21:20

How to make a new List in Java

We create a `Set` as: ``` Set myset = new HashSet() ``` How do we create a `List` in Java?

5 Oct at 09:57

PostgreSQL: Show tables in PostgreSQL

What's the equivalent to `show tables` (from MySQL) in PostgreSQL?

31 May at 14:55

What is the difference between public, protected, package-private and private in Java?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), `public`, `protected` and `private`, while making `class` and `interface` and dealing with...

Looping through the content of a file in Bash

How do I iterate through each line of a text file with [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell))? With this script: ``` echo "Start!" for p in (peptides.txt) do echo "${p}" done ``...

29 May at 19:47

How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery? I can get all of them like this: ``` $("form :radio") ``` How do I know which one is s...

Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"?

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.? ``` func...

What does "javascript:void(0)" mean?

``` <a href="javascript:void(0)" id="loginlink">login</a> ``` I've seen such `href`s many times, but I don't know what exactly that means.

30 Aug at 08:1

Best way to convert string to bytes in Python 3?

[TypeError: 'str' does not support the buffer interface](https://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface) suggests two possible methods to convert a str...

Understanding Python super() with __init__() methods

Why is `super()` used? Is there a difference between using `Base.__init__` and `super().__init__`? ``` class Base(object): def __init__(self): print "Base created" class ChildA(Ba...

1 Apr at 11:47

Insert results of a stored procedure into a temporary table

How do I do a `SELECT * INTO [temp table] FROM [stored procedure]`? Not `FROM [Table]` and without defining `[temp table]`? `Select` all data from `BusinessLine` into `tmpBusLine` works fine. ``` se...

SQL Update from One Table to Another Based on a ID Match

I have a database with `account numbers` and `card numbers`. I match these to a file to `update` any card numbers to the account number so that I am only working with account numbers. I created a view...

23 May at 16:50

Adding values to a C# array

Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example: ``` int[] terms; for(int runs = 0; runs < 400; runs++) { terms[] = runs; } ``` For...

24 Aug at 18:15

How to sleep for five seconds in a batch file/cmd

Windows's Snipping tool can capture the screen, but sometimes I want to capture the screen after five seconds, such as taking an image being displayed by the webcam. (Run the script and smile at the c...

15 Jun at 15:51

How to print without a newline or space

Consider these examples using `print` in Python: ``` >>> for i in range(4): print('.') . . . . >>> print('.', '.', '.', '.') . . . . ``` Either a newline or a space is added between each value. How c...

1 Jan at 23:46

How do I revert all local changes in Git managed project to previous state?

I ran `git status` which told me everything was up to date and there were no local changes. Then I made several consecutive changes and realized I wanted to throw everything away and get back to my or...

17 Jul at 00:42

How do I iterate over the words of a string?

How do I iterate over the words of a string composed of words separated by whitespace? Note that I'm not interested in C string functions or that kind of character manipulation/access. I prefer elegan...

4 Jul at 21:1