Adam's photo
I write software, music and technical documentation. I'd like to think I'm a writer of some sort...
  • 28th Oct, 2008

    Easy to read log files

    When dealing with a large codebase, or any codebase really, debug log files can get pretty detailed. I made the mistake of not separating my log entries into degrees of importance with a switch in some settings file, so I basically have logging enabled or disabled. When logging is disabled pages render between 8 and 35 ms, when enabled pages can take up to 500 ms.

  • 15th Sep, 2008

    Quick and easy XML creation

    Generating XML is easy to get wrong. Unescaped entities, mismatched tags, Unicode characters create a minefield for a developer. XHTML is a subset of XML so the same rules apply, however I've noticed not many "web frameworks" generate guaranteed pure XHTML.

  • 8th Aug, 2008

    Remove Subversion Directories

    To strip out all Subversion tracking directories (those annoying .svn hidden ones) navigate to the directory in a terminal then type the following:

  • 22nd Jul, 2008

    Use the correct XHTML doctype for your templates.

    If you're working with XSL as a templating system, you'll want it to include the correct DTD.

  • 16th Jun, 2008

    Your database will never be 3rd normal form.

    Databases have incredibly complicated data structures. When working with a large database, the temptation is to over-engineer the layout. A completely normalised database is one particularly useful in production.

  • 31st May, 2008

    Serialise Python objects to XML

    I'm lazy. I like a complete separation of back-end code and front end styling - logic in the back end, styling for front end. There are many templating solutions floating around, but most put code in with markup. Fortunately, we have a templating solution which most web developers already know... XSL.

  • 30th May, 2008

    Running multiple web sites in apache in your user directory

    A lot of Apache installs by default assume the website is running as www-data:www-data in /var/www.

  • 24th May, 2008

    Sqlite in Python

    Sqlite is a small, standalone SQL based database engine. As long as you know SQL, you can get get started with a small file based database in seconds.

  • 15th May, 2008

    Windows Server 2003 files don't download correctly.

    Windows 2003 Server does not correctly serve up files which do not have a MIME type configured.

  • 15th May, 2008

    Clearfix CSS

    Do you have a problem with tricky clearing? Use this.