Thursday, December 05, 2019

Everyday Carry

Except for a few hours on Sunday, when I replace the gray shirt with a tie and white shirt, this is what I wear and carry every day.  I selected most of these items because I find them practical and durable.  A complete inventory is below the image.


From top to bottom:

Tuesday, October 01, 2019

Gotcha: go Foo().Bar()

To my surprise, but in accordance with the Go language specification, the following code invokes Foo() in the current goroutine and then starts a separate goroutine to invoke Bar():

    go Foo().Bar()


I incorrectly assumed that it created a separate goroutine to evaluate the entire expression.  I'm not sure why I assumed that.  If you want both Foo and Bar to be run inside a new goroutine, you need something like this:

    go func () { Foo().Bar() }()


Hopefully writing this down will help me remember.

Tuesday, September 24, 2019

Review: A Brief History of Time 👍

I've been a fan of theoretical physics for a long time, but had never actually read Dr. Hawking's wildly popular A Brief History of Time. I got a coupon to buy it for $2 and went for it.  Even if you're only interested in science or the history of science, regardless of your own science ability, I'd recommend this book.  It's highly approachable.

The first 80% of the book describes how we came to know what we do know about the universe.  It's amazing how cleverly people can discern truth from a pittance of data available from the stars.

The book paints an informative picture of human nature.  It takes us a long time to embrace the truth when it happens to conflict with our notions of tradition, right, or beauty.  For example, regarding a universe that expands, Hawking writes, "This behavior of the universe could have been predicted from Newton's theory of gravity at any time in the nineteenth, the eighteenth, or even the late seventeenth century.  Yet so strong was the belief in a static universe that it persisted into the early twentieth century."  Humans love to grow attached to ideas, regardless of their truth or utility.  It's cliche that good ideas are initially opposed and discarded, and it's apparently true in the history of cosmology and theoretical physics.

The final 20% of the book describes speculative theories that haven't yet been tested.  This part of the book is not as fun to read. It lacks the anecdotes of creative discovery that make the first part of the book so fun: finding that a theory agrees with natural observation, or making observations that hobble all known theories.  If you want to focus only on the best parts of the book, you can skip chapters 10-12, and perhaps chapter 9.  For that content, your time may be better spent skimming Wikipedia articles about the arrow of time, wormholes, and string theory.

Thursday, August 29, 2019

Review: The Mote in God's Eye 👍

I just finished The Mote in God's Eye by Larry Niven & Jerry Pournelle.  It was excellent.  It's my favorite kind of speculative fiction: imagine one small change to how the world works and then explore its consequences.  In this case, the exploration is packaged as a first contact narrative which makes the comparative anthropology feel natural and entertaining.

Ignoring superficial differences, alien biology deviates from human biology in one way.  That deviation leads to substantial differences in their evolution, societal organization, priorities, and motives.  Niven and Pournelle toss in a few other interesting ideas along the way.

I sometimes had trouble keeping the cast of characters straight.  I've never had a mind for large social networks, so that's probably as much my problem as theirs.  Either way, it didn't detract from the story or the ideas.  It's definitely worth reading.

Monday, August 12, 2019

Databases by code size

I was curious how various databases compare in terms of their total source lines of code.  For each database I cloned the source repository or downloaded a source tarball.  I deleted code related to tests, and producing documentation (some projects have more test code than database code, so this can make a big difference).  Then I ran scc.  The numbers below are what scc labels as Code.  Since the methodology isn't exact, I only retained two significant figures.

The results are sorted from smallest to largest by SLOC count.  Let me know if you find mistakes or want another database included in the results.