Why I care about numbers

If you have worked with me, you know that I am not obsessed, but at least very, very interested in numerical measurements of performance. I have even been called, occasionally, a “math guy”.

That is a really weird place for me to have ended up, because I have to use a calculator every time a I leave a tip.

In college, I was a classics major. In particular, I concentrated on classical philology, the study of historical language.

ὣς εἰπὼν ὑπ᾽ ὄχεσφι τιτύσκετο χαλκόποδ᾽ ἵππω
ὠκυπέτα χρυσέῃσιν ἐθείρῃσιν κομόωντε

And having spoken, he harnessed to his chariot his horses, bronze-footed,
swift of flight, with long, golden manes
— Homer, Iliad, 8.41

Specific areas that interested me include etymology (the origins of words, in my case especially across languages) and morphology (how individual word-pieces combine to make up meanings).

I think I was interested in these areas because words have always seemed like toys to me, by which I mean “objects of play”, not “things that are insignificant.” In having that attitude, and in developing it through my studies in college and afterward, I also developed a much sharper sense of how empty words are, in a very specific way: we interpret them as having great meaning, but in fact any particular word is an almost random combination of sounds. What about the word “ocean” has to do with an ocean? There’s a big difference between what is signified and the signifier.

Of course words have the power to inspire and to change the world. As I’ve mentioned on this blog before, we are our own novels. And of course,

In the beginning was the Word, and the Word was with God, and the Word was God.
— John 1:1

Or alternatively,

And God said, “Let there be light,” and there was light.
— Genesis 1:3

Words are powerful. But for me there’s a big missing piece without something to prove them.

In mentioning that, I think a lot about my previous employment at what was then a startup agricultural nonprofit. A deeply admirable organization, with not great marketing, but an intense focus on impact and on numbers.

And in this case, those numbers mean the difference between life and death for the African farmers One Acre Fund serves. Could their marketing be better and should One Acre Fund be a household name? No doubt. But their actual impact is enormous. One of the things for which I most admire that organization is their attitude that if the impact wasn’t happening, they were failing, and must improve.

Words are incredibly important for creating a narrative and giving meaning to things we all experience. That’s important to me, but it’s not enough. Numbers provide you a more concrete measurement of what you’ve accomplished or what you’ve changed in the world. You really need both. The numbers give us proof; the words give us meaning.

Tim, a simple Arduino-based timer

The video demo to the left shows what happens as Tim counts down the final minute. It blinks faster, then flashes to indicate the timer is done, plays a tune, and resets.

Well, I finally finished my first Arduino project. It’s called Tim, and it’s a simple minute timer with a user-selectable number of minutes (up to 10). The goal was to create a simple project involving an LED bar graph (because I think they’re cool), music, and a battery that would allow the resulting electronics to be self-contained.


The breadboard setup. You may wonder why there are Hebrew letters on my work surface; that’s because it’s a Hebrew alphabet placemat. I figured that’d be a nice way to very slowly learn something else while I work.

The first step was prototyping all the electronics, which I did on a standard solderless breadboard. With a fairly simple circuit like this, it’s not too hard to lay everything out and get it working for the most part before writing the code.

The code and the chip

Writing the code, however, was hard. I’ve never written a substantial program in C before, though fortunately working with Arduino means that I didn’t have to get very deep into actually understanding things like pointers – I could sort of treat C as a scripting language. Here’s the code on GitHub if you’re interested.

However, I still had to think of a reasonable way to control ten LEDs and write a bunch of macros for things like flashing them all at once. I also had to figure out how to play music on a piezo buzzer, which there are libraries out there for, thankfully, e.g. the Arduino Tone library. The project incorporates a button as well, which occasionally was very frustrating to deal with because weak wire connections would cause the button to trigger without being touched.

I used the ATMega328 that ships with the Arduino Uno instead of switching it out for a lower-power or smaller chip. I did actually also spend a couple days trying to get a replacement chip to work, in particular the ATTiny84 (which is smaller and lower-power without having so few pins that I’d need to use a shift register).

But I couldn’t get the Tone library to work with it. I also had some problems with compatibility with the Arduino programming environment, which I’m sure more advanced users wouldn’t have encountered, but which didn’t seem possible for me to solve. It’s also a lot more convenient to upload code to the ATMega328 since it can just be dropped into the Arduino, programmed, and then removed and installed on the breadboard or PCB. The ATMega328 is frankly overpowered for this application, and eventually I’d like to learn to use the right microprocessor for a project instead of the convenient one.

