Converting from svn to git: salvaging local branches

If some team members use git-svn locally, they might have a local working branch. When the team moves to a central git repository, that work needs to come with them. In the old git-svn repo: 1) Find the revision where the local branch of interest branched off master: git svn find-rev `git merge-base $branch master` … Read moreConverting from svn to git: salvaging local branches

Idempotence in math and computing

“Idempotent” is a big word. It’s one of the four-dollar words thrown around by functional programmers, and it confuses people — including functional programmers. This is because we don’t use it consistently. In math, idempotence describes only unary functions that you can call on their own output. Math-idempotence is, “If you take the absolute value … Read moreIdempotence in math and computing

Def and Val in Scala constructors

TL;DR – use def all the time, and things just work. Remember that old adage from Java, “Never call a nonfinal method in your constructor”?Yeah, that still applies in Scala, and it keeps biting me. It’s easier to get wrong in Scala. Here’s a refresher:When a class is instantiated, the superclass is initialized first. Its … Read moreDef and Val in Scala constructors

Special Relativity finally makes sense

Preface: I studied physics in college, yet there were parts of it that didn’t click with me. Special relativity with all its “a flashlight on a train” examples, that’s counterintuitive and hard. Yesterday in Surfaces & Essences, the authors explain Einstein’s thought process when he came up with it, and it makes sense this way. … Read moreSpecial Relativity finally makes sense

Equations

3 + 2 = 5 can there be two ways of looking at that? Turns out there are.[1] One can see = as equivalence, which means that  5 = 3 + 2  is the same statement. Or, one can read = as “results in”, seeing “the operation of adding 2 to 3 yields 5.” In … Read moreEquations