857 reputation
610
bio website
location Netherlands
age 42
visits member for 3 years, 6 months
seen 7 hours ago

2d
comment Value of passing by reference
"Why have both?" Because there are differences between the two, and C++ lets you decide which one fits your situation best. See the link for the differences.
Jul
7
comment How to solve linear recurrences involving two functions?
Usually the next step is a Eigen-value/Eigen-vector decomposition of the matrix, after which an explicit formula for F(n) and G(n) can be derived.
Jul
2
comment What does “ (int) value & 0x1, (int) value & 0x2, (int) value & 0x4, (int) value & 0x8 means”
The wording may suggest that it can be extended to all numbers, which is not true: 8/6 is odd, while 8&6 yields false.
May
2
comment heading in right direction? C++ and class templates
Try this->numfields_. Without the this->, templatized base classes are not considered. Look for 2-phase lookup for details.
Apr
20
revised Estimed number of tries
added 1 character in body
Apr
20
revised Estimed number of tries
added 108 characters in body
Apr
20
comment Estimed number of tries
@Stefan4024 I don't understand why ans += x * p; yields the correct answer. Apparently it does, as you said it was accepted as answer. I can explain why p halves: for each bit sequence that isn't clear yet, the next bit will make it clear in half of the cases, and postpones it in the other half. But I don't understand the formula for x. I would have expected something like ans += (N-1)*p for odd N, as there are N-1 undetermined bit sequences at any point (for powers of 2, there will be less such sequences), but I don't see how x*p adds up to N-1. My intuition fails me here.
Apr
20
comment Estimed number of tries
@Stefan4024 x = (x*2) % N doubles x in every iteration, until it becomes greater than N. E.g. for N=13, x will be 1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1. Especially at the start, the doubling is clearly visible.
Apr
20
revised Estimed number of tries
deleted 4 characters in body
Apr
20
revised Estimed number of tries
deleted 4 characters in body
Apr
20
answered Estimed number of tries
Mar
26
comment Why is it bad to write something in language X as if you're writing a program in language Y in terms of using a shared coding paradigm
@Onno In C++, pointers and new are considered the powertools. Automatic storage is the handtool.
Mar
26
comment Why is it bad to write something in language X as if you're writing a program in language Y in terms of using a shared coding paradigm
@Onno When you ask "How do I hammer this screw into the wall without it getting bend?" everyone will tell you not to use a hammer.
Mar
21
comment Optimal movie schedule
Hint: Work backwards. If he arrives at the end of the night, he can watch zero minutes. Going back in time one minute at a time, the minutes he can watch is the w[t] = max(w[t+1], w[t+m[i]]+m[i]) where i iterates over the movies starting at time t. w[t] is the number of minutes he can watch when arriving at time t, and m[i] is the length of movie i.
Mar
4
comment What exactly is the Garbage Collector in Java?
Your assumption about C++ programmers is wrong. A C++ programmer would create the Object on the stack (allocated without 'new'), so it would get destructed when the loop ends. All generated by the C++ compiler, so the C++ programmer doesn't need to worry about it. No leak, no problem, no headache.
Jan
10
awarded  Yearling
Aug
28
revised Best Practices To Create Error Codes Pattern For an Enterprise Project in C#
added 49 characters in body
Aug
28
answered Best Practices To Create Error Codes Pattern For an Enterprise Project in C#
Aug
5
comment What sort of development does Risk Management and Quant related software entail?
@Job I just disagree on the label 'pseudo science'. I'll grant you that it isn't as well understood as Newton's Laws, but it's not a pseudo science either.
Aug
5
comment What sort of development does Risk Management and Quant related software entail?
@Job I bet you don't believe in fire insurance or saving for retirement either? Those are forms of Risk Management as well. The math is required to estimate how much you have to pay for the insurance.