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

20h
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.
Aug
27
comment What optimizations can be done for soft real-time code in C#?
1) Did you actually notice problems? Thanks the to background GC, your threads should only stop briefly for certain parts of the GC, but many other parts can run in parallel without interference. 2) How many milliseconds are we talking about here?
Aug
26
comment Are there any downsides to replacing js confirm boxes with “mark record as deleted”?
1) Both a flag and moving it are forms of soft deletion, since the data is still available. A flag is the conventional implementation. 2) I'm talking about reusing a value on a field which has a unique index (usually not the primary index) once the record occupying it has been deleted.
Aug
26
comment Are there any downsides to replacing js confirm boxes with “mark record as deleted”?
A unique index is the biggest pitfall with softdelete I encountered so far.