<?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>domi.co.uk - technology, music, photography, news</title>
	<atom:link href="http://domi.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://domi.co.uk</link>
	<description></description>
	<lastBuildDate>Sun, 18 Oct 2009 20:19:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iMovie &#8216;09 &#8211; tsk</title>
		<link>http://domi.co.uk/2009/10/18/imovie-09-tsk/</link>
		<comments>http://domi.co.uk/2009/10/18/imovie-09-tsk/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 20:19:06 +0000</pubDate>
		<dc:creator>dja</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=392</guid>
		<description><![CDATA[Spot the deliberate mistake:


]]></description>
			<content:encoded><![CDATA[<p>Spot the deliberate mistake:</p>

<p><img src="http://domi.co.uk/wp-content/uploads/2009/10/Picture-60.png" alt="Picture 60.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/10/18/imovie-09-tsk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just keep your eyes peeled!</title>
		<link>http://domi.co.uk/2009/09/22/just-keep-your-eyes-peeled/</link>
		<comments>http://domi.co.uk/2009/09/22/just-keep-your-eyes-peeled/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 14:40:59 +0000</pubDate>
		<dc:creator>dja</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[pix]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=389</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img src="http://domi.co.uk/wp-content/uploads/2009/09/just-keep-your-eyes-peeled-tweened.gif" alt="just-keep-your-eyes-peeled-tweened.gif" border="0" width="420" height="280" /></p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/09/22/just-keep-your-eyes-peeled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 CSS &#8211; let them eat cake?</title>
		<link>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/</link>
		<comments>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/#comments</comments>
		<pubDate>Fri, 22 May 2009 18:08:31 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=386</guid>
		<description><![CDATA[An interesting idea is presented on &#8220;for a beautiful web&#8221; regarding how best to deal with IE6 and its many failings. Universal Internet Explorer 6 CSS proposes that IE6 always gets sent a standard look and feel, so that the experience for its users is not bad &#8211; just not the full shebang. It&#8217;s clear [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting idea is presented on &#8220;for a beautiful web&#8221; regarding how best to deal with IE6 and its many failings. <a href="http://forabeautifulweb.com/blog/about/universal_internet_explorer_6_css/">Universal Internet Explorer 6 CSS</a> proposes that IE6 always gets sent a standard look and feel, so that the experience for its users is not bad &#8211; just not the full shebang. It&#8217;s clear it has been designed, rather than sending plain CSS-less HTML, but it&#8217;s very sparse.</p>

<p>Personally, I like the idea. I have done something similar on more than one occasion. I haven&#8217;t taken it to the same level, possibly, but I&#8217;ve treated IE6 in a similar way to how I treat screen readers for example: make sure all the content is available, and is usable. What follows are a couple of screen shots of redamc.com, first from Safari 4, then from IE6. (The Safari 4 shot is representative of all modern browsers, though.) The design basically revolves around having all the content on one page, in nicely scrollable boxes. In IE6, this was not well supported, and the decision was taken to make the layout more &#8220;blog-like&#8221;. All the content is the same, however.</p>

<p>First, Safari 4:</p>

<p><a href="http://domi.co.uk/wp-content/uploads/2009/05/safari4screenshot.jpg"><img src="http://domi.co.uk/wp-content/uploads/2009/05/safari4screenshot.jpg" alt="safari4screenshot.jpg"/></a></p>

<p>And IE6:</p>

<p><a href="http://domi.co.uk/wp-content/uploads/2009/05/ie6screenshot.jpg"><img src="http://domi.co.uk/wp-content/uploads/2009/05/ie6screenshot.jpg" alt="ie6screenshot.jpg"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/05/22/ie6-css-let-them-eat-cake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Development Standards: HTML</title>
		<link>http://domi.co.uk/2009/04/15/development-standards-html/</link>
		<comments>http://domi.co.uk/2009/04/15/development-standards-html/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:59:50 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=354</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://domi.co.uk/wp-pass.php" method="post">
    <p>This post is password protected. To view it please enter your password below:</p>
    <p><label for="pwbox-354">Password: <input name="post_password" id="pwbox-354" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
    </form>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/15/development-standards-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK 3.0 beta 3</title>
		<link>http://domi.co.uk/2009/04/15/iphone-sdk-30-beta-3/</link>
		<comments>http://domi.co.uk/2009/04/15/iphone-sdk-30-beta-3/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:28:20 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=350</guid>
		<description><![CDATA[Beta 3 is out and the new OS fixes the non-working Youtube from the previous beta.

[Update: and also breaks syncing, which now hangs on "Syncing contacts..."]

[Update2: Seems like the contacts syncing hang was a temporary issue...]
]]></description>
			<content:encoded><![CDATA[<p>Beta 3 is out and the new OS fixes the non-working Youtube from the previous beta.</p>

<p>[Update: and also breaks syncing, which now hangs on "Syncing contacts..."]</p>

<p>[Update2: Seems like the contacts syncing hang was a temporary issue...]</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/15/iphone-sdk-30-beta-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Standards: PHP</title>
		<link>http://domi.co.uk/2009/04/15/development-standards-php/</link>
		<comments>http://domi.co.uk/2009/04/15/development-standards-php/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 23:23:41 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=327</guid>
		<description><![CDATA[We might as well start this series off at the bottom and work our way up. So, let&#8217;s start with PHP &#8211; it&#8217;s not the base of our stack, but it&#8217;s the first element that heavily requires some coding standards in place.

As I said in the intro, this series will be about how I do [...]]]></description>
			<content:encoded><![CDATA[<p>We might as well start this series off at the bottom and work our way up. So, let&#8217;s start with PHP &#8211; it&#8217;s not the base of our stack, but it&#8217;s the first element that heavily requires some coding standards in place.</p>

<p>As I said in the intro, this series will be about how <em>I</em> do things, although of course it&#8217;s all heavily based on what I&#8217;ve seen and used elsewhere, and what I&#8217;ve known to work. Given this, I&#8217;ll also talk about the toolkits and frameworks I use: Code Igniter on the server side and jQuery on the client side. I also use YUI Reset and Fonts at the top of most or all CSS.</p>

<p>Although it&#8217;s just as important I won&#8217;t talk about sticking to some semblance of good MVC practice when using Code Igniter. There&#8217;s plenty of that out there.</p>

<h3>Why have development standards?</h3>

<p>Possibly the main reason is that one person working on the code can understand what another has done. If I look at anyone else&#8217;s code and it&#8217;s formatted in a way that obfuscates its meaning, I&#8217;m possibly going to miss something key.</p>

<p>Looking forward, if something isn&#8217;t correctly formatted, fixing a bug is going to be that much easier if it&#8217;s easily readable. This applies whether it was written by a different person or not.</p>

<h3>PHP tags</h3>

<p>In view files, the short opening tag <code>&lt;?</code> as opposed to <code>&lt;?php</code> is encouraged, as is its logical next step <code>&lt;?=$var?&gt;</code>. Reducing clutter in view files, where front-end developers or even designers may work, is worthwhile.</p>

<h3>Indentation</h3>

<p>All code &#8211; HTML, CSS, Javascript, PHP &#8211; should be indented correctly. All indents should be 1 single tab. I prefer to view that in my editor &#8211; whether it&#8217;s TextMate or Vim &#8211; as four columns. How you view it in your editor is a personal preference, as long as the file itself uses 1 tab.</p>

<h3>Line endings</h3>

<p>All line endings should be a single <code>\n</code> &#8211; i.e. Unix-style. In addition, add no trailing spaces to lines, and remove any that sneak in due to slack editing.</p>

<h3>Control Structures</h3>

<p>Including <code>if</code>, <code>for</code>, <code>while</code>, <code>switch</code>, etc:</p>

<p><strong>INCORRECT</strong> <em>in various ways</em></p>

<pre><code>if(condition1){
    //action1
}
elseif(condition2){
    //action2
}else{
    //action3
}
</code></pre>

<p><strong>CORRECT</strong></p>

<pre><code>if (condition1) {
    //action1
} elseif (condition2) {
    //action2
} else {
    //action3
}
</code></pre>

<h4>Another example:</h4>

<pre><code>for ($i = 0; $i &lt; 10; $i++) {
    ...
}
</code></pre>

<p>Control statements should have <em>one space</em> between the control keyword and opening parenthesis, to distinguish them from function calls.</p>

<p>You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added.</p>

<h4>A switch block:</h4>

<pre><code>switch (condition) {
    case 'one':
    action1;
    break;

    case 'two':
    action2;
    break;

    default:
    action3;
    break;
}
</code></pre>

<h3>Function Calls</h3>

<p>Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon. Here&#8217;s an example:</p>

<p><strong>INCORRECT</strong></p>

<pre><code>$var=foo($bar,$baz,$quux);
</code></pre>

<p><strong>CORRECT</strong></p>

<pre><code>$var = foo($bar, $baz, $quux);
</code></pre>

<p>As displayed above, there should be <em>one space</em> on either side of an equals sign used to assign the return value of a function to a variable.</p>

<h3>Function Declarations</h3>

<p>We usually try to put the arguments with default values at the end of the list:</p>

<pre><code>function fooBar($var1, $var2 = '') {
    if (condition) {
        statement;
    }
    return $value;
}
</code></pre>

<h3>Arrays</h3>

<p>Always use spaces:</p>

<pre><code>$array = array('val1', 'val2', 'val3');
</code></pre>

<p>If the array is even remotely large, break it into separate lines:</p>

<pre><code>$array = array(
    'key1' =&gt; 123,
    'key2' =&gt; 'foo',
    'key3' =&gt; getValue('bar'),
);
</code></pre>

<p>Notice the extra comma after the last element &#8211; this means we can rearrange the elements or add a new element with worrying about commas between elements. (This only works with PHP.)</p>

<h3>Comments</h3>

<p>Single line comments go like this:</p>

<pre><code>// Check the value of foo.
$bar = isset($foo) ? $foo : '';
</code></pre>

<p>Multi-line, &#8220;C-style&#8221; comments:</p>

<pre><code>/*
Check the value of foo.
This is to prevent errors.
*/
$bar = isset($foo) ? $foo : '';
</code></pre>

<p>Notice that the comment characters are on their own lines.</p>

<h3>Includes</h3>

<p>For unconditional inclusion, use <code>require_once 'includefile.php';</code></p>

<p>For conditional inclusion, use <code>include_once 'includefile.php';</code></p>

<p><em>Note: <code>require_once</code> and <code>include_once</code> are statements (or language constructs) <strong>not</strong> functions, so no parenthesis is required, or desired.</em></p>

<h3>Metadata</h3>

<p>Every applicable file should use an Id keyword:</p>

<pre><code>&lt;?php
// $Id$
</code></pre>

<p>which gets expanded by Subversion to</p>

<pre><code>&lt;?php
// $Id: codingstandards 758 2008-05-15 01:35:58Z dom $
</code></pre>

<h3>Naming conventions</h3>

<h4>Functions and Methods</h4>

<p>All names should start lowercase and use <a href="http://en.wikipedia.org/wiki/CamelCase">interCaps/camelCase</a></p>

<pre><code>function getFooBar() {
    ...
}
</code></pre>

<p>No underscores in the middle of function names, please:</p>

<p><strong>INCORRECT</strong></p>

<pre><code>function get_foo_bar() {
    ...
}
</code></pre>

<p>Private methods should start with an underscore:</p>

<pre><code>function _getFooBar() {
    ...
}
</code></pre>

<h4>Classes</h4>

<p>Classes follow the same method as methods ;) except start with uppercase.</p>

<pre><code>class FooBar {
    function FooBar() {
        ...
    }
}
</code></pre>

<h4>Constants</h4>

<p>Constants should be all UPPERCASE, except internally-provided ones like <code>true</code>, <code>false</code>, <code>null</code>;</p>

<h3>File Format</h3>

<p><strong>All</strong> files should be unix format &#8211; I <em>do not</em> want to see any \r\n&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/15/development-standards-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Standards: Intro</title>
		<link>http://domi.co.uk/2009/04/14/development-standards-intro/</link>
		<comments>http://domi.co.uk/2009/04/14/development-standards-intro/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 22:18:33 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=325</guid>
		<description><![CDATA[I&#8217;ve decided to write an occasional series of articles on coding and development standards. It will be how I see them &#8211; the standards I myself follow &#8211; so it might not be for everyone. What it will be is a guide to what to expect if I&#8217;m working for you, and what to expect [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to write an occasional series of articles on coding and development standards. It will be how <em>I</em> see them &#8211; the standards <em>I</em> myself follow &#8211; so it might not be for everyone. What it will be is a guide to what to expect if I&#8217;m working for you, and what to expect if you&#8217;re working for me.</p>

<p>I&#8217;ll write separate pieces for CSS, HTML, PHP and possibly for server administration-type stuff too &#8211; Apache configuration, and so on.</p>

<p>Expect the first instalment in the near future&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/04/14/development-standards-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook hard drive upgrade</title>
		<link>http://domi.co.uk/2009/03/16/macbook-hard-drive-upgrade/</link>
		<comments>http://domi.co.uk/2009/03/16/macbook-hard-drive-upgrade/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 22:47:40 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=317</guid>
		<description><![CDATA[I just got a new drive for my MacBook (MacBook2,1 &#8211; black) and am quite pleased with the simplicity of the process. First up, I didn&#8217;t need to add a jumper to throttle the SATA II drive down to SATA I speed. I put it in, it was recognised OK. The drive is a Seagate [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a new drive for my MacBook (MacBook2,1 &#8211; black) and am quite pleased with the simplicity of the process. First up, I didn&#8217;t need to add a jumper to throttle the SATA II drive down to SATA I speed. I put it in, it was recognised OK. The drive is a Seagate ST9320421ASG.</p>

<p>Secondly, the restore from Time Machine was pretty damn simple and effective. It&#8217;s always the same question with backups &#8211; if you don&#8217;t test them, do you know they&#8217;ll work? I&#8217;ve grabbed individual files from Time Machine and that seemed fine, but I had no way of knowing, without having a new drive with which to test, if a system restore would work. It did. Just boot with the DVD (or a copy of it on an external drive, if your DVD drive doesn&#8217;t work, like mine) and choose to restore from Time Machine. Just pick which backup to use, pick where to restore it to and wait. I suppose it took about an hour.</p>

<p>Once that&#8217;s done, reboot with the new system.</p>

<p>The only things I noticed awry were that my hosts file wasn&#8217;t there and that my Downloads directory wasn&#8217;t either! Seems a bit odd&#8230; Anyway, copy old hosts file to new location, copy old Downloads directory to home dir and sorted. I need to look into the missing directory issue, but all in all, not too bad an experience.</p>

<p>[Update: small, possibly even unrelated error: the firewall seemed to have Ruby blocked for some reason, even though it was listed as allowed - just switched it to block, then back to allowed and it worked.]</p>

<p>[Update2: the Downloads directory wasn't there because I, er, set it to be excluded... ahem. I'd forgotten about that.]</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/03/16/macbook-hard-drive-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screencast as development tool</title>
		<link>http://domi.co.uk/2009/02/26/screencast-as-development-tool/</link>
		<comments>http://domi.co.uk/2009/02/26/screencast-as-development-tool/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 16:39:18 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=315</guid>
		<description><![CDATA[I&#8217;m in the middle of the first phase of building a new webapp and like most web developers (I would bet) when I show someone what I&#8217;ve done, it&#8217;s not apparent what marvels of engineering I&#8217;ve pulled off! So, in order to actually give a quick run-down of where we&#8217;re at with the application, I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the middle of the first phase of building a new webapp and like most web developers (I would bet) when I show someone what I&#8217;ve done, it&#8217;s not apparent what marvels of engineering I&#8217;ve pulled off! So, in order to actually give a quick run-down of where we&#8217;re at with the application, I thought about making a screencast of the login, profile creation, module, video upl&#8211; well, I&#8217;ve said too much already ;)</p>

<p>After thinking about that for a bit, I wondered if any methodologies, agile or otherwise, use screencasts specifically as a tool. I could <a href="http://www.justfuckinggoogleit.com/">just Google it</a>, I know. In any case I think it&#8217;s a nice way of showing progress on the development &#8211; or bugs in the app.</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/02/26/screencast-as-development-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webshop launched</title>
		<link>http://domi.co.uk/2009/01/22/webshop-launched/</link>
		<comments>http://domi.co.uk/2009/01/22/webshop-launched/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 21:10:37 +0000</pubDate>
		<dc:creator>dom</dc:creator>
				<category><![CDATA[interweb]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[sport]]></category>
		<category><![CDATA[web biz]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://domi.co.uk/?p=291</guid>
		<description><![CDATA[As the first example of my Tienda.co.uk project, we&#8217;ve just launched slant1996.com which sells slightly mad t-shirt designs!
]]></description>
			<content:encoded><![CDATA[<p>As the first example of my <a href="http://tienda.co.uk/">Tienda.co.uk</a> project, we&#8217;ve just launched <a href="http://www.slant1996.com">slant1996.com</a> which sells slightly mad t-shirt designs!</p>
]]></content:encoded>
			<wfw:commentRss>http://domi.co.uk/2009/01/22/webshop-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
