Reputation
2,732
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~80k people reached

9h
comment is it an implementation issue or a bug?
Consider applying proper indentation to the code.
11h
answered Recommended HTTP status code for “plan limit exceeded” response
11h
comment Recommended HTTP status code for “plan limit exceeded” response
RFC4331 might be relevant, it's about quota limits for WebDAV.
12h
comment Recommended HTTP status code for “plan limit exceeded” response
There is HTTP 507 Insufficient Storage.
2d
comment How to store passwords which need to be re-read
"and a 'random' number" what do you mean by that? Usually the salt is the random number.
2d
comment How to store passwords which need to be re-read
Encrypting the password is slightly better than storing it in plain, but not much, since you still need to store the key somewhere.
2d
comment If passwords are stored hashed, does that mean that theoretically there exists another password that could be used to log in?
@gnat The requirements for a collision resistant hash (e.g. SHA-2) and a password hash (e.g. PBKDF2, bcrypt, scrypt) are quite different. In particular the latter is slow, salted and only requires first pre-image resistance not collision resistance or second preimage resistance. So I'm not sure if it's appropriate to close a question about password hashes as a duplicate of a question about collision cryptographic/collision resistant hashes.
2d
comment If passwords are stored hashed, does that mean that theoretically there exists another password that could be used to log in?
Password hashes are not necessarily collision resistant. In fact PBKDF2 and scrypt have certain trivial collisions (every password longer than one block has an equivalent, trivial to find password that has the same has.
Jun
28
reviewed Approve Do my “dal” and “fileHandler” interfaces overlap?
Jun
28
comment Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
Does the homework assignment explicitly require the deletion operation? If it does not, then I wouldn't implement it. My experience with homework assignments is that you should implement a solution that fulfills the stated requirements and nothing more.
Jun
28
comment Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
@Carcigenicate 1) Concerning the moving you must use the proper condition to figure out how many elements to use. All elements in the same buckets and elements of subsequent buckets displaced by it. 2) I suspect your non moving approach doesn't actually work. Since if you place a new value in that slot, with the new element coming from a higher bucket, this new element would disrupt the linear scan of the lower bucket extending beyond it. So implementing move-on-delete seems to be necessary with linear scan.
Jun
28
comment Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
Yes. AFAIK that's also the way F# implements discriminated unions, since it has to compile to the .NET type system, which is similar to java.
Jun
28
revised Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
added 272 characters in body
Jun
28
comment Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
@Carcigenicate Only the Occupied class would contains those fields, so you can't get an invalid state. If the base class were public, somebody might be able to create a contract violating derived class, but there are workarounds for that (like internal constructors, which would prevent instantiation of other derived classes). You can make these classes immutable if you want, only accepting values via the constructor and not having setters.
Jun
28
comment Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
@Carcigenicate This optimization can be used even with linear scanning. It corresponds to your second approach, but uses the same field to represent special values and something that's useful (the cached hash) if the slot contains an element. It's not a bad idea, but IMO an unnecessary complication for a homework problem.
Jun
28
revised Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
added 264 characters in body
Jun
28
revised Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
added 264 characters in body
Jun
28
answered Cleanest way to represent three states, where one can hold a Key/Value pair, and the other two are empty markers
Jun
28
comment Reading file during write on linux
I think the big difference between Linux and Windows is that Linux treats the file as separate from its file system entry. So you can unlink a filename while its open. Windows on the other hand delays the deletion until it gets closed. Does Linux allow the modification of running executable files? Or does it just allow deletion+recreation with different content?
Jun
28
comment How is a state machine different from any other computer program?
Sounds like turing tarpit. Just because it is possible to express any program like that, this doesn't mean it's a good form to model it like that. We're not computers, we need to reason about out programs, which for some programs works well when they're expressed as a state machine.