Interesting UX problems

This project posed some very interesting UX problems, which I posted about on Hacker News, and on this blog. I’m so used to working in text and graphics as a medium of expression. What happens when I only have an LED, with two states, to work with? Sure in this case I have ten LEDs, but that doesn’t compare to the limitless pages of text, video, sound or graphics that otherwise have available.

I ultimately decided that (a) all the bars should blink simultaneously while waiting for input, (b) that each bar should represent one minute during the selection and countdown process, and (c) the bar representing the current minute in a countdown should blink faster as the minute ends. Even with a few LEDs, there were lots of alternative indications I could have used. For example, I could have used a scanning motion, fading in and fading out, or even Morse Code to represent various states. The states I chose for the bar graph also were strangely evocative; both my wife and I felt increasingly anxious as the bars blinked faster toward the end of a minute.

These discoveries led me to a fascinating paper called “Unlocking the Expressivity of Point Lights” which deals with just this issue. In the paper, 24 different single-LED light patterns are identified, such as twinkling, fast pulsing, beacon, and heartbeat behaviors, together with 12 different behaviors such as a low battery state, waiting for user input, or normal operation. The authors then surveyed users to figure out which light pattern was most effective at conveying which state. For notification, for example, it’s two quick blinks (the beacon pattern). For some other states, the data was less conclusive; the best match for “running out of battery” was a flickering candle pattern.

Putting it all together


The back of the circuit board. I’ve used solder bridges a lot, and I also used wire that wasn’t always properly insulated. Next time, I’ll consider using wire of a thinner gauge as well.


The front of the board. I left the ATMega pinout diagram in place as I needed it to get everything placed correctly.


Once the code was all written and tested with a breadboard version of the circuit, it was time to assemble everything onto its own circuit board.

What I really wanted to do is make a custom PCB, but this turned out to be really difficult for me. Even programs like Fritzing were not intuitive. So, I ended up buying some cheap protoboard and soldering the connections together myself.

It kind of looks OK for a first try, and it works, which I think is the most important thing. But there are some big improvements that can be made without significantly increasing the cost of building these.

  • Using smaller-gauge wire, which is easier to work with
  • Using tools to bend and place the wire instead of bending and placing by hand
  • I’m considering buying uninsulated wire in particular, and using electrical or other tape to shield it from wires that need to cross the same space.
  • I also bought a much better soldering iron which seems to be quicker to heat up and therefore less time-consuming to work with. It should also reduce the amount of excess solder I have to use.

Lastly, the timer as currently built has an interesting property, which is that the buzzer only works when the battery is almost completely fresh. The rest of the timer will work just fine after the initial use, but the buzzer just clicks instead of playing a tune.

When I understand better how electronics work, I bet I’ll be able to troubleshoot this more effectively (my guess is that a brand-new battery is just barely able to power all the components, and once the voltage starts dropping, that ability goes away). I’ll probably replace the coin cell battery with a AAA or two. I’d also like to make a case for this timer as well, which I’ll do after my next project is complete.

Some cool new technologies

Introducing Book: a delightful video hosted at http://www.youtube.com/watch?v=YhcPX1wVp38

Introducing Book: a delightful video hosted at http://www.youtube.com/watch?v=YhcPX1wVp38

I go back and forth on buying physical vs. electronic books. Recently, I read the Lord of the Rings trilogy on my Kindle, but then just a few days after finishing I bought about half a dozen physical books for my next reads. Physical books have these advantages which I just haven’t been able to get in digital:

  • Aesthetics. Possibly the main reason. If you’re reading something consequential, it’s nice to have something heavy in your hand with a well-thought out printed cover, heavy paper, and nice typesetting. And something that’s pretty enough to be worth putting on a shelf when you’re finished.
  • Pages. It’s nice to be able to quickly flip back and forth to a figure or previous idea. You can also tell how close you are to the end as the thickness of the pages under your hands changes.
  • Cost. Yes, I realize many classic books on Kindle are actually available for free. Still, many books can be had incredibly cheaply, and you can buy used copies of real books as opposed to electronic editions. They also require no expensive electronic devices or access to electricity or communications networks.
  • Surveillance and tracking. I never imagined I would care about this, but physical books have the nice advantage of being surveillance- and (usually) ad-free, as they don’t require that you carry a device containing antennas or means of data storage. Though I suppose your purchase history can be tracked.

It occurred to me while I was buying these books that at one point, books were a big-deal new technology. Actually, the modern book is the result of combining many, many different big-deal new technologies, including writing, typesetting, printing, binding, paper production, etc. It’s easy to forget this.

