<?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>Zapper&#039;s Brain Dump</title>
	<atom:link href="http://zapper.hodgers.com/blogg/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://zapper.hodgers.com/blogg</link>
	<description>random musing and thoughts</description>
	<lastBuildDate>Wed, 29 Jun 2011 00:05:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Been a while since i did something really silly&#8230;</title>
		<link>http://zapper.hodgers.com/blogg/?p=284</link>
		<comments>http://zapper.hodgers.com/blogg/?p=284#comments</comments>
		<pubDate>Wed, 29 Jun 2011 00:05:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=284</guid>
		<description><![CDATA[So i&#8217;ve left my perm BBC job I&#8217;m now contract for youview. Let&#8217;s have fun&#8230; Who needs medical insurance, it&#8217;s been a while since i took apart a laptop, nearly set fire to a house or electrocuted myself, don&#8217;t worry I&#8217;m hardy. Meet Caliban v2. My first project for a while. I&#8217;m going to turn [...]]]></description>
				<content:encoded><![CDATA[<p>So i&#8217;ve left my perm BBC job</p>
<p>I&#8217;m now contract for youview.</p>
<p>Let&#8217;s have fun&#8230;</p>
<p>Who needs medical insurance, it&#8217;s been a while since i took apart a laptop, nearly set fire to a house or electrocuted myself, don&#8217;t worry I&#8217;m hardy.</p>
<div class="mceTemp">
<dl id="attachment_285" class="wp-caption alignnone" style="width: 650px;">
<dt class="wp-caption-dt"><a href="http://zapper.hodgers.com/blogg/wp-content/uploads/2011/06/Photo-6.jpg"><img class="size-full wp-image-285" title="Calban v2" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2011/06/Photo-6.jpg" alt="Fat man and his semi working £40 laptop, effectively blade since the screen doesn't work ish" width="640" height="480" /></a></dt>
</dl>
</div>
<p>Meet Caliban v2. My first project for a while.</p>
<div class="mceTemp">
<dl id="attachment_285" class="wp-caption alignnone" style="width: 650px;">
<dd class="wp-caption-dd">I&#8217;m going to turn you into a robot&#8230;.honest</dd>
</dl>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=284</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP : Hamcress + PHP 5.2 and the amesoweness</title>
		<link>http://zapper.hodgers.com/blogg/?p=277</link>
		<comments>http://zapper.hodgers.com/blogg/?p=277#comments</comments>
		<pubDate>Wed, 20 Apr 2011 14:11:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=277</guid>
		<description><![CDATA[First off Hamcress is brilliant and amazing, anyone doing TDD download it now, never use &#8220;assertEquals&#8221; ever again! The range of matchers and stuff, strongly recommend it to everyone it seems fabby Matchers! (from wiki) Core anything &#8211; always matches, useful if you don&#8217;t care what the object under test is describedAs &#8211; decorator to [...]]]></description>
				<content:encoded><![CDATA[<p>First off Hamcress is brilliant and amazing, anyone doing TDD download it now, never use &#8220;<em>assertEquals</em>&#8221; ever again!</p>
<p>The range of matchers and stuff, strongly recommend it to everyone it seems fabby</p>
<p><span id="more-277"></span></p>
<p>Matchers! (from wiki)</p>
<ul>
<li>Core
<ul>
<li><tt>anything</tt> &#8211; always matches, useful if you don&#8217;t care what the object under test is</li>
<li><tt>describedAs</tt> &#8211; decorator to adding custom failure description</li>
<li><tt>is</tt> &#8211; decorator to improve readability &#8211; see &#8220;Sugar&#8221;, above</li>
</ul>
</li>
<li>Logical
<ul>
<li><tt>allOf</tt> &#8211; matches if all matchers match, short circuits (like PHP <tt>&amp;&amp;</tt>)</li>
<li><tt>anyOf</tt> &#8211; matches if any matchers match, short circuits (like PHP <tt>||</tt>)</li>
<li><tt>not</tt> &#8211; matches if the wrapped matcher doesn&#8217;t match and vice versa</li>
</ul>
</li>
<li>Object
<ul>
<li><tt>equalTo</tt> &#8211; test object equality using the <tt>==</tt> operator</li>
<li><tt>anInstanceOf</tt> &#8211; test type</li>
<li><tt>notNullValue</tt>, <tt>nullValue</tt> &#8211; test for null</li>
<li><tt>sameInstance</tt> &#8211; test object identity using the <tt>===</tt> operator</li>
<li><tt>identicalTo</tt> &#8211; alias of <tt>sameInstance</tt>, but with similar semantics to <tt>equalTo</tt></li>
</ul>
</li>
<li>Number
<ul>
<li><tt>closeTo</tt> &#8211; test floating point values are close to a given value</li>
<li><tt>greaterThan</tt>, <tt>greaterThanOrEqualTo</tt>, <tt>lessThan</tt>, <tt>lessThanOrEqualTo</tt> &#8211; test ordering</li>
</ul>
</li>
<li>Collections
<ul>
<li><tt>hasItem</tt>, <tt>hasItems</tt> &#8211; test if an array contains one or more items</li>
</ul>
</li>
<li>Text
<ul>
<li><tt>equalToIgnoringCase</tt> &#8211; test string equality ignoring case</li>
<li><tt>equalToIgnoringWhiteSpace</tt> &#8211; test string equality ignoring differences in runs of whitespace</li>
<li><tt>containsString</tt>, <tt>endsWith</tt>, <tt>startsWith</tt> &#8211; test string matching</li>
</ul>
</li>
<li>Combinations
<ul>
<li><tt>both</tt> and <tt>either</tt>, for example:
<ul>
<li><tt>both(startsWith('a'))-&gt;andAlso(endsWith('b'))</tt></li>
<li><tt>either(startsWith('x'))-&gt;orElse(endsWith('y'))</tt></li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Sugar!</p>
<p>pretty is(&#8230;) and stuff that make stuff easier, call the same &#8220;is&#8221; &#8220;equalTo&#8221; matchers nesting them for readablity.</p>
<p>Here’s my first very simple hamcress test :-</p>
<p>before</p>
<pre class="brush: php">$this-&gt;assertEquals($this-&gt;class-&gt;getGid(), $expectedGid, "Game Gid got back from migitation game is wrong");</pre>
<p>after</p>
<pre class="brush: php">assertThat($this-&gt;class-&gt;getGid(), equalTo($expectedGid), "Game Gid got back from migitation game is wrong");</pre>
<p>Sooo soo much more readable!<br />
My only complaint is the  &#8220;Game Gid got back from migitation game is wrong&#8221; message isn&#8217;t called, without wrapping the matcher in a custom matchers which is a bit class verbose</p>
<h2>Gotta 1!</h2>
<p>download the 0.1.0 version if your on php 5.2, the 0.2.0 and 0.3.0 versions only work with 5.3 (that i could see at least)</p>
<p>http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-php-0.1.0.tgz</p>
<p>(0.2.0 / 0.3.0 weren&#8217;t compatible with PHP 5.2 because of the <a href="http://www.php.net/manual/en/language.oop5.late-static-bindings.php">static late binding</a> all over the place)</p>
<h2>Gotta 2!</h2>
<p>the class has changed since the tutorial! it&#8217;s &#8216;Hamcrest/hamcrest.php&#8217;</p>
<pre class="brush: php">&lt;?php
require_once 'PHPUnit/Framework.php';
require_once 'Hamcrest/hamcrest.php';

class Somedomain_Test_PHPUnit_ExtendedControllerTestCase extends BBC_Test_PHPUnit_ControllerTestCase {
...
}</pre>
<h2>Gotta 3!</h2>
<p>php unit has a assert that too!</p>
<pre class="brush: php">public function testHamcressAssertThat()
{
assertThat(true, equalTo(true));
}
public function testHamcressNotAssertThat()
{
assertThat(true, equalTo(false));
}
public function testPHPUnitAssertThat()
{
$this-&gt;assertThat(true, equalTo(true));
}
public function testPHPUnitNotAssertThat()
{
$this-&gt;assertThat(true, equalTo(false));
}</pre>
<p>http://code.google.com/p/hamcrest/wiki/TutorialPHP</p>
<p>http://code.google.com/p/hamcrest/wiki/UsesOfHamcrest</p>
<p>Additonally here&#8217;s some Zend asserts for controllers I use, basically I just want to test the routing works or not, it&#8217;s a single failure for me not a action/module or status code error, there all pre-hamcress inventions, and some of teh code has been stolen from many great folks i&#8217;ve worked with over the last few years, thank you all of you</p>
<pre class="brush: php">&lt; ? php 

require_once 'PHPUnit/Framework.php'; 
require_once 'Hamcrest/hamcrest.php'; 

abstract class Somedomain_Test_PHPUnit_ExtendedControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase {     

public function setUp() {       
parent::setUp();       
// MOCKING STARTS HERE       
// Unfortunately this won't be output first if the derived class does log(...); setUp();      
 // LOGGER_CLASS::info('BEGIN Test: Page - ' . get_class($this));
   }

   public function tearDown() {

      parent::tearDown();
      // UNMOCKING STARTS HERE

      // Unfortunately this won't be output last if the derived class does tearDown(); log(...);
      // LOGGER_CLASS::info('END Test: Page - ' . get_class($this));
   }

   /**
    * allows asserting if correct modulie/controller/action and http status code of controller response is correct
    * @param string expected module
    * @param string expected controller
    * @param string expected action
    * @param string expected http code
    * @param [optional] string - messages to add onto unit test fail
    *
    * $this-&gt;assertRouteDispatch('errorhandler', 'error', 'error', 500);
    */
   public function assertRouteDispatch ($assertedModule, $assertedController, $assertedAction, $httpCode, $message = "") {

      $routeStatus = " (module/controller/action)"
         . ":got(" . $this-&gt;getRequest()-&gt;getModuleName()
         . "/" . $this-&gt;getRequest()-&gt;getControllerName()
         . "/" . $this-&gt;getRequest()-&gt;getActionName()
         . ":HTTP)"
         . ":wanted(" . $assertedModule . "/" . $assertedController . "/" . $assertedAction . ":".$httpCode.") "
         . "\n Page Body [don't worry it will look messy and long, body dumps normally are] : \n" . $this-&gt;getResponse()-&gt;getBody();

      $this-&gt;assertModule($assertedModule, 'Incorrect module used ' . $message . $routeStatus);
      $this-&gt;assertController($assertedController, 'Incorrect controller used '.$message . $routeStatus);
      $this-&gt;assertAction($assertedAction, 'Incorrect action used '.$message . $routeStatus);
      $this-&gt;assertResponseCode($httpCode, 'Response Code Incorrect got '.$message . $routeStatus);
   }

   /**
    * allows asserting if content type header of controller response correct
    * @param string content header to contain, eg 'Content-Type: application/json'
    * @param [optional] string - messages to add onto unit test fail
    */
   public function assertContentTypeHeader($contentType, $message = "") {

      $repsonseHeaders = $this-&gt;__getKeyedArrayOfResponseHeaders();
      $this-&gt;assertEquals($repsonseHeaders["content-type"], $contentType, "response content type header not expected".$message);
   }

   /**
    * allows asserting if body is valid json
    * @param [optional] string - messages to add onto unit test fail
    */
   public function assertContentBodyValidJson($message = "") {

      $json = json_decode($this-&gt;getResponse()-&gt;getBody());
      $this-&gt;assertNotNull($json, "Http Response Body Response is not valid JSON: " . $this-&gt;getResponse()-&gt;getBody() . $message);
   }

   /**
    * allows asserting if body is valid xml
    REQUIRES UTILS
   public function assertContentBodyValidXml() {

      try {
         $success = true;
         $repsonseHeaders = BBC_Cbbc_Util::stringToSimpleXml($this-&gt;getResponse()-&gt;getBody(), "unittest_create_xml");
      } catch (Exception $e) {
         $success = false;
      }

      $this-&gt;assertTrue($success, "Http Response Body is not valid XML: " . $this-&gt;getResponse()-&gt;getBody());
   }*/

	/**
	 * Version of assertModule() with better error reporting.
	 *
	 * @param string $expected expected module
	 */

	public function assertModule($expected, $m = "") {
		$actual = $this-&gt;getRequest()-&gt;getModuleName();
		$message = "Expected module [$expected], got module [$actual]";
		if (!empty($m)) {
			$message .= ": $m";
		}
		parent::assertModule($expected, $message);
	}

	/**
	 * Version of assertController() with better error reporting.
	 *
	 * @param string $expected expected controller
	 */

	public function assertController($expected, $m = "") {
		$actual = $this-&gt;getRequest()-&gt;getControllerName();
		$message = "Expected controller [$expected], got controller [$actual]";
		if (!empty($m)) {
			$message .= ": $m";
		}
		parent::assertController($expected, $message);
	}

	/**
	 * Version of assertAction() with better error reporting.
	 *
	 * @param string $expected expected action
	 */

	public function assertAction($expected, $m = "") {
		$actual = $this-&gt;getRequest()-&gt;getActionName();
		$message = "Expected action [$expected], got action [$actual]";
		if (!empty($m)) {
			$message .= ": $m";
		}
		parent::assertAction($expected, $message);
	}

   private function __getKeyedArrayOfResponseHeaders()
   {
      $keyHeaders = array();
      $rawHeaders = $this-&gt;getResponse()-&gt;getHeaders();
      foreach ($rawHeaders as $header) {
         $name = $header['name'];
         $key  = strtolower($name);
         if (array_key_exists($name, $keyHeaders)) {
            if ($header['replace']) {
               $keyHeaders[$key] = $header['name'] . ': ' . $header['value'];
            }
         } else {
            $keyHeaders[$key] = $header['name'] . ': ' . $header['value'];
         }
      }
      return $keyHeaders;
   }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=277</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>microsoft testdrive : the amazing developer tool : IE firebug on Steroids</title>
		<link>http://zapper.hodgers.com/blogg/?p=271</link>
		<comments>http://zapper.hodgers.com/blogg/?p=271#comments</comments>
		<pubDate>Tue, 19 Apr 2011 17:25:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=271</guid>
		<description><![CDATA[http://ie.microsoft.com/testdrive/ Frankly it not only equals the now aged firebug, it surpasses it. Microsoft welcome back from the widerness, now if you could only backdoor force upgrade all IE6 users out there, all sins would be forgiven. No more messing with lots of vms and non-sense, we developers can now properly test IE9 and IE [...]]]></description>
				<content:encoded><![CDATA[<p><a title="microsoft test drive (aka IE firebug on steriods)" href="http://ie.microsoft.com/testdrive/"><img class="alignnone size-full wp-image-272" title="The microsoft testdrive software" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2011/04/profiler.jpg" alt="image of the microsoft testdrive in profiler mode" width="520" height="396" /><br />
</a></p>
<p><a title="microsoft test drive (aka IE firebug on steriods)" href="http://ie.microsoft.com/testdrive/">http://ie.microsoft.com/testdrive/</a></p>
<p>Frankly it not only equals the now aged firebug, it surpasses it.</p>
<p>Microsoft welcome back from the widerness, now if you could only backdoor<br />
force upgrade all IE6 users out there, all sins would be forgiven.</p>
<p><span id="more-271"></span>No more messing with lots of <a title="microsoft standard vms" href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21eabb90-958f-4b64-b5f1-73d0a413c8ef&amp;displaylang=en">vms and non-sense</a>, we developers can now properly test IE9 and IE 10!!!</p>
<p>(ps sorry yes i know cbeebies and cbbc are both launched now and use glow, and glow hasn&#8217;t been updated for ages, and glow doesn&#8217;t work in IE9/10, BBC boffins are on the case)</p>
<p>Only negative vista/windows 7 only, but another good reason for me to make<br />
the big switch back from Mac (just as soon as i&#8217;ve saved enough dough)</p>
<p>Allows really indepth testing of ie 7/8/9/10,</p>
<p>Tools:<br />
console with breakpoints,</p>
<p>tracing (aka console.log),</p>
<p>full js function call profiling,</p>
<p>dom inspection / rewriting aka firebug,</p>
<p>css editing,</p>
<p>And it&#8217;s unmicrosoftly brillant in UX and functionality,</p>
<p>Ant</p>
<p>in other news testing testing test :-</p>
<pre class="brush: as3; title: ; notranslate">
var formattedCode = new Hello.World();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=271</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2008 -&gt; AI Bots Experiments (Revisited in AS3)</title>
		<link>http://zapper.hodgers.com/blogg/?p=264</link>
		<comments>http://zapper.hodgers.com/blogg/?p=264#comments</comments>
		<pubDate>Tue, 19 Apr 2011 17:07:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=264</guid>
		<description><![CDATA[Ah&#8230;. to be 25 again&#8230; me at 25 =&#62; As stated in the last post, i&#8217;ve finally finished the T in the Park Channel T flash application, which any second should be going live&#8230; any second&#8230; any second at all It was a great project working with good friends and collegues, learning the wonders of [...]]]></description>
				<content:encoded><![CDATA[<p>Ah&#8230;. to be 25 again&#8230; me at 25 =&gt;</p>
<p>As stated in the last post, i&#8217;ve finally finished the T in the Park  Channel T flash application, which any second should be going live&#8230;  any second&#8230; any second at all</p>
<p>It was a great project working with good friends and collegues,  learning the wonders of away3D, flcikr, swfAddress, and all those nice  wee quirks of the flash IDE</p>
<p>One fo my afvourate features unfortunately not ready for release was  the bot crowd, the idea was these would wander around in a 3d  environment, surrounded by the various music stages of T in the Park,  when you rolled over the stage the little bots would swarm towards it, a  nice cute effect.</p>
<p>I got pretty close but ultimately what works well for animals,  fishes, and mircobes is really hard to get realistic for thinking  wandering humans, and with the deadline looming that was that</p>
<p><a href="http://zapper.hodgers.com/files/as3/ai_bots_as3/crowd_exp_1.html">simple as3 bots</a></p>
<p><a href="http://zapper.hodgers.com/files/as3/ai_bots_as3/crowd_exp_2.html">slightly more complex as3 bots</a></p>
<p><a href="http://zapper.hodgers.com/files/as3/ai_bots_as3/crowd_experiment_app.html">even more complex as3 in 3d pretendign to be humans badly</a></p>
<p><a href="http://zapper.hodgers.com/files/as3/ai_bots_as3/agent_bots_as3.zip">source</a></p>
<p><a href="http://zapper.hodgers.com/labs/?p=23">link to AS2 bots</a></p>
<p>Ps</p>
<p>I&#8217;ve now made it a promise to myself to give flex a try</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=264</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging Bloggs!</title>
		<link>http://zapper.hodgers.com/blogg/?p=256</link>
		<comments>http://zapper.hodgers.com/blogg/?p=256#comments</comments>
		<pubDate>Sun, 17 Apr 2011 19:44:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[htaccess]]></category>
		<category><![CDATA[blogg]]></category>
		<category><![CDATA[labs]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[new blogg]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=256</guid>
		<description><![CDATA[Code labs is dead Long live the Blogg I&#8217;m merged my labs and blogg blogs together, frankly it was become way too much hassle for something i hardly update &#160; thanks to mark for his use a different user post For those wanting to do the same and redirect not lose too much seo/help users, [...]]]></description>
				<content:encoded><![CDATA[<p>Code labs is dead</p>
<p>Long live the Blogg</p>
<p><a href="http://zapper.hodgers.com/blogg/wp-content/uploads/2011/04/code_to_blogg.jpg"><img class="alignnone size-full wp-image-259" title="code_to_blogg" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2011/04/code_to_blogg.jpg" alt="Code Labs is now Blogg" width="400" height="253" /></a></p>
<p>I&#8217;m merged my labs and blogg blogs together, frankly it was become way too much hassle for something i hardly update</p>
<p>&nbsp;</p>
<p>thanks to mark for his use a <a href="http://markjaquith.wordpress.com/2009/01/14/tip-for-merging-two-wordpress-blogs/">different user post</a></p>
<p>For those wanting to do the same and redirect not lose too much seo/help users, here&#8217;s a quick htaccess snippet for you,</p>
<p>create a file in your old directory for me it was /labs, and create a file called .htaccess</p>
<p>{code}</p>
<p>RewriteEngine On<br />
# redirect to new blog<br />
RewriteRule ^(.*)$ /blogg/$1 [R=301,L]</p>
<p>{code}</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=256</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Mac OS X Automatically Take Screenshots</title>
		<link>http://zapper.hodgers.com/blogg/?p=255</link>
		<comments>http://zapper.hodgers.com/blogg/?p=255#comments</comments>
		<pubDate>Wed, 10 Nov 2010 12:04:54 +0000</pubDate>
		<dc:creator>Old Code Blogg</dc:creator>
				<category><![CDATA[BAT]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dimitar]]></category>
		<category><![CDATA[james]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[screencapture]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/labs/?p=176</guid>
		<description><![CDATA[Had a bit of an issue, thought it was worth a post, first in a while&#8230; howto make mac osx automatically take timed screenshots every X seconds with a simple bash script For programmers, open terminal for i in {1..9999}; do echo &#8220;taking screen shot $i&#8221;; screencapture -x &#8220;helloworld$i.png&#8221;; sleep 1; done For Editorial Open [...]]]></description>
				<content:encoded><![CDATA[<p>Had a bit of an issue, thought it was worth a post, first in a while&#8230;</p>
<p>howto make mac osx automatically take timed screenshots every X seconds with a simple bash script</p>
<p><span id="more-255"></span></p>
<p>For programmers, open terminal</p>
<blockquote><p><span style="font-family: Arial;">for i in {1..9999}; do echo &#8220;taking screen shot $i&#8221;; screencapture -x &#8220;helloworld$i.png&#8221;; sleep 1; done</span></p></blockquote>
<p>For Editorial</p>
<p>Open Terminal</p>
<ol>
<li>Open finder</li>
<li>go to the &#8220;Applications&#8221; Folder</li>
<li>go inside the &#8220;Utilities&#8221; Folder</li>
<li>run the &#8220;Terminal&#8221; application</li>
</ol>
<p>Run the wee script which does the magic</p>
<ol>
<li>Go to the &#8220;Terminal&#8221; application</li>
<li>type &#8220;cd&#8221;</li>
<li>type a space</li>
<li>Go to finder,</li>
<li>open a folder you what the screen captures to happen in</li>
<li>drag the icon of the folder into the &#8220;Terminal&#8221; application (this should make some text appear in the Terminal app like /Data/Applications or something)</li>
<li>Go back to the &#8220;Terminal&#8221; application</li>
<li>type return</li>
<li>type <span style="font-family: Arial;">&#8216;for i in {1..9999}; do echo &#8220;taking screen shot $i&#8221;; screencapture -x &#8220;helloworld$i.png&#8221;; sleep 1; done</span>&#8216; exact character for character or copy and paste</li>
<li>type return</li>
<li>{at this point the computer should be taking screen shot every second}</li>
<li>Do stuff, what ever you want to capture</li>
<li>When you want to stop the capturing, simply quite &#8220;Terminal&#8221; the way you normally would</li>
</ol>
<p>Improvements</p>
<ul>
<li><span style="font-family: Arial;">sleep 1, controls the time between captures, so sleep 60 would take a capture every minute</span></li>
<li><span style="font-family: Arial;">{1..9999}, controls the amount of time, that means after 9999 loops it stops</span></li>
</ul>
<p>my good friend dimitar has suggested a better loop which never stops unless stopped by the user</p>
<blockquote><p><span style="font-family: Arial;">#! /usr/bin/env bash</p>
<p></span><span style="font-family: Calibri,Verdana,Helvetica,Arial;"></p>
<p></span><span style="font-family: Arial;">i=0</p>
<p></span><span style="font-family: Calibri,Verdana,Helvetica,Arial;"></p>
<p></span><span style="font-family: Arial;">while 1</p>
<p>do</p>
<p>((i++))</p>
<p>screencapture -T 1 &#8220;capture$i.jpg&#8221;</p>
<p>done</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=255</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Silly silly politi</title>
		<link>http://zapper.hodgers.com/blogg/?p=143</link>
		<comments>http://zapper.hodgers.com/blogg/?p=143#comments</comments>
		<pubDate>Fri, 23 Apr 2010 09:51:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[Brown]]></category>
		<category><![CDATA[Cameron]]></category>
		<category><![CDATA[Clegg]]></category>
		<category><![CDATA[Conversitive]]></category>
		<category><![CDATA[Google Ads]]></category>
		<category><![CDATA[Labour]]></category>
		<category><![CDATA[Lib Dem]]></category>
		<category><![CDATA[Silly Silly Silly]]></category>
		<category><![CDATA[Waste of money]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=143</guid>
		<description><![CDATA[Google Search String]]></description>
				<content:encoded><![CDATA[<div id="attachment_144" class="wp-caption alignnone" style="width: 410px"><a href="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/04/leaders_are_silly.jpg"><img class="size-full wp-image-144" title="leaders_are_silly" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/04/leaders_are_silly.jpg" alt="" width="400" height="270" /></a><p class="wp-caption-text">Leaders are silly, as always brown is a tad behind</p></div>
<p><a href="http://www.google.co.uk/search?q=leader+debate&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a">Google Search String</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=143</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating JSLint over a bunch of files in a folder (on the Commandline)</title>
		<link>http://zapper.hodgers.com/blogg/?p=253</link>
		<comments>http://zapper.hodgers.com/blogg/?p=253#comments</comments>
		<pubDate>Thu, 22 Apr 2010 13:18:51 +0000</pubDate>
		<dc:creator>Old Code Blogg</dc:creator>
				<category><![CDATA[bbc]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[auotmation]]></category>
		<category><![CDATA[automating]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[js-devel]]></category>
		<category><![CDATA[jslint]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/labs/?p=169</guid>
		<description><![CDATA[For what ever reason I decided I&#8217;m doing too much js to not being using the Excellent JSLint as such I&#8217;ve decided it&#8217;s time to use it in anger, no more bespoke copy and pasting, automated stylee, here how to do it $bash &#8211; ./scripts/jslintchecker.sh iplayer/ report.txt scripts/jslint.js Files here -&#62; JSLINT AUTOMATOR_SHELL_SCRIPT ZIP HERE [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_170" class="wp-caption alignnone" style="width: 310px"><a href="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/04/Fatman_Dancing11.jpg"><img class="size-medium wp-image-170" title="Fatman_Dancing" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/04/Fatman_Dancing1-300x188.jpg" alt="" width="300" height="188" /></a><p class="wp-caption-text">Hangover&#39;s suck</p></div>
<p>For what ever reason I decided I&#8217;m doing too much js to not being using the Excellent <a href="http://www.jslint.com/">JSLint</a> as such I&#8217;ve decided it&#8217;s time to use it in anger, no more bespoke copy and pasting, automated stylee, here how to do it</p>
<p>$bash &#8211; ./scripts/jslintchecker.sh iplayer/ report.txt   scripts/jslint.js</p>
<p>Files here -&gt;</p>
<p><a href="../../files/javascript/jslint_automator/jslintchecker_automator.zip">JSLINT AUTOMATOR_SHELL_SCRIPT ZIP HERE</a></p>
<p><em>update 4th May &#8211; fix script for absolute paths agruments</em></p>
<p><span id="more-253"></span>Basic solution -&gt;</p>
<p>Shell script Grabs files gives them to running JSLint on <a href="http://www.mozilla.org/js/spidermonkey/">spidermonkey</a></p>
<p>Core bash command is</p>
<blockquote><p>$bash &#8211; find . -name *.js </p>
<p>-exec sh -c &#8216;</p>
<p>cat $1 | jslint.js;&#8217; {} {} </p>
<p>&gt; report.txt ;</p></blockquote>
<p>So broken down thats</p>
<blockquote><p>$bash &#8211; find . -name *.js # get all the js files in . folder</p>
<p>-exec sh -c &#8216;echo $1&#8242; {} {} # run a shell command with the js file as the $1 variable</p>
<p>echo -e &#8220;B:AH&#8221;# print some nice stuff</p>
<p>cat $1 | jslint.js; # pipe the file $1 = /balh/balh,js, into jslint pass on the stdOut from that</p>
<p>&gt; report.txt ; # chuck in a file called report.txt</p></blockquote>
<p>Steps -&gt;</p>
<p>1. Install Spidermonkey</p>
<p>linux command I used</p>
<blockquote><p>$bash &#8211; yum clean all;</p>
<p>$bash &#8211; yum &#8211;noplugins install js-devel</p></blockquote>
<p>more <a href="http://wiki.apache.org/couchdb/Installing_SpiderMonkey">helpful instructions found here</a></p>
<p>2. Copy and unzip .sh/.js script files</p>
<p><a href="http://zapper.hodgers.com/files/javascript/jslint_automator/jslintchecker_automator.zip">DOWNLOAD ZIP HERE</a></p>
<p>js file from this <a href="http://whereisandy.com/code/jslint/">excellent blog</a> on the matter, and <a href="http://www.compuspec.net/reference/os/solaris/find/find_and_execute_with_pipe.shtml">this guy</a> cheers to him for writing an excellent post of using pipes within find exec commands,cheers you guys are the best</p>
<p>3. Chmod jslintchecker.sh and jslint.js so they execute, incase the zip file breaks it</p>
<blockquote><p>$bash &#8211; chmod 777 jslintchecker.sh</p>
<p>$bash &#8211; chmod 777 jslint.js</p></blockquote>
<p>4. Run jslintchecker.sh on the folder you wanta jslint check</p>
<blockquote><p>USEAGE jslintchecker.sh &lt;JS_FOLDER&gt; &lt;REPORT_FILE_NAME&gt; &lt;JSLINT_LOCATION&gt;</p>
<p>$bash &#8211; ./scripts/jslintchecker.sh iplayer/ report.txt scripts/jslint.js</p></blockquote>
<p>Zap</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=253</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PNG 24 to PNG 8 conversion without fireworks&#8230;. == pain</title>
		<link>http://zapper.hodgers.com/blogg/?p=247</link>
		<comments>http://zapper.hodgers.com/blogg/?p=247#comments</comments>
		<pubDate>Thu, 11 Mar 2010 10:10:49 +0000</pubDate>
		<dc:creator>Old Code Blogg</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie6 png8 non-hack]]></category>
		<category><![CDATA[imagemagick is very hard to install and lies]]></category>
		<category><![CDATA[png8]]></category>
		<category><![CDATA[pngcrush is nearly perfect if only it didn't lie occational]]></category>
		<category><![CDATA[pngopti is easy to install but hard to control]]></category>
		<category><![CDATA[pngout is honest and easy but a bit simple]]></category>
		<category><![CDATA[pngquant is a one trick pony but what a trick]]></category>
		<category><![CDATA[progressive enhancement]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/labs/?p=154</guid>
		<description><![CDATA[Here are the instructions how to convert png24 images into png8 for ie6 goodiness, all through the commandline using open source tools (i think) pngquant +pngout + pngcrush firefox &#38; transparent PNG 8 &#38; gradient background =  IE6 &#38; transparent PNG 8 &#38; gradient background =  updated removed full images as there sensitive First off&#8230; [...]]]></description>
				<content:encoded><![CDATA[<p>Here are the instructions how to convert png24 images into png8 for ie6 goodiness,</p>
<p>all through the commandline using open source tools (i think)</p>
<p><a href="http://www.libpng.org/pub/png/apps/pngquant.html">pngquant</a> +<a href="http://go2.wordpress.com/?id=725X1342&amp;site=porteightyeight.wordpress.com&amp;url=http%3A%2F%2Fadvsys.net%2Fken%2Futils.htm">pngout</a> + <a href="http://pmt.sourceforge.net/pngcrush/">pngcrush </a></p>
<p>firefox &amp; transparent PNG 8 &amp; gradient background = <img class="alignnone size-full wp-image-163" title="firefox3 + PNG8" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/firefox3_mac22.png" alt="firefox3 + PNG8" width="23" height="102" /></p>
<p>IE6 &amp; transparent PNG 8 &amp; gradient background = <img class="alignnone size-full wp-image-164" title="IE6 + PNG8" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/ie6_xp111.png" alt="IE6 + PNG8" width="22" height="110" /></p>
<p><em>updated removed full images as there sensitive</em></p>
<p><span id="more-247"></span></p>
<p>First off&#8230;</p>
<p><strong>Failures</strong></p>
<p>Tried imagemagick it turns transparency into a bit mask&#8230;.</p>
<p>Tried pngopti, it&#8217;s a black box that doesn&#8217;t tell you what it&#8217;s doing</p>
<p>Tried pngcrush, it lies when converting to 8 bit png&#8217;s and doesn&#8217;t do this if the pallette&#8217;s over 256 colours</p>
<p>Tried pngout, it does well but fails when the pallette isn&#8217;t smaller 257 colours</p>
<p>Now the good part</p>
<p><strong>Solution</strong></p>
<p>Solution a combination of tools</p>
<p><em>s</em><em>tep one</em></p>
<p>-&gt; quantise image into 256 (so basically png8&#8242;s look crap with large sprites or sprites with a large colour range)</p>
<p>I used <a href="http://www.libpng.org/pub/png/apps/pngquant.html">pngquant </a></p>
<blockquote><p>$bash -</p>
<p>pngquant 256 some_24_bit.png</p></blockquote>
<p><em>step two</em></p>
<p>-&gt; convert image form a png24 to a png8 (many tools claim to do this, many tools lie&#8230; or fail unexpectedly pngcrush! I trusted you)</p>
<p>I used <a href="http://go2.wordpress.com/?id=725X1342&amp;site=porteightyeight.wordpress.com&amp;url=http%3A%2F%2Fadvsys.net%2Fken%2Futils.htm">pngout</a> got the linux executable here <a href="http://www.jonof.id.au/kenutils">pngout-static</a> from this <a href="http://porteightyeight.com/2009/07/20/batch-conversion-of-png32-images-to-png8/">excellent blog</a></p>
<p>(unfortunately if the number of colours in the needed by the image is greater than 256 it fails hence the first step)</p>
<blockquote><p>$bash -</p>
<p>./pngout-static -c3 -d8 -y -force some_24_bit.png some_8_bit.png</p></blockquote>
<p><em>step three (optional)</em></p>
<p>-&gt;compress image for fun and profit <img src='http://zapper.hodgers.com/blogg/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  or simply just bandwidth savings</p>
<p>I used <a href="http://pmt.sourceforge.net/pngcrush/">pngcrush </a></p>
<p>Couldn&#8217;t find linux executable -&gt; compile instructions</p>
<blockquote><p>$bash -</p>
<p>yum &#8211;noplugins gcc-i386</p>
<p>yum &#8211;noplugins xz</p>
<p>xz -d pngcrush-BLAH.tar.xz</p>
<p>tar -xf pngcrush-BLAH.tar</p>
<p>cd pngcrush-B:AH</p>
<p>make install</p>
<p>./pngcrush &#8211;help</p>
<p> <img src='http://zapper.hodgers.com/blogg/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p></blockquote>
<p>here&#8217;s one I made <a href="http://zapper.hodgers.com/files/linux_bin/pngcrush-1.7.9.zip">earlier</a> only tested on the bbc&#8217;s forge sandbox, no promises given, if it doesn&#8217;t work build your own one, instructions above</p>
<p>So compress image using pngcrush</p>
<blockquote><p>$bash -</p>
<p>./pngcrush some_8_bit.png -bit_depth 8 -brute -rem alla -reduce some_8_bit_small.png</p></blockquote>
<p>whola -&gt; png8 with progressively enhanced IE6 transparency</p>
<p>Without fireworks!!! see what you can do with a little locked down machine and a VM <img src='http://zapper.hodgers.com/blogg/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>whoope!!!</p>
<p>and the results&#8230;.</p>
<p>Firefox 3 <span style="text-decoration: line-through;">(beatiful&#8230; ps i cheated slightly and did this screenshot on a mac so the fonts look prettier)</span></p>
<p><img class="alignnone size-full wp-image-163" title="firefox3 + PNG8" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/firefox3_mac22.png" alt="firefox3 + PNG8" width="23" height="102" /></p>
<p>IE 6 (ok it&#8217;s not perfect but the designs really like gradiented backgrounds&#8230; ah to build the thing in flash)</p>
<p><img class="alignnone size-full wp-image-164" title="IE6 + PNG8" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/ie6_xp111.png" alt="IE6 + PNG8" width="22" height="110" /></p>
<p><img class="alignnone size-full wp-image-160" title="PNG 24" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/favourite_icon22.png" alt="PNG 24" width="15" height="35" /> PNG 24</p>
<p><img class="alignnone size-full wp-image-161" title="PNG 8" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2010/03/favourite_icon2111.png" alt="PNG 8" width="15" height="35" /> PNG 8</p>
<p>Zap</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=247</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sparky the Harddisk</title>
		<link>http://zapper.hodgers.com/blogg/?p=133</link>
		<comments>http://zapper.hodgers.com/blogg/?p=133#comments</comments>
		<pubDate>Wed, 08 Jul 2009 20:28:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[cool]]></category>
		<category><![CDATA[broken harddisk]]></category>
		<category><![CDATA[near darwin award]]></category>
		<category><![CDATA[not dead yet]]></category>
		<category><![CDATA[sparky the harddisk]]></category>
		<category><![CDATA[sparky the laptop]]></category>

		<guid isPermaLink="false">http://zapper.hodgers.com/blogg/?p=133</guid>
		<description><![CDATA[Oooops I did it again, many of you have hear the story of the infamious sparky the laptop, the only laptop in history to have almost committed a darwin award on it&#8217;s owner, Well today I created the sparking hard disk, basically my hard disk broke nearly immediate the second I move to London, damn [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://zapper.hodgers.com/blogg/wp-content/uploads/2009/07/sparky_the_harddisk.jpg"><img class="alignnone size-full wp-image-134" title="sparky the harddisk" src="http://zapper.hodgers.com/blogg/wp-content/uploads/2009/07/sparky_the_harddisk.jpg" alt="" width="500" height="378" /></a></p>
<p>Oooops I did it again, many of you have hear the story of the infamious sparky the laptop, the only laptop in history to have almost committed a <a href="http://www.darwinawards.com/">darwin award</a> on it&#8217;s owner,</p>
<p><span id="more-133"></span></p>
<p>Well today I created the sparking hard disk, basically my hard disk broke nearly immediate the second I move to London, damn stuipd WD external harddisk, it&#8217;s rubbish don&#8217;t buy them their crap, heard of two other users that have had bad experiences.</p>
<p>Anyway I left the poor laptop alone until today, where&#8230; after not finding any case opening instructions, used a combination of two bread knifes, and a swizz army knife (this for future reference is not recommended).</p>
<p>This opened the case fine!, whoope I then took off the metal case around the usb socket, servering the poor sata and power connections ckeanly in half&#8230; oops</p>
<p>Not deterred by this i then put anything back together again (pressing the broken contact together [wish i had my soldering iron with me down south]) and connected the power&#8230;. there were one or two wee sparks, should mention i was pressing the contacts together with my fingers,</p>
<p>Again I&#8217;m fine, nothing caught fire this time, there isn&#8217;t any notiacable damage on the hard disk, so I&#8217;m going to discard the broken usb bit, and attempt to get the hard disk working inside my flatmates computer</p>
<p>He&#8217;s such a good flatmate, I think I&#8217;ll not mention the sparky bits&#8230;</p>
<p>Zap</p>
]]></content:encoded>
			<wfw:commentRss>http://zapper.hodgers.com/blogg/?feed=rss2&#038;p=133</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
