Most Popular

1500 questions
1010
votes
24 answers

Make body have 100% of the browser height

I want to make body have 100% of the browser height. Can I do that using CSS? I tried setting height: 100%, but it doesn't work. I want to set a background color for a page to fill the entire browser window, but if the page has little content I get…
bodyofheat
  • 10,103
  • 3
  • 13
  • 5
1010
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
  • 49,101
  • 40
  • 128
  • 172
1010
votes
7 answers

Node.js/Windows error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm'

I have Windows 7 32-bit. I installed the latest Node.js 32 bit. When I try to run the command npm install jquery, I receive the error: Error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm How does one resolve it?
tryasko
  • 10,229
  • 3
  • 12
  • 6
1010
votes
15 answers

JPA EntityManager: Why use persist() over merge()?

EntityManager.merge() can insert new objects and update existing ones. Why would one want to use persist() (which can only create new objects)?
Aaron Digulla
  • 307,434
  • 102
  • 574
  • 790
1009
votes
24 answers

How to permanently set $PATH on Linux/Unix

On Linux, how can I add a directory to the $PATH so it remains persistent across different sessions? Background I'm trying to add a directory to my path so it will always be in my Linux path. I've tried: export PATH=$PATH:/path/to/dir This works,…
Ali
  • 246,616
  • 257
  • 559
  • 746
1008
votes
6 answers

Is there any difference between a GUID and a UUID?

I see these two acronyms being thrown around and I was wondering if there are any differences between a GUID and a UUID?
Jon Tackabury
  • 44,666
  • 48
  • 125
  • 164
1008
votes
16 answers

What's the difference between HEAD^ and HEAD~ in Git?

When I specify an ancestor commit object in Git, I'm confused between HEAD^ and HEAD~. Both have a "numbered" version like HEAD^3 and HEAD~2. They seem very similar or the same to me, but are there any differences between the tilde and the caret?
TK.
  • 24,847
  • 19
  • 61
  • 72
1008
votes
17 answers

Creating a byte array from a stream

What is the prefered method for creating a byte array from an input stream? Here is my current solution with .NET 3.5. Stream s; byte[] b; using (BinaryReader br = new BinaryReader(s)) { b = br.ReadBytes((int)s.Length); } Is it still a…
Bob
  • 93,168
  • 29
  • 116
  • 127
1008
votes
15 answers

What is the meaning of "POSIX"?

What is POSIX? I have read the Wikipedia article and I read it every time I encounter the term. The fact is that I never really understood what it is. Can anyone please explain it to me by explaining "the need for POSIX" too?
claws
  • 49,128
  • 55
  • 141
  • 190
1007
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
  • 10,079
  • 3
  • 14
  • 3
1006
votes
11 answers

Convert a String representation of a Dictionary to a dictionary?

How can I convert the str representation of a dict, such as the following string, into a dict? s = "{'muffin' : 'lolz', 'foo' : 'kitty'}" I prefer not to use eval. What else can I use? The main reason for this, is one of my coworkers classes he…
UberJumper
  • 18,475
  • 17
  • 66
  • 86
1006
votes
20 answers

How do I duplicate a line or selection within Visual Studio Code?

Using Microsoft's Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Similar to Sublime's cmd+shift+d behaviour) It's a feature that I use constantly, and am struggling using Visual Studio Code without it.
Chris
  • 48,930
  • 28
  • 130
  • 174
1005
votes
9 answers

What's "tools:context" in Android layout files?

Starting with a recent new version of ADT, I've noticed this new attribute on the layout XML files, for example:
android developer
  • 110,603
  • 135
  • 674
  • 1,187
1005
votes
22 answers

How to sort an object array by date property?

Say I have an array of a few objects: var array = [{id: 1, date: Mar 12 2012 10:00:00 AM}, {id: 2, date: Mar 8 2012 08:00:00 AM}]; How can I sort this array by the date element in order from the date closest to the current date and time down? Keep…
ryandlf
  • 24,097
  • 34
  • 101
  • 157
1004
votes
19 answers

How can I stop .gitignore from appearing in the list of untracked files?

I just did a git init on the root of my new project. Then I created a .gitignore file. Now, when I type git status, .gitignore file appears in the list of untracked files. Why is that?
Jacques René Mesrine
  • 43,215
  • 26
  • 62
  • 102
1 2 3
99
100