<?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>Optimus Pete &#187; Tech</title>
	<atom:link href="http://tech.petegraham.co.uk/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.petegraham.co.uk</link>
	<description>yes i love technology</description>
	<lastBuildDate>Wed, 25 Aug 2010 10:06:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Away with Applications: The Death of Desktop</title>
		<link>http://tech.petegraham.co.uk/2007/05/15/away-with-applications-the-death-of-desktop/</link>
		<comments>http://tech.petegraham.co.uk/2007/05/15/away-with-applications-the-death-of-desktop/#comments</comments>
		<pubDate>Tue, 15 May 2007 15:09:39 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/05/15/away-with-applications-the-death-of-desktop/</guid>
		<description><![CDATA[There is a great talk that went up on Google Videos earlier this month called Away with Applications: The Death of Deskop. In it the speaker, Aza Raskin points out that no work is carried out actually using the computers desktop. He also points out the failing of desktop applications, that you frequently need to [...]]]></description>
			<content:encoded><![CDATA[<p>There is a great talk that went up on Google Videos earlier this month called <a target="_blank" href="http://video.google.com/videoplay?docid=-6856727143023456694">Away with Applications: The Death of Deskop</a>. In it the speaker, Aza Raskin points out that no work is carried out actually using the computers desktop. He also points out the failing of desktop applications, that you frequently need to switch between applications, moving content, to achieve even relatively simple tasks.</p>
<p>I think his points are particularly relevant as we move into an age where many traditional desktop apps are being converted to web applications. I see an increasing trend in web applications of people trying to recreate desktop applications like interfaces in a browser-based setting. Aza urges us to rethink what we know about computer interfaces and to come up with exciting and innovative alternatives.</p>
<p>Traditional applications have had more and more functionality added to them to an extent that they have become <em>“a portmanteau of all possible features”</em>, again it is worrying that many of today’s successful web apps could suffer the same fate. The speaker encourages open APIs and Mash-ups as an alternative and a may to combine applications without having to switch between multiple programs/services.</p>
<p>One of the most interesting parts of the talk for me is when the speaker demos some systems that he&#8217;s been developing himself, one is a command-line interface for launching applications that uses almost real language commands and auto-complete. The other is an interesting zoomable desktop, which is much more work orientated than the traditional model, it also centres around the concept of <em>“content as content”</em>.</p>
<p>At nearly an hour and a half the video is quite long but I found it extremely interesting, the speaker also looks a bit like Rick Moranis of <em>“Honey I shrunk the kids”</em> fame, which has got to be a good thing.</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/05/15/away-with-applications-the-death-of-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It’s internet with a small ‘i’ now</title>
		<link>http://tech.petegraham.co.uk/2007/04/30/it%e2%80%99s-internet-with-a-small-%e2%80%98i%e2%80%99-now/</link>
		<comments>http://tech.petegraham.co.uk/2007/04/30/it%e2%80%99s-internet-with-a-small-%e2%80%98i%e2%80%99-now/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 10:50:23 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/04/30/it%e2%80%99s-internet-with-a-small-%e2%80%98i%e2%80%99-now/</guid>
		<description><![CDATA[When I was doing my Computer Science degree our lectures used to make a big deal about making sure you spell Internet with a capital ‘I’, because it’s important and it’s the name of a thing. Apparently it’s now been decided that it should be spelt with a lowercase ‘i’, I wish bloody linguists would [...]]]></description>
			<content:encoded><![CDATA[<p>When I was doing my Computer Science degree our lectures used to make a big deal about making sure you spell Internet with a capital ‘I’, because it’s important and it’s the name of a thing. Apparently it’s now been decided that it should be spelt with a lowercase ‘i’, I wish bloody linguists would make their minds up!</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/04/30/it%e2%80%99s-internet-with-a-small-%e2%80%98i%e2%80%99-now/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP: Swap Variables One Liner</title>
		<link>http://tech.petegraham.co.uk/2007/03/29/php-swap-variables-one-liner/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/29/php-swap-variables-one-liner/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 16:26:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/29/php-swap-variables-one-liner/</guid>
		<description><![CDATA[Here's a nifty one liner in PHP which let's you swap 2 variables values.
PLAIN TEXT
PHP:




list&#40;$a,$b&#41; = array&#40;$b,$a&#41;; 






Much like the PHP XOR swap there's no real reason this is any better than using a temporary variable, but you might be able to impress chicks with it or something.
/* Pete Graham */
]]></description>
			<content:encoded><![CDATA[<p>Here's a nifty one liner in PHP which let's you swap 2 variables values.</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/list"><span style="color:#000066;">list</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$a</span>,<span style="color:#0000FF;">$b</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$b</span>,<span style="color:#0000FF;">$a</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Much like the <a href="http://tech.petegraham.co.uk/2007/03/26/php-xor-swap/">PHP XOR swap</a> there's no real reason this is any better than using a temporary variable, but you might be able to impress chicks with it or something.</p>
<p>/* Pete Graham */</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/29/php-swap-variables-one-liner/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Drupal: Hide Navigation on Forum</title>
		<link>http://tech.petegraham.co.uk/2007/03/29/drupal-hide-navigation-on-forum/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/29/drupal-hide-navigation-on-forum/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 16:15:23 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/29/drupal-hide-navigation-on-forum/</guid>
		<description><![CDATA[If you want to hide certain Navigational Blocks on your Drupal sites forum(s) here’s how to do it:
1. Go to "Administer » Blocks"
2. Click "configure" on the block you want to hide.
3. On Page specific Visibility Settings click the option for "Show if the following PHP code returns TRUE"
4. Enter the following code in the [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to hide certain Navigational Blocks on your Drupal sites forum(s) here’s how to do it:</p>
<p>1. Go to "Administer » Blocks"<br />
2. Click "configure" on the block you want to hide.<br />
3. On Page specific Visibility Settings click the option for "Show if the following PHP code returns TRUE"<br />
4. Enter the following code in the text area:</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>arg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#FF0000;">'node'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$node</span> = node_load<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'nid'</span> =&gt; arg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#0000FF;">$node</span>-&gt;<span style="color:#006600;">type</span> != <span style="color:#FF0000;">'forum'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">elseif</span> <span style="color:#006600; font-weight:bold;">&#40;</span>arg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#FF0000;">'forum'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This will hide the navigation on the forum hompage, when viewing lists of topics and when viewing individual posts (nodes).</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/29/drupal-hide-navigation-on-forum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JS: Unobtrusive Select All Checkboxes</title>
		<link>http://tech.petegraham.co.uk/2007/03/26/js-unobtrusive-select-all-checkboxes/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/26/js-unobtrusive-select-all-checkboxes/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 10:03:47 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[unobtrusive]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/26/js-unobtrusive-select-all-checkboxes/</guid>
		<description><![CDATA[I wrote last week about how I’m trying to improve my JavaScript skills. As a small exercise I have written this function for unobtrusively selecting/deselecting checkboxes in a form.
PLAIN TEXT
JAVASCRIPT:




function selectAll&#40;box&#41;


&#123;


// get the elements name


var id = box.id;


var name = /^&#40;&#91;a-z&#93;+&#41;&#40;_select_all&#41;$/i.exec&#40;id&#41;;


&#160;


name = name&#91;1&#93;;


&#160;


re = new RegExp&#40;'^'+name+'_[0-9]+$'&#41;;


&#160;


// get the elements stauts


var state = box.checked;


&#160;


// get the [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote last week about how I’m <a href="http://tech.petegraham.co.uk/2007/03/20/my-volatile-relationship-with-javascript/">trying to improve my JavaScript</a> skills. As a small exercise I have written this function for unobtrusively selecting/deselecting checkboxes in a form.</p>
<div class="igBar"><span id="ljavascript-7"><a href="#" onclick="javascript:showPlainTxt('javascript-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-7">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> selectAll<span style="color: #66cc66;">&#40;</span>box<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// get the elements name</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> id = box.<span style="color: #006600;">id</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> = <span style="color: #0066FF;">/^<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>a-z<span style="color: #66cc66;">&#93;</span>+<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>_select_all<span style="color: #66cc66;">&#41;</span>$/i</span>.<span style="color: #006600;">exec</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">name</span> = <span style="color: #000066;">name</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">re = <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'^'</span>+<span style="color: #000066;">name</span>+<span style="color: #3366CC;">'_[0-9]+$'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// get the elements stauts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> state = box.<span style="color: #006600;">checked</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// get the form element, search &quot;up&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> form = box.<span style="color: #006600;">parentNode</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span>form.<span style="color: #006600;">nodeName</span>.<span style="color: #006600;">toLowerCase</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #3366CC;">"form"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>!form.<span style="color: #006600;">parentNode</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">break</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">form = form.<span style="color: #006600;">parentNode</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// search through forms children for email_ checkboxes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>i=<span style="color: #CC0000;color:#800000;">0</span>;i&lt;form.<span style="color: #006600;">elements</span>.<span style="color: #006600;">length</span>;i++<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>form.<span style="color: #006600;">elements</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">type</span>==<span style="color: #3366CC;">'checkbox'</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Find checkbox for each member of the group:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>re.<span style="color: #006600;">test</span><span style="color: #66cc66;">&#40;</span>form.<span style="color: #006600;">elements</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #000066;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">form.<span style="color: #006600;">elements</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">checked</span> = state;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// onload stuff</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #000066;">onload</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> email = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'email_select_all'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">email.<span style="color: #006600;">onclick</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> selectAll<span style="color: #66cc66;">&#40;</span>email<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The Javascript will work on a HTML form like this</p>
<div class="igBar"><span id="lhtml-8"><a href="#" onclick="javascript:showPlainTxt('html-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-8">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form</span></a> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">"post"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Select all check box --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"email_select_all"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"checkbox"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- list of check boxes --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"checkbox"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"email_1"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"1"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"checkbox"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"email_2"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"1"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"checkbox"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"email_3"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"1"</span>  /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"checkbox"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"email_4"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"1"</span>  /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Send Message"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As long at the select all checkbox has an id of "something_select_all" and the checkboxes have id's of "something_"followed by a number then this will work. No inline Javascript is required all the JS can be put in a separate file.</p>
<p>Note: If any Javascript Gurus are reading that have pointers about how I could improve this function then please put your suggestions in the comments.</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/26/js-unobtrusive-select-all-checkboxes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL: Selecting Specifying Multiple Field Values</title>
		<link>http://tech.petegraham.co.uk/2007/03/22/sql-selecting-specifying-multiple-field-values/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/22/sql-selecting-specifying-multiple-field-values/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 18:05:06 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/22/sql-selecting-specifying-multiple-field-values/</guid>
		<description><![CDATA[Here are 3 different ways to perform a DB select when you want to specify two or more values for a field.
1. Use th OR operator
PLAIN TEXT
SQL:




SELECT * FROM people


WHERE &#40;first_name = 'pete'


OR first_name = 'paul'&#41;; 






2. Use a Regular Expression
PLAIN TEXT
SQL:




SELECT * FROM people


WHERE first_name ~'^pete&#124;paul$'; 






3. Use an array
PLAIN TEXT
SQL:




SELECT * FROM people


WHERE [...]]]></description>
			<content:encoded><![CDATA[<p>Here are 3 different ways to perform a DB select when you want to specify two or more values for a field.</p>
<p>1. Use th OR operator</p>
<div class="igBar"><span id="lsql-12"><a href="#" onclick="javascript:showPlainTxt('sql-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-12">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> people</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color:#006600; font-weight:bold;">&#40;</span>first_name = <span style="color: #ff0000;">'pete'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">OR</span> first_name = <span style="color: #ff0000;">'paul'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
2. Use a Regular Expression</p>
<div class="igBar"><span id="lsql-13"><a href="#" onclick="javascript:showPlainTxt('sql-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-13">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> people</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> first_name ~<span style="color: #ff0000;">'^pete|paul$'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
3. Use an array</p>
<div class="igBar"><span id="lsql-14"><a href="#" onclick="javascript:showPlainTxt('sql-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-14">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> people</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> first_name = ANY<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">'{pete,paul}'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Note: These should all work in PostgreSQL, I suspect the SQL may need altering for 2 and 3 to work with MySQL.</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/22/sql-selecting-specifying-multiple-field-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Remove Values from Array</title>
		<link>http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 10:30:17 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/</guid>
		<description><![CDATA[If you need to remove elements from an array that have a particular value(s) here’s a neat way of doing it without any looping:
PLAIN TEXT
PHP:




// our initial array


$arr = Array&#40;"blue", "green", "red", "yellow", "green", "orange", "yellow", "indigo", "red"&#41;;


print_r&#40;$arr&#41;;


&#160;


// remove the elements who's values are yellow or red


$arr = array_diff&#40;$arr, array&#40;"yellow", "red"&#41;&#41;;


print_r&#40;$arr&#41;;


&#160;


// optionally you could reindex [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to remove elements from an array that have a particular value(s) here’s a neat way of doing it without any looping:</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// our initial array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$arr</span> = <a href="http://www.php.net/array"><span style="color:#000066;">Array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"blue"</span>, <span style="color:#FF0000;">"green"</span>, <span style="color:#FF0000;">"red"</span>, <span style="color:#FF0000;">"yellow"</span>, <span style="color:#FF0000;">"green"</span>, <span style="color:#FF0000;">"orange"</span>, <span style="color:#FF0000;">"yellow"</span>, <span style="color:#FF0000;">"indigo"</span>, <span style="color:#FF0000;">"red"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// remove the elements who's values are yellow or red</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$arr</span> = <a href="http://www.php.net/array_diff"><span style="color:#000066;">array_diff</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"yellow"</span>, <span style="color:#FF0000;">"red"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// optionally you could reindex the array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$arr</span> = <a href="http://www.php.net/array_values"><span style="color:#000066;">array_values</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print_r"><span style="color:#000066;">print_r</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This is the output from the code above:<br />
Array ( [0] => blue [1] => green [2] => red [3] => yellow [4] => green [5] => orange [6] => yellow [7] => indigo [8] => red )<br />
Array ( [0] => blue [1] => green [4] => green [5] => orange [7] => indigo )<br />
Array ( [0] => blue [1] => green [2] => green [3] => orange [4] => indigo )</p>
<p>Pete Graham xXx</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Bill Gates Urban Myth</title>
		<link>http://tech.petegraham.co.uk/2007/03/21/bill-gates-urban-myth/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/21/bill-gates-urban-myth/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 15:21:03 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Bill Gates]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[wedgie]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/21/bill-gates-urban-myth/</guid>
		<description><![CDATA[There’s an Urban Myth that Bill Gates is so rich that if he was to drop a $1000 bill on the ground, it's just not worth his time to bend over and pick it up. Now it is true that he wouldn’t pick it up, however the real reason for this is he was wedgied [...]]]></description>
			<content:encoded><![CDATA[<p>There’s an Urban Myth that Bill Gates is so rich that if he was to drop a $1000 bill on the ground, it's just not worth his time to bend over and pick it up. Now it is true that he wouldn’t pick it up, however the real reason for this is he was wedgied multiple times as a child and now has a phobia of picking things of the floor.</p>
<p><img id="image83" alt="Bill Gates Sitting at his desk" src="http://tech.petegraham.co.uk/wp-content/uploads/2007/03/bill_gates_desk.jpg" /></p>
<ul>
<li><strong>FACT:</strong> In the hilarious 1990s comedy Bill and Ted wedgieing a person is referred to as giving someone a Melvin</li>
<li><strong>FACT:</strong> You can escape the Grim Reaper by Melvining him!</li>
</ul>
<p>The <a target="_blank" href="http://en.wikipedia.org/wiki/Wedgie">Wikipedia Wedgie page</a> is well worth reading.</p>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/21/bill-gates-urban-myth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My volatile relationship with Javascript</title>
		<link>http://tech.petegraham.co.uk/2007/03/20/my-volatile-relationship-with-javascript/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/20/my-volatile-relationship-with-javascript/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 17:55:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/20/my-volatile-relationship-with-javascript/</guid>
		<description><![CDATA[I started work in web development in 2004 at this point in time JavaScript was hugely unpopular in terms of web trends, this is probably because it was mostly used for annoying pop-ups, animations and whole list of other horrendous Internet crimes. I can recall having a King Herod style culling of all JavaScript from [...]]]></description>
			<content:encoded><![CDATA[<p>I started work in web development in 2004 at this point in time JavaScript was hugely unpopular in terms of web trends, this is probably because it was mostly used for annoying pop-ups, animations and whole list of other horrendous Internet crimes. I can recall having a King Herod style culling of all JavaScript from the <a target="_blank" href="http://www.tcat.ac.uk">TCAT website</a>, my first main project.</p>
<p>Recently due to the popularity of AJAX web applications JavaScript’s popularity seems to have exploded again! I’ve had to brush up on my JavaScript skills for some of the User Interface work on <a target="_blank" href="http://phuser.com">phuser.com</a>. Whenever I do JavaScript development I never feel as comfortable as I do with PHP or CSS. It’s definitely the weakest weapon in my web-dev arsenal.</p>
<p>I think it’s time to put my JavaScript prejudices behind me and get my hands dirty with some serious JS development. Now I’m not a JavaScript novice, I’ve got a few DHTML tricks up my sleeve I learnt back in the day. However I rarely write my own JavaScript, if I need a function I’ll look for one someone else has written.</p>
<p>When I’ve needed to learn about Javascript in the past I’ve always find it surprisingly hard to find good quality decent resources (compared to other Web technologies). I shall be posting links to any JavaScript articles/tutorials that I find particularly useful on this blog.</p>
<p><span style="font-weight: bold">Articles</span></p>
<ul>
<li><a target="_blank" href="http://adactio.com/atmedia2005/"> Using JavaScript for good, not evil</a>: Good short intro to unobtrusive JavaScript</li>
<li><a target="_blank" href="http://alistapart.com/articles/behavioralseparation"> Behavoiral Separation</a>: Covers the gallery example of the previous article but more indept code explaination</li>
<li><a href="http://www.howtocreate.co.uk/tutorials/javascript/dombasics"> DOM nodes and tree</a>: Unsurprisingly this provides a good introduction to the DOM (Document Object Model)</li>
</ul>
<p># Pete Graham</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/20/my-volatile-relationship-with-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My Favourite Electrical Connections</title>
		<link>http://tech.petegraham.co.uk/2007/03/19/my-favourite-electrical-connections/</link>
		<comments>http://tech.petegraham.co.uk/2007/03/19/my-favourite-electrical-connections/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 18:47:32 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[electrical connections]]></category>
		<category><![CDATA[scart]]></category>

		<guid isPermaLink="false">http://tech.petegraham.co.uk/2007/03/19/my-favourite-electrical-connections/</guid>
		<description><![CDATA[People seem to love my lists. Here is one of my favourite electrical connections:

Scart Socket
USB Port
3.5mm Stereo jack
Double phono
2.5mm Stereo jack
Parallel port
Ethernet
PS/2


/* Pete Graham */
]]></description>
			<content:encoded><![CDATA[<p>People seem to love my lists. Here is one of my favourite electrical connections:</p>
<ol>
<li>Scart Socket</li>
<li>USB Port</li>
<li>3.5mm Stereo jack</li>
<li>Double phono</li>
<li>2.5mm Stereo jack</li>
<li>Parallel port</li>
<li>Ethernet</li>
<li>PS/2</li>
</ol>
<p><img alt="sweet scart leeds with technical information" id="image77" src="http://tech.petegraham.co.uk/wp-content/uploads/2007/03/scart.jpg" /><br />
/* Pete Graham */</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.petegraham.co.uk/2007/03/19/my-favourite-electrical-connections/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

