146 reputation
6
bio website
location
age
visits member for 2 years, 10 months
seen 2 days ago

Jun
19
comment What would be the Impact of P=NP?
@ArthurB so if P=NP and the reduction algorithm is O(n^99999999) is P=NP still such a big deal?
Jun
16
comment What would be the Impact of P=NP?
@ArthurB fascinating. Assuming that P=NP, what is the order of the algorithm?
Jan
5
comment At what point is version control needed?
This is very weak. It is unlikely that a shop does not need version control, but if a shop truly does not need version control and a candidate refuses to work for a shop without version control, then it probably is not a good match. That being said, I don't believe in the existence of shops that don't need version control.
Sep
19
comment Is it appropriate for interviewers to ask candidates for their Stack Exchange user name?
@jwg You can have multiple accounts. Use one to ask your dumb questions. Use another to write your brilliant answers. Use a third, fourth, fifth, ..., if the hoi polloi are not upvoting your brilliance enough. Wash, rinse, repeat.
Sep
13
comment Is over-engineering a warning sign?
"What is 2+2?" 4 versus "Let's see how creative you are. What is 2+2?" The limit of the sequence 3.9, 3.99, 3.999, 3.9999, ...
Aug
27
comment Is there a term for reusing code by retyping it?
@gnat if you didn't feel that way about reviewing your own code, then that would mean you have not grown intellectually. It is a good sign.
Aug
21
comment Does an Open Source license exist that allows me to retain rights to revoke usage of software/source at any time, for any reason, and without warning?
This is my understanding of how things worked. However, if the open source has multiple authors then it is no longer your decision alone.
Aug
14
comment Is handwriting out code an efficient way to learn a programming language?
For sure, writing code on paper and then transcribing it to computer is not a very productive development habit. But for learning, the hassle of editing actually reinforces the learning. To get that blank line, you have to delete some of your code and rewrite it - forcing you to review it one more time.
Jul
14
comment Is it legitimate to ask co-workers to use specific browser in an intranet website?
Keep calm and close IE -- sd.keepcalm-o-matic.co.uk/i/keep-calm-and-close-ie.png
Jul
10
comment Is the List interface a leaky abstraction?
There is an even more general interface that is often sufficient in functionality: Iterable.
Jul
8
comment Paranoid Encryption
I do not understand your point about changing the key. I as the attacker will presumably have copies of all your encrypted files. If I can steal one of your keys, you have to assume that I can steal the associated data. Decrypting and reencrypting will not protect you.
Jul
4
comment Is fewer lines of code always better?
For the specific example given, I prefer the first because the intermediate variable names add absolutely no value. Others have written excellent answers for the more general case.
May
31
comment Making Simple IF Statements Shorter
I think this is the right answer. The computer will understand all forms. So you should write it the way your audience prefers. @AndresF in some multidisciplinary workspaces, some people from non-technical backgrounds may look at your code
May
30
comment Making Simple IF Statements Shorter
There is a another way: boolean test4=isChecked(str) .... boolean isChecked(String str){ return "checked"==str; }. You can use the method name to make this appropriately self-documenting.
May
24
comment In languages that don't allow underscores in integer constants, is it a good practice to create a constant for 1 billion?
@MathewFoscarini In general, mistakes can go either way. But when it comes to your bank, mistakes will always go against you.
Apr
22
comment Logging failed login attempts exposes passwords
I will concede my suggestion is at best a minor improvement on your otherwise excellent answer.
Apr
22
comment Logging failed login attempts exposes passwords
@galdikas I would guess they would keep the username constant but iterate over the passwords. I'll just assume your site has a username 'admin'. Because a lot of sites do have an 'admin' user and often this user has super-privileges so hacking this account is high-value. Now I can iterate over my dictionary of common passwords. Your site does not have an 'admin' user, but it is still under attack.
Apr
22
comment Logging failed login attempts exposes passwords
@galdikas There probably is not anyone stupid or persistent enough to keep doing it more than a few times, but there are scripts that are stupid and persistent enough to do it thousands of times. Wouldn't you like to know the difference?
Apr
22
comment Logging failed login attempts exposes passwords
@galdikas There is no need to extract anything from the user name. For example, I am user 'user' with password 'password'. I login with 'userpassword' and your hash function maps 'userpassword' to 17. The logs will say "Failed login attempt by unidentified user 17".
Apr
22
comment Logging failed login attempts exposes passwords
To be fair to ddyer, the user could inadvertently type their passwords into the URL field or any other field. If we are going to log any user supplied data, we can not guarantee that the password will not get logged. At some point, we can not protect the user from themselves.