2,672 reputation
2718
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years
seen 13 hours ago

16h
awarded  Yearling
1d
comment Should I accept empty collections in my methods that iterate over them?
I'd throw if the collection is null but not if it's empty.
Nov
24
revised What is this pattern called? Run finally?
deleted 11 characters in body
Nov
24
comment Why are self-hosting compilers considered a rite of passage for new languages?
Unless it's a special purpose language, a language which isn't well-suited to write a compiler in is probably not well suited for what I want to do either.
Nov
23
comment Function guaranteed to never return the same value twice
The problem with v4 GUIDs is that they're only very likely unique, not guaranteed unique. Not a big issue in practice, but not satisfy the requirements if the interviewer takes them literally.
Nov
23
comment Function guaranteed to never return the same value twice
In a practical situation I'd go with a random value of sufficient size. ~120 are a common choice, at 256 bits you're clearly on the safe side (hardware errors that cause a counter to malfunction are much more likely than a 256 bit collision).
Nov
23
comment Function guaranteed to never return the same value twice
On physical machines you could assume that MAC addresses are unique.
Nov
23
comment Is it normal for a programmer to not have 100% clarity over their own code at times?
As long as you have a good reason for each dimension, I don't see a reason to avoid a 5D array. Perhaps there is a better solution, such as a dictionary with a complex key or several lower dimensional arrays, but I can very well imagine a 5D array being appropriate for a tricky problem like a chess AI.
Nov
23
comment Is it normal for a programmer to not have 100% clarity over their own code at times?
I never have 100% clarity over my own code.
Nov
22
comment Why does this evaluation function work in a connect four game in java
This doesn't do much beyond assuming that possession of points near the center is good (included in more possible rows). This can't function as a complete evaluation function by itself since it consider partial or even complete rows at all. It's only a heuristic to distinguish between situations and moves that look similarly good after looking at (partial) rows.
Nov
22
comment OSS Non-Commericial License
Or if you're worried that offering a (web)service based on your software doesn't count as distribution, there is the AGPL.
Nov
22
comment OSS Non-Commericial License
@SeanAllred That won't work for most software, mostly software targeted at enterprises. Another problem is that it creates a perverse incentive by discouraging you from improving the software so it requires less support.
Nov
19
revised Why are Apache 2.0 works excluded from OpenBSD?
added 11 characters in body
Nov
19
answered Why are Apache 2.0 works excluded from OpenBSD?
Nov
19
comment Why are Apache 2.0 works excluded from OpenBSD?
The new apache license - Theo de Raadt (Feb 18 2004) seems to be the relevant discussion. Some issues seem to be 1) readability for non lawyers 2) where copyright notices must be placed
Nov
18
comment How to send data between HTTP requests without user modifying it?
You might be able to use a MAC, but that's still potentially vulnerable to replay attacks.
Nov
18
comment Extracting first and last name from a single name field
Writing the code is easy. Deciding on which rules to use is the hard part.
Nov
18
comment What is the simplest human readable configuration file format?
I see two potential problems with your format: 1) Representing lists. You could use array link indexes [0], but that has its share of issues. 2) Representing something that does exist but is empty. If neither of these matter to you, the format is pretty nice.
Nov
18
comment Should I go with MongoDB Free Version?
The big downside of mongo is the lack of transactions.
Nov
15
comment docker-izing a classical db-based webapp - single or multiple containers?
From the article you linked: "for most systems, you'll want role-based containers (app, db, redis, etc)"