Most Popular
1500 questions
1147
votes
12 answers
How do I check if string contains substring?
I have a shopping cart that displays product options in a dropdown menu and if they select "yes", I want to make some other fields on the page visible.
The problem is that the shopping cart also includes the price modifier in the text, which can be…

Jordan Garis
- 11,489
- 3
- 16
- 4
1147
votes
7 answers
Convert list of dictionaries to a pandas DataFrame
How can I convert a list of dictionaries into a DataFrame? Given:
[{'points': 50, 'time': '5:00', 'year': 2010},
{'points': 25, 'time': '6:00', 'month': "february"},
{'points':90, 'time': '9:00', 'month': 'january'},
{'points_h1':20, 'month':…

appleLover
- 14,835
- 9
- 33
- 50
1147
votes
57 answers
How to force browsers to reload cached CSS and JS files?
I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser…

Kip
- 107,154
- 87
- 232
- 265
1147
votes
18 answers
What is (functional) reactive programming?
I've read the Wikipedia article on reactive programming. I've also read the small article on functional reactive programming. The descriptions are quite abstract.
What does functional reactive programming (FRP) mean in practice?
What does reactive…

JtR
- 20,568
- 17
- 46
- 60
1146
votes
7 answers
push_back vs emplace_back
I'm a bit confused regarding the difference between push_back and emplace_back.
void emplace_back(Type&& _Val);
void push_back(const Type& _Val);
void push_back(Type&& _Val);
As there is a push_back overload taking a rvalue reference I don't quite…

ronag
- 49,529
- 25
- 126
- 221
1146
votes
20 answers
What is the difference between ++i and i++?
In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?

The.Anti.9
- 43,474
- 48
- 123
- 161
1145
votes
22 answers
What's the difference between lists and tuples?
What's the difference between tuples/lists and what are their advantages/disadvantages?

Lucas Gabriel Sánchez
- 40,116
- 20
- 56
- 83
1145
votes
10 answers
What is the difference between g++ and gcc?
What is the difference between g++ and gcc? Which one of them should be used for general c++ development?

Brian R. Bondy
- 339,232
- 124
- 596
- 636
1145
votes
6 answers
Git: Find the most recent common ancestor of two branches
How to find the most recent common ancestor of two Git branches?

Ted
- 14,465
- 6
- 28
- 28
1145
votes
26 answers
Switch statement for multiple cases in JavaScript
I need multiple cases in switch statement in JavaScript, Something like:
switch (varName)
{
case "afshin", "saeed", "larry":
alert('Hey');
break;
default:
alert('Default case');
break;
}
How can I do that? If…

Afshin Mehrabani
- 33,262
- 29
- 136
- 201
1144
votes
21 answers
PHP array delete by value (not key)
I have a PHP array as follows:
$messages = [312, 401, 1599, 3, ...];
I want to delete the element containing the value $del_val (for example, $del_val=401), but I don't know its key. This might help: each value can only be there once.
I'm looking…

Adam Strudwick
- 12,671
- 13
- 31
- 41
1144
votes
3 answers
Show git diff on file in staging area
Is there a way I can see the changes that were made to a file after I have done git add file?
That is, when I do:
git add file
git diff file
no diff is shown. I guess there's a way to see the differences since the last commit but I don't know what…

arod
- 13,481
- 6
- 31
- 39
1144
votes
29 answers
Does functional programming replace GoF design patterns?
Since I started learning F# and OCaml last year, I've read a huge number of articles which insist that design patterns (especially in Java) are workarounds for the missing features in imperative languages. One article I found makes a fairly strong…

Juliet
- 80,494
- 45
- 196
- 228
1144
votes
30 answers
endsWith in JavaScript
How can I check if a string ends with a particular character in JavaScript?
Example: I have a string
var str = "mystring#";
I want to know if that string is ending with #. How can I check it?
Is there a endsWith() method in JavaScript?
One…

Phani Kumar Bhamidipati
- 13,183
- 6
- 24
- 27
1144
votes
13 answers
Is there a float input type in HTML5?
According to html5.org, the "number" input type's "value attribute, if specified and not empty, must have a value that is a valid floating point number."
Yet it is simply (in the latest version of Chrome, anyway), an "updown" control with integers,…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862