755 reputation
49
bio website daniel.lubarov.com
location Burlingame, CA
age 24
visits member for 3 years
seen 17 hours ago

Apr
19
awarded  Yearling
Apr
5
comment Correct way to undo the past few git commits including a merge?
By the way since you altered master's history, I think your teammates will get errors when they git pull. They could do git fetch; git reset --hard origin/master to overwrite their master branch with your new one, or just delete their local repos and do a fresh clone.
Apr
5
comment Correct way to undo the past few git commits including a merge?
What's interesting about git is you have your own local master branch which can diverge from the remote git server's master. When you run git reset --hard [SHA] your local master branch will point to that SHA. When you force push master the remote server's master branch will point to that SHA too.
Apr
4
comment Correct way to undo the past few git commits including a merge?
In some cases you can avoid conflicts by reverting the most recent change first, then the next most recent, etc. But if there are good commits mixed in with bad commits and they touch the same files, there may be "real" conflicts that you need to resolve manually.
Apr
4
comment Correct way to undo the past few git commits including a merge?
If you find it easier to pick a commit to go back to, but also want the safer option, you could do git reset --soft [good SHA], git commit and git push. That would push a new change that reverts everything after the good SHA.
Apr
4
comment Correct way to undo the past few git commits including a merge?
Were the other commits part of the merge or separate? If separate then yes, you'd need to git revert [SHA] each one.
Apr
4
revised Correct way to undo the past few git commits including a merge?
added 223 characters in body
Apr
4
answered Correct way to undo the past few git commits including a merge?
Mar
21
comment Can you use Pi as a crude random number generator?
@Falcon the same could be said of other CSPRNGs, but we can seed a pi-based PRNG by skipping the first s digits. Provided that the seed is sufficiently large and random, the sequence being well-known wouldn't make the generator easier to predict.
Feb
5
revised What are the essential mathematics topics that a programmer should know in order to learn algorithms?
fix typo: know -> no
Feb
5
suggested suggested edit on What are the essential mathematics topics that a programmer should know in order to learn algorithms?
Jan
21
answered How to name arrays or list when the nouns are both singular and plural?
Dec
22
comment Avoid too complex method - Cyclomatic Complexity
Your Java code has some integer division where you want float division.
Dec
7
comment Is a senior programmers advice about always using books a good idea?
@StephenC for stateless classes, it just seems strange to allow multiple instances when one would suffice, and what's the advantage? One stateful singleton that comes to mind is a packrat parser - you might have several singleton classes that extend an AbstractParser. True, it requires synchronization if you're parsing in parallel, but sharing the memoized state is important.
Dec
6
answered Is a senior programmers advice about always using books a good idea?
Nov
17
comment Is there any “real” reason multiple inheritance is hated?
@AndyzSmith, I see your point, but not all inheritance conflicts are actual semantic problems. Consider my example - none of the types make promises about toString's behavior, so overriding its behavior doesn't violate the substitution principle. You also sometimes get "conflicts" between methods which have the same behavior but different algorithms, especially with collections.
Nov
15
comment How to handle divide by zero in a language that doesn't support exceptions?
But we can't tell whether the denominator was intended to be positive or negative, so division might yield +inf when -inf was desired, or visa versa.
Nov
15
revised Is there any “real” reason multiple inheritance is hated?
deleted 1 characters in body
Nov
15
revised Is there any “real” reason multiple inheritance is hated?
deleted 14 characters in body
Nov
15
revised Is there any “real” reason multiple inheritance is hated?
added 12 characters in body