Most Popular
1500 questions
1203
votes
8 answers
What is the maximum length of a valid email address?
What is the maximum length of a valid email address? Is it defined by any standard?

volatilevoid
- 12,605
- 4
- 21
- 16
1203
votes
16 answers
Why not use Double or Float to represent currency?
I've always been told never to represent money with double or float types, and this time I pose the question to you: why?
I'm sure there is a very good reason, I simply do not know what it is.

Fran Fitzpatrick
- 17,902
- 15
- 33
- 34
1203
votes
30 answers
How do you explicitly set a new property on `window` in TypeScript?
I setup global namespaces for my objects by explicitly setting a property on window.
window.MyNamespace = window.MyNamespace || {};
TypeScript underlines MyNamespace and complains that:
The property 'MyNamespace' does not exist on value of type…

joshuapoehls
- 32,695
- 11
- 50
- 61
1201
votes
21 answers
How to pass command line arguments to a rake task
I have a rake task that needs to insert a value into multiple databases.
I'd like to pass this value into the rake task from the command line, or from another rake task.
How can I do this?

Tilendor
- 48,165
- 17
- 52
- 58
1201
votes
20 answers
Copy array items into another array
I have a JavaScript array dataArray which I want to push into a new array newArray. Except I don't want newArray[0] to be dataArray. I want to push in all the items into the new array:
var newArray =…

bba
- 14,621
- 11
- 29
- 26
1201
votes
25 answers
Get list of all tables in Oracle?
How do I query an Oracle database to display the names of all tables in it?

vitule
- 15,612
- 11
- 33
- 37
1199
votes
22 answers
How to install an npm package from GitHub directly
Trying to install modules from GitHub results in this error:
ENOENT error on package.json.
Easily reproduced using express:
npm install https://github.com/visionmedia/express throws error.
npm install express works.
Why can't I install from…

guy mograbi
- 27,391
- 16
- 83
- 122
1198
votes
15 answers
Remove all whitespace in a string
I want to eliminate all the whitespace from a string, on both ends, and in between words.
I have this Python code:
def my_handle(self):
sentence = ' hello apple '
sentence.strip()
But that only eliminates the whitespace on both sides of…

not 0x12
- 19,360
- 22
- 67
- 133
1197
votes
13 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
- 76,540
- 58
- 260
- 305
1196
votes
29 answers
SQL Update from One Table to Another Based on a ID Match
I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number so that I am only working with account numbers.
I created a view linking the table to the account/card database to…
Boerseun
1196
votes
28 answers
How to apply CSS to iframe?
I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?
John
1195
votes
33 answers
How can I deal with this Git warning? "Pulling without specifying how to reconcile divergent branches is discouraged"
After a git pull origin master, I get the following message:
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next…

Davide Casiraghi
- 15,591
- 9
- 34
- 56
1194
votes
9 answers
How do I sort a list of objects based on an attribute of the objects?
I have a list of Python objects that I want to sort by a specific attribute of each object:
[Tag(name="toe", count=10), Tag(name="leg", count=2), ...]
How do I sort the list by .count in descending order?

Nick Sergeant
- 35,843
- 12
- 36
- 44
1193
votes
30 answers
Colors in JavaScript console
Can Chrome's built-in JavaScript console display colors?
I want errors in red, warnings in orange and console.log's in green. Is that possible?

Randomblue
- 112,777
- 145
- 353
- 547
1192
votes
42 answers
Converting an object to a string
How can I convert a JavaScript object into a string?
Example:
var o = {a:1, b:2}
console.log(o)
console.log('Item: ' + o)
Output:
Object { a=1, b=2} // very nice readable output :)
Item: [object Object] // no idea what's inside :(

user680174
- 11,921
- 3
- 15
- 3