How do I lowercase a string in Python?
Is there a way to convert a string to lowercase? ``` "Kilometers" → "kilometers" ```
.prop() vs .attr()
So [jQuery 1.6](http://api.jquery.com/category/version/1.6/) has the new function [prop()](http://api.jquery.com/prop/). ``` $(selector).click(function(){ //instead of: this.getAttribute('sty...
- Modified
- 25 Apr at 18:2
What is The Rule of Three?
- - - -
- Modified
- 26 May at 12:7
How do I parse command line arguments in Bash?
Say, I have a script that gets called with this line: ``` ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile ``` or this one: ``` ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile ...
- Modified
- 23 Jul at 15:31
Class (static) variables and methods
How do I create class (i.e. [static](https://en.wikipedia.org/wiki/Method_(computer_programming)#Static_methods)) variables or methods in Python?
- Modified
- 3 Dec at 07:36
How to make a great R reproducible example
When discussing performance with colleagues, teaching, sending a bug report or searching for guidance on mailing lists and here on Stack Overflow, a [reproducible example](https://stackoverflow.com/he...
Branch from a previous commit using Git
If I have `N` commits, how do I branch from the `N-3` commit?
- Modified
- 25 Jul at 02:37
Make .gitignore ignore everything except a few files
I understand that a `.gitignore` file cloaks specified files from Git's version control. How do I tell `.gitignore` to ignore everything except the files I'm tracking with Git? Something like: ``` # I...
How do I chop/slice/trim off last character in string using Javascript?
I have a string, `12345.00`, and I would like it to return `12345.0`. I have looked at `trim`, but it looks like it is only trimming whitespace and `slice` which I don't see how this would work. Any ...
- Modified
- 13 Oct at 15:32
How can I save username and password in Git?
I want to use a push and pull automatically in [Git Extensions](http://gitextensions.github.io/), [Sourcetree](https://en.wikipedia.org/wiki/Atlassian#Acquisitions_and_product_announcements) or any ot...
- Modified
- 5 Sep at 10:28
Why are elementwise additions much faster in separate loops than in a combined loop?
Suppose `a1`, `b1`, `c1`, and `d1` point to heap memory, and my numerical code has the following core loop. ``` const int n = 100000; for (int j = 0; j < n; j++) { a1[j] += b1[j]; c1[j] += d1...
- Modified
- 6 Nov at 14:38
Generate random number between two numbers in JavaScript
Is there a way to generate a in a with JavaScript ? : a specified range from were the random number could be either .
- Modified
- 30 Apr at 08:13
What's the difference between SCSS and Sass?
From what I've been reading, Sass is a language that makes CSS more powerful with variable and math support. What's the difference with SCSS? Is it supposed to be the same language? Similar? Differe...
Difference between decimal, float and double in .NET?
What is the difference between `decimal`, `float` and `double` in .NET? When would someone use one of these?
- Modified
- 11 Jul at 18:33
Get the size of the screen, current web page and browser window
How can I get `windowWidth`, `windowHeight`, `pageWidth`, `pageHeight`, `screenWidth`, `screenHeight`, `pageX`, `pageY`, `screenX`, `screenY` which will work in all major browsers? ![screenshot descr...
- Modified
- 9 Jun at 09:2
What is the purpose of .PHONY in a Makefile?
What does `.PHONY` mean in a Makefile? I have gone through [this](http://www.gnu.org/software/make/manual/make.html#Phony-Targets), but it is too complicated. Can somebody explain it to me in simple ...
- Modified
- 18 Sep at 03:0
Indent multiple lines quickly in vi
It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?
- Modified
- 29 Oct at 09:54
$(document).ready equivalent without jQuery
I have a script that uses `$(document).ready`, but it doesn't use anything else from jQuery. I'd like to lighten it up by removing the jQuery dependency. How can I implement my own `$(document).ready...
- Modified
- 20 Aug at 20:39
Should 'using' directives be inside or outside the namespace in C#?
I have been running [StyleCop](http://en.wikipedia.org/wiki/StyleCop) over some C# code, and it keeps reporting that my `using` directives should be inside the namespace. Is there a technical reason ...
- Modified
- 6 Feb at 14:3
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...
- Modified
- 1 Jan at 23:46
Finding duplicate values in a SQL table
It's easy to find duplicates with one field: ``` SELECT email, COUNT(email) FROM users GROUP BY email HAVING COUNT(email) > 1 ``` So if we have a table ``` ID NAME EMAIL 1 John asd@asd.com ...
- Modified
- 28 Sep at 16:11
How do I get a consistent byte representation of strings in C# without manually specifying an encoding?
How do I convert a `string` to a `byte[]` in .NET (C#) without manually specifying a specific encoding? I'm going to encrypt the string. I can encrypt it without converting, but I'd still like to kno...
- Modified
- 26 Feb at 22:22
How do I recover a dropped stash in Git?
I frequently use `git stash` and `git stash pop` to save and restore changes in my working tree. Yesterday, I had some changes in my working tree that I had stashed and popped, and then I made more ch...
How do I generate a random integer in C#?
How do I generate a random integer in C#?
What is a non-capturing group in regular expressions?
How are non-capturing groups, i.e., `(?:)`, used in regular expressions and what are they good for?
- Modified
- 5 Jan at 21:38