<?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>amnuts &#187; Andy</title>
	<atom:link href="http://blog.amnuts.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.amnuts.com</link>
	<description>php projects, javascript, and... stuff.</description>
	<lastBuildDate>Fri, 07 May 2010 09:11:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTPC build &#8211; the parts, they be comin&#8217;</title>
		<link>http://blog.amnuts.com/2010/05/07/htpc-build-the-parts-they-be-comin/</link>
		<comments>http://blog.amnuts.com/2010/05/07/htpc-build-the-parts-they-be-comin/#comments</comments>
		<pubDate>Fri, 07 May 2010 09:10:42 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[htpc]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=183</guid>
		<description><![CDATA[Actually, for the most part I have gotten the parts.  The only thing I&#8217;m waiting on now is the CPU (together with a tube of Arctic Silver 5 compound) and the wifi card.  Hopefully they&#8217;ll come soon, because not having the CPU is a bit of a show-stopper.  However, the case&#8230;
Ahh, the case.  The Antec [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, for the most part I have gotten the parts.  The only thing I&#8217;m waiting on now is the CPU (together with a tube of Arctic Silver 5 compound) and the wifi card.  Hopefully they&#8217;ll come soon, because not having the CPU is a bit of a show-stopper.  However, the case&#8230;</p>
<p>Ahh, the case.  The Antec Fusion Remote.  A lovely case, it seems.  The construction feels fantastic, nice and sturdy, and the front looks wonderful.  But, man!  The thing is a beast!  I swear that it&#8217;s almost as big as my desktop PC.  The unit we have to put the HTPC on is <em>just about</em> big deep enough &#8211; so long as we don&#8217;t want any cables at all attached to the back!  It&#8217;s either that (and what&#8217;s the point of having the HTPC if we can&#8217;t hook it up to anything?) or have the case hover over the edge of the unit, which&#8217;d look sloppy.  No, the case, albeit probably very nice, is going back.  But what to do?  Every case I look at and like is about the same depth.  All the really slim cases would also require me sending back my PSU, probably the wifi card as well, and possibly wouldn&#8217;t accommodate the graphics card.  Thankfully I came across the <a href="http://silverstonetek.com/products/p_contents.php?pno=gd02&amp;area=">Silverstone GD02</a> which will allow for a standard ATX PSU, a graphics card up to 11.5&#8243; in length and still looks quite nice to boot.  Best of all, it&#8217;s about 8cm shorter in depth than the Fusion Remote!  I&#8217;m hoping that I didn&#8217;t need to go for the GD05 which is a further 4cm shorter than even the GD02, because I like the ability to have an external 3.5&#8243; device on the case (for adding a memory card reader or similar further on down the line).</p>
<p>Now, the GD02 case doesn&#8217;t have a few things that the Fusion does.  It doesn&#8217;t have a display on the front.  To be honest, I&#8217;m coming around to the idea of that actually being a really good thing.  Do I really want to have a <em>really</em> bright (from what I&#8217;ve read) display on the front of the case while watching a movie?  No, I think that&#8217;d be distracting.  It also doesn&#8217;t have a remote.  Well, the diNovo keyboard with integrated touchpad should do the trick there.  And it doesn&#8217;t have a volume control on the front of the case.  OK, that&#8217;s only an added bonus and nothing I&#8217;d miss anyway.</p>
<p>So the new case was ordered yesterday from <a href="http://www.scan.co.uk/">Scan</a> (along with a 1.5TB hard drive), and bless &#8216;em, it&#8217;s already been dispatched and I should have it today!  Whoever I ordered the CPU from needs to get in gear because I want to get buildin&#8217;! <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/05/07/htpc-build-the-parts-they-be-comin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTPC build!</title>
		<link>http://blog.amnuts.com/2010/05/04/htpc-build/</link>
		<comments>http://blog.amnuts.com/2010/05/04/htpc-build/#comments</comments>
		<pubDate>Tue, 04 May 2010 18:01:40 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[htpc]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=178</guid>
		<description><![CDATA[A while ago my wife asked me if it were possible to remove all the DVDs we had on a couple shelves and put them in the loft and &#8217;somehow&#8217; put them on to the computer so we could watch the movies&#8230;  naturally my mind went straight to building or buying a media centre/HTPC.  After [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago my wife asked me if it were possible to remove all the DVDs we had on a couple shelves and put them in the loft and &#8217;somehow&#8217; put them on to the computer so we could watch the movies&#8230;  naturally my mind went straight to building or buying a media centre/HTPC.  After looking around I found some nice small systems, such as the systems by Acer or Zotac.  However, they either didn&#8217;t come with a blu-ray player, or didn&#8217;t have room in the case to add to in the future (such as adding a tv tuner card or similar).  So after a long while, I finally decided I may as well just build the darned thing!  (OK, so it wasn&#8217;t much of a push that I needed to buy lots of computer components and build a new PC&#8230;)</p>
<p>This is what we went and ordered this past weekend:</p>
<ul>
<li>Antex Fusion Remote case<br />
<em>probably a little bigger than I wanted, but lots of people seemed to like it</em></li>
<li>AMD Phenom II X4 955 CPU<br />
<em>may as well have something that can encode reasonably well!</em></li>
<li>Asus Micro-ATX M4a785 HTPC mobo</li>
<li>LG Blu-ray reader/DVD multi-format burner</li>
<li>2GB Crucial RAM</li>
<li>ATI HD 5450 graphics card<br />
<em>even though mobo has the 4200 line built-in, I think it&#8217;ll be better to use a dedicated card</em></li>
<li>Logitech diNovo Mini keyboard</li>
</ul>
<p>Got a few other things as well, such as a wifi card, bluetooth dongle, etc.  The only thing I don&#8217;t currently have is a hard drive.  I&#8217;m thinking of a small, fast drive for the program partition and a couple large drives in RAID 1&#8230;  Actually, is that possible?  Can I have one drive in the computer not in raid and two others in raid?  Or is it a case of they all need to be in some format of raid or not at all?  Guess I&#8217;ll soon find out!</p>
<p>Very excited about all of this&#8230; Some parts have already been allocated and invoiced, so hopefully have everything within the next 10 or so days.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/05/04/htpc-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New baby!</title>
		<link>http://blog.amnuts.com/2010/03/20/new-baby/</link>
		<comments>http://blog.amnuts.com/2010/03/20/new-baby/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 16:21:09 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=173</guid>
		<description><![CDATA[Welcoming to the world my lovely little daughter, Rozalynd.  Born on the 17th March and weighing in at 6lb 2oz.  Apparently, I didn&#8217;t learn my lesson the first time and thought more kids and less time to code would be a good thing&#8230;  
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.amnuts.com/wp-content/uploads/2010/03/Contemplative-Rozalynd.jpg"><img class="alignright size-thumbnail wp-image-174" title="Contemplative Rozalynd" src="http://blog.amnuts.com/wp-content/uploads/2010/03/Contemplative-Rozalynd-150x150.jpg" alt="" width="150" height="150" /></a>Welcoming to the world my lovely little daughter, Rozalynd.  Born on the 17th March and weighing in at 6lb 2oz.  Apparently, I didn&#8217;t learn my lesson the first time and thought more kids and less time to code would be a good thing&#8230; <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/03/20/new-baby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QrCode view helper</title>
		<link>http://blog.amnuts.com/2010/02/10/qrcode-view-helper/</link>
		<comments>http://blog.amnuts.com/2010/02/10/qrcode-view-helper/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 16:36:16 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[qrcode]]></category>
		<category><![CDATA[zend_view]]></category>
		<category><![CDATA[zend_view_helper]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=166</guid>
		<description><![CDATA[You see QrCodes popping up every now and again on sites, in publications and the like.  I think they can be a very handy way for people with cameras on their phones to get a url or other content on to their phone very easily.  (I&#8217;m thinking more about those people without iPhones [...]]]></description>
			<content:encoded><![CDATA[<p>You see QrCodes popping up every now and again on sites, in publications and the like.  I think they can be a very handy way for people with cameras on their phones to get a url or other content on to their phone very easily.  (I&#8217;m thinking more about those people without iPhones or full keyboards, of course!)</p>
<p>If you&#8217;ve never seen a QrCode before, it looks something like this:</p>
<p><img src="http://chart.apis.google.com/chart?cht=qr&amp;chl=http%3A%2F%2Fblog.amnuts.com%2F&amp;chld=M|0&amp;chs=100x100" alt="QR Code image" /></p>
<p>Now how cool would it be to be able to generate that automatically for each page on your site and allow people to be able bookmark that site on their phone?  Well, <strong><em>I</em></strong> think it&#8217;d be pretty cool!  So I came up with a very simple ZF view helper to do it for me.</p>
<p><span id="more-166"></span>This is the view helper code:</p>
<pre class="brush: php;">&lt;?php

/**
 * Output a QR code block.
 *
 * Currently, only via Google Chart API is supported, but it has
 * room to add other sources of qrcode generation.
 *
 * @category   Amnuts
 * @package    Amnuts_View
 * @subpackage Amnuts_View_Helper
 */
class Amnuts_View_Helper_QrCode extends Zend_View_Helper_Abstract
{
    protected $template = '
        &lt;div class=&quot;qrcode&quot;&gt;
            &lt;p&gt;Bookmark this page on your mobile&lt;/p&gt;
            &lt;img src=&quot;%s&quot; alt=&quot;QR Code image&quot; /&gt;
            &lt;p class=&quot;hint&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/QR_Code&quot;&gt;What is this?&lt;/a&gt;&lt;/p&gt;
        &lt;/div&gt;
        ';

    /**
     * Constructor.
     *
     * @return Amnuts_View_Helper_QrCode
     */
    public function qrCode($template = null)
    {
        if (null !== $template) {
            $this-&gt;template = $template;
        }
        return $this;
    }

    /**
     * Generate the QR code image via Google's Chart API.
     *
     * @param  array  $params
     * @return string
     */
    public function google($params = array())
    {
        $default = array(
            'text'       =&gt; $_SERVER['SCRIPT_URI'],
            'size'       =&gt; '100x100',
            'correction' =&gt; 'M',
            'margin'     =&gt; 0
        );
        $params = array_merge($default, $params);

        $params['text']   = urlencode($params['text']);
        $params['margin'] = (int)$params['margin'];
        if (!in_array($params['correction'], array('L', 'M', 'Q', 'H'))) {
            $params['correction'] = 'M';
        }
        if (!preg_match('/^\d+x\d+$/', $params['size'])) {
            $params['size'] = '100x100';
        }

        $url = &quot;http://chart.apis.google.com/chart?cht=qr&amp;chl={$params['text']}&quot;
             . &quot;&amp;chld={$params['correction']}|{$params['margin']}&quot;
             . &quot;&amp;chs={$params['size']}&quot;;
        return sprintf($this-&gt;template, $url);
    }
}
</pre>
<p>As it&#8217;s a view helper, it&#8217;s very simple to use within your view.  Just do something like:</p>
<pre class="brush: php;">&lt;?php echo $this-&gt;qrCode()-&gt;google(); ?&gt;</pre>
<p>If you want to change the default template for one instance, you can do that such as:</p>
<pre class="brush: php;">&lt;?php echo $this-&gt;qrCode('&lt;li&gt;&lt;img src=&quot;%s&quot; /&gt;&lt;/li&gt;')-&gt;google(); ?&gt;</pre>
<p>And, of course, you can change the parameters that the QrCode uses, too.  By default, if you don&#8217;t supply the &#8216;text&#8217; parameter then it will use the script uri.  But you could change that with something like:</p>
<pre class="brush: php;">&lt;?php echo $this-&gt;qrCode()-&gt;google(array('text' =&gt; 'Visit my site at: http://blog.amnuts.com/')); ?&gt;</pre>
<p>There are other options as view helper code shows.  But this should get you started on easily using QrCodes on your own site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/02/10/qrcode-view-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today&#8217;s date</title>
		<link>http://blog.amnuts.com/2010/02/01/todays-date/</link>
		<comments>http://blog.amnuts.com/2010/02/01/todays-date/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:33:00 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=164</guid>
		<description><![CDATA[Today&#8217;s date has a lovely palindromic quality to it:
01022010
Cool.  
]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s date has a lovely palindromic quality to it:</p>
<p><strong>01022010</strong></p>
<p>Cool. <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/02/01/todays-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding new items to RSS feed &#8211; it shouldn&#8217;t be this hard!</title>
		<link>http://blog.amnuts.com/2010/01/28/adding-new-items-to-rss-feed-it-shouldnt-be-this-hard/</link>
		<comments>http://blog.amnuts.com/2010/01/28/adding-new-items-to-rss-feed-it-shouldnt-be-this-hard/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:57:25 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[zend_feed]]></category>
		<category><![CDATA[zend_feed_writer]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=155</guid>
		<description><![CDATA[I have just started to use the Zend_Feed related components in earnest and am really liking the Zend_Feed_Writer (new to ZF 1.10.0).  So what I wanted to do was created an RSS feed file is one didn&#8217;t exist and then keep updating that file as-and-when new items came in.  Seems a really easy [...]]]></description>
			<content:encoded><![CDATA[<p>I have just started to use the Zend_Feed related components in earnest and am really liking the Zend_Feed_Writer (new to ZF 1.10.0).  So what I wanted to do was created an RSS feed file is one didn&#8217;t exist and then keep updating that file as-and-when new items came in.  Seems a really easy and simple thing to do, right?  That, unfortunately, has not been my experience.</p>
<p>I have to say that to documentation seems quite lacking on the ZF site (for all the the Feed components, really, not just the Writer).  Because of that, what follows may be idiotic and there really is an easy way.  If so, I hope that you will post up a comment and let me know because I&#8217;d love to learn!</p>
<p>On with what I did&#8230;</p>
<p><span id="more-155"></span><br />
My set up is actually to take an email sent to a particular address and add the contents to an RSS feed as-and-when the email arrives.  So when the first email comes in the RSS feed file needs to be created.  Using the Zend_Feed_Writer_Feed component, this is a really easy job.  Once saved the XML looks well structured and everything is as expected.  But then what happens when the next email comes in?  Obviously I wouldn&#8217;t want to create a new feed file because it&#8217;d remove any previous entries.  Also, I want to tweak the pubDate so that it reflects when this new email came in.  I also wanted to use the Zend_Feed_Writer_Entry component so that the structure of the new item matches the previous ones.</p>
<p>The first thing to do was to load the RSS file and tweak the pubDate.</p>
<pre class="brush: php;">
$now = new DateTime();
$now-&gt;setTimestamp(time());
$feed = new Zend_Feed_Rss(null, file_get_contents($feedFile));
$feed-&gt;pubDate = $now-&gt;format(DATE_RSS);
</pre>
<p>Then I created the entry:</p>
<pre class="brush: php;">
$entry = new Zend_Feed_Writer_Entry();
$entry-&gt;setId($entryId);
$entry-&gt;setTitle($emailSubject);
$entry-&gt;addAuthor(array(
    'name'  =&gt; $emailFromName,
    'email' =&gt; $emailFormAddress
));
$entry-&gt;setDateCreated($emailDate-&gt;getTimestamp());
$entry-&gt;setContent($emailBody);
</pre>
<p>At this point it would be <strong><em>really</em></strong> nice to have some kind of Zend_Feed_Rss::addEntry(Zend_Feed_Writer_Entry|string of entry xml), or ::appendEntry()/::prependEntry(), but I was not able to see anything of the sort.  So what I did was to create a DOMDocument with the feed file contents, render the entry and append it to the channel node.</p>
<pre class="brush: php;">
$rss = new DOMDocument();
$rss-&gt;loadXML($feed-&gt;saveXML());
$rss-&gt;formatOutput = true;
$rss-&gt;substituteEntities = false;

$renderer = new Zend_Feed_Writer_Renderer_Entry_Rss($entry);
$renderer-&gt;setRootElement($rss-&gt;documentElement);
$renderer-&gt;render();
$element = $renderer-&gt;getElement();

$channel  = $rss-&gt;getElementsByTagName('channel')-&gt;item(0);
$imported = $rss-&gt;importNode($element, true);
$channel-&gt;appendChild($imported);

file_put_contents($feedFile, $rss-&gt;saveXML());
</pre>
<p>Now, that&#8217;s not a lot of code, but does it seem even remotely logical to do that when there&#8217;s already a fairly inclusive API for the feeds &#8211; perhaps just not inclusive enough?</p>
<p>Like I mentioned at the start, though; if you know a better way then please let me know &#8211; I&#8217;m always happy to learn!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/01/28/adding-new-items-to-rss-feed-it-shouldnt-be-this-hard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend_Form decorators webinar</title>
		<link>http://blog.amnuts.com/2010/01/18/zend_form-decorators-webinar/</link>
		<comments>http://blog.amnuts.com/2010/01/18/zend_form-decorators-webinar/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 22:37:44 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[decorators]]></category>
		<category><![CDATA[webinar]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=153</guid>
		<description><![CDATA[If you&#8217;re not sure about Zend_Form&#8217;s decorators, what they are or how to use them, then Matthew Weier O’Phinney has the webinar for you:
http://www.zend.com/webinar/Framework/webinar-leveraging-zend_form-decorators-20091216.flv
It&#8217;s a great introduction to decorators, how to implement them and how to do slightly more complex things with them.  Well worth a watch!
]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re not sure about Zend_Form&#8217;s decorators, what they are or how to use them, then <a href="http://weierophinney.net/matthew/">Matthew Weier O’Phinney</a> has the webinar for you:</p>
<p><a href="http://www.zend.com/webinar/Framework/webinar-leveraging-zend_form-decorators-20091216.flv">http://www.zend.com/webinar/Framework/webinar-leveraging-zend_form-decorators-20091216.flv</a></p>
<p>It&#8217;s a great introduction to decorators, how to implement them and how to do slightly more complex things with them.  Well worth a watch!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/01/18/zend_form-decorators-webinar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Same height for elements &#8211; now with jQuery goodness!</title>
		<link>http://blog.amnuts.com/2009/12/24/same-height-for-elements-2/</link>
		<comments>http://blog.amnuts.com/2009/12/24/same-height-for-elements-2/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 00:25:56 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plug-in]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=150</guid>
		<description><![CDATA[A while ago I wrote a post on how to use the Prototype js library to make elements on your page have the same height.
For those too lazy to read that post, it can be summarised something like this:

Have a number of divs on your page that have different size blocks of text in them? [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote a post on <a href="http://blog.amnuts.com/2007/02/09/same-height-for-elements/">how to use the Prototype js library to make elements on your page have the same height</a>.</p>
<p>For those too lazy to read that post, it can be summarised something like this:<br />
<span id="more-150"></span></p>
<blockquote><p>Have a number of divs on your page that have different size blocks of text in them?  Want to make all the divs have the same height, but can&#8217;t accurately determine what that height should be in advance?  No problem!  Use javascript to tweak the heights when the page has loaded and the browser knows the size of the divs.  Use this plugin to do it automatically based on a class you supply the elements you want to change the size of.  Better yet, make them all match either the smallest height or the largest height!</p></blockquote>
<p>Simple, yes?</p>
<p>Well, that was with Prototype&#8230; But a while ago now I created a version for jQuery.  So here it is.</p>
<pre lang="javascript">
/**
 * Same Height, jQuery plug-in.
 *
 * This plug-in allows you to automatically have all of the elements marked
 * with a particular class to be the same height, either by smallest or
 * largest.
 *
 * By default, 'samemaxheight' and 'sameminheight' will be used.
 *
 * Examples of use:
 *
 *     $(document).ready(function() {
 *         $('body').sameheight();
 *     });
 *
 *     $(document).ready(function() {
 *         $('#mainContent').sameheight({
 *             max: 'mymaxclass',
 *             min: 'myminclass'
 *         });
 *     });
 *
 *     $.fn.sameheight.defaults.max = 'mymaxclass';
 *     $.fn.sameheight.defaults.min = 'myminclass';
 *     $('body').sameheight();
 *
 * @copyright Copyright (c) 2009 Andrew Collington <andy @amnuts.com>
 */
(function($) {
    $.fn.sameheight = function(userOptions) {
        var options = $.extend({}, $.fn.sameheight.defaults, userOptions);

        var maxH = 0;
        $('.' + options.max, $(this)).each(function(){
            var h = $(this).height();
            maxH = (h > maxH) ? h : maxH;
        });
        $('.' + options.max, $(this)).each(function(){
            $(this).css({
                'height'   : maxH + 'px',
                'overflow' : 'hidden'
            });
        });

        var minH = 0;
        $('.' + options.min, $(this)).each(function(){
            var h = nodes[i].height();
            minH = ((h < minH) || !minH) ? h : minH;
        });
        $('.' + options.min, $(this)).each(function(){
            $(this).css({
                'height'   : minH + 'px',
                'overflow' : 'hidden'
            });
        });
    };

    $.fn.sameheight.defaults = {
        max: 'samemaxheight',
        min: 'sameminheight'
    };
})(jQuery);
</pre>
<p></andy></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/12/24/same-height-for-elements-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointless error message</title>
		<link>http://blog.amnuts.com/2009/12/21/pointless-error-message/</link>
		<comments>http://blog.amnuts.com/2009/12/21/pointless-error-message/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:11:42 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=143</guid>
		<description><![CDATA[Just ran a bit of SQL on Oracle and this was the oh-so helpful error message I got back:
Warning:  ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BINARY got BINARY
So you&#8217;re expecting a binary value and what you got was a binary value, but that&#8217;s inconsistent with the binary value you were expecting to be [...]]]></description>
			<content:encoded><![CDATA[<p>Just ran a bit of SQL on Oracle and this was the oh-so helpful error message I got back:</p>
<blockquote><p><strong>Warning</strong>:  ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BINARY got BINARY</p></blockquote>
<p>So you&#8217;re expecting a binary value and what you got was a binary value, but that&#8217;s inconsistent with the binary value you were expecting to be binary?!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/12/21/pointless-error-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Team Development book review</title>
		<link>http://blog.amnuts.com/2009/12/07/php-team-development-book-review/</link>
		<comments>http://blog.amnuts.com/2009/12/07/php-team-development-book-review/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 11:48:32 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[packt]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=139</guid>
		<description><![CDATA[So I&#8217;ve finally finished the book!  OK, I finished it a couple weeks ago but haven&#8217;t had a chance to post up a review yet.  Of course, I had every intention of finishing it a lot earlier considering I was flying for nine hours to the States and then another few hours on to Mexico [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.packtpub.com/php-team-development?utm_source=blog.amnuts.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_000684"><img style="float:right;border:0;margin:0 0 10px 10px;" src="https://www.packtpub.com/images/100x123/1847195067.png" alt="Book cover" /></a>So I&#8217;ve finally finished the book!  OK, I finished it a couple weeks ago but haven&#8217;t had a chance to post up a review yet.  Of course, I had every intention of finishing it a lot earlier considering I was flying for nine hours to the States and then another few hours on to Mexico &#8211; and the journey back again! &#8211; but that really was just wishful considering I was travelling with my two year old son.  Oh well! <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>On with the book review&#8230;</p>
<p>The book, as the title makes it plainly obvious, is about <a href="http://www.packtpub.com/php-team-development?utm_source=blog.amnuts.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_000684">developing your team in relation to working with PHP</a>.  It&#8217;s aimed at, well, pretty much anyone who has an interest in developing or working in a team, be it managers who need to set up and manage teams or developers working within a team who want to improve their work flow and procedures, or anyone in between.  It does this by giving an overview on several subjects, but doesn&#8217;t go as far as to tell you that you must do x, y or z.  This is understandable, though, as every team is different and the book acknowledges this.</p>
<p><span id="more-139"></span>Chapter 1 discusses the need for teams and the use of established software engineering patterns that can help as well as touching on some tools such as issue tracking, source control, etc.  This chapter is good if you&#8217;re not sure with a lot of terminology as the overview covers a few key topics such as continuous integration and regression, and also touches on software development principles.  It doesn&#8217;t go in to depth about any one thing, as they&#8217;re covered in further chapters.</p>
<p>Chapter 2 covers MVC (Model View Controller) design principles and how you might form you team to deal with different aspects of the MVC pattern.  To be honest, if you&#8217;ve dealt with MVC at all in your job then this chapter holds no surprises, as you will know how the pattern works and how you would give responsibilities to different team groups/members.  However, if you&#8217;ve not had any experience at all then it offers a nice little introduction to the pattern.  (Remember, though, that this is not about how you would code the MVC pattern or use it in your project &#8211; it&#8217;s about making the principles of the pattern known to you and how it may fit in to team working.)</p>
<p>Chapter 3 is about dealing with complexity.  That is to say, if you have a complex project or application then this chapter gives you an idea on how to manage that and implement things that will make your job easier.  Essentially, what this chapter comes down to is why it&#8217;s a good idea to use a framework.  Again, it&#8217;s nothing new if you&#8217;ve already used frameworks (generally by then you know all the reasons why it tends to be a good thing for complex projects), but if you&#8217;re contemplating using one, or sit in a more managerial role and want to know why your developers are using one, then it&#8217;s worth the read.  At the end of the chapter the author also gives links to a number of different frameworks &#8211; some of which I hadn&#8217;t heard of before &#8211; along with their license type and a brief description.  What I especially liked about this chapter is that the author came over quite framework agnostic.  He wasn&#8217;t saying that one framework is better than another or which you should use &#8211; he supplies a list of frameworks and arms you with knowledge of what to look for in a framework (commercial license, documentation, support, code quality, security, etc.) and sets you on your way.  It is, of course, up to you to choose a framework that best suits your project and then integrate that in to your team workings.  This is a Good Thing!</p>
<p>Chapter 4 is about the process to get from the concept of an application to the end product and the steps in between.  There are a number of flow charts throughout this chapter that help you understand the process, and for someone like me who generally goes from being told someone wants an application,  to getting a brief functional requirements set and then making the thing, I can see that I have room for improvement! <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Chapter 5 is about Agile development, and probably the chapter I was looking forward to the most.  Agile development was something I&#8217;d heard about, had an ever-so vague idea of what it was, but wasn&#8217;t too sure.  this chapter tells you what the principles are behind Agile development, how is works when dealing with the customer and a wide general overview.  The chapter then goes on to cover Extreme Programming (XP) a bit, and how Agile and XP can work in the team, pair programming, sustainable working styles for the developers, stand-up meetings, and so on.  It was good to find out a lot of how I work falls under Agile/XP, even though I didn&#8217;t know it at the time!  I learned a lot from this chapter and know a number of things I want to try to implement in to my working practice.</p>
<p>Chapter 6 is about collaboration among the team.  Basically it covers how source control is helpful, bug control and reporting, and ways developers can communicate (mailing lists, for example).  Useful stuff if you don&#8217;t know about it already, but pretty much any developer I know already uses source control in one form or another, as well as bug reporting, mailing lists, IRC, and everything else.</p>
<p>Chapter 7, the final chapter, is about continuous integration &#8211; what happens when your project needs to change, how does the project evolve, how to ensure team success and more.  Even though this is a distinct chapter in itself, I did get the feeling that it was more like a summary chapter of everything that you had just read.  But this was probably just because the author was referencing a number of his earlier chapters because they relatedto what he was taling about at the time.</p>
<p><strong>Conclusion</strong></p>
<p>This book is only 160 or so pages in size and it tries to cram a <em>lot</em> of information in to it.  There are times I wish the author could have gone in to more detail, but could also very much appreciate that the author didn&#8217;t have enough room to do so.  I actually quite liked that it was a really high-level overview for the most part, because it gave me a lot of ideas of things I want to investigate further and can now go and find resources that covers those bits in much more details.</p>
<p>Because I know quite a number of principles this book covered, such as the MVC chapters, source control, etc., I didn&#8217;t take quite so much away from it as another person may &#8211; and I&#8217;m sure other developers would feel the same &#8211; but I did still learn a lot from it, such as the agile development, and a number of keys principles that mayhelp me manage my time better as well as have a more integrated team.</p>
<p>However, this book wasn&#8217;t all roses and there were a number of things I really didn&#8217;t like.  The first thing is the authors style of writing.  I honestly didn&#8217;t gel with it very well and actually struggled to get past the first couple of chapters.  There was an overabundance of commas &#8211; sometimes breaking up the sentence in odd places &#8211; and it because a little repetitive and word for no reason.  My wife accuses me of using commas too much, which I probably do, but the amount in this book just caused me a headache!  The writing style I could get over (as mine&#8217;s not the best, but then, I&#8217;m not trying to sell you a book!), but the one thing that <em>really</em> pissed me off was that fact that the credits included a proof reader!!  WHAT?!  I lost count of the times &#8216;form&#8217; was used when it should have been &#8216;from&#8217;, or the spelling mistakes, grammatical errors, or missing words entirely!  A couple of my favourites is when the author was discussing the use of functional programming vs. OOP, and then goes on to say, &#8220;Be it fictional programming you are using or object-oriented programming&#8230;&#8221;  <em>Fictional</em> programming!  And this highlights the commas quite nicely, &#8220;&#8230;we might be about to deal with estimates that are off the mark for some time, in the long run, both, the development team as well as clients and users will become frustrated&#8230;&#8221;  I don&#8217;t so much blame the author for these mistakes &#8211; I can&#8217;t imagine the pressure of writing a book and trying to get it spot on &#8211; but isn&#8217;t that why you employ proof readers and editors??</p>
<p>All in all I&#8217;d say that if you&#8217;ve been developing for a while and had any team experience then this book wont be of much use to you.  However, if you&#8217;ve never worked in a team environment, or don&#8217;t have much development experience, are a manager or something like that, then you may find this book quite beneficial to you for an overview of working in and establishing team working principles.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/12/07/php-team-development-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
