<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> 
	<channel> 
		<title>Menial &ndash; Blog</title> 
		<link>http://menial.co.uk/</link> 
		<description>Latest posts from the Menial blog.</description> 
		<language>en-gb</language> 
		<pubDate>Mon, 6 Oct 2008 11:50:54 GMT</pubDate>  
		<docs>http://www.rssboard.org/rss-specification</docs> 
		<generator>Menial FeedsController</generator> 
		 
		<item> 
			<title>Finals</title> 
			<link>http://menial.co.uk/blog/2007/05/07/finals/</link> 
			<description>
			<![CDATA[
			<p>It's been a long time since I posted any code. My excuse is that I've written my dissertation and now have finals looming. Code will resume in the not-too-distant future.</p>

<p>In the mean time, I leave you with <a href="http://xkcd.com/c258.html">this xkcd cartoon</a>:</p>

<p><img src="/files/blog/xkcd_conspiracy_theories.png"></p>			<p><a href="http://menial.co.uk/blog/2007/05/07/finals/">Permalink</a></p>
			]]>
			</description>
			 
			<pubDate>Mon, 7 May 2007 05:06:04 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/05/07/finals/</guid> 
		</item> 
		 
		<item> 
			<title>AppleScript for starting and stopping Apache and MySQL </title> 
			<link>http://menial.co.uk/blog/2007/03/13/applescript-for-starting-and-stopping-apache-and-mysql/</link> 
			<description>
			<![CDATA[
			<p>Got a couple of pieces of AppleScript for starting and stopping Apache and MySQL which are too small to be worth posting as snippets.</p>

<p><strong>Starting:</strong><br />
<code>
do shell script "/sw/sbin/apachectl start" password "MY_PASSWORD" with administrator privileges
do shell script "/usr/local/mysql/bin/mysqld_safe > /dev/null 2>&1 &" password "MY_PASSWORD" with administrator privileges
</code></p>

<p><strong>Stopping:</strong><br />
<code>
do shell script "/sw/sbin/apachectl stop" password "MY_PASSWORD" with administrator privileges
do shell script "/usr/local/mysql/bin/mysqladmin -u root -pROOT_MYSQL_PASSWORD shutdown" password "MY_PASSWORD" with administrator privileges
</code></p>


<p>You will obviously need to change MY_PASSWORD to your admin password. You need to change ROOT_MYSQL_PASSWORD to your root MySQL password, or another user name/password combo with shutdown privileges. Note: there should <em>not</em> be a space between -p and ROOT_MYSQL_PASSWORD.</p>

<p>Also, the path to apache/mysql might need changing. You can find out where they are by running <code>which apachectl</code> and <code>which mysqld_safe</code> in the terminal.</p>

<p>Just paste the code into Script Editor, and save how/wherever you like. I save mine as run-only executables which show up nicely in <a href="http://quicksilver.blacktree.com">Quicksilver</a>.</p>			<p><a href="http://menial.co.uk/blog/2007/03/13/applescript-for-starting-and-stopping-apache-and-mysql/">Permalink</a></p>
			]]>
			</description>
						<category>Mac OS X</category> 
						<category>Code</category> 
			 
			<pubDate>Tue, 13 Mar 2007 04:40:54 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/03/13/applescript-for-starting-and-stopping-apache-and-mysql/</guid> 
		</item> 
		 
		<item> 
			<title>CakePHP ACL code posted</title> 
			<link>http://menial.co.uk/blog/2007/01/30/cakephp-acl-code-posted/</link> 
			<description>
			<![CDATA[
			<p>Just a heads up to let CakePHP coders know I've <a href="/snippets/view/4/">posted a new snippet</a> which extends slightly <abbr title="Access Control List">ACL</abbr> usage within Cake apps. It's been posted to Trac for some time, but I don't know whether it'll be merged into the core.</p>

<p><a href="/snippets/view/4/">Take a look</a>.</p>			<p><a href="http://menial.co.uk/blog/2007/01/30/cakephp-acl-code-posted/">Permalink</a></p>
			]]>
			</description>
						<category>Snippets</category> 
			 
			<pubDate>Tue, 30 Jan 2007 11:58:17 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/01/30/cakephp-acl-code-posted/</guid> 
		</item> 
		 
		<item> 
			<title>Host move complete</title> 
			<link>http://menial.co.uk/blog/2007/01/25/host-move-complete/</link> 
			<description>
			<![CDATA[
			<p>Well, the move is done.</p>
<p>I've moved to DreamHost, because I wanted a cheap host who had SSH access and other goodies to play with (RoR and Subversion particularly). With a $99 discount, it's cheap enough that I can just discard it after a year if it's not good enough.</p>
<p>My first observation is that it's noticeably slower than the old host. Especially MySQL as the database is on a different machine. It might be worth looking into installing a local copy if possible.</p>
<br />
<p>Finally, DreamHost have disabled PHPs <code>allow_url_fopen</code> ini setting, which breaks my favatars code. I've fixed my own copy to and will upload a new version as soon as I've more fully tested it.</p>

<p><strong>Edit:</strong><br />
There also seems to be a problem with escaping characters to go into the database. Something else to fix&hellip;</p>			<p><a href="http://menial.co.uk/blog/2007/01/25/host-move-complete/">Permalink</a></p>
			]]>
			</description>
						<category>Menial</category> 
			 
			<pubDate>Thu, 25 Jan 2007 10:15:50 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/01/25/host-move-complete/</guid> 
		</item> 
		 
		<item> 
			<title>Moving hosts</title> 
			<link>http://menial.co.uk/blog/2007/01/21/moving-hosts/</link> 
			<description>
			<![CDATA[
			<p>I'm currently in the process of changing my hosting provider. Hopefully the move should go smoothly, but not having transferred a live website between hosts before there will probably be something I've forgotten. So please, if something seems wrong or this site just vanishes from the face of the internet, rest assured that I'll be <span style="text-decoration: line-through">panicking</span> working to fix it.</p>			<p><a href="http://menial.co.uk/blog/2007/01/21/moving-hosts/">Permalink</a></p>
			]]>
			</description>
						<category>Menial</category> 
			 
			<pubDate>Sun, 21 Jan 2007 11:49:44 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/01/21/moving-hosts/</guid> 
		</item> 
		 
		<item> 
			<title>Exposing Cocoa bindings on a custom control</title> 
			<link>http://menial.co.uk/blog/2007/01/18/exposing-cocoa-bindings-on-a-custom-control/</link> 
			<description>
			<![CDATA[
			<p>For quite a while now, I have been working on-and-off (more off than on) at learning Objective-C and <a href="http://developer.apple.com/cocoa/">Cocoa</a> with an eye to making a couple of things for personal use.</p>

<p>Cocoa's bindings are totally amazing. While making a custom control I suddenly thought I wanted to make it able to use the bindings system to get/set the control value. Below is the code to do this:</p>

<p>
<code><pre>
+ (void)initialize {
	[self exposeBinding:@"dateValue"];
}
</pre></code>
</p>

<p>Great isn't it?</p>

<p>As long as your accessors are already key-value-coding compliant (ie. are of the form value/setValue; firstName/setFirstName etc.), you just call exposeBinding for each binding you want to create and that's it!</p>

<p>Ah, less code, less bugs. Love it.</p>			<p><a href="http://menial.co.uk/blog/2007/01/18/exposing-cocoa-bindings-on-a-custom-control/">Permalink</a></p>
			]]>
			</description>
						<category>Cocoa</category> 
						<category>Code</category> 
			 
			<pubDate>Thu, 18 Jan 2007 15:34:38 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/01/18/exposing-cocoa-bindings-on-a-custom-control/</guid> 
		</item> 
		 
		<item> 
			<title>iPhone</title> 
			<link>http://menial.co.uk/blog/2007/01/10/iphone/</link> 
			<description>
			<![CDATA[
			<p><a href="http://www.apple.com/iphone/">iPhone</a>. Gadget craving++. You just know it's going to be a popular topic for quite some time.</p>

<p>My last three phones have been:</p>
<ol>
<li>Sony Ericsson k700</li>
<li>Motorola V3 (RAZR)</li>
<li>Samsung D900 (current - also broken)</li>
</ol>

<p>
The joystick thing on the k700 gummed up with crud. I shattered my RAZR (totally my fault). The D900, I picked it up off my desk the other day and the screen was blank and refused to come on. It's going off to be replaced/repaired sometime this week. Of these three phones, they either had a nice design (RAZR, D900) or a nice OS (k700). This made them pretty mediocre phones all-round, although the D900 is the best so far. 
</p>

<p>The iPhone appeals to me because it's got a very nice design with no moving parts to gum up, though the screen will need protecting. It's also got a very good OS, with a lot of thought gone in to what a phone is mainly used for. ie. Making calls and sending text messages. On some phones now these feature seems almost an afterthought.</p>

<p>Being a music player, it looks like I could sell my iPod. You couldn't do that with the Motorola ROKR even though it was supposed to be a music phone. Battery life would be a big concern though. How much would 2 hours music listening shorten the phone talk time?
Will reserve judgement on that until I can actually get my paws on a working model.</p>

<p>The internet/email stuff is not something I use now as data transfer is too expensive. This having built-in wi-fi could well convert me on to using it. It'd be good for taking on trips instead of my laptop.</p>

<p>Something that would be a killer feature for me would be having skype on there and using that when I'm connected to a suitable network rather than my cellular network provider. No wi-fi? Use Vodafone at whatever price they charge at the moment. Got wi-fi? Use skype to call at a fraction of the Vodafone price.</p>

<p>Size & price are something I'll reserve judgement on until I can handle a working model. Trying to judge sizes without actually holding it is just too tricky. Price? We'll have to wait and see what they set it at in the UK. Aaaaand that brings us to the release date. Fourth quarter 2007. Too damn long.</p>			<p><a href="http://menial.co.uk/blog/2007/01/10/iphone/">Permalink</a></p>
			]]>
			</description>
			 
			<pubDate>Wed, 10 Jan 2007 05:10:39 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2007/01/10/iphone/</guid> 
		</item> 
		 
		<item> 
			<title>Favatars bug fixed</title> 
			<link>http://menial.co.uk/blog/2006/12/21/favatars-bug-fixed/</link> 
			<description>
			<![CDATA[
			<p>Apologies to those who downloaded the favatars controller since I put it up, but there was a bit of a blindingly obvious bug present in it which has now been fixed and uploaded.</p>

<p>After outputting the favicon, the script would attempt to render a view (which doesn't exist here), triggering a &quot;missing view&quot; error. On a production Cake site, this causes a 404 error header to be sent along with the data. Consequently, the icon renders fine, but your error log starts filling up with 404 errors for files which are being displayed OK.</p>

<p>The fix is really simple, in the <code>favatar()</code> action, replace the <code>return;</code> statements with <code>exit();</code>. No more view rendering, no more 404s, no problem!</p>			<p><a href="http://menial.co.uk/blog/2006/12/21/favatars-bug-fixed/">Permalink</a></p>
			]]>
			</description>
						<category>CakePHP</category> 
			 
			<pubDate>Thu, 21 Dec 2006 00:18:53 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2006/12/21/favatars-bug-fixed/</guid> 
		</item> 
		 
		<item> 
			<title>CakePHP controller speedup</title> 
			<link>http://menial.co.uk/blog/2006/12/19/cakephp-controller-speedup/</link> 
			<description>
			<![CDATA[
			<p>I have been looking at ways to speed up my CakePHP-based pages and it would appear that the biggest speed hit is including and instantiating all the classes used in a single page load. There are quite a few if you consider all the components, helpers and base classes together. And yes, I'm ignoring full-page caching in this post.</p>

<p>Anyway, being as the favatars system on this blog is in its own controller and needs to be as fast as possible, I was looking for ways to speed it up. After much profiling of the page in Zend Studio and implementing caching I realised there was something else that could be done.</p>

<p>In my AppController, I declare the use of the Acl component, the Aro and Aco models and the HTML helper, as pretty much all controllers use these. Except for the favatars controller&hellip;</p>

<p>While I don't have numerical data to back this up, setting the <code>$uses</code>, <code>$components</code> and <code>$helpers</code> vars to null in the favatars controller (and thus not instantiating four unneeded classes) seems to speed up the icon serving a fair bit.</p>

<p>So yeah, the point of this is that you should always check you're not including and instantiating classes you don't need and that they might be in places you don't remember to check.</p>			<p><a href="http://menial.co.uk/blog/2006/12/19/cakephp-controller-speedup/">Permalink</a></p>
			]]>
			</description>
						<category>Menial</category> 
						<category>CakePHP</category> 
			 
			<pubDate>Tue, 19 Dec 2006 05:00:49 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2006/12/19/cakephp-controller-speedup/</guid> 
		</item> 
		 
		<item> 
			<title>CakePHP Favatar Controller</title> 
			<link>http://menial.co.uk/blog/2006/12/17/cakephp-favatar-controller/</link> 
			<description>
			<![CDATA[
			<p>I've <a href="http://menial.co.uk/snippets/view/2/">added a new snippet</a>, this time a CakePHP-specific one. Favatars is a Wordpress plugin for displaying favicons as avatars next to blog post comments. This code is an adaptation of the original work to turn it into a CakePHP Controller. When given a URL, it will attempt to locate a favicon for that site. If one is found, it is cached and displayed. If not, it will display a default image.</p>

<p>By using this controller within &lt;img&gt; tags, favicons can be used as images anywhere within your site, without knowing their specific address. It is currently in use on this blog and favicons will appear next to post comments.</p>


<p><strong>Examples:</strong><br />
<img src="http://menial.co.uk/favatars/favatar/?link=cakephp.org" alt="CakePHP favicon" title="CakePHP favicon" style="height:16px; width:16px;" /> CakePHP<br />
<img src="http://menial.co.uk/favatars/favatar/?link=adiumx.com" alt="Adium favicon" title="Adium favicon" style="height:16px; width:16px;" /> Adium<br />
<img src="http://menial.co.uk/favatars/favatar/?link=snook.ca" alt="Snook.ca favicon" title="Snook.ca favicon" style="height:16px; width:16px;" /> Snook.ca<br />
<img src="http://menial.co.uk/favatars/favatar/?link=menial.co.uk" alt="Menial favicon" title="Menial favicon" style="height:16px; width:16px;" /> Menial<br />
<img src="http://menial.co.uk/favatars/favatar/?link=" alt="Default favicon" title="Default favicon" style="height:16px; width:16px;" /> Default image<br />
</p>

<p>Instructions for use are included in the download and I will be posting improvements as they are made. Comments and suggestions are very welcome.</p>

<p><a href="http://menial.co.uk/snippets/view/2/">Get the code!</a></p>			<p><a href="http://menial.co.uk/blog/2006/12/17/cakephp-favatar-controller/">Permalink</a></p>
			]]>
			</description>
						<category>CakePHP</category> 
						<category>Snippets</category> 
			 
			<pubDate>Sun, 17 Dec 2006 07:15:23 GMT</pubDate> 
			<guid isPermaLink="true">http://menial.co.uk/blog/2006/12/17/cakephp-favatar-controller/</guid> 
		</item> 
		 
	</channel> 
</rss>