All Questions

5403 votes
22 answers
1.9m views

What's the difference between tilde(~) and caret(^) in package.json?

After I upgraded to the latest stable node and npm, I tried npm install moment --save. It saves the entry in the package.json with the caret ^ prefix. Previously, it was a tilde ~ prefix. Why are ...
Fizer Khan's user avatar
  • 91.4k
5397 votes
34 answers
5.2m views

Regular expression to match a line that doesn't contain a word

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a ...
5390 votes
36 answers
3.6m views

How do I resolve merge conflicts in a Git repository?

How do I resolve merge conflicts in my Git repository?
Spoike's user avatar
  • 121k
5386 votes
37 answers
1.6m views

How do I add an empty directory to a Git repository?

How do I add an empty directory (that contains no files) to a Git repository?
Laurie Young's user avatar
5380 votes
34 answers
4.4m views

How do I make a flat list out of a list of lists?

I have a list of lists like [ [1, 2, 3], [4, 5, 6], [7], [8, 9] ] How can I flatten it to get [1, 2, 3, 4, 5, 6, 7, 8, 9]? If your list of lists comes from a nested list ...
Emma's user avatar
  • 54.6k
5379 votes
43 answers
836k views

What is a plain English explanation of "Big O" notation?

I'd prefer as little formal definition as possible and simple mathematics.
Arec Barrwin's user avatar
  • 61.8k
5373 votes
13 answers
3.1m views

How do I exit Vim?

I am stuck and cannot escape. It says: type :quit<Enter> to quit VIM But when I type that it simply appears in the object body.
jclancy's user avatar
  • 51.6k
5275 votes
106 answers
4.2m views

How do I make the first letter of a string uppercase in JavaScript?

How do I make the first character of a string uppercase if it's a letter, but not change the case of any of the other letters? For example: "this is a test" → "This is a test" &...
Robert Wills's user avatar
  • 53.4k
5242 votes
27 answers
2.6m views

What is the difference between "INNER JOIN" and "OUTER JOIN"?

Also, how do LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN fit in?
Chris de Vries's user avatar
5201 votes
68 answers
4.9m views

How do I check whether a checkbox is checked in jQuery?

I need to check the checked property of a checkbox and perform an action based on the checked property using jQuery. For example, if the age checkbox is checked, then I need to show a textbox to enter ...
5161 votes
67 answers
3.0m views

What is the most efficient way to deep clone an object in JavaScript?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only supported by Firefox. I've done things like obj = JSON.parse(...
5110 votes
25 answers
838k views

Reference Guide: What does this symbol mean in PHP? (PHP Syntax)

What is this? This is a collection of questions that come up now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list. This ...
5105 votes
128 answers
4.9m views

How can I horizontally center an element?

How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div>
4981 votes
32 answers
1.3m views

What is the difference between a URI, a URL, and a URN? [closed]

What is the difference between a URL, a URI, and a URN?
Sean McMains's user avatar
  • 58.8k
4951 votes
62 answers
3.6m views

How do I check if an array includes a value in JavaScript?

What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) { for (var i = 0; i < a.length; i++...
brad's user avatar
  • 75.1k

15 30 50 per page
1
3 4
5
6 7
1613487