<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DaveDevelopment &#187; MySQL</title>
	<atom:link href="http://www.davedevelopment.co.uk/archive/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davedevelopment.co.uk</link>
	<description>Dave Marshall</description>
	<lastBuildDate>Tue, 01 Jun 2010 13:18:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Set MySQL connection variables with mysql-proxy</title>
		<link>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/</link>
		<comments>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 11:01:02 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[mysql-proxy]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=477</guid>
		<description><![CDATA[We recently moved the application I work on everyday to Amazon Web Services and bravely adopted their Relational Database Service (RDS) and have had little trouble thus far, but the other day I noticed since we kicked into BST, timestamps in the database where an hour behind. Low and behold, the default time zone cannot [...]]]></description>
			<content:encoded><![CDATA[<p>We recently moved the application I work on everyday to <a href="http://aws.amazon.com/">Amazon Web Services</a> and bravely adopted their <a href="http://aws.amazon.com/rds/">Relational Database Service (RDS)</a> and have had little trouble thus far, but the other day I noticed since we kicked into BST, timestamps in the database where an hour behind. Low and behold, the default time zone <a href="http://aws-musings.com/amazon-relational-database-service-rds-the-timezone-problem/">cannot be changed</a>. Luckily, we&#8217;ve been using <a href="https://launchpad.net/mysql-proxy">mysql-proxy</a> since we migrated and rather than changed our application, I managed to knock up a <a href="http://www.lua.org/">lua</a> script that sets the timezone variable on every query. It would be nice if it could do it when it creates a connection, but I&#8217;ve not worked out how to do that yet!</p>
<pre name="code" class="lua">
---
-- read_query() can rewrite packets
--
function read_query( packet )
        if string.byte(packet) == proxy.COM_QUERY then
                proxy.queries:append(1, string.char(proxy.COM_QUERY) .. "SET time_zone = 'Europe/London'", {resultset_is_needed = true})
                proxy.queries:append(2, packet)
                return proxy.PROXY_SEND_QUERY
        end
end

---
-- read_query_result() is called when we receive a query result
-- from the server
--
function read_query_result(inj)
        if (inj.type == 1) then
            return proxy.PROXY_IGNORE_RESULT
        end
end
</pre>
<p>If anyone could point me in the general direction for setting the variable at connection time, it&#8217;d be appreciated. I assume I can create a create_connection function, but I don&#8217;t know where to go from there.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy&amp;bodytext=We%20recently%20moved%20the%20application%20I%20work%20on%20everyday%20to%20Amazon%20Web%20Services%20and%20bravely%20adopted%20their%20Relational%20Database%20Service%20%28RDS%29%20and%20have%20had%20little%20trouble%20thus%20far%2C%20but%20the%20other%20day%20I%20noticed%20since%20we%20kicked%20into%20BST%2C%20timestamps%20in%20the%20data" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy&amp;notes=We%20recently%20moved%20the%20application%20I%20work%20on%20everyday%20to%20Amazon%20Web%20Services%20and%20bravely%20adopted%20their%20Relational%20Database%20Service%20%28RDS%29%20and%20have%20had%20little%20trouble%20thus%20far%2C%20but%20the%20other%20day%20I%20noticed%20since%20we%20kicked%20into%20BST%2C%20timestamps%20in%20the%20data" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;h=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Versions in popular Linux Distributions</title>
		<link>http://www.davedevelopment.co.uk/2008/05/08/php-versions-in-popular-linux-distributions/</link>
		<comments>http://www.davedevelopment.co.uk/2008/05/08/php-versions-in-popular-linux-distributions/#comments</comments>
		<pubDate>Thu, 08 May 2008 19:33:40 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php linux sles version]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=58</guid>
		<description><![CDATA[I had a problem today at work, I&#8217;ve been coding exclusively in PHP5.2 since it was available and most of the servers I&#8217;ve been working for are Debian or Ubuntu based, so I didn&#8217;t have any problems until this afternoon. We&#8217;ve recently bought a SAN solution from Dell and to gain support we bought two [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem today at work, I&#8217;ve been coding exclusively in PHP5.2 since it was available and most of the servers I&#8217;ve been working for are Debian or Ubuntu based, so I didn&#8217;t have any problems until this afternoon. We&#8217;ve recently bought a SAN solution from Dell and to gain support we bought two new servers, both with <a href="http://www.novell.com/products/server/">SUSE Enterprise Linux</a> installed, which only comes with PHP 5.1.2. That particular version came out in January 2006. Since then I&#8217;ve been using the new <a href="http://uk.php.net/manual/en/function.date-create.php">DateTime</a> object, the <a href="http://uk.php.net/filter">filter</a> functions, <a href="http://uk2.php.net/manual/en/function.memory-get-peak-usage.php">memory_get_peak_usage()</a> and <a href="http://uk2.php.net/manual/en/function.sys-get-temp-dir.php">sys_get_temp_dir()</a>. And they&#8217;re only the problems I noticed. We could install from source, but then we lose the subtle benefits of package management.</p>
<p>So, this lead to me wondering what LAMP versions the popular distros are using, with the help of <a href="http://distrowatch.com">DistroWatch</a>, I compiled this table. It only shows the community/open source distributions, the commercials counterparts for each are usually at least a year behind, guaranteeing support but only for out of date versions.</p>
<table>
<tr>
<th>Distribution</th>
<th>Version</th>
<th>Apache</th>
<th>MySQL</th>
<th>PHP</th>
</tr>
<tr>
<td>Ubuntu</td>
<td>8.04 LTS Hardy Heron</td>
<td>2.2.8</td>
<td>5.0.51a</td>
<td>5.2.4</td>
</tr>
<tr>
<td>openSUSE</td>
<td>10.3</td>
<td>2.2.4</td>
<td>5.0.45</td>
<td>5.2.4</td>
</tr>
<tr>
<td>Fedora</td>
<td>8 Werewolf</td>
<td>2.2.6</td>
<td>5.0.45</td>
<td>5.2.4</td>
</tr>
<tr>
<td>Debian GNU/Linux</td>
<td>4.0 Etch</td>
<td>2.2.3</td>
<td>5.0.32
         </td>
<td>5.2.0</td>
</tr>
<tr>
<td>Mandriva Linux</td>
<td>2008.1</td>
<td>2.2.8</td>
<td>5.0.51a</td>
<td>5.2.5</td>
</tr>
<tr>
<td>Knoppix</td>
<td>5.3.1</td>
<td>2.2.8</td>
<td>5.0.51a</td>
<td>5.2.3</td>
</tr>
<tr>
<td>Slackware Linux</td>
<td>12.0</td>
<td>2.2.4</td>
<td>5.0.37</td>
<td>5.2.3</td>
</tr>
<tr>
<td>Gentoo Linux</td>
<td>2007.0</td>
<td>2.0.58</td>
<td>5.0.38</td>
<td>5.2.2</td>
</tr>
<tr>
<td>FreeBSD</td>
<td>7.0 RELEASE</td>
<td>2.2.6</td>
<td>5.0.45</td>
<td>5.2.5</td>
</tr>
</table>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;title=PHP%20Versions%20in%20popular%20Linux%20Distributions&amp;bodytext=I%20had%20a%20problem%20today%20at%20work%2C%20I%27ve%20been%20coding%20exclusively%20in%20PHP5.2%20since%20it%20was%20available%20and%20most%20of%20the%20servers%20I%27ve%20been%20working%20for%20are%20Debian%20or%20Ubuntu%20based%2C%20so%20I%20didn%27t%20have%20any%20problems%20until%20this%20afternoon.%20We%27ve%20recently%20bought%20a%20SAN%20sol" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;title=PHP%20Versions%20in%20popular%20Linux%20Distributions&amp;notes=I%20had%20a%20problem%20today%20at%20work%2C%20I%27ve%20been%20coding%20exclusively%20in%20PHP5.2%20since%20it%20was%20available%20and%20most%20of%20the%20servers%20I%27ve%20been%20working%20for%20are%20Debian%20or%20Ubuntu%20based%2C%20so%20I%20didn%27t%20have%20any%20problems%20until%20this%20afternoon.%20We%27ve%20recently%20bought%20a%20SAN%20sol" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;h=PHP%20Versions%20in%20popular%20Linux%20Distributions" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;title=PHP%20Versions%20in%20popular%20Linux%20Distributions" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;title=PHP%20Versions%20in%20popular%20Linux%20Distributions" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F&amp;title=PHP%20Versions%20in%20popular%20Linux%20Distributions" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F05%2F08%2Fphp-versions-in-popular-linux-distributions%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2008/05/08/php-versions-in-popular-linux-distributions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Simple database migrations with Phing and DbDeploy</title>
		<link>http://www.davedevelopment.co.uk/2008/04/14/how-to-simple-database-migrations-with-phing-and-dbdeploy/</link>
		<comments>http://www.davedevelopment.co.uk/2008/04/14/how-to-simple-database-migrations-with-phing-and-dbdeploy/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 16:20:08 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[dbdeploy]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[migrations]]></category>
		<category><![CDATA[phing]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=53</guid>
		<description><![CDATA[Introduction
This How To will introduce some simple database migrations to your PHP application. Ruby on Rails is a popular web application framework, that provides a method of migrating (upgrading) the applications database programatically, keeping the database schema essentially version controlled. This allows individual developers to update their working databases and the databases on testing, staging [...]]]></description>
			<content:encoded><![CDATA[<h4>Introduction</h4>
<p>This How To will introduce some simple database migrations to your PHP application. <a href="http://www.rubyonrails.org/">Ruby on Rails</a> is a popular <a href="http://en.wikipedia.org/wiki/Web_application_framework">web application framework</a>, that provides a method of migrating (upgrading) the applications database programatically, keeping the database schema essentially version controlled. This allows individual developers to update their working databases and the databases on testing, staging or production machines to be updated with new versions of applications. The <a href="http://www.cakephp.org">CakePHP</a> framework has recently developed a <a href="http://bakery.cakephp.org/articles/view/cake-db-migrations-v2-1">migrations library</a> simliar to rails, but this article focuses on using seperate tools to run database migrations, a build tool called <a href="http://phing.info">Phing</a>, along with a method for creating database migrations, <a href="http://dbdeploy.com/">dbdeploy</a>.</p>
<h4>Install Phing</h4>
<p>I always use the beta or release candidate of phing and for the purposes of this article I suggest you do too. The best way to download and install phing is using <a href="http://pear.php.net/">PEAR</a>. This can be done on Linux or Windows assuming you have the pear script in your PATH with three shell commands.</p>
<pre class="bash shell">
shell> pear channel-discover pear.phing.info
shell> pear config-set preferred_state beta
shell> pear install phing/phing
</pre>
<h4>Example Application structure</h4>
<p>As an example, we&#8217;re going to develop a simple application with the following directory structure.</p>
<pre>
example/
 |-- db/
 |   `-- deltas/
 |-- deploy/
 |   `-- scripts/
 |-- library/
 `-- public/
</pre>
<p>The <tt>db</tt> directory contains sql files for using and manipulating our database and<br />
the <tt>deploy</tt> directory contains our build scripts that set the migrations in motion. The library directory contains our application code and the <tt>public</tt> folder will contain scripts and files accessible directly from the web, but will not be the focus of this article.</p>
<h4>Build scripts</h4>
<p>This section shows you how to develop the build scripts that will run the database migrations. The first file we need to create is a simple configuration file and should be fairly self explanatory. The file is written as <tt>key=value</tt>, lines beginning with a <tt>#</tt> are comments. Open your editor and save the following text as <tt>deploy/build.properties</tt>.</p>
<pre>
# Property files contain key/value pairs
#key=value

# This dir must contain the local application
build.dir=../

# Credentials for the database migrations
db.host=localhost
db.user=user
db.pass=password
db.name=example

# paths to programs
progs.mysql=/usr/bin/mysql
</pre>
<p>The next file we are going to create is the <tt>deploy/build.xml</tt> file. This is the file that tells Phing what we want it to do. I&#8217;m not going to go into too much detail describing each part of the build file, there are some comments, but you should consult the <a href="http://phing.info/docs/guide/current/">Phing Documentation</a> for further details and enhancements.</p>
<pre name="code" class="xml">
&lt;?xml version=&quot;1.0&quot; ?&gt;
&lt;project name=&quot;PurpleMonkey&quot; basedir=&quot;.&quot; default=&quot;build&quot;&gt;

    &lt;!-- Sets the DSTAMP, TSTAMP and TODAY properties --&gt;
    &lt;tstamp/&gt;

    &lt;!-- Load our configuration --&gt;
    &lt;property file=&quot;./build.properties&quot; /&gt;

    &lt;!-- create our migration task --&gt;
    &lt;target name=&quot;migrate&quot; description=&quot;Database Migrations&quot;&gt;  

        &lt;!-- load the dbdeploy task --&gt;
        &lt;taskdef name=&quot;dbdeploy&quot; classname=&quot;phing.tasks.ext.dbdeploy.DbDeployTask&quot;/&gt;

        &lt;!-- these two filenames will contain the generated SQL to do the deploy and roll it back--&gt;
        &lt;property name=&quot;build.dbdeploy.deployfile&quot; value=&quot;deploy/scripts/deploy-${DSTAMP}${TSTAMP}.sql&quot; /&gt;
        &lt;property name=&quot;build.dbdeploy.undofile&quot; value=&quot;deploy/scripts/undo-${DSTAMP}${TSTAMP}.sql&quot; /&gt;

        &lt;!-- generate the deployment scripts --&gt;
        &lt;dbdeploy
            url=&quot;mysql:host=${db.host};dbname=${db.name}&quot;
            userid=&quot;${db.user}&quot;
            password=&quot;${db.pass}&quot;
            dir=&quot;${build.dir}/db/deltas&quot;
            outputfile=&quot;${build.dir}/${build.dbdeploy.deployfile}&quot;
            undooutputfile=&quot;${build.dir}/${build.dbdeploy.undofile}&quot; /&gt;

        &lt;!-- execute the SQL - Use mysql command line to avoid trouble with large files or many statements and PDO --&gt;
        &lt;exec
            command=&quot;${progs.mysql} -h${db.host} -u${db.user} -p${db.pass} ${db.name} &amp;lt; ${build.dbdeploy.deployfile}&quot;
            dir=&quot;${build.dir}&quot;
            checkreturn=&quot;true&quot; /&gt;
    &lt;/target&gt;
&lt;/project&gt;
</pre>
<p>That&#8217;s essentially all the magic we need. Now we just need to create our database.</p>
<h4>Writing dbdeploy delta scripts</h4>
<p>We haven&#8217;t actually created our database, so rather than create it the traditional way, we will actually use the migrations to create the initial schema. We&#8217;ve not actually decided what our example application does yet, but seeing as most tutorials make blogs, why don&#8217;t we give that a bash. We&#8217;ll start simple, one table with three columns called <tt>post</tt>.</p>
<table>
<tr>
<th>Field</th>
<th>Type</th>
<th>Comment</th>
</tr>
<tr>
<td>title</td>
<td>VARCHAR(255)</td>
<td>The title of our post</td>
</tr>
<tr>
<td>time_created</td>
<td>DATETIME</td>
<td>The time we created our post</td>
</tr>
<tr>
<td>content</td>
<td>MEDIUMTEXT</td>
<td>The content of our post</td>
</tr>
</table>
<p>Dbdeploy works by creating numbered delta files. Each delta files contains simple SQL to both deploy the change and roll it back. The basic layout of a delta file is like so.</p>
<pre name="code" class="sql">
--//

-- Run SQL to do the changes

--//@UNDO

-- RUN SQL to undo the changes

--//
</pre>
<p>We are creating our initial schema, so put the following content in <tt>db/deltas/1-create_initial_schema.sql</tt></p>
<pre name="code" class="sql">
--//

CREATE TABLE `post` (
    `title` VARCHAR(255),
    `time_created` DATETIME,
    `content` MEDIUMTEXT
);

--//@UNDO

DROP TABLE `post`;

--//
</pre>
<h4>Migrating the database</h4>
<p>We are one step away from running our first migration. To keep track of the current version of the database, dbdeploy requires a table in the database. This is the only time we will have to interact with the mysql client directly.</p>
<pre class="shell bash">
shell> mysql -hlocalhost -uroot -ppassword example
mysql> CREATE TABLE changelog (
  change_number BIGINT NOT NULL,
  delta_set VARCHAR(10) NOT NULL,
  start_dt TIMESTAMP NOT NULL,
  complete_dt TIMESTAMP NULL,
  applied_by VARCHAR(100) NOT NULL,
  description VARCHAR(500) NOT NULL
);
mysql> ALTER TABLE changelog ADD CONSTRAINT Pkchangelog PRIMARY KEY (change_number, delta_set);
</pre>
<p>We are now ready to run our first migration and create the initial schema for our application.</p>
<pre>
shell>cd deploy
shell>phing migrate
</pre>
<p>All being well, we now have a posts table in our database. But what about an author for our blog posts? We&#8217;ll have to add another table and a foreign key from the post table to author table. To do this we create another delta, we call this one <tt>db/deltas/2-create_author_and_link_to_post.sql</tt></p>
<pre name="code" class="sql">
--//

CREATE TABLE `author` (
    `author_id` INT(10) unsigned auto_increment,
    `name` VARCHAR(255),
    PRIMARY KEY (`author_id`)
);

ALTER TABLE `post` ADD `author_id` INT(10) unsigned NULL;

--//@UNDO

ALTER TABLE `post` DROP `author_id`;

DROP TABLE `author`;

--//
</pre>
</p>
<p>Run our migrations again.</p>
<pre class="shell bash">
shell> cd deploy
shell> phing migrate
</pre>
<h4>Conclusion</h4>
<p>That&#8217;s pretty much it, you&#8217;ve seen how to create database deltas and use them to migrate your database, if you can&#8217;t be bothered to copy and paste things to try for yourself, download the <a href="/files/example_application.zip">example application</a>.</p>
<p>There are plenty of caveats when it comes to version controlling databases, especially if you branch and merge your application code, some are <a href="http://dbdeploy.com/documentation/getting-started/rules-for-using-dbdeploy/">detailed</a> in the dbdeploy documentation</p>
<p>This tutorial is probably incomplete or wrong in plenty of ways, if you think you have something to point out, please leave your comments below</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;title=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy&amp;bodytext=Introduction%0D%0AThis%20How%20To%20will%20introduce%20some%20simple%20database%20migrations%20to%20your%20PHP%20application.%20Ruby%20on%20Rails%20is%20a%20popular%20web%20application%20framework%2C%20that%20provides%20a%20method%20of%20migrating%20%28upgrading%29%20the%20applications%20database%20programatically%2C%20keeping" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;title=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy&amp;notes=Introduction%0D%0AThis%20How%20To%20will%20introduce%20some%20simple%20database%20migrations%20to%20your%20PHP%20application.%20Ruby%20on%20Rails%20is%20a%20popular%20web%20application%20framework%2C%20that%20provides%20a%20method%20of%20migrating%20%28upgrading%29%20the%20applications%20database%20programatically%2C%20keeping" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;h=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;title=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;title=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F&amp;title=How%20To%3A%20Simple%20database%20migrations%20with%20Phing%20and%20DbDeploy" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F04%2F14%2Fhow-to-simple-database-migrations-with-phing-and-dbdeploy%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2008/04/14/how-to-simple-database-migrations-with-phing-and-dbdeploy/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>How To: Send SQL commands to a database in VIM</title>
		<link>http://www.davedevelopment.co.uk/2007/03/29/how-to-send-sql-commands-to-a-database-in-vim/</link>
		<comments>http://www.davedevelopment.co.uk/2007/03/29/how-to-send-sql-commands-to-a-database-in-vim/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 16:02:30 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/2007/03/29/how-to-send-sql-commands-to-a-database-in-vim/</guid>
		<description><![CDATA[A simple way of sending SQL to your database from everyone&#8217;s favourite editor Vim, without any plugins or macros.
Firstly we need to add a custom command to our .vimrc, open it up and add the following line, where:

CommandName &#8211; The name of your command
Username &#8211; The username for this database
Password &#8211; The password for this [...]]]></description>
			<content:encoded><![CDATA[<p>A simple way of sending SQL to your database from everyone&#8217;s favourite editor <a href="http://www.vim.org" title="Vim - The Editor">Vim</a>, without any plugins or macros.</p>
<p>Firstly we need to add a custom command to our <tt>.vimrc</tt>, open it up and add the following line, where:</p>
<ul>
<li><tt>CommandName</tt> &#8211; The name of your command</li>
<li><tt>Username</tt> &#8211; The username for this database</li>
<li><tt>Password</tt> &#8211; The password for this database</li>
<li><tt>Database</tt> &#8211; The name of the database</li>
</ul>
<pre class="code">
:command -range=% CommandName :&lt;line1&gt;,&lt;line2&gt;w !mysql -uUsername -pPassword Database -t
</pre>
<p>For example:</p>
<pre class="code">
:command -range=% SendDB :&lt;line1&gt;,&lt;line2&gt;w !mysql -utest -ptest test -t
</pre>
<p>That&#8217;s all the setting up we need. As you can see, after the exclamation mark is just the regular <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql.html">MySQL Command line tool</a> and various options.</p>
<p>Fire up <a href="http://www.vim.org" title="Vim - The Editor">vim</a> and start editing your sql.</p>
<pre class="code">
# vim test.sql
</pre>
<p>As an example, here&#8217;s some simple SQL.</p>
<pre class="code">
-- Drop existing table
DROP TABLE IF EXISTS `test`;

-- Create table
CREATE TABLE IF NOT EXISTS `test` (
    `test_id` INT(11) NOT NULL auto_increment,
    `name` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`test_id`)
);

-- Add our data
INSERT INTO `test`(`name`) VALUES('dave');

-- Get it back out again
SELECT * FROM `test`;
</pre>
<p>If we&#8217;re happy with what we&#8217;ve written, while in command mode, type <tt>:SendDB</tt>, or whatever you called your command and hit enter. If it works, you&#8217;ll see something like this.</p>
<pre class="code">
~/test.sql[+][sql] unix
:SendDB
+---------+------+
| test_id | name |
+---------+------+
|       1 | dave |
+---------+------+

Press ENTER or type command to continue
</pre>
<p>You can always add to the custom command, in particular piping the output to less can be effective for larger result sets.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;title=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM&amp;bodytext=A%20simple%20way%20of%20sending%20SQL%20to%20your%20database%20from%20everyone%27s%20favourite%20editor%20Vim%2C%20without%20any%20plugins%20or%20macros.%0D%0A%0D%0AFirstly%20we%20need%20to%20add%20a%20custom%20command%20to%20our%20.vimrc%2C%20open%20it%20up%20and%20add%20the%20following%20line%2C%20where%3A%0D%0A%0D%0A%0D%0A%20%20%20%20CommandName%20-%20The%20name%20" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;title=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM&amp;notes=A%20simple%20way%20of%20sending%20SQL%20to%20your%20database%20from%20everyone%27s%20favourite%20editor%20Vim%2C%20without%20any%20plugins%20or%20macros.%0D%0A%0D%0AFirstly%20we%20need%20to%20add%20a%20custom%20command%20to%20our%20.vimrc%2C%20open%20it%20up%20and%20add%20the%20following%20line%2C%20where%3A%0D%0A%0D%0A%0D%0A%20%20%20%20CommandName%20-%20The%20name%20" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;h=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;title=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;title=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F&amp;title=How%20To%3A%20Send%20SQL%20commands%20to%20a%20database%20in%20VIM" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2007%2F03%2F29%2Fhow-to-send-sql-commands-to-a-database-in-vim%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2007/03/29/how-to-send-sql-commands-to-a-database-in-vim/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails &#8211; First Impressions</title>
		<link>http://www.davedevelopment.co.uk/2006/08/28/ruby-on-rails-first-impressions/</link>
		<comments>http://www.davedevelopment.co.uk/2006/08/28/ruby-on-rails-first-impressions/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 18:29:15 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/2006/08/28/ruby-on-rails-first-impressions/</guid>
		<description><![CDATA[I&#8217;ve finally gotten around to finishing the basic design on the Broadband affiliate site project I&#8217;ve had ongoing for a while and figured it would be nice to have a backend to add/remove, de-activate all the different packages etc. So, I decided to go crazy and have a look at Ruby on Rails.
Now I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally gotten around to finishing the basic design on the Broadband affiliate site project I&#8217;ve had ongoing for a while and figured it would be nice to have a backend to add/remove, de-activate all the different packages etc. So, I decided to go crazy and have a look at <a href="http://www.rubyonrails.org/">Ruby on Rails</a>.</p>
<p>Now I&#8217;m not extremely well versed with patterns and so on, but I have a decent understanding of the MVC style architecture that seems to be popular these days and I&#8217;ve seen a few tutorials on <a href="http://www.symfony-project.com/">Symfony</a>, a PHP 5 web framework which I believe is fairly similar in nature to Rails, so I figured I&#8217;d get along okay. I feel I was pretty right, in a few hours over today and yesterday I&#8217;ve come out with a working database driven website and administration area running on Ruby on Rails.</p>
<p>Running <a href="http://www.gentoo.org">Gentoo</a>, I always try and use the portage package management tool,  to be double sure on what I needed to do I had a little search on google which led me to <a href="http://wiki.rubyonrails.org/rails/pages/HowtoInstallOnGentooWithApache">this page</a>, and these commands.</p>
<pre class="code">
echo "dev-ruby/rails mysql fastcgi" >> /etc/portage/package.use
emerge -av rails
rails /path/to/app
</pre>
<p>That all went well and I was sat looking at a clean rails application. I fired up the builtin webserver, <a href="http://www.webrick.org/">WEBrick</a>, it worked, so I closed it again. Seeing as I use Apache on all my servers, I wanted to use it for the development aswell. I&#8217;ve never used FastCGI before, but what do you know there was an example virtual host definition in the rails <tt>README</tt> file.</p>
<pre class="code">
  &lt;VirtualHost *:80&gt;
    ServerName rails
    DocumentRoot /path/application/public/
    ErrorLog /path/application/log/server.log

    &lt;Directory /path/application/public/&gt;
      Options ExecCGI FollowSymLinks
      AllowOverride all
      Allow from all
      Order allow,deny
    &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
</pre>
<p>Once again, this worked a treat. I then set about creating my application, which by enlarge went along without many flaws, using a combination of the excellent <a href="http://api.rubyonrails.org/">Rails API</a>, this <a href="http://media.rubyonrails.org/video/rails_take2_with_sound.mov"><em>Create a weblog in 15 minutes</em></a> screencast and <a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html">Rolling with Ruby on Rails</a> as guidance. The biggest problem I had was creating initially trying to create the scaffolds. Not knowing RoR&#8217;s naming conventions, I&#8217;d foolishly named my database tables in the singular form, ie provider rather than providers. After overcoming this, I rolled on pretty nicely.</p>
<p>Using <a href="http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator">this page</a> as guidance I used the login_generator to create a simple admin area, and the scaffolding stuff filled most of the admin pages for me, just a few tweaks here and there were required. The public face was even easier, basically allowing a few different ways to filter the list of broadband packages through one action, &#8216;list&#8217;. </p>
<p>As far as the language Ruby itself goes, I&#8217;ve barely learnt anything, basically because Rails does it all for me. The most complicated things I did code wise, was using a <tt>case</tt> statement to change the filtering on the public packages page and this simple function for turning bytes into a more readable form.</p>
<pre class="code">
        def human_readable(number)
                count = 0
                while number/1024 > 1
                        number = number/1024
                        count += 1
                end

                iec = ['', 'K', 'M', 'G', 'T']
                return number.to_s + iec[count]
        end
</pre>
<p>My only gripe with this so far, is the speed. It does take forever to generate these simple pages, the built in webserver does seem to be a shade quicker, but I&#8217;d still rather use apache. I&#8217;m sure there&#8217;ll be some tweaks I can make to speed the FastCGI module up, but there&#8217;s no rush for that now.</p>
<p>Hopefully I&#8217;ll signup for a few affiliate programs and launch the site properly within the next few days, I don&#8217;t expect to make a fortune but it&#8217;s been a good little learning utility so far and I hope to use it to learn a few things about affiliate marketing.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;title=Ruby%20on%20Rails%20-%20First%20Impressions&amp;bodytext=I%27ve%20finally%20gotten%20around%20to%20finishing%20the%20basic%20design%20on%20the%20Broadband%20affiliate%20site%20project%20I%27ve%20had%20ongoing%20for%20a%20while%20and%20figured%20it%20would%20be%20nice%20to%20have%20a%20backend%20to%20add%2Fremove%2C%20de-activate%20all%20the%20different%20packages%20etc.%20So%2C%20I%20decided%20to%20g" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;title=Ruby%20on%20Rails%20-%20First%20Impressions&amp;notes=I%27ve%20finally%20gotten%20around%20to%20finishing%20the%20basic%20design%20on%20the%20Broadband%20affiliate%20site%20project%20I%27ve%20had%20ongoing%20for%20a%20while%20and%20figured%20it%20would%20be%20nice%20to%20have%20a%20backend%20to%20add%2Fremove%2C%20de-activate%20all%20the%20different%20packages%20etc.%20So%2C%20I%20decided%20to%20g" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;h=Ruby%20on%20Rails%20-%20First%20Impressions" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;title=Ruby%20on%20Rails%20-%20First%20Impressions" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;title=Ruby%20on%20Rails%20-%20First%20Impressions" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F&amp;title=Ruby%20on%20Rails%20-%20First%20Impressions" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F08%2F28%2Fruby-on-rails-first-impressions%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2006/08/28/ruby-on-rails-first-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://media.rubyonrails.org/video/rails_take2_with_sound.mov" length="54364199" type="video/quicktime" />
		</item>
		<item>
		<title>Setting up an adserver</title>
		<link>http://www.davedevelopment.co.uk/2006/05/13/setting-up-an-adserver/</link>
		<comments>http://www.davedevelopment.co.uk/2006/05/13/setting-up-an-adserver/#comments</comments>
		<pubDate>Sat, 13 May 2006 12:15:19 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/2006/05/13/setting-up-an-adserver/</guid>
		<description><![CDATA[I recently set up an adserver, purely so I could split an ad spot on the proxy site between two campaigns, to see which one performs better. 
Installing phpAdsNew, an open-source ad-server, was very easy and their documentation is excellent.
Creating the publishing zone was easy enough, then I had to create the two campaigns. The [...]]]></description>
			<content:encoded><![CDATA[<p>I recently set up an adserver, purely so I could split an ad spot on the proxy site between two campaigns, to see which one performs better. </p>
<p>Installing <a href="http://phpadsnew.com/" title="phpAdsNew">phpAdsNew</a>, an open-source ad-server, was very easy and their documentation is excellent.</p>
<p>Creating the publishing zone was easy enough, then I had to create the two campaigns. The two ad networks I wanted to compare, were <a href="http://www.rightmedia.com/" title="RightMedia">RightMedia</a> and <a href="http://www.bannerconnect.net/" title="BannerConnect">BannerConnect</a>, which both use the yieldmanager software developed by RightMedia. I set these two up as Advertisers, then created a campaign for each. Then under the campaign you create a banner, which I created as HTML banners. Originally I used the standard yieldmanager tags, but this didn&#8217;t seem to work properly, I don&#8217;t think Internet Explorer was rendering the ads. Naturally I didn&#8217;t notice at first, I don&#8217;t do Internet Explorer. After changing to the Raw iFrame tags, I started getting plenty of impressions again and it worked out quite well.</p>
<p>I&#8217;m planning to move a few other ad zones over to the adserver, it makes sense and should help my acquire more money! Next step is to get the geo-targeting going, I&#8217;ve got nothing to geo-target right now, but should come in useful at some stage.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;title=Setting%20up%20an%20adserver&amp;bodytext=I%20recently%20set%20up%20an%20adserver%2C%20purely%20so%20I%20could%20split%20an%20ad%20spot%20on%20the%20proxy%20site%20between%20two%20campaigns%2C%20to%20see%20which%20one%20performs%20better.%20%0D%0A%0D%0AInstalling%20phpAdsNew%2C%20an%20open-source%20ad-server%2C%20was%20very%20easy%20and%20their%20documentation%20is%20excellent.%0D%0A%0D%0ACr" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;title=Setting%20up%20an%20adserver&amp;notes=I%20recently%20set%20up%20an%20adserver%2C%20purely%20so%20I%20could%20split%20an%20ad%20spot%20on%20the%20proxy%20site%20between%20two%20campaigns%2C%20to%20see%20which%20one%20performs%20better.%20%0D%0A%0D%0AInstalling%20phpAdsNew%2C%20an%20open-source%20ad-server%2C%20was%20very%20easy%20and%20their%20documentation%20is%20excellent.%0D%0A%0D%0ACr" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;h=Setting%20up%20an%20adserver" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;title=Setting%20up%20an%20adserver" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;title=Setting%20up%20an%20adserver" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F&amp;title=Setting%20up%20an%20adserver" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F05%2F13%2Fsetting-up-an-adserver%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2006/05/13/setting-up-an-adserver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL 5 Certification</title>
		<link>http://www.davedevelopment.co.uk/2006/03/08/mysql-developer-certification-exams-booked/</link>
		<comments>http://www.davedevelopment.co.uk/2006/03/08/mysql-developer-certification-exams-booked/#comments</comments>
		<pubDate>Wed, 08 Mar 2006 19:04:04 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/2006/03/08/mysql-developer-certification-exams-booked/</guid>
		<description><![CDATA[Over the last few days I&#8217;ve had to send a couple of emails to customer support at Pearson Vue, basically because I couldn&#8217;t find a way of booking any exam except the one I have already passed, the ZCE. Eventually, once I tried using the site in IE, I got a javascript alert telling me [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few days I&#8217;ve had to send a couple of emails to customer support at <a href="http://www.vue.com/" title="Pearson Vue">Pearson Vue</a>, basically because I couldn&#8217;t find a way of booking any exam except the one I have already passed, the ZCE. Eventually, once I tried using the site in IE, I got a javascript alert telling me I needed a seperate web account to register for <a href="http://www.mysql.org" title="MySQL">MySQL</a> exams. Unfortunately, when I tried to create a new web account, I was told that they already had a web account matching my details and would I like them to reset my password!</p>
<p>Anyways, they responded to my second email quite quickly and sure enough I logged in and booked the two <a href="http://www.mysql.com/training/certification/50/" title="MySQL 5 Certifications">MySQL Developer</a> Certification exams, the first on 10th April and the second 8th May. Hopefully this will put me under a bit of pressure and make me pick up the <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&#038;tag=davedvd-21&#038;camp=1634&#038;creative=6738&#038;path=ASIN%2F0672328127%2Fqid%253D1141861211">Certification Guide</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=davedvd-21&amp;l=ur2&amp;o=2" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />  once again.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;title=MySQL%205%20Certification&amp;bodytext=Over%20the%20last%20few%20days%20I%27ve%20had%20to%20send%20a%20couple%20of%20emails%20to%20customer%20support%20at%20Pearson%20Vue%2C%20basically%20because%20I%20couldn%27t%20find%20a%20way%20of%20booking%20any%20exam%20except%20the%20one%20I%20have%20already%20passed%2C%20the%20ZCE.%20Eventually%2C%20once%20I%20tried%20using%20the%20site%20in%20IE%2C%20I" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;title=MySQL%205%20Certification&amp;notes=Over%20the%20last%20few%20days%20I%27ve%20had%20to%20send%20a%20couple%20of%20emails%20to%20customer%20support%20at%20Pearson%20Vue%2C%20basically%20because%20I%20couldn%27t%20find%20a%20way%20of%20booking%20any%20exam%20except%20the%20one%20I%20have%20already%20passed%2C%20the%20ZCE.%20Eventually%2C%20once%20I%20tried%20using%20the%20site%20in%20IE%2C%20I" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;h=MySQL%205%20Certification" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;title=MySQL%205%20Certification" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;title=MySQL%205%20Certification" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F&amp;title=MySQL%205%20Certification" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F08%2Fmysql-developer-certification-exams-booked%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2006/03/08/mysql-developer-certification-exams-booked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBoss and Gentoo</title>
		<link>http://www.davedevelopment.co.uk/2006/03/02/jboss-and-gentoo/</link>
		<comments>http://www.davedevelopment.co.uk/2006/03/02/jboss-and-gentoo/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 10:55:05 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=13</guid>
		<description><![CDATA[After learning and using Java though my 3 years of university, I haven&#8217;t touched the stuff since. Not because I don&#8217;t like it, just because I haven&#8217;t needed to. After a meeting at work the other day I decided to pull my finger out and re-educate myself, particularly towards the enterprise stuff, which they didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>After learning and using Java though my 3 years of university, I haven&#8217;t touched the stuff since. Not because I don&#8217;t like it, just because I haven&#8217;t needed to. After a meeting at work the other day I decided to pull my finger out and re-educate myself, particularly towards the enterprise stuff, which they didn&#8217;t teach me at Uni. If they had I&#8217;d probably be loaded right now.</p>
<p>Finding a <a href="http://www.tusc.com.au/tutorial/html/">tutorial</a>, I sat down at my desktop machine and set about creating my first J2EE application. I&#8217;m a big fan of <a href="http://www.gentoo.org" title="Gentoo">Gentoo</a> Linux and try to use it&#8217;s portage package management as much as possible, making it easy to maintain my system, so rather than download <a href="http://www.jboss.org" title="JBoss">JBoss</a> like the tutorial says, I simply.</p>
<p><code># emerge jboss</code></p>
<p>This went fine, as did firing up jboss and going to the console through my browser. Then I stumbled. Trying to invoke &#8217;startDatabaseManager&#8217; wouldn&#8217;t seem to work. It said it did, but the applet never appeared. An hour later, after customising the deploy XML file for HyperSonic, I was closer to having the database the way it needs to be, but still couldn&#8217;t get the applet to fire up. I googled for a while and found a handful of people having the same problems, but never for the same reason. In the end I gave up. </p>
<p>The thing is, right now I&#8217;m interested in the J2EE side of things, not so much the database, so it&#8217;s kind of annoying getting stuck so early. I&#8217;ll spend some time tonight trying to access the HSQLDB another way, if not I&#8217;ll try and adapt the tutorial to use <a href="http://www.mysql.org" title="MySQL AB">MySQL</a>!</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;title=JBoss%20and%20Gentoo&amp;bodytext=After%20learning%20and%20using%20Java%20though%20my%203%20years%20of%20university%2C%20I%20haven%27t%20touched%20the%20stuff%20since.%20Not%20because%20I%20don%27t%20like%20it%2C%20just%20because%20I%20haven%27t%20needed%20to.%20After%20a%20meeting%20at%20work%20the%20other%20day%20I%20decided%20to%20pull%20my%20finger%20out%20and%20re-educate%20myse" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;title=JBoss%20and%20Gentoo&amp;notes=After%20learning%20and%20using%20Java%20though%20my%203%20years%20of%20university%2C%20I%20haven%27t%20touched%20the%20stuff%20since.%20Not%20because%20I%20don%27t%20like%20it%2C%20just%20because%20I%20haven%27t%20needed%20to.%20After%20a%20meeting%20at%20work%20the%20other%20day%20I%20decided%20to%20pull%20my%20finger%20out%20and%20re-educate%20myse" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;h=JBoss%20and%20Gentoo" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;title=JBoss%20and%20Gentoo" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;title=JBoss%20and%20Gentoo" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F&amp;title=JBoss%20and%20Gentoo" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2006%2F03%2F02%2Fjboss-and-gentoo%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2006/03/02/jboss-and-gentoo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
