Delete a column from a Pandas DataFrame
To delete a column in a DataFrame, I can successfully use: ``` del df['column_name'] ``` But why can't I use the following? ``` del df.column_name ``` Since it is possible to access the Series via `...
Check if a value is an object in JavaScript
How do you check if a value is an object in JavaScript?
- Modified
- 25 Sep at 22:52
Download a specific tag with Git
I'm trying to figure out how I can download a particular tag of a Git repository - it's one version behind the current version. I saw there was a tag for the previous version on the git web page, wit...
How do I iterate over a range of numbers defined by variables in Bash?
How do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this (called "sequence expression" in the Bash [documentation](http://www.gnu.org/software/bash...
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...
- Modified
- 12 Feb at 10:39
How to lazy load images in ListView in Android
I am using a `ListView` to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load images so while the text displays, the ...
- Modified
- 24 Dec at 04:33
How do I recursively grep all directories and subdirectories?
How do I recursively `grep` all directories and subdirectories? ``` find . | xargs grep "texthere" * ```
Find object by id in an array of JavaScript objects
I've got an array: ``` myArray = [{'id':'73','foo':'bar'},{'id':'45','foo':'bar'}, etc.] ``` I'm unable to change the structure of the array. I'm being passed an id of `45`, and I want to get `'bar...
- Modified
- 15 Feb at 21:50
Does Java support default parameter values?
I came across some Java code that had the following structure: ``` public MyParameterizedFunction(String param1, int param2) { this(param1, param2, false); } public MyParameterizedFunction(Strin...
- Modified
- 8 May at 09:1
How can I update NodeJS and NPM to their latest versions?
### I just installed Node.js & NPM (Node Package Manager) I installed NPM for access to additional Modules. After I installed Node.js & NPM I noticed that neither were the latest versions availabl...
- Modified
- 25 Mar at 05:36
How to replace master branch in Git, entirely, from another branch?
I have two branches in my Git repository: 1. master 2. seotweaks (created originally from master) I created `seotweaks` with the intention of quickly merging it back into `master`. However, that ...
- Modified
- 19 Aug at 18:8
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?
- Modified
- 6 Sep at 10:49
How do I check if a variable is an array in JavaScript?
How do I check if a variable is an array in JavaScript? ``` if (variable.constructor == Array) ```
- Modified
- 10 Apr at 12:59
What is the optimal algorithm for the game 2048?
I have recently stumbled upon the game [2048](http://gabrielecirulli.github.io/2048/). You merge similar tiles by moving them in any of the four directions to make "bigger" tiles. After each move, a n...
- Modified
- 22 Feb at 03:52
How to get a Docker container's IP address from the host
Is there a command I can run to get the container's IP address right from the host after a new container is created? Basically, once Docker creates the container, I want to roll my own code deploymen...
- Modified
- 8 Apr at 13:32
How to stop tracking and ignore changes to a file in Git?
I have cloned a project that includes some `.csproj` files. I don't need/like my local `csproj` files being tracked by Git (or being brought up when creating a patch), but clearly they are needed in t...
- Modified
- 19 Nov at 13:42
Why is it string.join(list) instead of list.join(string)?
This has always confused me. It seems like this would be nicer: ``` ["Hello", "world"].join("-") ``` Than this: ``` "-".join(["Hello", "world"]) ``` Is there a specific reason it is like this?
How do I break out of nested loops in Java?
I've got a nested loop construct like this: ``` for (Type type : types) { for (Type t : types2) { if (some condition) { // Do something and break... break; // Br...
- Modified
- 6 Dec at 06:35
Writing to files in Node.js
I've been trying to find a way to write to a file when using Node.js, but with no success. How can I do that?
- Modified
- 8 Mar at 09:36
How to check if the string is empty?
Does Python have something like an empty string variable where you can do: ``` if myString == string.empty: ``` Regardless, what's the most elegant way to check for empty string values? I find hard...
- Modified
- 1 Nov at 13:1
How do I format XML in Notepad++?
I have [Notepad++](http://en.wikipedia.org/wiki/Notepad%2B%2B) and I got some XML code which is very long. When I pasted it in Notepad++ there was a long line of code (difficult to read and work with)...
- Modified
- 6 Apr at 01:35
Config Error: This configuration section cannot be used at this path
I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error: > Config Error: This configuration sectio...
Detecting an "invalid date" Date instance in JavaScript
I'd like to tell the difference between valid and invalid date objects in JS, but couldn't figure out how: ``` var d = new Date("foo"); console.log(d.toString()); // shows 'Invalid Date' console.log(...
- Modified
- 5 Jul at 19:34
Difference between static class and singleton pattern?
What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-...
- Modified
- 15 Nov at 15:2