AeroCapture

Whenever I needed a screenshot of some application for this website, I used an image editor to cut out the window’s drop shadow, generated an alpha channel from its luminance, added that as a layer behind the actual application window and saved the entire thing again.

Today I wrote a small utility to automate this process for me: AeroCapture. Pressing the “Print Screen” key will take a screenshot of the active window, and save it as a .png in the My Pictures directory, retaining the window’s drop shadow in the image’s alpha channel.

Screen capture of a small window showing a clip art of a digital camera

You can download it here: [rokdownload menuitem=”17″ downloaditem=”42″ direct_download=”true”]AeroCapture.7z[/rokdownload] (C# source code included)

This got me thinking. Somehow, whenever I have the choice between…

  • spending 2 minutes doing a repetitive task that I’ve done a few dozen times before already (like fixing up the screenshot for my website)
  • or spending 4 hours to automate the task

…I always choose the 2 minutes approach. I can continue working on what I was planning to do and I don’t have as many utilities to maintain.

What do you do in this situation?

The logo used by Microsoft for .NET 4.0, a wavy letter N accompanied by the text "Microsoft .NET"

Visual Studio 2010

Two weeks ago, Microsoft released Visual Studio 2010 and with it, .NET 4.0.

I’m very excited about .NET 4.0 because this is the first standalone release of .NET since 2.0 came out, meaning that it doesn’t bundle any of the older runtimes. As you may know, .NET 3.5 is actually just .NET 2.0 with some more assemblies – all the magic required for LINQ, extension methods and lambda expressions happens in the compiler.

The letter N constructed from overlapping blue wave functions

The new Visual Studio UI also looks very nice and the darker background puts the actual work (the code) into focus. But there have been some changes like the apparent removal of the Debug/Release combo in the toolbar and the ability to add your own External Tools to the Tools menu in the Express Editions (don’t worry, both are still there, I explain how to enable them a bit down in this article).

So I decided to write a small heads-up on why I think Visual Studio 2010 and .NET 4.0 are cool and how to get back your favorite options if you’re already used to the Visual Studio 2008 Express Editions.

Read More

VirtualBox on Headless Gentoo

Being an adherent of Continuous Integration, I need a build machine that runs round the clock even when my workstation is turned off. As I’m running a small home server, this wouldn’t be an issue — if it weren’t for the fact that my home server runs Linux and 99% of my development happens in Windows. So I use virtualization to run a small Windows system on top of my home server.

In the past I used VMware for this job. VMware worked well for me and performance was quite good, but now that I’ve switched to a fully headless system, I noticed that the vmware-server package pulls in most of the X11 libraries – which I’m not particularly keen on having on my system due to their compile times.

A cube mounted like a display showing the Sun logo

So I went shopping for some alternatives. KVM sounded interesting (and was the leanest virtualization solution I could find), but the Gentoo Wiki stated that Windows didn’t work in qemu with recent kernels, so I went looking on – and found VirtualBox. This article explains how to set up VirtualBox on a headless Gentoo system.

Read More

Installing TeamCity on Gentoo Linux

If you haven’t heard of Continuous Integration yet, it’s the practice of setting up an automated system that rebuilds projects automatically whenever someone commits a new change to your source code repository. It ensures that whatever is in your repository builds and runs: automated builds usually involve compiling, running unit tests and packaging the installer.

Official TeamCity logo depicting a blue T and orange C

To do continuous integration, you need a tool that monitors your source code repository and starts the builds – a continuous integration server. My weapon of choice is TeamCity, a free CI server written in Java with first-class support for .NET and its toolchain (like NAnt, NUnit, NCover or PartCover).

TeamCity is pretty easy to deploy – the Windows package has an installer which leaves you with a fully working server after just a few clicks and even the Linux package is pretty simple to deploy: Download, unzip, run runAll.sh and you’re done. To properly integrate it into a Linux server (so it will come back up after rebooting and can be reached via HTTP without having to run either Apache or TeamCity on a non-standard port), you’ll need to run your own Tomcat server.

This guide will tell you how to do it!

Read More
Logo of the XNA Game Game Architecture tutorial series, three interlocked gears

Game Architecture Day 2

Stylish logo of two engaged gears with the text XNA Game Architecture

Welcome to day 2 of the XNA Game Architecture series!

I have thought hard about whether I should just assume a certain level of object oriented programming knowledge in this series. People picking up these articles likely already have some knowledge about objects and design, so I settled on a quick run-over of the principles that hopefully won’t bore the seasoned developers and provide a good reference for people just starting out!

If you already know all this, feel free to skip ahead until it becomes interesting again or to the next chapter ;)!

Read More

Integrating SpamAssassin into Courier

Please excuse the current flurry of Linux articles. I’m moving servers and this is my way of writing notes to myself and possibly helping out others. Normal service will resume shortly ;-)

This article is a follow-up to my guide on Installing Courier on Gentoo. As long as you have a working Courier installation on your system, there should be no issues following this guide.

Drawing of an arrow piercing through a stack of mail envelopes

Running a mail server without some kind of spam filtering is just insane these days. SpamAssassin is a nice solution, especially if you run SpamAssassin during the SMTP transaction to reject spam while it is being uploaded to your server.

Read More

Installing Courier on Gentoo

On my previous system, I had used qmail (netqmail actually, which is qmail with some patches). Qmail is moderately difficult to set up and in its 3 years lifespan on my system, it has broken down on several occasions. That’s why I decided to use another mail server when I moved my domains to a different system.

Because the Courier IMAP server has never let me down before, I decided to give the Courier Mail Server a chance. Lots of people are using Courier IMAP to access their mail but Exim, Postfix or Qmail to accept incoming emails. Even the Gentoo Wiki contains various HowTos for these combinations, but not a single one for a homogenous Courier setup. After trying out Courier, I don’t see why, so this is my attempt to rectify the situation (and to remember what needs to be done for the next time I’m moving my domains to another system!)

Read More

Installing wTorrent on Gentoo

If you want to download torrents on your Linux system, there are several clients to choose from. One of the nicest and fastest clients is rTorrent. It is full-featured, supports encryption, dynamic host table exchange and achieves fantastic download speeds.

But its best feature probably is that it isn’t bound to any windowing toolkit. You can install one of its GUI frontends to manage it on your fancy KDE 4 desktop machine, but you can also run it on a headless system and manage torrent from a text-only console. And if you happen to run it on a home server like me, there’s wTorrent, a beaufitful AJAX-driven web frontend that allows you to manage your torrents in your browser.

Screenshot of the wTorrent web frontend for rTorrent

Installing wTorrent isn’t the easiest thing to do, so, as when I tried to get the best out of my SSD, I decided to write this small article explaining how to do it. I’m using Gentoo Linux, but it shouldn’t be too hard to apply this article to another Linux distribution.

Read More
Logo of the XNA Game Game Architecture tutorial series, three interlocked gears

Game Architecture Day 1

Stylish logo of two engaged gears with the text XNA Game Architecture

Welcome to day 1 of the XNA Game Architecture series! We’re about to create a small 3D Shoot ’em Up using the principles of modern software architecture.

If you missed the introduction, this series is about the architecture of games. Instead of focusing on a single concept, we’ll be focusing at how it all comes together and how you can keep your game’s code manageable and clean. You’ll be looking over my shoulder as I write a small game and explain why I do things one way and not the other :)

Today, I will start the project by creating a development tree that contains the actual XNA project and some third-party libraries I’m going to use within the game. Normally, I would add those libraries as I go, but I’ve got a pretty clear idea for this project and it will be easier for you because I can just package them all in a handy zip archive which you’ll find at the end of this article.

Read More