6 programming project mistakes you should avoid

January 28, 2010 – 6:45 pm Tags:

During my adventures in programming, I’ve been involved in many projects. Luckily, despite having made some mistakes, they’ve gone quite well. Here are a few of them, with tips on how to avoid making them yourself.

Read the rest of this entry »

How much would you pay for good headphones?

January 14, 2010 – 9:09 pm

Time for some consumer advice today.

I’m sure many of us have often thought about getting headphones – and I’m sure many of us already have a pair – but how much is a reasonable amount to spend? And what will a higher-grade (read: more expensive) pair do that’s worth the money?

I recently decided to invest on some new headphones. The AKG K 701′s to be precise. They aren’t exactly very cheap and you’d probably want a headphone amplifier to go with them, one which I incidentally also bought. I’ve also had some more reasonably priced headphones in the past: Sennheiser HD-555′s and going down in the price range, some Koss and Philips ones.

My opinion is that great headphones can make listening to music much more enjoyable. However, should you go all out and buy expensive ones like the AKG, or is it smarter to purchase something else?

Read the rest of this entry »

Rendering graphics in JavaScript games

January 7, 2010 – 2:49 pm Tags: ,

As I’ve been rewriting TankWar, I’ve been thinking of various approaches to displaying the game’s graphics. At the moment, I can count three feasible approaches for rendering game graphics:

  • DHTML – In other words, using divs with images and moving them around
  • Canvas
  • A hybrid: Canvas with DHTML

I’ve considered each of these, and they all have some pros and cons which we’ll look at next.

Read the rest of this entry »

Best of 2009

December 29, 2009 – 8:34 pm

In the tradition of end of the year posts, here’s some “best of” statistics from this blog for the year 2009.

Next week we will return to our regular programming.

Read the rest of this entry »

Vim / Opera tip: Open highlighted text in Vim

December 22, 2009 – 6:50 pm Tags: ,

Here’s a quick tip for Opera and Vim users: How to add a menu item which allows you to quickly open highlighted text on a web page in Vim.

This trick can be applied with any other application too, like <insert your favorite editor>

Read the rest of this entry »

Rewriting TankWar: Assessing the damage

December 16, 2009 – 7:22 pm Tags: , ,

I have decided to rewrite TankWar, and I’ll be writing a bunch of blog posts about the process. If you ever wanted to know how to write a scorched earth/worms-like game using just JavaScript, now is your chance to learn ;)

This is the first one: Assessing the damage. In other words, take a look at the old code and see what can be salvaged. I’ll also list some issues with the current implementation, and how I plan on solving them in the new version.

Read the rest of this entry »

Git interactive rebase tips

December 10, 2009 – 4:51 pm Tags: ,

Interactive rebase is one of my most used Git commands. It’ll let me slice and dice commits in various useful ways. Here’s a few tips for you to unleash the true potential of rebase :)

  1. Basics: editing, combining, reordering and removing commits
  2. Breaking a commit into two
  3. Taking a part of a commit and bringing it to HEAD
  4. Bonus! How to recover commits if you screw up

Read the rest of this entry »

TankWar has online mode again: This time on Opera Unite

December 2, 2009 – 6:45 pm Tags: , ,

You may recall an earlier post about TankWar, my 100% JavaScript cannons-game. Back when I wrote it, I included online play, but the server went down with a hard disk failure.

Now, I have rewritten the online mode – this time that part is also all JavaScript – continue reading to find out what makes it tick.

Read the rest of this entry »

Dynamic precompiling of JavaScript functions for fun and profit

November 27, 2009 – 6:13 pm Tags:

Hey it’s Friday so it’s time to try a fun JavaScript hack – Let’s go and precompile some functions!

What does “precompiling” mean? In principle, it means we take a function which takes multiple parameters and pre-define some of them. All this is done dynamically, so your code can do it on the fly.

Let’s check out how this works and what benefits it has.

Read the rest of this entry »

Git tips for SVN users

November 19, 2009 – 7:27 pm Tags: ,

SVN is the version control system I’ve used the most, but lately I’ve been using Git more and more. I’ve also been using Git with projects that have an svn repository thanks to git’s built in svn support.

While working with it, I’ve ran into several typical cases that I’ve often needed to deal with, that I haven’t encountered with SVN, so I thought I’d share some tips with you, as I’m really starting to think Git is a much better tool than SVN.

Read the rest of this entry »