<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>LuckyDonkey</title>
	<atom:link href="http://www.luckydonkey.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.luckydonkey.com</link>
	<description>Never knowingly knowing narwhals</description>
	<pubDate>Mon, 28 Jul 2008 00:53:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>SQLAlchemy-Migrate upgrade scripts in a transaction</title>
		<link>http://www.luckydonkey.com/2008/07/27/sqlalchemy-migrate-upgrade-scripts-in-a-transaction/</link>
		<comments>http://www.luckydonkey.com/2008/07/27/sqlalchemy-migrate-upgrade-scripts-in-a-transaction/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 23:51:50 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[NewMetalArmy]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[SQLAlchemy]]></category>

		<category><![CDATA[TurboGears]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=210</guid>
		<description><![CDATA[SQLAlchemy Migrate is a really good tool for managing database upgrades for SQLAlchemy centric projects. I've been using it for 6 months on New Metal Army and I haven't had a screwed website upgrade yet!
For those that don't know SQLAlchemy-migrate allows you to version control database changes and easily upgrade and downgrade a database. Basically [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/sqlalchemy-migrate/">SQLAlchemy Migrate</a> is a really good tool for managing database upgrades for <a href="http://www.sqlalchemy.org/">SQLAlchemy</a> centric projects. I've been using it for 6 months on <a href="http://www.newmetalarmy.com">New Metal Army</a> and I haven't had a screwed website upgrade yet!</p>
<p>For those that don't know SQLAlchemy-migrate allows you to version control database changes and easily upgrade and downgrade a database. Basically you write a python script with two functions: upgrade and downgrade. You test the script against the database, commit it to the SQLAlchemy-migrate version repository (not to be confused with your source control mechanism). Finally you upgrade your development database.</p>
<p>When it the time comes to deploy the new application you simply ask sqlalchemy-migrate to upgrade your database to the current version. sqlalchemy-migrate reads the current version of your schema from the database (via a custom table it inserts) and proceeds to upgrade your schema by running each upgrade script in turn.</p>
<p>Often you want your upgrades and downgrades to run within a transaction. Not because you expect them to fail but because while writing them you don't wont to leave the database partially upgraded or downgraded if your script fails. To do this I wrote a transaction decorator. Here is a template for an upgrade script:</p>
<pre class="python"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># encoding: utf-8</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">datetime</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> sqlalchemy <span style="color: #ff7700;font-weight:bold;">import</span> *</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> migrate <span style="color: #ff7700;font-weight:bold;">import</span> *</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">from</span> migrate.<span style="color: black;">changeset</span> <span style="color: #ff7700;font-weight:bold;">import</span> *</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">metadata = MetaData<span style="color: black;">&#40;</span>migrate_engine<span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">def</span> transaction<span style="color: black;">&#40;</span>f, *args, **kwargs<span style="color: black;">&#41;</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #ff7700;font-weight:bold;">def</span> wrapper<span style="color: black;">&#40;</span>*args, **kwargs<span style="color: black;">&#41;</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        connection = migrate_engine.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        transaction = connection.<span style="color: black;">begin</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #ff7700;font-weight:bold;">try</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            result = f<span style="color: black;">&#40;</span>*args, **kwargs<span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            transaction.<span style="color: black;">commit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #ff7700;font-weight:bold;">return</span> result</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #ff7700;font-weight:bold;">except</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            transaction.<span style="color: black;">rollback</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #ff7700;font-weight:bold;">raise</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #ff7700;font-weight:bold;">finally</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            connection.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    wrapper.__name__ = f.__name__</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    wrapper.<span style="color: #0000cd;">__dict__</span> = f.<span style="color: #0000cd;">__dict__</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    wrapper.__doc__ = f.__doc__</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #ff7700;font-weight:bold;">return</span> wrapper</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@transaction</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">def</span> upgrade<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #ff7700;font-weight:bold;">pass</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@transaction</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff7700;font-weight:bold;">def</span> downgrade<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #ff7700;font-weight:bold;">pass</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>I fill in the upgrade and downgrade functions and I'm done <img src='http://www.luckydonkey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I include the decorator in every script as it's good practice to make your scripts as independent as possible. If you imported it from a module you may improve it in the future and inadvertently break your old downgrade scripts.</p>
<p>I hope this  helps you version control your database schema and data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/07/27/sqlalchemy-migrate-upgrade-scripts-in-a-transaction/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FreeBSD 7.0: installing psycopg 2.07</title>
		<link>http://www.luckydonkey.com/2008/07/23/freebsd-70-installing-psycopg-207/</link>
		<comments>http://www.luckydonkey.com/2008/07/23/freebsd-70-installing-psycopg-207/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 17:37:35 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=209</guid>
		<description><![CDATA[While setting up a new FreeBSD 7.0 server I found that psycopg 2.0.7 doesn't easy_install on FreeBSD. It's because of a configuration problem in config.h at the bottom.
#if defined(__FreeBSD__) &#124;&#124; (defined(_WIN32) &#38;&#38; !defined(__GNUC__)) &#124;&#124; defined(__sun__)
/* what's this, we have no round function either? */
static double round&#40;double num&#41;
&#123;
  return &#40;num &#62;= 0&#41; ? floor&#40;num + [...]]]></description>
			<content:encoded><![CDATA[<p>While setting up a new FreeBSD 7.0 server I found that psycopg 2.0.7 doesn't easy_install on FreeBSD. It's because of a configuration problem in config.h at the bottom.</p>
<pre class="cpp"><span style="color: #339900;">#if defined(__FreeBSD__) || (defined(_WIN32) &amp;&amp; !defined(__GNUC__)) || defined(__sun__)</span>
<span style="color: #ff0000; font-style: italic;">/* what's this, we have no round function either? */</span>
<span style="color: #0000ff;">static</span> <span style="color: #0000ff;">double</span> round<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">double</span> num<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  <span style="color: #0000ff;">return</span> <span style="color: #000000;">&#40;</span>num &gt;= <span style="color: #0000dd;">0</span><span style="color: #000000;">&#41;</span> ? <span style="color: #0000dd;">floor</span><span style="color: #000000;">&#40;</span>num + <span style="color: #0000dd;">0.5</span><span style="color: #000000;">&#41;</span> : <span style="color: #0000dd;">ceil</span><span style="color: #000000;">&#40;</span>num - <span style="color: #0000dd;">0.5</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #339900;">#endif</span>
&nbsp;</pre>
<p>However 'round' is defined in FreeBSD and has been since FreeBSD 5.3 (according to the manual page). The fix is simple, just remove the 'defined(__FreeBSD__) ||' part of the '#if' and you should be fine. Now you can 'easy_install .' psycopg2.</p>
<p>PS: I'd tried to raise a ticket but http://www.initd.org/ trac seems to have been down for ages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/07/23/freebsd-70-installing-psycopg-207/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mac OSX: starting postgres on boot</title>
		<link>http://www.luckydonkey.com/2008/07/03/mac-osx-starting-postgres-on-boot/</link>
		<comments>http://www.luckydonkey.com/2008/07/03/mac-osx-starting-postgres-on-boot/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 16:57:41 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=208</guid>
		<description><![CDATA[Every bloody operating system has it's own unique way of starting things at boot time. Today I bothered to learn how OS X does it. Here's how I got PostgreSQL to start when my machine is turned on:
What gets started is handled by a program called SystemStarter. On boot it looks through /Library/StartupItems for folders. [...]]]></description>
			<content:encoded><![CDATA[<p>Every bloody operating system has it's own unique way of starting things at boot time. Today I bothered to learn how OS X does it. Here's how I got PostgreSQL to start when my machine is turned on:</p>
<p>What gets started is handled by a program called SystemStarter. On boot it looks through /Library/StartupItems for folders. Inside those folders it looks for a script with the same name as the folder and a plist called StartupParameters.plist.</p>
<p>So as super user:</p>
<pre class="bash"><span style="color: #000066;">cd</span> /Library/StartupItems/
mkdir PostgreSQL
touch PostgreSQL/PostgreSQL
touch PostgreSQL/StartupParameters.plist
&nbsp;</pre>
<p>Now we need to fill in the details. In PostgreSQL/PostgreSQL enter:</p>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh
</span>
sudo -u postgres /usr/<span style="color: #000066;">local</span>/pgsql/bin/pg_ctl -D /usr/<span style="color: #000066;">local</span>/pgsql/data -l /usr/<span style="color: #000066;">local</span>/pgsql/data/logfile start</pre>
<p>This is a long line, but it's basically running postgres (via pg_ctl) as the user postgres. You'll need to change this to the whatever user you run postgres as and where ever your install of postgres is. I've used the standard names and directories so it's likely this will work for you too.</p>
<p>Now lets look at the plist. This file contains information for SystemStarter about when to start postgres, what postgres needs and provides and any messages to print to log files:</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist SYSTEM &quot;file://localhost/System/Library/DTDs/PropertyList.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.9&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dict<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>Description<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;string<span style="font-weight: bold; color: black;">&gt;</span></span></span>PostgreSQL<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/string<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>Messages<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dict<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>start<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;string<span style="font-weight: bold; color: black;">&gt;</span></span></span>Starting PostgreSQL<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/string<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>stop<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;string<span style="font-weight: bold; color: black;">&gt;</span></span></span>Stopping PostgreSQL<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/string<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dict<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>OrderPreference<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;string<span style="font-weight: bold; color: black;">&gt;</span></span></span>None<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/string<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;key<span style="font-weight: bold; color: black;">&gt;</span></span></span>Provides<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/key<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;array<span style="font-weight: bold; color: black;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;string<span style="font-weight: bold; color: black;">&gt;</span></span></span>PostgreSQL<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/string<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/array<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dict<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/plist<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p>You can test your new settings by typing sudo SystemStarter -n -D, fix any error messages, reboot and you should have postgres all the time <img src='http://www.luckydonkey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/07/03/mac-osx-starting-postgres-on-boot/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I have a shameful secret: as an engineer&#8230;</title>
		<link>http://www.luckydonkey.com/2008/06/24/i-have-a-shameful-secret-as-an-engineer/</link>
		<comments>http://www.luckydonkey.com/2008/06/24/i-have-a-shameful-secret-as-an-engineer/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 08:28:47 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=207</guid>
		<description><![CDATA[... I have no idea how to fix twitter. I know  this sounds incredible but it is true, there I have said it, it's out in the open.
I use twitter every day to send out really quite boring messages. "I've had some chocolate" and "I like lossless encoding" are all stunning examples of how [...]]]></description>
			<content:encoded><![CDATA[<p>... I have no idea how to fix twitter. I know  this sounds <i>incredible</i> but it is true, there I have said it, it's out in the open.</p>
<p>I use twitter every day to send out really quite boring messages. "I've had some chocolate" and "I like lossless encoding" are all stunning examples of how boring my twitters are. Sometimes they don't appear on twitter for hours... occasionally they don't appear at all.</p>
<p>As an engineer I think I have a fair idea of how twitter works BUT I have a <a href="http://www.newmetalarmy.com">code base</a> full of my own problems. I tend to spend my time thinking about those rather then fixing twitters by proxy.</p>
<p>So I'm asking the internet, can you all just shut up about <a href="http://www.google.co.uk/search?q=how+to+fix+twitter">fixing twitter</a>. I am sure <b>they</b> are aware of <b>their</b> deficiencies and how it would be better if they didn't do X or did do Y. Let's leave it to them to solve and if they don't I'm sure one of the genius twitter fixing bloggers can make his own distributed erlang über resilient systems that only blogger can create.</p>
<p>Here endeth the rant!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/06/24/i-have-a-shameful-secret-as-an-engineer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Password, it&#8217;s just not obvious to normal people</title>
		<link>http://www.luckydonkey.com/2008/05/20/password-its-just-not-obvious-to-normal-people/</link>
		<comments>http://www.luckydonkey.com/2008/05/20/password-its-just-not-obvious-to-normal-people/#comments</comments>
		<pubDate>Tue, 20 May 2008 01:18:08 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=206</guid>
		<description><![CDATA[As a programmer and all round geek I spend a lot of my time thinking about user interfaces for normal people. This is probably the hardest aspect to programming.
Putting yourself in the place of a normal user is, basically, impossible but every programmer/ui designer attempts to do this EVERY day.
Why am I talking about this? [...]]]></description>
			<content:encoded><![CDATA[<p>As a programmer and all round geek I spend a lot of my time thinking about user interfaces for normal people. This is probably the hardest aspect to programming.</p>
<p>Putting yourself in the place of a normal user is, basically, impossible but every programmer/ui designer attempts to do this EVERY day.</p>
<p>Why am I talking about this? Well my dad's hotmail account was hacked over the weekend and of course I was called to look in to it. Of course my first thought was that he had a weak password. So I ask him  "How good is your password, does it contain numbers and puntuation?". He paused and said "No, it's a word, they asked for a pass WORD".</p>
<p>Now it's easy to think that this is my dad's fault. But when you think about it, he did exactly what was asked of him. He entered a pass WORD a single word. A word from the dictionary, that's where words come from for normal people.</p>
<p>No one programmer or designer has failed him. An entire industry asks to world for passwords. To the industry, this is normal. It knows what it means by password but to normal people it means a word.</p>
<p>With this in mind I've raised a ticket for <a href='http://www.newmetalarmy.com'>New Metal Army</a> to change the word password to pass phrase (after asking my dad what he thought it meant of course).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/05/20/password-its-just-not-obvious-to-normal-people/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Interesting Take on Breakout</title>
		<link>http://www.luckydonkey.com/2008/04/23/interesting-take-on-breakout/</link>
		<comments>http://www.luckydonkey.com/2008/04/23/interesting-take-on-breakout/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:25:39 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=205</guid>
		<description><![CDATA[Some friends of mine have been working on a 'breakout' style game. I put breakout in quotes because it's not just a simple copy of breakout. They've added a lot of cool stuff to the game. It looks stunning and the demo I played about 5 months ago played really well. I've not played the [...]]]></description>
			<content:encoded><![CDATA[<p>Some friends of mine have been working on a 'breakout' style game. I put breakout in quotes because it's not just a simple copy of breakout. They've added a lot of cool stuff to the game. It looks stunning and the demo I played about 5 months ago played really well. I've not played the latest version but I am sure it's only got better.</p>
<p>Check out the video!</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/TnW0q1iJ8Fo&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/TnW0q1iJ8Fo&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>You can read more <a href='http://www.slam-game.com/game.html'>here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/04/23/interesting-take-on-breakout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe Flash: Not starting off on the correct foot</title>
		<link>http://www.luckydonkey.com/2008/04/23/adobe-flash-not-starting-off-on-the-correct-foot/</link>
		<comments>http://www.luckydonkey.com/2008/04/23/adobe-flash-not-starting-off-on-the-correct-foot/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 10:45:15 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=204</guid>
		<description><![CDATA[I'm about to embark on a learning exercise. I want to get my head around Flash to see if I can enhance New Metal Army. So I go to the Adobe website and click through to product demos... register (why do I have to register for EVERYTHING) and click on the download trial button... firefox [...]]]></description>
			<content:encoded><![CDATA[<p>I'm about to embark on a learning exercise. I want to get my head around Flash to see if I can enhance <a href='http://www.newmetalamry.com'>New Metal Army</a>. So I go to the Adobe website and click through to product demos... register (why do I have to register for EVERYTHING) and click on the download trial button... firefox redirects  all over the place and then nothing happens! So I try it in Safari... nothing happens.... I give up!</p>
<p>The next day (determined to get somewhere) I run VMWare Fusion, go in to IE and after a million click sounds I start downloading the Mac version of Flash CS3. So I need Windows to download the Mac version...grr</p>
<p>Being a good netizen I decide to file a ticket against the problem:</p>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/picture-2-2.png" height="304" width="464" border="1" hspace="4" vspace="4" alt="Picture 2-2" /></p>
<p><strong>EUROPEAN ENGLISH</strong>! There is no such thing as European English. There is English and American English. One of them is correct, the other is a phonetically correct abomination.</p>
<p>I didn't realise my 30 day trial would be such a trial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/04/23/adobe-flash-not-starting-off-on-the-correct-foot/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Expelled?</title>
		<link>http://www.luckydonkey.com/2008/04/22/expelled/</link>
		<comments>http://www.luckydonkey.com/2008/04/22/expelled/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 11:30:47 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=202</guid>
		<description><![CDATA[You may have heard of Expelled the movie. It's a movie about how creationist scientists are expelled from the science community for thinking 'outside of the box'.
Well this scientist has an excellent story about how HE was expelled from the queue for the movie... but there is an awesome twist to the tale.
http://scienceblogs.com/pharyngula/2008/03/expelled.php
]]></description>
			<content:encoded><![CDATA[<p>You may have heard of Expelled the movie. It's a movie about how <a href="http://en.wikipedia.org/wiki/Creationism">creationist</a> scientists are <strong>expelled</strong> from the science community for thinking 'outside of the box'.</p>
<p>Well this scientist has an excellent story about how HE was expelled from the queue for the movie... but there is an awesome twist to the tale.</p>
<p><a href='http://scienceblogs.com/pharyngula/2008/03/expelled.php'>http://scienceblogs.com/pharyngula/2008/03/expelled.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/04/22/expelled/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Turbogears Development: Enviroment</title>
		<link>http://www.luckydonkey.com/2008/04/19/turbogears-development-enviroment/</link>
		<comments>http://www.luckydonkey.com/2008/04/19/turbogears-development-enviroment/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 10:08:05 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[NewMetalArmy]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Subversion]]></category>

		<category><![CDATA[TurboGears]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=201</guid>
		<description><![CDATA[I thought I'd run through a list of tools that I used to make New Metal Army. New Metal Army is my first major website and I learned a lot along the way. Here are the tools in no particular order:
Subversion
First and foremost, subversion is a source control tool but it's also a safety net. [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I'd run through a list of tools that I used to make <a href="http://www.newmetalarmy.com">New Metal Army</a>. New Metal Army is my first major website and I learned a lot along the way. Here are the tools in no particular order:</p>
<h2><a href="http://subversion.tigris.org/">Subversion</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080112.jpg" height="106" width="123" border="1" hspace="4" vspace="4" alt="200804080112" style="float:left; border:0px;" />First and foremost, subversion is a source control tool but it's also a safety net. I can't see how you can call yourself a developer if you don't have source control. From day one I got myself an account on <a href="http://www.webfaction.com/?affiliate=eunit">Webfaction</a> set up subversion and started versioning everything. They allow https connection so everything is safe and because I don't live in their data center it's off site as well <img src='http://www.luckydonkey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br clear="all"/></p>
<h2><a href="http://trac.edgewall.org/">Trac</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/trac-logo.png" height="61" width="55" border="1" hspace="4" vspace="4" alt="Trac Logo" style="float:left; border:0px" />Again on <a href="http://www.webfaction.com/?affiliate=eunit">Webfaction</a>, I installed Trac. Trac is a project management webtool. It hooks in to svn so you can see repository changes as a timeline and see checkins as colored diffs. It also has a ticket system and wiki. I found the wiki to be invaluable. It allowed me to track my thoughts in a 'low barrier to entry' fashion. It's so easy to add a wiki page, there really isn't any excuse for not doing it! The ticket/task tracking is basic but fine for small teams. There is a simple notion of a milestone and a release but the metrics for measuring progress just aren't there. For me though, this was fine. Web projects are relatively simple and single man projects don't require metrics really.<br />
<br clear="all"/></p>
<h2><a href="http://macromates.com/">TextMate</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080025.jpg" height="131" width="140" border="1" hspace="4" vspace="4" alt="200804080025" style="float:left; border:0px" />TextMate is a text editor primarily aimed at programmers but useful for anyone who needs to edit structured documents where the content is more important then the layout. I first ran in to TextMate while I was evaluating Ruby. The Ruby community seems to be dominated by macbook pro users sitting in Starbucks, bashing code in to TextMate and buzzing on coffee. Although I decided not to use Ruby I did stick with TextMate. It really is the premier text editor for OS X. It's the first editor that has replaced emacs for me. I didn't use any extensions for TextMate but I did use <a href="http://pychecker.sourceforge.net/">PyChecker</a> and <a href="http://www.jslint.com/">JSLint</a> with it to check my python and Javascript code on save.<br />
<br clear="all"/></p>
<h2><a href="http://macrabbit.com/cssedit/">CSSEdit</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080026.jpg" height="134" width="158" border="1" hspace="4" vspace="4" alt="200804080026" style="float:left; border:0px" />CSSEdit is an editor devoted to CSS. The cool thing is that it has live editting. So as you edit the CSS file for a site, it changes the preview of the site. This is quite frankly brilliant and very cheap compared to the time it saved me. <br/>Combined with <a href="http://developer.yahoo.com/yui/">YUI</a>'s <a href="http://developer.yahoo.com/yui/reset/">CSSReset</a> I can proudly say I 'ported' New Metal Army from Firefox to Safari, IE and Opera in a few days with minimal difficulty. CSSReset should be the basis for ALL website development and Yahoo should get a fucking medal for creating it. Cheers guys <img src='http://www.luckydonkey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br clear="all"/></p>
<h2><a href="http://www.pixelmator.com/">Pixelmator</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080027.jpg" height="137" width="160" border="1" hspace="4" vspace="4" alt="200804080027" style="float:left; border:0px" />Pixelmator is a nice image editor the supports PSD's and layers. I got it as part of a <a href="http://www.macheist.com/">MacHeist</a> bundle and just started using it rather then paying hundreds of quid for Photoshop. Because it supports PSD's I can still work with artists who quite rightly want to use Photoshop.<br />
<br clear="all"/></p>
<h2><a href="http://www.vmware.com/mac">VMWare Fusion</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080027-1.jpg" height="138" width="168" border="1" hspace="4" vspace="4" alt="200804080027-1" style="float:left; border:0px" />Working on a mac makes it hard to get Internet Explorer working. I don't want or need a PC so VMWare comes to the rescue. VMWare is an OS virtualisation package that basically allows me to run various versions on Windows, Linux and BSD in a window. So I can run IE 5.5, 6.0 and 7 in separate virtual instances and check compatibility across IE5.5+, Safari, FireFox 2+ and Opera 9+. Since I'm a one man operation time consuming and boring tasks like this need to be made as painless as possible... or they won't get done.<br />
<br clear="all"/></p>
<h2><a href="http://www.getfirebug.com/">Firebug</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080029.jpg" height="154" width="162" border="1" hspace="4" vspace="4" alt="200804080029" style="float:left; border:0px" />Firebug is an extension for Firefox that allows you to examine pages and page elements to see how their layout has been calculated but it also allows you to debug Javascript inside the browser. It far exceeds IE's rather forced script debugger compatibility or .NET integration. This tool saved me months of debugging and more importantly sped up the learning curve for web development.<br />
<br clear="all"/></p>
<h2><a href="http://www.wingware.com/">Wingware IDE</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080030.jpg" height="139" width="166" border="1" hspace="4" vspace="4" alt="200804080030" style="float:left; border:0px" />There were times when I needed to debug fiddly python code and the python command line debugger just wasn't cutting it. I turned to Wingware's IDE for debugging and it served me very well. I only used it a few times though.</p>
<p><br clear="all"/></p>
<h2><a href="http://www.neooffice.org/">NeoOffice</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080031.jpg" height="130" width="144" border="1" hspace="4" vspace="4" alt="200804080031" style="float:left; border:0px" />Neooffice is a Mac port of Open Office. It's a good replacement for Claris or MS Office. I only needed to write a few letters to lawyers and such but it's good to not have to pay £500 for the privilege. I did use it a lot for opening up 50Mb csv files and it coped quite well with it.<br />
<br clear="all"/></p>
<h2><a href="http://www.python.org/">Python</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080031-1.jpg" height="71" width="211" border="1" hspace="4" vspace="4" alt="200804080031-1" style="float:left; border:0px" />Well this is pretty obvious, TurboGears uses Python so I am forced to work with it. Well luckily python is one of the best languages to do anything in. With a vast array of modules it's really quick to create scripts to process data for your website. As an affiliate for many music companies (iTunes, HMV, Play, Amazon, ...) I get access to huge XML and CSV files with their latest prices, stock and shipping information. Because of python's flexibility it is easy to merge this data in to New Metal Army.<br />
<br clear="all"/></p>
<h2><a href="http://turbogears.org/">TurboGears</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080110.jpg" height="130" width="129" border="1" hspace="4" vspace="4" alt="200804080110" style="float:left; border:0px" /><br />
TurboGears is a no brainer here. It's the web framework New Metal Army sits upon. For me though TG was more then a framework. TG comes with a great community bundled for free. I learned a lot just reading the mailing list. I also learned a lot by reading the code for TurboGears itself. It's well written and cleanly constructed. There is some advanced python on there but I don't think anything is overly complicated. Python is a great language to read and I think more programmers need to learn that they CAN dive in to most code and quickly work out what is going on.</p>
<p><br clear="all"/></p>
<h2><a href="http://www.postgresql.org/">PostgreSQL</a></h2>
<p><img src="http://www.luckydonkey.com/wp-content/uploads/2008/04/200804080118.jpg" height="103" width="130" border="1" hspace="4" vspace="4" alt="200804080118" style="float:left; border:0px" /><br />
Postgres has always been my database of choice. Unfortunately I have no real reason for this other then it's always covered my needs and it is standards compliant so I expect it to cover my needs for the foreseeable future. TurboGears uses an <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> mapper (<a href="http://www.sqlalchemy.org/">SQLAlchemy</a>) between it and the database so I could swap Postgres for MSSQL, MySQL, Firebird, Oracle or a number of others. Postgres serves New Metal Army VERY well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/04/19/turbogears-development-enviroment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>So I got hacked&#8230;</title>
		<link>http://www.luckydonkey.com/2008/04/11/so-i-got-hacked/</link>
		<comments>http://www.luckydonkey.com/2008/04/11/so-i-got-hacked/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 23:57:46 +0000</pubDate>
		<dc:creator>dazza</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.luckydonkey.com/?p=188</guid>
		<description><![CDATA[Luckydonkey got hacked yesterday as far as I can see. Somehow the lucky hacker managed to insert a series of links in to one of my blog entries. They created a div with a relative position of -1200, -1200 so it didn't appear when Luckydonkey was browsed.
It did however appear in Google Reader. Stou from [...]]]></description>
			<content:encoded><![CDATA[<p>Luckydonkey got hacked yesterday as far as I can see. Somehow the lucky hacker managed to insert a series of links in to one of my blog entries. They created a div with a relative position of -1200, -1200 so it didn't appear when Luckydonkey was browsed.</p>
<p>It did however appear in Google Reader. Stou from <a href="http://www.siafoo.net/">http://www.siafoo.net/</a> noticed the spam and kindly emailed me.</p>
<p>It is completely my fault. I've known that my install of Wordpress was quite old for sometime. This was the kick in the arse I needed to upgrade I guess. So if you are looking at this in a browser you will have noticed it's got the basic WP theme. I'll be bringing my unique design skills back to the internet soon.</p>
<p>Once again thanks to Stou for being a good internet citizen.</p>
<p>edit: you may see a lot of drug adverts on the site for a few days till google sorts itself out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.luckydonkey.com/2008/04/11/so-i-got-hacked/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
