[EDIT]: I gave a talk on this at Covalence Conf 2020, which you can watch here if you’d like!

Since the very earliest versions of Electron, the remote module has been the go-to tool for communicating between the main and renderer processes. The basic premise is this: from the renderer process, you ask remote for a handle to an object in the main process. Then you can use that handle just as if it were a normal JavaScript object in the renderer process—calling methods, awaiting promises, and registering event handlers. All the IPC calls between the renderer and main process are handled for you behind the scenes. …

You might have used Chrome’s Developer Tools to profile your JavaScript to improve performance or find bottlenecks. DevTools is fantastic, but there’s a lot of potentially useful information that the performance panel doesn’t capture. Enter Chrome Tracing: a tool that’s built into Chrome (and Electron) that can collect a huge variety of detailed performance data. At Slack, we use Chrome Tracing to diagnose complex performance issues, and hopefully after reading this, you’ll be able to as well.

Chrome Tracing consists of two important parts: first, a system for collecting performance-relevant information from the browser itself; and second, a tool for inspecting and analyzing that information. You can try it out for yourself right now by opening chrome://tracing in Chrome. Go ahead and click ‘Record’, select a category (or leave the default ‘Web Developer’ option selected), do something in Chrome, then come back to the tracing tab and click ‘Stop’. …

Earlier this year, I read Drawdown, a survey of tools and techniques for addressing climate change ranked by impact. It’s an exceptionally well-researched book and you should read it, but what I want to talk about today is the part of the book that had the most impact on me personally.

The first thing that usually comes to mind when you think about solutions to climate change is renewable energy. …

Or, How The Crap Do I Make That Curve?!

Sometimes I get an idea in my head that requires a particular kind of mathematical function: say, a cosine, or a logarithm, or a polynomial. Since I don’t have much of a background in mathematics, it’s more likely that I know the shape of function I want, but not how to write it down.

Image for post
Image for post
How do I get the computer to make this curve?

If I’m lucky, some dusty corner of my mind will shake off the cobwebs that have been accumulating there since first year algebra and offer itself in service, saying something useful like “Uh… maybe try tanh?”

But today I was unlucky. I wanted something kind of like a square wave, but not as harsh. A sine wave was too smooth, and a square wave was not smooth enough. Surely there must be some mathematical incantation I can utter that will solve this problem! I had the idea that I wanted to start with a sine wave and “squash” it, so the bits between 0 and 1 were a bit closer to 1, and the bits between 0 and –1 were closer to –1. …

stop procrastinating
procrastinate more
— — — (to avoid something more important)
chip away at it
decide to do less
accept it
—— (as it is)
publish it
smile at it
write about it
be proud of it

forget it

(And some other stuff.)

A year and a half ago I started working on a mind mapping tool called Synaptograph, heavily inspired by the wonderful Exobrain, but quickly ran out of steam. This week, with joy, I picked it up again.

I keep notes of various kinds in about five different places right now. I write things on paper, I jot things down on my phone in Notes.app, I save articles I want to keep in Pinboard, I save papers and images in Dropbox, and I have more than a few NOTES.md files lying around in my code repositories. And lately, I’ve been using Synaptograph to sketch out and explore new ideas. …

The L5 society was a group in the 70's–80's that advocated for the colonization of space, in particular the Earth-Luna L5 Lagrange point. They were heavily inspired by Gerard O’Neill’s book The High Frontier, which described how technology already available at that time could be employed to build an orbital colony vessel.

Image for post
Image for post
The indisputably rad logo of the L5 society

O’Neill proposed a cylindrical colony design, with a pair of 8km×32km cylinders rotating in opposite directions at about 3rpm to approximate Earth’s gravity. The counter-rotation would cancel out the gyroscopic force, helping to keep the station properly aligned with the sun.

(Though 3rpm sounds like it would be a little sickening! Look at that painting below, and imagine the sun zipping around all three of those window sections every 20 seconds. That’s about 3 seconds from left to right of each section. I guess you’d get used to it, but I bet new arrivals would spend a few days staring intently at their feet.) …

I’ve been jamming on a little game prototype with a friend that uses a triangle grid. Figuring out how to set up the coordinate system has been a bit of a nightmare; triangles are super weird! We’ve currently got it set up so that each row of triangles shares a y coordinate, and then the x coordinates are a bit wonky depending on which y you’re at. Like this:

Image for post
Image for post
I’m calling this system “square-packed” coordinates.

This is handy for storing the map in memory, but not very nice at all for answering questions like “how far away are these two triangles from one another” or “what triangle did the player click” or even just “where do I draw this triangle”. In this coordinate system, (0,0) and (2,1) have two other triangles between them, but (1,0) and (3,1) share a common point. …

I went to the San Francisco Public Library today (which is just across the road from my house — it’s a crime I don’t visit there more often!) to see what I could find in the way of books on plate tectonics. I found Continental Drift and Plate Tectonics by William Glen, published 1975, which had some wonderful diagrams in it.

I learned that there are two broad classes of material that the Earth’s crust tends to be made from: dense basaltic rock which makes up the ocean floor and is about 10 km thick, and lighter granitic rock that makes up continental mass, and is about 25 km thick most places. All the crusty bits are floating on a sort-of-solid goop called the asthenosphere, above which the rock cools down enough to be solid and below which the rock is under so much pressure that it solidifies. …

I wrote something slow in Python (I know, surprising isn’t it), and I wanted to run lots of it in parallel so the ridiculous 36 or whatever hypercores the machine I was using would actually get used. Python couldn’t find a thread if you linked it to 4chan, so I wanted to just invoke Python a few times on different parts of my input data and combine the outputs later.

Image for post
Image for post

Enter GNU parallel, with its delightfully dorky logo. I had about a thousand inputs, and I wanted to run enough of them to fill up my CPUs without causing undue thrashing and overhead from cache evictions and paging and so on. …


Jeremy Rose

Nullius in verba.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store