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

May
11
comment idquantique .vs. rdrand
@RobertHarvey Statistical analysis can only discover the most blatant flaws in a PRNG. There are plenty of flawed PRNGs that no statistical test will find.
May
11
comment idquantique .vs. rdrand
If you take a proper PRNG and seed it with about 256 bits of hardware entropy it'll produce unlimited amounts of pseudo-random data that's completely indistinguishable from real data by any known process.
May
6
comment Web hosting deciding to pay for hosting or host your own?
Concerning the last paragraphy, there is colocation.
Apr
29
comment How did they debug segmentation faults before protected memory?
Even now many pointer mistakes don't cause a nice segfault.
Apr
28
comment Can an 81 digit number generator lead to copyright infringement?
Reusing existing collections might be problematic. A random puzzle matching some existing puzzle is certainly no problem.
Apr
25
comment How to reject a code review that you believe is unnecessary?
Just because you can't write a test doesn't mean it's not broken. Undefined behaviour which usually happens to work as expected (C and C++ are full of that), race conditions, potential reordering due to a weak memory model...
Apr
25
comment How to reject a code review that you believe is unnecessary?
C and C++ are full of things that appear to work but are actually undefined behaviour. UB is a real defect, even if you can't write a test that shows it doesn't work as it should. For example many compilers use UB as an optimization opportunity, by assuming that the case that's undefined never happens. For example if you used size > size+1 to check for overflow on a signed integer, the compiler may simply replace this expression with false, since overflow of signed integers is undefined. See blog.llvm.org/2011/05/…
Apr
7
comment NDIS Driver Filter VS API Hooking
That depends on context, and you didn't describe the context of your application. I'd prefer API hooking when I want to affect a single specific application, and a driver if I want to affect the whole system. But other considerations might apply.
Apr
7
comment How important is it to reduce the number of lines in code?
@Alnitak Since the expressions have no side effects the code is equivalent. The compiler may omit evaluation if it can guarantee that that change has no observable effect. I expect that modern c compilers can optimize out such a difference, not sure about the JVM.
Mar
29
comment Why can't a compiler avoid importing a header file twice by its own?
On the MS compiler there is #pragma once which tells the compiler to only include that file once.
Mar
28
comment How to find siblings of a tree?
@CoffeeAddict I did not say it is trivial. I explicitly said it is not, and I allowed for minor mistakes. But I think finding the main algorithm isn't very hard. Testing the code and ensuring that all corner cases work takes more than 5 mins, but writing the basic code down should be quite quick.
Mar
24
comment Test case design - do for all positive tests exist also negative ones?
There are two cases here 1) When you enter a number, no message is displayed 2) If you enter a non-number it displays an error. You should write a test case for both of these. It doesn't matter which of these you label "positive" or "negative", just that you test both of them.
Mar
23
comment Why does Cem Kaner consider a test not revealing a bug a waste of time?
IMO a caught regression counts as a caught bug. It's just not a bug that was present at the time the test was written.
Mar
22
comment Configuration file that can be modified by user in C#
One important question is where you want to store this file. Since you're talking about a service, you probably don't want unprivileged users to be able to change the file, else you get the risk of a privilege escalation vulnerability.
Mar
22
comment Is “White-Board-Coding” inappropriate during interviews?
Even if it's just notepad.exe it's so much easier to work with than paper or a whiteboard. You can insert or delete lines, which is a huge pain on physical media.
Mar
22
comment Is “White-Board-Coding” inappropriate during interviews?
"simple" and "reverse a string" in one sentence? IMO that's quite a difficult task, and I'd need extensive documentation checking(and probably googling) to do that. So many subtle corner cases...
Mar
21
comment Why have hardware-accelerated vector graphics not taken off?
Not entirely sure what you want, but what about Cairo, Mozilla Azure, and Direct2D?
Mar
21
comment Are generic programming and OOP mutually exclusive?
@RobertHarvey The main difference between a generic in the C# sense and a template in the C++ sense is that a C# generic binds to interfaces and does overload resolution using the abstract type parameter whereas C++ binds to names and does overload resolution with the concrete type at instantiation time.
Mar
21
comment What is a good design for a container, assignment and items
I'd give Flight a property Bookings and a property Users, where Users is a convenience feature. I'd mostly abandon the notion of Container and Assignment, but if you really want you can use interfaces(IContainer with property IEnumerable<IAssignment> Assignments to represent them.
Mar
21
comment Do unit tests sometimes break encapsulation?
@MattFenwick It might be a sign that they should be moved to a different class, but that class should probably be internal, so you still end up testing internals.