Most Popular

1500 questions
950
votes
7 answers

Ruby: How to install a specific version of a ruby gem?

Using the command-line gem tool, how can I install a specific version of a gem?
mjs
  • 57,072
  • 26
  • 82
  • 114
949
votes
18 answers

Why is setTimeout(fn, 0) sometimes useful?

I've recently run into a rather nasty bug, wherein the code was loading a had a pre-selected value. In IE6, we already had code to fix the selected
Dan Lew
  • 81,251
  • 29
  • 178
  • 174
949
votes
11 answers

How to search a Git repository by commit message?

I checked some source code into GIT with the commit message "Build 0051". However, I can't seem to find that source code any more - how do I extract this source from the GIT repository, using the command line? Update Checked in versions 0043, 0044,…
Contango
  • 65,385
  • 53
  • 229
  • 279
949
votes
20 answers

git replacing LF with CRLF

Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository. I then pasted the export into the bare repositories directory, and did a: git add -A I then got a list of messages saying: LF will…
mrblah
  • 88,033
  • 134
  • 292
  • 404
948
votes
8 answers

What's the difference between event.stopPropagation and event.preventDefault?

They seem to be doing the same thing... Is one modern and one old? Or are they supported by different browsers? When I handle events myself (without framework) I just always check for both and execute both if present. (I also return false, but I…
Rudie
  • 46,504
  • 37
  • 126
  • 167
947
votes
15 answers

Update Git submodule to latest commit on origin

I have a project with a Git submodule. It is from an ssh://... URL, and is on commit A. Commit B has been pushed to that URL, and I want the submodule to retrieve the commit, and change to it. Now, my understanding is that git submodule update…
Thanatos
  • 37,926
  • 14
  • 76
  • 136
947
votes
9 answers

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?
JSS
  • 9,479
  • 3
  • 13
  • 3
947
votes
9 answers

Why use pip over easy_install?

A tweet reads: Don't use easy_install, unless you like stabbing yourself in the face. Use pip. Why use pip over easy_install? Doesn't the fault lie with PyPI and package authors mostly? If an author uploads crap source tarball (eg: missing…
Sridhar Ratnakumar
  • 68,948
  • 61
  • 139
  • 172
947
votes
26 answers

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.
Brian Boatright
  • 33,940
  • 33
  • 76
  • 102
945
votes
25 answers

Place cursor at the end of text in EditText

I am changing the value of an EditText on keyListener. But when I change the text the cursor is moving to the beginning of the EditText. I need the cursor to be at the end of the text. How to move the cursor to the end of the text in a EditText.
Manu
  • 9,459
  • 3
  • 12
  • 3
944
votes
67 answers

HTML text input allow only numeric input

Is there a quick way to set an HTML text input () to only allow numeric keystrokes (plus '.')?
Julius A
  • 33,082
  • 26
  • 68
  • 92
944
votes
25 answers

Getting a random value from a JavaScript array

Consider: var myArray = ['January', 'February', 'March']; How can I select a random value from this array using JavaScript?
Sarah
  • 9,631
  • 3
  • 15
  • 8
944
votes
42 answers

Shell command to sum integers, one per line?

I am looking for a command that will accept (as input) multiple lines of text, each line containing a single integer, and output the sum of these integers. As a bit of background, I have a log file which includes timing measurements. Through…
Andrzej Doyle
  • 97,637
  • 30
  • 185
  • 225
944
votes
6 answers

Is there any difference between a GUID and a UUID?

I see these 2 acronyms thrown around, and I was wondering if there are any differences between a GUID and a UUID?
Jon Tackabury
  • 42,888
  • 45
  • 121
  • 164
944
votes
25 answers

How to download a file over HTTP?

I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes. The text processing that creates/updates the XML file is written in Python. However, I use…
Owen
  • 19,917
  • 13
  • 38
  • 47
1 2 3
99
100