Questions

How can I generate random alphanumeric strings?

How can I generate a random 8 character alphanumeric string in C#?

22 Apr at 22:44

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

.gitignore for Visual Studio Projects and Solutions

Which files should I include in `.gitignore` when using in conjunction with Solutions (`.sln`) and Projects?

What do Clustered and Non-Clustered index actually mean?

I have a limited exposure to DB and have only used DB as an application programmer. I want to know about `Clustered` and `Non clustered indexes`. I googled and what I found was : > What I found in ...

How do I connect to a MySQL Database in Python?

How do I connect to a MySQL database using a python program?

28 Jul at 17:48

How to trim whitespace from a Bash variable?

I have a shell script with this code: ``` var=`hg st -R "$path"` if [ -n "$var" ]; then echo $var fi ``` But the conditional code always executes, because `hg st` always prints at least one new...

20 Jun at 05:55

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

Reference - What does this error mean in PHP?

### What is this? This is a number of answers about warnings, errors, and notices you might encounter while programming PHP and have no clue how to fix them. This is also a Community Wiki, so every...

How to exit git log or git diff

I'm trying to learn Git with the help of [Git Immersion](http://gitimmersion.com/). There's one thing that frustrates me whenever I use `git log` or `git diff`: ![Git log shows (END) marker](https://...

17 Apr at 17:57

How to determine if Javascript array contains an object with an attribute that equals a given value?

I have an array like ``` vendors = [{ Name: 'Magenic', ID: 'ABC' }, { Name: 'Microsoft', ID: 'DEF' } // and so on... ]; ``` How do I check this array to see if "Magenic" exists...

21 Oct at 11:54

How do I get the path to the current script with Node.js?

How would I get the path to the script in Node.js? I know there's `process.cwd`, but that only refers to the directory where the script was called, not of the script itself. For instance, say I'm in ...

17 Dec at 12:3

master branch and 'origin/master' have diverged, how to 'undiverge' branches'?

Somehow my `master` and my `origin/master` branch have diverged. I actually don't want them to diverge. How can I view these differences and them?

28 Jul at 09:16

Are HTTPS URLs encrypted?

Are all URLs encrypted when using TLS/SSL (HTTPS) encryption? I would like to know because I want all URL data to be hidden when using TLS/SSL (HTTPS). If TLS/SSL gives you total URL encryption then ...

29 Apr at 18:0

Where is the global git config data stored?

When using `git config --global` to set things up, to which file will it write? Example: ``` git config --global core.editor "blah" ``` I can't find it at these places: ``` C:\Program Files\Git\e...

16 Aug at 09:39

How can I sanitize user input with PHP?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?

How can I develop for iPhone using a Windows development machine?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows? The only other way I can think of doing this is to run a Mac VM image on a ...

5 Feb at 08:55

Pipe to/from the clipboard in a Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if `/dev/clip` was a device li...

28 Aug at 22:10

How to list branches that contain a given commit?

How can I query git to find out which branches contain a given commit? `gitk` will usually list the branches, unless there are too many, in which case it just says "many (38)" or something like that. ...

30 Oct at 08:46

How to execute a JavaScript function when I have its name as a string

I have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later? Depending on the circumstances, I may need to pass various arguments int...

29 Jun at 16:47

HTTP response code for POST when resource already exists

I'm building a server that allows clients to store objects. Those objects are fully constructed at client side, complete with object IDs that are permanent for the whole lifetime of the object. I ha...

24 Mar at 17:47

How to call shell commands from Ruby

How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?

10 Jan at 01:45

Get JavaScript object from array of objects by value of property

Let's say I have an array of four objects: ``` var jsObjects = [ {a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}, {a: 7, b: 8} ]; ``` Is there a way that I can get the third object (`{a: 5,...

15 Feb at 21:50

Detecting a mobile browser

I'm looking for a function that returns a boolean value if the user is using a mobile browser or not. I know that I can use `navigator.userAgent` and write that function by using regex, but user-agent...

What is a correct MIME type for .docx, .pptx, etc.?

For older *.doc documents, this was enough: ``` header("Content-Type: application/msword"); ``` What MIME type should I use for new .docx documents? Also, for pptx and xlsx documents?

How to clear the canvas for redrawing

After experimenting with composite operations and drawing images on the canvas I'm now trying to remove images and compositing. How do I do this? I need to clear the canvas for redrawing other images...