2,712 reputation
2819
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 6 months
seen 1 hour ago

NSA running around with their hair on fire because they realise if everyone starts using OTPs and not their weak AES algorithm then their PRISM programme is worthless. --- zuallauz - Would this simple encrypted chat program be feasible using One Time Pads?


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.
Nov
28
comment if a c# interface contain only getter and setter definition, is it a code smell?
The presence of the setters is a bit weird. This looks like the kind of data which most consumer would only read not modify.
Nov
28
comment Who is responsible for stream positioning?
Yes, in general the caller should do the positioning.
Nov
28
comment Do we still need manual code review if we use sonarqube code review tools
Resharper detects code that can be rewritten as LINQ quite often.
Nov
27
awarded  Yearling
Nov
26
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.