Most Popular
1500 questions
1245
votes
14 answers
Secure hash and salt for PHP passwords
It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.
This question, Is “double hashing” a password less secure than just hashing it once?
suggests that…
luiscubal
- 24,773
- 9
- 57
- 83
1242
votes
34 answers
Dealing with "java.lang.OutOfMemoryError: PermGen space" error
Recently I ran into this error in my web application:
java.lang.OutOfMemoryError: PermGen space
It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6.
Apparently this can occur after redeploying an application a…
Chris
- 632
- 4
- 11
- 18
1242
votes
14 answers
What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do
I really want to know more about the update, export and the values that could be given to hibernate.hbm2ddl.auto
I need to know when to use the update and when not? And what is the alternative?
These are changes that could happen over DB:
new…
Suzan
1241
votes
11 answers
How can I pipe stderr, and not stdout?
I have a program that writes information to stdout and stderr, and I need to process the stderr with grep, leaving stdout aside.
Using a temporary file, one could do it in two steps:
command > /dev/null 2> temp.file
grep 'something' temp.file
But…
user80168
1240
votes
7 answers
What does %~dp0 mean, and how does it work?
I find %~dp0 very useful, and I use it a lot to make my batch files more portable.
But the label itself seems very cryptic to me... What is the ~ doing? Does dp mean drive and path? Does the 0 refer to %0, the path to the batch file that includes…
Sebastián Grignoli
- 32,444
- 17
- 71
- 86
1239
votes
45 answers
Android SDK installation doesn't find JDK
I'm trying to install the Android SDK on my Windows 7 x64 System.
jdk-6u23-windows-x64.exe is installed, but the Android SDK setup refuses to proceed because it doesn't find the JDK installation.
Is this a known issue? And is there a solution?
Simon
- 5,703
- 3
- 16
- 6
1239
votes
8 answers
How do I iterate through two lists in parallel?
I have two iterables, and I want to go over them in pairs:
foo = [1, 2, 3]
bar = [4, 5, 6]
for (f, b) in iterate_together(foo, bar):
print("f:", f, " | b:", b)
That should result in:
f: 1 | b: 4
f: 2 | b: 5
f: 3 | b: 6
One way to do it…
Nathan Fellman
- 122,701
- 101
- 260
- 319
1237
votes
11 answers
What is event bubbling and capturing?
What is the difference between event bubbling and capturing? When should one use bubbling vs capturing?
Arun P Johny
- 384,651
- 66
- 527
- 531
1236
votes
43 answers
How can I initialise a static Map?
How would you initialise a static Map in Java?
Method one: static initialiser
Method two: instance initialiser (anonymous subclass)
or
some other method?
What are the pros and cons of each?
Here is an example illustrating the two methods:
import…
dogbane
- 266,786
- 75
- 396
- 414
1235
votes
24 answers
Get the data received in a Flask request
I want to be able to get the data sent to my Flask app. I've tried accessing request.data but it is an empty string. How do you access request data?
from flask import request
@app.route('/', methods=['GET', 'POST'])
def parse_request():
data =…
ddinchev
- 33,683
- 28
- 88
- 133
1234
votes
17 answers
What is the difference between public, private, and protected inheritance in C++?
What is the difference between public, private, and protected inheritance in C++?
All of the questions I've found on SO deal with specific cases.
user106599
1233
votes
13 answers
Global Git ignore
I want to set up Git to globally ignore certain files.
I have added a .gitignore file to my home directory (/Users/me/) and I have added the following line to it:
*.tmproj
But it is not ignoring this type of files, any idea what I am doing wrong?
Mild Fuzz
- 29,463
- 31
- 100
- 148
1233
votes
11 answers
Serializing to JSON in jQuery
I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this?
My specific situation: I have an array defined as shown below:
var countries = new Array();
countries[0] = 'ga';
countries[1] = 'cd';
...
and I need to…
Herb Caudill
- 50,043
- 39
- 124
- 173
1232
votes
2 answers
How do I use 'git reset --hard HEAD' to revert to a previous commit?
I know that Git tracks changes I make to my application, and holds on to them until I commit the changes.
To revert to a previous commit, I used:
$ git reset --hard HEAD
HEAD is now at 820f417 micro
How do I then revert the files on my hard drive…
Brian McDonough
- 13,829
- 4
- 19
- 23
1231
votes
12 answers
Fastest way to check if a value exists in a list
What is the fastest way to check if a value exists in a very large list (with millions of values) and what its index is?
Jean-Francois Gallant
- 13,583
- 6
- 20
- 24