<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>Foo.co.za</title>
	<link>http://www.foo.co.za</link>
	<description>My rants on anything from PHP and software development to music and just about everything else.</description>
	<pubDate>Mon, 15 Jun 2009 14:15:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>How to Sync your E.T. Systems remote to your automated garage door</title>
		<link>http://www.foo.co.za/how-to-sync-your-et-systems-remote-to-your-automated-garage-door</link>
		<comments>http://www.foo.co.za/how-to-sync-your-et-systems-remote-to-your-automated-garage-door#comments</comments>
		<pubDate>Mon, 15 Jun 2009 14:15:44 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[Automation]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/how-to-sync-your-et-systems-remote-to-your-automated-garage-door</guid>
		<description><![CDATA[E.T. Systems seems to have quickly taken over the garage door and gate automation market in Cape Town - every second person has one of those ugly, blue remotes - some with up to six buttons on them - attached to their key rings.

I recently had 2 of my remotes fail within the space  of [...]]]></description>
			<content:encoded><![CDATA[<p>E.T. Systems seems to have quickly taken over the garage door and gate automation market in Cape Town - every second person has one of those ugly, blue remotes - some with up to six buttons on them - attached to their key rings.</p>
<p><img src="http://www.foo.co.za/uploads/pics/6button_large.jpg" /></p>
<p>I recently had 2 of my remotes fail within the space  of a month and was off to E.T. Systems to acquire a new one (at a whopping R125 mind you!)</p>
<p>Here&#8217;s the simple procedure to sync your new remote to your E.T. Systems garage door:</p>
<p>The E.T. Systems remotes work by implementing some sort of patented rolling code transmitted by the remote and identified by the receiver. Without digging into details, this rolling code necessitates syncing your remote to your garage door.</p>
<p>To start, pop open the plastic cover of your garage door. Next, search for 3 pins labeled &#8220;BT LT&#8221; (bottom right of the circuit board in this picture):</p>
<p><img src="http://www.foo.co.za/uploads/pics/DSC00389.jpg" width="600" /></p>
<p>The idea is to short the pin on the &#8220;BT&#8221; side with the middle pin - press the button on the remote that you wish to use to open the garage door and at the same time use something metal to &#8220;short&#8221; the pin labeled &#8220;BT&#8221; and the middle pin. You should hear a beeping sound which indicates that the operation was successful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/how-to-sync-your-et-systems-remote-to-your-automated-garage-door/feed</wfw:commentRss>
		</item>
		<item>
		<title>ABSA building insurance, what a joke!</title>
		<link>http://www.foo.co.za/absa-building-insurance-what-a-joke</link>
		<comments>http://www.foo.co.za/absa-building-insurance-what-a-joke#comments</comments>
		<pubDate>Thu, 11 Jun 2009 13:54:09 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[Insurance]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/archives/7</guid>
		<description><![CDATA[If you&#8217;re like me and just got Absa&#8217;s building insurance with your Absa home loan, because, well, it was easy, I&#8217;d advise you to think again!
It all started on a windy autumn day when the fascia board on my roof blew off, nearly falling on my poor neighbour&#8217;s Uno (which surely would have flattened it [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me and just got Absa&#8217;s building insurance with your Absa home loan, because, well, it was easy, I&#8217;d advise you to think again!</p>
<p>It all started on a windy autumn day when the fascia board on my roof blew off, nearly falling on my poor neighbour&#8217;s Uno (which surely would have flattened it :)) On my neighbour&#8217;s advice, I decided to claim from my building insurance. So, Tuesday morning 10 AM, I decide to brave the Absa call center and submit my claim&#8230;</p>
<p>20 minutes of annoying hold music later and I&#8217;m put through to an operator - I submit the claim and they tell me its been forwarded to the Cape Town division, great. Knowing how these things go, I make a note of the Cape Town office&#8217;s number and end the call.</p>
<p>By Wednesday afternoon I still hadn&#8217;t heard back from those lazy Capetonians, so I decide to do some leg work with my fingers and call them up - &#8220;no sir, we&#8217;ll submit your claim to a contractor immediately&#8221;. &#8220;So why haven&#8217;t you?&#8221; - I wanted to ask.  So I wait in vain with a couple of days of rainy weather threatening to destroy my house even further.</p>
<p>Friday afternoon I get a call from the contractor who assured me in a very Afrikaans accent that Absa takes their insurance very seriousness and he wants to come have a look, right now! After insisting that I&#8217;m at work and won&#8217;t be able to open up for him, he&#8217;s so adamant that I just let him be - hope he has good eyes!</p>
<p>The weekend comes and goes and before I know it, it&#8217;s Wednesday again. Give them a call - &#8220;No, the person who is dealing with your claim is on leave, I&#8217;ll follow up and call you back&#8221;. Great.</p>
<p>Friday afternoon arives, and yet again I phone. Now, by this time I&#8217;ve had enough of their shoddy service and I was planning on switching to Santam the moment the claim is settled. So to my suprise (or maybe not) they refuse to fix the roof - they claim the workmanship on the fascia board is bad because the builder used nails instead of screws. Hmmm. OK, very irate now. I phone up my good buddy Dann at Santam - apparently they need a specific clause in their policy that specifies that nails used on the facia board is considered bad workmanship, otherwise they have to pay up&#8230;</p>
<p>So several phone calls later I&#8217;m able to get my hands on the policy wording&#8230; I quote from section B: Specific Exceptions: &#8220;3. defects in design or construction&#8221; - Sounds pretty broad and subjective to me.</p>
<p>So I phone some builders, a structural engineer, the Master Builder&#8217;s association and the overwhelming opinion is that nails are more frequently used than screws and doesn&#8217;t constitute bad workmanship.</p>
<p>Finally, after several emails, phone calls, and weeks later, the claim is reassessed and a contractor is assigned to fix the roof, success! Of course, not wanting to end up in the same situation again I ask him what they use to attach the Fascia boards&#8230; NAILS!! They use F#$%#%@ nails!</p>
<p>In conclusion, it doesn&#8217;t pay to be an optimist - insurance companies will and do find any excuse not to pay out a claim leaving it up to the consumer to prove their case. I guess most people just give up and with the amount of trouble I went through with this claim, maybe that would have been the saner option!</p>
<p>I&#8217;ll be cancelling my insurance with Absa the moment the roof is fixed and start looking for another bank to finance my home loan.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/absa-building-insurance-what-a-joke/feed</wfw:commentRss>
		</item>
		<item>
		<title>Blocking MSN ads</title>
		<link>http://www.foo.co.za/blocking-msn-ads</link>
		<comments>http://www.foo.co.za/blocking-msn-ads#comments</comments>
		<pubDate>Tue, 01 Apr 2008 11:47:19 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[MSN]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/archives/6</guid>
		<description><![CDATA[Although probably not the best way to block MSN ads, I discovered this method accidentally while debugging my PHP app. Here&#8217;s what you do:

Download and install Fiddler
Run Fiddler and launch MSN live
Watch the web sessions window in fiddler until you see something like &#8220;ads1.msn.com&#8221; in the hosts column - this might be different for other [...]]]></description>
			<content:encoded><![CDATA[<p>Although probably not the best way to block MSN ads, I discovered this method accidentally while debugging my PHP app. Here&#8217;s what you do:</p>
<ul>
<li>Download and install <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a></li>
<li>Run Fiddler and launch MSN live</li>
<li>Watch the web sessions window in fiddler until you see something like &#8220;ads1.msn.com&#8221; in the hosts column - this might be different for other PC&#8217;s, I&#8217;m not sure</li>
<li>Add this line to your &#8220;C:\WINDOWS\system32\drivers\etc\hosts&#8221; file:</li>
<li>127.0.0.1    ads1.msn.com</li>
</ul>
<p>This redirects any requests to the ad server to your localhost. A minor drawback is the annoying popup messages you get when it fails to connect, but it works <img src='http://www.foo.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> No more ads!</p>
<p>I&#8217;m sure with a little more inspiration and time you could hack it to serve up whatever image you want, your very own MSN skinner! Enjoy <img src='http://www.foo.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/blocking-msn-ads/feed</wfw:commentRss>
		</item>
		<item>
		<title>Simpletest and brittle test cases</title>
		<link>http://www.foo.co.za/simpletest-and-brittle-test-cases</link>
		<comments>http://www.foo.co.za/simpletest-and-brittle-test-cases#comments</comments>
		<pubDate>Wed, 19 Mar 2008 14:20:12 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[Simpletest]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/archives/5</guid>
		<description><![CDATA[I&#8217;ve been thoroughly annoyed the last 2 days with Simpletest.
The mock objects have some unexpected behaviour when setting return values for their methods:
$someMock-&#62;setReturnValue('get', 123);
$someMock-&#62;setReturnValue('get', 234); 
Which value does it use? 123. It doesn&#8217;t overwrite the first set value. How do we get around this problem? Like this:
$someMock-&#62;setReturnValueAt(0, 'get', 123);
$someMock-&#62;setReturnValueAt(1, 'get', 234);
setReturnValueAt() allows you to specifiy [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thoroughly annoyed the last 2 days with Simpletest.</p>
<p>The mock objects have some unexpected behaviour when setting return values for their methods:</p>
<p><code>$someMock-&gt;setReturnValue('get', 123);<br />
$someMock-&gt;setReturnValue('get', 234); </code></p>
<p>Which value does it use? 123. It doesn&#8217;t overwrite the first set value. How do we get around this problem? Like this:</p>
<p><code>$someMock-&gt;setReturnValueAt(0, 'get', 123);<br />
$someMock-&gt;setReturnValueAt(1, 'get', 234);</code></p>
<p>setReturnValueAt() allows you to specifiy return values for any additional calls to that method. This is all dandy, but its making my test cases very brittle by creating a tight coupling between my test case and the code being tested.</p>
<p>What I want to be able to do is:</p>
<p>1) set the return value for the mock object<br />
2) run the test that calls this method, not caring how many times the method is called (for argument sake, lets say this is a simple getter method).<br />
3) set the return value for the mock object to something else<br />
4) run another test</p>
<p>I don&#8217;t see any way of doing this other that creating a new instance of the mock object. O well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/simpletest-and-brittle-test-cases/feed</wfw:commentRss>
		</item>
		<item>
		<title>Wireshark</title>
		<link>http://www.foo.co.za/wireshark</link>
		<comments>http://www.foo.co.za/wireshark#comments</comments>
		<pubDate>Wed, 14 Nov 2007 15:19:53 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[Zend Framework]]></category>

		<category><![CDATA[Network]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/archives/4</guid>
		<description><![CDATA[I installed Wireshark out of curiosity - I&#8217;d seen it mentioned and wanted to see how I could find a use for the network protocol analyzer. It sat lying around until a friend asked  whether or not it would be possible to skew a particular poll result.
The poll used a flash frontend. I knew [...]]]></description>
			<content:encoded><![CDATA[<p>I installed <a href="http://www.wireshark.org" target="_blank">Wireshark </a>out of curiosity - I&#8217;d seen it mentioned and wanted to see how I could find a use for the network protocol analyzer. It sat lying around until a friend asked  whether or not it would be possible to skew a particular poll result.</p>
<p>The poll used a flash frontend. I knew there had to be backend it communicated with, so I fired up Wireshark, started logging and cast my vote. A simple ping to the web host revealed  the IP address of the destination host which I used to sort the Wireshark result set. There it was - a post to a PHP script to record my vote, complete with HTTP headers and URL string.</p>
<p>Thanks to the <a href="http://framework.zend.com" target="_blank">Zend Framework</a> and a few lines of code later, my very own poll skewer:</p>
<p><code>&lt;?php</code></p>
<p>require_once(&#8217;C:/php/libs/Zend/Http/Client.php&#8217;);</p>
<p>$client = new Zend_Http_Client(&#8217;http://www.somedomain.com/poll/poll.php&#8217;);<br />
$client-&gt;setParameterPost(&#8217;pollId&#8217;, &#8216;7654&#8242;);<br />
$client-&gt;setParameterPost(&#8217;answerId&#8217;, &#8216;3&#8242;);</p>
<p>$response = $client-&gt;request(&#8217;POST&#8217;);<br />
print urldecode($response-&gt;getBody());</p>
<p>?&gt;</p>
<p>Throw that in a loop and iterate a few thousand times and you quickly begin to understand how important it is to add restrictions based on a user&#8217;s IP address and / or cookies - even though these often cause more trouble than they&#8217;re worth.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/wireshark/feed</wfw:commentRss>
		</item>
		<item>
		<title>In a PECL - Subversion API for PHP</title>
		<link>http://www.foo.co.za/in-a-pecl-subversion-api-for-php</link>
		<comments>http://www.foo.co.za/in-a-pecl-subversion-api-for-php#comments</comments>
		<pubDate>Fri, 24 Aug 2007 15:24:00 +0000</pubDate>
		<dc:creator>Neil Broers</dc:creator>
		
		<category><![CDATA[Subversion]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.foo.co.za/blog/archives/3</guid>
		<description><![CDATA[The PECL SVN extension provides bindings for the SNV API. Its currently in version 0.2 Beta (and there doesn&#8217;t seem to be all that much activity on the project), but I have successfully tested some of the basic methods (checkout, ls, add, commit) without problems. There is, however, no documentation on the functions provided by [...]]]></description>
			<content:encoded><![CDATA[<p>The PECL SVN extension provides bindings for the SNV API. Its currently in version 0.2 Beta (and there doesn&#8217;t seem to be all that much activity on the project), but I have successfully tested some of the basic methods (checkout, ls, add, commit) without problems. There is, however, no documentation on the functions provided by the extension, so I dug through the extension code to make a list of the available functions:</p>
<p><strong>bool svn_checkout(string repos, string targetpath [, int revision])</strong><br />
Checks out a particular revision from repos into targetpath</p>
<p><strong>mixed svn_diff(string path1, int rev1, string path2, int rev2)</strong><br />
Recursively diffs two paths.  Returns an array consisting of two streams: the first is the diff output and the second contains error stream output</p>
<p><strong>bool svn_cleanup(string workingdir)</strong><br />
Recursively cleanup a working copy directory, finishing any incomplete operations, removing lockfiles, etc.</p>
<p><strong>string svn_fs_revision_prop(resource fs, int revnum, string propname)</strong><br />
Fetches the value of a named property</p>
<p><strong>resource svn_fs_youngest_rev(resource fs)</strong><br />
Returns the number of the youngest revision in the filesystem</p>
<p><strong>resource svn_fs_revision_root(resource fs, int revnum)</strong><br />
Get a handle on a specific version of the repository root</p>
<p><strong>resource svn_fs_file_contents(resource fsroot, string path)</strong><br />
Returns a stream to access the contents of a file from a given version of the fs</p>
<p><strong>int svn_fs_file_length(resource fsroot, string path)</strong><br />
Returns the length of a file from a given version of the fs</p>
<p><strong>long svn_fs_node_prop(resource fsroot, string path, string propname)</strong><br />
Returns the value of a property for a node</p>
<p><strong>long svn_fs_node_created_rev(resource fsroot, string path)</strong><br />
Returns the revision in which path under fsroot was created</p>
<p><strong>array svn_fs_dir_entries(resource fsroot, string path)</strong><br />
Enumerates the directory entries under path; returns a hash of dir names to file type</p>
<p><strong>int svn_fs_check_path(resource fsroot, string path)</strong><br />
Determines what kind of item lives at path in a given repository fsroot</p>
<p><strong>resource svn_repos_fs(resource repos)</strong><br />
Gets a handle on the filesystem for a repository</p>
<p><strong>resource svn_repos_open(string path)</strong><br />
Open a shared lock on a repository.</p>
<p><strong>resource svn_repos_create(string path [, array config [, array fsconfig]])</strong><br />
Create a new subversion repository at path</p>
<p><strong>bool svn_repos_recover(string path)</strong><br />
Run recovery procedures on the repository located at path.</p>
<p><strong>bool svn_repos_hotcopy(string repospath, string destpath, bool cleanlogs)</strong><br />
Make a hot-copy of the repos at repospath; copy it to destpath</p>
<p><strong>array svn_commit(string log, array targets [, bool dontrecurse])</strong><br />
Make a hot-copy of the repos at repospath; copy it to destpath</p>
<p><strong>array svn_add(string path [, bool recursive [, bool force]])</strong><br />
Schedule the addition of a file in a working directory</p>
<p><strong>array svn_status(string path [, bool recursive [, bool get_all [, bool update [, bool no_ignore]]]])</strong><br />
Schedule the addition of a file in a working directory</p>
<p><strong>array svn_update(string path [, int revno [, bool recurse]])</strong><br />
Update working copy at path to revno</p>
<p><strong>resource svn_repos_fs_begin_txn_for_commit(resource repos, long rev, string author, string log_msg)</strong><br />
create a new transaction</p>
<p><strong>long svn_repos_fs_commit_txn(resource txn)</strong><br />
commits a transaction and returns the new revision</p>
<p><strong>resource svn_fs_txn_root(resource txn)</strong><br />
creates and returns a transaction root</p>
<p><strong>boolean svn_fs_make_file(resource root, string path)</strong><br />
creates a new empty file, returns true if all is ok, false otherwise</p>
<p><strong>boolean svn_fs_make_dir(resource root, string path)</strong><br />
creates a new empty directory, returns true if all is ok, false otherwise</p>
<p><strong>resource svn_fs_apply_text(resource root, string path)</strong><br />
creates and returns a stream that will be used to replace the content of an existing file</p>
<p><strong>boolean svn_fs_copy(resource from_root, string from_path, resourse to_root, string to_path)</strong><br />
copies a file or a directory, returns true if all is ok, false otherwise</p>
<p><strong>boolean svn_fs_delete(resource root, string path)</strong><br />
deletes a file or a directory, return true if all is ok, false otherwise</p>
<p><strong>resource svn_fs_begin_txn2(resource repos, long rev)</strong><br />
create a new transaction</p>
<p><strong>boolean svn_fs_is_file(resource root, string path)</strong><br />
return true if the path points to a file, false otherwise</p>
<p><strong>boolean svn_fs_is_dir(resource root, string path)</strong><br />
return true if the path points to a directory, false otherwise</p>
<p><strong>boolean svn_fs_change_node_prop(resource root, string path, string name, string value)</strong><br />
return true if everything is ok, false otherwise</p>
<p><strong>boolean svn_fs_contents_changed(resource root1, string path1, resource root2, string path2)</strong><br />
return true if content is different, false otherwise</p>
<p><strong>boolean svn_fs_props_changed(resource root1, string path1, resource root2, string path2)</strong><br />
return true if props are different, false otherwise</p>
<p><strong>boolean svn_fs_abort_txn(resource txn)</strong><br />
abort a transaction, returns true if everything is ok, false othewise</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://pecl.php.net/package/svn" target="_blank">The SVN PECL package home page</a></li>
</ul>
<ul>
<li><a href="http://edoceo.com/int-main/20060808-pecl-svn-package.php" target="_blank">Some usage examples</a></li>
</ul>
<ul>
<li><a href="http://cvs.php.net/viewvc.cgi/pecl/svn/" target="_blank">The PECL SVN subversion repository</a></li>
</ul>
<ul>
<li><a href="http://svn.collab.net/svn-doxygen/" target="_blank">The Subversion API Docs</a> (The PECL extension calls the functions in this API, so these docs are useful in determining the purpose of a function in the PECL extension. Generally the function names correspond, but the function parameters differ slightly in some cases)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.foo.co.za/in-a-pecl-subversion-api-for-php/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