I then realized that there are lots of other different big-deal technologies that we don’t think about. Like the bike I just bought, which also has lots of advantages over more recently-invented forms of transportation:

  • Portability. Bikes let you move fast, but they’re relatively easy to store. Compare cars, which let you move much, much faster but are harder to store. They can also go lots of places that cars can’t go – it’s easy to move past a traffic jam on a bike.
  • Infrastructure. For cars to work, they require a vast infrastructure of factories, repair shops, retailers of secondary supplies, and roads, not to mention the colossal investments made in petroleum extraction, refinement and distribution (electric cars, of course, need to be plugged in to the grid instead of being fueled up).
  • Sustainability. Bikes are better for your health, and obviously also require far fewer natural resources to run and maintain.

And the modern bike, too, is a combination of lots of other big-deal technologies – metalworking / woodworking, rubber molding, and classical physics, for example.

Because they’re combinations of lots of different development over time, books and bikes have the nice ability to degrade gracefully in the absence of these technologies. A book can exist without a binding or a cover, or without typesetting or mechnical printing. A bike can have a wooden frame, or even a cardboard frame or a 3D printed frame.

These technologies are well-understood and easy to reason about, and so they’re easily extensible; you can add a book-light to a book or substitute a different type of paper or produce different types of books for different applications. Anybody can make these extensions, specialist knowledge isn’t always required. This “old new” technology is also intrinsically much more maker-friendly.

And there’s still huge money to be made in continuing to extend these technologies, which is maybe what we’re actually seeing with the electronic book (an extension rather than a replacement), and what we’re seeing much more obviously with new devices that are coming out to make bikes easier and more fun to ride, and even more practical.

Hacking is the skill of…?

The concept of “hacking” is interesting; it’s usually thought of as finding some kind of novel solution or shortcut to solving a problem. I think there’s a deeper meaning, though.

Any time you write code (and arguably, when you solve any problem at all), you make a model. A model is a way of representing reality, and when you represent something, you necessarily simplify it. In fact, if you’re a good problem-solver, you simplify so much that you consider only those dimensions that matter for the solution.

Take an algebraic equation as an example. x + 3 = 7 answers the question “Jane has 7 apples. John has 3 fewer apples than Jane. How many apples does John have?”. And that’s all it does. It doesn’t consider any facts that are unrelated to the solution, such as John’s last name or how Jane got more apples than he did.

Or, if I want a JS function that squares a number, I could end up with:

function square(x)
{return x*x;}
square(2); //4

This function doesn’t consider why I am squaring a number, or what I am doing with it. There’s no context other than that I want the input multiplied by itself.

As another example, let’s say I’m writing an application that needs to manipulate information about books. I might model a book this way:

