2,498 reputation
2618
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 3 years, 11 months
seen 7 hours ago

8h
comment Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
@PieterB There is a big German accounting software that doesn't work on computers with a non German locale because it does this. It first converts the date to string using the system locale and then tries to parse it with a fixed locale and complains about the illegal format. It does the same with numbers and varying decimal separators, except that it doesn't complain there, it corrupts the data and exhibits weird behaviour. Took me days to figure that one out.
8h
comment Code that converts a value into a different representation, then converts it back to where it started is bad, but how?
Converting to double is a lossy operation.
8h
answered Software license without modify
1d
comment What are data validation best practices?
Personally I'd either use a ModelStateDictionary (or a similar class if it's not an ASP.NET application) or exceptions. Which one I prefer depends on context, for a validation class the dictionary approach is probably preferable.
Oct
4
comment GPL - No version mentioned
I recommend contacting the authors/copyright holders and asking them to clarify.
Oct
4
comment Why overriding a static method does not result in polymorphism in java
Why do you claim that you can override a static method? You can hide it, but that's quite a different thing.
Oct
4
comment How do I handle a spam server invalidating my tokens?
I don't think the form should only have that single button, it should ask for the new password. Change the password when pressing the submit button and invalidate the token at the same time.
Oct
4
comment How do I handle a spam server invalidating my tokens?
IMO you should combine invalidation on password change (POST, see Bart's answer) with an expiry time (24h or so). If the user opens the email too late they simply need to request another email.
Sep
29
comment How do I compile my software for all platforms from Ubuntu Linux 64 bit?
1) Can you cross-compile? I believe that should be possible at least for different linux flavours. 2) Compilation is usually the easy part. Debugging platform specific issues is the main problem.
Sep
29
comment Ethics, Clients, and legal repercussions
But if you buy the source code, you usually get access to the source code (surprise surprise). Compare this with "reverse engineering obfuscated code" as in the OP. While it may happen in same cases that a company has the rights to an application without source code, but that's relatively rare.
Sep
24
awarded  Autobiographer
Sep
22
comment Where and how to mention Stackoverflow participation in the résumé?
One problem with those tiny urls is that they hide your username.
Sep
22
comment Why does `SortedDictionary` not implement `IReadOnlyDictionary`?
I guess they simply forgot to add it, or considered it too much work for too little gain.
Sep
21
comment FizzBuzz - really?
What did they use instead of the remainder operator? x - (x/y)*y?
Sep
17
comment Should I worry about performance, even if there is no loss of convenience?
My experience is that incremental updates are very error prone and hard to debug. I only use them when recomputing is too costly.
Sep
13
comment Function only returns unchanged parameter, useless?
For example in C# I often use .OrderBy(x => x)
Sep
9
comment Why is the use of conjunctions in method names a bad naming convention?
I wouldn't use a suffix for the throwing variant, but I would use one for the null returning variant. Could be Try..., ...OrNull, ...OrDefault. @EricLippert That's not the only convention in .net. Consider Single vs. SingleOrDefault, which is very close to the OrNull the OP suggested.
Aug
29
comment Why don't compilers inline everything?
RAM is slow. And CPU cache is only a few MB.
Aug
27
comment What optimizations can be done for soft real-time code in C#?
@Doval The GC of the compact framework used by XNA running on the xbox is much worse than the GC used in the normal framework. There were significant changes to the GC in .net 4.0 related to background collection which should benefit latency. With background collection the expensive Gen2 collection can run in the background while your application continues working. It can even run Gen0/Gen1 collections while the Gen2 collections is in progress.
Aug
27
comment What optimizations can be done for soft real-time code in C#?
In my experience object pools are useful for recycling large arrays (such as buffers). For small objects the runtime tends to do well without manual pooling.