Let's say I'm ordering burritos for my two friends while they quar up in Jersey City, and want to calculate the total price of my order: It's a little confusing to follow the flow of data in a spreadsheet when it's written like that, so I hope you don't mind this equivalent diagram that represents it as a graph: We're rounding the cost of an El...
Some of you may know I quit my job to work on a little text editor for fun. Unfortunately, in the process of doing that, I got distracted by the challenging problem of self-adjusting computation. And unfortunately, to solve that problem in a performant way, you need really fast graphs, a notorious problem in Rust. And to get really fast graphs,...
In 2018, I skipped my own college graduation. Two days before, at dawn, I instead flew to the Bay Area to spend that weekend attending a retreat for young people in the technology industry. It was a three day long extravaganza, half conference, half party, funded by charging venture capitalists for the right to come in and chat about artificial...
It's September 10, 2019. The Steve Jobs Theater in Cupertino is packed to the brim. The crowd hushes as the lights dim, leaving only the glow of several hundred MacBooks Pro. A glossy animation titled Wonderful tools starts to play, showing off Apple products new and old. Tim Cook runs up on stage to raucous applause. Apparently nobody in...
In 2006, Robert Andersen sent the first tweet that @mentioned another user, and an internet convention was born. In a world without smartphones, Twitter's primary interface was SMS. There were no threads, no @username autocomplete. If a user said something and you wanted to reply, your only option was to compose a new text to 40404, manually...
Alexis Beingessner's Text Rendering Hates You, published exactly a month ago today, hits very close to my heart. Back in 2017, I was building a rich text editor in the browser. Unsatisfied with existing libraries that used ContentEditable, I thought to myself "hey, I'll just reimplement text selection myself! How difficult could it possibly be?"...
canvas { width: 100vw; height: 100vh; display: block; } attribute vec2 a_position; void main() { gl_Position = vec4(a_position, 0.5, 1.); } precision highp float; uniform sampler2D u_texture; uniform float u_time; uniform vec2 u_screenres; void main() { vec2 unmirroredCoords = gl_FragCoord.xy - (u_screenres / 2.0); float...
"Come back to Recurse Center!" they told me. "You'll get to write all sorts of cool code!" they said. Well I just spent two weeks writing exactly zero lines of code. It's a great feeling, seeing everyone around you create beautiful 3D graphical masterpieces or fully complete web applications while you spend twelve hours a day struggling to read...
Recurse Center has this fantastic HP7440A plotter from the eighties. Using only a few simple commands — select pen, pen up, pen down, and move to position — we can draw very precise shapes with a pen. Yesterday, I wrote a utility in Rust that converts a font file and some text into plotter instructions. Once I had that code linted, reviewed, and...
Sous-vide cooking is a lot of fun. Food is vacuum sealed and cooked for many hours in a water bath at a specific temperature, usually something like 140°F, far below boiling. Meat becomes really juicy, eggs become creamy, and you can do all sorts of fun precision cooking. However, cookers on Amazon cost $100–200, which if you ask me, is a scam....
Most quadcopters are powered by brushless motors. These have major advantages over brushed motors: less friction, less noise, and no brushes that need replacement. However, these advantages come at a cost — while brushed motors can be powered by a simple direct current, brushless motors require some sort of complicated, changing AC current. No...
This November is the one year anniversary of Slate, the small open source project I’ve been maintaining. It started off as a sort of toy project from my internship at TripIt, but now that real companies use it, I feel an obligation to keep it mostly bug-free. I hadn’t done much open source before, so this year has been a great learning experience...
Now that Hacker School is over, I finally have some spare time to blog about the projects I built. This is one I built about 2/3rds of the way into the batch. I've been writing various small projects in Rust in order to learn the language. My most recent project is a shell! Since obviously it'd be a ton of work to make an actually decent shell, I...
In my previous post, I explained how we used SHA-256 to cryptographically sign HTTP requests between an Arduino called DoorDuino and a Ruby app known as Doorbot. However, that system was vulnerable to a hash length extension attack. To understand how extension attacks work, let's first discuss how SHA-256 hashes strings. SHA-256 starts by...
When J.J. and I designed the Hacker School door system, one of our problems was keeping the system secure. There are two parts of the door system, DoorDuino, which is an Arduino that unlocks the door, and Doorbot, which is a Sinatra server that registers users and receives text messages. These two pieces talk to each other over HTTP. When it...
Today, I implemented the SHA-256 hashing algorithm from scratch in Rust, with Matthew Avant. "Why in the lord's name would you do this?" is a question you probably would ask. Hahaha, you're so funny! Let's talk about how SHA-256 works. The Big Picture SHA-256 starts by creating an array of 8 numbers, which start out as predefined constants. Let's...
One of the many perks of Hacker School is alumni Thursdays, where alumni can come in to hack on open source projects and pair program with others. However, there is a problem — Hacker School doesn't have enough key fobs to give to every alumnus. Instead, they ring the doorbell, and someone sits by the phone to press the "unlock" button whenever...
One of my current projects at Hacker School is to (attempt) to solve the knapsack problem using 64-bit assembly. I've never done anything in assembly before — before I started this project, I didn't even know what a register was. It's been an educational, if frustrating project. Today's frustrations have revolved around macho64 and debugging. As...
I've been learning a little assembly with some other Hacker Schoolers. It's fun, but I spent nearly an hour yesterday trying to find a modern online guide for running x86-64 assembly on OS X, and couldn't really find anything that didn't involve complicated uses of gcc. Frankly, without the ever-wise advice of davidad, I probably wouldn't have...