function Book(author, pages) {
this.author = author;
this.pages = pages;
this.difficulty = (pages/100) + (author == 'James Joyce' ? 100 : 0);

theCastle = new Book('Kafka',1000);
//Book {author: "Kafka", pages: 1000, difficulty: 10}

ulysses = new Book('James Joyce', 1000);
//Book {author: "James Joyce", pages: 1000, difficulty: 110}

This model of a Book has no context. The name of the function and its properties could be anything:

function a(b, c) {
this.foo = b;
this.bar = c;
this.baz = (c / 100) + (b == 'James Joyce' ? 100 : 0);

It also doesn’t take into account, or generate, information about the authors’ lives, the jacket art, the main characters’ names, etc. It’s just whatever is in the function. Assume for a moment that I have a good product manager and we know that author, pages, and difficulty are all we need. In that case this would be a waste of time (and arguably a less effective solution):

function Book(author, pages, description, catalogNumber, referencedBy) 
this.author = author;
this.pages = pages;
this.difficulty = (pages / 100) + (author == 'James Joyce' ? 100 : 0);
this.description = description;
this.referencedBy = $.getJSON('booksearch/' + catalogNumber);

//plus server-side code to look up this book
//then search the catalog for references to it

You can keep elaborating the function until you get within an arbitrarily small distance of creating an actual book. You can add data about the year of publication, the fonts, and page sizes. You can take atomic measurements of printing materials, page wear, and ink. You can keep going until your model is a perfect representation of the book itself. (At which point it would cease to be a model, of course.)

I think that a hack might be the discovery and exploitation of the compromises that are made in this simplifying process.

This incredible playthrough of Ocarina of Time is a great example. The speedrunner playing the game finishes it in about a half an hour whereas the usual playthrough time is probably on the order of days. The link skips ahead to the major exploitation of the game’s code, and is followed by the explanation, which is long. But basically, the hack involves taking advantage of simplifications that the designers of the N64 and Ocarina of Time made in the way the world of the game is built and represented in system memory.

As one partial example, locations that are not in view are moved out of system memory, and when this happens to a warp location, it’s possible to change the timing of the warp animation to coincide with other events that then cause the warp destination to change.

This is an easy-to-understand exploitation but isn’t so different from hacking computer systems; it’s about in some way breaking the model used to build a system.

Under this definition, social engineering could be a type of hacking, if it’s used to exploit simplifications that people make in the way they think. Posing as an authority figure over the phone to get someone’s personal information, for example, is a way of taking advantage of the fact that most people assume those who claim authority are legitimate. The filibuster is arguably a hack, because it takes advantage of simplified (or incorrect) assumptions about when it would be used.

Trompe l’oeil painting and forced perspective photography would be hacking under this definition as well. Our visual systems make lots of simplifications in the way we perceive the world, and many assumptions about depth cues in particular. This allows a skilled person to create a fully 2-dimensional representation that mimics all of these cues and therefore looks 3-dimensional.

This is a meaning of “hacking” that I think is somewhat different from the usual one, so I’ll keep thinking about it. Still, it suggests that the skill of hacking is a very valuable one, if it means you are an expert at understanding models and their limitations, and also how to use those limitations to your advantage.

Why is major marketing collateral still published as PDFs?

Most enterprise software companies publish assets such as ebooks and whitepapers exclusively as PDFs. I’m not sure why. Publishing this way has at least a few problems:

  1. Analytics. When someone reads your content in PDF, you lose the ability to capture time on page and bounce rate, and also you can’t use heatmapping and scrollmapping tools to tell what parts of your content visitors are spending their time on. It’s true that this data is ambiguous (are they spending time on this section because it’s interesting or because it’s difficult to understand?) but I’d rather have it than not. Also, heatmapping tables of contents in particular can be a good guide as to what content people are interested in.
  2. Workflow. We’re still experimenting with InCopy and other solutions, but generally PDFs are much harder for content creators to update than HTML files. That means that graphic designers or other format experts have to get involved – which quickly becomes frustrating during the final rounds of small edits. Tracking revisions for HTML files is also much easier than tracking revisions for PDFs.
  3. Search. I will admit that I’m not basing this on anything, but it seems like PDFs are less powerful for SEO than HTML pages. It certainly makes it harder to get new organic traffic to take further actions on your site based on what they’ve found.
  4. Conversions. Of course, in many cases an asset download is itself the conversion. But it’d be nice to have the flexibility to send visitors elsewhere for more information or for further actions.
  5. Interactivity. There are lots of other cases where it’d be nice to add interactions, embed video, etc. I, at least, have never done this in PDF and wouldn’t know where to start; but I and lots of other people do this every day in web pages.

HTML solves all these problems. It also lacks the following advantages of PDFs:

  1. The paper document experience. This is the primary advantage, I think, of continuing to publish in PDF – it mimics the experience of looking at your own pace through complex marketing or informational material. Images, text, and other components are part of a single, unified file that can be emailed by a salesperson, sent to an e-reader, opened on the subway, etc. You don’t have to worry about internet connectivity or other loading issues making it impossible to get the information you need.
  2. Printing. Usually, you’ll want to have printed copies of an asset that can be handed out at events. It’s hard to get something truly high-quality by converting from HTML to PDF. Also, HTML colors are specified in RGB, whereas for printable assets you’ll usually want to specify colors in CMYK or some other system suitable for printing.
  3. Compatibility. Using PDF ensures that a document will look exactly the same no matter which platform you’re viewing it on. But I’ve noticed that I’m spending less and less of my time troubleshooting cross-browser issues these days, and for most marketing content, is pixel-perfection really necessary?

I think the best way to publish major marketing assets is probably in HTML by default, with a link to a downloadable PDF version.

Optionally, you might set up a landing page with an HTML short summary or selected pieces, and then have a call to action to click through to the full content from there. This would be a good idea for content that is behind a registration wall – but it also might be smart for content that is very long and would benefit from an abstract or overview page. (A registration page follows this landing page if appropriate.)

Eventually, if there is some agreed-upon way to add CMYK or other printer-friendly color metadata to HTML, something like jsPDF or another HTML to PDF converter would be the ideal solution. All the advantages of both format types without extra work to convert HTML to PDF.