<?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>Chris Tate-Davies</title>
	<atom:link href="http://www.christatedavies.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christatedavies.co.uk</link>
	<description>An archive of helpful tit bits of information for development, and probably some stuff that is incomplete, wrong or boring...</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:18:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using mod_rewrite for clean URLs</title>
		<link>http://www.christatedavies.co.uk/2012/01/31/using-mod_rewrite-for-clean-urls/</link>
		<comments>http://www.christatedavies.co.uk/2012/01/31/using-mod_rewrite-for-clean-urls/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 11:18:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=323</guid>
		<description><![CDATA[Say your message board on your blog uses the following request URL to find and display the correct data: http://www.mysite.com/blog/index.php?category=news&#38;year=2012&#38;month=1 This is a rather simple request, but it is not very nice looking or easy on the eye, and it can be improved, for the user end experience. Take this for instance: http://www.mysite.com/blog/news/2012/1 That&#8217;s much [...]]]></description>
			<content:encoded><![CDATA[<p>Say your message board on your blog uses the following request URL to find and display the correct data:</p>
<pre>http://www.mysite.com/blog/index.php?category=news&amp;year=2012&amp;month=1</pre>
<p>This is a rather simple request, but it is not very nice looking or easy on the eye, and it can be improved, for the user end experience.</p>
<p>Take this for instance:</p>
<pre>http://www.mysite.com/blog/news/2012/1</pre>
<p>That&#8217;s much nicer, and easier to read and understand even for a non technical person. They may understand the category, year and month without any input from you,</p>
<p>How do you convert your site? Well you don&#8217;t need to, but you can use a .htaccess mod_rewrite to change the url in the background.</p>
<pre>RewriteRule blog/([a-z0-9]+)/([0-9]{4})/([0-9]) /blog/index.php?category=$1&amp;year=$2&amp;month=$3 [L]</pre>
<p>This takes the first quantifier after blog (a-z0-9) and says any characters, put into $1. The second is a 4 digit number, and the third, any number.</p>
<p>The [L] tells the re-write engine that if this rule matches, don&#8217;t do any more rule processing (last one)</p>
<p>If you implement this way of displaying your links, then your site should be better off in the big wide world of search engines. A lot of search engine spiders ignore URL&#8217;s with &amp; in them as it can cause recursive looping and its easier to just ignore them.</p>
<p>Also, if you come to rewrite your blog in a new language, ASP for instance (shudder at the thought) then you can change the rule simply:</p>
<pre>RewriteRule blog/([a-z0-9]+)/([0-9]{4})/([0-9]) /blog/index.asp?category=$1&amp;year=$2&amp;month=$3 [L]</pre>
<p>Thinking about your user experience, even if you are considering the search engines, is important.</p>
<p>If you want to read more about the Apache re-write module, you can go <a href="http://httpd.apache.org/docs/current/rewrite/" target="_blank">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2012/01/31/using-mod_rewrite-for-clean-urls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Message: [Syntax Error] Expected PlainValue, got &#8221;&#8217; at position x in property {model}</title>
		<link>http://www.christatedavies.co.uk/2011/12/14/message-syntax-error-expected-plainvalue-got-at-position-x-in-property-model/</link>
		<comments>http://www.christatedavies.co.uk/2011/12/14/message-syntax-error-expected-plainvalue-got-at-position-x-in-property-model/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 10:36:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[annotation]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[ORM]]></category>
		<category><![CDATA[PlainValue]]></category>
		<category><![CDATA[quotes]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=316</guid>
		<description><![CDATA[Was getting the above error in my Doctrine project, turned out I had used a single quote in the ORM Annotations:     /**      * @ORM\Column(type='integer', name='row_number')      * @var int      */     protected $rowNumber; Your ORM Annotations must be double quotes &#8221; to allow the read ahead to read ahead&#8230; &#160;]]></description>
			<content:encoded><![CDATA[<p>Was getting the above error in my Doctrine project, turned out I had used a single quote in the ORM Annotations:</p>
<pre>    /**
     * @ORM\Column(type='integer', name='row_number')
     * @var int
     */
    protected $rowNumber;</pre>
<p>Your ORM Annotations <strong>must</strong> be double quotes &#8221; to allow the read ahead to read ahead&#8230;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/12/14/message-syntax-error-expected-plainvalue-got-at-position-x-in-property-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VPNetMon &#8211; close programs when VPN drops</title>
		<link>http://www.christatedavies.co.uk/2011/12/10/vpnetmon-close-programs-when-vpn-drops/</link>
		<comments>http://www.christatedavies.co.uk/2011/12/10/vpnetmon-close-programs-when-vpn-drops/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 20:42:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=312</guid>
		<description><![CDATA[If you are using a VPN to securely download files, whether it be for anomynous reasons or anything else, if the VPN connection gets dropped, your PC may revert to an unsecured connection to continue the operation. VPNetMon is an application that montors your VPN connection and if it drops, the application can be configured [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using a VPN to securely download files, whether it be for anomynous reasons or anything else, if the VPN connection gets dropped, your PC may revert to an unsecured connection to continue the operation.</p>
<p>VPNetMon is an application that montors your VPN connection and if it drops, the application can be configured to close certain apps.</p>
<p>So if you are using a BitTorrent client and using an anonymous VPN connection to download content this will make you feel much more secure indeed.</p>
<p>You can get it at <a href="http://vpnetmon.webs.com/" target="_blank">http://vpnetmon.webs.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/12/10/vpnetmon-close-programs-when-vpn-drops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>God, Windows is sloooooow</title>
		<link>http://www.christatedavies.co.uk/2011/11/30/god-windows-is-sloooooow/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/30/god-windows-is-sloooooow/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 12:17:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Humour]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tortoise]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=292</guid>
		<description><![CDATA[I am assisting a colleague today check out a rather large feature branch. I showed him the branch address and he started checking it out using Tortoise SVN on Windows 7. Upon returning to my desk (Ubuntu 11.10), I decided to merge the branch with the major trunk. I checked out a brand new copy [...]]]></description>
			<content:encoded><![CDATA[<p>I am assisting a colleague today check out a rather large feature branch. I showed him the branch address and he started checking it out using Tortoise SVN on Windows 7.</p>
<p>Upon returning to my desk (Ubuntu 11.10), I decided to merge the branch with the major trunk. I checked out a brand new copy of the branch, merged it (for the first time in several months) and then re-committed the pages.</p>
<p>Guess what, he&#8217;s still checking out the original!!!</p>
<p>Do yourselves a favour guys, make it Linux this Christmas&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/30/god-windows-is-sloooooow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HEX colour chart with RGB reference</title>
		<link>http://www.christatedavies.co.uk/2011/11/30/hex-colour-chart-with-rgb-reference/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/30/hex-colour-chart-with-rgb-reference/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 09:52:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[colours]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=288</guid>
		<description><![CDATA[I need this quite often so I thought I would put it on my site. Nothing more, nothing less. (Click it to make it bigger) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>I need this quite often so I thought I would put it on my site. Nothing more, nothing less. (Click it to make it bigger)</p>
<p><a href="http://www.christatedavies.co.uk/wp-content/uploads/2011/11/hexchart.gif"><img class="alignleft size-medium wp-image-289" title="HEX colour chart" src="http://www.christatedavies.co.uk/wp-content/uploads/2011/11/hexchart-300x259.gif" alt="HEX colour chart" width="300" height="259" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/30/hex-colour-chart-with-rgb-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS properties direction (padding, margins, etc)</title>
		<link>http://www.christatedavies.co.uk/2011/11/25/css-properties-direction-padding-margins-etc/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/25/css-properties-direction-padding-margins-etc/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 14:44:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[box-model]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[margins]]></category>
		<category><![CDATA[padding]]></category>
		<category><![CDATA[stylesheets]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=285</guid>
		<description><![CDATA[You&#8217;ll have no doubt seen: padding: 5px 10px 5px 10px; in a CSS file. Do you ever wonder which of the properties are which? Just start at the top and move clockwise until you reach the left side. Top Right Bottom Left It saves doing this:- padding-top: 5px; padding-right: 10px; padding-bottom: 5px; padding-left: 10px; Just [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ll have no doubt seen:</p>
<pre>padding: 5px 10px 5px 10px;</pre>
<p>in a CSS file. Do you ever wonder which of the properties are which?</p>
<p>Just start at the top and move clockwise until you reach the left side.</p>
<pre>Top Right Bottom Left</pre>
<p>It saves doing this:-</p>
<pre>padding-top: 5px;
padding-right: 10px;
padding-bottom: 5px;
padding-left: 10px;</pre>
<p>Just a simple one that I&#8217;m sure 99.9% of people knew.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/25/css-properties-direction-padding-margins-etc/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu, Thunderbird always maximised</title>
		<link>http://www.christatedavies.co.uk/2011/11/23/ubuntu-thunderbird-always-maximised/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/23/ubuntu-thunderbird-always-maximised/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 11:46:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=283</guid>
		<description><![CDATA[I recently switched from Linux Mint back to the old trusty Ubuntu (11.10) One major problem was Unity, but I got round this by installing Xfce and use that as a shell instead. Much better. Now, my Thunderbird is proper maximised. Like full screen, so I can&#8217;t switch to any applications unless I use ALT [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched from Linux Mint back to the old trusty Ubuntu (11.10)</p>
<p>One major problem was Unity, but I got round this by installing Xfce and use that as a shell instead. <span style="text-decoration: underline;"><strong>Much</strong></span> better.</p>
<p>Now, my Thunderbird is proper maximised. Like full screen, so I can&#8217;t switch to any applications unless I use ALT TAB. Found help on the net.</p>
<p>1) Close Thunderbird</p>
<p>2) Locate your localstore.rdf file, mine was in:</p>
<pre>~/.thunderbird/ftfxbq7f.default$</pre>
<p>3) Edit the file, and find the section that looks a little like this:</p>
<pre>&lt;RDF:Description RDF:about="chrome://messenger/content/messenger.xul#messengerWindow"
                   width="1024"
                   height="1024"
                   screenX="344"
                   screenY="113"
                   sizemode="fullscreen" /&gt;</pre>
<p>And change it to:</p>
<pre>&lt;rdf:Description RDF:about="chrome://messenger/content/messenger.xul#messengerWindow"
                   width="800"
                   height="600"
                   sizemode="normal"
                   screenX="5"
                   screenY="5" /&gt;</pre>
<p>Then, once restarted, Thunderbird should be all nice and accessible again. Thanks to <a href="http://gregk.me/2008/mozilla-firefox-and-thunderbird-ubuntu-maximized-issue/" target="_blank">Greg</a> for this one!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/23/ubuntu-thunderbird-always-maximised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A-Z list of CSS features</title>
		<link>http://www.christatedavies.co.uk/2011/11/20/a-z-list-of-css-features/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/20/a-z-list-of-css-features/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 17:34:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/2011/11/20/a-z-list-of-css-features/</guid>
		<description><![CDATA[Found this great list of CSS features. https://developer.mozilla.org/en/CSS/CSS_Reference]]></description>
			<content:encoded><![CDATA[<p>Found this great list of CSS features.</p>
<p><a href="https://developer.mozilla.org/en/CSS/CSS_Reference" target="_blank">https://developer.mozilla.org/en/CSS/CSS_Reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/20/a-z-list-of-css-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Hoisting</title>
		<link>http://www.christatedavies.co.uk/2011/11/18/javascript-hoisting/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/18/javascript-hoisting/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 12:08:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[hoisting]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=279</guid>
		<description><![CDATA[When using JavaScript, you declare a variable using the var keyword. var myvariable = "a value"; These variables are globally accessible unless they are defined within a function. Javascript performs an operation known as &#8220;hoisting&#8221; when it compiles which draws all the declarations to the top of the page. Here is a piece of code: [...]]]></description>
			<content:encoded><![CDATA[<p>When using JavaScript, you declare a variable using the var keyword.</p>
<pre>var myvariable = "a value";</pre>
<p>These variables are globally accessible unless they are defined within a function. Javascript performs an operation known as &#8220;hoisting&#8221; when it compiles which draws all the declarations to the top of the page.</p>
<p>Here is a piece of code:</p>
<pre>var test = "my test";
alert(test);</pre>
<p>When run, the above will display &#8220;my test&#8221; in an alert, as you would expect.</p>
<p>Consider this:</p>
<pre>var test = "my test";
alert(test);

function testMe() {
    alert(test);
    var test = "another test";
    alert(test);
}

testMe();</pre>
<p>The above will display &#8220;my test&#8221; and then an &#8220;undefined&#8221; error and then &#8220;another test&#8221; in an alert. This is because we have declared a function variable within the function testMe function and this overrides the global state.</p>
<p>If we refactor the code as so:</p>
<pre>var test = "my test";
alert(test);

function testMe() {
    alert(test);
    test = "another test";
    alert(test);
}

testMe();</pre>
<p>Because we have not used the var keyword, the variable exists throughout, and the alerts you get will be &#8220;my test&#8221; and then &#8220;my test&#8221; and finally, &#8220;another test&#8221;</p>
<p>Its very important to remember this, as when you have some large functions, you could be getting obscure results you could be looking for a long time to find the issue.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/18/javascript-hoisting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing controller data from a partial viewscript</title>
		<link>http://www.christatedavies.co.uk/2011/11/17/accessing-controller-data-from-a-partial-viewscript/</link>
		<comments>http://www.christatedavies.co.uk/2011/11/17/accessing-controller-data-from-a-partial-viewscript/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 15:43:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[partial]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[Viewscript]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Zend_Form]]></category>

		<guid isPermaLink="false">http://www.christatedavies.co.uk/?p=273</guid>
		<description><![CDATA[When using an inline partial viewscript in my form, I sometimes need access to data. I can accomplish this by using a setter and getter with a public function in my form. We&#8217;ll use the action &#8220;guinness&#8221; as the controller action in this example. application\modules\project\forms\guinness\base.php protected $_id; public function setId($id) { $this-&#62;_id = $id; return [...]]]></description>
			<content:encoded><![CDATA[<p>When using an inline partial viewscript in my form, I sometimes need access to data. I can accomplish this by using a setter and getter with a public function in my form. We&#8217;ll use the action &#8220;guinness&#8221; as the controller action in this example.</p>
<p><strong>application\modules\project\forms\guinness\base.php</strong></p>
<pre>protected $_id;

public function setId($id)
{
    $this-&gt;_id = $id;
    return $this;
}

public function getId()
{
    return $this-&gt;_id;
}

public function getPintCount()
{
    $model = new PubModel();
    return $model-&gt;countPints(this-&gt;getId());
}</pre>
<p><strong>application\modules\project\views\scripts\guinness\page.phtml</strong></p>
<pre>&lt;?=$this-&gt;render('_partial.phtml');?&gt;</pre>
<p><strong>application\modules\project\controllers\GuinnessController.php</strong></p>
<pre>&lt;?php
$form = new SomeForm();
$form-&gt;setId(123);
?&gt;</pre>
<p><strong>application\modules\projects\views\scripts\guinness\_partial.phtml</strong></p>
<pre>&lt;?=$this-&gt;element-&gt;getPintCount();?&gt;</pre>
<p>&nbsp;</p>
<p>This way I can get the content view my connected partials which in essence are a copy of the viewscript.</p>
<p>Seems a long way round, but it keeps everything nicely separated.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christatedavies.co.uk/2011/11/17/accessing-controller-data-from-a-partial-viewscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

