Julia Evans

Harm reduction for developers

Harm reduction is an idea in public health that says basically: people are going to do risky activities (intravenous drug use, sex, drinking alcohol, maybe abusing alcohol), and instead of saying “just say no to drugs!”, we can choose to help make those activities less risky.

Some examples of measures:

  • needle exchanges and safe injection sites
  • designated drivers and free taxis home
  • safer sex classes

I don’t want to trivialize any of these issues, but I think the idea that switching out YOU’RE WRONG TO DO THAT JUST DON’T DO THAT for doing something to help people be safer is super powerful and useful, and I see it in discussions of software development all the time.

Fun with machine learning: does your model actually work?

I’m writing a talk for PyData NYC right now, and it’s the first talk I’ve ever written about what I do at work.

I’ve seen a lot of “training a model with scikit-learn for beginners” talks. They are not the talk I’m going to give. If you’ve never done any machine learning it’s fun to realize that there are tools that you can use to start training models really easily. I made a tiny example of generating some fake data and training a simple model that you can look at.

But honestly how to use scikit-learn is not something I struggle with, and I wanted to talk about something harder.

I want to talk about what happens after you train a model.

How well does it work?

If you’re building a model to predict something, the first question anyone’s going to ask you is:

“So, how well does it work?”

I often feel like the only thing I’ve ever learned about machine learning is how important it is to be able to answer this question, and how hard it is. If you read Cathy O’Neil’s blog posts about why models to measure teachers’ teaching are flawed, you see this everywhere:

we should never trust a so-called “objective mathematical model” when we can’t even decide on a definition of success

If it were a good model, we’d presumably be seeing a comparison of current VAM scores and current other measures of teacher success and how they agree. But we aren’t seeing anything like that.

If your model is actually doing something important (deciding whether teachers should lose their jobs, or how risky a stock portfolio is, or what the weather will be tomorrow), you have to measure if it’s working.

What women in technology really think (150 of them, at least)


I’ve read tons of articles about or by women who work as developers. I read a thing yesterday and it was the best thing I’ve ever read. Yesterday I found a link to a survey on Twitter asking for the experiences of women who work in technology, and did the survey. There’s question at the end that asks

Any other comments you’d like to make?

I didn’t think much of it at the time – I said something (that I’ve had an incredibly good experience, but that it makes me very angry that other people have bad experiences). But then I looked at everyone else’s responses. It’s an amazing example of a wide range of women’s opinions and experiences, and I think you should read it. I’ve formatted all of the responses to that question a little better, or you can see the full survey results.

Working remote, 8 months in (seeing humans is important!)

in remote

I wrote up what it was like to be working remote 3 months after I started. 5 months later, I have some new thoughts!

The worst thing about working remotely so far has just been feeling generally alienated. I talked a litle about motivation in Don’t feel guilty about not contributing to open source, where I mentioned a theory that motivation is made up of competence (I know how to do this!), autonomy (I can make my own decisions!), and relatedness (I know why I’m doing this!).

It turns out that a) this is called self-determination theory, and b) I totally misunderstood what “relatedness” meant. It turns out that relatedness is actually about feeling connected to the people about you (“the universal want to interact, be connected to, and experience caring for others”). It’s the opposite of feeling alienated :)

I didn’t visit the office for 4 months and that was a mistake! Turns out that if I don’t see a group of people for way too long then it’s easy to feel like nobody cares about me and everything I do is terrible, and it has all kinds of strange negative unforeseen consequences. Visiting SF for a while made everything approximately 100x better. In gifs (of course) seeing people can be the difference between:


Right now I feel a lot more like gif #2, which is pretty great.

How to set up a blog in 5 minutes

Some people at Hacker School were asking for advice / directions for how to set up a blog. So here are some directions for a simple possible way!

There are lots of ways to set up a blog. This way will let you write posts with Markdown, version them with Git, publish them with git push origin gh-pages, and, most importantly, think for exactly 0 seconds about what your site should look like. You’ll need a working Ruby environment which is the hardest part. I use rbenv to manage my Ruby. I have spent months being confused about how to make Ruby work, so If you also need to set up Ruby it will take more than 5 minutes and this will be a total lie.

But! If you do, there is no excuse for you to not have a blog within 5 minutes (or at least not more than an hour). It took me 40 minutes but that was because I was also writing this blog post.

I used to worry a lot about what my website looked like, and then I realized if I wrote interesting blog posts basically nobody cared!

How does SQLite work? Part 2: btrees! (or: disk seeks are slow don’t do them!)

in databases

Welcome back to fun with databases! In Part 1 of this series, we learned that:

  • SQLite databases are organized into fixed-size pages. I made an example database which had 1k pages.
  • The pages are all part of a kind of tree called a btree.
  • There are two kinds of pages: interior pages and leaf pages. Data is only stored in leaf pages.

I mentioned last time that I put in some print statements to tell me every time I read a page, like this:

sqlite> select * from fun where id = 10;
Read a btree page, page number 4122
Read a btree page, page number 900
Read a btree page, page number 5

Let’s understand a little bit more about how these btrees work! First, some theory.

Normally when I think about tracking tree accesses, I think about it in terms of “how many times you need to jump to a new node”. So in a binary tree with depth 10, you might need to jump up to 10 times.

How does SQLite work? Part 1: pages!

in databases

This evening the fantastic Kamal and I sat down to learn a little more about databases than we did before.

I wanted to hack on SQLite, because I’ve used it before, it requires no configuration or separate server process, I’d been told that its source code is well-written and approachable, and all the data is stored in one file. Perfect!

Strange Loop 2014

in conferences

I spent some of last week at Strange Loop. I met lots of new curious, friendly, wonderful people, gave a talk that people really liked, played board games with friends, and generally had a great time.

It was also kind of a big deal for me personally! A year and a half ago I gave my first lightning talk at a meetup, and was super scared. I’ve heard a lot about how great of a conference Strange Loop was, and I really wouldn’t have anticipated then that

  • I’d get to go
  • they’d accept a talk I submitted (“You can be a kernel hacker!”)
  • the room would be packed
  • people would say things like “that was my favorite talk of the conference”

I always imagine cool developer conferences like Strange Loop as being full of wizard developers who know everything about programming. I was worried that my talk would be too entry-level (I explain what a kernel is / what a system call is from the ground up, for instance).

It turned out tons of people there didn’t know a lot about systems programming / how kernels work, and my choice to make the talk accessible made a lot of people happy. So far I’ve given a bunch of talks and I’ve never regretted trying to make it easy to follow for as many people as possible.

You can be a kernel hacker!

in kernel

This blog post is adapted from a talk I gave at Strange Loop 2014 with the same title. Watch the video!

When I started Hacker School, I wanted to learn how the Linux kernel works. I’d been using Linux for ten years, but I still didn’t understand very well what my kernel did. While there, I found out that:

  • the Linux kernel source code isn’t all totally impossible to understand
  • kernel programming is not just for wizards, it can also be for me!
  • systems programming is REALLY INTERESTING
  • I could write toy kernel modules, for fun!
  • and, most surprisingly of all, all of this stuff was useful.

I hadn’t been doing low level programming at all – I’d written a little bit of C in university, and otherwise had been doing web development and machine learning. But it turned out that my newfound operating systems knowledge helped me solve regular programming tasks more easily.

I also now feel like if I were to be put on Survivor: fix a bug in my kernel’s USB driver, I’d stand a chance of not being immediately kicked off the island.