Pages:  1 2 3 4 5
  Created - 2014/04/26 18:46:14+0000

I've started working on a TCP proxy. I inherited the code for one at work which wasn't very good. We also had three different versions of it lying around. I spent a morning replacing them with a cleaner, single implementation. I wasn't very happy with it because it took the same approach to threading as the one it replaced. Spawn two threads for each proxied connection. So I decided to do an implementation that did not continuously spawn threads. This meant using non-blocking I/O and a fixed... read more

Playing with assembly
  Created - 2013/12/10 21:05:28+0000

I've been playing with assembly code recently. It isn't something I have looked at since my undergraduate degree. It's very slow going but fun in a perverse way. I had forgotten a lot. I'm using the NASM assembler for the x86_64 instruction set. They were not what I was using in my degree so some of the things are new and that makes it unclear what I have forgotten. Macros are new, at least for assembly. I've been putting together some obvious, generic macros for the syscalls. ... read more

Rated Executor
  Created - 2013/10/06 14:53:58+0000

A colleague was working on a demo that polled the Twitter API. He had to solve the problem where he needed to ensure that the poll did not exceed the rate limits imposed on polling. This problem can easily be generalised into a generic problem, accessing a resource at no greater than a fixed rate. I didn't know of a generalised solution to the problem so I decided to implement one. A rated executor. A rate limited executor or a rated executor is an executor that executes tasks no faster than a fixed... read more

Checkstyle in the IDE
  Created - 2013/09/29 15:06:28+0000

Shortly after I started using Maven I added the Maven Checkstyle plugin to my build to generate reports on the conformance of my code to my preferred coding style. Recently I added an Eclipse plugin to do the same. The effects of installing a Checkstyle plugin into an IDE are simple. It makes you far more likely to fix problems and causes you to check files more thoroughly. What do I mean by more likely to fix problems? I mean that I don't have to check something to see what Checkstyle says th... read more

User Agent Parsing
  Created - 2013/09/25 21:48:59+0000

For my Web Utilities project I have been parsing user agent strings. You can take a look at the results for your browser by going to my user agent parser . All the APIs I looked at were focused on parsing for the Browser, OS, Layout Engine and Device. They ignore many of the additional details. There are sites such as but I didn't want to make requests to a web API to get the information. So I did it myself. It has been very slow, boring and unpleasant. Lots of dat... read more