Error "'git' is not recognized as an internal or external command"
I have an installation of Git for Windows, but when I try to use the `git` command in Command Prompt, I get the following error: ``` 'git' is not recognized as an internal or external command, operab...
- Modified
- 17 Dec at 02:7
Convert Array to Object
What is the best way to convert: ``` ['a','b','c'] ``` to: ``` { 0: 'a', 1: 'b', 2: 'c' } ```
- Modified
- 10 Mar at 14:18
Regular expression for alphanumeric and underscores
Is there a regular expression which checks if a string contains only upper and lowercase letters, numbers, and underscores?
- Modified
- 17 Oct at 19:47
Move the most recent commit(s) to a new branch with Git
How do I move my recent commits on master to a new branch, and reset master to before those commits were made? e.g. From this: ``` master A - B - C - D - E ``` To this: ``` newbranch C - D - E ...
- Modified
- 8 Jul at 04:10
Removing Conda environment
I want to remove a certain environment created with conda. How can I achieve that? Let's say I have an active `testenv` environment. I tried, by following documentation, with: ``` $ conda env remove ...
What is the difference between ++i and i++?
In C, what is the difference between using `++i` and `i++`, and which should be used in the incrementation block of a `for` loop?
- Modified
- 15 Mar at 10:32
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...
Failed to load the JNI shared Library (JDK)
When I try opening [Eclipse](http://www.eclipse.org/), a pop-up dialog states: > Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`. Following this, Eclipse force closes. Here's a f...
- Modified
- 4 Dec at 08:39
Count the number of occurrences of a character in a string
How do I count the number of occurrences of a character in a string? e.g. `'a'` appears in `'Mary had a little lamb'` 4 times.
How to get current time and date in C++?
Is there a cross-platform way to get the current date and time in C++?
- Modified
- 16 Jun at 20:35
Counting the number of elements with the values of x in a vector
I have a vector of numbers: ``` numbers <- c(4,23,4,23,5,43,54,56,657,67,67,435, 453,435,324,34,456,56,567,65,34,435) ``` How can I have R count the number of times a value appears in the...
What is the correct way to check for string equality in JavaScript?
What is the correct way to check for equality between Strings in JavaScript?
- Modified
- 3 Aug at 19:45
Using boolean values in C
C doesn't have any built-in boolean types. What's the best way to use them in C?
How do I check if a variable exists?
I want to check if a variable exists. Now I'm doing something like this: ``` try: myVar except NameError: # Do something. ``` Are there other ways without exceptions?
How can I write to the console in PHP?
Is it possible write a string or log into the console? ## What I mean Just like in JSP, if we print something like `system.out.println("some")`, it will be there at the console, not at a page.
How do you set a default value for a MySQL Datetime column?
How do you set a default value for a MySQL Datetime column? In SQL Server it's `getdate()`. What is the equivalant for MySQL? I'm using MySQL 5.x if that is a factor.
How do I set, clear, and toggle a single bit?
How do I set, clear, and toggle a bit?
- Modified
- 4 Jul at 21:14
Iterate through object properties
``` var obj = { name: "Simon", age: "20", clothing: { style: "simple", hipster: false } } for(var propt in obj){ console.log(propt + ': ' + obj[propt]); } ``` H...
- Modified
- 13 Mar at 10:58
Removing whitespace from strings in Java
I have a string like this: ``` mysz = "name=john age=13 year=2001"; ``` I want to remove the whitespaces in the string. I tried `trim()` but this removes only whitespaces before and after the whol...
- Modified
- 28 Mar at 07:29
jQuery how to find an element based on a data-attribute value?
I've got the following scenario: ``` var el = 'li'; ``` and there are 5 `<li>`'s on the page each with a `data-slide=number` attribute . I now need to find the currently active slide number which ...
- Modified
- 24 May at 15:38
Calculate difference between two dates (number of days)?
I see that this question has been answered for [Java](https://stackoverflow.com/questions/1555262/), [JavaScript](https://stackoverflow.com/questions/1036742/), and [PHP](https://stackoverflow.com/que...
How to POST JSON data with Python Requests?
I need to POST a JSON from a client to a server. I'm using Python 2.7.1 and simplejson. The client is using Requests. The server is CherryPy. I can GET a hard-coded JSON from the server (code not show...
- Modified
- 2 Oct at 23:23
How to set environment variables in Python?
I need to set some environment variables in the Python script and I want all the other scripts that are called from Python to see the environment variables' set. If I do, ``` os.environ["DEBUSSY"] = 1...
- Modified
- 6 Sep at 13:43
CSS force image resize and keep aspect ratio
I am working with images, and I ran into a problem with aspect ratios. ``` <img src="big_image.jpg" width="900" height="600" alt="" /> ``` As you can see, `height` and `width` are already specified. ...
- Modified
- 18 Jul at 18:55