<?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, 27 Jan 2012 21:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Merge two urls</title>
		<link>http://blog.amnuts.com/2011/09/26/merge-two-urls/</link>
		<comments>http://blog.amnuts.com/2011/09/26/merge-two-urls/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 14:38:51 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Code snippets]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=245</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
/**
 * Combine two urls.
 *
 * The urls can be either a string or url parts that consist of:
 *
 *     scheme, host, port, user, pass, path, query, fragment
 *
 * If passed in as parts in an array, the query parameter can be either
 * a string or an array of name/value key pairs.  The query parameters
 * will be added on to the ones from the original url.  If you want to
 * remove query parameters, or any other parts of the url, you need to
 * pass the value in as null.
 *
 * Examples:
 *
 *     urlMerge(
 * 	       '/tests/section/people?id=9405',
 *         array('query' =&gt; array('found' =&gt; true, 'id' =&gt; null))
 *     );
 *
 *     urlMerge(
 * 	       'http://www.example.com/',
 *         array('scheme' =&gt; 'https', 'query' =&gt; 'foo=bar&amp;test=1'
 *     );
 *
 *     urlMerge(
 * 	       array('path' =&gt; '/tests/item', 'query' =&gt; 'id=9405'),
 *         'http://www.example.com'
 *     );
 *
 * @param  string|array $original
 * @param  string|array $new
 * @return string
 */
