Author Archives: Lorin Hochstein

Pick a random paper from Zotero

Here’s how to select a paper at random from Zotero. In Zotero, select the folder you want to select the paper from. Open up the Javascript dialog at: Tools → Developer → Run Javascript Paste in the following code This … Continue reading

Posted in Uncategorized | Leave a comment

Which lines repeat most often in a stack trace?

I was looking at the stack trace of a stack overflow exception, and it’s looong (1172 lines). I wanted to just see which lines occurred most often. Easy enough with the right incantation of sort and uniq.

Posted in Uncategorized | Leave a comment

Running Eclipse MAT on macOS

If you try to run Eclipse Memory Analyzer (MAT) out of the box on macOS, you’ll likely get an error that you need version 11 or above of Java, even if you have version 11 installed (say, with SDKMAN!). You … Continue reading

Posted in Uncategorized | 2 Comments

Pasting HTML from the macOS clipboard

I like to write decision tables in Google Sheets. If you copy to the clipboard, it copies to HTML. Alas, pbpaste doesn’t support pasting HTML, and the text representation throws out too much info. There’s a nice answer on Stack … Continue reading

Posted in Uncategorized | Leave a comment

WARNING: An illegal reflective access operation has occurred

If you’re running a newer version of the JDK (9 or greater), you might have started to see warnings that look like this: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/myname/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.11/4d8f25c5da08af46fb204fd493ec894699a3f4e8/groovy-2.5.11.jar) to method … Continue reading

Posted in Uncategorized | Leave a comment

Unescaping strings of stack traces

I often find myself copying strings of Java stack traces which have escaped tabs and newlines (\t\n). Those aren’t fun to read. Here’s a quick Python script I rigged up to grab what’s on the clipboard and format it properly. … Continue reading

Posted in Uncategorized | Leave a comment

Stripping leading timestamp from GitHub Action logs

GitHub Action logs start with timestamps. To strip them with sed:

Posted in Uncategorized | Leave a comment

Automating Slack status changes on macOS

In these days of everyone working from home, I really liked the approach to setting Slack status that Alex Hidalgo mentioned on Twitter: I wanted to be able to change status from Alfred. Turns out there’s a handy Applescript bundle … Continue reading

Posted in Uncategorized | Leave a comment

Stomping a local git branch with the remote

When somebody rebases their PR, my local copy of that branch gets out of sync: ➜ keel git:(fix-paused-events) git status On branch fix-paused-events Your branch and ‘luispollo/fix-paused-events’ have diverged, and have 8 and 16 different commits each, respectively. (use “git … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

J-Bob from the Little Prover

The Little Prover book references a companion proof assistant tool called J-Bob. I had a hard time getting it running using Racket’s Dracula package, here’s how to do it: Install Racket. Install the Dracula package for Racket. On macOS, I … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment