Executing Tmux Commands

Took me a while to figure this out so I thought I’d blog it. If you’re using tmux and know of a command that you want to execute, but it’s not bound to anything (the example I had was clear-history) you can type leader-: (So, by default, C-b :) and then type the command’s name. All of the commands can be found in the man page, which is pretty intimidating, but quite complete.

October 31, 2011

Refactoring

There’s always bad code in projects, and like it or not, it is inevitable that you will come across a big old chunk of it sooner or later. You can’t really see it as a bad thing: every programmer should be embarrassed by their old code to some extent, and the nature of the projects we work on usually means that code stays in production for years. So, bad code is a fact of life, and as such, refactoring should be constantly on the table. Refactoring old code doesn’t need to be a huge thing, or a massive project that needs undertaking: it can be many small steps. Each day, you have the opportunity to tidy up a few files, write some tests, and generally improve your codebase. ...

October 31, 2011

Free To Play Models

I’ve been playing Heroes of Newerth for the last month or so, and it’s caused me to think a lot about the pros and cons on free to play models. The basic idea is that, instead of charging £30 upfront for a game, you release it for free, with some significant limitations, and charge for the removal of those limitations. A lot of MMO games are moving over to this model, and League Of Legends has led the way in the MOBA/ARTS (whatever we’re calling it) scene. ...

October 14, 2011

Python DSLs - Do's and Don'ts

DSLs are becoming a little more popular in Python, now that Django is gaining popularity, and as they appear, I know that we’re going to see a few bad patterns showing up as well as a load of great stuff. I wrote a pretty big DSL to describe plans in Billmonitor, so I’ve made a few mistakes myself, so I thought I’d write the lessons I learned along the way. Everything You’ve Written Before Is A DSL Every time you write a program, you define new words that you then put together to create something else. You’re writing your own language that defines things that relate to your domain. That’s all a DSL is - don’t make the mistake of thinking that your DSL is anything special, it’s just another program. It’s sort of a special case of programming - something that you fully intend other people to use, presumably without knowing the rest of the language. And as we all know, special cases aren’t special enough to break the rules. ...

January 11, 2011

Installing MongoDB using Chef and apt-get

I didn’t end up using apt-get, because it installs most of X in the process of installing XULRunner, but if you want a Mongo recipe, here’s one that should work, more or less. Your mileage may vary, I haven’t tested it out all that thoroughly.

November 15, 2010

Starcraft 2 Dynamic Triggers

In the Starcraft 2 galaxy editor, you can attach events to triggers, the idea being, when the event happens, the trigger fires. In the map I’m working on, a train moves through a series of points, so I thought what I’d do is, issue the train with an order to move to the next point it needs to reach, and have it fire an event when it gets there. I stored the points that it had to move through in an array and kept a pointer to the current location in the array. ...

September 30, 2010

WORKING_SET_INSTANCE_FAIL - the worst error message

I’ve been getting into Starcraft 2 lately, and I’ve found myself quite interested in making maps. I tried to publish my first today, and was greeted by a most unfriendly error. As the progress meter ticked up, somewhere between 80% and 100% it would fail, with the error message WORKING_SET_INSTANCE_FAIL. Completely confused by this, I googled around for a while, and no-one seemed to have a concrete solution, so I tried a few and hit on something that worked: I deleted the players colours from the Map -> Player Properties window. ...

September 16, 2010

Running SSH Tunnels as Daemons

If you need an ssh tunnel, chances are good that you need it to hang about for a while, so you might as well stick it in the background somewhere. Start-stop-daemon is a good candidate tool for the job, but it’s pretty weird to use. Here’s what I figured out.

August 13, 2010

Java 1.6.0_17 and HTMLUnit and SSL

Well, it looks like Java 1.6 update 17 closed some security holes which makes a lot of stuff involving SSL break. I have read about a few fixes, all of which were found by googling my particular exception, but none of them worked for me, so I turned to trusty HTMLUnit to fix my problems. Obviously, if you’re not using HTMLUnit, this won’t help you, but if you are, you can turn off the checking of SSL certificates using the handy setUseInsecureSSL method on your WebClient object.

June 1, 2010

Spotstock - lessons learned

At the end of the week before last I decided that Spotify’s new social features were a good excuse to host a little festival using Spotify as a platform. I announced it on Twitter and facebook, and then tried to decide how best to run it. I figured I’d try my best to just get the site done so people could see it and start thinking about their playlists, so I made it entirely static. I put it on a rails stack so I could add to it later, which gave me an opportunity to use the awesome Heroku service for deployment. In under an hour, the site was up. This turned out to be really sensible, because I have a bad habit of starting projects and not finishing them. Here I was finished before I’d even really started thinking about what I’d do. ...

May 14, 2010