2,671 reputation
2718
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 1 month
seen 3 hours ago

Dec
26
comment UHD glare or non glare?
I don't think that you'll see more code with the higher resolution, since you'll probably need to increase the font size to keep it readable.
Dec
24
comment Questions about getting MCTS
I'd rather learn about Monte-Carlo Tree Search (MCTS), far more interesting.
Dec
21
comment IRC Channels and Programmers why?
Chat is nice for socializing and discussing something. But it didn't find it a good choice for solving problems.
Dec
21
comment readability vs shorter code in returning from function
The nops in your assembly code are a clear indication that JIT optimizations are disabled. Using the default settings VS disables JIT optimizations if you run in the debugger.
Dec
19
comment What is the hierarchical DB schema for this xml?
The big downside of MongoDB is that it doesn't support transactions (yet).
Dec
19
comment Is using multiple static classes with maximum one public method is a good idea
Most of those disadvantages are only an issue if you have global state or don't use higher order functions where appropriate.
Dec
18
comment Algorithm to test file equivalence
I would not use multiple hashes. One collision resistant hash (e.g. SHA2) should be enough. The probability of accidental collisions is negligible with good hashes of at least 256 bits and beyond ridiculous at 512 bits (e.g. SHA-512). Against deliberate collisions using multiple hashes is only about as strong as the strongest hash, not stronger. In general it's typically better to spend the CPU budget on using a stronger hash instead of multiple weak hashes. Personally I wouldn't even bother with byte-by-byte comparison of files if the have the same SHA-2 hash.
Dec
16
comment Is it better to use strings or int to reference enums outside the java part of the system?
In the javascript API I'd certainly use strings. In the DB both have their advantages. Some databases have built in enum support.
Dec
8
comment Adding non distinct elements to a dictionary
Perhaps a HashSet<T> is a better fit than a dictionary.
Dec
8
comment Is automatic conversion to collection types from non-collection variable a good idea?
It's pretty common, taking the form of (params T[] bla).
Dec
5
comment Rationale behind CSS height with percentage value
Perhaps because it is or at least looks like a circular dependency.
Dec
4
comment Why doesn't Android use shared libraries?
@WyattBarnett I'm generally a fan of putting everything my application needs in the application directory, the security/bug fix issue is the only significant downside I know of.
Dec
4
comment Why doesn't Android use shared libraries?
The main advantage of centralized storage isn't disk space, it's that there is only one place where you need to apply a bug or even security fix.
Dec
4
comment Why do UTC Dates have different days of the week for some months?
2014-12-04 01:00 in UTC+02:00 is 2014-12-03 23:00 in UTC. If you use a library which represents dates by timestamps at midnight, then applying timezone conversion to dates changes the date since midnight can become before-midnight in another timezone.
Dec
4
comment Securing sensitive data from developers
@JanHudec Especially since adding code the the application leaves traces in version control.
Dec
4
comment Securing sensitive data from developers
@Clinton Do you have separate admin and developer teams? The server admin can always read the data and encryption doesn't help since they can easily get the key.
Dec
4
comment Best OOP Practice in C#: Passing the object as parameter VS creating a new instance of the object
Depends a lot on what kind of class TheObject is. If it's something service or policy like, pass it in.
Dec
4
comment How to handle a memory consuming member variable
If it's static, it better be immutable.
Dec
2
comment When is inlining worth it?
I once had a significant performance decrease in a cryptographic hashfunction due to the increased code size when unrolling a loop, probably because it didn't fit into a CPU cache. CPU caches, especially the faster ones, are quite small compared with RAM.
Dec
1
comment Is generating a large random number more unique than generating each digit in that number?
It doesn't make sense to use rand or mt_rand. Use a CSPRNG, or if you just need something unique, a GUID/UUID.