So you’ve graduated or are about to graduate (woo! congrats!), or maybe you’re just interested, and you’ve never had much education on money in the so-called “real world”. At least, this was my situation about 3 years ago. The following is everything I’ve learnt about money in the last 3 years, and the idea is to put you in a strong position to know whether you’re being fairly compensated wherever you end up working.

Note: Being a Brit, this post only really applies to the UK. I don’t know much about compensation or taxation in other countries.

Read on →

I’m a big fan of Quora. One of the questions I came across recently concerned how files get copied from one place to another. I wrote an answer that tried to show empirically how files get copied. I thought it would make for a nice blog post, so I’ve cleaned up the original answer and extended the parts that I waffled over to be much more concrete and correct.

Prerequisite knowledge: If you’re not sure what a system call is, this post might confuse you.

Read on →

I started playing World of Warcraft (WoW) way back in 2005, shortly after it was released in February of that year. I would have been 14 at the time. I stopped playing some time in 2007, I don’t remember exactly when. During those two years my real life was put on hold while I created an entirely new life.

Read on →

Today I’ll be interrupting the usual programming to write a little something about phobias, specifically targeted at people that don’t have any. It’s probably going to come across a little killjoy and lecture-y but stick with me, it’s an important topic worth understanding.

Read on →

It’s quite easy to get scared by large systems of things that seem like magic. The Internet is pretty remarkable. It’s probably among the largest and most complicated systems ever designed by human beings. All those hundreds of web pages we view each month arrive at our computers unscathed a large percentage of the time. Some of them will have crossed the Pacific! That small percentage of the time we have a page “hang” while loading is often resolved by simply hitting the refresh button. Ace, right?

But how do those pages actually get to us? In this post (and maybe more, I might split them out, we’ll see how it goes) I want to show how these things work with practical examples and real commands that you can run to inspect what’s going on.

Prerequisite knowledge: Basic Ruby should do it. If you’ve built a simple web application with Sinatra or Rails or something similar, you should be able to follow along without much issue.

NOTE: I’m a Mac user. Some of the examples may be Mac specific. I will try, where possible, to give equivalent commands you can run on a Linux machine but I may miss something out. If you spot something that doesn’t work on your platform, get in touch. Windows users: I’m sorry.

Read on →

Over the last few weeks I’ve been grappling with a bug that just wouldn’t leave me alone. In the end, it took almost a week of pouring over TCP dumps and RFCs to figure out what was going on and, if I’m honest, the solution is a best-guess because I can’t figure out how to prove the theory.

It was a fun one, though, so I felt like writing it up :)

Read on →

A while ago, I found a pair of really useful GDB functions for debugging live Ruby processes on ThoughtBot’s blog:

ThoughtBot .gdbinit
1
2
3
4
5
6
7
define redirect_stdout
  call rb_eval_string("$_old_stdout, $stdout = $stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); $stdout.sync = true")
end

define ruby_eval
  call(rb_p(rb_eval_string_protect($arg0,(int*)0)))
end

These proved really handy but they have a couple of problems relating to garbage collection and Macs, so I made a few modifications.

NOTE: If you don’t care about the explanation, scroll to the bottom of the post for the modified script.

Read on →