function urlMerge($original, $new)
{
    if (is_string($original)) {
        $original = parse_url($original);
    }
    if (is_string($new)) {
        $new = parse_url($new);
    }
    $qs = null;
    if (!empty($original['query']) &amp;&amp; is_string($original['query'])) {
        parse_str($original['query'], $original['query']);
    }
    if (!empty($new['query']) &amp;&amp; is_string($new['query'])) {
        parse_str($new['query'], $new['query']);
    }
    if (isset($original['query']) || isset($new['query'])) {
        if (!isset($original['query'])) {
            $qs = $new['query'];
        } elseif (!isset($new['query'])) {
            $qs = $original['query'];
        } else {
            $qs = array_merge($original['query'], $new['query']);
        }
    }
    $result = array_merge($original, $new);
    $result['query'] = $qs;
    foreach ($result as $k =&gt; $v) {
        if ($v === null) {
            unset($result[$k]);
        }
    }
    if (!empty($result['query'])) {
        $result['query'] = http_build_query($result['query']);
    }
    return (isset($result['scheme']) ? &quot;{$result['scheme']}://&quot; : '')
		. (isset($result['user']) ? $result['user']
		    . (isset($result['pass']) ? &quot;:{$result['pass']}&quot; : '').'@' : '')
		. (isset($result['host']) ? $result['host'] : '')
		. (isset($result['port']) ? &quot;:{$result['port']}&quot; : '')
		. (isset($result['path']) ? $result['path'] : '')
		. (!empty($result['query']) ? &quot;?{$result['query']}&quot; : '')
		. (isset($result['fragment']) ? &quot;#{$result['fragment']}&quot; : '');
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2011/09/26/merge-two-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamhost and procmail &#8211; parsing your mail with a script</title>
		<link>http://blog.amnuts.com/2011/06/18/dreamhost-and-procmail-parsing-your-mail-with-a-script/</link>
		<comments>http://blog.amnuts.com/2011/06/18/dreamhost-and-procmail-parsing-your-mail-with-a-script/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 20:12:10 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[process email with a script]]></category>
		<category><![CDATA[procmail]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=236</guid>
		<description><![CDATA[I have a Dreamhost account and have done for some while. Typically I&#8217;m happy with their service, but yesterday was the first real frustration I had with them. I wanted to use procmail to send email to a script for processing. I was sure I had done this before on Dreamhost, but couldn&#8217;t seem to [...]]]></description>
			<content:encoded><![CDATA[<p>I have a Dreamhost account and have done for some while. Typically I&#8217;m happy with their service, but yesterday was the first real frustration I had with them.  I wanted to use procmail to send email to a script for processing.  I was sure I had done this before on Dreamhost, but couldn&#8217;t seem to get it to work in the wee hours of the night.  So after a quick email to support asking if it was possible, they came back with this response:</p>
<blockquote><p>Unfortunately this is not possible. We do<br />
not offer or support any type of email to script functionality on our<br />
servers.</p></blockquote>
<p>And this pretty much backed up all the searches I had been doing on line in regards to Dreamhost and using procmail.</p>
<p>Now, where they may not support people doing this, it is my pleasure to tell you that it is possible!  And here&#8217;s how you do it&#8230;<br />
<span id="more-236"></span><br />
The first think you have to do is set up the email address that you want to have processed &#8211; this can be done from the control panel under &#8216;<em>Mail &gt; Manage email &gt; Create new email address</em>&#8216;.  Let&#8217;s pretend that you set one up called process@yourdomain.com.</p>
<p>Now you have your email user set up you need to create a shell account user &#8211; one that can log in via SSH.  This can be done from &#8216;<em>Users &gt; Manage users &gt; Add a new user</em>&#8216;.  It&#8217;s important that you select the &#8216;Shell: allows SFTP/FTP plus shell access&#8217; option.  (You may want to use one of your existing shell users, of course, but I personally set one up just for the purpose as Dreamhost doesn&#8217;t limit you on the number of users you can have.)</p>
<p>Now that you have the email address and shell user account set up, you now need to forward whatever goes to that address to the shell account.  This is done with a filter, which can be modified in &#8216;<em>Mail &gt; Message filters</em>&#8216;.  You can have multiple filters on the same address, so you may do some additional processing, but the essential filter to have for the script parsing is to have the email sent to the shell user.  So enter your filter string (I made mine so that the &#8216;To&#8217; contains &#8216;*&#8217; &#8211; ie, everything, but you may only want it matching something particular for processing by the script), and select the &#8216;Forward to shell account&#8217; option with the appropriate user selected.  Then select the option what to do when the filter matches &#8211; &#8216;execute and stop&#8217; or &#8216;execute and continue&#8217;.  I chose the former because I had only the one filter, but you will want it to continue if you have more (or stop is this is the last of multiple filters).</p>
<p>OK, we&#8217;re about half way there&#8230;</p>
<p>Now you want to log in to the shell account and create a few files.  The first file has the filename <strong>.forward.postfix</strong> and has the contents:</p>
<pre class="brush: bash; title: ; notranslate">
&quot;|/usr/bin/procmail -t&quot;
</pre>
<p>(Yes, you need the quotes!)</p>
<p>The next file is your procmail rule, and that&#8217;s in a file that&#8217;s called <strong>.procmailrc</strong>.  It&#8217;s possible to do a lot of things with procmail and I&#8217;m going to explain none of them here!  At the end of this post will be some links about procmail for you to check out and learn from.  Instead, I&#8217;ll just show you what I have and you can go from there.</p>
<pre class="brush: bash; title: ; notranslate">
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log.`date +%y-%m-%d`
SHELL=/bin/sh

:0
|`/usr/local/php53/bin/php /home/youruser/yourscript.php`
</pre>
<p>The first four lines just set up various things; the location of your mail directory, the log file name, and so on.  If the directory <strong>.procmail</strong> doesn&#8217;t exist in your root directory then you may want to create it.</p>
<p>The last two lines are the procmail recipe. Often here you will see three lines &#8211; the <em>:0</em> to start a rule (sometimes with a lock file &#8211; again, follow the procmail links for info) then a filter, such a <em>From.*person@domain</em> and then the &#8216;what to do if this matches&#8217; part. I skipped the filter because I wanted to capture anything that came in to my email address.</p>
<p>The next line is really the important one.  You need the pipe (the &#8216;|&#8217;) to pipe the content of the email to a script execute via a shell command.  And that&#8217;s crucial here &#8211; you need to wrap your command up in backticks (`) for it to work &#8211; I had no luck without those.</p>
<p>You&#8217;ll notice here that I&#8217;m using the PHP binary specifically at <em>/usr/local/php53/bin/php</em> &#8211; this is because I wanted to use PHP 5.3.</p>
<p>And there you have it &#8211; send an email to process@yourdomain.com and the script (in the example above, <em>yourscript.php</em>) will be able to read in the email via stdin and do something with it.</p>
<p>By the way, the PHP code to get the email in to a variable is:</p>
<pre class="brush: php; title: ; notranslate">
$rawEmail = '';
if (($fp = fopen('php://stdin', 'r')) !== false) {
    while (!feof($fp)) {
        $rawEmail .= fread($fp, 1024);
    }
    fclose($fp);
}
</pre>
<p>You can then parse it for multiparts and so on.  If you&#8217;re like me and want a really easy way to do that, just use <em>Zend_Mail_Message</em>:</p>
<pre class="brush: php; title: ; notranslate">
$email = new Zend_Mail_Message(array(
    'raw' =&gt; $rawEmail
));
</pre>
<h4>Procmail links</h4>
<p>All of these are external links and I cannot vouch for the quality of any of them or how much you&#8217;ll learn from reading them.  However, as one if procmail&#8217;s very own homepage, you can&#8217;t really go wrong!</p>
<ul>
<li><a href="http://www.procmail.org/">Procmail homepage</a></li>
<li><a href="http://www.unixgeeks.org/security/newbie/unix/procmail/procmail-guide.html">Procmail guide</a></li>
<li><a href="http://partmaps.org/era/procmail/quickref.html">Quick reference guide</a></li>
<li><a href="http://userpages.umbc.edu/~ian/procmail.html">Mail filtering with Procmail</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2011/06/18/dreamhost-and-procmail-parsing-your-mail-with-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CSS3 sucks (right now, but I&#8217;m sure it&#8217;ll get better)</title>
		<link>http://blog.amnuts.com/2011/05/15/using-css3-sucks-right-now-but-i-am-sure-it-will-get-better/</link>
		<comments>http://blog.amnuts.com/2011/05/15/using-css3-sucks-right-now-but-i-am-sure-it-will-get-better/#comments</comments>
		<pubDate>Sun, 15 May 2011 16:00:44 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[complaint]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=230</guid>
		<description><![CDATA[Am I the only one to think that using a number of aspects of CSS3 right now really sucks? The potential it offers is great, but does anyone really think doing something like this for a gradient is a productive use of time? Once upon a time, not that long ago, the trend setters/leaders of [...]]]></description>
			<content:encoded><![CDATA[<p>Am I the only one to think that using a number of aspects of CSS3 right now really sucks?  The potential it offers is great, but does anyone really think doing something like this for a gradient is a productive use of time?</p>
<pre class="brush: css; title: ; notranslate">
    background: #9880cc; /* Old browsers */
    background: -moz-linear-gradient(top, #9880cc 0%, #bab3cc 93%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9880cc), color-stop(93%,#bab3cc)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #9880cc 0%,#bab3cc 93%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #9880cc 0%,#bab3cc 93%); /* Opera11.10+ */
    background: -ms-linear-gradient(top, #9880cc 0%,#bab3cc 93%); /* IE10+ */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9880CC', endColorstr='#BAB3CC',GradientType=0 ); /* IE6-9 */
    background: linear-gradient(top, #9880cc 0%,#bab3cc 93%); /* W3C */
</pre>
<p>Once upon a time, not that long ago, the trend setters/leaders of the web development community would have lynched you if you so much as dared to use a proprietary tag, be it in the css or the html.  Now they&#8217;re actively encouraging the above kind of usage?!  It&#8217;s ridiculous!  Firefox, Chrome, Safari, IE and Opera all require different proprietary rules, and then you have the W3C recommended way and then the fallback for older browsers.</p>
<p>A Transform in CSS3 is just as bad:</p>
<pre class="brush: css; title: ; notranslate">
-moz-transform: scale(0.8) rotate(deg) translate(px, px) skew(deg, deg);
-webkit-transform: scale(0.8) rotate(deg) translate(px, px) skew(deg, deg);
-o-transform: scale(0.8) rotate(deg) translate(px, px) skew(deg, deg);
-ms-transform: scale(0.8) rotate(deg) translate(px, px) skew(deg, deg);
transform: scale(0.8) rotate(deg) translate(px, px) skew(deg, deg);
</pre>
<p>And this time it&#8217;s not the rule value that&#8217;s different for each, it&#8217;s the rule name!</p>
<p>I think HTML5 (well, XHTML5 for me &#8211; I do love a properly closed tag!) and CSS3 are great, don&#8217;t get me wrong, and I think we&#8217;ve already seen a lot of examples of wonderful sites and demos created using them.  But surely how it&#8217;s getting there and the asinine number of rules we have to put in for each browser is a major step backwards in what people were trying to achieve only a few years ago?  (Ie, a nice compliant <strong>standard</strong> way of doing things.)</p>
<p>Incidentally; there are a couple great sites that help out doing fancy new CSS3 stuff:</p>
<p><a href="http://www.colorzilla.com/gradient-editor/">The Ultimate CSS Gradient Generator</a><br />
<a href="http://css3generator.com/">CSS3 Generator</a></p>
<p>Using sites like those can save a bit of sanity.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2011/05/15/using-css3-sucks-right-now-but-i-am-sure-it-will-get-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting an array of objects by one or more object property</title>
		<link>http://blog.amnuts.com/2011/04/08/sorting-an-array-of-objects-by-one-or-more-object-property/</link>
		<comments>http://blog.amnuts.com/2011/04/08/sorting-an-array-of-objects-by-one-or-more-object-property/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 16:18:26 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Code snippets]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=220</guid>
		<description><![CDATA[Quite often I find myself having an array of objects and needing to sort that array by one or more of the properties in the objects&#8230; Imagine, for example, getting a large result set from Zend_Db, or something similar, and ordering in the query just takes too long. Or perhaps you&#8217;re getting results from a [...]]]></description>
			<content:encoded><![CDATA[<p>Quite often I find myself having an array of objects and needing to sort that array by one or more of the properties in the objects&#8230;  Imagine, for example, getting a large result set from Zend_Db, or something similar, and ordering in the query just takes too long.  Or perhaps you&#8217;re getting results from a web service and that service doesn&#8217;t return the results in the order you&#8217;d like to use.  Have you ever found yourself in that situation, too?  On looking at the <a href="http://uk.php.net/usort">usort documentation</a> one day I came across a comment by someone called <em>Will Shaver</em> that did almost what I wanted.  With a little adaptation for my own use (being able to change the sort order, for example), it has become one of my favourite functions to use for sorting.</p>
<pre class="brush: php; title: ; notranslate">
    /**
     * Sort an array of objects.
     *
     * You can pass in one or more properties on which to sort.  If a
     * string is supplied as the sole property, or if you specify a
     * property without a sort order then the sorting will be ascending.
     *
     * If the key of an array is an array, then it will sorted down to that
     * level of node.
     *
     * Example usages:
     *
     * osort($items, 'size');
     * osort($items, array('size', array('time' =&gt; SORT_DESC, 'user' =&gt; SORT_ASC));
     * osort($items, array('size', array('user', 'forname'))
     *
     * @param array $array
     * @param string|array $properties
     */
    public static function osort(&amp;$array, $properties)
    {
        if (is_string($properties)) {
            $properties = array($properties =&gt; SORT_ASC);
        }
        uasort($array, function($a, $b) use ($properties) {
            foreach($properties as $k =&gt; $v) {
                if (is_int($k)) {
                    $k = $v;
                    $v = SORT_ASC;
                }
                $collapse = function($node, $props) {
                    if (is_array($props)) {
                        foreach ($props as $prop) {
                            $node = (!isset($node-&gt;$prop)) ? null : $node-&gt;$prop;
                        }
                        return $node;
                    } else {
                        return (!isset($node-&gt;$props)) ? null : $node-&gt;$props;
                    }
                };
                $aProp = $collapse($a, $k);
                $bProp = $collapse($b, $k);
                if ($aProp != $bProp) {
                    return ($v == SORT_ASC)
                        ? strnatcasecmp($aProp, $bProp)
                        : strnatcasecmp($bProp, $aProp);
                }
            }
            return 0;
        });
    }
</pre>
<p>Now a few cools things about the function:</p>
<ol>
<li>It uses <a href="http://php.net/manual/en/functions.anonymous.php">anonymous/lambda functions (or closures, whatever your prefer to call them)</a>, and that&#8217;s just plain fun</li>
<li>You can sort on more than one property and because the sorting is recursive, it&#8217;ll sort the second property within the confines of the first, the third within the confines of the second, and so on.  Think sorting in SQL</li>
<li>You can sort in ascending or descending order for any of the properties</li>
<li>It retains key associations so you could use this on an associative array of objects</li>
<li>If the parameter you want to sort on is an array itself then you can use any value (by specifying it&#8217;s key) in that array as the sorting value</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2011/04/08/sorting-an-array-of-objects-by-one-or-more-object-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extend Zend_View_Stream to easily escape view variables</title>
		<link>http://blog.amnuts.com/2010/10/31/easily-escape-view-variables/</link>
		<comments>http://blog.amnuts.com/2010/10/31/easily-escape-view-variables/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 22:14:55 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zend_view_stream]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=207</guid>
		<description><![CDATA[Zend_View_Stream is used pretty much when ever you use Zend_View, and I&#8217;ve blogged about how handy it is before.  But as it&#8217;s a class like any other, you can extend it to give added functionality.  One such use is to add automatic escaping to your view variables when you want.  So instead of doing: You [...]]]></description>
			<content:encoded><![CDATA[<p>Zend_View_Stream is used pretty much when ever you use Zend_View, and <a href="http://blog.amnuts.com/2009/03/24/zend-framework-hidden-gems/">I&#8217;ve blogged about how handy it is before</a>.  But as it&#8217;s a class like any other, you can extend it to give added functionality.  One such use is to add automatic escaping to your view variables when you want.  So instead of doing:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo $this-&gt;escape($this-&gt;var); ?&gt;
&lt;?= $this-&gt;escape($this-&gt;var); ?&gt;
</pre>
<p>You could simply do:</p>
<pre class="brush: php; title: ; notranslate">&lt;?=~ $this-&gt;var; ?&gt;</pre>
<p>That&#8217;s a lot simpler, isn&#8217;t it?<br />
<span id="more-207"></span><br />
To do this, we need to do two things; 1) extend the stream class and 2) make sure we register it before Zend Framework registers Zend_View_Stream.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class My_Stream extends Zend_View_Stream
{
    /**
     * Opens the script file and converts markup.
     */
    public function stream_open($path, $mode, $options, &amp;$opened_path)
    {
        // get the view script source
        $path        = str_replace('zend.view://', '', $path);
        $this-&gt;_data = file_get_contents($path);

        /**
         * If reading the file failed, update our local stat store
         * to reflect the real stat of the file, then return on failure
         */
        if ($this-&gt;_data === false) {
            $this-&gt;_stat = stat($path);
            return false;
        }

        /**
         * Convert &lt;?= ?&gt; to long-form &lt;?php echo ?&gt; and &lt;? ?&gt; to &lt;?php ?&gt;
         *
         */
        $this-&gt;_data = preg_replace(
            '/\&lt;\?\=~ (.*?);? \?&gt;/',
            '&lt;?php echo $this-&gt;escape($1); ?&gt;',
            $this-&gt;_data
        );
        $this-&gt;_data = preg_replace(
            '/\&lt;\?\=/',
            '&lt;?php echo ',
            $this-&gt;_data
        );
        $this-&gt;_data = preg_replace(
            '/&lt;\?(?!xml|php)/s',
            '&lt;?php ',
            $this-&gt;_data
        );

        /**
         * file_get_contents() won't update PHP's stat cache, so we grab a stat
         * of the file to prevent additional reads should the script be
         * requested again, which will make include() happy.
         */
        $this-&gt;_stat = stat($path);

        return true;
    }
}
</pre>
<p>The observant of you will notice that the above is almost exactly the same as Zend_View_Stream::stream_open(), but with this bit of code added to it:</p>
<pre class="brush: php; title: ; notranslate">
        $this-&gt;_data = preg_replace(
            '/\&lt;\?\=~ (.*?);? \?&gt;/',
            '&lt;?php echo $this-&gt;escape($1); ?&gt;',
            $this-&gt;_data
        );
</pre>
<p>So if you don&#8217;t like using ~ to do the escape this is where you&#8217;d change it.</p>
<p>Now all you have to do is register your stream before Zend Framework does.  You could do this in your bootstrap file, your application class, or whereever it makes sense for your applicaiton.  Basically, you&#8217;d just be dropping in a line like this:</p>
<pre class="brush: php; title: ; notranslate">stream_register_wrapper('zend.view', 'My_Stream');</pre>
<p>Hopefully that gives you some ideas on extending the stream wrapper even more!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/10/31/easily-escape-view-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today&#8217;s date is the answer</title>
		<link>http://blog.amnuts.com/2010/10/10/todays-date-is-the-answer/</link>
		<comments>http://blog.amnuts.com/2010/10/10/todays-date-is-the-answer/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 08:15:02 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/2010/10/10/todays-date-is-the-answer/</guid>
		<description><![CDATA[The date today is 10/10/10. 101010 in binary is 42 which is, as we all know, the answer to life the universe and everything in it.]]></description>
			<content:encoded><![CDATA[<p>The date today is 10/10/10.</p>
<p>101010 in binary is 42 which is, as we all know, the answer to life the universe and everything in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/10/10/todays-date-is-the-answer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPNW</title>
		<link>http://blog.amnuts.com/2010/10/09/phpnw/</link>
		<comments>http://blog.amnuts.com/2010/10/09/phpnw/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 18:24:34 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpnw]]></category>
		<category><![CDATA[phpnw10]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/2010/10/09/phpnw/</guid>
		<description><![CDATA[Usually I&#8217;m a total wallflower at conferences, gravitating to only the people I know. This time round I&#8217;m trying to change that and speak to people, ask speakers questions, and all that. Right now, though, I&#8217;m enjoying dinner.]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; margin-right: auto; margin-left: auto;" src="http://blog.amnuts.com/wp-content/uploads/2010/10/wpid-wp-1286648268416.jpg" alt="image" /></p>
<p>Usually I&#8217;m a total wallflower at conferences, gravitating to only the people I know. This time round I&#8217;m trying to change that and speak to people, ask speakers questions, and all that.</p>
<p>Right now, though, I&#8217;m enjoying dinner. <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/10/09/phpnw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPNW Conference 2010</title>
		<link>http://blog.amnuts.com/2010/10/08/phpnw-conference-2010/</link>
		<comments>http://blog.amnuts.com/2010/10/08/phpnw-conference-2010/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 09:38:22 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[phpnw]]></category>
		<category><![CDATA[phpnw10]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=197</guid>
		<description><![CDATA[Going to be travelling to the PHPNW Conference today (it&#8217;s tomorrow, but I don&#8217;t fancy catching the stupidly early train to get there on time), but going over the schedule is a pain&#8230; There are just too many good talks! How can I possibly go see them all?! The 11:15 time slot is easy, that&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Going to be travelling to the PHPNW Conference today (it&#8217;s tomorrow, but I don&#8217;t fancy catching the stupidly early train to get there on time), but going over the schedule is a pain&#8230; There are just too many good talks!  How can I possibly go see them all?!  The 11:15 time slot is easy, that&#8217;ll be <a href="http://conference.phpnw.org.uk/phpnw10/zend-framework-2-0-is-coming">Rob Allen&#8217;s talk on ZF 2</a> &#8211; we use it so much at work now that it&#8217;d be crazy to not find out what&#8217;s coming and how this may affect what we&#8217;re currently doing.  Same with the  <a href="http://conference.phpnw.org.uk/phpnw10/unit-testing-after-zend-framework-1-8">Michelangelo van Dam talk on unit testing with ZF</a>.  But the 12:15, 15:00 and 16:15 talks?  I have no idea what to choose!  <a href="http://conference.phpnw.org.uk/phpnw10/optimizing-zend-framework">Juozas Kaziukena&#8217;s Optimizing Zend Framework</a> might be worth while, but then again, is it all about ZF1 and how much will be relevant for ZF2?  The <a href="http://conference.phpnw.org.uk/phpnw10/practical-hiphop">HipHop talk by Scott McVicar</a> would be interesting. I can&#8217;t see it being deployed at my work, should still be a good talk&#8230; I&#8217;m liking the sound of the <a href="http://conference.phpnw.org.uk/phpnw10/database-version-control-without-pain">Database version control without pain by Harrie Verveer</a> as well!  And that still leaves me with two other time slots to decide on&#8230; Sheesh!</p>
<p>The agony of choice, eh? <img src='http://blog.amnuts.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amnuts.com/2010/10/08/phpnw-conference-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping Zend Studio&#8217;s version of Zend Framework in sync with Zend Server CE (on Windows)</title>
		<link>http://blog.amnuts.com/2010/09/30/keeping-zend-studios-version-of-zend-framework-in-sync-with-zend-server-ce-on-windows/</link>
		<comments>http://blog.amnuts.com/2010/09/30/keeping-zend-studios-version-of-zend-framework-in-sync-with-zend-server-ce-on-windows/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 22:19:33 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[symlink]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Server CE]]></category>
		<category><![CDATA[Zend Studio]]></category>

		<guid isPermaLink="false">http://blog.amnuts.com/?p=187</guid>
		<description><![CDATA[Today I updated my install Zend Server CE.  I have to say that the ease of installing PHP, Apache and MySQL with Zend Server CE is amazing, and then configuring PHP&#8217;s extensions and directives with the provided interface is simply a dream!  (Really wish I could afford the full Zend Server, but that&#8217;s another matter&#8230;) [...]]]></description>
			<content:encoded><![CDATA[<p>Today I updated my install Zend Server CE.  I have to say that the ease of installing PHP, Apache and MySQL with Zend Server CE is amazing, and then configuring PHP&#8217;s extensions and directives with the provided interface is simply a dream!  (Really wish I could afford the full Zend Server, but that&#8217;s another matter&#8230;)</p>
<p>One thing that irked me, though, was that now my Zend Studio&#8217;s version of Zend Framework was different.  That doesn&#8217;t seem like a big problem, but I use the include path for my projects and always have ZF on there, which allows me to take advantage of the auto complete and so on.</p>
<p>My first thought was to use a symbolic link to point form the Studio&#8217;s folder to the Server CE folder&#8230;  But wait, I&#8217;m using Windows 7 &#8211; surely something as handy as a symbolic link can only be used on Linux machines?  I can understand why you&#8217;d think that, but did you know that you can create symlinks on Windows as of Vista?  Oh yes, you read correctly, my friend!  The command to do that is:</p>
<pre class="brush: powershell;">mklink /D \Path\To\SymLink \Path\To\Original</pre>
<p>So for me, it was a case of doing:</p>
<pre class="brush: powershell;">mklink /D "ZendFramework-1" "C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework"</pre>
<p>from within my Zend Studio folder, which happened to be:</p>
<pre class="brush: powershell;">C:\Program Files (x86)\Zend\Zend Studio - 7.1.1\plugins\org.zend.php.framework.resource_7.2.0.v20100324-1300\resources</pre>
<p>I rebuilt my projects and lo-and-behold, a new version of ZF for my projects, and one that&#8217;ll always match with what Zend Server CE thinks I&#8217;m using. <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/09/30/keeping-zend-studios-version-of-zend-framework-in-sync-with-zend-server-ce-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 [...]]]></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;<br />
<span id="more-183"></span><br />
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>
	</channel>
</rss>

