2,701 reputation
2819
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 4 months
seen 9 hours ago

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
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)"
Nov
15
comment local communications between two apps
I'd consider ZeroMQ. It's message based, so you don't need to implement that part yourself. It has different backends from in memory over pipes to full blown TCP.
Nov
15
comment Pre-processor usage to separate logic to different versions of product
Note that an if statement doesn't necessarily imply a runtime condition. If the condition is a compile time constant compilers will usually omit the unreachable code (but depending on the language they might produce a warning).
Nov
14
comment Is it better to use preprocessor directive or if(constant) statement?
If you want to be able to set it via the compiler command line, I'd still use a constant in the code itself and only #define the value assigned to that constant.
Nov
14
answered Pre-processor usage to separate logic to different versions of product
Nov
14
comment Why are pointers not recommended when coding with C++
Don't use backticks for highlighting, they're for inline code. Either use bold or italique.
Nov
6
comment Why do new programmers seem to ignore compiler error messages/runtime exception messages?
In my experience just looking at the code works well for syntax errors, since there the compiler message is often about a failure that's indirectly caused by the original error. For semantic errors, as in your example, the error message is usually essential.
Nov
5
comment Where should I store and verify files manipulated by an app
As many tests as possible should not touch actual files at all.