siawyoung
Re:Commits are snapshots not diffs (2020)
on Thursday April 08, 2021 @03:52PM (#26742981)
Commits are conceptually snapshots, and everything else Git does is just an optimization over the naive “keep all versions of all files ever” (imagine implementing a version of Git that is just zipping the entire folder). Diffs are isomorphic to commits and are generated as needed.
I wrote about it (albeit imprecisely) here: https://siawyoung.com/git-intuition
Re:Binary Search Reconsidered (2018)
on Friday December 25, 2020 @12:50PM (#25537877)
This makes sure that none of the quantities being calculated will overflow while still returning the same answer.
Where x is min and y is max, the midpoint is:
(x+y)/2 = x+(y-x)/2 x+y = 2x+y-x x+y=x+y