<?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</title>
	<atom:link href="http://blog.amnuts.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.amnuts.com</link>
	<description>php projects, javascript, and... stuff.</description>
	<lastBuildDate>Mon, 22 Feb 2010 16:14:13 +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>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>
		<item>
		<title>PHP Team Development (book)</title>
		<link>http://blog.amnuts.com/2009/09/30/php-team-development-book/</link>
		<comments>http://blog.amnuts.com/2009/09/30/php-team-development-book/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:13:57 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[packt]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=136</guid>
		<description><![CDATA[The other day I had a new book sent to me called PHP Team Development, written by Samisa Abeysinghe and published by Packt Publishing.  Unfortunately, it arrived at work when I was on holiday so I haven&#8217;t been able to have a look at it yet. :-/  However, I&#8217;m back today and have [...]]]></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>The other day I had a new book sent to me called <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">PHP Team Development</a>, written by Samisa Abeysinghe and published by Packt Publishing.  Unfortunately, it arrived at work when I was on holiday so I haven&#8217;t been able to have a look at it yet. :-/  However, I&#8217;m back today and have the book in my hands  (well, not literally, of course, else typing would be much more difficult), so am looking forward to diving in to it.</p>
<p>Hopefully have a bit of a review posted up here some time soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/09/30/php-team-development-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework hidden gems</title>
		<link>http://blog.amnuts.com/2009/03/24/zend-framework-hidden-gems/</link>
		<comments>http://blog.amnuts.com/2009/03/24/zend-framework-hidden-gems/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 17:16:20 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[streams]]></category>
		<category><![CDATA[zend_view]]></category>
		<category><![CDATA[zend_view_stream]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=133</guid>
		<description><![CDATA[Sometimes you come across hidden little gems in the Zend Framework that save you time, even if that&#8217;s just down to the amount of text you need to type.  The Zend_View holds one of these little gems&#8230;
Did you know that you can use the short php open tags and echo tag in your view [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you come across hidden little gems in the Zend Framework that save you time, even if that&#8217;s just down to the amount of text you need to type.  The Zend_View holds one of these little gems&#8230;</p>
<p>Did you know that you can use the short php open tags and echo tag in your view scripts, and you don&#8217;t even need to have this turned on in the php.ini file?</p>
<p>So you can have things like:</p>
<p><code>&lt;? $this->viewHelper(); ?&gt;</code></p>
<p>and:</p>
<p><code>&lt;?= $this->variable; ?&gt;</code></p>
<p>instead of:</p>
<p><code>&lt;?php $this->viewHelper(); ?&gt;</code><br />
<code>&lt;?php echo $this->variable; ?&gt;</code></p>
<p>Might not seem a lot, but when you have a lot of view scripts to write then you can save quite a few key strokes.</p>
<p>It&#8217;s able to do this, even if you have short_tags off (as it should be!) because Zend_View uses a stream to open and seek through the view script &#8211; Zend_View_Stream.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/03/24/zend-framework-hidden-gems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text box &#8216;hint&#8217; values with jQuery</title>
		<link>http://blog.amnuts.com/2009/02/17/text-box-hint-values-with-jquery/</link>
		<comments>http://blog.amnuts.com/2009/02/17/text-box-hint-values-with-jquery/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 00:24:23 +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=129</guid>
		<description><![CDATA[On creating a rather large form recently, I was in the need to have some kind of hint to the user about what format the content should take on several input boxes.  I could have done this with a description under the form element, but a more accepted way to do this, it seems, [...]]]></description>
			<content:encoded><![CDATA[<p>On creating a rather large form recently, I was in the need to have some kind of hint to the user about what format the content should take on several input boxes.  I could have done this with a description under the form element, but a more accepted way to do this, it seems, is to have a &#8216;hint&#8217; in the element itself.  You know the kind of thing I mean; a value, usually quite a light grey colour, that is present until you click in to the form element and then is disappears.  I also wanted to do this as a jQuery plug-in because, well, why not? <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span id="more-129"></span><br />
There are some things to bare in mind with this kind of functionality.  Obviously, you only want it to apply to text boxes and textareas &#8211; anything else is a waste of time&#8230; Even password fields are pointless to have a hint in them because it&#8217;ll only be a series of stars anyway!</p>
<p>The next thing to bare in mind is that you don&#8217;t want to reset the value if the user has typed anything in.  And sometimes you may even want to accept the user typing exactly what the hint is, you you can&#8217;t just assume that if the value == the hint then it&#8217;s OK to clear.</p>
<p>And with those things in mind, here&#8217;s the plug-in:</p>
<pre lang="javascript">
/**
 * Form text box hints.
 *
 * This plug-in will allow you to set a 'hint' on a text box or
 * textarea.  The hint will only display when there is no value
 * that the user has typed in, or that is default in the form.
 *
 * You can define the hint value, either as an option passed to
 * the plug-in or by altering the default values.  You can also
 * set the hint class name in the same way.
 *
 * Examples of use:
 *
 *     $('form *').textboxhint();
 *
 *     $('.date').textboxhint({
 *         hint: 'YYYY-MM-DD'
 *     });
 *
 *     $.fn.textboxhint.defaults.hint = 'Enter some text';
 *     $('textarea').textboxhint({ classname: 'blurred' });
 *
 * @copyright Copyright (c) 2009,
 *            Andrew Collington, andy@amnuts.com
 * @license New BSD License
 */
(function($) {
    $.fn.textboxhint = function(userOptions) {
        var options = $.extend({}, $.fn.textboxhint.defaults, userOptions);
        return $(this).filter(':text,textarea').each(function(){
            if ($(this).val() == '') {
                $(this).focus(function(){
                    if ($(this).attr('typedValue') == '') {
                        $(this).removeClass(options.classname).val('');
                    }
                }).blur(function(){
                    $(this).attr('typedValue', $(this).val());
                    if ($(this).val() == '') {
                        $(this).addClass(options.classname).val(options.hint);
                    }
                }).blur();
            }
        });
    };

    $.fn.textboxhint.defaults = {
        hint: 'Please enter a value',
        classname: 'hint'
    };
})(jQuery);
</pre>
<p>Some examples of use (as shown in the plug-in header comment, but I figure it can&#8217;t hurt to show it again!)</p>
<pre lang="javascript">
$('form *').textboxhint();

$('.date').textboxhint({
    hint: 'YYYY-MM-DD'
});

$.fn.textboxhint.defaults.hint = 'Enter some text';
$('textarea').textboxhint({ classname: 'blurred' });
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2009/02/17/text-box-hint-values-with-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
