<?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:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"
>

<channel>
	<title>oneangrydwarf</title>
	<atom:link href="http://www.oneangrydwarf.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oneangrydwarf.co.uk</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Thu, 13 Nov 2008 19:40:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Maps Tutorial, Part 1: A Simple Map</title>
		<link>http://www.oneangrydwarf.co.uk/web/google-maps-tutorial-part-1-a-simple-map/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/google-maps-tutorial-part-1-a-simple-map/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 19:40:15 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Google Maps]]></category>

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/?p=181</guid>
		<description><![CDATA[Google Maps provides an excellent and powerful mapping solution with some complex features whilst maintaining high usability and a fast user interface. Through the JavaScript API Google have exposed a large portion of the functionality of their maps and data for use in websites and web applications (all of which must comply with their Terms [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://maps.google.com">Google Maps</a> provides an excellent and powerful mapping solution with some complex features whilst maintaining high usability and a fast user interface. Through the <a href="http://code.google.com/apis/maps/">JavaScript API</a> Google have exposed a large portion of the functionality of their maps and data for use in websites and web applications (all of which must comply with their <a href="http://code.google.com/apis/maps/terms.html">Terms of Use</a>). It may sound difficult but it doesn&#8217;t have to be. In fact it is quite easy to produce some quite sophisticated behaviour with relatively little code.</p>
<p>In this series I hope to demonstrate how to build several increasingly complex mapping applications that could have practical uses in a website or application. At the end of each part I will give some ideas for how I think the example could be adapted to a real-life situation. As the examples get more advanced the number of possible applications will increase but so also will the amount of work required to change my code to achieve a specific purpose. I hope to demonstrate to tools and techniques you might need in making these changes. So, of we go!</p>
<p>In the first example I will show how to create a very simple map that can be displayed on a web page with a pin marking a particular point.</p>
<h3>Prerequisites</h3>
<p>For this part of the tutorial you will need a basic knowledge of HTML, CSS and JavaScript and some web space but not a lot else. You won&#8217;t even need any server-side scripting!</p>
<h3>Step 1 - Getting a Google API Key</h3>
<p>The first step is to obtain a Google API key. This will be required for any Google Maps application that you create and is tied to the domain from which the requests to the API are made. This may mean that you need separate API keys if your development domain is different to your live domain. This is not really a problem however as it is really simple to obtain a key.</p>
<p>Simply go to <a href="http://code.google.com/apis/maps/signup.html">the sign-up page</a>, read the Terms of Use (or more likely the summary as the full document is rather dull), check the box confirming you understand the blurb, enter your site URL and generate the key.</p>
<p>The next page will give you your key (a really long string of letters and numbers) as well as a snippet  of code to get you started. Ignore this for now as we will be recreating something similar in a moment but with more explanation along the way. If you forget your key, don&#8217;t worry as following this procedure again should result in exactly the same key as long as domain is the same.</p>
<h3>Step 2 - Displaying a Map</h3>
<p>Okay, that&#8217;s the boring bit over. Now for something more interesting - let&#8217;s get a map on the screen. Firstly create a simple (X)HTML file (I&#8217;ll assume you know how to do this) and add an empty <code>div</code> element to the <code>body</code> as below.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
   <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;map&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<p>Make sure you don&#8217;t forget the <code>id</code> attribute as we&#8217;ll be using it in a moment. </p>
<p>Next, you&#8217;ll need to load in the API file. Add the following code to the HTML <code>head</code> tag replacing the key for this site with the key for yours.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAv5cMnGZ5zeb1SlRlW91GkBStkTdrHPl7LrMl77V0klQxRUcDRBSy-WJLTWS8O7_n3a6dBXQ0xp7Jqg&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Now that&#8217;s the preparation done so we can add the map itself. Create a new JavaScript file called <code>map.js</code> in a directory called <code>js</code> and add the lines</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> load<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>GBrowserIsCompatible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;map&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
      map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span>0<span style="color: #339933;">,</span> 0<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>;
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> load;
window.<span style="color: #000066;">onunload</span> <span style="color: #339933;">=</span> GUnload;</pre></div></div>

<p>So what&#8217;s going on here? Well the <code>load()</code> function is the bit doing all the magic and is creating a new Google Map object (if the browser can display it) and attaching it to our map <code>div</code>. The centre point of the map is set to longitude 0 and latitude 0 which is the point on the equator on the Prime Meridian (which runs through Greenwich). The last argument sets the zoom level of the map which is set to the minimum value to display a world map. We will change this centre point and zoom level later. We attach this function to execute when the page is loaded so the map gets displayed as soon as the user visits the page. </p>
<p>The <code>GUnload()</code> call destroys any Google JavaScript objects left around when the user navigates away from the page. This is important as in some browsers those objects would stay in memory until the whole browser is closed unless explicitly destroyed.</p>
<p>Okay, just a few more bits left to get the map on the screen. Firstly you will need to load in your newly created JavaScript file into the HTML page.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/map.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>You may be wondering why I&#8217;ve separated the JavaScript into another file whereas the Google example has it all in the one HTML file. It is good practice to separate markup (HTML), behaviour (JavaScript) and presentation (CSS) into different &#8216;layers&#8217; or groups of files as it helps separate your code into more maintainable and readable chunks. It also means that browsers can cache your JavaScript and CSS files independently and therefore decrease loading times. For a further discussion into these techniques see <a href="http://www.alistapart.com/articles/understandingprogressiveenhancement">Understanding Progressive Enhancement</a> from <a href="http://www.alistapart.com">A List Apart</a> or the <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">Wikipedia article on progressive enhancement</a>.</p>
<p>We need to set the size of the map on the page otherwise it will not display properly. To do this, create a CSS file called <code>styles.css</code> in a new directory called <code>css</code>. Insert the following code.</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;"><span style="color: #cc00cc;">#map</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span>;
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span>;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Now link the style to your HTML page by adding</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/styles.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>to the <code>head</code> of the document.
</pre>
<p>If you now open your HTML page in a web browser you should see a lovely world map displayed on the page.</p>
<h3>Step 3 - Centering the Map</h3>
<p>That&#8217;s the hard work done now lets change where the map is focused. Google Maps requires location information to be passed to it in terms of its longitude and latitude. Unless you think in these terms you will need to convert an address, location or postcode into this format in order to use it in a Google Maps application. The process of converting an address or other human readable location into its longitude and latitude is called geocoding. We will discuss this topic in a later tutorial but for now we will use the Google&#8217;s own Maps application to do the work for us.</p>
<p>Go to <a href="http://maps.google.com">Google Maps</a> and search for the location you want to be at the centre of your map. Check that the map is centred around the correct point and that the marker is pointing to the right place. Now, right click on the marker and select the option &#8216;Clear search results&#8217;. The marker will disappear but the map should stay centered on the same place. Now go to the top right and click &#8216;Send&#8217;. A box will pop up containing a link. The longitude and latitude are in the &#8216;ll&#8217; fragment of the url. This is the data you will need.</p>
<p>For example, I searched for Downing Street, London and the URL I have is</p>
<p><code>http://maps.google.co.uk/maps?hl=en&#038;ie=UTF8&#038;<b>ll=51.503093,-0.128124</b><br />&#038;spn=0.010205,0.027895&#038;z=16</code> </p>
<p>I have highlighted the relevent fragment. In this case the longitude is 51.503093 and the latitude is -0.128124.</p>
<p>With these values we need to add a few lines to the beginning of the <code>map.js</code> file.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> latitude <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>0.128124.;
<span style="color: #003366; font-weight: bold;">var</span> longitude <span style="color: #339933;">=</span> <span style="color: #CC0000;">51.503093</span>;
<span style="color: #003366; font-weight: bold;">var</span> zoom <span style="color: #339933;">=</span> <span style="color: #CC0000;">13</span>;</pre></div></div>

<p>Now alter the script that sets the centre location to the following.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> location <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span>latitude<span style="color: #339933;">,</span> longitude<span style="color: #009900;">&#41;</span>;
map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span>location<span style="color: #339933;">,</span> zoom<span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>Now when you load the map it should be centred around the point you specified.</p>
<h3>Step 4 - Adding a Marker</h3>
<p>Adding a marker is very simple. Just add the following code to your JavaScript file at the end of the <code>load()</code> function. This will add a marker at the same location as the map is centered.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> marker <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span>location<span style="color: #009900;">&#41;</span>;
map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span>marker<span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>Load up your map in your browser and you should see you map focused on and marking the location you specified. Magic.</p>
<p>As you can see the amount of code involved in this is quite small considering the visual complexity of the effect. The Google Maps API allows you to tell it what you want it to do in simple terms while it does all the hard work in the background. </p>
<p>This example map would be perfect on a company website to show the location of an office or shop or simply to point out a landmark or a place you have visited. A picture (or map) is worth a thousand words! In future tutorials we will look at more advanced techniques like information bubbles, multiple points, interacting with the server and geocoding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/google-maps-tutorial-part-1-a-simple-map/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading to Ubuntu Intrepid Ibex</title>
		<link>http://www.oneangrydwarf.co.uk/web/upgrading-to-ubuntu-intrepid-ibex/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/upgrading-to-ubuntu-intrepid-ibex/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 18:53:33 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Ubuntu]]></category>

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

		<category><![CDATA[intrepid-ibex]]></category>

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

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/?p=174</guid>
		<description><![CDATA[The latest version of Ubuntu, 8.10 (also known as Intrepid Ibex), has been out for a few days now and I was waiting for the update manager to tell me the upgrade was available. When this didn&#8217;t happen I tried to find out why.
It turns out that version 8.04 (Hardy Heron) was what Ubuntu call [...]]]></description>
			<content:encoded><![CDATA[<p>The latest version of Ubuntu, 8.10 (also known as Intrepid Ibex), has been out for a few days now and I was waiting for the update manager to tell me the upgrade was available. When this didn&#8217;t happen I tried to find out why.</p>
<p>It turns out that version 8.04 (Hardy Heron) was what Ubuntu call a <cite>Long Term Support</cite> release which is why you often see 8.04 followed by the acronym LTS. For this reason, by default, Hardy Heron will not by default offer the new version as an upgrade in the update manager. This can be fixed of course and here&#8217;s how:</p>
<ol>
<li>Go to the Software Sources item in the menus:
<pre>
System -> Administration -> Software Sources
</pre>
</li>
<li>Now select the Updates tab and change the option at the bottom called &#8216;Release upgrade&#8217; from &#8216;Long term support releases only&#8217; to &#8216;Normal releases&#8217; and then accept the changes.</li>
<li>Now go back to the Update Manager  in
<pre>System -> Administration -> Update Manager</pre>
<p>and the option to upgrade will be present and you can upgrade as normal. Simple.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/upgrading-to-ubuntu-intrepid-ibex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>.local Domains on Ubuntu Desktop</title>
		<link>http://www.oneangrydwarf.co.uk/web/local-domains-on-ubuntu-desktop/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/local-domains-on-ubuntu-desktop/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 19:43:47 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Ubuntu]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/?p=46</guid>
		<description><![CDATA[My web development environment usually consists of an Ubuntu machine set up with a LAMP stack using Apache virtual hosts and a simple DNS setup. I tend to use a .local extension to the domains to make them easy to access and to compare to their online counterparts. For example I use oneangrydwarf.local for the [...]]]></description>
			<content:encoded><![CDATA[<p>My web development environment usually consists of an Ubuntu machine set up with a <acronym title="Linux, Apache, MySQL and PHP">LAMP</acronym> stack using <a href="http://httpd.apache.org/docs/1.3/vhosts/">Apache virtual hosts</a> and a simple DNS setup. I tend to use a <code>.local</code> extension to the domains to make them easy to access and to compare to their online counterparts. For example I use <code>oneangrydwarf.local</code> for the testing environment for this site. </p>
<p>The problem comes when I set this up on an <a href="http://www.ubuntu.com/products/WhatIsUbuntu/desktopedition">Ubuntu Desktop</a> installation (as opposed to an <a href="http://www.ubuntu.com/products/whatisubuntu/serveredition">Ubuntu Server</a> installation) which I prefer simply for ease of use. Unfortunately a program called <a href="http://avahi.org/">Avahi</a> stands in my way by hijacking the top-level domain and overriding the DNS records. Apparently Avahi is used for &#8220;<cite>service discovery on a local network</cite>&#8221; and is an integral part of Ubuntu Desktop (attempting to remove it also removes the desktop environment) but personally I don&#8217;t need it and it gets in my way. For anybody else having this problem here&#8217;s how to fix it, firstly temporarily (if you need Avahi normally but just want a quick fix) and secondly a more permanent solution.</p>
<ol>
<li>Stop the Avahi daemon by typing

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avahi-daemon stop</pre></div></div>

<p>      This will only solve the problem until the server is rebooted as the process is integral to Ubuntu Desktop. Attempting to uninstall Avahi will also uninstall the Ubuntu Desktop.</li>
<li>Tell Ubuntu to check the DNS server first by editing <code>/etc/nsswitch.conf</code> and changing the line that reads

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">hosts:  files mdns4_minimal <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">NOTFOUND</span>=<span style="color: #7a0874; font-weight: bold;">return</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> dns mdns4</pre></div></div>

<p>      to</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">hosts: files dns mdns4_minimal <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">NOTFOUND</span>=<span style="color: #7a0874; font-weight: bold;">return</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> mdns4</pre></div></div>

<p>      Now restart Avahi with the command</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avahi-daemon restart</pre></div></div>

<p>      See <a href="http://andrewgdotcom.wordpress.com/2007/09/28/avahi-and-dot-local-addresses-on-ubuntu-gutsy/">Avahi and dot-local addresses on Ubuntu Gutsy</a> from <a href="http://andrewgdotcom.wordpress.com/">The Fifth Wheel of andrewg</a> for more details.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/local-domains-on-ubuntu-desktop/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Syntax Highlighting with Wordpress</title>
		<link>http://www.oneangrydwarf.co.uk/web/syntax-highlighting-with-wordpress/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/syntax-highlighting-with-wordpress/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 19:43:21 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Site Updates]]></category>

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

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

		<category><![CDATA[syntax-highlighting]]></category>

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

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

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/?p=101</guid>
		<description><![CDATA[No programming blog is complete without decent syntax highlighting so it seemed reasonable to expect there to already be a good plug-in available to provide the functionality I need. Sure enough, a quick search resulted in finding WP-Syntax. The plug-in is based on GeSHi which started as the syntax highlighter for phpBB and is now [...]]]></description>
			<content:encoded><![CDATA[<p>No programming blog is complete without decent syntax highlighting so it seemed reasonable to expect there to already be a good plug-in available to provide the functionality I need. Sure enough, a quick search resulted in finding <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a>. The plug-in is based on <a href="http://qbnz.com/highlighter/"><acronym title="Generic Syntax Highlighter">GeSHi</acronym></a> which started as the syntax highlighter for <a href="http://www.phpbb.com/">phpBB</a> and is now a fully independent project with support for most major languages.</p>
<p>As a demonstration (and a test) here&#8217;s some PHP:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Foo <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bar</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">echo</span> <span style="">'Hello World!'</span>;
   <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>and some CSS (with line numbers):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css css" style="font-family:monospace;">   <span style="color: #6666ff;">.foo</span> <span style="color: #00AA00;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span>;
      <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span>;
   <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I think that&#8217;s enough of a demonstration and promotion of the previously mentioned projects but expect to see some code related posts in the not-to-distant future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/syntax-highlighting-with-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Site Design</title>
		<link>http://www.oneangrydwarf.co.uk/web/new-site-design/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/new-site-design/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 17:08:34 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Site Updates]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/?p=51</guid>
		<description><![CDATA[You may have noticed that I have just launched a new, improved site design. I decided on a new look in order to accomodate the changing direction of the site and my future plans for its content.
The first thing you might notice is the wider layout (see the before and after screenshots) which allows for [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that I have just launched a new, improved site design. I decided on a new look in order to accomodate the changing direction of the site and my future plans for its content.</p>
<div id="attachment_64" class="wp-caption alignleft" style="width: 310px"><a href="http://www.oneangrydwarf.co.uk/wp-content/uploads/2008/10/old-design.png"><img class="size-medium wp-image-64" title="Old Design" src="http://www.oneangrydwarf.co.uk/wp-content/uploads/2008/10/old-design-300x188.png" alt="Before" width="300" height="188" /></a><p class="wp-caption-text">Before</p></div>
<div id="attachment_65" class="wp-caption alignleft" style="width: 310px"><a href="http://www.oneangrydwarf.co.uk/wp-content/uploads/2008/10/new-design.png"><img class="size-medium wp-image-65" title="New Design" src="http://www.oneangrydwarf.co.uk/wp-content/uploads/2008/10/new-design-300x188.png" alt="After" width="300" height="188" /></a><p class="wp-caption-text">After</p></div>
<p>The first thing you might notice is the wider layout (see the before and after screenshots) which allows for both a wider reading area and more content in the sidebars (more on that in another post). The shorter header section is more streamlined too which also gives over more space to content. The emphasis on content is also echoed by the new location of the sidebars on the right. Content is king!</p>
<p>So, what will all this space be used for? Well I am hoping to keep the content updated much more frequently and with much more of a technical emphasis. I have been working as a professional web developer for over a year now and it&#8217;s time I started documenting some of my experiences. Maybe somebody somewhere might find it useful as well as it being a good record for me in the future.</p>
<p>Any feedback or bug reports on the new design are more than welcome. I know its far from perfect but I hope to iron out all the major problems over the next few weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/new-site-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>In Response to &#8216;Where did all the PHP developers go?&#8217;</title>
		<link>http://www.oneangrydwarf.co.uk/web/in-response-to-where-did-all-the-php-developers-go/</link>
		<comments>http://www.oneangrydwarf.co.uk/web/in-response-to-where-did-all-the-php-developers-go/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 07:55:11 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/uncategorized/in-response-to-where-did-all-the-php-developers-go/</guid>
		<description><![CDATA[In response to this post by Leonid Mamchenkov about the lack of good PHP developers in Cyprus I thought I would share my thoughts about the experience that the company I work for has had in recruiting a PHP developer to work on our web applications in the UK. We have had great difficulty targeting [...]]]></description>
			<content:encoded><![CDATA[<p>In response to <a href="http://mamchenkov.net/wordpress/2008/06/04/where-did-all-the-php-programmers-go/" title="Where did all the PHP programmers go?">this post</a> by Leonid Mamchenkov about the lack of good PHP developers in Cyprus I thought I would share my thoughts about the experience that the company I work for has had in recruiting a PHP developer to work on our web applications in the UK. We have had great difficulty targeting the quality of developer that we need for our large scale business applications and have come to the conclusion that it&#8217;s partly due to the lack of good web developers in the market. We have had a wide variety of applicants but very few have been anywhere near the quality we have been looking for (so far).</p>
<p>There are a lot of &#8217;script kiddies&#8217; around who claim to be advanced developers just because they have made a few websites that use a scripting language and a database. Very few seem to have any knowledge of MVC, frameworks, design patterns, version control or even fundamental concepts like OO and basic commenting and documentation techniques. Like Leonid we would settle for even a few of these skills.</p>
<p>I don&#8217;t believe that these problems are necessarily specific to PHP (I may be wrong) but probably the web development industry in general. One of the main problems is the lack of respect for web development by computer scientists and academics. Coming from a university that teaches what I would call pure computer science (by that I mean concepts, thought processes, theory and techniques rather than any particular technologies or programming in a specific language) I was staggered to find, at the end of my degree, that out of my hundred or so fellow students I was one of the only ones going into the web development industry as a career. There were some who had an interest but it was always considered a secondary skill which would be a bonus feature on their CV rather than their main selling point. Web development, particularly with scripting languages (including PHP, Ruby and Python), is not considered to be a &#8216;proper&#8217; profession for someone with that level of qualification. Java is the exception to the rule as it seems to be the language of choice for many universities to teach the principles of programming and is therefore accepted by its students as an appropriate tool on which to base their career path.</p>
<p>There are quite a few universities that teach the more practical aspects of computer science and some even specifically web development but our experience is that many of their graduates have learnt either .Net or Java but nothing else. The former often do not seem to even be aware of programming tools outside of the safe and cosy Microsoft ecosystem. I am not criticising these universities or the languages that they teach but I do feel that other languages and tools are under-represented in academia.</p>
<p>In response to Leonid&#8217;s criticisms of PHP I do agree that one of its problems is its ease of use and the fact that it is newbie safe. There is no doubt that this does attract a lot of beginners to the community. However with the right training and experience there is no reason why these beginners can&#8217;t become great programmers, even if they do stick to PHP.</p>
<p>I also think it is unfair to say that it is an &#8216;ugly language&#8217; although it most certainly can be if not used well. It certainly can&#8217;t be criticised for not being &#8216;convenient&#8217; especially when used with PEAR or a good framework. In my opinion Java is more of an ugly language to read and certainly some of it&#8217;s libraries have been forced into its &#8216;everything is an object&#8217; approach even where it is not appropriate. I admit that PHP is somewhat inconsistent in its function naming and the combination of native functions, procedural code and objects in its documentation but this is becoming easier to ignore with projects such as PEAR and the Zend Framework. PHP is a rapidly maturing language which in the last few years has become a very realistic candidate for developing large scale applications. Yes, it has its weaknesses and can be used to write horrible code but any language can, if put in the wrong hands. The problem here is not PHP itself but the type of people who claim to be good at it.</p>
<p>I think as a community there needs to be more work done to raise the profile of PHP, and web scripting in general, within academia. There are a lot of misconceptions about web scripting and its applicability to large projects and computer science theory. The industry is very young and its power only just being demonstrated. In order to keep moving forward we need more benchmarks and qualifications for developers so we can really separate the excellent and the good from the truly awful. Less time spent searching for the people our projects need is more time creating new and innovative applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/web/in-response-to-where-did-all-the-php-developers-go/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Day 47 - Berlin</title>
		<link>http://www.oneangrydwarf.co.uk/travel/day-47-berlin/</link>
		<comments>http://www.oneangrydwarf.co.uk/travel/day-47-berlin/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 17:46:04 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/travel/day-47-berlin/</guid>
		<description><![CDATA[We checked out of our hotel after breakfast and went to drop our bags at the station until our night train. We headed back into the centre determined to see some more of this lovely city and learn some more of its history.
First we headed for &#8216;Checkpoint Charlie&#8217; which was one of the most important [...]]]></description>
			<content:encoded><![CDATA[<p>We checked out of our hotel after breakfast and went to drop our bags at the station until our night train. We headed back into the centre determined to see some more of this lovely city and learn some more of its history.</p>
<p>First we headed for &#8216;Checkpoint Charlie&#8217; which was one of the most important crossing points between East and West Berlin and was nicknamed such by the Americans (&#8217;Charlie&#8217; is from the NATO phonetic alphabet as this was the 3rd major checkpoint). We didn&#8217;t go into the museum as it was very overpriced but there was ample information for free on the billboards along the pavement.</p>
<p>The wall was built around West Berlin which was controlled by the Allied troops (US, UK and France). The East of Berlin and the rest of Eastern Germany were controlled by the Soviets. These two &#8217;sides&#8217; represented the victorious parties of WWII and left West Berlin and a kind of island in East Germany with limited passage to the West.</p>
<p>The Soviets favoured communism whilst the Allies wanted to promote democracy. Hence Germany and Berlin were literally split in two. The wall divided streets, neighbourhoods, friends and families. The Soviets made several attempts to force the Allies to give up West Berlin by erecting the wall and militarising it with guardtowers and the so-called death strip.</p>
<p>Over 100 people died trying to cross from the poor and communist East to the West side of the city employing various elaborate methods to trick the Soviet guards. If they were caught they would be arrested or shot. Guards would get pay bonuses for killing escaping civilians. The wall came down in 1989 as the Cold War came to an end and Berlin was then reunited.</p>
<p>The longest remaining stretch of the wall lies outside the &#8216;Topography of Terror&#8217;. This site is supposed to be a museum to commemorate the headquarters of the SS and Gestapo. The museum however is a temporary open-air exhibition due to an epic 15-year political and financial cock-up worthy of a UK government project. The fact that the museum is &#8216;temporary&#8217; detracts from its effectiveness in demonstrating what the building, detroyed after the war, would have been like. It was interesting but not as good as the similar museum in Budapest.</p>
<p>Dinner was in an Australian Bar in Potsdamerplatz and later we headed for the station to catch our overnight train to Brussels.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/travel/day-47-berlin/feed/</wfw:commentRss>
		<georss:point featurename="Berlin, Germany">52.52348 13.411494</georss:point>
	</item>
		<item>
		<title>Day 46 - Berlin</title>
		<link>http://www.oneangrydwarf.co.uk/travel/day-46-berlin/</link>
		<comments>http://www.oneangrydwarf.co.uk/travel/day-46-berlin/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 17:35:00 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/travel/day-46-berlin/</guid>
		<description><![CDATA[Well today I was ill and we really didn&#8217;t do a lot. It seems that not only did the curry not taste that good but that it was a health risk too. Needless to say we couldn&#8217;t venture far from the toilet except to go to the chemists for much needed medicine. Luckily Emma was [...]]]></description>
			<content:encoded><![CDATA[<p>Well today I was ill and we really didn&#8217;t do a lot. It seems that not only did the curry not taste that good but that it was a health risk too. Needless to say we couldn&#8217;t venture far from the toilet except to go to the chemists for much needed medicine. Luckily Emma was alright.</p>
<p>We tried to venture out for food in the late afternoon but had to return back to the hotel soon after. By the evening all I could really manage was to go to the cinema again. This time it was &#8216;Evan Almighty&#8217; which was truly awful.</p>
<p>We were supposed to be going to Potsdam today but will have to do that another time. Not a great day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/travel/day-46-berlin/feed/</wfw:commentRss>
		<georss:point featurename="Berlin, Germany">52.52348 13.411494</georss:point>
	</item>
		<item>
		<title>Day 45 - Berlin</title>
		<link>http://www.oneangrydwarf.co.uk/travel/day-45-berlin/</link>
		<comments>http://www.oneangrydwarf.co.uk/travel/day-45-berlin/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 17:12:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/travel/day-45-berlin/</guid>
		<description><![CDATA[The train journey to Berlin was a long one but in a German train so wasn&#8217;t too bad. We arrived at Berlin Hauptbahnhof which is the brand new central station completed this year. The station is huge and acts as a transport hub for a city that was previously split in two. Fittingly the site [...]]]></description>
			<content:encoded><![CDATA[<p>The train journey to Berlin was a long one but in a German train so wasn&#8217;t too bad. We arrived at Berlin Hauptbahnhof which is the brand new central station completed this year. The station is huge and acts as a transport hub for a city that was previously split in two. Fittingly the site is right were the Wall was.</p>
<p>Berlin is a lovely city, very clean and green too. An easy walk to our hotel made our introduction to the city a nice one.</p>
<p>We headed out for lunch and found an Indian restaurant. It was alright but not a patch on an English curry.</p>
<p>After this we walked past the Jewish memorial site and then to the Reichstag (government building) and the Brandenburg Gate. The whole area is spotlessly clean and beautifully designed. There are huge modern buildings seamlessly integrated into the historic surroundings. The wide open spaces and greenery make the whole area very nice to wander around.</p>
<p>Next we headed to Potsdamerplatz which is one of the cities busiest squares and was of significance in both WW2 and then the Cold War. There is a memorial segment of the wall with informative posters. The square is surrounded by huge high-rise modern architecture and the huge &#8216;Sony Centre&#8217; which is not just a shop but a giant entertainment complex with restaurants, shops and an IMAX cinema. The whole area is one of the nicest inner city areas I have ever been too and is so well kept.</p>
<p>We went to the cinema in the evening to see &#8216;Reign Over Me&#8217;. Well worth seeing, especially in such a nice cinema.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/travel/day-45-berlin/feed/</wfw:commentRss>
		<georss:point featurename="Berlin, Germany">52.52348 13.411494</georss:point>
	</item>
		<item>
		<title>Day 44 - Prague</title>
		<link>http://www.oneangrydwarf.co.uk/travel/day-44-prague/</link>
		<comments>http://www.oneangrydwarf.co.uk/travel/day-44-prague/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 17:22:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.oneangrydwarf.co.uk/travel/day-44-prague/</guid>
		<description><![CDATA[Breakfast today was at the café again and very nice. The weather was little dodgy but we got a pedalo out nonetheless and the rain held off for then. It was nice to see the city from a different perspective without the crowds.
Much of the rest of the day was spent sampling some more of [...]]]></description>
			<content:encoded><![CDATA[<p>Breakfast today was at the café again and very nice. The weather was little dodgy but we got a pedalo out nonetheless and the rain held off for then. It was nice to see the city from a different perspective without the crowds.</p>
<p>Much of the rest of the day was spent sampling some more of Prague&#8217;s beer in a variety of pubs and bars. Lunch was our main meal today and I had goulash with dumplings (a traditional Czech dish). With 2 beers, 2 cocktails and our meals the whole bill came to under 10 pounds - good value. The trick in Prague is to not eat in the main tourist areas and venture just a few streets away - the prices drop considerably (a 0.5L Pilsner in the main square bar is about 1.50GBP whereas we paid about 60p).</p>
<p>We walked around in the evening and had an ice cream. Quite a lazy day really but it is so easy to do that in Prague and not break the bank.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneangrydwarf.co.uk/travel/day-44-prague/feed/</wfw:commentRss>
		<georss:point featurename="Prague, Czech Republic">50.087811 14.42046</georss:point>
	</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.555 seconds -->
