Reputation
2,749
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~83k people reached

Jan
29
comment Are there programming languages that allow you to do set arithmetic on types?
@RobertHarvey At least intersection & would be extremely useful IMO. It simplifies interface hierarchies since you can simply have one interface for each feature, without needing inheritance. For example collection interfaces with & instead of just inheritance would be more flexible and cleaner.
Jan
29
comment Are there programming languages that allow you to do set arithmetic on types?
Support for & and | seems useful, but ^ and ! not so much.
Jan
26
comment When must arbitrary precision arithmetic functions be used in PHP?
Chord might interpret a SHA-1 hash as a large number. Not because of SHA-1 is related to big integers, but because the protocol built on top of it might find it convenient to do so. DHTs use a distance metric between hashes, theirs might be expressed using big integers.
Jan
26
comment What is the most effective grammar to use for issue titles?
One problem with the imperative variants is that they assume that you know the solution when creating the issue.
Jan
26
revised If we close browser window without getting logout, what will happen when we provide same URL in the browser?
Format quote as quote, not text. Better tags. Grammar and formatting fixes.
Jan
26
suggested approved edit on If we close browser window without getting logout, what will happen when we provide same URL in the browser?
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)