Vertical centering in CSS for content of unknown height

I read this excellent article on centering and as the comments are suspended, I thought I'd post about it instead.

I think the floater div position is inconsistent. In 'Which Method?' the floater is a closed tag above the content. In Method 3 the floater wraps the content.

Also a potential con for Method 3 is that you need to know the height of the content, where as you don't for Method 1.

I went with Method 1 as IE9 supports it, though for wider compatibility I should include the IEx hacks.

Interviewed by Engineering and Technology magazine

I did an interview for Caroline Elliott's article in the IET's Engineering and Technology magazine, entitled "Enterprising Careers". Really pleased with the quote:

Drupal code formatting for Zend Studio or Eclipse

This post started out about code formatting, but it's grown to include all my Eclipse setup.

Originally I built a PHP formatter in Zend Studio, but I had difficulties setting up the free Eclipse PDT with this config. I followed instructions at:, then tweaked some of the configuration. I pulled it into Eclipse (Juno), changed the XML paths and ignored the warnings, then resaved it out again from the wizard to get it in the right format.

Eclipse setup

PHP development IDEs and why you should have one

I've been doing a lot of development in PHP recently. I started programming in C/Codeworks, but it wasn't until I did some work in OpenCV and Visual Studio that I started seeing the value of IDEs. Having a good debugger is essential to resolving bugs in a timely manner. While it's possible to integrate a text editor, profiler and version control system with a debugger, it takes time to setup and maintain this tool chain, time that I'd rather pay someone else to spend.

Linux shutdown command variants

shutdown -r now
resets and restarts the computer

shutdown now
turns some machines off (which is technically called a halt)

shutdown -h now
shutdown and halt/turn machine off

Can't call arguments.slice() in JS

Javascript is a wonderful language, full of twists and turns. I was surprised that I could:


but not


It turns out it's because arguments is not a real array, but a function, which you can access like an array, e.g.:


To do a slice() op on it:

var args =, 1);

Debugging concurrent javascript in Firebug using QUnit

QUnit queues up all the javascript tests, then runs them. This means you get an accurate picture of how long the tests take to run sequentially, but you have to be very careful about multi-threaded execution. When testing DiSCO, I had to keep using QUnit.stop and .start() whenever I had an asynchronous event between tests.

Also, when setting breakpoints in Firebug, be careful to set them inside the test functions as your code will be operating in two different timeframes. Below t0 is the test setup timeframe and t1 the test execution timeframe.

------- |-t0--- |-t1---

Using SVN hooks to run QA tests on Javascript

Read a great primer by Amaxus on Using JSlint with Subversion hooks. There were a few bugs, largely created by missing \ characters in the published source. My working version is published zipped up below.

Multithreaded wget alternative for Linux or Mac OS X

Happened across aget today. The source is available from

To compile under Mac OS X (10.6 Snow Leopard), you need to add -D_DARWIN_C_SOURCE to the gcc compile flags in the Makefile.

# EnderUNIX Aget Makefile

OBJS = main.o Aget.o Misc.o Head.o Signal.o Download.o Resume.o
LDFLAGS = -pthread
CC = gcc
STRIP = strip

all: $(OBJS)

Metadata Tools for Production £5m competition

Alex Stanhope is a Technology consultant to the UK Creative Industries and Venture Catalyst. This is my personal website.
Bristol | Lightenna | ManKind Project | goodkarma
All material copyright (c) 2006-2010 | Website by Lightenna, featuring N.Design's GlossyBlue theme.
Syndicate content Syndicate content