<?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>Evilprofessor.co.uk</title>
	<atom:link href="http://www.evilprofessor.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evilprofessor.co.uk</link>
	<description>The website of Steven Lloyd Watkin</description>
	<lastBuildDate>Thu, 26 Aug 2010 23:11:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Zend Framework Body Tag View Helper</title>
		<link>http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/</link>
		<comments>http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 23:13:28 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Registry]]></category>
		<category><![CDATA[Zend_View_Helper]]></category>
		<category><![CDATA[Body]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[view helper]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[Zend_View_Helper_Placeholder_Container_Standalone]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=311</guid>
		<description><![CDATA[Summary Here I discuss the creation of a view helper for modifying HTML tags, and more specifically body tags. The created view helper allows functionality similar to the head*/inlineScript view helpers already in the standard Zend Framework view helpers, but allows the programmatic modification of tag attributes. Definitely check out the demo page and the [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_320" class="wp-caption alignright" style="width: 222px"><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2010/08/422213306_02bcf3f7d2_m.jpg"><img class="size-full wp-image-320 " title="Photo from  http://www.flickr.com/photos/daniello/" src="http://www.evilprofessor.co.uk/wp-content/uploads/2010/08/422213306_02bcf3f7d2_m.jpg" alt="Photo from  http://www.flickr.com/photos/daniello/" width="212" height="300" /></a><p class="wp-caption-text">Photo from http://www.flickr.com/photos/daniello/</p></div>
<h2>Summary</h2>
<p>Here I discuss the creation of a view helper for modifying HTML tags, and more specifically <a href="http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/" class="kblinker" title="More about body tag &raquo;">body tags</a>. The created view helper allows functionality similar to the head*/inlineScript view helpers already in the standard <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a> view helpers, but allows the programmatic modification of tag attributes. Definitely check out the demo page and the code on github.</p>
<h2>Motivation</h2>
<p>The standard Zend Framework view helpers are a great set of tools for streamlining mundane view tasks and allowing for the modification/addition of scripts and header blocks (generally held in the layout) from within the view without applying ugly hacks (i.e. the head*/inlineScript view helpers).</p>
<p>Upon occasion I have found need to make modifications to the &lt;body&gt; tag, for example adding an <em><a title="body onload attribute" href="http://www.w3schools.com/jsref/event_body_onload.asp" target="_blank">onload</a>, class, </em>or <em>style </em>attribute etc. I also required to be able to perform this from within other view helpers. Take this following contrived example&#8230;</p>
<blockquote><p>On website X, certain pages include standard <a href="http://www.dojotoolkit.org/" class="kblinker" target="_blank" title="More about Dojo &raquo;">dojo</a> forms. These dojo forms are held within view helpers for convenience. Generally it has been decided not to include the dojo <a href="http://www.w3schools.com/css/css_intro.asp" class="kblinker" target="_blank" title="More about CSS &raquo;">CSS</a> classes in the body tag and only add them when necessary. There maybe several view helpers on the page that need to add their own attributes to the body tag.<em> (I said it was contrived)</em></p></blockquote>
<p>The code is available in my GIT repository @ <a title="Body tag view helper @ github" href="http://github.com/lloydwatkin/Demos/tree/master/zendframework/abstracttag/" target="_blank">github</a> and the <a title="Body Tag View Helper Demo" href="http://www.evilprofessor.co.uk/uploads/php/zendframework/abstracttag/demo.php" target="_blank">demo page</a>.<br />
<span id="more-311"></span></p>
<h2>How it works</h2>
<p>When creating the body tag view helper I soon realised that most of the code was not specific to what I was developing so I pulled out the common functionality into an abstract class.  By concreting the  abstract class it is possible to modify any tag in the same way as the body tag discussed here making the code much more versitile.</p>
<p>Underneath the hood (so to speak) the code is based on that of the head* and the inlineScript view helpers. It utilises Zend_View_Helper_Placeholder_Container_Standalone to store the attributes and their values until they are required. The container itself uses <a href="http://framework.zend.com/manual/en/zend.registry.html" class="kblinker" target="_blank" title="More about Zend_Registry &raquo;">Zend_Registry</a> to store values under the key defined in the class (if you look at the <a href="http://www.phpunit.de/" class="kblinker" target="_blank" title="More about unit test &raquo;">unit tests</a> I clear the registry down after each test).</p>
<p>The code would fit in well with the &#8220;<a href="http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" class="kblinker" title="More about Naked Zend_Layout and Zend_View &raquo;">Naked Zend_Layout and Zend_View</a>&#8221; code I wrote about a couple of weeks ago or as part of the standard Zend Framework <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" class="kblinker" target="_blank" title="More about MVC &raquo;">MVC</a> install.</p>
<p><strong>Usage</strong></p>
<p>The class should be very simple to use. Firstly two entries are required within your layout script as follows:</p>
<pre class="php" name="code" type="code">&lt;?php echo $this-&gt;bodyTag() ?&gt;
&lt;?php echo $this-&gt;bodyTag()-&gt;toString(Pro_View_Helper_AbstractTag::CLOSE) ?&gt;</pre>
<p>Note: You&#8217;ll need to change the class name should you move the view helper to your own library. Obviously the constant is available through the implementation (bodyTag) as well as through the abstract class.</p>
<p>An example of making changes to your body tag using the view helper to echo &lt;body class=&#8221;nihilo myclass&#8221; style=&#8221;text-align-left; width: 80em&#8221;&gt; is:</p>
<pre class="php" name="code" type="code">&lt;?php
$this-&gt;bodyTag('class', 'nihilo')
    -&gt;bodyTag('style', 'text-align: left')
    -&gt;bodyTag('style', 'width: 80em', false, ';')
    -&gt;bodyTag('class', 'myclass')
?&gt;</pre>
<p>This can be done throughout the view file, in several view helpers, and in the layout file (provided its before the body tag is written out). Attributes can be removed/overwritten whilst values can be added and appended (separator can be passed). If the same attribute value is passed several times only a single copy is written with the attribute.</p>
<p>For a full demo either fork the github repository and run the demo.php file in your own browser, or alternatively visit <a title="Body tag view helper demo" href="http://www.evilprofessor.co.uk/uploads/php/zendframework/abstracttag/demo.php" target="_blank">this page</a> to see it in action. Usage of the <a href="http://github.com/lloydwatkin/Demos/blob/master/zendframework/abstracttag/demo.php" target="_blank">demo.php</a> script assumes you have the Zend Autoloader (or similar) already setup.</p>
<h2>Creating your own Tag helper</h2>
<p>To implement your own view helper simply extend the abstract tag class and overwrite the following class properties:</p>
<ul>
<li><em>$_regKey</em>: A unique key for the tag (used for Zend_Registry)</li>
<li><em>$_validAttributes</em>: An array of valid attribute names, should be lowercase to comply with <a href="http://www.w3.org/" class="kblinker" target="_blank" title="More about w3c &raquo;">W3C</a></li>
<li><em>$_selfClosing</em>: Boolean value to specify if tag is self closing or not, e.g. <strong>&lt;br/&gt;</strong></li>
<li><em>$_tagName</em>: Name of the tag (i.e. <strong>body</strong> in this example)</li>
</ul>
<p>So, finally the code for the bodyTag view helper itself, its very compact:</p>
<pre class="php" name="code" type="code">/**
 * View helper for the body tag
 *
 * @author     Lloyd Watkin
 * @since      21/08/2010
 * @package    Pro
 * @subpackage ViewHelper
 */
class Pro_View_Helper_BodyTag
    extends Pro_View_Helper_AbstractTag
{
    /**
     * Registry key for placeholder
     *
     * @var string
     */
    protected $_regKey = 'Pro_View_Helper_BodyTag';

    /**
     * Which attributes are valid
     *
     * Currently only STF attributes supported
     * (S = STRICT, T = TRANSITIONAL, F = FRAMESET)
     *
     * @see http://www.w3schools.com/tags/tag_body.asp
     * @var array
     */
    protected $_validAttributes = array(
        /* Standard Attributes */
        'class', 'dir', 'id', 'lang', 'style', 'title', '<a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">xml</a>:lang',
        /* Event Attributes */
        'onclick', 'ondblclick', 'onload', 'onmousedown', 'onmousemove',
        'onmouseout', 'onmouseover', 'onmouseup', 'onkeydown', 'onkeypress',
        'onkeyup', 'onunload',
    );

    /**
     * Self closing tag?
     *
     * @var boolean
     */
    protected $_selfClosing = false;    

    /**
     * Tag name
     *
     * @var string
     */
    protected $_tagName = 'body';
}</pre>
<p>If you take a look at the repository there&#8217;s also a group of unit tests that fully cover the functionality. The unit tests are written in <a href="http://www.phpunit.de/" class="kblinker" target="_blank" title="More about phpunit &raquo;">PHPUnit</a> and are in the <a href="http://github.com/lloydwatkin/Demos/blob/master/zendframework/abstracttag/BodyTagTest.php" target="_blank">BodyTagTest.php</a> file.</p>
<h2>Finally&#8230;</h2>
<p>Here I&#8217;ve shown you my implementation of an abstract tag abstract view helper (eek) and its body tag implementation. Whilst the javaScript functionality can be implemented in other ways (other than hard coding at output time) other things can&#8217;t (without javaScript that is) without changing other parts of the application. I hope you find the classes helpful in your application&#8230;</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Body+Tag+View+Helper+http://is.gd/ev6oC" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Body+Tag+View+Helper+http://is.gd/ev6oC" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Body+Tag+View+Helper+http://is.gd/ev6oC" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Body+Tag+View+Helper+http://is.gd/ev6oC" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;submitHeadline=Zend+Framework+Body+Tag+View+Helper" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;submitHeadline=Zend+Framework+Body+Tag+View+Helper" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;t=Zend+Framework+Body+Tag+View+Helper" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;t=Zend+Framework+Body+Tag+View+Helper" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;t=Zend+Framework+Body+Tag+View+Helper" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;t=Zend+Framework+Body+Tag+View+Helper" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Body+Tag+View+Helper&amp;link=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Body+Tag+View+Helper&amp;link=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/&amp;title=Zend+Framework+Body+Tag+View+Helper" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/311-zend-framework-body-tag-view-helper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick Start Symfony DI (Dependency Injection) Tutorial</title>
		<link>http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/</link>
		<comments>http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 14:21:35 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Dependency Injection Container]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Cache]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[di]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ini]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[IOC]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yaml]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=264</guid>
		<description><![CDATA[What is Dependency Injection (DI)? Dependency injection is a technique that allows for loosely coupled objects within a software application. Generally if an object requires access to the functionality of another it would be instantiated internally leading to tightly coupled systems. By implementing dependency injection we inject the required objects ready for use (sometimes also [...]]]></description>
			<content:encoded><![CDATA[<h2>What is <a href="http://en.wikipedia.org/wiki/Dependency_injection" class="kblinker" target="_blank" title="More about Dependency Injection &raquo;">Dependency Injection</a> (DI)?</h2>
<p>Dependency injection is a technique that allows for loosely coupled objects within a software application. Generally if an object requires access to the functionality of another it would be instantiated internally leading to tightly coupled systems. By implementing dependency injection we inject the required objects ready for use (sometimes also referred to inversion of control &#8211; IOC). Take the following example:</p>
<pre class="php" type="code" name="code">&lt;?php
class DecisionMaker {
    public function makeDecision(array $parameters) {
        // Need the database adapter
        $dp = new DecisionParameters();
        $parameterScore = $dp-&gt;getScore($parameters);
        /* ... Some more decision logic ... */
        return ($parameterScore &gt; 50);
    }
}</pre>
<p>This piece of code is said to be tightly coupled to the <em>DecisionParameters</em> object. Rewriting the above in a loosely coupled fashion we&#8217;d have something like&#8230;.</p>
<pre class="php" type="code" name="code">&lt;?php
class DecisionMaker {
    private $_dp;
    public function __construct($dp) {
        $this-&gt;_dp = $dp;
    }
    public function makeDecision(array $parameters) {
        $parameterScore = $this-&gt;_dp-&gt;getScore($parameters);
        /* ... Some more decision logic ... */
        return ($parameterScore &gt; 50);
    }
}</pre>
<p>Whilst gaining the benefits of loosely coupled code we are adding complexity such that each time an object is instantiated we also have to instantiate its dependencies and pass these in too. For example, this:</p>
<pre class="php" type="code" name="code">$choice = new DecisionMaker();
echo $choice-&gt;makeDecision(array('effort' =&gt; 'low', 'return' =&gt; 'high'));</pre>
<p>now becomes:</p>
<pre class="php" type="code" name="code">$dp = new DecisionParameters();
$choice = new DecisionMaker($dp);
echo $choice-&gt;makeDecision(array('effort' =&gt; 'low', 'return' =&gt; 'high'));</pre>
<p>This situation becomes more painful as the number of dependencies for a class is increased, and what if the dependencies themselves have dependencies? This can quite quickly become an object administration nightmare! Enter dependency injection containers (or frameworks)&#8230;<br />
<span id="more-264"></span></p>
<h2>Dependency Injection Containers/Frameworks</h2>
<p>Dependency injection containers (or frameworks) handle the process of object creation; instantiating and injecting any dependencies before returning an instance to the caller.</p>
<p>In your code rather than create new objects directly we request a copy of the object from the DI container. The object we are returned already has  all its dependencies injected and the object is ready to go.</p>
<h3><a href="http://www.symfony-project.org/" class="kblinker" target="_blank" title="More about Symfony &raquo;">Symfony</a> Dependency Injection Container</h3>
<p>Symfony is probably best known for their full stack <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" class="kblinker" target="_blank" title="More about MVC &raquo;">MVC</a> framework however they have also released a number of the components that can be used independently. For example, the dependency injection container we&#8217;re going to talk about here, a <a href="http://www.yaml.org/" class="kblinker" target="_blank" title="More about yaml &raquo;">YAML</a> parser, a templating engine, see <a href="http://components.symfony-project.org/" class="kblinker" target="_blank" title="More about symfony components &raquo;">Symfony components</a> for more.</p>
<p>The Symfony DI container is based on that from the <a href="http://en.wikipedia.org/wiki/Spring_Framework" class="kblinker" target="_blank" title="More about spring framework &raquo;">Spring Framework</a> in <a href="http://www.java.com/en/" class="kblinker" target="_blank" title="More about java &raquo;">Java</a>.</p>
<h2>Bootstrapping</h2>
<p>In order to bootstrap the Symfony dependency injection framework we use code as included below. I have chosen to use YAML just because its easy to read and setup. For maximum speed you may want to write out your containers to plain <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> (the Symfony container can do this for you once setup), or alternatively cache the whole container using <a href="http://framework.zend.com/manual/en/zend.cache.html" class="kblinker" target="_blank" title="More about Zend_Cache &raquo;">Zend_Cache</a>, or similar.</p>
<p>To install Symfony DI follow the instructions included here <a href="http://components.symfony-project.org/dependency-injection/installation">http://components.symfony-project.org/dependency-injection/installation</a>, and add it to your path.</p>
<pre class="php" type="code" name="code">// Load the Symfony DI container
require 'sfServiceContainerBuilder.php';
$container = new sfServiceContainerBuilder();
$loader = new sfServiceContainerLoaderFileYaml($container);
$loader-&gt;load(APPLICATION_PATH . '/config/di/services.yml');</pre>
<p>Firstly we instantiate a new container, and then we load our configuration from a YAML file. Note: the DI container can load config from several formats such as <a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">XML</a>, YAML, PHP, and INI*.  I tend to include a single YAML file and import other files from within there.</p>
<p>Several configuration files can be imported using different formats, the newer definitions overwriting those that have already been defined. Configuration files can include references to objects and parameters.</p>
<p><em>*INI is only able to define parameters and is unable to import other files</em></p>
<h2>Configuration Example</h2>
<pre>imports:
  - { resource: daos.yml }

parameters:
  username: false

services:
  # Customer model
  model.customer:
    class:  Pro_Customer
    calls:
      - [ setLogger, [ @utils.logger ] ]
      - [ setDao, [ @data.userdata.mysql ] ]
      - [ setUserName, [ %username% ] ]

  # Product model
  model.product:
    class:  Pro_Product
    arguments: [%username%, { type: %accesslevel%, lastlogin: %lastlogin% } ]
    calls:
     - [ setDao, [ @data.product.mysql ] ]

  # Logger
  utils.logger:
    class: Pro_Logger
    constructor: getInstance
    calls:
      - [ setHandle, [ @utils.filewriter ] ]</pre>
<p>I think the code above is fairly self explanatory but for clarity I&#8217;ll explain each part now.</p>
<p>First off we define some imports (i.e. other files to parse), I like to group my configurations for example DAOs in one file, utilities in another and name the file appropriately. Whilst a little slower it speeds up the maintenance of the configuration files. Its also possible to parse files of other formats using different import flags. Files are parsed in order with newer definitions overwriting or amending previously defined services/parameters.</p>
<p>Next we define a parameter, a parameter can generally be any PHP variable type. At this point I didn&#8217;t  know what my username parameter should be (I need to authenticate for that!), so I&#8217;ve defined a default value and I&#8217;ll overwrite that value later. Note, classes aren&#8217;t instantiated until you ask for them so defining parameters a little later is perfectly fine. Following this I define some services:</p>
<ol>
<li>Instantiate Pro_Customer, pass an instance of my logger to the setLogger() method, add in my <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">MySQL</a> <a href="http://en.wikipedia.org/wiki/Data_access_object" class="kblinker" target="_blank" title="More about data access object &raquo;">data access object</a> (DAO), and pass in the username as well. Each time I ask for this object I want a new instance</li>
<li>Create an instance of Pro_Product, pass arguments of username and an options array to the constructor. After instantiation call setDao() and pass it my product DAO</li>
<li>Give me a copy of Pro_Logger, instantiate it using the getInstance() method and pass a copy of my file writer object via setHandle() once its loaded. My file writer is defined in one of my imports.</li>
</ol>
<p>Within the configuration files <em>services</em> are referenced by prepending the name with an &#8216;@&#8217; symbol, <em>parameters</em> are referenced by prepending and appending with &#8216;%&#8217; symbols, e.g. <em>@utils.logger %username%</em>.</p>
<h2>Adding data post loading</h2>
<p>Sometimes you don&#8217;t know what the value of parameters should be until after you have bootstrapped, as with our <em>username</em> parameter above. In order to overwrite the value the <em>offsetSet()</em> method is used, firstly passing the parameter name followed by its new value:</p>
<pre class="php" type="code" name="code">$container-&gt;offsetSet('username', $username);</pre>
<h2>Getting Objects from the container</h2>
<p>Once setup rather than instantiating objects directly we now go to the DI container to get instances. With the Symfony DI we call the <em>getService() </em>method, passing in a string which describes the variable you wish to retrieve, e.g.</p>
<pre class="php" type="code" name="code">$logger = $container-&gt;getService('utils.logger');</pre>
<p>This will perform the equivalent of:</p>
<pre class="php" type="code" name="code">$logger = Pro_Logger::getInstance();
$fileWriter = new Pro_Writer_FileWriter();
$logger-&gt;setHandler($fileWriter);</pre>
<p>It is possible to determine if the container has an instance of a service by calling the <em>hasService()</em> method, which returns a boolean value.</p>
<p>Its not necessary to have access to the container beyond the top level of your application since once retrieving an instance all of the required dependencies right down to the deepest depths of your application are already setup and waiting to be called.</p>
<h2>Unit Testing</h2>
<p>Dependency injection also has the added benefit of allowing objects to be tested in isolation. Taking the <em>DecisionMaker</em> class example before implementing the dependency injection setup our test results were also dependent on the implementation of the <em>DecisionParameters</em> class.</p>
<p>Should the <em>DecisionParameters</em> class return different results our tests could start failing through no fault of our own. Using dependency injection we can now pass in a <em>DecisionParameters</em> object which returns a known/fixed set of results for certain input parameters, we are now testing <em>DecisionMaker</em> in isolation from any external factors, i.e. if our tests start failing this can be directly attributed to something changing in the <em>DecisionMakeer</em> class. This is particularly important should you be relying on test data from a database for testing.</p>
<h2>Application Configuration</h2>
<p>The way in which your application behaves on your production server will inevitably differ from your development setup. For example, in a development environment the level of logging would be much more granular than on your production system. By altering your dependency injection container configuration files slightly (or parsing an additional configuration file) the altering of behaviour depending on the environment is made simple.</p>
<p>By type hinting on interfaces rather than implementations when setting your dependencies its also possible to swap out components for compatible components with a few lines of YAML or XML. For instance, you may currently access your database via a MySQL DAO (Data Access Object), but in time you may develop a PDO, Zend_Db, or Doctrine implementation of this DAO. By adding the new implementation into your configuration file suddenly all the objects that used the old MySQL implementation are now using your new implementation without needing to attack the bowels of your application.</p>
<h2>Notes</h2>
<ul>
<li>By setting <em>shared: true</em> in the configuration we are always given the same instance of an object. This is very useful when dealing with objects which contain resources such as database connections, file handles, etc</li>
<li>There are two methods by which dependencies can be injected. One is to pass dependencies with the constructor, or alternatively via setter methods. The generally accepted pattern is to pass required dependencies via the constructor and optionals via setters. My personal preference is to use setters for everything, but this is down to the individual developer</li>
</ul>
<h2>Finally&#8230;.</h2>
<p>Along with a brief discussion on dependency injection and its advantages and disadvantages this has also been a quick-start guide to implementing the Symfony Dependency Injection Container&#8230; hopefully you&#8217;ve seen that it&#8217;s surprisingly quick and easy. From here you&#8217;ll be able to start using dependency injection through your application and look to using many more of the advanced features (although the simple example covers the vast majority of functionality you&#8217;ll require). As always I point you to the <a title="Symfony DI container manual" href="http://components.symfony-project.org/dependency-injection/documentation" target="_blank">manual</a> for further information.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial+http://is.gd/eFBct" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial+http://is.gd/eFBct" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial+http://is.gd/eFBct" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial+http://is.gd/eFBct" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;submitHeadline=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;submitHeadline=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;t=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;t=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;t=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;t=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial&amp;link=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial&amp;link=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/&amp;title=Quick+Start+Symfony+DI+%28Dependency+Injection%29+Tutorial" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/264-quick-start-symfony-di-dependency-injection-tutorial/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Naked Zend_Layout and Zend_View</title>
		<link>http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/</link>
		<comments>http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 23:47:28 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Layout]]></category>
		<category><![CDATA[Zend_View]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[view helper]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend_layout]]></category>
		<category><![CDATA[zend_view]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=269</guid>
		<description><![CDATA[In this article I look at using Zend_Layout and Zend_View along with a simple front controller to show how it is possible to start separating business logic and presentation within your application. All code is available on github: Naked Zend_Layout and Zend_View on GitHub. MVC A common design pattern for modern web applications is the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>In this article I look at using Zend_Layout and Zend_View along with a simple front controller to show how it is possible to start separating business logic and presentation within your application. All code is available on github:<br />
<a title="Naked Zend_Layout and Zend_View" href="http://github.com/lloydwatkin/Demos/tree/master/view/" target="_blank">Naked Zend_Layout and Zend_View on GitHub</a>.</p></blockquote>
<h2><span id="more-269"></span></h2>
<h2><a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" class="kblinker" target="_blank" title="More about MVC &raquo;">MVC</a></h2>
<p>A common <a href="http://www.evilprofessor.co.uk/category/internet/design-patterns/" class="kblinker" title="More about design pattern &raquo;">design pattern</a> for modern web applications is the MVC pattern. The <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a> in &#8216;full stack&#8217; mode is one implementation of MVC in <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> and consists of three parts:</p>
<ul>
<li>Model (M)</li>
<li>View (V)</li>
<li>Controller (C)</li>
</ul>
<p>The pattern is designed such that business and presentation logic are completely separated from one another (with business logic in the model, and presentation in the view) and the controller sitting in the middle conducting the &#8220;orchestra&#8221;.</p>
<h2>Presentation and Logic</h2>
<p>In the Zend Framework the view  is handled by two main components: <strong>Zend_View</strong> and<strong> Zend_Layout</strong>. Zend_Layout as the name suggests looks after the layout  aspect of the site (generally headers, footers, sidebars, etc). Zend_View focusses on presenting the data that your model has been working to produce or derive.</p>
<p>As developers, and their applications, evolve we tend to move through various stages, generally each an improvement on the previous, improving maintainability and extensibility. One of the main issues is that presentation and logic still get intermingled and its not simple to start separating the two.</p>
<h4>What&#8217;s wrong with mixing the two?</h4>
<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2010/08/ostrich-0776.jpg"><img class="alignright size-thumbnail wp-image-271" style="margin: 5px;" title="Ostrich" src="http://www.evilprofessor.co.uk/wp-content/uploads/2010/08/ostrich-0776-150x150.jpg" alt="Ostrich" width="225" height="225" /></a>There&#8217;s several reasons why mixing different parts of the application, for example a designer working on your site may not want to (or have the knowledge) to scan around in code trying to work out where to make presentation changes. In the same way a developer (if you&#8217;re like me who has the design skills of an ostrich) may break out in a cold sweat when you mention design or UI work.</p>
<p>Additionally what if later you would like to present your sites on different media, such as mobile telephones, tablet PCs, or expose the data via web services (XML/JSON/etc)? Having mixed presentation and logic you stand almost no hope without some very ugly hacks to pull the presentation back out of your code, before injecting something new. If data and presentation has been separated making these changes are almost trivial, create a new view script for the new format and direct requests as appropriate.</p>
<h2>Separating the two</h2>
<p>In an evolving application its not always economical to start implementing a full MVC solution and the application needs to be migrated slowly &#8211; sometimes running old code in parallel with new. It maybe that there are masses of logic (such as database connection setup, authentication, cookie handling, etc) that aren&#8217;t ready for moulding to your chosen frameworks setup, therefore old and known-to-be-working code can continue to be used until such time it can be rewritten/refactored.</p>
<p style="padding-left: 30px;"><em>Note: Using Zend_Layout and Zend_View like this is perfectly acceptable within the Zend Framework landscape and the framework has been designed such that individual components can be used without the rest of the framework. A great advantage in evolving applications and probably one of the major reasons for its high uptake in enterprise applications.</em></p>
<h2>Front Controller</h2>
<p>Below I create a front controller  - a single file designed to pick up any requests which are not matched to a file on the file-system. This is often achieved using a .htaccess file such as the one used in the default Zend Framework install. Within the front controller I will be setting up our layout and view and showing where the different parts of the application slip into it.</p>
<pre class="php">define('APP_PATH', dirname(__FILE__). '/..');
// Start buffering output
ob_start();

// Create a Zend_View instance
Zend_Layout::startMvc();
$layout = Zend_Layout::getMvcInstance();
$layout-&gt;setLayoutPath(APP_PATH . '/layout/scripts')
    -&gt;setViewSuffix('phtml')
    -&gt;setLayout('index');

$view = $layout-&gt;getView()
    -&gt;setScriptPath(APP_PATH . '/view/scripts')
    -&gt;addHelperPath(APP_PATH . '/library/Zend/View/Helper', 'Zend_View_Helper');

// Set Base URL - ok *almost* naked, but you don't need this!
Zend_Controller_Front::getInstance()-&gt;setBaseUrl($_SERVER['HTTP_HOST']);

try {
    /**
     * Perform some application routing...
     *  - Could be using this as a front controller and directing all requests
     *    through this one file (provided file does not exist in file system
     *  - Note the method below is only really for demonstration, it would be
     *    horrible with a large site
     */
    switch ($_GET['page']) {
    	case 'index':
    	case 'exception':
    		$pageName = $_GET['page'];
    		break;
    	default:
    		$pageName = false;
    		break;
    }
    // Example of a page not being found...
    if (false === $pageName) {
        $responseHeader = 'HTTP/1.1 404 Page Not Found';
        throw new Exception('Page not Found');
    }

    /**
     * Add data to your view object here
     *   You may have your own controller implementation or some includes files
     *   where business logic is partly separated from view logic
     */
    $view-&gt;displayText = 'Hello from Lloyd';
    $view-&gt;buttonText  = 'I\'m not active!';

	$layout-&gt;content = $view-&gt;render("{$pageName}.phtml");
    echo $layout-&gt;render();
} catch (Exception $e) {
	// Clean out already buffered content - we don't want to display that!
	ob_clean();
    if (!isset($responseHeader)) {
    	$responseHeader = 'HTTP/1.1 500 Internal Server Error';
    }
    header($responseHeader);
    $view-&gt;exception = $e;
    $layout-&gt;content = $view-&gt;render('error.phtml');
    echo $layout-&gt;render();
}</pre>
<p>Firstly we start output buffering, by doing this we can set our headers at any point in the request and know that it is possible to send them. Should an exception be thrown at any stage of the code execution we clean this buffer and write out or error message content and layout. This ensures that we do not deliver part rendered content containing errors to the end user.</p>
<p>Next a new MVC instance of Zend_Layout is generated and we tell it that out <a href="http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" class="kblinker" title="More about layout script &raquo;">layout scripts</a> have the extension phtml, are to be found in a directory outside of the public path, and that our default layout is called index(.phtml). From the layout we then extract the view object (to which we set our data to be presented) and apply similar setup.</p>
<p>Next we setup the view object with a reference to the default Zend_View helpers. View helpers are sets of additional convenience functionality. For example, writing out a float in monetary format, or creating a zebra striped table (they can be read about <a title="Zend_View Helpers" href="http://framework.zend.com/manual/en/zend.view.helpers.html" target="_blank">here</a>). By extending Zend_View_Helper_Abstract and adding your own library at this point its possible to use your own application view helpers.</p>
<p>The rest of the application code is now wrapped in a try {} catch {} block. Should anything throw an uncaught exception we can catch it and display a nice error message to the end user.</p>
<p>Our first task within the try {} catch {} is to route our request, what does the user want to see? Here I&#8217;ve implemented some very simple demonstration code where I check the value of the &#8216;page&#8217; get variable. Your routing can be very much more complex. The routing is used to call what ever code needs to be executed to get/handle data provided by the user and to tell the system what view (and possibly layout script) to use.</p>
<p>Ultimately if our router does not match any page it sets a 404 response code and displays a nice page not found message to the end user. Here, we throw and catch our own exception (and a very generic exception at that) but probably you&#8217;d be throwing your own exception from within the router code.</p>
<p>Once we&#8217;ve successfully routed our request we can begin to do something with the code. It might be that you have your own controllers/models implemented or you include some code that&#8217;s already been separated somewhat. Here I set a couple of simple variables to the view object.</p>
<p>Once this is completed we simply render the views with our data. If the code throws an uncaught exception for any reason this is trapped near the bottom of the script. Here we clear already buffered output, set a 500 response header, and tell our application to render the &#8216;error&#8217; view script (which is generally a much stripped down version of the normal layout/view and logs the error for checking later).</p>
<p>As the view is rendered first and injected into the layout it is possible to change the layout from within the view, and indeed set required extras, for example,</p>
<ul>
<li>Page title</li>
<li>Meta tags</li>
<li>Scripts (URLs or code) into the &amp;lt;head&amp;gt; section</li>
<li>Add additional styles, etc</li>
</ul>
<p>Additionally its even possible to change the entire layout from within the view by using&#8230;</p>
<pre class="php">&lt;?php $this-&gt;layout()-&gt;setLayout('alternativeLayout') ?&gt;</pre>
<p>&#8230;as and when required.</p>
<h2>Finally&#8230;</h2>
<p>I hope this has been a useful introduction to Zend_Layout and Zend_View and it will enable you to start implementing your own basic MVC and improve the maintainibility/extensibility of your code. Please take a look at the source code for examples of usage (see the README file for instructions).</p>
<p><strong>The code assumes that you&#8217;ve already got autoloading working (or you have included the required classes).  In addition, I would not recommend that you implement the routing or data setting as above, this is very much simplified for demonstration. To see the full code take a look at the source code linked at the top of this article.</strong></p>
<p><strong>Zend Framework version: 1.10.6</strong></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Naked+Zend_Layout+and+Zend_View+http://is.gd/ehfqu" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Naked+Zend_Layout+and+Zend_View+http://is.gd/ehfqu" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Naked+Zend_Layout+and+Zend_View+http://is.gd/ehfqu" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Naked+Zend_Layout+and+Zend_View+http://is.gd/ehfqu" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;submitHeadline=Naked+Zend_Layout+and+Zend_View" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;submitHeadline=Naked+Zend_Layout+and+Zend_View" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;t=Naked+Zend_Layout+and+Zend_View" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;t=Naked+Zend_Layout+and+Zend_View" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;t=Naked+Zend_Layout+and+Zend_View" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;t=Naked+Zend_Layout+and+Zend_View" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Naked+Zend_Layout+and+Zend_View&amp;link=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Naked+Zend_Layout+and+Zend_View&amp;link=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/&amp;title=Naked+Zend_Layout+and+Zend_View" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework Per Module Layout Settings &#8211; Follow Up</title>
		<link>http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/</link>
		<comments>http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:48:44 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=242</guid>
		<description><![CDATA[As a follow up to my previous post on per module based layout settings for Zend Framework, I&#8217;ve updated the code to require less configuration then before (not that it required more that a few lines in your application configuration!). Again we make use of a Zend Controller Action Helper invoking it from the bootstrap [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow up to my previous post on <a title="Per Module Based Layout Settings - Zend Framework" href="http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/" target="_blank">per module based layout settings</a> for <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a>, I&#8217;ve updated the code to require less configuration then before (not that it required more that a few lines in your application configuration!).<br />
<span id="more-242"></span><br />
Again we make use of a <a title="Zend Controller Action Helper" href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html" target="_blank">Zend Controller Action Helper</a> invoking it from the bootstrap as follows:</p>
<pre class="php" name="code">
    /**
     * Sets up <a href="http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" class="kblinker" title="More about layout script &raquo;">layout scripts</a> on a per-module basis
     */
    protected function _initLayoutHelper()
	{
	    $this-&gt;bootstrap('frontController');
	    $layout = Zend_Controller_Action_HelperBroker::addHelper(
	        new Pro_Controller_Action_Helper_SetLayoutPath(APPLICATION_PATH));
	}
</pre>
<p>Almost exactly the same as before except this time we pass the constant <strong>APPLICATION_PATH</strong> into the constructor as our base path.</p>
<p>Next the controller action helper itself now looks as follows:</p>
<pre class="php" name="code">
/**
 * Sets the layout path on a per-module basis
 *
 * @author     Lloyd Watkin
 * @since      16/02/2010
 * @package    Pro
 * @subpackage Controller_Action_Helper
 */

/**
 * Sets the layout path on a per-module basis
 *
 * @author     Lloyd Watkin
 * @since      16/02/2010
 * @package    Pro
 * @subpackage Controller_Action_Helper
 */
class Pro_Controller_Action_Helper_SetLayoutPath
    extends Zend_Controller_Action_Helper_Abstract
{
	/**
	 * Base path
	 *
	 * @var string
	 */
	protected $_path;

	/**
	 * Construct
	 *
	 * @param string $path
	 */
	public function __construct($path)
	{
	    $this-&gt;setBasePath($path);
	}

	/**
	 * Set base path
	 *
	 * @param string $path
     */
	public function setBasePath($path)
	{
		if (!is_string($path) || empty($path)) {
			throw new Exception('Excepted string for base path');
		}
		$this-&gt;_path = $path;
	}

	/**
	 * Get the base path
	 *
	 * @return string
	 */
	protected function _getBasePath()
	{
		if (is_null($this-&gt;_path)) {
			if (!defined('APPLICATION_PATH')) {
				throw new Exception('Base path can not be determined');
			}
			$this-&gt;_path = APPLICATION_PATH;
		}
		return $this-&gt;_path;
	}

    /**
     * Sets layout path based on module
     */
    public function preDispatch()
    {
    	$module = preg_replace(
    	    '/[^A-Z]/i', '', $this-&gt;getRequest()-&gt;getModuleName()
    	);

	    if ($bootstrap = $this-&gt;getActionController()
	                       -&gt;getInvokeArg('bootstrap')) {

	        $view = $bootstrap-&gt;getResource('view');
	        $layoutPath = $this-&gt;_getBasePath() .
	            "/modules/{$module}/layouts/scripts/";

	        /* If layout directory exists then apply it, otherwise just fall
	         * back on the default
	         */
	        if (is_dir($layoutPath)) {
	            $this-&gt;getActionController()
	                 -&gt;getHelper('layout')
	                 -&gt;setLayoutPath($layoutPath);
	            $view-&gt;headLink()-&gt;appendStylesheet(
	                "/styles/{$module}/style.css"
	            );
	        }
    	}
    }
}
</pre>
<p>Note the passing of our base path (cf. APPLICATION_PATH) in the constructor, we also have a getter and setter for the base path. Unlike the previous version of the code if the layouts path does not exist then the code will fall back the default layout path. If the base path is not set it will try to determine the base path from the constant APPLICATION_PATH, otherwise an exception is thrown. I&#8217;ve also cheekily thrown in a module-based style sheet for good measure</p>
<p>The module based layout is determined from whether the layout script path exists (obviously this method can be changed easily). This does add a little overhead from the application.ini setup (however if the layout path exists <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> will cache the result for performance*) but in return you gain the <em>added convenience</em> of more easily dropping in new modules.</p>
<p>That&#8217;s it, not much different, but you don&#8217;t need to add a new configuration entry each time you wish to add a new module :)</p>
<p>*To clear this cache (if required) use the <a href="http://uk.php.net/manual/en/function.clearstatcache.php" target="_blank">clearstatcache</a> function.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up+http://is.gd/ehfBt" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up+http://is.gd/ehfBt" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up+http://is.gd/ehfBt" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up+http://is.gd/ehfBt" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;submitHeadline=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;submitHeadline=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;t=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;t=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;t=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;t=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up&amp;link=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up&amp;link=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/&amp;title=Zend+Framework+Per+Module+Layout+Settings+%E2%80%93+Follow+Up" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating URL in Zend Customer View Helper</title>
		<link>http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/</link>
		<comments>http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 23:01:57 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[front controller]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[Router]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[Zend_View_Helper_Abstract]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=239</guid>
		<description><![CDATA[This may seem simple, but I was banging my head trying to create a URL in a custom view helper in Zend Framework. I have routing setup which gets the module from the sub-domain in use so I couldn&#8217;t use a simple hardcoded URL. Basically but invoking an instance of the front controller its possible [...]]]></description>
			<content:encoded><![CDATA[<p>This may seem simple, but I was banging my head trying to create a URL in a custom view helper in <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a>. I have routing setup which gets the module from the sub-domain in use so I couldn&#8217;t use a simple hardcoded URL.</p>
<p><span id="more-239"></span></p>
<p>Basically but invoking an instance of the front controller its possible to grab the router and assemble a url. Assemble is the function used in the view helper. The URL is built up from an array of module, controller, action, etc, followed by a second parameter of the route to use. The code is as follows:</p>
<pre class="php">&lt;?php
/**
 * View helper which returns link category URL
 *
 * @author     Lloyd Watkin
 * @since      25/01/2010
 * @package    ViewHelper
 * @subpackage LinksUrl
 */
class Pro_View_Helper_LinksUrl
    extends Zend_View_Helper_Abstract
{
	/**
	 * Returns link category URL
	 *
	 * @param  Doctrine_Record $category
	 * @param  string          $module
	 * @param  string          $controller
	 * @param  string          $action
	 * @return string Url
	 */
    public function linksUrl($category, $module = 'www',
        $controller = 'links', $action = 'index')
    {
    	$router = Zend_Controller_Front::getInstance()-&gt;getRouter();

        return $router-&gt;assemble(array(
            'module'     =&gt; $module,
            'controller' =&gt; $controller,
            'action'     =&gt; $action,
            'category'   =&gt; "{$category-&gt;id}-{$category-&gt;name}",
        ), 'www-index');
    }
}</pre>
<p>Another way to do this is to invoke Zend_View_Helper_Url itself and call the Url method (if you want to use the helper itself). This can be done by using the following code:</p>
<pre class="php">&lt;?php
/**
 * View helper which returns link category URL
 *
 * @author     Lloyd Watkin
 * @since      25/01/2010
 * @package    ViewHelper
 * @subpackage LinksUrl
 */
class Pro_View_Helper_LinksUrl
    extends Zend_View_Helper_Abstract
{
	/**
	 * Returns link category URL
	 *
	 * @param  Doctrine_Record $category
	 * @param  string          $module
	 * @param  string          $controller
	 * @param  string          $action
	 * @return string Url
	 */
    public function linksUrl($category, $module = 'www',
        $controller = 'links', $action = 'index')
    {
    	$link = new Zend_View_Helper_Url();

        return $link-&gt;url(array(
            'module'     =&gt; $module,
            'controller' =&gt; $controller,
            'action'     =&gt; $action,
            'category'   =&gt; "{$category-&gt;id}-{$slug}",
        ), 'www-index');
    }
}</pre>
<p>Both almost identical. Not a hard thing to do in the framework but can catch you out ;)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Creating+URL+in+Zend+Customer+View+Helper+http://is.gd/ehfBu" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Creating+URL+in+Zend+Customer+View+Helper+http://is.gd/ehfBu" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Creating+URL+in+Zend+Customer+View+Helper+http://is.gd/ehfBu" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Creating+URL+in+Zend+Customer+View+Helper+http://is.gd/ehfBu" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;submitHeadline=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;submitHeadline=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;t=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;t=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;t=Creating+URL+in+Zend+Customer+View+Helper" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;t=Creating+URL+in+Zend+Customer+View+Helper" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Creating+URL+in+Zend+Customer+View+Helper&amp;link=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Creating+URL+in+Zend+Customer+View+Helper&amp;link=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/&amp;title=Creating+URL+in+Zend+Customer+View+Helper" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/239-creating-url-in-zend-custom-view-helper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically add pages to Zend_Navigation container at runtime</title>
		<link>http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/</link>
		<comments>http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 22:50:19 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[dynamically]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[sub-page]]></category>
		<category><![CDATA[view]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[Zend_Navigation]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=236</guid>
		<description><![CDATA[In a continuation on my last post about Zend_Navigation, Route requests for sitemap.xml to custom controller/action, this post is about dymnamically adding pages to a Zend_Navigation container at runtime/script execution. Its all well and good specifying your pages in a ini or xml file but at some point you&#8217;re going to have changing pages in [...]]]></description>
			<content:encoded><![CDATA[<p>In a continuation on my last post about Zend_Navigation, <a href="http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/">Route requests for sitemap.xml to custom controller/action</a>, this post is about dymnamically adding pages to a Zend_Navigation container at runtime/script execution.</p>
<p>Its all well and good specifying your pages in a <strong>ini</strong> or <strong><a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">xml</a></strong> file but at some point you&#8217;re going to have changing pages in your site that you want as part of a menu, sitemap, or to be included in your breadcrumb trail. Therefore what we need to do is add pages to our Zend_Navigation container at runtime. Examples for this would be in adding news items, blog posts, or page comments, etc.</p>
<p><span id="more-236"></span></p>
<p>In this example I&#8217;m going to add some news posts to my statically defined ini config. To get my news post page configurations I&#8217;ve used a class which returns an array in the following format:</p>
<pre class="php">$pagesToAdd = array (
  0 =&gt;
    array (
      'label' =&gt; 'Fake news story #5...',
      'module' =&gt; 'www',
      'route' =&gt; 'www-index',
      'action' =&gt; 'view',
      'controller' =&gt; 'news',
      'params' =&gt; array (
          'id' =&gt; '5-Fake-news-story--5' )
    ),
  1 =&gt;
    array ( /* More page details */ ),
 );</pre>
<p>As you&#8217;ll notice that the function has returned an array in which are contained arrays which make up the config arrays for Zend_Navigation_Page_Mvc. Therefore, by looping over the array new Zend_Navigation pages can be created from the config array. The next thing to do as part of the loop is to to add the pages in the correct position (alternatively pages can be added in bulk by using -&gt;addPages() method).</p>
<p>To do this, locate the page you wish to add the sub-pages to and simply add the pages. In this case I have used the following code to find my page:</p>
<pre class="php">$container-&gt;findOneBy('label', 'Latest News')-&gt;addPage($page);</pre>
<p>My overall navigation initialisation in the bootstrap therefore looks like this:</p>
<pre class="php">    /**
     * used for handling top-level navigation
     *
     * @return Zend_Navigation
     */
    protected function _initNavigation()
    {
        $this-&gt;bootstrap('layout');
        $layout = $this-&gt;getResource('layout');
        $view = $layout-&gt;getView();
        $config = new Zend_Config_Ini(
            APPLICATION_PATH . '/configs/navigation.ini', APPLICATION_ENV);

        $container = new Zend_Navigation($config-&gt;default);
        // Now add the last 25 news reports
        $news  = new News();
        $pages = $news-&gt;getNavigationEntries();
        foreach ($pages AS $page) {
        	$page = new Zend_Navigation_Page_Mvc($page);
        	$container-&gt;findOneBy('label', 'Latest News')-&gt;addPage($page);
        }
        $view-&gt;navigation($container);
    }</pre>
<p>On thing that needs to be added is some form of caching (using <a href="http://framework.zend.com/manual/en/zend.cache.html" class="kblinker" target="_blank" title="More about Zend_Cache &raquo;">Zend_Cache</a> presumably ;)) otherwise this is going to be quite expensive with each page load.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime+http://is.gd/ehfBv" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime+http://is.gd/ehfBv" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime+http://is.gd/ehfBv" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime+http://is.gd/ehfBv" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;submitHeadline=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;submitHeadline=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;t=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;t=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;t=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;t=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime&amp;link=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime&amp;link=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/&amp;title=Dynamically+add+pages+to+Zend_Navigation+container+at+runtime" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/236-dynamically-add-pages-to-zend_navigation-container-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Route requests for sitemap.xml to custom controller/action</title>
		<link>http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/</link>
		<comments>http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 00:13:56 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ini]]></category>
		<category><![CDATA[Router]]></category>
		<category><![CDATA[Routes]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[Zend_Navigation]]></category>
		<category><![CDATA[Zend_Router]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=231</guid>
		<description><![CDATA[In order to direct requests for /sitemap.xml to a custom controller and action in your Zend Framework application simply add the following in your application.ini or alternative config file (e.g. I use navigation.ini): resources.router.routes.sitemap.route = "sitemap.xml" resources.router.routes.sitemap.defaults.controller = index resources.router.routes.sitemap.defaults.action = sitemap Example code for outputting can be seen by creating an action in the [...]]]></description>
			<content:encoded><![CDATA[<p>In order to direct requests for /<a href="http://en.wikipedia.org/wiki/Sitemaps">sitemap.xml</a> to a custom controller and action in your <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a> application simply add the following in your application.ini or alternative config file (e.g. I use navigation.ini):</p>
<pre name="code" class="ini">
resources.router.routes.sitemap.route                = "sitemap.xml"
resources.router.routes.sitemap.defaults.controller  = index
resources.router.routes.sitemap.defaults.action      = sitemap
</pre>
<p>Example code for outputting can be seen by creating an action in the appropriate controller (e.g. my sitemap lies in the index controller, sitemap action):</p>
<pre name="code" class="php">
&lt;<a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">php</a>
class IndexController
    extends Zend_Controller_Action
{
    /**
     * Renders a sitemap based on Zend_Navigation setup
     */
    public function sitemapAction()
    {
    	echo $this->view->navigation()->sitemap();
    	$this->view->layout()->disableLayout();
    	$this->_helper->viewRenderer->setNoRender(true);
    }
}
</pre>
<p>Sitemaps can quickly and easily be generated using <a href="http://framework.zend.com/manual/en/zend.navigation.html">Zend_Navigation</a>, a great quick tutorial (and generally very useful for Zend Framework tutorials) is <a href="http://www.zendcasts.com/">Zend Casts</a> &#8211; <a href="http://www.zendcasts.com/zend_navigation-dynamically-creating-a-menu-a-sitemap-and-breadcrumbs/2009/06/">Dynamically creating a menu a sitemap and breadcrumbs</a>.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Route+requests+for+sitemap.xml+to+custom+controller%2Faction+http://is.gd/ehfBY" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Route+requests+for+sitemap.xml+to+custom+controller%2Faction+http://is.gd/ehfBY" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Route+requests+for+sitemap.xml+to+custom+controller%2Faction+http://is.gd/ehfBY" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Route+requests+for+sitemap.xml+to+custom+controller%2Faction+http://is.gd/ehfBY" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;submitHeadline=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;submitHeadline=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;t=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;t=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;t=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;t=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction&amp;link=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction&amp;link=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/&amp;title=Route+requests+for+sitemap.xml+to+custom+controller%2Faction" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/231-route-requests-for-sitemap-xml-to-custom-controlleraction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Framework Per-Module based settings</title>
		<link>http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/</link>
		<comments>http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 22:40:16 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[layoutPath]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=227</guid>
		<description><![CDATA[I&#8217;ve created a followup to this post which requires less configuration, please see Module Based Layout &#8211; Zend Framework. When using the zend framework with modules, its obvious that if you&#8217;re running various (sub-)sites off the same application you don&#8217;t necessarily want the same layout scripts for each part. I decided to go with the [...]]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;ve created a followup to this post which requires less configuration, please see <a href="http://www.evilprofessor.co.uk/242-zend-framework-per-module-layout-settings-follow-up/">Module Based Layout &#8211; Zend Framework</a>.</em></p>
<p>When using the <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">zend framework</a> with modules, its obvious that if you&#8217;re running various (sub-)sites off the same application you don&#8217;t necessarily want the same <a href="http://www.evilprofessor.co.uk/269-naked-zend_layout-and-zend_view/" class="kblinker" title="More about layout script &raquo;">layout scripts</a> for each part. I decided to go with the following site structure:</p>
<pre>/Application
    /controllers
        ...
    /models
    /modules
        /default
            /controllers
            /layout
                /scripts
            /views
                /scripts
        /anotherModule
            ...
    /scripts
</pre>
<p>The problem was setting up the layout scripts on a per-module basis. The answer came through using an Action Helper. Setting up the layouts on a per-module basis involves three steps:</p>
<ol>
<li>Application.ini (or similar configuration setup):<br/>
<pre name="code" class="ini">admin.resources.layout.layoutPath = APPLICATION_PATH "/modules/admin/layouts/scripts"
default.resources.layout.layoutPath = APPLICATION_PATH "/modules/default/layouts/scripts"
member.resources.layout.layoutPath = APPLICATION_PATH "/modules/member/layouts/scripts"
affiliate.resources.layout.layoutPath = APPLICATION_PATH "/modules/affiliate/layouts/scripts"</pre>
</li>
<li>Create your Action Helper:<br/>
<pre name="code" class="php">&lt;?php
/**
 * Sets the layout path on a per-module basis
 *
 * @author Lloyd Watkin &lt;lloyd@evilprofessor.co.uk&gt;
 * @since  2010-01-01
 */
class Pro_Controller_Action_Helper_SetLayoutPath
    extends Zend_Controller_Action_Helper_Abstract
{
    /**
     * Sets layout path based on module
     */
    public function preDispatch()
    {
    	$module = $this->getRequest()->getModuleName();

	    if ($bootstrap = $this->getActionController()
	                       ->getInvokeArg('bootstrap')) {

	        $config = $bootstrap->getOptions();

	        if (isset($config[$module]['resources']['layout']['layoutPath'])) {
	            $layoutPath =
	                 $config[$module]['resources']['layout']['layoutPath'];
	            $this->getActionController()
	                 ->getHelper('layout')
	                 ->setLayoutPath($layoutPath);
	        }
    	}
    }
}</pre>
</li>
<li>And lastly boostrap the action helper:<br/>
<pre name="code" class="php">...
    /**
     * Sets up layout scripts on a per-module basis
     */
    protected function _initLayoutHelper()
	{
	    $this->bootstrap('frontController');
	    $layout = Zend_Controller_Action_HelperBroker::addHelper(
	        new Pro_Controller_Action_Helper_SetLayoutPath());
	}
...</pre>
</li>
</ol>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Per-Module+based+settings+http://is.gd/ehfBZ" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Zend+Framework+Per-Module+based+settings+http://is.gd/ehfBZ" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Per-Module+based+settings+http://is.gd/ehfBZ" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Zend+Framework+Per-Module+based+settings+http://is.gd/ehfBZ" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;submitHeadline=Zend+Framework+Per-Module+based+settings" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;submitHeadline=Zend+Framework+Per-Module+based+settings" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;t=Zend+Framework+Per-Module+based+settings" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;t=Zend+Framework+Per-Module+based+settings" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;t=Zend+Framework+Per-Module+based+settings" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;t=Zend+Framework+Per-Module+based+settings" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Per-Module+based+settings&amp;link=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework+Per-Module+based+settings&amp;link=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/&amp;title=Zend+Framework+Per-Module+based+settings" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/227-zend-framework-per-module-based-settings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doctrine: DATETIME default NOW()</title>
		<link>http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/</link>
		<comments>http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 18:30:04 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[yaml]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=222</guid>
		<description><![CDATA[I&#8217;ve been struggling with setting up a database schema for a new Zend Framework project. I&#8217;m using trying to use Doctrine ORM for my database models. I need to set up the schema so that it allowed me to set a default date and time for a `datetime` column, e.g. when adding a new message [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been struggling with setting up a database schema for a new <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a> project. I&#8217;m <del datetime="2009-12-30T17:03:47+00:00">using</del> trying to use Doctrine ORM for my database models. I need to set up the schema so  that it allowed me to set a default date and time for a `datetime` column, e.g. when adding a new message I get the current timestamp. After much searching and experimenting I found the solution so I&#8217;m sharing it.</p>
<p>In your schema <a href="http://www.yaml.org/" class="kblinker" target="_blank" title="More about yaml &raquo;">YAML</a> file simply do the following:</p>
<pre name="code" class="yaml">
Message:
  actAs:
    Timestampable:
      created:
        name: created_at
        type: timestamp
        format: Y-m-d H:i:s
      updated:
        name: last_updated
        type: timestamp
        format: Y-m-d H:i:s
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(255)
    email: string(300)
    message: string(2000)
</pre>
<p>If on the other hand you don&#8217;t want an `updated_at` column you can use the following:</p>
<pre name="code" class="yaml">
Message:
  actAs:
    Timestampable:
      created:
        name: created_at
        type: timestamp
        format: Y-m-d H:i:s
      updated:
        disabled: true
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(255)
    email: string(300)
    message: string(2000)
</pre>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Doctrine%3A+DATETIME+default+NOW...+http://is.gd/ehfC3" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Doctrine%3A+DATETIME+default+NOW...+http://is.gd/ehfC3" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Doctrine%3A+DATETIME+default+NOW...+http://is.gd/ehfC3" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Doctrine%3A+DATETIME+default+NOW...+http://is.gd/ehfC3" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;submitHeadline=Doctrine%3A+DATETIME+default+NOW..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;submitHeadline=Doctrine%3A+DATETIME+default+NOW..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;t=Doctrine%3A+DATETIME+default+NOW..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;t=Doctrine%3A+DATETIME+default+NOW..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;t=Doctrine%3A+DATETIME+default+NOW..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;t=Doctrine%3A+DATETIME+default+NOW..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Doctrine%3A+DATETIME+default+NOW...&amp;link=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Doctrine%3A+DATETIME+default+NOW...&amp;link=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/&amp;title=Doctrine%3A+DATETIME+default+NOW..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/222-doctrine-datetime-default-now/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Design Patterns &#8211; Observer Pattern</title>
		<link>http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/</link>
		<comments>http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:02:38 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[object orientated]]></category>
		<category><![CDATA[objected orientated]]></category>
		<category><![CDATA[observable]]></category>
		<category><![CDATA[observer]]></category>
		<category><![CDATA[observer pattern]]></category>
		<category><![CDATA[observers]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[php-oo]]></category>
		<category><![CDATA[subject]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=211</guid>
		<description><![CDATA[I&#8217;ve been reading Head First Design Patterns recently and have decided to write some of the patterns as PHP examples for my own benefit. The first one that I&#8217;ve decided to code up is the Observer Pattern. The formal definition of the Observer Pattern is: The observer pattern (a subset of the asynchronous publish/subscribe pattern) [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading <a href="http://www.amazon.co.uk/gp/product/0596007124?ie=UTF8&amp;tag=evilprofecouk-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596007124">Head First Design Patterns</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=evilprofecouk-21&amp;l=as2&amp;o=2&amp;a=0596007124" border="0" alt="" width="1" height="1" /> recently and have decided to write some of the patterns as PHP examples for my own benefit. The first one that I&#8217;ve decided to code up is the <a title="Observer Pattern" href="http://en.wikipedia.org/wiki/Observer_pattern" target="_blank">Observer Pattern</a>. The formal definition of the Observer Pattern is:</p>
<blockquote><p>The <strong>observer pattern</strong> (a subset of the asynchronous <a title="Publish/subscribe" href="http://en.wikipedia.org/wiki/Publish/subscribe">publish/subscribe pattern</a>) is a <a title="Design pattern (computer science)" href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29">software <a href="http://www.evilprofessor.co.uk/category/internet/design-patterns/" class="kblinker" title="More about design pattern &raquo;">design pattern</a></a> in which an <a title="Object (computer science)" href="http://en.wikipedia.org/wiki/Object_%28computer_science%29#Objects_in_object-oriented_programming">object</a>, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their <a title="Method (computer science)" href="http://en.wikipedia.org/wiki/Method_%28computer_science%29">methods</a>. It is mainly used to implement distributed event handling systems.</p></blockquote>
<p>As systems become more loosely coupled making sure that when an event happens all systems that require knowledge of these updates are informed. For example, a blog post, after saving a post we may need to update a search engine (e.g. Lucene), update our sitemap, tags, email subscribed users, etc. The observer pattern allows developers to add additional listeners without editing their observable object. By injecting observers (i.e. a search engine update observer, a sitemap generator, etc) into a subject (i.e. blog post editing system) we can allow the it to perform all the necessary updates without any changes.</p>
<p><span id="more-211"></span></p>
<p>Before the Observer pattern was identified the usual trick would be to update the observable object with an additional line of code to update the required system, and removing the line of code as required. This does not allow for easily adding and removing observers.</p>
<p>The subject updates all of its observers via an update method. This update method calls a method in each observer which is derived from implementing an interface. Observers can add an remove themselves through methods in the observable object.</p>
<p>That&#8217;s basically it! I always find an example to be the best method of learning/understanding so here&#8217;s my coded up example&#8230;</p>
<h2>Observer Pattern in <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a></h2>
<p style="text-align: center;"><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2009/12/snapshot1.png"><img class="size-medium wp-image-218 aligncenter" title="PHP Observer Pattern Running" src="http://www.evilprofessor.co.uk/wp-content/uploads/2009/12/snapshot1-300x187.png" alt="" width="300" height="187" /></a></p>
<p>In my example I&#8217;ve created a news system (<em>NewsAggregator</em>) which sends out news headline updates to smaller news feeds. Here the news sytem takes the place of the <strong>Subject</strong>, <strong>Observable</strong>, etc whereas the news feeds take the role of the<strong> Observers</strong> or <strong>Listeners</strong>.</p>
<p>Once initialised observers can attach and detach themselves from the subject as they see fit. In my example I have created three observers, these scan the headlines sent out by the subject and &#8216;shout&#8217; the news if its appropriate. The three observers are named below along with the terms they scan for when receiving news headlines:</p>
<ul>
<li><strong>Sport Observer:</strong> &#8216;rugby&#8217;, &#8216;football&#8217;, &#8216;tennis&#8217;</li>
<li><strong>News Observer: </strong>&#8216;politics&#8217;, &#8216;finance&#8217;, &#8216;government&#8217;</li>
<li><strong>Gossip Observer:</strong> &#8216;celebrity&#8217;, &#8216;music&#8217;, &#8216;fashion&#8217;</li>
</ul>
<p>After initalising the subject I add the news and gossip observers and send out a news update. After this the sport observer is added before more news updates are sent out. Lastly the gossip observer is removed before a final news headline is sent out.</p>
<p>The three different observer classes implement the interface <strong>Observer</strong>, this gives them a clear interface/method through which they will receive updates. Provided they implement the <strong>Observer</strong> interface they will be able to attach themselves to the <strong>Subject</strong>. This also keeps with the programming paradigm of &#8216;program to interfaces not implementations&#8217;. The <strong>NewsAggregator </strong>class extends the abstract class <strong>Subject</strong>, which provides us with the three required public methods:</p>
<ol>
<li><strong>updateObservers()</strong></li>
<li><strong>addObserver()</strong></li>
<li><strong>removeObserver()</strong></li>
</ol>
<p>The code can be seen running here, <a href="http://www.evilprofessor.co.uk/uploads/php/designPatterns/observerPattern/main.php" target="_blank">Observer Pattern in PHP Running</a>, and the code can be downloaded from here, <a href="http://www.evilprofessor.co.uk/uploads/php/designPatterns/observerPattern/" target="_blank">Observer Pattern in PHP Code</a>.</p>
<h3>Observer Script</h3>
<pre class="php">&lt;?php
/**
 * This file contains the observers
 *
 * @author Lloyd Watkin
 * @since 2009/12/23
 */

abstract class Subject
{
	abstract public function addObserver(Observer $observer);
	abstract public function removeObserver(Observer $observer);
	abstract public function updateObservers( $newsHeadline );
}

/**
 * This is the subject class for the example
 *
 * @author Lloyd Watkin
 * @since 2009/12/23
 */
class ArticleAggregator extends Subject
{
	/**
	 * Holds a list of our observers
	 *
	 * @var array
	 */
	protected $_observerList = array();

	/**
	 * Method to add an observer
	 *
	 * @var Observer $observer
	 * @return void
	 */
	public function addObserver(Observer $observer)
	{
		$this-&gt;_observerList[] = $observer;
	}

	/**
	 * Method to remove an observer
	 *
	 * @var Observer $observer
	 * @return boolean
	 */
	public function removeObserver(Observer $observer)
	{
		foreach ($this-&gt;_observerList AS $key =&gt; $ob) {
			if ($ob == $observer) {
				unset($this-&gt;_observerList[$key]);
				return true;
			}
		}
		return false;
	}

	/**
	 * Method to update observers
	 *
	 * @var string $newsHeadline
	 * @return void
	 */
	public function updateObservers( $newsHeadline )
	{
		foreach ($this-&gt;_observerList AS $ob) {
			$ob-&gt;update( $newsHeadline );
		}
	}

	/**
	 * Add a new news story
	 *
	 * @var string $story
	 * @return void
	 */
	public function addNewsStory( $story )
	{
		if ( empty( $story ) || !is_string( $story) ) {
			throw new InvalidArgumentException('Expected a news story!');
		}
		$this-&gt;updateObservers( $story );
	}
}</pre>
<h3>Subject / Observable Script</h3>
<pre class="php">&lt;?php
/**
 * This file contains the subject
 *
 * @author Lloyd Watkin
 * @since 2009/12/23
 */

abstract class Subject
{
	abstract public function addObserver(Observer $observer);
	abstract public function removeObserver(Observer $observer);
	abstract public function updateObservers( $newsHeadline );
}

/**
 * This is the subject class for the example
 *
 * @author Lloyd Watkin
 * @since 2009/12/23
 */
class ArticleAggregator extends Subject
{
	/**
	 * Holds a list of our observers
	 *
	 * @var array
	 */
	protected $_observerList = array();

	/**
	 * Method to add an observer
	 *
	 * @var Observer $observer
	 * @return void
	 */
	public function addObserver(Observer $observer)
	{
		$this-&gt;_observerList[] = $observer;
	}

	/**
	 * Method to remove an observer
	 *
	 * @var Observer $observer
	 * @return boolean
	 */
	public function removeObserver(Observer $observer)
	{
		foreach ($this-&gt;_observerList AS $key =&gt; $ob) {
			if ($ob == $observer) {
				unset($this-&gt;_observerList[$key]);
				return true;
			}
		}
		return false;
	}

	/**
	 * Method to update observers
	 *
	 * @var string $newsHeadline
	 * @return void
	 */
	public function updateObservers( $newsHeadline )
	{
		foreach ($this-&gt;_observerList AS $ob) {
			$ob-&gt;update( $newsHeadline );
		}
	}

	/**
	 * Add a new news story
	 *
	 * @var string $story
	 * @return void
	 */
	public function addNewsStory( $story )
	{
		if ( empty( $story ) || !is_string( $story) ) {
			throw new InvalidArgumentException('Expected a news story!');
		}
		$this-&gt;updateObservers( $story );
	}
}</pre>
<h3>Controller Script</h3>
<pre class="php">&lt;?php
/**
 * Observer Design Pattern Example
 *
 * @author Lloyd Watkin
 * @since 2009/12/23
 * @link http://www.evilprofessor.co.uk
 */
include 'observers.php';
include 'subject.php';

if (!empty($_SERVER['HTTP_USER_AGENT'])) {
    echo '
<pre>';
}

// What are we doing?
echo 'Observer Pattern Example in PHP' . PHP_EOL;
echo '================================' . PHP_EOL;
// Set up our subject
$subject = new ArticleAggregator();
echo ' - ArticleAggregator created' . PHP_EOL;

// Add some observers
$subject-&gt;addObserver( new NewsObserver() );
$subject-&gt;addObserver( $gossiper = new GossipObserver() );

echo ' - Added NewsObverser &amp; GossipObserver' .
	 PHP_EOL . PHP_EOL;

// Beep, beep, beep... News Flash!
echo 'NewsFlash: celebrity rugby player loves finance' . PHP_EOL;
echo '================================================' . PHP_EOL;
$subject-&gt;addNewsStory('celebrity rugby player loves finance');
echo PHP_EOL;

echo ' - SportObserver has found out and wants to join the group!';
$subject-&gt;addObserver( new SportObserver() );
echo PHP_EOL . PHP_EOL;

// Beep, beep, beep... News Flash!
echo 'NewsFlash: government messes up again!' . PHP_EOL;
echo '=======================================' . PHP_EOL;
$subject-&gt;addNewsStory('government messes up again!');
echo PHP_EOL;

// Beep, beep, beep... News Flash!
echo 'NewsFlash: fashion and football combine' . PHP_EOL;
echo '=======================================' . PHP_EOL;
$subject-&gt;addNewsStory('fashion and football combine');
echo PHP_EOL;

// Beep, beep, beep... News Flash!
echo 'NewsFlash: music and politics, what next?' . PHP_EOL;
echo '==========================================' . PHP_EOL;
$subject-&gt;addNewsStory('music and politics, what next?');
echo PHP_EOL;

/**
 * Gossipers grow tired of news very quickly and have decided
 * to stop listening, despite all the interesting news today!
 */
echo ' - GossipObserver is bored and leaves the group!' .
     PHP_EOL . PHP_EOL;
$subject-&gt;removeObserver( $gossiper );

// Beep, beep, beep... News Flash - Update to an earlier story!
echo 'NewsUpdate: fashion and football combine says ' .
     'government' . PHP_EOL;
echo '================================================' .
     '=========' . PHP_EOL;
$subject-&gt;addNewsStory( 'fashion and football combine ' .
                        'says government' );
echo PHP_EOL;

if (!empty($_SERVER['HTTP_USER_AGENT'])) {
    echo '</pre>
<p>';</p>
<p>}</pre>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=PHP+Design+Patterns+%E2%80%93+Observer+Pattern+http://is.gd/ehfC4" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=PHP+Design+Patterns+%E2%80%93+Observer+Pattern+http://is.gd/ehfC4" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=PHP+Design+Patterns+%E2%80%93+Observer+Pattern+http://is.gd/ehfC4" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=PHP+Design+Patterns+%E2%80%93+Observer+Pattern+http://is.gd/ehfC4" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;submitHeadline=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;submitHeadline=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;t=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;t=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;t=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;t=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern&amp;link=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern&amp;link=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/&amp;title=PHP+Design+Patterns+%E2%80%93+Observer+Pattern" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/211-php-design-patterns-observer-pattern/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Office Grid Computing using Virtual environments &#8211; Part 4</title>
		<link>http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/</link>
		<comments>http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:59:53 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Grid Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[redbean]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[slave]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svn update]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=130</guid>
		<description><![CDATA[Introduction I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><em>I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I&#8217;m going to look at the potential benefits of employing an office <a href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">grid</a> using virtualised environments.</em></p>
<p>In <a href="http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/">part 3</a> we created our virtual processing machine and set up windows machines to become idle-time workers.</p>
<h2>Running the latest code</h2>
<p>Inevitably after creating your workers business logic will change, bugs will be found, faster more efficient code will be produced thus leaving your workers sat around processing data using <a href="http://en.wikipedia.org/wiki/Code_smell" target="_blank"><em>old smelly code</em></a>. How then do we ensure that we&#8217;re always using the latest and greatest version of our processing scripts?</p>
<p>There are a few very easy simple ways we could do this, the trick, however, is to reduce processing power and network traffic in achieving this. Lets start with the simplest of solutions and improve it slowly over a couple of iterations.</p>
<p>The first method would be to simply connect to our job control server (via samba, FTP, or similar) and pull down the latest version of the code. Not very efficient, but it will do the job. Lets improve on that somewhat, how about creating an rsync script and using that each time instead? Alternatively what about putting our latest processing script into subversion checking out the code initially and then just updating our code on each run (<a title="svn update" href="http://svnbook.red-bean.com/en/1.1/re28.html" target="_blank"><em>svn update</em></a>)?</p>
<p>In the end we could end up with a bash script (called by cron every 10 minutes) which looks as simple as this:</p>
<pre style="padding-left: 60px;">#!/bin/sh
if ps ax | grep -v grep | grep <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">php</a> &gt; /dev/null
then
    echo "Job is currently processing, exit"
else
    echo "Job is not running, start now"
    cd /path/to/working/copy
    svn update
    php yourJobProcessingScript.php
fi</pre>
<p>Now we can be sure that with each run we&#8217;re definitely running the latest code. We&#8217;re ensuring this by updating our code base each and every time we perform a run and reducing network traffic by only transferring the file differences across our network.</p>
<p>In my demonstration setup, I did exactly as above. Subversion was installed on my job processing server and I simply pulled the latest code from a &#8216;worker&#8217; branch using &#8216;svn update&#8217;. I also added a version number tag to my processing script which was returned to the database as part of the results return. This way I could see that my code was being updated each time I copied my trunk into the worker branch i.e. that I was definitely running the latest processing script.</p>
<h2>Using the latest data</h2>
<p>If your job processing makes use of data sources then at some point these are going to be updated too. Unless you call your data sources on a very infrequent basis you&#8217;re going to flood your network with traffic as soon as your workers start running bringing everything to a standstill. For my solution I decided that I&#8217;d like to move my data sources around with my VMs.</p>
<p style="padding-left: 30px;"><em><strong>Hold you&#8217;re horses there!</strong> What if my data sources are HUGE? Well this really is a case of how much data are we talking? It may be more cost effective to install an additional larger hard drive into each machine than to purchase an additional processing server. This is a question of budget and is up to the business to decide. It maybe that your data sources are so large that its just unfeasible to keep that amount of data in your worker machines. In that case what would you do? Well we could look at calling a local data server, but this might cause issues with the network. In this case a grid system such as this may become unrealistic to include in your office environment. It may also be that you can look into alternative running strategies, for example only calling your workers between 8pm and 6am each night and/or throttling data source requests.</em></p>
<p>Moving on lets say our data sources amount to 100Gb of data. Well yes that&#8217;s quite a bit of data to move around the network on an update. How would we ensure that we have the latest copy of the data in this case? Rsync is a possibility, but personally I think by running your latest data source on your job processing server and setting this up as a master in replication (with a nice long bin log) might be the way to go:</p>
<p><a class="tt-flickr tt-flickr-Small" title="replication" href="http://www.evilprofessor.co.uk/gallery/photo/4144476425/replication.html"><img class="aligncenter" src="http://farm3.static.flickr.com/2799/4144476425_0aace3e106_m.jpg" alt="replication" width="200" height="240" /></a> By setting each of your workers up as a slave to the job control server updates to your data sources will trickle down nicely to your workers without a huge increase in network activity (that is unless you perform a huge data update and all your workers kick in at once). This has advantages over rsync in that you wouldn&#8217;t get a long pause before each job; as the database updates, the <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mysql</a> daemon on your worker will continually update its data while the processing continues.</p>
<p>This is how I set up my demonstration server. To set up replication I followed the guide on the mySQL site (<a href="http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html" target="_blank">Setting up replication</a>) and within 20 minutes I had my inital worker replicating the job control servers dataset. For each additional worker the replication settings and process worked each time when the VM was copied.</p>
<h2>Summary</h2>
<p>In this section of the article we have looked at how easy and painless it is to keep your processing code up to date by usingÂ  rsync or subverion (SVN) to do the work and reduce network traffic at the same time.Â  We also discussed how to keep your data source information up-to-date by allowing it to trickle down to each of your workers. Thus we areÂ  ensuring that we keep up with business logic and information in our office grid system. There will obviously be countless alternatives to performing these tasks, but here were two simple examples to show how easy a solution is to come by.</p>
<h2>Next time</h2>
<p>In the final part of this series, aptly named <a href="http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/">Part 5</a> , we&#8217;ll discuss deploying this system for. I&#8217;ll summarise what has been learned and what I managed to create.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4+http://is.gd/ehfCp" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4+http://is.gd/ehfCp" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4+http://is.gd/ehfCp" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4+http://is.gd/ehfCp" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4&amp;link=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4&amp;link=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+4" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Office Grid Computing using Virtual environments &#8211; Part 3</title>
		<link>http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/</link>
		<comments>http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:37:55 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[idle]]></category>
		<category><![CDATA[LiMP]]></category>
		<category><![CDATA[scheduled tasks]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[VBoxManage]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[windows xp]]></category>
		<category><![CDATA[worker]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=129</guid>
		<description><![CDATA[Introduction I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><em>I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I&#8217;m going to look at the potential benefits of employing an office <a href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">grid</a> using virtualised environments.</em></p>
<p>In <a href="../126-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2">part 2</a> we looked at the jobs a server will run, and how jobs should be configured in order to achieve greatest amount of processing whilst ensuring that each job is processed without fail.</p>
<h2>Setting up your worker &#8211; or LiMP server</h2>
<p>The next step in the process is to set up your virtual workers. For this I&#8217;m going to use an installation of centOS using VirtualBox. I&#8217;m going to install <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a> and <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> on the server, also known as a <strong>LiMP</strong> (<strong>Li</strong>nux, <strong>m</strong>ySQL, <strong>P</strong>HP) ServerÂ  (I <em>may</em> have made that name up).</p>
<ul>
<li>Install VirtualBox on your windows machine (follow link)</li>
<li>Download and install centOS (current version 5.3) within a created virtual machine</li>
</ul>
<p>There&#8217;s no point me going to this there&#8217;s probably 1,000&#8242;s of great tutorials out there (ok, here&#8217;s one: <a href="http://paulsiu.wordpress.com/2008/09/08/creating-and-managing-centos-virtual-machine-under-virtualbox/" target="_blank">Creating and ManagingÂ  centOS virtual machine under virtualbox</a>). The important point to note I suppose is that I called my virtual machine <strong>GridMachine</strong>.</p>
<p>As far as my choices of virtualisation client and operating system go there is no big compelling reason for each choice. VirtualBox is something I use on my home machine and is supported by the three major operating systems. I chose centOS as its a good stable OS and I use it on my own web server. I am a great believer in the right tools for the job (although I&#8217;m applying &#8216;use the quickest and easiest for you&#8217; mentality here), so <strong>if operating system X runs your code quicker and more efficiently use that instead</strong> :)</p>
<p>Importantly make sure that your VM uses DHCP, otherwise for each new virtual machine would need to be configured separately which is something we don&#8217;t want.By using DHCP we don&#8217;t need to configure network settings individually for worker machines, DHCP will hand out IPs for you. Therefore you can copy your virtual machine about the office without worrying about setting each one up (this improves scalability and reduces worker administration).</p>
<p>The process you should aim to achieve would be to obtain a new physical machine, install VirtualBox, and then pretty much deploy the virtual image without much else. It might be wise to setup all your workers on a different subnet so that you can at least see how many machines are running. You&#8217;ll also need to set up your machines on a long lease or unlimited lease DHCP.</p>
<h2>How to run Jobs on the worker</h2>
<p>This is an interesting area and there are several valid methods for processing jobs on the worker. Here I&#8217;ll just discuss the two most obvious:</p>
<ul>
<li>Perpetually running script: A script, be it a shell script, or a PHP script is executed once on the worker and runs as part of an infinite loop. I&#8217;ve discounted this method as one crash of the script and potentially your workers will cease to run without some sort of intervention.</li>
<li>Cron based script execution: Every X minutes the cron daemon kicks off a call to your script to get things going. Without some checking this could lead to many many copies of your worker script running.</li>
</ul>
<p>My decision was to go with cron which kicks off a shell script every 10 minutes.Â  My shell script performs the following tasks:</p>
<ol>
<li>Get a process list and grep this for &#8216;php&#8217;. If not found then continue.</li>
<li>Call your job code, in my case this would be something PHP based</li>
<li>Worker script completes its run</li>
<li>Ready to go again on the next appropriate call</li>
</ol>
<p>My bash script looks something like the following:</p>
<pre style="padding-left: 60px;">#!/bin/sh
if ps ax | grep -v grep | grep php &gt; /dev/null
then
    echo "Job is currently processing, exit"
else
    echo "Job is not running, start now"
    php yourJobProcessingScript.php
fi</pre>
<p>Note: the echo&#8217;s are <span style="text-decoration: line-through;">almost</span> completely pointless, but may help the next person who comes along to try and edit them.</p>
<p>That concludes the set up of the worker virtual machine, quick, simple, and easy to copy to each new piece of hardware that is received. The &#8216;cleverness&#8217; of the grid system really isn&#8217;t in the visualised OS, its all to do with the code created to process jobs, the job configuration, and in making sure that the job runs when appropriate (i.e. when the host is idle).</p>
<h2>Setting up Windows to Initialise Workers</h2>
<p>The first task is to work out the command required to run the virtual machine from the windows command line. If you&#8217;ve installed virtualBox in the default location and you&#8217;ve named your worker <strong>GridMachine</strong> then the command required to load up your worker is:</p>
<pre>"C:\Program Files\Sun\VirtualBox\VBoxManage.exe" startvm GridMachine</pre>
<p>However to run the script in a &#8216;headless&#8217; state we need to use:</p>
<pre>"C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe" -startvm GridMachine <span style="font-style: italic;">--vrdp=off</span></pre>
<p>This will start the virtual machine without the GUI and allow it to save state gracefully. The second argument turns off RDP so it doesn&#8217;t conflict with windows RDP, or give you a message about listening on port 3389. <strong>The virtual machine name is cAsE sEnSiTiVe!</strong></p>
<p>Next, we&#8217;ll need to set windows up to kick off our worker VM once the machine has been idle. To do this (on Windows XP) you&#8217;ll need to go Start -&gt; All Programs -&gt; Accessories -&gt; System Tools -&gt; Scheduled Tasks as below:</p>
<p><a class="tt-flickr tt-flickr-Medium" title="scheduled tasks" href="http://www.evilprofessor.co.uk/gallery/photo/4144266971/scheduled-tasks.html"><img class="aligncenter" src="http://farm3.static.flickr.com/2490/4144266971_d3cf67aa9b.jpg" alt="scheduled tasks" width="500" height="375" /></a></p>
<p>Next click on &#8216;Add Scheduled Task&#8217; followed by browse to add a custom program. Navigate to your VBoxManage script and click ok. Schedule your task for any of the options (we&#8217;ll change this in a minute) and continue. After skipping the next screen windows will ask you who you want to run this task, I&#8217;d suggest either &#8216;Administrator&#8217; or creating a new privileged user. Remember we don&#8217;t want to interfere with the standard staff account on the machine at any point. Click next and check show advanced options for this task.</p>
<p>To the end of the run textbox add our &#8216;<strong>startvm GridMachine</strong>&#8216; string and ensure that run only when logged in is left unticked. Visit the schedule task next and change the schedule drop down to the option &#8216;when idle&#8217;, choose the amount of time you&#8217;d like the machine to be idle before moving on to the next tab.</p>
<p>Finally untick the option which states stop the task if it has been running X amount of time, but do tick the option to stop the task if the machine is no longer idle.</p>
<p><a title="schedule" href="http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/"><img class="aligncenter" src="http://farm3.static.flickr.com/2538/4144305507_b91d5b9526.jpg" alt="schedule" width="500" height="375" /></a></p>
<p>That&#8217;s it then for the windows host setup!</p>
<h2>Summary</h2>
<p>In this part we have set up a virtual machine to act as a worker, as well as the way in which we call and execute our job processing scripts (for myself a PHP script). From here we look at how to set up our copies of windows to start up the virtual machine in headless mode when the computer becomes idle, and save its state when the user resumes usage of the machine. Hopefully at this point you&#8217;re seeing how simple it is to set up such a system and are itching to get some experiments going yourself!</p>
<h2>Next time</h2>
<p>In <a href="http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/">Part 4</a> we&#8217;ll be looking at using tools to ensure that you&#8217;re running the latest version of the code and data sources so that obtained results are always up-to-date with the latest business information and logic.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3+http://is.gd/ehfCK" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3+http://is.gd/ehfCK" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3+http://is.gd/ehfCK" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3+http://is.gd/ehfCK" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3&amp;link=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3&amp;link=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+3" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Office Grid Computing using Virtual environments &#8211; Part 1</title>
		<link>http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/</link>
		<comments>http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:23:57 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Grid Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[grid computing]]></category>
		<category><![CDATA[idle]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=122</guid>
		<description><![CDATA[Introduction I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><em>I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I&#8217;m going to look at the potential benefits of employing an office <a href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">grid</a> using virtualised environments.</em></p>
<p>As a <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> developer I&#8217;m going to use tools that I use each day namely, Linux, <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a>, PHP, VirtualBox and subversion (SVN). However I hope this guide will adapt to other languages and technologies just as well.</p>
<p>The solution I provide will be very loosely based on the type of processing we&#8217;d need to achieve however this may not be true through the entire article as I&#8217;ll change things for simplicity, or to produce more interesting usage scenarios.</p>
<p>These virtualised environments will run on windows machines since this is what the majority of offices run. The processing that the office machines do should not interfere with staff using those machines, should require no maintenance at the machine, and be easily deployable to new machines as they become available. Also, new virtual machines should not require any additional configuration as this greatly reduces the scalability and ease at which the grid system can be extended.</p>
<h2>Why Deploy an Office Computing Grid?</h2>
<p>Firstly you may be thinking,why not just use a cloud computing resource such as <a title="Amazon EC2" href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAoQFjAA&amp;url=http%3A%2F%2Faws.amazon.com%2Fec2%2F&amp;ei=bbkRS7mIN5m7jAeB7pnSAw&amp;usg=AFQjCNGFRZyNkZ3nq3JjaAjQe39QrvEUOQ&amp;sig2=6ftznJzDDi90b5KE0-lFJg" target="_blank">Amazon&#8217;s EC2 platform</a>? Well the reasons could be several, for example:</p>
<ul>
<li>You won&#8217;t entrust certain data to a cloud computing environment</li>
<li>You can&#8217;t put certain data into a cloud computing environment for legal reasons (e.g. data leaving the country), potentially for legal reasons, e.g. NHS records.</li>
<li>You want to keep your processing units close and have full control over the hardware too</li>
<li>You don&#8217;t have the project funds to run cloud instances</li>
<li>Your office doesn&#8217;t have a connection to the internet and therefore its not possible to use a cloud resource</li>
<li><em>You don&#8217;t like rain, clouds suggest rain, therefore you keep well away</em></li>
</ul>
<p>I&#8217;m sure the list could continue, but I think that&#8217;s enough for now.</p>
<h2>Advantages of an Office Computing Grid</h2>
<p>Well, lets do some maths (and in true physics style lets make some sweeping assumptions). Imagine you have big beefy processing server running 100 jobs per day. In your office you have 50 machines which are idle 16 hours a day, each of these machines is 10% as powerful as your beefy processing sever. (All results here are rounded to underestimate performance increase).</p>
<p>So, 1 machine * 10% power * 2/3 time = 0.067 i.e. 1 desktop processing in idle time could process <strong>6 full jobs per day</strong>.</p>
<p>If you now scale this up it takes <strong>15 idle desktops</strong> to process as many jobs per day as your main processing server does.</p>
<p>So in our pretend office of <strong>50 machines</strong> we could increase our processing power from 1 server up to <strong>4 full processing servers</strong>, or we could be processing<strong> 400 jobs per day </strong>instead of 100.</p>
<p>Notice, for <strong>no investment in new hardware</strong> your company has just<strong> increased its batch processing capacity 4 times</strong>! Potentially you&#8217;re going to increase your power usage but from most office environments I&#8217;ve been to machines are generally left on overnight anyway, so you could see this as a green initiative.</p>
<p>Other advantages also mean that investment in new (or updated) processing servers can be delayed if your office machines are sufficient and that as you improve the power of your office machines your office grid becomes more powerful automatically.</p>
<h2>Technologies</h2>
<p>What you need? (or more correctly what did I use):</p>
<ul>
<li>Idle office machines (in my case a spare old windows XP laptop)</li>
<li>VirtualBox (or another virtualisation client software)</li>
<li>A virtual machine with PHP, mySQL runningÂ  running a cut down OS, I&#8217;m calling these my <strong>LiMP servers</strong> :)</li>
<li>Jobs to run</li>
<li>Job server (can be another virtual machine somewhere)</li>
</ul>
<h2>Typical Jobs</h2>
<p>The types of jobs that this system is designed to run is as follows:</p>
<ul>
<li>System receives a list of data upon which we need to match and return results</li>
<li>Matching involves checking/searching several (fairly static) data sources</li>
<li>Results from data sources may require further validation, merging, checking of additional data sources in response to results</li>
<li>Data is returned with matching records, fully validated and processed</li>
<li>Each record within a job is independent of the rest</li>
</ul>
<p>So basically we&#8217;re looking at running jobs which require a mixture of database lookups and some number crunching, a fairly typical scenario in a business environment.</p>
<p>Grid solutions are not only advantageous for processing jobs of this type. Basically, any process which can be split into independent units can be run in parallel. See this wikipedia for examples and more information: <a title="Grid Computing" href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">Grid Computing</a>, but a couple of famous examples are <a title="SETI@Home" href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAcQFjAA&amp;url=http%3A%2F%2Fsetiathome.berkeley.edu%2F&amp;ei=apQZS46_COS2jAfrtImDBA&amp;usg=AFQjCNE7Tvfo6afud4XTSmeVQ_PRdqJ_8Q&amp;sig2=G8B2pKRcEzooLr7WUPRzdQ" target="_blank">Seti@Home</a> and <a title="BIONC" href="http://en.wikipedia.org/wiki/BOINC" target="_blank">BIONC</a>. There are frameworks for running computing grids, and these are well worth looking into.</p>
<h2>What will we achieve?</h2>
<p>By the end of these articles I hope to show that deploying an office grid need not be hugely expensive or time consuming. I&#8217;m going to discuss:</p>
<ul>
<li>Setting up the job control system, job configuration</li>
<li>Creating an appropriate processing virtual machine</li>
<li>How to setup the system on a windows machine</li>
<li>Ensuring you are using the latest code and data</li>
<li>Deployment and benchmarking</li>
<li>Looking ahead</li>
</ul>
<p>I&#8217;ll be building (ok I built, then wrote this) an example application to test the concepts on a local machine using windows XP and my &#8216;GridMachine&#8217; virtual machine. My job control server will be my main machine which runs <a title="Fedora" href="http://www.fedoraproject.org" target="_blank">Fedora 11</a>.</p>
<p>This is in no way meant to demonstrate a fully working robust system, its meant more of a demonstration and discussing showing that these things can be achieved in a reasonably short space of time and at little cost. Please feel free to send me any comments, corrections, or improvements and I&#8217;ll do my best to keep this article updated to match.</p>
<h2>Next time</h2>
<p>In <a href="http://www.evilprofessor.co.uk/126-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2">part 2</a> I will start by looking at the job control system, and look into how jobs should be configured in order to achieve greatest amount of processing whilst ensuring that each job is processed without fail.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1+http://is.gd/ehg5V" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1+http://is.gd/ehg5V" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1+http://is.gd/ehg5V" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1+http://is.gd/ehg5V" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1&amp;link=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1&amp;link=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+1" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Office Grid Computing using Virtual environments &#8211; Part 2</title>
		<link>http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/</link>
		<comments>http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:23:00 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Grid Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[job control]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=125</guid>
		<description><![CDATA[Introduction I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><em>I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I&#8217;m going to look at the potential benefits of employing an office <a href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">grid</a> using virtualised environments.</em></p>
<p>In <a href="http://www.evilprofessor.co.uk/122-utilising-office-computers-for-batch-processing-using-virtual-environments-part-1">Part 1</a> I gave an overview of the system and technologies I will be using as well as discussed some of the potential reasons why you would want to create an office grid.</p>
<h2>Job Control</h2>
<p>If you&#8217;re going to be running jobs then you&#8217;re going to need some way to manage them. Your job control system (on your job server) needs to be really well thought out before even attempting to run an office grid. So firstly, what are the tasks for a job control system:</p>
<ul>
<li>Hand out jobs upon request from workers</li>
<li>Tell workers what type of jobs to run</li>
<li>Track jobs</li>
<li>Ensure that jobs are only run once</li>
<li>Provide job data to workers, or at least tell them where to get it</li>
</ul>
<p>The system also needs to be extensible, a solution that works for now in a single case may be extended to run several types of jobs as the business sees the worth in a grid solution. For example, jobs may gain priorities, more than one job type may exist (i.e. several code bases), eventually you may even run several different worker machines that are optimised for each type of job (although that does move away from the &#8216;generic worker&#8217; idea). Always try to think about the future when developing systems, a short term vision can lead to longer term frustration and increased development time.</p>
<h2>Job Server</h2>
<p>We&#8217;re going to need somewhere to control our jobs from, this should be the only system in your grid that has a fixed resource locator, be that an IP address, host name, URL (using internal DNS), etc. This is because the workers need to know where to look for jobs, workers need to find the job control system (not the job control system find the workers).</p>
<p>The job server itself doesn&#8217;t really have a complicated task (in a basic system anyhow), it needs to store a list of jobs, hand out jobs, receive results, and subsequently store them for later retrieval. How these parts (such as &#8216;hand out jobs&#8217;) are defined can be very basic. Later on we can extend the system to include an administration interface to add, edit, delete, suspend jobs but this is beyond this exercise.</p>
<p>There is no reason whatsoever then that your job server could not be a virtual machine running within your main processing server provided it doesn&#8217;t drain too many resources from it. The job server however does need high availability, if it goes down on a Friday evening you&#8217;re going to lose a whole weekend of processing, potentially costing you a couple of weeks worth of processing time (when compared to your main processing server alone). You may want to consider putting your job server on a load balanced environment for high availability.</p>
<h2>Basic Setup</h2>
<p>The basic setup for our job server will consist of what I&#8217;m calling one of my <strong>LiMP servers</strong> (that is <strong>Li</strong>nux, <strong>m</strong>ySql, <strong>P</strong>HP). The code running on theÂ  workers will actually work out what jobs it can run by interacting with with job control system databases. Later on we could create a web service and actually hand out jobs rather than having the workers do the hard work themselves, but for now we&#8217;ll continue using the <a title="KISS principle" href="http://en.wikipedia.org/wiki/KISS_principle" target="_blank">KISS principle</a> (Keep it Simple, Stupid!).</p>
<p>So, lets create three <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a> tables to deal with jobs. These will be `jobs`, `jobRecords`, and `jobResults`.</p>
<p style="text-align: left;"><a class="tt-flickr tt-flickr-Medium" title="jobs table" href="http://www.evilprofessor.co.uk/gallery/photo/4141800891/jobs-table.html"><img class="aligncenter" src="http://farm3.static.flickr.com/2753/4141800891_7c606f7b24.jpg" alt="jobs table" width="500" height="270" /></a> Here I&#8217;m using <a title="SQL Buddy" href="http://www.sqlbuddy.com/" target="_blank">SQL Buddy</a> a great little alternative to <a title="phpMyAdmin" href="http://www.phpmyadmin.net/home_page/index.php" target="_blank">phpMyAdmin</a> just because its easier to install on centOS (for others see: <a title="10 Great Alternatives to phpMyAdmin" href="http://www.webdesigneronline.co.uk/10-great-alternatives-to-phpmyadmin" target="_blank">10 Great alternatives to phpMyAdmin</a>)</p>
<p style="text-align: left;">This table consists of 5 simple fields,</p>
<ul>
<li><strong>id: </strong>Uniquely identify the job</li>
<li><strong>name: </strong>Could be a client reference, or any number of other identifiers</li>
<li><strong>Status:</strong> You need to know where the job is at, e.g.
<ul>
<li><strong>0: </strong>Not started</li>
<li><strong>1: </strong>Picked up</li>
<li><strong>2:</strong> Completed</li>
</ul>
</li>
<li><strong>started_by: </strong>Who&#8217;s started doing the job? This isn&#8217;t entirely required but is a nice to have. I&#8217;d suggest tracking workers by their IP address on your network</li>
<li><strong>started_at: </strong>When did the worker start the job? By tracking jobs that have not completed within X amount of time we know we need to pick up the job once again and start processing by another worker. Workers could stop processing/go offline for any number of reasons, power failure, crash, network loss, etc.</li>
</ul>
<p>It is easy how this table could be extended with a few additional fields to allow for statistics tracking, a finish time column to see how long the job took, a counter to see how many workers picked up the job (obviously this needs to tend to 1), job priority, the list can go on and on. In more complex job scenarios it would be possible to specify how much memory the worker would need access to (and therefore only use suitable workers), or even what type of worker would be required.</p>
<p>Lets add a few example jobs:</p>
<p><a class="tt-flickr tt-flickr-Small" title="example jobs" href="http://www.evilprofessor.co.uk/gallery/photo/4142891139/example-jobs.html"><img class="aligncenter" src="http://farm3.static.flickr.com/2709/4142891139_24ab23b9b8_m.jpg" alt="example jobs" width="465" height="99" /></a></p>
<p>The next table again is quite simple to understand, these are our job records. They are linked to the main jobs table by a column `jobs_id`. The make up of this table very much depends on the data that you need to supply to your workers, lets make a very simple example where we have four columns:</p>
<ul>
<li><strong>id:</strong> ID of the record</li>
<li><strong>name: </strong>Person&#8217;s name</li>
<li><strong>address: </strong>Person&#8217;s address</li>
<li><strong>jobs_id: </strong>The job ID that this record is linked to</li>
</ul>
<p>The third and final table consists of a results table, it has much the same make up as our records table, and with the addition of some columns could be part of the records table:</p>
<ul>
<li><strong>job_record_id: </strong>Link the result to the job table</li>
<li><strong>result: </strong>The result data</li>
</ul>
<p>&#8230;and that&#8217;s all you need for job control! (albeit at a very basic level) In my case I&#8217;m pointed to another table where my data to process was located, but this could just as easily been a file, parameters to run simulation code, you name it.</p>
<h2>Selecting a job</h2>
<p>As stated previously, the workers will do our job management for us for now, so all we need to really do is find a job that needs processing and get the information. How would we do this? Well pick our job selection criteria and look for jobs, in SQL I did the following:</p>
<ol>
<li>Take any jobs that are not marked as complete but from our worker and reset them (substitute __ME__ with an identifier, easiest would be IP address):
<pre>UPDATE `jobs` SET `status` = 0 WHERE `status` = 1 AND `started_by` = __ME__;</pre>
</li>
<li>Using our job selection criteria, select a job and tell the control system that this worker is dealing with it:
<pre>UPDATE `jobs` SET `status` = 1, `started_by` = __ME__, `started_at` = NOW() WHERE `status` = 0 OR
(`status` = 1 AND `started_at` &gt; DATE_SUB(NOW(), INTERVAL X HOUR)) ORDER BY `id` ASC;</pre>
<p>By grabbing jobs that haven&#8217;t returned results in X amount of time we ensure that all jobs are run in the event of a worker crashing or going AWOL.</li>
<li>Next grab the jobs details followed by the records themselves:
<pre>SELECT * FROM `jobs` WHERE `started_by` = __ME__  LIMIT 1;
SELECT * FROM `job_records` WHERE `id` = __JOBID__;</pre>
</li>
</ol>
<p>Upon completion of the job we insert our result records and mark the job as complete. Remember as jobs can suspend/resume at any time allow for some robustness in your script. It might be that the task suspends half way through updating the job control system, so checking the number of records in a job and the number of results saved back to the job control system would be a wise move.</p>
<p>In addition, whilst this demonstrates how jobs can be selected and managed from an SQL-query frame you should really be <a href="http://en.wikipedia.org/wiki/Abstraction" target="_blank">abstracting</a> your job control so that if you decide to switch to using a web service, a file based system, <a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">XML</a>, or any other number of systems it will not affect the code above it.</p>
<h2>Job Configuration</h2>
<p>The next aspect to consider is job size and configuration. By playing with job configuration we can strike an excellent balance between speed, process replication, and reliability. Take a couple ofÂ  scenarios:</p>
<ol>
<li><strong>Jobs take 1 day each to run: </strong>This means that your workers need 15 days to process each job (remember 10% of the power for 2/3rds of the time). This is clearly not a wise configuration, your job size is way too big! It would take at least double the time to get a job processed should the initial worker go AWOL (time to pick up that it hasn&#8217;t returned a result plus reprocessing time). In an ideal you&#8217;d have at least one full job <strong>easily cleared </strong>by the end of each long idle period, that way you keep the jobs ticking over and at worst case a job would take two days to process should the first go missing.</li>
<li><strong>Jobs take 1 minute to run: </strong>This means that your workers take about 15 minutes to run each job. Whilst this may initially seem ideal, you gain additional work processing during lunch time, coffee breaks, meetings, etc this scenario puts strain on other areas of your system and introduces its own problems. For example, firstly your setup/processing time ratio is going to go right down, therefore losing system efficiency. Your network is going to be constantly streaming job information to the various workers frustrating staff who are dong their day to day work. You&#8217;re also going to put more strain on your job processing server as it has to dish out lots and lots of small pieces of work on a regular basis. Lastly, in this situation if your job server goes down you&#8217;re going to create a huge back log of uncompleted work whereas bigger jobs could of continued processing blissfully unaware that the job server was experiencing difficulties.</li>
</ol>
<p>In reality there will be no one ideal configuration for your grid setup, much depends on the available resources, types of job, job turnaround time requirements, network capability, and so on. However some guidelines would be:</p>
<ul>
<li>Size jobs so that each worker can get through at least 3-4 jobs in a period of 15 hours (the longest likely idle time period)</li>
<li>Play with the job size so that setup time becomes fairly insignificant compared to the processing time (bearing in mind the above point).</li>
<li>If a job doesn&#8217;t complete in double the amount of time (maybe less) you expect it to complete it assume that its gone AWOL and start processing it with another worker. This means you may have to wait up to three times the normal length of a job for it to complete (possibly longer if the subsequent job fails). You may want to reduce this time, but be careful not to reduce it too much as you may start <strong>duplicating processing tasks</strong> on a regular basis.</li>
<li>Jobs should be independent of outside requirements as much as possible. The job server, for example, should only be contacted at the start and end of every job.</li>
<li>Don&#8217;t saturate your network, this will have two negative effects, your daytime staff will find using the network frustrating and problems may be experienced with connections timing out a problem that will only get worse as you scale your grid.</li>
<li>Ensure jobs can run on your workers. If jobs become too memory intensive or disk space intensive jobs will start aborting and the only thing you&#8217;ll notice is a drop in number of jobs processed with no real reason why.</li>
</ul>
<h2>Submitting Results of a Job</h2>
<p>When submitting the results of a job it is important to check that results have not been submitted by another worker, especially if the current worker has been dormant for some time.</p>
<p>When results are submitted ensure that the number of results matches the number of records within the job.</p>
<p>As stated previously, and can not be over emphasised, build fault tolerance into job retrieval and results submission. The workers can (and most likely will) go into suspend mode at the most inconvenient of times and this needs to be catered for. Also once again abstracting away your results submission will help cater for future changes to your job control system much easier to deal with.</p>
<h2>Summary</h2>
<p>In this sectionÂ  we have looked at what a job control server needs to do and how to get a very basic system set up. We discussed how to retrieve a job from the control system and how best to configure jobs to get the most our of your office grid system. To finish, a paragraph or two on submitting results back to the job control server was presented.</p>
<ul>
<li>A job control server manages jobs and ensures that all work units are completed</li>
<li>By abstracting your job select/results submission we can change the technology of the control server without much problems</li>
<li>Configure your jobs to ensure that they are run quickly and efficiently without putting too much pressure on your network infrastructure, and without duplicating processing tasks on a regular basis.</li>
<li>Ensure that you build fault tolerance and error checkingÂ  into your routines, workers can suspend and resume and the most inconvenient of times. Remember to check if results have already been submitted by another worker.</li>
</ul>
<h2>Next time</h2>
<p>In <a href="http://www.evilprofessor.co.uk/129-office-grid-computing-using-virtual-environments-part-3/">part 3 </a>we&#8217;ll create our virtual processing machine and set up our windows machines to become idle-time workers.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2+http://is.gd/ehg5W" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2+http://is.gd/ehg5W" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2+http://is.gd/ehg5W" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2+http://is.gd/ehg5W" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2&amp;link=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2&amp;link=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+2" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/125-utilising-office-computers-for-batch-processing-using-virtual-environments-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Office Grid Computing using Virtual environments &#8211; Part 5</title>
		<link>http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/</link>
		<comments>http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:03:08 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Grid Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[improve]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[worker]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zned]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=131</guid>
		<description><![CDATA[Introduction I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><em>I work in a company where we run many batch jobs processing millions of records of data each day and I&#8217;ve been thinking recently about all the machines that sit around each and every day doing nothing for several hours. Wouldn&#8217;t it be good if we could use those machines to bolster the processing power of our systems? In this set of articles I&#8217;m going to look at the potential benefits of employing an office <a href="http://en.wikipedia.org/wiki/Grid_computing" target="_blank">grid</a> using virtualised environments.</em></p>
<p>In <a href="http://www.evilprofessor.co.uk/130-office-grid-computing-using-virtual-environments-part-4/">Part 4</a> we looked at using tools to ensure that we&#8217;re running the latest version of the code and data sources so that obtained results are always up-to-date with the latest business information and logic.</p>
<h2>Pre-Deployment</h2>
<p>Before deploying your grid system if there&#8217;s one thing you do and one thing alone it&#8217;s <strong>benchmark your current system</strong>! No matter what you tell colleagues about how much extra work your system is going to do unless you have numbers to back this up your guarantees are nothing. So,</p>
<ul>
<li>how many records can you process currently? Per Day? Per Hour?</li>
<li>How long does it typically take to turn around a job?</li>
<li>How much more capacity do you have?</li>
</ul>
<p>There&#8217;s also additional questions:</p>
<ul>
<li>If your processing server (or one of your processing servers) goes down how will this affect your capabilities, will you be crippled?</li>
<li>What advantages do you hope/expect to get from a grid system?</li>
<li>Are your office machines capable of running the jobs?</li>
<li>Are your (or can you jobs be converted) to wrok in this style of running?</li>
</ul>
<p>The last major point is to take your time on any major change like this. Update your processing code to work using the new methodology, benchmark again. Possibly set up your processing server to run a virtual machine, after all your processing server will just be another worker (just a very powerful one relatively). Allow the new process to settle.</p>
<h2>Deployment</h2>
<p style="padding-left: 30px;"><em>My suggestion would be to pop into the office one weekend perform all the installations and setup. Do this just before a fortnight&#8217;s holiday and leave so other poor chap to deal with the consequences&#8230;</em> maybe not&#8230;</p>
<p>Deployment for a system like this needs to be slow. Despite it being relatively simple to set up this system will affect your entire office infrastructure (well the digital one). Firstly, roll out to a couple of machines at a time, monitor network traffic, how the worker hosts perform on a day-to-day basis. You may need to alter your job configuration in response to your findings.</p>
<p>Once the system has settled with a few machines (lets say 10% of all office machines, i.e. 5) keep monitoring network traffic and host machine performance.Â  Next benchmark again, you should now be processing 33% more jobs than your first benchmarks. Check this is so, or that you&#8217;re at least in this ballpark. If not, investigate what is going on before moving on. Repeat this cycle until you happily have all office machines running without killing individual machine performance or grinding your network to a standstill.</p>
<p>At all times keep benchmarking, even after all deployments are made. Check how new code updates affect speed of your system, check all workers are reporting in and processing jobs. Slowly (very slowly) increment your job configuration to get the best from your workers and network.</p>
<h2>Stop!</h2>
<p>What if you want to stop your workers from running at some time? They are all out there running, regenerating, and trying their best to process data like hungry insects. The answer may seem obvious but its worth adding just in case its overlooked. Simply edit your processing script with an exit(0) or die() or some other statement to kill your processing job. An important reason why we always try to update to the latest processing script before any run!</p>
<h2>Demonstration System</h2>
<p>In order to write this set of short articles I created a very small grid to demonstrate the technologies and methodologies. I read lots of articles, tutorials, and used various tools to setup and monitor what was going on. By no means have I gone out and saturated a whole office with traffic and nor have I had access to a regular staff members PC to see how host performance was affected.</p>
<p>My demonstration system was very humble indeed. I used my regular desktop set up as a job control server. On this I had installed <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a> server installed set up as a master in replication, <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a>,Â  and SVN linked through apache (for access via worker VM).</p>
<p>I then created a centOS worker machine on VirtualBox on a 6 year old windows XP laptop. I setup scheduled tasks as specified after copying the VM onto the machine and let it go.</p>
<p>The virtual machine was set up with PHP, subversion, and mySQL. I checked out a branch named &#8216;worker&#8217; from my job control servers repository and made sure it could be updated using &#8216;svn update&#8217;. Next I setup mySQL as a slave and checked that data was replicating from mySQL on the job control server down to the worker VM. After all this I setup the bash script and the cron job.</p>
<p>My processing script basically went along the lines of this (very simple stuff):</p>
<ul>
<li> Read in the name field</li>
<li>Counted the number of similar names in a table from the data source held on the VM</li>
<li>Counted the number of names as above but splitting the name by spaces (i.e. forename, middle, surname)</li>
<li>Repeated this process 1,000 times</li>
</ul>
<p>Each job took approximately 20 minutes to run. At one point I opened several copies of the worker VM on the windows laptop and watched the jobs be checked off by each of the worker IP addresses. At this point I also confirmed that replication automatically restarted.</p>
<p>Leaving the laptop to idle resulted in a worker starting to process jobs from the job control server. When resuming laptop usage there was a delay of about 30-60 seconds, this is a fair amount of time and staff would need to be made aware that their machine may pause for a short while when returning to the machine. Newer machines may not have a pause of this long. The benefit of the amount of processing performed by these machines during idle periods would more that outweigh staff members having to wait a short period (say 1 minute) on arriving at their machines of a morning (I frequently wait longer that this for a Windows Defender update to take place) provided they were made aware of this (useful time to grab a morning coffee!).</p>
<p>Overall I feel confident that I have demonstrated the technologies that could be used to create such a system. I have shown that such a system does work on a (very) small scale and with some more experimenting could be scaled up utilise the resources of an office&#8217;s machines. If I don&#8217;t get to the point of doing this I would be very interested to know/see when someone else does.</p>
<h2>Conclusions / Evaluation</h2>
<p>The next obvious step would be to actually get a real world example and start to deploy a system such as this within an office environment and see what happens. Asking a business to commit to this without a trail blazing company to prove the technology and effectiveness may be a little difficult. Grid/Distributed computing is very popular is some circles and has some large applications (BIONC, SETI@Home, Folding@Home, etc). I did not, however, find a smaller scale and simple system like this in my searches that could be rolled out within an office environment.</p>
<p>I created a basically free system using mostly open source software and tools available in almost any office. The technologies were basically demonstrated and show to perform and work as expected. Hopefully I have show that with not much work and with a very simple setup you can deploy an office grid computing system that is powerful, cheap,Â  and scalable all at the same time.</p>
<p>Once a system is up and running there is almost no end to the amount of customisation and improvements you can make. For example statistics / benchmarking can easily be added showing the worth of such a system every day. New machines can be added quickly and easily as and when they arrive with upgrades to existing hardware bolstering your processing power.</p>
<p>I hope you&#8217;ve enjoyed reading this series of articles and its given you food for thought on running an office grid system. The solution presented here won&#8217;t necessarily work in all situations but should be adaptable to allow you to get your data processing done using your own solution.</p>
<p>Please feel free to send me any comments, corrections, or improvements and I&#8217;ll do my best to keep this article updated to match.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5+http://is.gd/ehfAK" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5+http://is.gd/ehfAK" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5+http://is.gd/ehfAK" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5+http://is.gd/ehfAK" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;submitHeadline=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;t=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5&amp;link=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5&amp;link=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/&amp;title=Office+Grid+Computing+using+Virtual+environments+%E2%80%93+Part+5" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/131-office-grid-computing-using-virtual-environments-part-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework: Fundamentals &#8211; Review</title>
		<link>http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/</link>
		<comments>http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 22:42:27 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Courses]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[course]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[dynamic libraries]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[fundamentals]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[summary]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[webex]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=117</guid>
		<description><![CDATA[For developers who haven't had time to look at the Zend Framework this course (Zend Framework: Fundamentals) offers a good overall picture of the framework introducing you to the key areas and giving enough information in order to continue. For those who have spent time looking at the framework and have followed one or two tutorials this course does not offer much beyond.]]></description>
			<content:encoded><![CDATA[<p>My employer recently paid for a group of us developers to take the <a title="Zend Framework: Fundamentals" href="http://www.zend.com/services/training/course-catalog/zend-framework" target="_blank">Zend Framework: Fundamentals</a> course, here I&#8217;ll summarise my thoughts and opinions on the course for others. For those looking to save time, here&#8217;s my summary:</p>
<p><em>For developers who haven&#8217;t had time to look at the <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a> this course (Zend Framework: Fundamentals) offers a good overall picture of the framework introducing you to the key areas and giving enough information in order to continue. For those who have spent time looking at the framework and have followed one or two tutorials this course does not offer much beyond.</em></p>
<h2>Background</h2>
<p>I&#8217;ve been a <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> developer for around 5-6 years, and have started working with the Zend Framework on a component basis over the last 6 months. I&#8217;ve developed and/or been a developer on a couple of small Zend Framework <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" class="kblinker" target="_blank" title="More about MVC &raquo;">MVC</a> sites.Â  I&#8217;ll be honest, I haven&#8217;t had a huge amount of exposure to other frameworks from a coding point of view but have spent several hours researching the project websites and evaluating them.Â  The framework and the community surrounding Zend Framework it is quite exciting and there seem to be huge possibilities in where its going.</p>
<h2>About the Course</h2>
<p>The course is delivered over 9 two hour webex sessions (with a 10-minute break in the middle). The time is spent going through a set of slides provided by Zend with discussion at any time. You can use a microphone to talk to the instructor, but to be honest I didn&#8217;t see anyone use anything more than the chat window. In addition a VMWare Ubuntu machine is provided that has example code and projects set up an a trial version of Zend Studio. The course leader talks to attendees either over an integrated VoIP solution, or you can dial in using one of the many worldwide dial in numbers.</p>
<p>During the course the material consists of a brief overview of the Framework and the MVC pattern before heading into a sample guestbook application. The discussion demonstrated bootstrapping, Zend_Application, Db Tables, Database access, Forms, Filtering, ACL, Validating, etc, etc. Basically covering all the topics you&#8217;d require to get a basic site up an running all the time giving you the tools to go and get more advanced in the framework (although this did amount to &#8216;See the website&#8217; much of the time).</p>
<p>Time is given to code up some examples, and to develop the &#8216;guestbook&#8217; and simple &#8216;wiki&#8217; application. Personally I felt that providing the code or each app and then asking us to develop what was essentially a copy alongside didn&#8217;t really provide a good learning experience. I would have preferred to develop an application similar, but not identical. to the example application with the benefit of having a guide to refer to. Alternatively building the applications from scratch with the demonstrator would of possibly led to more questions about <strong>why</strong> and <strong>how</strong>, thus giving a better understanding of the framework, after all you can look up specifics after the course.</p>
<p>The last lecture consisted of working on the wiki application with help/guidance from the instructor. After the course feedback was taken, it was emphasised several times through the course that Zend takes feedback very seriously, in fact apparently our version of the course was quite new. Some of the other developers in the company will be taking the course soon so it will be interesting to see if this has happened.</p>
<p>The course style was informal, allowed for feedback and collaboration between attendees and the instructor. The course leader was friendly, approachable (email addresses were shared for questions), and whilst his presentation from the slides was a bit shaky seemed fully competent in the framework. He was clearly someone who used the framework on a regular basis rather than someone who is taught to teach the course, I liked the &#8216;real world&#8217; experience in that respect.</p>
<h2>Overall Feeling</h2>
<p>In some ways I found the course a waste of time, in others it was very handy. Hopefully I&#8217;ll get my reasons across clearly, and maybe provide some food for thought or useful feedback (knowing me this is unlikely!).</p>
<p>For myself this course was aimed at too low a level. Having gone through the quickstart guide, read Rob Allen&#8217;s Zend Framework in Action, and worked with the framework a little I didn&#8217;t really get anything too much. I would of liked the course to pick up from the end of the quickstart and develop additional skills.</p>
<p>That said, the course title does clearly state &#8220;Zend Framework: <strong>Fundamentals</strong>&#8221; and in that aspect the course achieves what it sets out to do. Other members of the development team that haven&#8217;t spent the time looking into the framework finished each session with enthusiasm and asked questions which was really nice to see.</p>
<p>All was not lost, it was good to spend time confirming the basic details of the framework and get to ask a couple of questions in areas where I wasn&#8217;t 100%. It was also time that I got to sit down each day and think about coding using the framework and future projects, something I wouldn&#8217;t of been able to do otherwise (can you imagine your company agreeing to that? :) ). Last but not least you also get a nice certificate from Zend to say that you attended the course (albeit by email).</p>
<h3>Zend Framework Certification</h3>
<p>This was one question that kept coming to mind during the course, would it prepare me for the certification? The quick, easy is a resounding <strong>No</strong>. The course instructor was quite clear on that with the additional advice that for the certification you should really be using the framework on a day to day basis and feel very comfortable and confident in its usage and methodologies.</p>
<h2>Summary</h2>
<p>Given everything I&#8217;ve written above, I&#8217;ll summarise everything in two easy bullet points:</p>
<ul>
<li><em>New to Zend Framework: </em>This course does exactly what you&#8217;d expect, it gives you a nice introduction to the framework and a good grounding on the basics from which you can build. The course seems to generate interest and enthusiasm for the framework amongst developers.</li>
<li><em>Used the Zend Framework: </em>While it was nice to shore up some of the very basics I felt the time, effort, and funds to take the course could of been better spent elsewhere. It will be nice to seeÂ  Zend create a new higher level course to take developers to the next level &#8211; at least to the standard of certification and beyond. <strong>For that I would sign up immediately.</strong></li>
</ul>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Zend+Framework%3A+Fundamentals+%E2%80%93+Review+http://is.gd/ehg60" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Zend+Framework%3A+Fundamentals+%E2%80%93+Review+http://is.gd/ehg60" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Zend+Framework%3A+Fundamentals+%E2%80%93+Review+http://is.gd/ehg60" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Zend+Framework%3A+Fundamentals+%E2%80%93+Review+http://is.gd/ehg60" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;submitHeadline=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;submitHeadline=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;t=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;t=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;t=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;t=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review&amp;link=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review&amp;link=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/&amp;title=Zend+Framework%3A+Fundamentals+%E2%80%93+Review" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/117-zend-framework-fundamentals-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[notice] child pid XXXX exit signal Segmentation fault (11)</title>
		<link>http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/</link>
		<comments>http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:09:52 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[blank page]]></category>
		<category><![CDATA[dynamic libraries]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[segmentation fault]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=115</guid>
		<description><![CDATA[If you've recently upgraded PHP or Apache you maybe coming up against the issue of your webserver returning blank pages, and throwing error messages into your logs with no idea why, here's one possible way to fix it...]]></description>
			<content:encoded><![CDATA[<p><em>If you&#8217;ve recently upgraded <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> or Apache you maybe coming up against the issue of your webserver returning blank pages, and throwing error messages into your logs with no idea why, here&#8217;s one possible way to fix it&#8230;<br />
</em><br />
I&#8217;ve had this problem a couple of times recently after upgrading Apache or PHP on a virtual machine. The first time I noticed the error I simply reverted to a backup of my VM but the second time I realised I&#8217;d have to look into the issue.</p>
<p>The first time I noticed the issue some of my web pages were being served as blank files while the others worked absolutely fine. After some investigation I noted that apache was writing out to /var/log/http/error_log with the following message repeatidly:</p>
<p><strong>[notice] child pid XXXX exit signal Segmentation fault (11)</strong></p>
<p>There&#8217;s not allot to go by on-line, and most of the pages about it trail off to nothing. That said, I narrowed down the issue to PHP crashing when trying to unneeded dynamic libraries. </p>
<p>Looking at my php.ini (/etc/php.ini) I commented out all of the dynamic libraries loaded planning on commenting them back in as required. The two I had to take out where <strong>pdo.so</strong> and <strong><a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mysql</a>.so</strong>. </p>
<p>Once these were removed all my web pages were being served fine, just as before the PHP/Apache update.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...+http://is.gd/ehg61" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...+http://is.gd/ehg61" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...+http://is.gd/ehg61" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...+http://is.gd/ehg61" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;submitHeadline=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;submitHeadline=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;t=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;t=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;t=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;t=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...&amp;link=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811...&amp;link=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/&amp;title=%5Bnotice%5D+child+pid+XXXX+exit+signal+Segmentation+fault+%2811..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/115-notice-child-pid-xxxx-exit-signal-segmentation-fault-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless on Acer 5002 WLMi on Linux (Fedora 11)</title>
		<link>http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/</link>
		<comments>http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 21:48:05 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=111</guid>
		<description><![CDATA[As I&#8217;ve spent another few hours today without internet access I thought I&#8217;d better get this written down so that next time I mess my laptop up the information is easy to fix. Basically to get wireless drivers working for an Acer 5002 WLMi you&#8217;ll need to use b43-fwcutter. Instructions can be found here: Linux [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve spent another few hours today without internet access I thought I&#8217;d better get this written down so that next time I mess my laptop up the information is easy to fix.</p>
<p>Basically to get wireless drivers working for an Acer 5002 WLMi you&#8217;ll need to use b43-fwcutter. Instructions can be found here: <a href="http://linuxwireless.org/en/users/Drivers/b43">Linux Wireless B43</a>.</p>
<p>Easy once the information is located.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...+http://is.gd/ehg62" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...+http://is.gd/ehg62" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...+http://is.gd/ehg62" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...+http://is.gd/ehg62" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;submitHeadline=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;submitHeadline=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;t=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;t=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;t=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;t=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...&amp;link=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11...&amp;link=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/&amp;title=Wireless+on+Acer+5002+WLMi+on+Linux+%28Fedora+11..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/111-wireless-on-acer-5002-wlmi-on-linux-fedora-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Html Table Generating Class (HtmlTable.php)</title>
		<link>http://www.evilprofessor.co.uk/101-html-table-generating-class/</link>
		<comments>http://www.evilprofessor.co.uk/101-html-table-generating-class/#comments</comments>
		<pubDate>Tue, 05 May 2009 21:11:26 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=101</guid>
		<description><![CDATA[I required to generate a HTML table from PHP data for a project that I was working on. Unfortunately after a bit of Googling I couldn&#8217;t really find anything that was suitable so I decided to create my own. I realise that this may not be the best table generating class ever and there&#8217;s probably [...]]]></description>
			<content:encoded><![CDATA[<p>I required to generate a HTML table from <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> data for a project that I was working on. Unfortunately after a bit of Googling I couldn&#8217;t really find anything that was suitable so I decided to create my own.</p>
<p>I realise that this may not be the best table generating class ever and there&#8217;s probably a few bugs still in it, but I&#8217;d prefer to share and if anyone wants a better version I&#8217;ll look into it :) I originally wanted to create a table built up of seperate objects e.g. cell object, row object (built up of cell objects), but I realised the overhead on this would be HUGE! So I&#8217;ve gone back to an array setup.</p>
<p>The class will calculate the maximum number of columns used in the header, footer, or body and write out that number of columns. Headers, Footers, and the Caption are optional. Attributes are made up of an array where the key is the attribute name and the value is the attribute value. Attributes are applied to table tag (on table creation &#8211; class initialisation), table rows (array[row][attribute]), and table cells (array[row][column][attribute]) this applies for headers, footers, and the table body.</p>
<h2>Example</h2>
<p>I always find the best way to look at something is to use an example so here we go:</p>
<pre name="code" class="php">
$table = new HtmlTable( array('class' =&gt;'sortable',
                'style' =&gt; 'width: 550px;'));
$header[0][0]['content'] = 'ID';
$header[0][1]['content'] = 'Title';
$header[0][2]['content'] = 'Date';
$header[0][3]['content'] = 'Site';

$table-&gt;addHeader($header);
$i = 0;
foreach ($newsList AS $newsItem) {
$itemLink = "{$newsItem['title']}";
$tableBody[$i] = array(0 =&gt; array('content' =&gt; $newsItem['id'],
'attributes' =&gt; array('style' =&gt; 'font-weight: bold;')),
1 =&gt; array('content' =&gt; $itemLink),
2 =&gt; array('content' =&gt; $newsItem['date_posted']),
3 =&gt; array('content' =&gt; $newsItem['site']) );
$i++;
}
$table-&gt;addBody($tableBody);
echo $table-&gt;drawTable();
</pre>
<table class="sortable" style="width: 550px;" border="0">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Date</th>
<th>Site</th>
</tr>
</thead>
<tbody>
<tr>
<td style="font-weight: bold;">9</td>
<td>News 1</td>
<td>2009-04-04 10:40:00</td>
<td>site name</td>
</tr>
<tr>
<td style="font-weight: bold;">10</td>
<td>News 2</td>
<td>2009-04-04 12:44:11</td>
<td>site name</td>
</tr>
</tbody>
</table>
<p>And the HTML looks like this:</p>
<pre id="line34">&lt;<span class="start-tag">table</span><span class="attribute-name"> class </span>=<span class="attribute-value"> "sortable" </span><span class="attribute-name">style </span>=<span class="attribute-value"> "width: 550px;" </span>&gt;
&lt;<span class="start-tag">thead</span>&gt;
	&lt;<span class="start-tag">tr</span><span class="attribute-name"> </span>&gt;
		&lt;<span class="start-tag">th</span><span class="attribute-name"> </span>&gt;ID&lt;/<span class="end-tag">th</span>&gt;</pre>
<pre id="line46">		&lt;<span class="start-tag">th</span><span class="attribute-name"> </span>&gt;Title&lt;/<span class="end-tag">th</span>&gt;
		&lt;<span class="start-tag">th</span><span class="attribute-name"> </span>&gt;Date&lt;/<span class="end-tag">th</span>&gt;
		&lt;<span class="start-tag">th</span><span class="attribute-name"> </span>&gt;Site&lt;/<span class="end-tag">th</span>&gt;
&lt;/<span class="end-tag">tr</span>&gt;
&lt;/<span class="end-tag">thead</span>&gt;
&lt;<span class="start-tag">tbody</span>&gt;
	&lt;<span class="start-tag">tr</span><span class="attribute-name"> </span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> style </span>=<span class="attribute-value"> "font-weight: bold;" </span>&gt;9&lt;/<span class="end-tag">td</span>&gt;</pre>
<pre id="line54">		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;News 1&lt;/<span class="end-tag">td</span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;2009-04-04 10:40:00&lt;/<span class="end-tag">td</span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;site name&lt;/<span class="end-tag">td</span>&gt;
&lt;/<span class="end-tag">tr</span>&gt;
	&lt;<span class="start-tag">tr</span><span class="attribute-name"> </span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> style </span>=<span class="attribute-value"> "font-weight: bold;" </span>&gt;10&lt;/<span class="end-tag">td</span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;News 2&lt;/<span class="end-tag">td</span>&gt;</pre>
<pre id="line61">		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;2009-04-04 12:40:00&lt;/<span class="end-tag">td</span>&gt;
		&lt;<span class="start-tag">td</span><span class="attribute-name"> </span>&gt;site name&lt;/<span class="end-tag">td</span>&gt;
&lt;/<span class="end-tag">tr</span>&gt;</pre>
<pre id="line176">&lt;/<span class="end-tag">tbody</span>&gt;
&lt;/<span class="end-tag">table</span>&gt;</pre>
<h2>Code</h2>
<p><strong><a title="Html Table Generating Class" href="http://www.evilprofessor.co.uk/wp-content/uploads/2009/05/htmltablephp.txt" target="_blank">HtmlTable.php</a></strong><br />
If you have any comments please make them below, it would be great to hear some. If you end up using it also let me know and I&#8217;ll extend it in the future :)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Html+Table+Generating+Class+%28HtmlTable.php...+http://is.gd/ehg63" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Html+Table+Generating+Class+%28HtmlTable.php...+http://is.gd/ehg63" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Html+Table+Generating+Class+%28HtmlTable.php...+http://is.gd/ehg63" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Html+Table+Generating+Class+%28HtmlTable.php...+http://is.gd/ehg63" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;submitHeadline=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;submitHeadline=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;t=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;t=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;t=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;t=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Html+Table+Generating+Class+%28HtmlTable.php...&amp;link=http://www.evilprofessor.co.uk/101-html-table-generating-class/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Html+Table+Generating+Class+%28HtmlTable.php...&amp;link=http://www.evilprofessor.co.uk/101-html-table-generating-class/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/101-html-table-generating-class/&amp;title=Html+Table+Generating+Class+%28HtmlTable.php..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/101-html-table-generating-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log to DB using Zend Framework</title>
		<link>http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/</link>
		<comments>http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 21:06:30 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[writers]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=98</guid>
		<description><![CDATA[I&#8217;ve managed to get a site up and running with the Zend Framework, everything is logging nicely to FireBug/FirePHP so next step was to log to the DB. I also wanted to log some additional information using the framework such as user agent, date and time, get and post variables. So to extend the manual [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve managed to get a site up and running with the <a href="http://framework.zend.com" class="kblinker" target="_blank" title="More about Zend Framework &raquo;">Zend Framework</a>, everything is logging nicely to FireBug/FirePHP so next step was to log to the DB. I also wanted to log some additional information using the framework such as user agent, date and time, get and post variables. So to extend the manual a little here&#8217;s what I did:</p>
<p><code>// Set up logging to DB<br />
$db = <a href="http://framework.zend.com/manual/en/zend.registry.html" class="kblinker" target="_blank" title="More about Zend_Registry &raquo;">Zend_Registry</a>::get('dbAdapters');<br />
$db = $db['general'];</p>
<p>$columnMapping = array(	'priority' 	=> 'priority',<br />
						'message' 	=> 'message',<br />
						'datetime' 	=> 'timestamp',<br />
						'user_agent'=> 'user_agent',<br />
						'get_vars'	=> 'get_vars',<br />
						'post_vars'	=> 'post_vars',<br />
						'site'		=> 'site'<br />
						);</p>
<p>$writerDb   = new Zend_Log_Writer_Db($db, 'error_logging', $columnMapping);<br />
$logger 	= new Zend_Log($writerDb);</p>
<p>$logger->setEventItem('datetime',date('Y-m-d H:i:s'));<br />
$logger->setEventItem('user_agent',$_SERVER['HTTP_USER_AGENT']);<br />
$logger->setEventItem('get_vars',print_r($_GET,true));<br />
$logger->setEventItem('post_vars',print_r($_POST,true));<br />
$logger->setEventItem('site',SITE);	</p>
<p>$logger->info('Informational message');</code></p>
<p>Where the array keys in $columnMapping are my column names. &#8216;Priority&#8217; and &#8216;message&#8217; are understood by <a href="http://framework.zend.com/manual/en/zend.log.writers.html">Zend_Log_Writers</a> but the additional fields were added to give me some additional information.</p>
<p>Obviously this assumes that you have logging working using one of the other writers first :)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Log+to+DB+using+Zend+Framework+http://is.gd/ehg65" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Log+to+DB+using+Zend+Framework+http://is.gd/ehg65" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Log+to+DB+using+Zend+Framework+http://is.gd/ehg65" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Log+to+DB+using+Zend+Framework+http://is.gd/ehg65" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;submitHeadline=Log+to+DB+using+Zend+Framework" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;submitHeadline=Log+to+DB+using+Zend+Framework" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;t=Log+to+DB+using+Zend+Framework" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;t=Log+to+DB+using+Zend+Framework" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;t=Log+to+DB+using+Zend+Framework" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;t=Log+to+DB+using+Zend+Framework" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Log+to+DB+using+Zend+Framework&amp;link=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Log+to+DB+using+Zend+Framework&amp;link=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/&amp;title=Log+to+DB+using+Zend+Framework" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/98-log-to-db-using-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Names Directory and Facebook Application</title>
		<link>http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/</link>
		<comments>http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 09:33:05 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News about Work]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hits]]></category>
		<category><![CDATA[indexed]]></category>
		<category><![CDATA[names]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=95</guid>
		<description><![CDATA[One of the fun things I&#8217;ve been involved in whilst working for Tracesmart is the names directory. Basically we took our huge information database and pulled out a big pile of stats about various names. The process is all one big SEO effort in order to draw more traffic to the site, but it also [...]]]></description>
			<content:encoded><![CDATA[<p>One of the fun things I&#8217;ve been involved in whilst working for Tracesmart is the <a href="http://www.tracesmart.co.uk/names-directory/">names directory</a>. Basically we took our huge information database and pulled out a big pile of stats about various names.</p>
<p>The process is all one big SEO effort in order to draw more traffic to the site, but it also provides some interesting information and name statistics.</p>
<p>Here&#8217;s an example for my name <a title="Lloyd Watkin" href="http://www.tracesmart.co.uk/find-name/lloyd_watkin/" target="_blank">Lloyd Watkin</a>, or I suppose more correctly <a title="Steven Watkin" href="http://www.tracesmart.co.uk/find-name/steven_watkin/" target="_blank">Steven Watkin</a>. Take a minute to <a href="http://www.tracesmart.co.uk/uk-names/" target="_blank">look up your name</a> on the Tracesmart site, might be interesting ;)</p>
<p>We&#8217;ve also got names statistics data on the <a href="http://www.tracesmart.co.uk/names-directory/">names directory</a> page which tells you what names have been searched and how recently. Its quite interesting to see famous people&#8217;s names fly up the stats when they appear in the news. A recent example is that of <a title="Liam Neeson" href="http://en.wikipedia.org/wiki/Liam_Neeson" target="_blank">Liam Neeson</a> who&#8217;s wife died from a skiing accident recently, although obviously people aren&#8217;t quite right on the spelling (hence the huge numbers of hits on this name) &#8212; <a title="Liam Nilson" href="http://www.tracesmart.co.uk/find-name/liam_nilson/" target="_blank">Liam Nilson</a>.</p>
<h2>Facebook Application</h2>
<p>Once the <a title="Names Directory" href="http://www.tracesmart.co.uk/names-directory/" target="_blank">names directory</a> was created we set about creating a <a title="My Name Facebook Application" href="http://apps.facebook.com/my-name/" target="_blank">facebook application</a> which we duely named &#8216;<a title="My Name Facebook Application" href="http://apps.facebook.com/my-name/" target="_blank">My Name</a>&#8216;. The facebook application is an extension of the <a href="http://www.tracesmart.co.uk/names-directory/">names directory</a> and provides some additional statistics. In order to add the names directory to your facebook account please visit:</p>
<p style="text-align: center;"><a href="http://apps.facebook.com/my-name/">http://apps.facebook.com/my-name/</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=UK+Names+Directory+and+Facebook+Application+http://is.gd/ehfwf" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=UK+Names+Directory+and+Facebook+Application+http://is.gd/ehfwf" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=UK+Names+Directory+and+Facebook+Application+http://is.gd/ehfwf" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=UK+Names+Directory+and+Facebook+Application+http://is.gd/ehfwf" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;submitHeadline=UK+Names+Directory+and+Facebook+Application" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;submitHeadline=UK+Names+Directory+and+Facebook+Application" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;t=UK+Names+Directory+and+Facebook+Application" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;t=UK+Names+Directory+and+Facebook+Application" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;t=UK+Names+Directory+and+Facebook+Application" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;t=UK+Names+Directory+and+Facebook+Application" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=UK+Names+Directory+and+Facebook+Application&amp;link=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=UK+Names+Directory+and+Facebook+Application&amp;link=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/&amp;title=UK+Names+Directory+and+Facebook+Application" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/95-names-directory-and-facebook-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickr and Yahoo!: Forgotten Login Details</title>
		<link>http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/</link>
		<comments>http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 19:31:22 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[details]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[forgotten]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=93</guid>
		<description><![CDATA[A few months ago I changed my Flickr password so that a friend could upload some shots to it. A couple of months later I find I&#8217;ve forgotten that password and trying to remember all my secret details from Yahoo! is just a nightmare. I had my Yahoo! email address for several years and I [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I changed my Flickr password so that a friend could upload some shots to it. A couple of  months later I find I&#8217;ve forgotten that password and trying to remember all my secret details from Yahoo! is just a nightmare. I had my Yahoo! email address for several years and I wasn&#8217;t sure when or where (I was living) when I signed up &#8211; oh just to make this clearer Flickr uses Yahoo! login system :)</p>
<p>Yahoo! were no help either, they wanted exact details and would reject anything that didn&#8217;t match. Plus I wasn&#8217;t allowed to provide a list of possible matching details it had to be right on every detail otherwise it would be rejected. I can understand the security but this was getting a pain in the arse, especially as I could retrieve my user name to my usual email address without any trouble (why couldn&#8217;t you send a reset there!?!?!). On top of all this they wanted the details sent to their offices in California either by mail or fax, boo!</p>
<p>Step back to Flickr who kindly send an email to my registered email address asking me to detach my Yahoo! account from my Flickr account. Hooray I could then sign up with a new Yahoo! account and reattach my Flickr account to this new login. </p>
<p>After waiting at least a week each time for Yahoo! to reply Flickr got this all sorted within 2-3 hours!</p>
<p>Well done Flickr, thankfully you&#8217;re out there looking after your customers :)</p>
<p>Now for everyone&#8217;s boredom here&#8217;s yet another link to my Flickr account</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details+http://is.gd/ehg69" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details+http://is.gd/ehg69" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details+http://is.gd/ehg69" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details+http://is.gd/ehg69" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;submitHeadline=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;submitHeadline=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;t=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;t=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;t=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;t=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details&amp;link=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details&amp;link=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/&amp;title=Flickr+and+Yahoo%21%3A+Forgotten+Login+Details" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/93-flickr-and-yahoo-forgotten-login-details/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiking from Ystradgynlais up to Abercraf</title>
		<link>http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/</link>
		<comments>http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 17:45:19 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Hiking]]></category>
		<category><![CDATA[abercraf]]></category>
		<category><![CDATA[ancient briton]]></category>
		<category><![CDATA[cribarth]]></category>
		<category><![CDATA[neath to brecon railway]]></category>
		<category><![CDATA[open cast]]></category>
		<category><![CDATA[Rugby]]></category>
		<category><![CDATA[six nations]]></category>
		<category><![CDATA[tawe]]></category>
		<category><![CDATA[wales]]></category>
		<category><![CDATA[ystradgynlais]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=88</guid>
		<description><![CDATA[Went hiking with the guys from Pontardawe today. we got a taxi up to Ystradgynlais and started a hike there after a breakfast in Merlyns.Â  As a note a few doors down there&#8217;s a cafe called Mimosa which is named after the boat which took the first Welsh settlers to Patagonia. The cafe was opened [...]]]></description>
			<content:encoded><![CDATA[<p>Went hiking with the guys from Pontardawe today. we got a taxi up to Ystradgynlais and started a hike there after a breakfast in <a title="Merlyn's Ystradgynlais" href="http://www.hotels.uk.com/details/5581/Merlyn%27s.htm" target="_blank">Merlyns</a>.Â  As a note a few doors down there&#8217;s a cafe called <a title="Mimosa" href="http://books.google.com/books?id=OscUpqaBzPoC&amp;pg=PA17&amp;lpg=PA17&amp;dq=mimosa+ystradgynlais&amp;source=bl&amp;ots=U3R_0cv3er&amp;sig=uNtebPWXE5scEQtAhZsCaCVzTvE&amp;hl=en&amp;ei=O0G9ScbkLNnHjAeUzvGOCA&amp;sa=X&amp;oi=book_result&amp;resnum=6&amp;ct=result#PPP1,M1" target="_blank">Mimosa</a> which is named after the boat which took the first Welsh settlers to Patagonia. The cafe was opened many yeas later by descendants of one of those original families who had returned to Wales.</p>
<p>We headed over to the <a title="Neath and Brecon Railway" href="http://en.wikipedia.org/wiki/Neath_and_Brecon_Railway" target="_blank">Neath to Brecon Railway</a>, and then up the hill to see the site of an old powered tram system with powered by something called &#8220;the machine&#8221; or &#8220;the engine&#8221;, I forget. Anyway at the top of the hill is the ruins of the old machine house which you can see in my photos. From there we headed north towards the Cribarth (and the pub). The Sarn Helen Open Cast meant that we had to detour and head back down to the railway line.</p>
<p>We headed up the railway line forÂ  a bit (its being changed to a cycle path by the open cast people), and cut off to cross the valley to head up the Cribarth. We came across a circular building which was used to feed cattle of a Scottish design (McTurk brothers?).Â  There was a dead sheep inside so obviously it wasn&#8217;t working so well any more ;)</p>
<p>We followed the Tawe for awhile before headnig up the Cribarth and eventually towards the Ancient Briton for a few beers and watch the <a title="Italy Vs Wales" href="http://news.bbc.co.uk/sport2/hi/rugby_union/7941510.stm" target="_blank">Italy vs Wales</a> rugby match.</p>
<p>Heres some photos: <a href="http://www.flickr.com/photos/lloydwatkin/sets/72157615312599088/" target="_blank">Ystradgynlais to Abercraf hike</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Hiking+from+Ystradgynlais+up+to+Abercraf+http://is.gd/ehg6b" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Hiking+from+Ystradgynlais+up+to+Abercraf+http://is.gd/ehg6b" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Hiking+from+Ystradgynlais+up+to+Abercraf+http://is.gd/ehg6b" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Hiking+from+Ystradgynlais+up+to+Abercraf+http://is.gd/ehg6b" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;submitHeadline=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;submitHeadline=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;t=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;t=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;t=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;t=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf&amp;link=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf&amp;link=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/&amp;title=Hiking+from+Ystradgynlais+up+to+Abercraf" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/88-hiking-from-ystradgynlais-up-to-abercraf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspired&#8230; and guilted!</title>
		<link>http://www.evilprofessor.co.uk/81-wtf/</link>
		<comments>http://www.evilprofessor.co.uk/81-wtf/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:51:31 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=81</guid>
		<description><![CDATA[I&#8217;ve recently set up a blog for one of the guys in work &#8211; Matthew Hopkins &#8211; and seeing his first few posts has made me think that maybe I should add a few posts as its been a good while and lots has happened over 2008. Another one of the guys in work does [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently set up a blog for one of the guys in work &#8211; <a title="Matthew Hopkins" href="http://www.bonkleg.co.uk" target="_blank">Matthew Hopkins</a> &#8211; and seeing his first few posts has made me think that maybe I should add a few posts as its been a good while and lots has happened over 2008. Another one of the guys in work does himself a blog to, good old <a title="Stephen Griffiths" href="http://www.stevegriff.com" target="_blank">Stephen Griffiths</a> so take a look there too.</p>
<p>So I&#8217;m going to plod on and add some retrospective posts about what 2008 held for me and how 2009 is shaping up :)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Inspired%E2%80%A6+and+guilted...+http://is.gd/ehg6c" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Inspired%E2%80%A6+and+guilted...+http://is.gd/ehg6c" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Inspired%E2%80%A6+and+guilted...+http://is.gd/ehg6c" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Inspired%E2%80%A6+and+guilted...+http://is.gd/ehg6c" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/81-wtf/&amp;submitHeadline=Inspired%E2%80%A6+and+guilted..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/81-wtf/&amp;submitHeadline=Inspired%E2%80%A6+and+guilted..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/81-wtf/&amp;t=Inspired%E2%80%A6+and+guilted..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/81-wtf/&amp;t=Inspired%E2%80%A6+and+guilted..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/81-wtf/&amp;t=Inspired%E2%80%A6+and+guilted..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/81-wtf/&amp;t=Inspired%E2%80%A6+and+guilted..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Inspired%E2%80%A6+and+guilted...&amp;link=http://www.evilprofessor.co.uk/81-wtf/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Inspired%E2%80%A6+and+guilted...&amp;link=http://www.evilprofessor.co.uk/81-wtf/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/81-wtf/&amp;title=Inspired%E2%80%A6+and+guilted..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/81-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2008 WTF?!?</title>
		<link>http://www.evilprofessor.co.uk/83-2008-wtf/</link>
		<comments>http://www.evilprofessor.co.uk/83-2008-wtf/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 00:00:12 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Evilprofessor Designs]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News about Work]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Running]]></category>
		<category><![CDATA[Scuba Diving]]></category>
		<category><![CDATA[Scuba Santas]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/?p=83</guid>
		<description><![CDATA[2008 was a strange old year, there's several things I really enjoyed about it,  and there's some things that have now been forgotten and moved on with....]]></description>
			<content:encoded><![CDATA[<p>2008 was a strange old year, there&#8217;s several things I really enjoyed about it,Â  and there&#8217;s some things that have now been forgotten and moved on with&#8230;.</p>
<h2>Diving</h2>
<p>I haven&#8217;t done much in the way of scuba diving I think I managed around about 10 dives all year. One of those dives was the <a href="http://www.scuba-santas.co.uk" class="kblinker" target="_blank" title="More about Scuba Santa &raquo;">scuba santas</a> event at Vobster Quay which was more successful than my wildest dreams. In the end we raised over Â£1000 for the <a href="http://www.rnli.org.uk" class="kblinker" target="_blank" title="More about RNLI &raquo;">RNLI</a>, got coverage on BBC and ITV, and had around 80 divers in the water. Vobster was a sea of scuba diving santas for the day! I really hope I get to do mroe diving in 2009 (lots more!), getting back into it will involve lots of training to get comfortable again. I miss the days of getting on the boat, sun beaming down, grabbing a lobster, packing upÂ Â  and heading home for a few beers.</p>
<h2>Running</h2>
<p>At the end of January 2008 I was involved in a car crash, hit from behind whilst stopped, nothing major or so I thought. Over several months my neck pain got progressively worse stopping me running. In the end I contacted an accident claims company who started getting me treatment with a chiropractor in Cardiff which I&#8217;m still attending (March 2009 &#8211; the claim still isn&#8217;t settled either). Running is another one of those things I want to get back to, I did start with <a title="Miles Cook" href="http://www.cookieonline.net" target="_blank">Miles</a> but between illnesses, injuries, and him eventually moving to Cambridge we only got out a handful of times. I really need a good kick up the bum to get going again, although my one consolation is that I have been cycling back and fore to work for months which is doing me some good.</p>
<h2>Moved</h2>
<p>In July 2008 I moved into a flat with Megan, we&#8217;re getting through the painting and decorating and getting it looking really niceÂ  &#8211; although we&#8217;re sort of dragging our heels with the painting&#8230;.still. The flat is in Adamsdown in Cardiff (I never seem to move far) and is suiting us just great.</p>
<h2>Work</h2>
<p>Work was all over the place in 2008, I started off drifting a little before taking up work at a letting agent as manager. This helped no end with the <a title="Estate and Letting Agency Software" href="http://www.ep-projects.co.uk/products/letting-and-estate-agency-software/" target="_blank">estate and letting agency software</a> that I was developing. My plan for the <a title="Estate and Letting Agency Software" href="http://www.ep-projects.co.uk/products/letting-and-estate-agency-software/" target="_blank">estate and letting agency software</a> is to release it as a low cost product when I have more time to clear it up. From what I&#8217;m told about competing products on the market it is easier to use and performs many or more of the same functions in a better way :)</p>
<p>During April 2008 coming up to my 22nd birthday both Megan and my mother started pushing for me to &#8216;get a career&#8217;, which a hard idea to swallow was really what I needed. Running my own company was fun but didn&#8217;t provide the stability needed and earning a pittance at the letting agency wasn&#8217;t a long term career goal. It was always a case of wait until I get my software finished and I&#8217;ll start selling it, but time was always against me.</p>
<p>What followed was several interviews with some great companies in some great areas, full of promise of moving to a new area, fresh start seemed great. The best job offer was with a large hosting provider in the Worcester area and seemed ideal. So what happened? Well I had developed an online SMS solution back around christmas that had been sitting around not doing much which investors were found for. Excellent I thought and off we went. All didn&#8217;t end well and after several months of broken promises and rising stress levels I made a stand and walked out. Working 60 hours a week, coming home and doing another 3-4 hours plus working all weekend and for all the stress it was one of the best decisions I&#8217;ve ever made. (Here I&#8217;d like to thank Megan, my parents, and my friends that stood by me, I was a stress-headed dick at times, and I&#8217;m sorry)</p>
<p>Four weeks later I landed myself a job with a company called Tracesmart in Cardiff Bay as a <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> Developer. After passing the tests and the interviews I started with a whole pile of enthusiasm (as you can imagine things had been a bit low for sometime). Tracesmart perform people searching, people tracing, electoral roll data handling, involving huge quantities of data. I&#8217;ve been there now for about 5 months (given I&#8217;m actually writing this in March 2009) and I love every minute of it. I&#8217;m pushing myself every day, have a great working environment (my desk overlooks the bay!), good colleagues! I&#8217;ve been involved in some good projects (other posts to follow) and I&#8217;m really proud of the work I&#8217;m doing there.</p>
<h2>2009&#8230;.</h2>
<p>Despite starting 2009 in Germany suffering from the Novo virus 2009 is great so far. Megan and I spentÂ  New Years time in Germany and Amsterdam. Amsterdam is beautiful and the Anne Frank house had a real profound effect on me, somewhere we&#8217;ll definately be returning to. Work is going really well. My neck is getting better and better so in a couple of weeks time I&#8217;ll head out for those first few awful runs once again. The only thing I really need now is a good few dives (or a dive holiday) to get back into the swing of things!</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=2008+WTF...+http://is.gd/ehg6e" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=2008+WTF...+http://is.gd/ehg6e" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=2008+WTF...+http://is.gd/ehg6e" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=2008+WTF...+http://is.gd/ehg6e" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;submitHeadline=2008+WTF..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;submitHeadline=2008+WTF..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;t=2008+WTF..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;t=2008+WTF..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;t=2008+WTF..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;t=2008+WTF..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=2008+WTF...&amp;link=http://www.evilprofessor.co.uk/83-2008-wtf/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=2008+WTF...&amp;link=http://www.evilprofessor.co.uk/83-2008-wtf/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/83-2008-wtf/&amp;title=2008+WTF..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/83-2008-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scuba Santa&#8217;s Website Launched</title>
		<link>http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/</link>
		<comments>http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 15:55:39 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Scuba Santas]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/11/22/scuba-santas-website-launched/</guid>
		<description><![CDATA[Given the growing size of this years scuba santas event to be held at Vobster Quay on the 20th December 2008 I thought I should create a website to collect all the information in one place instead of having it spread between Yorkshire Divers (YD) and facebook. So here&#8217;s the site Scuba Santas &#8211; http://www.scuba-santas.co.uk [...]]]></description>
			<content:encoded><![CDATA[<p>Given the growing size of this years <a href="http://www.scuba-santas.co.uk" class="kblinker" target="_blank" title="More about Scuba Santa &raquo;">scuba santas</a> event to be held at Vobster Quay on the 20th December 2008 I thought I should create a website to collect all the information in one place instead of having it spread between <a href="http://www.yorkshire-divers.com" class="kblinker" target="_blank" title="More about Yorkshire Divers &raquo;">Yorkshire Divers</a> (YD) and facebook.</p>
<p>So here&#8217;s the site Scuba Santas &#8211; <a href="http://www.scuba-santas.co.uk/">http://www.scuba-santas.co.uk</a></p>
<p>Links are appreciated as this is a fun event that I organise to raise money for the <a href="http://www.rnli.org.uk" class="kblinker" target="_blank" title="More about RNLI &raquo;">RNLI</a> each year.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Scuba+Santa%E2%80%99s+Website+Launched+http://is.gd/ehg6f" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Scuba+Santa%E2%80%99s+Website+Launched+http://is.gd/ehg6f" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Scuba+Santa%E2%80%99s+Website+Launched+http://is.gd/ehg6f" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Scuba+Santa%E2%80%99s+Website+Launched+http://is.gd/ehg6f" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;submitHeadline=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;submitHeadline=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;t=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;t=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;t=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;t=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Scuba+Santa%E2%80%99s+Website+Launched&amp;link=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Scuba+Santa%E2%80%99s+Website+Launched&amp;link=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/&amp;title=Scuba+Santa%E2%80%99s+Website+Launched" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/80-scuba-santas-website-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scuba Santas 2008 &#8211; Up and Running&#8230;</title>
		<link>http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/</link>
		<comments>http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 14:54:28 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Scuba Santas]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/09/05/scuba-santas-2008-up-and-running/</guid>
		<description><![CDATA[Scuba Santas 2008 is now up and running. Planning is underway for the 2008 dives organised through YD for the 20th December 2008.Â  The event is being controlled through facebook events. There&#8217;s also a first individual post on YD here about what date to run the event and to get some provisional names for diving [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.new.facebook.com/pages/Scuba-Santas-2008/34681704277" title="Facebook: Scuba Santas 2008">Scuba Santas 2008</a> is now up and running. Planning is underway for the 2008 dives organised through YD for the 20th December 2008.Â  The event is being controlled through <a target="_blank" href="http://www.new.facebook.com/event.php?eid=12258749959" title="Santa Dives 20th December 2008">facebook events</a>.</p>
<p>There&#8217;s also a first individual post on YD here about what date to run the event and to get some provisional names for diving santas: <a target="_blank" href="http://www.yorkshire-divers.com/forums/planned-trips-spare-spaces/77548-scuba-santas-2008-a.html" title="Scuba Santas 2008 - Yorkshire Divers">Scuba Diving Santas 2008 &#8211; on Yorkshire Divers</a>.</p>
<p>The event will once again be held at <a target="_blank" href="http://www.vobsterquay.co.uk/" title="Vobster Quay">Vobster Quay</a>, we&#8217;ve applied for another <a target="_blank" href="http://www.guinnessworldrecords.com/" title="Guiness World Records">Guiness World Record</a>, and hopefully get more visits from news crews such as those we had last year from the <a target="_blank" href="http://www.bbc.co.uk" title="BBC">BBC</a>.</p>
<p>More news will be posted once we&#8217;ve decided on a charity and things are moving along :)</p>
<p>Here&#8217;s more about last years event: <a target="_blank" href="http://www.evilprofessor.co.uk/2007/12/22/santa-dives-vobster-quay-2007/" title="Scuba Santas 2007">Scuba Santas 2007</a>.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Scuba+Santas+2008+%E2%80%93+Up+and+Running...+http://is.gd/ehg6g" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Scuba+Santas+2008+%E2%80%93+Up+and+Running...+http://is.gd/ehg6g" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Scuba+Santas+2008+%E2%80%93+Up+and+Running...+http://is.gd/ehg6g" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Scuba+Santas+2008+%E2%80%93+Up+and+Running...+http://is.gd/ehg6g" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;submitHeadline=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;submitHeadline=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;t=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;t=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;t=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;t=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running...&amp;link=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running...&amp;link=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/&amp;title=Scuba+Santas+2008+%E2%80%93+Up+and+Running..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/79-scuba-santas-2008-up-and-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IanDennisTechnical.co.uk Launches &#8211; Trimix, Advanced Nitrox Training</title>
		<link>http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/</link>
		<comments>http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 14:39:12 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/09/04/advanced-nitrox-trimix-technical-training/</guid>
		<description><![CDATA[Ian Dennis Technical has now been launched. Simply a shift of domains for Advanced Diver Training was a quick inexpensive website set up for a scuba diving instructor. So for all your uk trimix training you know where to go! Ian Dennis Technical &#8211; IANTD training in nitrox and trimix Tweet This Post Plurk This [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ianDennisTechnical.co.uk/" title="Ian Dennis Technical - Trimix, Advanced Nitrox Training" target="_blank"><img src="http://www.evilprofessor.co.uk/wp-content/uploads/2008/09/iandennistechnical.thumbnail.JPG" title="Ian Dennis Technical Website" alt="Ian Dennis Technical Website" align="left" /></a> Ian Dennis Technical has now been launched. Simply a shift of domains for Advanced Diver Training was a quick inexpensive website set up for a scuba diving instructor. So for all your <a href="http://www.iandennistechnical.co.uk" title="Advanced Nitrox, Trixmix Training" target="_blank">uk trimix training</a> you know where to go! <a href="http://www.ianDennisTechnical.co.uk" target="_blank" title="Ian Dennis Technical - IANTD/PADI Nitrox and Trimix Scuba Dive Training">Ian Dennis Technical &#8211; IANTD training in nitrox and trimix</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training+http://is.gd/ehg6h" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training+http://is.gd/ehg6h" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training+http://is.gd/ehg6h" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training+http://is.gd/ehg6h" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;submitHeadline=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;submitHeadline=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;t=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;t=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;t=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;t=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training&amp;link=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training&amp;link=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/&amp;title=IanDennisTechnical.co.uk+Launches+%E2%80%93+Trimix%2C+Advanced+Nitrox+Training" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/78-advanced-nitrox-trimix-technical-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabled Form Fields are not submitted&#8230;</title>
		<link>http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/</link>
		<comments>http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 11:01:10 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/09/04/disabled-form-fields-are-not-submitted/</guid>
		<description><![CDATA[As a quick note, as part of the ongoing estate agency software project I&#8217;ve gone back to editing date entry within the system. Now instead of allowing users to enter any old bit of text I&#8217;ve switched over to a Javascript date/time picker (for the short term) that allows user to &#8216;pick&#8217; and date and [...]]]></description>
			<content:encoded><![CDATA[<p>As a quick note, as part of the ongoing <a href="http://www.agency008.co.uk" title="Agency008 - Estate/Lettings Agency Software" target="_blank">estate agency software</a> project I&#8217;ve gone back to editing date entry within the system. Now instead of allowing users to enter any old bit of text I&#8217;ve switched over to a <a href="http://www.javascriptkit.com/script/script2/tengcalendar.shtml" title="Javascript Date/Time Picker" target="_blank">Javascript date/time picker</a> (for the short term) that allows user to &#8216;pick&#8217; and date and time from a pop up window.</p>
<p>Now, for my old systemÂ  the picker would pop up when the user clicked on the <a href="http://www.w3schools.com/TAGS/tag_input.asp" title="HTML Input Field" target="_blank">input field</a>. This however would allow the user to ignore the text field and still go and type any old thing into the field. This wasn&#8217;t ideal. So my solution was to &#8216;<a href="http://www.javascriptkit.com/javatutors/deform3.shtml" title="Disable attribute html forms" target="_blank">disable</a>&#8216; the form field and put a <a href="http://www.google.co.uk/url?q=http://www.w3schools.com/TAGS/tag_span.asp&amp;sa=X&amp;oi=revisions_result&amp;resnum=4&amp;ct=result&amp;cd=1&amp;cad=revid%3D1709474994&amp;usg=AFQjCNE0TW2ZKEJUFTj4QklCLWvmhWngmA" title="html &lt;span&gt;" target="_blank">span</a> next to it with an <a href="http://www.w3schools.com/jsref/jsref_onclick.asp" title="Javascript onClick Event" target="_blank">onclick</a> event calling the date/time picker. This meant that the user was almost forced into using the nice date/time picker so dates would go in with the correct format (although that still has to be validated!).</p>
<p>So I started passing my nicely formatted date-time(s) through the form and <strike>picking</strike> trying to pick them up with <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a>&#8216;s <a href="http://www.w3schools.com/PHP/php_get.asp" title="PHP $_GET" target="_blank">$_GET</a> or <a href="http://www.w3schools.com/php/php_post.asp" title="PHP $_POST Variables" target="_blank">$_POST </a>variables. Unfortunately&#8217;disabled&#8217; fields are not passed through form submissions <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_sad.gif" onclick="document.getElementById('content').value += ' :worry:';" class="wp-smiley" /> This was very annoying. The solution was to enable the input element using javascript when the form was submitted using the <a href="http://www.htmlcodetutorial.com/forms/_FORM_onSubmit.html" title="Javascript onSubmit Event" target="_blank">onsubmit </a>event.</p>
<p>This meant that the form data was passed through as required and was nicely formatted ready for validation&#8230;Â  <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_wink.gif" onclick="document.getElementById('content').value += ' :wink:';" class="wp-smiley" /></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Disabled+Form+Fields+are+not+submitted...+http://is.gd/ehg6i" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Disabled+Form+Fields+are+not+submitted...+http://is.gd/ehg6i" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Disabled+Form+Fields+are+not+submitted...+http://is.gd/ehg6i" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Disabled+Form+Fields+are+not+submitted...+http://is.gd/ehg6i" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;submitHeadline=Disabled+Form+Fields+are+not+submitted..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;submitHeadline=Disabled+Form+Fields+are+not+submitted..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;t=Disabled+Form+Fields+are+not+submitted..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;t=Disabled+Form+Fields+are+not+submitted..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;t=Disabled+Form+Fields+are+not+submitted..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;t=Disabled+Form+Fields+are+not+submitted..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Disabled+Form+Fields+are+not+submitted...&amp;link=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Disabled+Form+Fields+are+not+submitted...&amp;link=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/&amp;title=Disabled+Form+Fields+are+not+submitted..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/75-disabled-form-fields-are-not-submitted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search Array Keys and Return Matches</title>
		<link>http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/</link>
		<comments>http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 16:26:57 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/08/13/search-array-keys-and-return-matches/</guid>
		<description><![CDATA[I&#8217;ve had the need to search through an array and return the elements that have keys that match a search term. So I thought I&#8217;d share. &#8216;Why would I need this?&#8217; would probably be the first question you&#8217;d ask, well if I wanted to search through an array for all the elements that related to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had the need to search through an array and return the elements that have keys that match a search term. So I thought I&#8217;d share.</p>
<p>&#8216;W<em>hy would I need this?&#8217;</em> would probably be the first question you&#8217;d ask, well if I wanted to search through an array for all the elements that related to the dimensions of an item then I could pull out the appropriate keys by using this little function:</p>
<pre><code>&lt;?
function searchArrayKey($array,$search)
{
Â $search = strtolower($search);
Â if (is_array($array))
Â {
Â Â foreach ($array as $key =&gt; $data)
Â Â {
Â Â Â if (strpos(strtolower($key),$search) === 0) { $returnArray[$key] = $data; }Â 
Â Â }
Â Â return $returnArray;
Â } else
Â {Â // User hasn't subimitted an array...
Â Â return false;
Â }
}
?&gt;</code></pre>
<p>So for example if I wanted to search an array of item data for the dimension data then I could do the following (and print to screen presumably):</p>
<pre><code>$dimensions = searchArrayKeys($itemArray,'dimension');</code></pre>
<p>Which would return something like:</p>
<pre><code>print_r($dimensions);
Array
(
    [dimension_height] => 20
    [dimension_width] => 30
    [dimension_depth] => 40
)</code></pre>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Search+Array+Keys+and+Return+Matches+http://is.gd/ehg6j" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Search+Array+Keys+and+Return+Matches+http://is.gd/ehg6j" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Search+Array+Keys+and+Return+Matches+http://is.gd/ehg6j" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Search+Array+Keys+and+Return+Matches+http://is.gd/ehg6j" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;submitHeadline=Search+Array+Keys+and+Return+Matches" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;submitHeadline=Search+Array+Keys+and+Return+Matches" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;t=Search+Array+Keys+and+Return+Matches" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;t=Search+Array+Keys+and+Return+Matches" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;t=Search+Array+Keys+and+Return+Matches" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;t=Search+Array+Keys+and+Return+Matches" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Search+Array+Keys+and+Return+Matches&amp;link=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Search+Array+Keys+and+Return+Matches&amp;link=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/&amp;title=Search+Array+Keys+and+Return+Matches" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/74-search-array-keys-and-return-matches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom php.ini with Plesk</title>
		<link>http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/</link>
		<comments>http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 15:53:13 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/08/13/custom-phpini-with-plesk/</guid>
		<description><![CDATA[We have a dedicated server with ukFastÂ on which we run a number of domains that exist on virtual servers running under Plesk. Anyway, on most of my domains I want to hide away warnings and for security keep errors to the log files, however on some of my domains (such as those I&#8217;m developing on) [...]]]></description>
			<content:encoded><![CDATA[<p>We have a <a target="_blank" href="http://en.wikipedia.org/wiki/Dedicated_hosting_service" title="Dedicated Hosting Solution">dedicated server</a> with <a target="_blank" href="http://www.ukfast.net/" title="UKFast: Dedicated Servers and stuff...">ukFast</a>Â on which we run a number of <a target="_blank" href="http://en.wikipedia.org/wiki/Domain_name" title="Domains">domains</a> that exist on virtual servers running under <a target="_blank" href="http://www.parallels.com/plesk/" title="Plesk">Plesk</a>. Anyway, on most of my domains I want to hide away warnings and for security keep errors to the log files, however on some of my domains (such as those I&#8217;m developing on) I want to show every little nasty warning and error that appears.</p>
<p>If I edit my <a target="_blank" href="http://www.php.net/ini.core" title="<a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a>.INI&#8221;>php.ini </a>this affects each and every domain on the server, not a good idea especially when several of the sites are fully live versions <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_redface.gif" onclick="document.getElementById('content').value += ' :$';" class="wp-smiley" />Â So in order to get around this you need to put a file called <a target="_blank" href="http://www.gadberry.com/aaron/2006/02/09/plesk_vhost/" title="vhost.conf">vhosts.conf </a>in your <em>conf</em> directory, for example, <code>/var/www/vhosts/&lt;my_domain&gt;/conf/vhost.conf</code>.</p>
<p>Once you&#8217;ve added your additional code, again for example I included,</p>
<pre><code>php_value error_reporting E_ALL
php_value display_errors On</code></pre>
<p>followed by running the following command (this reconfigures all of your domains its just <del dateTime="2008-08-13T15:35:24+00:00">quicker</del> lazier than typing in the domain name <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_cool.gif" onclick="document.getElementById('content').value += ' :cool:';" class="wp-smiley" />,</p>
<pre><code># /usr/local/psa/admin/bin/websrvmng -a</code></pre>
<p>If you&#8217;re feeling a bit nimble then you can always type out the full version which is,</p>
<pre><code># /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=&lt;my_domain&gt;</code></pre>
<p>After this command if you look to httpd.include file, will see that your httpd.include will have an include line for your vhost.conf, something like this:</p>
<pre><code>Include /srv/www/vhosts/domain.com/conf/vhost.conf</code></pre>
<pre></pre>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Custom+php.ini+with+Plesk+http://is.gd/ehg6k" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Custom+php.ini+with+Plesk+http://is.gd/ehg6k" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Custom+php.ini+with+Plesk+http://is.gd/ehg6k" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Custom+php.ini+with+Plesk+http://is.gd/ehg6k" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;submitHeadline=Custom+php.ini+with+Plesk" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;submitHeadline=Custom+php.ini+with+Plesk" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;t=Custom+php.ini+with+Plesk" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;t=Custom+php.ini+with+Plesk" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;t=Custom+php.ini+with+Plesk" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;t=Custom+php.ini+with+Plesk" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Custom+php.ini+with+Plesk&amp;link=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Custom+php.ini+with+Plesk&amp;link=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/&amp;title=Custom+php.ini+with+Plesk" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/73-custom-phpini-with-plesk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diving Rheola Lakes, Glynneath</title>
		<link>http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/</link>
		<comments>http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 09:00:38 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Dive Trips]]></category>
		<category><![CDATA[Scuba Diving]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/08/02/diving-rheola-lakes-glynneath/</guid>
		<description><![CDATA[Hearing about a new dive site through YD, it being cheaper (Â£5) and closer (well for Simon) than the NDAC we decided to head down to check it out. The site is north of Neath on the A465 and is an easy drive from the M4. The site is run by Steve of Quest Marine [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilprofessor.co.uk/gallery/photo/2731612776/Rheola-004.html" class="tt-flickr"><img border="0" vspace="5" width="133" src="http://farm4.static.flickr.com/3273/2731612776_454d830ac0_t.jpg" hspace="5" alt="Rheola-004" height="93" style="float: left; width: 133px; height: 93px" title="Rheola-004" /></a>Hearing about a new dive site through YD, it being cheaper (Â£5) and closer (well for Simon) than the <a target="_blank" href="http://www.ndac.co.uk" title="National Diving and Activity Centre, Chepstow">NDAC</a> we decided to head down to check it out. The site is north of <a target="_blank" href="http://en.wikipedia.org/wiki/Neath" title="Neath">Neath</a> on the <a target="_blank" href="http://en.wikipedia.org/wiki/A465_road" title="a465">A465</a> and is an easy drive from the M4. The site is run by Steve of <a target="_blank" href="http://www.questmarine.tv/glyn_neath_lakes.htm" title="Quest Marine">Quest Marine</a> (site details on link).</p>
<p><a href="http://www.evilprofessor.co.uk/gallery/photo/2731616718/Rheola-008.html" class="tt-flickr"><img border="0" vspace="5" width="133" src="http://farm4.static.flickr.com/3230/2731616718_7ee1c8d3e3_t.jpg" hspace="5" alt="Rheola-008" height="106" style="float: right; width: 133px; height: 106px" title="Rheola-008" /></a>There are two lakes at the site, one for powerboating and one forÂ quieter activities (such asÂ diving!). Â Parking is right up against the water and for the entire day we were the only two divers there <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_lol.gif" onclick="document.getElementById('content').value += ' :cunning:';" class="wp-smiley" />. The smaller lake isn&#8217;t huge but an ok size for a smaller number of divers. There&#8217;s toilets at the site but not much else, although there&#8217;s a burger van a short drive back to the entrance to the site and a place you can buy <a target="_blank" href="http://www.mcdonalds.com/" title="junk food">junk food</a> just around the corner.</p>
<p><a href="http://www.evilprofessor.co.uk/gallery/photo/2731615356/Rheola-007.html" class="tt-flickr"><img border="0" vspace="5" width="127" src="http://farm4.static.flickr.com/3138/2731615356_6e71b837bf_t.jpg" hspace="5" alt="Rheola-007" height="96" style="float: left; width: 127px; height: 96px" title="Rheola-007" /></a>The lakes were created as they were dug out for rock to build the heads of the valleys road and have naturally filled up over time, due to that there&#8217;s no fish life although plenty of plants. Adding some fish would be quite nice and would draw in some additional money from fishermen, although there were some kids fishing the bigger lake so I guess that there&#8217;s probably some in there.</p>
<p>The water was very clear with a good 5-6m visibility, although if you knocked theÂ bottom lots of suspended matter was sent upwards and took a while to settle. The suspended matter was much preferrable to theÂ black dust knocked up if you find a patch without plants. I did this to test what it was like butÂ forgot to take some video to demonstrate <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_rolleyes.gif" onclick="document.getElementById('content').value += ' :rolleyes:';" class="wp-smiley" /></p>
<p align="center" style="text-align: center"><a href="http://www.evilprofessor.co.uk/gallery/photo/2731618926/Rheola-011.html" class="tt-flickr"><img border="0" vspace="5" width="136" src="http://farm4.static.flickr.com/3260/2731618926_2446d54a18_t.jpg" hspace="5" alt="Rheola-011" height="94" style="width: 136px; height: 94px" title="Rheola-011" /></a>Â <a href="http://www.evilprofessor.co.uk/gallery/photo/2730782353/Rheola-006.html" class="tt-flickr"><img border="0" vspace="5" width="107" src="http://farm4.static.flickr.com/3031/2730782353_888687bfb6_t.jpg" hspace="5" alt="Rheola-006" height="118" style="width: 107px; height: 118px" title="Rheola-006" /></a>Â <a href="http://www.evilprofessor.co.uk/gallery/photo/2731617632/Rheola-009.html" class="tt-flickr"><img border="0" vspace="5" width="136" src="http://farm4.static.flickr.com/3284/2731617632_3bc3e7bc5b_t.jpg" hspace="5" alt="Rheola-009" height="94" style="width: 136px; height: 94px" title="Rheola-009" /></a></p>
<p>We were told that the max depth was 12m with the lake sloping down in 2m steps but we reached a max of 10.8metres. After about 20 minutes (+ 1 golf ball) we both got a bit bored of the site but pushed the dive to 40 minutes. The second dive we went in with a plan and did several run times with stops at 9m, 6m, and 3m both up and down.</p>
<p>In summary, a good cheap site at Â£5, not much depth but good for practice.Â I wouldn&#8217;t go for a pleasure dive, there needs to be a purpose, maybe if the site develops a few objects would go in but I don&#8217;t know what the owners plans are there!</p>
<p style="text-align: center"><a href="http://www.evilprofessor.co.uk/gallery/album/72157606532104234/Rheola-Lakes---2nd-August-2008.html" title="Diving Rheola Lakes, Glynneath - 2nd August 2008">Diving Rheola Lakes, Glynneath &#8211; 2nd August 2008</a> <a href="http://www.evilprofessor.co.uk/gallery/album/72157606532104234/Rheola-Lakes---2nd-August-2008.html" title="Diving Rheola Lakes, Glynneath - 2nd August 2008"><img border="0" align="middle" width="100" src="http://farm4.static.flickr.com/3109/2731620646_b1c73fcc93_t.jpg" height="75" style="width: 100px; height: 75px" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Diving+Rheola+Lakes%2C+Glynneath+http://is.gd/ehg6n" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Diving+Rheola+Lakes%2C+Glynneath+http://is.gd/ehg6n" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Diving+Rheola+Lakes%2C+Glynneath+http://is.gd/ehg6n" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Diving+Rheola+Lakes%2C+Glynneath+http://is.gd/ehg6n" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;submitHeadline=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;submitHeadline=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;t=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;t=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;t=Diving+Rheola+Lakes%2C+Glynneath" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;t=Diving+Rheola+Lakes%2C+Glynneath" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Diving+Rheola+Lakes%2C+Glynneath&amp;link=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Diving+Rheola+Lakes%2C+Glynneath&amp;link=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/&amp;title=Diving+Rheola+Lakes%2C+Glynneath" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/72-diving-rheola-lakes-glynneath/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Variables not existing and forms</title>
		<link>http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/</link>
		<comments>http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 10:36:59 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/07/31/php-variables-not-existing-and-forms/</guid>
		<description><![CDATA[I came across something I wasn&#8217;t aware of today that is very handy&#8230;. the error control operator &#8216;@&#8217;Â in PHP. So for some background to how I came across this problem, in my web applications I tend to use the same form to insert data into a mySQL database. If I have an some sort of [...]]]></description>
			<content:encoded><![CDATA[<p>I came across something I wasn&#8217;t aware of today that is very handy&#8230;. the <a target="_blank" href="http://uk.php.net/manual/en/language.operators.errorcontrol.php" title="The Error Control Operator '@'">error control operator &#8216;@&#8217;</a>Â in <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a>.</p>
<p>So for some background to how I came across this problem, in my web applications I tend to use the same form to insert data into a <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a> database. If I have an some sort of &#8216;id&#8217; number set via a <a target="_blank" href="http://www.w3schools.com/PHP/php_get.asp" title="GET Variable">GET variable</a> then that triggers a load from the database, otherwise I&#8217;m adding new data.</p>
<p>In my form elements I often set the <em>value </em>of the form field to something like <strong>&lt;?=$data['fieldValue'];?&gt;</strong> this works fine when loading data but when I&#8217;m inserting new data I get the form filled in as follows (note on my login or when I&#8217;m testing I have error reporting set to E_ALL so I can make sure everything is running correctly):</p>
<p style="text-align: center"><strong>Notice</strong>: Undefined variable: data in <strong>/home/public_html/dataEdit.php</strong> on line <strong>69</strong></p>
<p>So what I eventually ended up doing was writing longer (uglier) code which said, <strong>&lt;? if (isset($data['fieldValue'])) { echo $data['fieldValue']; } ?&gt;.</strong> Not exactly great <img src="http://www.evilprofessor.co.uk/wp-includes/images/yahoo/icon_sad.gif" onclick="document.getElementById('content').value += ' :worry:';" class="wp-smiley" /></p>
<p>Then I stumbled across the error control operator in PHP, by simply placing an &#8216;@&#8217; symbol before an operator (basically anything that can return a result) the above problem is solved. For example I can now make my for value parameter &lt;<strong>?=@$data['fieldValue'];?</strong>&gt;. If the variable is not set (i.e. an<em> error</em> would be generated) then the error is suppressed.</p>
<p>Note: Using the &#8216;@&#8217; symbol can supress major errors and hide the fact that part of your site isn&#8217;t running correctly, so be careful!</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=PHP+Variables+not+existing+and+forms+http://is.gd/ehg6o" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=PHP+Variables+not+existing+and+forms+http://is.gd/ehg6o" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=PHP+Variables+not+existing+and+forms+http://is.gd/ehg6o" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=PHP+Variables+not+existing+and+forms+http://is.gd/ehg6o" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;submitHeadline=PHP+Variables+not+existing+and+forms" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;submitHeadline=PHP+Variables+not+existing+and+forms" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;t=PHP+Variables+not+existing+and+forms" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;t=PHP+Variables+not+existing+and+forms" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;t=PHP+Variables+not+existing+and+forms" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;t=PHP+Variables+not+existing+and+forms" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=PHP+Variables+not+existing+and+forms&amp;link=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=PHP+Variables+not+existing+and+forms&amp;link=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/&amp;title=PHP+Variables+not+existing+and+forms" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/70-php-variables-not-existing-and-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Server, Safe Mode, and File Ownership&#8230;</title>
		<link>http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/</link>
		<comments>http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 15:42:58 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/07/29/moving-server-safe-mode-and-file-ownership/</guid>
		<description><![CDATA[I recently moved some of the web applications that I&#8217;ve written over to a new dedicated server with UKFast. The new server I had with my previous terrible web host, was setup in a much less secure way (]]></description>
			<content:encoded><![CDATA[<p>I recently moved some of the web applications that I&#8217;ve written over to a new dedicated server with <a target="_blank" href="http://www.ukfast.net/" title="UKFast - Dedicated Server">UKFast</a>. The new server I had with my previous <a target="_blank" href="http://www.1and1.co.uk" title="Terrible Web Host">terrible web host</a>, was setup in a much less secure way (<a target="_blank" href="http://www.php.net/features.safe-mode" title="<a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> Safe Mode&#8221;>safe_mode</a> off for example) than the new one so I was finding that several scripts weren&#8217;t working.</p>
<p>One of the major annoyances was <a target="_blank" href="http://www.php.net/features.file-upload" title="PHP File Uploads">php file uploads </a>used to put property pictures onto the site. With <a target="_blank" href="http://www.php.net/error-reporting" title="PHP Error Reporting">error reporting</a> switched to maximum and Display Errors switched on in my php.ini file I was able to see the full list of errors. One of the major complaints stated something along the lines of&#8230;</p>
<p style="text-align: center"><em>PHP Warning:Â  Unknown(): SAFE MODE Restriction in effect.Â  The script whose uid is 1 is not allowed to access /path/to/script.php owned by uid 26658 in Unknown on line 0;</em></p>
<p>Many of the directories and image files were created by the old site and so file ownership was a major problem. Technical support suggested turning off safe mode as a short term fix and then working around it in the longer term. I wasn&#8217;t quite happy with this solution so spent some time thinking through the problem.</p>
<p>I knew that you could change the ownership of a file by logging in as root via <a target="_blank" href="http://en.wikipedia.org/wiki/Secure_Shell" title="SSH">SSH</a> and running the following commands&#8230;</p>
<p style="text-align: center">&lt;&gt;<em><a target="_blank" href="http://en.wikipedia.org/wiki/Chown" title="CHOWN">chown </a>user:group filename (also see <a target="_blank" href="http://en.wikipedia.org/wiki/Chgrp" title="chgrp">chgrp</a>)</em><br />
<em>(You can use the -R switch to chown all the files in your site)</em></p>
<p>I started by setting the file and group ownership of the files on my site to 26658 (if we&#8217;re using the above example!). This seemed to sort the problem until that is I tried to <a target="_blank" href="http://en.wikipedia.org/wiki/File_Transfer_Protocol" title="FTP">FTP</a> files to and from the site, resulting in a permission denied and/or file not found errors.</p>
<p>So after playing around with several uid&#8217;s I had a <a target="_blank" href="http://www.nicecupofteaandasitdown.com/" title="Cup of Tea">cup of tea</a> and thought through the problems. For me to upload files via FTP then the owner of the file is going to have to match the FTP username. So I set the owner of the file as the username I used to log in via FTP. Secondly, the webserver is going to want to access the files so I set the group ownership as &#8216;<em>apache</em>&#8216;.</p>
<p>This didn&#8217;t quite work, but setting the /tmp directory ownership to nobody (<em>chown nobody /tmp</em>) seems to have fixed the problems :)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...+http://is.gd/ehg6p" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...+http://is.gd/ehg6p" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...+http://is.gd/ehg6p" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...+http://is.gd/ehg6p" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;submitHeadline=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;submitHeadline=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;t=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;t=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;t=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;t=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...&amp;link=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership...&amp;link=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/&amp;title=Moving+Server%2C+Safe+Mode%2C+and+File+Ownership..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/69-moving-server-safe-mode-and-file-ownership/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FREE Board Management Software for Estates and Letting Agents</title>
		<link>http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/</link>
		<comments>http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 11:23:09 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[News about Work]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/06/19/free-board-management-software-for-estates-and-letting-agents/</guid>
		<description><![CDATA[As a result of feedback from our agents I&#8217;ve now added FREE board management software to the property SMS software that I&#8217;ve written. I&#8217;ve created the system so you can make use of the board management or not. If agents use the software then the website will send out an email to their board agent [...]]]></description>
			<content:encoded><![CDATA[<p>As a result of feedback from our agents I&#8217;ve now added <a target="_blank" href="http://www.instant-property-information.co.uk" title="FREE Board Management Software">FREE board management software</a> to the <a target="_blank" href="http://www.ipi-SMS.co.uk" title="Property SMS">property SMS</a> software that I&#8217;ve written.</p>
<p>I&#8217;ve created the system so you can make use of the board management or not. If agents use the software then the website will send out an email to their board agent at the end of the day to instruct them on board placement (there&#8217;s more detail in there than that :)).</p>
<p>Anyway please feel free to take a look at the <a target="_blank" href="http://www.ipi-sms.co.uk" title="Property SMS system">property SMS</a> system that I&#8217;ve written.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=FREE+Board+Management+Software+for+Estates+and+Letting+Agents+http://is.gd/ehg6q" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=FREE+Board+Management+Software+for+Estates+and+Letting+Agents+http://is.gd/ehg6q" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=FREE+Board+Management+Software+for+Estates+and+Letting+Agents+http://is.gd/ehg6q" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=FREE+Board+Management+Software+for+Estates+and+Letting+Agents+http://is.gd/ehg6q" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;submitHeadline=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;submitHeadline=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;t=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;t=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;t=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;t=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents&amp;link=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents&amp;link=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/&amp;title=FREE+Board+Management+Software+for+Estates+and+Letting+Agents" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/67-free-board-management-software-for-estates-and-letting-agents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instant Property Information (IPI)</title>
		<link>http://www.evilprofessor.co.uk/65-instant-property-information-ipi/</link>
		<comments>http://www.evilprofessor.co.uk/65-instant-property-information-ipi/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 13:46:54 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/06/14/instant-property-information-ipi/</guid>
		<description><![CDATA[Â Property Information via SMS Evilprofessor Designs have created a fully bespoke SMS application for a new company called Instant Property Information. IPI provide a service whereby instant information can be delivered to people interested in property 24 hours a day 7 days a week even when the office is closed. The system also includes a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2008/06/ipi.JPG" title="Instant Property Information Site Image"><img align="middle" src="http://www.evilprofessor.co.uk/wp-content/uploads/2008/06/ipi.thumbnail.JPG" alt="Instant Property Information Site Image" title="Instant Property Information Site Image" /></a>Â <a target="_blank" href="http://www.ipi-sms.co.uk" title="Property Information via SMS/Text Message">Property Information via SMS</a></p>
<p>Evilprofessor Designs have created a fully bespoke SMS application for a new company called Instant Property Information. IPI provide a service whereby instant information can be delivered to people interested in property 24 hours a day 7 days a week even when the office is closed. The system also includes a <a target="_blank" href="http://www.instant-property-information.co.uk/board-Management-Software.php" title="FREE Board Management Software">FREE board management system</a>, and can send out <a target="_blank" href="http://www.instant-property-information.co.uk/scheduled-sms-sending.php" title="Scheduled SMS sending">scheduled text messages </a>for estates and letting agents. Unlike most other systems out there we&#8217;ve done the maths and have made sure that this system is <strong>FREE </strong>for agents.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Instant+Property+Information+%28IPI...+http://is.gd/ehg6s" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Instant+Property+Information+%28IPI...+http://is.gd/ehg6s" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Instant+Property+Information+%28IPI...+http://is.gd/ehg6s" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Instant+Property+Information+%28IPI...+http://is.gd/ehg6s" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;submitHeadline=Instant+Property+Information+%28IPI..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;submitHeadline=Instant+Property+Information+%28IPI..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;t=Instant+Property+Information+%28IPI..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;t=Instant+Property+Information+%28IPI..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;t=Instant+Property+Information+%28IPI..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;t=Instant+Property+Information+%28IPI..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Instant+Property+Information+%28IPI...&amp;link=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Instant+Property+Information+%28IPI...&amp;link=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/65-instant-property-information-ipi/&amp;title=Instant+Property+Information+%28IPI..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/65-instant-property-information-ipi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instant Property Information via SMS</title>
		<link>http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/</link>
		<comments>http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 14:00:46 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2008/06/11/instant-property-information-via-sms/</guid>
		<description><![CDATA[I&#8217;ve just taken up a position with a new company providing property information by SMS / Text Messages. Best of all we worked out a way that we can offer this service to estate and letting agents for FREE! No ties! No contract! How does instant property information work? Basically, a prospective tenant or house [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just taken up a position with a new company providing <a target="_blank" href="http://www.instant-property-information.co.uk/" title="Property Information by SMS / Text Messages">property information by SMS / Text Messages</a>. Best of all we worked out a way that we can offer this service to <a target="_blank" href="http://www.seraphestates.co.uk" title="Estate and Letting Agent">estate and letting agent</a>s for FREE! No ties! No contract!</p>
<p>How does instant property information work? Basically, a prospective tenant or house buyer Â sees a property that they like and texts a code on the property board. Instantly they recieve property information back from your company with your contact details. Ten minutes later you receive an email containing their contact details and the property that they were insterested in, so you can call them giving them additional details and to arrange viewings.</p>
<p>This was developed with a letting agent in Cardiff so we&#8217;ve got plenty of industry knowledge to answer some of the questions that other systems out there do not address.</p>
<p>Hopefully you&#8217;ll be seeing this service come to a your streetÂ in the near future, <a target="_blank" href="http://www.instant-property-information.co.uk" title="Instant Property Information via SMS">instant property information</a>.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Instant+Property+Information+via+SMS+http://is.gd/ehg6t" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Instant+Property+Information+via+SMS+http://is.gd/ehg6t" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Instant+Property+Information+via+SMS+http://is.gd/ehg6t" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Instant+Property+Information+via+SMS+http://is.gd/ehg6t" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;submitHeadline=Instant+Property+Information+via+SMS" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;submitHeadline=Instant+Property+Information+via+SMS" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;t=Instant+Property+Information+via+SMS" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;t=Instant+Property+Information+via+SMS" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;t=Instant+Property+Information+via+SMS" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;t=Instant+Property+Information+via+SMS" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Instant+Property+Information+via+SMS&amp;link=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Instant+Property+Information+via+SMS&amp;link=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/&amp;title=Instant+Property+Information+via+SMS" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/64-instant-property-information-via-sms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Santa Dives &#8211; Vobster Quay 2007</title>
		<link>http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/</link>
		<comments>http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 10:30:08 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Dive Trips]]></category>
		<category><![CDATA[Scuba Diving]]></category>
		<category><![CDATA[Scuba Santas]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/12/22/santa-dives-vobster-quay-2007/</guid>
		<description><![CDATA[Packing up the car on aÂ cold frostyÂ morning I wondered &#8220;whatÂ am I thinking&#8220;. Actually&#8230; that&#8217;s much like most early start dive trips except this morning I was shivering a little :( I was heading down to Vobster Quay in Somerset to meet several other equally foolish people for an interesting new eventÂ organised between members of Yorkshire [...]]]></description>
			<content:encoded><![CDATA[<p>Packing up the car on aÂ cold frostyÂ morning I wondered &#8220;<em>whatÂ am I thinking</em>&#8220;. Actually&#8230; that&#8217;s much like most early start dive trips except this morning I was shivering a little :( I was heading down to Vobster Quay in Somerset to meet several other equally foolish people for an interesting new eventÂ organised between members of Yorkshire DiversÂ (YD).</p>
<p><a href="http://www.evilprofessor.co.uk/gallery/photo/2130443905/Steam-coming-off-the-water-in-the-morning.html" class="tt-flickr"><img border="0" width="155" src="http://farm3.static.flickr.com/2106/2130443905_e496fb5d16_t.jpg" alt="Steam coming off the water in the morning" height="110" style="float: right; width: 155px; height: 110px" title="Steam coming off the water in the morning" /></a>The drive down from Cardiff was interesting due to the amount of fog and I had to crawl the car through Bristol. Upon reaching the dive site we saw that the water was in the same state as many people from around the country had been the previous night&#8230;. steaming ;)</p>
<p>So why had a small hardy bunch gathered in the middle of Somerset on a freezing December morning? Well its the age old story of getting dressed up as father christmas and jumping into cold water to raise money for charity. Every year members of YD work hard and selflessly to raise money for various charities and this year it was the turn of the <a href="http://www.rnli.org.uk" class="kblinker" target="_blank" title="More about RNLI &raquo;">RNLI</a>, appreciated by many divers in the UK.</p>
<p>During the dive the Santas were joined byÂ a christmas fairy, a snowman, and a pagan viking (celebrating the <a target="_blank" href="http://en.wikipedia.org/wiki/Winter_solstice" title="Wikipedia: Winter Solstice">Winter Solstice</a>). It doesn&#8217;t exactly sound like the most seraphic underwater scene but it was the good kind of strange being surrounded by such a group of people underwater. One of the nice things is thatÂ the group wasÂ diving everything from single tanks to twinsets and rebreathers. We all came from different diving backgrounds PADI, BSAC, TDI, IANTD, GUE but we were all there to have a bit of winter diving fun asÂ one big underwater group :)</p>
<p align="center"><a href="http://www.evilprofessor.co.uk/gallery/photo/2130440791/Wheres-the-other-santa.html" class="tt-flickr"><img border="0" align="absMiddle" width="161" src="http://farm3.static.flickr.com/2252/2130440791_3a5be920e3_m.jpg" alt="Where's the other santa?" height="240" style="width: 161px; height: 240px" title="Where's the other santa?" /></a>Â <a href="http://www.evilprofessor.co.uk/gallery/photo/2131213954/Queen-Scallop.html" class="tt-flickr"><img border="0" width="240" src="http://farm3.static.flickr.com/2095/2131213954_3d14eea73f_m.jpg" alt="Queen Scallop" height="161" /></a></p>
<p>A chilly first dive of around 45 minutes took us over to the rear end of an aeroplane fusilage where everyone posted for festive underwater christmas photos. Floating inside an aeroplane fusilage, underwater, hearing two guys singing &#8220;We&#8217;re walking in the air&#8221; has to count as one of the most surreal experiences of my life! Maybe narcosis does take significant effect at less than 30 metres as I spent most of the dive smiling or laughing mask filling with water all the time :)</p>
<p>We finished on a boat wreck which had been festively decorated by staff at Vobster Quay. Those who turned up to keep watch on the surface later told the group how people had exited the water looking confused asking &#8220;Umm did anyone else see all the father christmas&#8217; underwater?&#8221;.</p>
<p align="center"><a href="http://www.evilprofessor.co.uk/gallery/photo/2130435793/Odin-underwater.html" class="tt-flickr"><img border="0" width="240" src="http://farm3.static.flickr.com/2071/2130435793_e3d99fa578_m.jpg" alt="Odin underwater" height="169" /></a>Â <a href="http://www.evilprofessor.co.uk/gallery/photo/2130441247/Frosty-the-Snowman.html" class="tt-flickr"><img border="0" align="absMiddle" width="161" src="http://farm3.static.flickr.com/2413/2130441247_d8dcc03c3f_m.jpg" alt="Frosty the Snowman" height="240" style="width: 161px; height: 240px" title="Frosty the Snowman" /></a></p>
<p>On surfacing all involved took readily to a nice hot cup of tea, some some mince pies, and pulling christmas crackers. Those celebrating the winter solstice were soon offering people a small cup of meade to warm the soul after a cold dive, another welcome addition to the day.</p>
<p>LaterÂ we were joined by an enthusitastic young journalist who wanted to come along for a dive to experienceÂ the group of Santas. &#8220;<em>Crazy</em>&#8220;Â I thought, but we had a spare Santa outfit, soÂ as soon as we could feel our extremities then once again it was time to jump in. We obtained some interesting video footage for the BBC which included several santas disappearing into in long dark tunnel and some very festive rebreather divers.</p>
<p>Upon exiting the water maybe a little of the enthusiasm was lost but there were definate smiles from our new friend. <em>Everybody should dive with a group of Santas!</em></p>
<p>Â <a href="http://www.evilprofessor.co.uk/gallery/photo/2131217630/Queen-Scallop-and-Frosty-the-Snowman.html" class="tt-flickr"><img border="0" width="281" src="http://farm3.static.flickr.com/2203/2131217630_418733bab0_m.jpg" alt="Queen Scallop and Frosty the Snowman" height="217" style="float: right; width: 281px; height: 217px" /></a><br />
<a href="http://www.evilprofessor.co.uk/gallery/photo/2130436551/Santa-divers-.html" class="tt-flickr"><img border="0" width="144" src="http://farm3.static.flickr.com/2002/2130436551_e89283e1bd_m.jpg" alt="Santa divers :)" height="98" style="width: 144px; height: 98px" /></a></p>
<p><a href="http://www.evilprofessor.co.uk/gallery/photo/2131217782/Lloyd-playing-with-beard-.html" class="tt-flickr"><img border="0" width="146" src="http://farm3.static.flickr.com/2002/2131217782_ef1b213671_m.jpg" alt="Lloyd playing with beard :)" height="97" style="width: 146px; height: 97px" /></a></p>
<p>Overall the whole group had a fun enjoyable day despite the temperatures, and we certainly managed to spread a little of that Christmas magic for everyone at the site that day. I&#8217;d like to thank Tim from Vobster Quay for the use of their facilities and donating Â£5 for every scuba diving Santa, Gareth Lock from &#8220;<a target="_blank" href="http://www.imagesoflife.co.uk" title="Images of Life">Images of Life</a>&#8221; for his excellent underwater photography skills, everyone who took part today, and also everyone that has donated money for the event. Donations can be collected until the mid-Feburary 2008 via our JustGiving page: <a href="http://www.justgiving.com/ScubaSantas/">http://www.justgiving.com/ScubaSantas/</a>.</p>
<p><strong>See you next year!</strong></p>
<p>Lloyd Watkin</p>
<p>See more pictures here: <a href="http://www.evilprofessor.co.uk/gallery/album/72157603525450806/Santa-Dives-2007.html" title="Scuba Santas 2007 Photo Gallery">Scuba Santas 2007 <img border="0" align="absMiddle" width="100" src="http://farm3.static.flickr.com/2286/2130457143_68a1c32594_t.jpg" height="75" style="width: 100px; height: 75px" /></a> <scuba border="0" src="http://farm3.static.flickr.com/2286/2130457143_68a1c32594_t.jpg" height="75" width="100"></scuba></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Santa+Dives+%E2%80%93+Vobster+Quay+2007+http://is.gd/ehg6u" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Santa+Dives+%E2%80%93+Vobster+Quay+2007+http://is.gd/ehg6u" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Santa+Dives+%E2%80%93+Vobster+Quay+2007+http://is.gd/ehg6u" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Santa+Dives+%E2%80%93+Vobster+Quay+2007+http://is.gd/ehg6u" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;submitHeadline=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;submitHeadline=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;t=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;t=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;t=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;t=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007&amp;link=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007&amp;link=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/&amp;title=Santa+Dives+%E2%80%93+Vobster+Quay+2007" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/63-santa-dives-vobster-quay-2007/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Merthyr Mawr Christmas Pudding Challenge 10k 2007</title>
		<link>http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/</link>
		<comments>http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 11:00:05 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Races]]></category>
		<category><![CDATA[Running]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/12/16/merthyr-mawr-christmas-pudding-challenge-10k-2007/</guid>
		<description><![CDATA[I&#8217;d been looking forward to this race for a good couple of months! The Christmas Pudding challenge promised a big sand dune and a spell of stream running. I was not disappointed. My first race at Merthyr Mawr, before this race I didn&#8217;t even know that the highest sand dune in Europe was almost in [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-47" href="http://www.evilprofessor.co.uk/?attachment_id=47" title="The Big Dipper, Methyr Mawr, South Wales"></a>I&#8217;d been looking forward to this race for a good couple of months! The <a target="_blank" href="http://www.brackla-harriers.org/" title="Merthyr Mawr Christmas Pudding Challenge from the Brackla Harriers">Christmas Pudding challenge </a>promised a big sand dune and a spell of stream running. I was not disappointed. My first race at <a target="_blank" href="http://en.wikipedia.org/wiki/Merthyr_Mawr" title="Wikipedia: Merthyr Mawr">Merthyr Mawr</a>, before this race I didn&#8217;t even know that the highest sand dune in Europe was almost in my back yard. After parking the car a couple of miles away and running up to the start I saw the monster in front of me *gulp* much bigger than I was expecting.</p>
<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/mm4.jpg" title="The Big Dipper, Merthyr Mawr, South Wales"><img align="top" width="231" src="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/mm4.jpg" alt="The Big Dipper, Merthyr Mawr, South Wales" height="178" style="float: left; width: 231px; height: 178px" title="The Big Dipper, Merthyr Mawr, South Wales" /></a>Â Here&#8217;s a picture of the sand dune from near the top as you can see its a big one at about 300ft! The way up was tough and with lots of people I couldn&#8217;t go any faster even if I&#8217;d wanted to. Anyway there was a bit of congestion at the top of the dune so there was a few minutes of waiting around (good time for everyone to catch their breath). The next thing I know I&#8217;m plummeting straight down the other side at full speed, half worried I&#8217;m going to bowl over at any moment, but my its good fun ;)</p>
<p>From there we head out across a flat wind swept area before what I heard to refer as the <em>&#8216;orrible hill</em>, and it was just that. A long steep hill up to the golf course (at least it wasn&#8217;t covered in sand too). So did the usual trick, drop the arms, reduce the stride length and switch into &#8220;<a target="_blank" href="http://tigger.uic.edu/~plotnick/littleng.htm" title="Disney's Little Engine that Could">Disney&#8217;s LittleÂ Engine that Could</a>&#8221; mode&#8230;.</p>
<p align="center"><span style="text-align: center"><em>&#8220;I know I can, I&#8217;m sure I can, I know I can, I&#8217;m sure I can&#8221;</em></span></p>
<p>&#8230;which slowly became, &#8220;<em>I&#8217;m not sure I can, I know my legs hurt</em>&#8221; :( Slowly but surely I got to the top of the hill and had some nice views down to the sea.</p>
<p>I figured the mid-point couldn&#8217;t be far away at thisÂ time and upon approaching not only were we offered water but mulled wine and mince pies. Now being the highly professional athlete I am of course I opted for the mulled wine, vitamins, water, warmth it all made sense&#8230;..surely? A good cup of hot mulled wine it was and with the long slow decent I started flying along &#8211; alcohol fueled possibly ;)</p>
<p>Around back to the dunes which again made the running a little tough and in the back of my mind the stream was coming. Next thing I know we&#8217;re running through a shallowÂ bit of water,Â some tried to skirt around the outside but for a laugh I headed through the middle :) Got out of that one when a marshall mentioned there was another couple to go. Lets say the third one was pretty deep and cold, almost got up to places I don&#8217;t wish to have frozen off, but fortunately the crowd was spared me shreaking like a girl had that happened!</p>
<p>Post race I collected my soup and bread roll and <em>Christmas Pudding</em> and ran back to a warm car for the drive home accompanied by some loud <a target="_blank" href="http://en.wikipedia.org/wiki/Jay-Z" title="Wikipedia: Jay Z">JayZ</a> courtesy of <a target="_blank" href="http://www.google.co.uk/url?q=http://www.bbc.co.uk/radio1/&amp;revid=1693984244&amp;sa=X&amp;oi=revisions_inline&amp;resnum=0&amp;ct=result&amp;cd=1&amp;usg=AFQjCNEja-L8D9WsvpBcwDinsca5ZLyv4A" title="BBC Radio 1">Radio 1</a>.</p>
<p><iframe height="700" width="100%" frameBorder="0" src="http://js.mapmyfitness.com/embed/blogview.html?r=9c03cce9ef153d32e08c1bafbb369309&amp;u=m&amp;t=run"></iframe></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007+http://is.gd/ehfRE" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007+http://is.gd/ehfRE" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007+http://is.gd/ehfRE" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007+http://is.gd/ehfRE" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;submitHeadline=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;submitHeadline=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;t=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;t=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;t=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;t=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007&amp;link=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007&amp;link=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/&amp;title=Merthyr+Mawr+Christmas+Pudding+Challenge+10k+2007" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/46-merthyr-mawr-christmas-pudding-challenge-10k-2007/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cardiff Santa Dash 2007</title>
		<link>http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/</link>
		<comments>http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 12:30:11 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Races]]></category>
		<category><![CDATA[Running]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/12/09/cardiff-santa-dash-2007/</guid>
		<description><![CDATA[Â This was to be a quick 5km race around Bute Park in Cardiff, however the weather over the past week meant that a last minute change of course was required reducing the course length to around 3km (best guess!). The announcement system was terrible (being polite) so I don&#8217;t think many people actually had much [...]]]></description>
			<content:encoded><![CDATA[<p>Â This was to be a quick 5km race around Bute Park in Cardiff, however the weather over the past week meant that a last minute change of course was required reducing the course length to around 3km (best guess!). The announcement system was terrible (being polite) so I don&#8217;t think many people actually had much of an idea what was going on.</p>
<p>The race went ok, nothing much to report except although things in the gym has been going well it doesn&#8217;t make up for a lack of running in the outdoors! I have the Merthyr Mawr Christmas pudding next weekend which I&#8217;m really looking forward to although the weather has prevented much running outside. This will need to fixed over the next week :)</p>
<p><a href="http://www.evilprofessor.co.uk/gallery/album/72157603417986567/Cardiff-Santa-Dash-2007.html" title="Cardiff Santa Dash 2007 Photos">Cardiff Santa Dash 2007 Photos</a> <a href="http://www.evilprofessor.co.uk/gallery/album/72157603417986567/Cardiff-Santa-Dash-2007.html" class="tt-flickr"><img border="0" align="middle" width="100" src="http://farm3.static.flickr.com/2015/2098924100_26b95b77bf_t.jpg" height="75" style="width: 100px; height: 75px" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Cardiff+Santa+Dash+2007+http://is.gd/ehg6w" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Cardiff+Santa+Dash+2007+http://is.gd/ehg6w" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Cardiff+Santa+Dash+2007+http://is.gd/ehg6w" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Cardiff+Santa+Dash+2007+http://is.gd/ehg6w" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;submitHeadline=Cardiff+Santa+Dash+2007" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;submitHeadline=Cardiff+Santa+Dash+2007" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;t=Cardiff+Santa+Dash+2007" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;t=Cardiff+Santa+Dash+2007" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;t=Cardiff+Santa+Dash+2007" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;t=Cardiff+Santa+Dash+2007" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Cardiff+Santa+Dash+2007&amp;link=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Cardiff+Santa+Dash+2007&amp;link=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/&amp;title=Cardiff+Santa+Dash+2007" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/45-cardiff-santa-dash-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced Diver Training</title>
		<link>http://www.evilprofessor.co.uk/60-advanced-diver-training/</link>
		<comments>http://www.evilprofessor.co.uk/60-advanced-diver-training/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 12:00:46 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/12/01/advanced-diver-training/</guid>
		<description><![CDATA[Advanced Diver Training was a quick inexpensive website set up for a scuba diving instructor. The budget was small but this does not mean that the quality of the end product had to be low. The site was created, edited, and up and running within 3 days at a small cost. We hope you agree [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/advanced-diver-training.JPG" title="Advanced Diver Training"><img src="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/advanced-diver-training.thumbnail.JPG" alt="Advanced Diver Training" style="float: left" /></a></p>
<p>Advanced Diver Training was a quick inexpensive website set up for a scuba diving instructor. The budget was small but this does not mean that the quality of the end product had to be low. The site was created, edited, and up and running within 3 days at a small cost. We hope you agree that the site has a professional look and the site owner is able to update and edit the site without further intevention of a website designer. This website was developed with the open source software <a target="_blank" href="http://www.wordpress.org" title="Wordpress">wordpress</a>.</p>
<p><a target="_blank" href="http://www.advanced-diver-training.co.uk" title="Advanced Diver Training - IANTD/PADI Nitrox and Trimix Scuba Dive Training">Advanced Diver Training &#8211; PADI/IANTD training in nitrox and trimix</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Advanced+Diver+Training+http://is.gd/ehg6z" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Advanced+Diver+Training+http://is.gd/ehg6z" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Advanced+Diver+Training+http://is.gd/ehg6z" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Advanced+Diver+Training+http://is.gd/ehg6z" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;submitHeadline=Advanced+Diver+Training" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;submitHeadline=Advanced+Diver+Training" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;t=Advanced+Diver+Training" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;t=Advanced+Diver+Training" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;t=Advanced+Diver+Training" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;t=Advanced+Diver+Training" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Advanced+Diver+Training&amp;link=http://www.evilprofessor.co.uk/60-advanced-diver-training/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Advanced+Diver+Training&amp;link=http://www.evilprofessor.co.uk/60-advanced-diver-training/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/60-advanced-diver-training/&amp;title=Advanced+Diver+Training" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/60-advanced-diver-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyfinder</title>
		<link>http://www.evilprofessor.co.uk/58-keyfinder/</link>
		<comments>http://www.evilprofessor.co.uk/58-keyfinder/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 12:00:43 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/11/01/keyfinder/</guid>
		<description><![CDATA[Keyfinder required a new online store for their business. Open source software solutions wouldn&#8217;t have provided the features that they required, therefore Evilprofessor Designs stepped in and created them a fully custom webstore with full PayPal IPN integration. Keyfinder staff can fully customise the website through an admin interface which includes updating orders and registations, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/keyfinder.JPG" title="Keyfinder"><img src="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/keyfinder.thumbnail.JPG" alt="Keyfinder" style="float: left" /></a></p>
<p>Keyfinder required a new online store for their business. Open source software solutions wouldn&#8217;t have provided the features that they required, therefore Evilprofessor Designs stepped in and created them a fully custom webstore with full PayPal IPN integration. Keyfinder staff can fully customise the website through an admin interface which includes updating orders and registations, editing page text, and add/edit/update product listings.</p>
<p><a target="_blank" href="http://www.keyfinder.com" title="Keyfinder - Security and peace of mind for your keys...">Keyfinder &#8211; Security and peace of mind for your keys&#8230;</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Keyfinder+http://is.gd/ehg6A" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Keyfinder+http://is.gd/ehg6A" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Keyfinder+http://is.gd/ehg6A" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Keyfinder+http://is.gd/ehg6A" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/58-keyfinder/&amp;submitHeadline=Keyfinder" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/58-keyfinder/&amp;submitHeadline=Keyfinder" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/58-keyfinder/&amp;t=Keyfinder" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/58-keyfinder/&amp;t=Keyfinder" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/58-keyfinder/&amp;t=Keyfinder" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/58-keyfinder/&amp;t=Keyfinder" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Keyfinder&amp;link=http://www.evilprofessor.co.uk/58-keyfinder/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Keyfinder&amp;link=http://www.evilprofessor.co.uk/58-keyfinder/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/58-keyfinder/&amp;title=Keyfinder" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/58-keyfinder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tour of Torfaen Half Marathon</title>
		<link>http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/</link>
		<comments>http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 10:00:20 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Races]]></category>
		<category><![CDATA[Running]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/10/28/tour-of-torfaen-half-marathon/</guid>
		<description><![CDATA[What am I doing? I&#8217;ve been in bed all week with a bad cold, I&#8217;ve managed one run since the Cardiff Half where I pulled my left calf, and now I&#8217;m stood out in the freezing driving rain about to run another one!!! Standing at the start line, soaked to the bones already, the hooter [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What am I doing?</strong> I&#8217;ve been in bed all week with a bad cold, I&#8217;ve managed one run since the <a href="http://www.evilprofessor.co.uk/2007/10/14/cardiff-half-marathon-2007/" title="Cardiff Half Marathon">Cardiff Half </a>where I pulled my left calf, and now I&#8217;m stood out in the freezing driving rain about to run another one!!! Standing at the start line, soaked to the bones already, the hooter goes&#8230;. here we go again :)<span id="more-43"></span></p>
<p>As I said, I&#8217;d been in bed with a cold the previous week before the race, was hit and miss about whether I&#8217;d do the race but Friday morning I was feeling a bit better (besides the horrendus cough) so I thought why not. I knew I&#8217;d only be sitting around on Sunday morning wishing I&#8217;d done the race anyway.</p>
<p>Waking up Sunday morning I looked out of the window and oh bugger was it raining hard, the warm bed looked awfully inviting, but no I was going. Arriving at <a target="_blank" href="http://www.torfaen.gov.uk/LeisureAndCulture/SportsClubsAndCentres/CwmbranStadium/Home.aspx" title="Cwmbran Stadium">Cwmbran Stadium</a> if anything the weather had got a little worse, but I climbed onto the coach for the trip up to <a target="_blank" href="http://www.blaenavon.gov.uk/" title="Blaenavon ">Blaenavon</a> for the start. Runners gathered in the rugby club before the race, and despite the conditions outside everyone was in high spirits and lots of laughs going around :)</p>
<p>I decided that I was going to try and cover the first part of the race as fast as I could, I knew without much training I wouldn&#8217;t really have the stamina to keep going for the entire race. So I belted it at the start planning on just surviving the last part of the course. I managed to cover the first 5km in just over 20 minutes (good news for the next 5km race!).</p>
<p>All the way around everyone out supporting (or just walking the dog), the PCSOs directing traffic, and all the other runnersÂ were <em>very friendly</em> and <em>encouraging</em>. That&#8217;s the main difference that struck me about this compared to the <a target="_blank" href="http://www.evilprofessor.co.uk/2007/10/14/cardiff-half-marathon-2007/" title="Cardiff Half Marathon">Cardiff Half</a>.</p>
<p>As predicted after about 9 miles I could feel my legs getting heavy and my pace slowed right down. The wind had picked up again and at times was holding runners on the spot, not nice at this point in the race. By 11 miles my chest got tight and I had to stop a couple of times for some coughing fits :( Still arriving in the stadium for a lap and a half I managed to grab a little more energy from somewhere.</p>
<p>I eventually finished in 1:56:33, drenched, tired, aching, <em>but with a big smile on my face</em>! More like a time from a training run, but that&#8217;s fine given the circumstances. I&#8217;ll definately be back next year, hopefully I&#8217;ll be in much better physical state to run and the weather gods will be smiling on the event ;)</p>
<p>All that said it was nice to get home to a hot bath and some cold beers :)</p>
<p><iframe height="700" width="100%" frameBorder="0" src="http://js.mapmyfitness.com/embed/blogview.html?r=c6eb8db4c26532b405ef134f68794cba&amp;u=m&amp;t=run"></iframe></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Tour+of+Torfaen+Half+Marathon+http://is.gd/ehg6B" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Tour+of+Torfaen+Half+Marathon+http://is.gd/ehg6B" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Tour+of+Torfaen+Half+Marathon+http://is.gd/ehg6B" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Tour+of+Torfaen+Half+Marathon+http://is.gd/ehg6B" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;submitHeadline=Tour+of+Torfaen+Half+Marathon" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;submitHeadline=Tour+of+Torfaen+Half+Marathon" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;t=Tour+of+Torfaen+Half+Marathon" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;t=Tour+of+Torfaen+Half+Marathon" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;t=Tour+of+Torfaen+Half+Marathon" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;t=Tour+of+Torfaen+Half+Marathon" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Tour+of+Torfaen+Half+Marathon&amp;link=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Tour+of+Torfaen+Half+Marathon&amp;link=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/&amp;title=Tour+of+Torfaen+Half+Marathon" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/43-tour-of-torfaen-half-marathon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stuck on 4096 characters???</title>
		<link>http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/</link>
		<comments>http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 14:21:58 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/10/26/stuck-on-4096-characters/</guid>
		<description><![CDATA[I&#8217;ve come up with a problem recently returning data via an XML feed using AJAX. In my case I was returning a list of images each having several links to perform various tasks (e.g. set as main image, add as thumbnail, add full image, etc). The first load would go through fine and all images [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come up with a problem recently returning data via an <a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">XML</a> feed using AJAX. In my case I was returning a list of images each having several links to perform various tasks (e.g. set as main image, add as thumbnail, add full image, etc).</p>
<p>The first load would go through fine and all images and their links would appear as I&#8217;d expect. There was also no problems in IE7, Safari (on Windows), or Opera 9+. When it came to Firefox 2 the image list would be cut short! Editing the javascript it basically seems that the returned data would be cut off at 4096 characters.</p>
<p>It took a while to track down the result. I thought initially this might of been a javascript maximum string length problem, but that other browsers just let the issue slip. Not that either. <strong>Anyway it turns out that text nodes are split at 4096 characters.</strong></p>
<p>It&#8217;s quite simple to fix you simply need to <em>normalise()</em> your returned data in your AJAX script. Simply add the second line once you&#8217;ve gathered your XML data:</p>
<p><code>xmlResponse = xmlHttp.responseXML;<br />
xmlResponse.normalize();</code></p>
<p>This will solve the 4096 character limit when using Firefox 2 or any other browser I haven&#8217;t checked that doesn&#8217;t normalise the data automatically.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Stuck+on+4096+characters...+http://is.gd/ehg6C" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Stuck+on+4096+characters...+http://is.gd/ehg6C" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Stuck+on+4096+characters...+http://is.gd/ehg6C" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Stuck+on+4096+characters...+http://is.gd/ehg6C" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;submitHeadline=Stuck+on+4096+characters..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;submitHeadline=Stuck+on+4096+characters..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;t=Stuck+on+4096+characters..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;t=Stuck+on+4096+characters..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;t=Stuck+on+4096+characters..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;t=Stuck+on+4096+characters..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Stuck+on+4096+characters...&amp;link=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Stuck+on+4096+characters...&amp;link=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/&amp;title=Stuck+on+4096+characters..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/42-stuck-on-4096-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and easy $_POST security&#8230;</title>
		<link>http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/</link>
		<comments>http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 19:44:50 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/10/25/quick-and-easy-_post-security/</guid>
		<description><![CDATA[A quick and easy way to protect yourself from mySQL injection attacks in PHP is to use&#8230; $sql = "insert into table set "; Â foreach ($_POST as $key =&#62; $data) Â { Â Â Â Â  $sql .= $key." = '".strip_tags(htmlentities(addslashes($data)))."',"; Â } Â $sql .= mysql_query(rtrim($sql,',').";") or die(mysql_error()); What this script does is to take your $_POST data and remove [...]]]></description>
			<content:encoded><![CDATA[<p>A quick and easy way to protect yourself from <a href="http://www.mysql.com/?bydis_dis_index=1" class="kblinker" target="_blank" title="More about mysql &raquo;">mySQL</a> injection attacks in <a href="http://www.php.net" class="kblinker" target="_blank" title="More about PHP &raquo;">PHP</a> is to use&#8230;</p>
<p><code>$sql = "insert into table set ";<br />
Â foreach ($_POST as $key =&gt; $data)<br />
Â {<br />
Â Â Â Â  $sql .= $key." = '".strip_tags(htmlentities(addslashes($data)))."',";<br />
Â }<br />
Â $sql .= mysql_query(rtrim($sql,',').";") or die(mysql_error());<br />
</code><br />
What this script does is to take your <em>$_POST</em> data and remove anything malicious from it. Looping over the <em>$_POST</em> data we build up an SQL statement. At the end then we simply execute using with <em>mysql_query</em>.</p>
<p>NOTE: This does not validate your data, it just helps prevent malicious attacks.</p>
<p>Another version of this that I use to to grab all my form information into variables to to place the following code within the foreach loop instead&#8230;</p>
<p><code>eval("$".$key." = '".strip_tags(htmlentities(addslashes($data)))."';");</code></p>
<p>This makes up a list of variables following your forms field names and strips malicious code from them. This method then allows you to do some form validation before inserting data into your tables ;)</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Quick+and+easy+%24_POST+security...+http://is.gd/ehg6E" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Quick+and+easy+%24_POST+security...+http://is.gd/ehg6E" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Quick+and+easy+%24_POST+security...+http://is.gd/ehg6E" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Quick+and+easy+%24_POST+security...+http://is.gd/ehg6E" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;submitHeadline=Quick+and+easy+%24_POST+security..." title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;submitHeadline=Quick+and+easy+%24_POST+security..." title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;t=Quick+and+easy+%24_POST+security..." title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;t=Quick+and+easy+%24_POST+security..." title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;t=Quick+and+easy+%24_POST+security..." title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;t=Quick+and+easy+%24_POST+security..." title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Quick+and+easy+%24_POST+security...&amp;link=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Quick+and+easy+%24_POST+security...&amp;link=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/&amp;title=Quick+and+easy+%24_POST+security..." title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/41-quick-and-easy-_post-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cardiff Half Marathon 2007</title>
		<link>http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/</link>
		<comments>http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 09:00:09 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Races]]></category>
		<category><![CDATA[Running]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/10/14/cardiff-half-marathon-2007/</guid>
		<description><![CDATA[So today was it, my first half marathon. Training had gone fairly well, I&#8217;d managed to do my over the mountain half training several times my best time on that being 1 hour 57 mins roughly. A few days of tapering, which generally meant I felt rubbish and there I was standing on the start [...]]]></description>
			<content:encoded><![CDATA[<p>So today was it, my first half marathon. Training had gone fairly well, I&#8217;d managed to do my over the mountain half training several times my best time on that being 1 hour 57 mins roughly. A few days of tapering, which generally meant I felt rubbish and there I was standing on the start line at 8:30am. <strong>I finished in 1 hour 48 mins 44 seconds.</strong><span id="more-40"></span></p>
<p>I wasn&#8217;t as nervous for this race as I was for the <a href="http://www.evilprofessor.co.uk/2007/07/29/bupa-great-wales-run-2007/" title="Great Wales Run 2007">Great Wales Run</a>, maybe it&#8217;s because I was better prepared, not as well prepared, or just plain stupid! Either way it was good for my stomach.</p>
<p>The race got going at 9am and started off just fine. I planned to run 8:20 minute miles for the whole race. The good thing about 8:20 minute miles is that it makes the maths easy for getting your pacing right. Every 3 miles is 25 minutes! Getting to the one mile marker I checked my watch that readÂ 4 minutes 20Â seconds, hmm bugger, something had gone wrong thereÂ :(Â  It simply meant I had to do a little more maths to work out my pacing but it kept my head busy :)</p>
<p>As I&#8217;ve found in other races I had to spent a good part of the start of the race getting around people who&#8217;d started way too far up the field. A little annoying and knackers you out a bit from the quick bursts of speed to get around people.<a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr"></a><a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr"></p>
<p style="text-align: center"><a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr"><img border="0" width="180" src="http://farm3.static.flickr.com/2304/1597358707_13b9a9f949_m.jpg" alt="img_4337" height="240" /></a><a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr">Â </a><a href="http://www.evilprofessor.co.uk/gallery/photo/1597374827/img4340.html" class="tt-flickr"><img border="0" width="240" src="http://farm3.static.flickr.com/2032/1597374827_4075dfa6be_m.jpg" alt="img_4340" height="180" /></a><a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr"> </a><a href="http://www.evilprofessor.co.uk/gallery/photo/1598258774/img4339.html" class="tt-flickr"><img border="0" width="180" src="http://farm3.static.flickr.com/2148/1598258774_f69c731ac7_m.jpg" alt="img_4339" height="240" /></a><a href="http://www.evilprofessor.co.uk/gallery/photo/1597358707/img4337.html" class="tt-flickr"> </a></p>
<p></a>The race itself was rather nice, good to be across the barage again, although I realised after a bit that I was running on the windward side and acting as a windbreak for so many other people, that said the breeze was nice :) Support around the bay was good it&#8217;s always nice to have people giving a shout. I kept popping a glucose tablet every 3 miles and having a few mouthfuls of water at the water stations.</p>
<p>Heading back up into the town there was lots of supporters outside the stadium and I almost cried when we passed the burger van at the market. Still only another couple of hours and I&#8217;d be sitting in a pub enjoying the fruits of my labour. I was hitting my pacing rather well as far as I could tell which I was quite happy about, meaning that I should get in for approx 1 hour 50 minutes, <em>a time I&#8217;d be very happy with</em>!</p>
<p>The last mile was fairly crappy due to the stone work on the ground, I tried to run as much as possible on the grass to avoid that problem. Entering the castle grounds for the finishing straight was awesome there were so many people shouting. It gave me a real lift and I picked up speed and managed to sprint across the line, about to puke as I stopped ;)</p>
<p>Nabbed myself a couple of free bottles of <a target="_blank" href="http://www.lucozade.com/" title="Lucozade">lucozade </a>and sat on the bank waiting for Rhianne to run it in. Fair play she managed to finish in 2 hours 31 minutes much better than she had hoped, well done Rhianne! After a long painful walk home (being overtaken by old people I should add) a quick shower and I was in <a target="_blank" href="http://www.fullers.co.uk/frames.phtml?page_object_id=2022" title="Fuller's London Pride">London Pride</a> heaven. All you can eat Tapas at <a target="_blank" href="http://www.latasca.co.uk/HOME/Home.html" title="La Tasca - Spanish Tapas ">La Tasca</a> and a few more pints of <a target="_blank" href="http://www.sabrain.com/" title="Brains Beer - It's Brains you want !">Brains</a> and all was well with the world again&#8230;. now just two weeks until the next one :)</p>
<p>More photos&#8230; <a href="http://www.evilprofessor.co.uk/gallery/album/72157602466327750/Cardiff-Half-Marathon---14th-October-2007.html" class="tt-flickr"><img border="0" align="middle" width="75" src="http://farm3.static.flickr.com/2195/1598274492_ba3796371c_t.jpg" height="100" style="width: 75px; height: 100px" />Cardiff Half Marathon 2007 photos</a></p>
<p><iframe height="700" width="100%" frameBorder="0" src="http://js.mapmyfitness.com/embed/blogview.html?r=8350d58b94bce40b325b8826d220402a&amp;u=m&amp;t=run"></iframe></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Cardiff+Half+Marathon+2007+http://is.gd/ehg6F" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Cardiff+Half+Marathon+2007+http://is.gd/ehg6F" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Cardiff+Half+Marathon+2007+http://is.gd/ehg6F" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Cardiff+Half+Marathon+2007+http://is.gd/ehg6F" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;submitHeadline=Cardiff+Half+Marathon+2007" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;submitHeadline=Cardiff+Half+Marathon+2007" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;t=Cardiff+Half+Marathon+2007" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;t=Cardiff+Half+Marathon+2007" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;t=Cardiff+Half+Marathon+2007" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;t=Cardiff+Half+Marathon+2007" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Cardiff+Half+Marathon+2007&amp;link=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Cardiff+Half+Marathon+2007&amp;link=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/&amp;title=Cardiff+Half+Marathon+2007" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/40-cardiff-half-marathon-2007/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Divesigns.com</title>
		<link>http://www.evilprofessor.co.uk/56-divesignscom/</link>
		<comments>http://www.evilprofessor.co.uk/56-divesignscom/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 12:00:26 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/10/01/divesignscom/</guid>
		<description><![CDATA[Dive Signs required a low cost solution due to being a start up company. Dive Signs are a family run business based in Essex they sell highly reflective vinyl stickers for the scuba diving industry. The solution for Dive Signs was a customised install of Zen Cart, the entire site took less than one week [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/divesigns.JPG" title="DiVeSiGnS"><img src="http://www.evilprofessor.co.uk/wp-content/uploads/2007/12/divesigns.thumbnail.JPG" alt="DiVeSiGnS" style="float: left" /></a></p>
<p>Dive Signs required a low cost solution due to being a start up company. Dive Signs are a family run business based in Essex they sell highly reflective vinyl stickers for the scuba diving industry. The solution for Dive Signs was a customised install of <a target="_blank" href="http://www.zencart.com" title="Zen Cart - The Art of eCommerce">Zen Cart</a>, the entire site took less than one week to get up and running and they are already expanding their online catalogue.</p>
<p><a target="_blank" href="http://www.divesigns.com" title="Divesigns - Highly reflective vinyl stickers for scuba diving">Divesigns.com &#8211; Highly reflective vinyl signs for scuba diving</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Divesigns.com+http://is.gd/ehg6H" title="Post to Twitter"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Divesigns.com+http://is.gd/ehg6H" title="Post to Twitter">Tweet This Post</a> <a class="tt" href="http://plurk.com/?status=Divesigns.com+http://is.gd/ehg6H" title="Post to Plurk"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-plurk.png" alt="Post to Plurk" /></a> <a class="tt" href="http://plurk.com/?status=Divesigns.com+http://is.gd/ehg6H" title="Post to Plurk">Plurk This Post</a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/56-divesignscom/&amp;submitHeadline=Divesigns.com" title="Post to Yahoo Buzz"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-buzz.png" alt="Post to Yahoo Buzz" /></a> <a class="tt" href="http://buzz.yahoo.com/submit?submitUrl=http://www.evilprofessor.co.uk/56-divesignscom/&amp;submitHeadline=Divesigns.com" title="Post to Yahoo Buzz">Buzz This Post</a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Delicious"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Digg"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/56-divesignscom/&amp;t=Divesigns.com" title="Post to Facebook"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.evilprofessor.co.uk/56-divesignscom/&amp;t=Divesigns.com" title="Post to Facebook">Facebook</a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/56-divesignscom/&amp;t=Divesigns.com" title="Post to MySpace"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-myspace.png" alt="Post to MySpace" /></a> <a class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://www.evilprofessor.co.uk/56-divesignscom/&amp;t=Divesigns.com" title="Post to MySpace">MySpace</a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Divesigns.com&amp;link=http://www.evilprofessor.co.uk/56-divesignscom/" title="Post to Ping.fm"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-ping.png" alt="Post to Ping.fm" /></a> <a class="tt" href="http://ping.fm/ref/?method=microblog&amp;title=Divesigns.com&amp;link=http://www.evilprofessor.co.uk/56-divesignscom/" title="Post to Ping.fm">Ping This Post</a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Reddit"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to Reddit">Reddit</a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to StumbleUpon"><img class="nothumb" src="http://www.evilprofessor.co.uk/wp-content/plugins/tweet-this/icons/tt-su.png" alt="Post to StumbleUpon" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://www.evilprofessor.co.uk/56-divesignscom/&amp;title=Divesigns.com" title="Post to StumbleUpon">Stumble This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilprofessor.co.uk/56-divesignscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Including an RSS Feed on your site&#8230;</title>
		<link>http://www.evilprofessor.co.uk/39-including-an-rss-feed-on-your-site/</link>
		<comments>http://www.evilprofessor.co.uk/39-including-an-rss-feed-on-your-site/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 15:31:00 +0000</pubDate>
		<dc:creator>Steven Lloyd Watkin</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.evilprofessor.co.uk/2007/09/26/including-an-rss-feed-on-your-site/</guid>
		<description><![CDATA[I&#8217;ve used my RSS feed generator on a few sites now, so I figure it&#8217;s about time I share. The final output validates and conforms to RSS2.0 standards so it will import into most things. I&#8217;ve even got mine linked to my facebook profile. The full code is at the bottom of the page. Basically [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used my <a target="_blank" href="http://en.wikipedia.org/wiki/RSS_(file_format)" title="Wikipedia: RSS Feeds">RSS</a> feed generator on a few sites now, so I figure it&#8217;s about time I share. The final output <a target="_blank" href="http://feedvalidator.org/" title="RSS Feed Validator">validates</a> and conforms to RSS2.0 standards so it will import into most things. I&#8217;ve even got mine linked to my <a target="_blank" href="http://www.facebook.com" title="Facebook.com - Social Networking">facebook</a> profile. The full code is at the <a href="http://www.evilprofessor.co.uk/wp-admin/post.php#fullScript" title="Full RSS Feed Script">bottom of the page</a>.</p>
<p>Basically I use my RSS script to generate news feeds for the sites that I write. Examples can be seen on these sites,</p>
<ul>
<li><a target="_blank" href="http://www.cardiffscuba.co.uk/rss.php" title="Cardiff Scuba RSS Feed">Cardiff Scuba RSS Feed</a>,</li>
<li><a target="_blank" href="http://www.seraphestates.co.uk" title="Seraph Estates RSS Feed">Seraph Estates RSS Feed</a>.</li>
</ul>
<p>But generally you can use the feed generator to serve any information you wish. For example would be the results of a search query where the query variables can be picked up from $_GET[]&#8216;s $_POST[]&#8216;s.</p>
<p>Anyway a question a friend asked me was &#8220;<a target="_blank" href="http://www.whyrss.com/" title="What's the point in RSS?">What&#8217;s the Point in RSS</a>&#8221; good question! Click on the link to find out :)</p>
<p>Right anyway onto the script. Firstly we need to tell the browser or news-aggregator that it&#8217;s looking at a rss:xml feed,</p>
<pre lang="php">// Write the RSS header
header("Content-Type: text/<a href="http://en.wikipedia.org/wiki/XML" class="kblinker" target="_blank" title="More about XML &raquo;">xml</a>;charset=utf-8");</pre>
<p>It&#8217;s at this point that I usually set up my database connection and link to the information I require so usually it&#8217;ll be something like,</p>
<pre lang="php">include_once( "./connect.php" );
$sql = mysql_query("select * from news order by 'datePosted' desc LIMIT 50;" );</pre>
<p>I limit to 50 as no one wants to see 1000&#8242;s of posts going back years and years unless they specifically ask for it :) Then we start writing out the &#8216;introduction&#8217; part of the feed,</p>
<pre lang="php">echo "<!--l version=\"1.0\" encoding=\"utf-8\"-->";
echo "<rss version="\"></rss>";
echo "<channel></channel>";
echo "";
echo "<description>YOUR SITE/FEED DESCRIPTION</description>";
echo "
<link>".$_SERVER['HTTP_SERVER']."</link>";</pre>
<p>Then we loop through our items (in this case news articles) printing the data out to our xml file,</p>
<pre lang="php">// loop through the array pulling database fields for each item
while ($newsItem = mysql_fetch_assoc($sql))
{
	$title 			= textFormat($newsItem['news_title']);
	$link 			= $_SERVER['HTTP_SERVER']."news.php#news".$newsItem['id'];
	$description 	= textFormat($newsItem['news_item']);
	$uid 			= "tag:".$_SERVER['HTTP_SERVER'].",2007-09-26:rss.".$newsItem['id'];
	$pubDate 		= date("D, d M Y H:i:s O", strtotime($newsItem['date_posted']));
	echo "<item></item>";
    echo "";
    echo "
<link>".$link."</link>";
    echo "<description>".$description."</description>";
    echo "
<pubdate>".$pubDate."</pubdate>";
    echo "<guid isPermaLink="\">".$uid."</guid>";
    echo "";
}</pre>
<p>Remember for our RSS feed all text should be <a target="_blank" href="http://en.wikipedia.org/wiki/UTF-8" title="Wikipedia: UTF-8">UTF-8</a> encoded so we include a little function to do this,</p>
<pre lang="php">function textFormat($intext) { return utf8_encode(htmlspecialchars(stripslashes($intext)));}</pre>
<p>Then it&#8217;s just a simple case of closing down our xml tree and we&#8217;re all done,</p>
<pre lang="php">echo "";</pre>
<p>Pretty painless wasn&#8217;t it :) And you can use these feeds to output anything of use. If someone is returning to your site to check for updated information should it be course dates, news items, forum posts, blog entries, even property searches it can all be done using RSS feeds.</p>
<p>Here&#8217;s the entire script:<a name="fullScript" title="fullScript"></a></p>
<pre lang="php"><!---->//==========================================
// Author: Steven Lloyd Watkin
// Company: Evilprofessor Designs
// Website: http://www.ep-projects.co.uk
// Date: June 2007
// Feel free to use and modify, but please
// include reference to my site somewhere :)
//==========================================  

function textFormat($intext) { return utf8_encode(htmlspecialchars(stripslashes($intext)));}  

header("Content-Type: text/xml;charset=utf-8");
echo "<!--l version=\"1.0\" encoding=\"utf-8\"-->";
echo "<rss version="\"></rss>";
echo "<channel></channel>";  

// retrieve database records
include('connect.php');
$sql = mysql_query("select * from 'news' order by 'datePosted' desc");  

echo "";
echo "<description>YOUR SITE/FEED DESCRIPTION</description>";
echo "
<link>".$_SERVER['HTTP_SERVER']."</link>"; 

// loop through the array pulling database fields for each item
while ($newsItem = mysql_fetch_assoc($sql))
{
	$title 			= textFormat($newsItem['news_title']);
	$link 			= $_SERVER['HTTP_SERVER']."news.php#news".$newsItem['id'];
	$description 	= textFormat($newsItem['news_item']);
	$uid 			= "tag:".$_SERVER['HTTP_SERVER'].",2007-09-26:rss.".$newsItem['id'];
	$pubDate 		= date("D, d M Y H:i:s O", strtotime($newsItem['date_posted']));
	echo "<item></item>";
    echo "";
    echo "
<link>".$link."</link>";
    echo "<description>".$description."</description>";
    ec