I work in the intersection of technology and government. Which is why stumbling on Catala was such a delight. “Deriving faithful-by-construction algorithms from legislative texts” you say? Uh yeah, pretty sure my customers could benefit from that kind of rigor.
And could it count for my currently unmet resolution if I can pick up the basics before year-end? I get to decide the answer to that, and the answer is yes. Time to get reading.
If you’ve never heard of Benford’s Law, it’s worth reading about this nifty statistical fact. The gist is that for certain types of data sets, the frequency of the leading digit follows a predictable pattern (with 1 being the most frequent by far). I decided to put it to the test by analyzing the total view counts for each post on this blog.
Leading Digit
Actual Rate
Predicted Rate
1
31.3%
30.1%
2
27.7%
17.6%
3
17.5%
12.5%
4
7.8%
9.7%
5
5.4%
7.9%
6
2.4%
6.7%
7
1.2%
5.8%
8
4.2%
5.1%
9
2.4%
4.6%
I guess that’s why they call it a law, because the actual digit rates match up pretty well.
Speaking of which, apparently I also have a thing for namedlaws. If you do too, the article is worth it for this side note:
The fact that things are often named for someone who didn’t discover it first is common. In fact, there is a name for this, Stigler’s Law of Eponymy. It was proposed by the American statistics professor Stephen Stigler in 1980 when he wrote that no scientific discovery is named after its original discoverer. In an ironic twist, Stigler acknowledged that the American sociologist Robert Merton had previously discovered “Stigler’s Law”.
Frederick Brooks died last week. He was a giant of the software industry, and deserves wider recognition for his contributions. Start by reading the New York Times article linked above, then grab a copy of The Mythical Man-Month. Few works have moved me so profoundly, at least if you measure by number of times I reference them (which, incidentally, is roughly how Google’s PageRank works).
Rest in peace, Mr Brooks. I’m thankful for you, and I’m sure you won’t be forgotten by those who build our castles in the air.
Really enjoyed Two Heads Are Better Than One, a discussion of the various ways technology has allowed humans to have “second brains.” I realized in some ways this blog is one such implementation; it’s a place I can capture thoughts and stories so that I can recall them later without keeping them in working memory.
As a bonus, via the article I discovered Obsidian, which I’m now dying to try out. I’m a sucker for Markdown and the power of plain text processing tools.
I’ve mentioned before my penchant for minimalism, which is why for the past 8 years my code editor of choice has been Atom (in fact, I may have been a beta tester for it, my memory’s a bit fuzzy on that point). Which is why it bummed me out a bit to read it’s being shut down at the end of this year. Technology marches on, I suppose. I can’t blame GitHub Microsoft for wanting to consolidate development effort in their fully-featured IDEs, especially integrated cloud-based solutions like Codespaces.
Still, I’m going to miss Atom’s simplicity and customizability (I’d even contributed to a few plugins). It was robust enough to be a complete development environment (for my coding style, at least), yet snappy enough for quick one-off text file editor. For the former case I’ll probably get back into VSCode, and Sublime Text ought to do the trick latter. Though maybe I can use it for both?
Because I’m a LeBron fan, when it comes to Wordle, I care more about longevity of sustained greatness (i.e. my perfect streak of winning games) than I do about having epic individual performances (i.e. having a lot games where I’ve won in 2 or 3 guesses). That means I need a way to keep my statistics even if I move between devices or need to replace one.
Almost to quadruple 100!
It turns out (at least as of this writing, who knows if the NYT will change it) that statistics are stored in a simple JSON object in browser local storage. On a laptop this storage is easily manipulated using DevTools, and on mobile it’s a bit tougher but still not too bad, at least on Android.
Both of the above, however, rely on GUIs. It got me thinking if there was a scriptable approach. First, I found a Python library (natch) that can speak the Chrome DevTools protocol. Then I had to figure out how to use it to read and write to local storage. That wasn’t too hard (even though the example here is in Node, the technique was portable). Finally I needed to make the library connect to both a laptop-based browser (easy), and my Android phone via adb (not so easy). Luckily I stumbled on the correct magical incantation in this post. Put it all together, and boom, I can now backup my Wordle streak, and easily transfer it between devices, using a script:
Want to see how I did it? Well, you’re in luck, because I packaged up my implementation and published it on PyPI. The source code is also on Github. Enjoy!
Despite writing a bit about CDK nearly two years ago, it’s taken me some time to get a chance to really lean into it. Having now built out a couple real projects, I can confidently say that like it has its rough edges, like any technology, but overall it’s both powerful and fun.
If you’re so inclined, feel free to check out my most recent creation, a construct for deploying a Hyperledger Fabric network on Amazon Managed Blockchain.
# Easy as pie!
HyperledgerFabricNetwork(
self, 'MyNetwork',
network_name='MyNetwork',
member_name='MyMember',
)
For my next trick post I’ll go through one of the aforementioned rough edges I discovered, and how it can hopefully be fixed.
Back in my math major days in college, I was introduced to the Online Journal of Integer Sequences. It’s exactly what it says on the tin. As part of a class we were encouraged to contribute, which I did.
A few weeks ago I had another idea for a submission, and to my surprise no one else had added it, so once again I had opportunity to contribute a little piece of Internet history.
Here’s a complete list of the sequences I’ve authored over the years:
If the above isn’t enough online notoriety, check out my only published mathematical work, A Probabilistic View of Certain Weighted Fibonacci Sums. I was only a mild contributor, but still got an authorial credit, which is pretty cool.
I spent some time today chatting with an early career colleague who’s looking towards a future career in the dark arts software development. Being the kind of person that enjoys the sound of my own voice, I enjoy these opportunities to pontificate. One piece of advice I routinely give is that good engineers write well, and developing this skill will pay itself back with copious dividends.
However, that shouldn’t be read to mean that quantity trumps quality. Far from it, keeping things brief is usually more difficult than not (I know I’m bad at rambling, kinda like I am now). Which is why I found this little article on the value of the humble readme such valuable advice.
The other day I published a blockchain solution on Github, and while I’m pretty proud of the code, the readme is in bad shape (as of today at least). For my next project (a refactoring of the core of this solution into a reusable CDK construct) I think I’m going to write the readme first, as the above article suggests. We’ll see how it goes!