Prototype wrapup #41

Last time I did a prototype wrapup it was mainly home automation stuff. Since then I've fallen out of prototypes habit a bit but, especially with my recent integration push, I'm starting to pick up on them a little and use them for bigger projects.


I've had a little Arduino-on-a-breadboard kit for a while, but I never actually set it up properly. I thought it would let me program the bootloader (ie that it would work as an ISP), but actually it just connected to the serial pins by default. However, by using the broken out FT232 pins in bitbang mode and a few jumper wires it was possible to do it. Even though the functionality was all there it took a totally unreasonable amount of time to figure out how to do it, so I thought I'd capture my newfound knowledge in a shell script for posterity.


I'm working on an interesting project for Prismatik Labs that involved some Javascript AST mangling, so I thought I'd try to get comfortable with the Typescript API. It was actually pretty easy once I figured it out, but a lot of it is undocumented, so this is a little demo transformer that adds comments around function calls and function definitions.


This was a bit of a tale of woe. I was setting up user groups on a Linux machine and running into that annoying problem where you add yourself to a new group, but for it to take effect you have to quit and log back in. I carefully put together the Linux syscall magic necessary to load the group list and update the current groups, before realising that what I was trying to do was fundamentally impossible under Linux's security model (a process can only relinquish privileges, not gain them, and an extra group counts as gaining privileges). Still, here's some code that would work if it was somehow injected into your shell and your shell was running as root anyway (or had CAP_SETGID, which is pretty close).


On the other hand, this worked great. I'm doing some new brain things and I needed to convert the raw data format used by my code to something that research-grade tools could understand. So I wrote the unimaginatively named txt2edf to do it. I tested it out using a BDF file and BrainVision Analyzer and, although random markers showed up for no reason, the data itself seemed to import cleanly.

Future forgiveness

I've been thinking a little about forgiveness and its curious intersection with the present. Although I'm a profound believer in going easy on yourself and forgiving your own mistakes, I think that can sometimes go badly wrong when it turns into forgiving yourself in advance.

The whole point of forgiveness is to recognise that, well, it's in the past, there's nothing you can do about it now. Trying to figure out who should have done better or feeling bad about decisions that are already past is a waste of time and effort that could go into improving the future. There are plenty of mistakes yet to make, and those you can actually influence.

But for some reason it seems very easy to mix up forgiving yourself for past mistakes with forgiving yourself in advance for future ones. "Well, if I don't do the right thing here, it's understandable. I'm only human after all." "I want to be productive, but I've had a tough day and nobody would blame me for just putting my feet up instead."

These are things it only really makes sense to say in retrospect. It's fine to look back and forgive a mistake, but if you're looking forward to forgiving a mistake that's entirely different. The crucial "nothing I can do about it now" isn't there. It's not recognising the futility of trying to change the past, it's creating futility about the future. It's an excuse not to try. And if you're forgiving yourself for a decision while you're making it, that means your forgiveness forms part of the calculation. You're not forgiving yourself, you're figuring out what you can get away with.

That said, the best thing to do with a future mistake is actually the same as the best thing to do with a past mistake: learn from it. The difference is that with a future mistake, if you learn from it quickly enough, you don't need to make it at all.

Doing nothing

I've written before about the perils of leisure-like activities, those things that kind of seem like fun but really aren't that fun. Of course, most of us recognise that social news sites and other timewasting dopamine farms aren't great ways to spend your time, but we do it anyway. So why is this and how do we fix it?

Of course, entertainment as analgesia is probably familiar to anyone who, faced with an stray unpleasant memory, has found themselves typing "facebo-" into their web browser before they even realise what they're doing. But I think there's a more general principle that you can get from a two-axis analysis: timewasting is not very positive, but it's also not very negative. It's a reliable feeling of just enough reward to be worth it.

That might not seem particularly great, but "not very negative" can sometimes be quite a compelling proposition. If you're stressed, tired, or upset, you know you can quite quickly lose yourself in something that's reliably neutral. Neutral beats negative any day. Unfortunately, that easy escape from negativity can stop you from addressing its source. Worse still, sometimes important stuff is uncomfortable, and discomfort doesn't stack up well against neutrality.

