2,701 reputation
2819
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 4 months
seen 13 hours ago

Jan
26
comment If we close browser window without getting logout, what will happen when we provide same URL in the browser?
If you're using cookie based authentication, it depends on the kind of cookie. Session cookies will be deleted when the browser closes, persistent cookies may survive longer. What exactly closing a window/tab means if it isn't the only one, depends on the browser.
Jan
26
comment When must arbitrary precision arithmetic functions be used in PHP?
SHA-1 operates on several 32 bit integers internally. Externally it operates on byte sequences. So it's closer to strings than to big numbers. It's rarely helpful to treat it as a 160 bit integer. (There are other areas of crypto, such as RSA which use big integers internally, but you shouldn't implement those on a general purpose big integer library since that will open up side channel attacks)
Jan
23
comment Is it good to create static method at Visual Studio refactoring?
There is very little difference between static methods and instance methods. The main distinction is that instance methods have an implicit parameter for this.
Jan
21
comment Summary of C# naming conventions (official Microsoft conventions)
The framework conventions only apply to externally visible types/members (visibility is public or protected). For the rest you can use project/company specific conventions.
Jan
14
comment What should be the maximum length of a function?
@CaffGeek Or perhaps the function is simply doing something non trivial. I've seen functions which would take me days to fully understand. Even functions where I understand all the concepts involved can easily take half an hour to work through the details. While it's nice to have trivial functions, many problems are simply inherently difficult.
Jan
13
comment How should one debug a PHP web application securely without exposing secrets to competitors?
Related How to be a zero-bug programmer?.
Jan
13
comment storing and retrieving millions of documents using c#
For the actual files, a plain file system should work fine. Just don't place them all in the same directory, create subdirectories with a few hundred files. For example you could create a subdirectory for each day 2013/01/13/filename.ext. For the search use whatever database you like, mapping the query to a filename.
Jan
10
comment Why do we need to use sealed on a class? Do we really need sealed?
Eric thinks from the point of view of a library developer. If a change to a library breaks a consumer, the library author can't make that change anymore. So it's useful to restrict a consumer from using it in a way that you're not willing to support. Restricting the consumer increases the flexibility of the library developer.
Jan
9
comment Why should we be aware of licenses?
That you agree to the license by merely using the software isn't that clear. Typically users have to agree to a EULA whose legal standing is tricky. It's only clear that you can't legally distribute software without obtaining a license.
Jan
2
comment Win loss code that does not make 1-0 record better than someone like 20-3
Most ranking systems base their result on the strength of the player you beat. Elo is a really primitive but popular system, Whole-History Rating is a nice advanced one.
Dec
13
comment How do you unit test private methods?
protected is part of the public API and incurs the same limitations (can never be changed, must be documented,...). In C# you can use internal together with InternalsVisibleTo.
Dec
12
comment Why doesn't Java String have static string manipulation methods?
null is an exceptional state and should be handled explicitly.
Dec
11
comment Creative Commons 3 vs Common Public Attribution License Version 1.0 for my PHP Script
I believe that your first condition ("but can not redistribute it as a new product or with a different name") contradictions the OSI definition of open source.
Dec
11
comment ASP.NET Web Forms is bad, or what am I missing?
Another issue with your example is that it's vulnerable to CSRF attacks. (But that'd also be true if you used POST without an Anti-CSRF token)
Dec
11
comment ASP.NET Web Forms is bad, or what am I missing?
Because the HTTP specification says so. "In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe"."
Dec
11
comment ASP.NET Web Forms is bad, or what am I missing?
Don't use GET to modify something. At minimum you should use POST, but preferably DELETE.
Dec
11
comment Under what scenarios will an App's localStorage get cleared?
"is it a good idea to use localStorage?" That depends on what you want to store there. You cannot expect it to be permanent, so design your application to take that into account.
Dec
11
comment How should we “pick the comfortable programming language” in an interview?
Unless you have reason to believe that the interviewers are good functional programmers, I'd avoid haskell.
Dec
11
comment How to identify unstable floating point computations?
I meant a custom type that keeps track of upper and lower bounds by using different rounding. This doesn't work in every situation (In particular non continuous operations like x > y don't work), but should work well in many cases.
Dec
11
comment How to identify unstable floating point computations?
A custom numeric type that keeps track of the error in C++ should work decently. Of course that requires some changes to the program.