2,836 reputation
1319
bio website zvrba.net
location Oslo, Norway
age
visits member for 4 years, 2 months
seen Jul 13 '13 at 20:50

Sep
22
awarded  Good Question
Sep
21
awarded  Popular Question
Sep
20
answered Fast algorithm to search a sorted array of floats to find the pair of floats bracketing an input value
Sep
20
comment Would scala be a good choice instead of Java?
Rewriting everything in another language? And 2 years with nothing to deliver? Sounds like a terrible management decision and like you might need a new job in half a year ;)
Sep
3
comment Choosing the type of Index Variables
@Michael: I agree it was contrived example. Still, I often write algorithms with nested loops: for(i=0;i<v.size()-1;++i) for(j=i+1;j<v.size();++j) .. if v is empty, the outer loop executes (size_t)-1 times. So I either have to check v.empty() before the loop or cast v.size() to a signed type, both of which I personally think are ugly workarounds. I choose a cast as it's fewer LOC, no if()s => fewer possibilites for mistake. (Also, in 2nd complement, conversion oveflow returns a negative number, so the loop doesn't execute at all.)
Sep
1
comment Choosing the type of Index Variables
In what situation would it be meaningful for simple test such as if(v.size()-1 > 0) { ... } to return true for an empty container? The problem is that sizes are also often used in arithmetic, esp. with index-based containers, which is asking for trouble given that they're unsigned. Basically, using unsigned types for anything else than 1) bitwise manipulations, or 2) modular arithmetic is calling for trouble.
Aug
31
answered Choosing the type of Index Variables
Aug
29
comment practical way to learn C?
You'll get more sensible answers if you can tell us WHY do you want to learn C?
Aug
29
answered How large non-OO code bases are managed?
Aug
25
comment Is there any evidence that Intellisense reduces productivity?
Not only that; if you want to have readable code, you need rather long names, and Intellisense helps to avoid misspellings and wasted compilations due to them.
Aug
11
comment Why (not) segmentation?
You have completely misunderstood the segmentation. In 8086 it might have been a hack; 80286 introduced protected mode where it was crucial for protection; in 80386 it was even further extended and segments can be larger than 64kB, still with the benefit of hardware checks. (BTW, 80286 did NOT have an MMU.)
Aug
10
answered Why (not) segmentation?
Aug
10
answered Good design: How much hackyness is acceptable?
Aug
4
comment Which hashing algorithm is best for uniqueness and speed?
You're wrong; crypto algorithms are designed to be as fast as possible while still remaining secure.
Jul
28
answered New to programming, where do I start?
Jul
27
answered How should I charge for programming things which take two minutes to fix?
Jul
25
comment Can any GPLv2 licensed library be used in a company's internal intranet application?
Of course that one does not have the obligation to redistribute the program. But whoever receives it has the right to redistribute it should he wish to do so. In other words, if you say to your employees that they are not allowed to redistribute your program, you're in violation of GPL (as it explicitly says that you cannot limit the receiver's freedom to further distribute the work).
Jul
25
comment Can any GPLv2 licensed library be used in a company's internal intranet application?
(Whether you wish to think of your employees as adversaries, and to which degree, should be proportional with the amount of damage that the leakage of this app can cause.)
Jul
25
comment Can any GPLv2 licensed library be used in a company's internal intranet application?
Whether you intend to distribute the application or not is irrelevant. The GPL is clear on the following: anyone who gets his/her hands on a GPL work can freely distribute it further (and can demand the source code). Talk to a lawyer to find out what else can be held against your employees if they choose to distribute the GPL work, as the GPL license allows them.
Jul
25
comment Can any GPLv2 licensed library be used in a company's internal intranet application?
The console-based EXE is GPL since it uses a GPL library, and, as such, the GPL requires that it must remain freely redistributable by anyone who gains access to it. Yes, an employee might lose his job for doing so, but it is his right to redistribute the GPL'd EXE with the source. Though, other rules and laws (e.g., trade secret) might apply. Check with a lawyer whether you can really hold "disloyal" employees responsible for doing that which is granted by the GPL.