But although the neutrality gets you in the door, I ultimately think it's timewasting's small, safe positivity that makes it really dangerous. Why take a risk on an uncertain positive outcome when you have a certain one right here, right in front of you, just a click away? To do something else, you don't just have to accept the negatives of the thing you could have, you also have to give up the positive thing you have already. That's a brutal combination.

Unfortunately, the time when you most need the awareness to avoid timewasting is the time you're least likely to have it. Everyone gets tired sometimes, or needs a break from thinking. Escapism can be healty when it gives you the distance to deal with something better. And who doesn't occasionally feel that just doing nothing might be the most attractive idea in the world right now?

I think there is an answer to be found in recognising that the "not negative" and "slightly positive" aspects of timewasting are separable. You can have not negative without the seductive safety of slightly positive. You can have a break without putting anything fun in that break to sweeten the deal, which robs the break of its compulsivity. Then the break only sticks around for long enough to you to feel the pull of something positive again.

In other words, perhaps the solution to doing nothing is, in fact, to do nothing. Actually nothing. Not staring at a screen, chatting to a friend or playing a game. Just embrace the lack of anything and see how it feels. At first, probably, relieving. Then, hopefully, boring. It's dangerous for nothing to be interesting.


I've been thinking a little about the various things I like to make and do. Broadly speaking, these fall into the categories of ideas, prototypes, small projects, big projects, and writing. Somewhere in there is commercial work as well, but, as I noted during honesty month, it can be difficult to find a good balance between these things. I often end up feeling like I'm being pulled in different directions that I have to choose between. This is mostly what led to backing off on writing at the end of last year.

Having now had some time to consider it, I think that the solution lies not in balance but in integration. Rather than finding a compromise between different directions, it makes more sense to align them towards the same direction or, if necessary, abandon a direction that is unalignable. I'm only splitting my time between ideas, prototypes, writing and small projects if the different parts have nothing to do with each other. On the other hand, if the parts are all connected, I'm really just spending my time on the same thing but in different ways.

That means if I'm working on a large project, I can split it up into small projects, and further split small projects into prototypes and so on. Ideas can turn into prototypes that turn into new projects, and I can develop new ideas based on the projects I'm currently working on. And, all the while, writing can act as a kind of informational outlet for the various parts of this process, like print statements scattered throughout a codebase.

One particular thing I think is powerful about this idea is it makes my commercial work situation much clearer. My ideal commercial project, then, is something that also integrates with my other work. So work I can write about, prototype, come up with ideas for and so on. An ideal situation is if the things I'm doing anyway can be commercialised, but going the other way and making a commercial need fit with my existing work is also a fine way to integrate, and probably more likely to work in the short term.

Conventional Wisdom 4: Better late than never

I have a truly prodigious number of unfinished projects, unpublished drafts, and unanswered emails. At a certain point, these things seem to hit a kind of procrastination event horizon where I stop even pretending to work on them. The problem is, they never really go away. Still somewhere in the back of my head I'm thinking "maybe I'll get around to that someday". This month, I'm going to go hunting for some of these dangling threads and attempt to either do something useful with them or cut them loose for good.

To make it more concrete, I have four half-written posts that I started over a year ago and never finished, so I'll finish those. I also have Conventional Wisdom 3 and some related ideas to write up (oops). I'm also going to aim to finish off, or at least push out the door, four currently limbo-ed projects, about one per week. Finally, I'm going to dig through my old emails because I know there's some unanswered stuff in there from years back that I wanted to answer at the time. If anything interesting comes of that I'll write it up.

This seems like a lot, but I'm hoping it will be easier than it sounds because I've already done most of the work. I'm not sure what to expect exactly from this, but I'm hoping that having those old projects put to bed will impart a sense of relief, or at least responsibility. Maybe I will even find that some things I had written off were actually worth coming back to.

Oh, and you may have noticed this is Conventional Wisdom 4 despite being in the 5th month. I originally intended to do it in April, but, uh, that didn't work out. Oh well, better late than never!