<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.wezm.net/</id>
  <title>WezM.net - All Articles</title>
  <updated>2012-01-21T06:18:00Z</updated>
  <link rel="alternate" href="http://www.wezm.net/"/>
  <link rel="self" href="http://feeds.feedburner.com/wezm"/>
  <author>
    <name>Wesley Moore</name>
    <uri>http://www.wezm.net/about/</uri>
  </author>
  <entry>
    <id>tag:www.wezm.net,2012-01-21:/personal/2012/01/a-photo-a-day-in-2012/</id>
    <title type="html">A Photo a Day in 2012</title>
    <published>2012-01-21T06:18:00Z</published>
    <updated>2012-01-21T06:18:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/personal/2012/01/a-photo-a-day-in-2012/"/>
    <content type="html">&lt;p&gt;This year I've decided to have a go at publishing a photo every day
of the year. I'm not the first to do this, its also known by the name
&lt;a href="http://content.photojojo.com/tutorials/project-365-take-a-photo-a-day/"&gt;Project 365&lt;/a&gt;. I'm publishing my photos to the &lt;a href="http://www.flickr.com/photos/wezm/sets/72157628659470185/"&gt;2012 set on
Flickr&lt;/a&gt;. The first week whilst I was still on Christmas holidays was
pretty easy. Although I am missing a photo for Jan 2 as the photo I took
got deleted whilst trying to restore my iPhone that got drowned in a river.
Anyway after returning to work its been harder to find things to take
pictures of but I haven't missed a day yet.&lt;/p&gt;

&lt;p&gt;Some of my favourites from the first 3 weeks are:&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;a href="http://www.flickr.com/photos/wezm/6657534021/"&gt;&lt;img src="http://farm8.staticflickr.com/7012/6657534021_4f817ed181.jpg" alt="Eastern Spinebill" /&gt;&lt;/a&gt;
  &lt;figcaption&gt;Jan 8 &amp;mdash; Eastern Spinebill&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;a href="http://www.flickr.com/photos/wezm/6689132165/"&gt;&lt;img src="http://farm8.staticflickr.com/7165/6689132165_a804d761de.jpg" alt="CityLink" /&gt;&lt;/a&gt;
  &lt;figcaption&gt;Jan 13 &amp;mdash; CityLink&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;a href="http://www.flickr.com/photos/wezm/6697126903/"&gt;&lt;img src="http://farm8.staticflickr.com/7022/6697126903_7edb0f16f4.jpg" alt="Sulphur Crested Cockatoo" /&gt;&lt;/a&gt;
  &lt;figcaption&gt;Jan 15 &amp;mdash; Sulphur Crested Cockatoo&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;a href="http://www.flickr.com/photos/wezm/6719362425/"&gt;&lt;img src="http://farm8.staticflickr.com/7160/6719362425_4ca8528510.jpg" alt="Belvedere — Intense" /&gt;&lt;/a&gt;
  &lt;figcaption&gt;Jan 18 &amp;mdash; Belvedere &amp;ndash; Intense&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;a href="http://www.flickr.com/photos/wezm/6727700109/"&gt;&lt;img src="http://farm8.staticflickr.com/7147/6727700109_2b71858bf7.jpg" alt="Macedon Primary School Plantation" /&gt;&lt;/a&gt;
  &lt;figcaption&gt;Jan 19 &amp;mdash; Macedon Primary School Plantation&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2012-01-21:/technical/2011/12/freebsd-zfs-powered-nas/</id>
    <title type="html">Home NAS Powered by FreeBSD and ZFS</title>
    <published>2012-01-21T06:08:00Z</published>
    <updated>2012-01-21T06:08:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/12/freebsd-zfs-powered-nas/"/>
    <content type="html">&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;Here's the tl;dr version: I sold my Mac Pro to fund building a home
NAS. The result is a HP MicroServer with 4Gb RAM and 3 &amp;times; 2Tb hard
drives running FreeBSD from the system drive and a ZFS pool across the
three 2Tb drives. Total cost: AU$731.67.&lt;/p&gt;

&lt;h2&gt;Rationale&lt;/h2&gt;

&lt;p&gt;Recently the Time Machine drive in my Mac Pro started to randomly
disappear and Mac OS X would say that I had removed it improperly,
which was not true given it was an internal drive still inside the
machine.&lt;/p&gt;

&lt;p&gt;I've seen this behaviour before and in that case it resulted in the drive
being replaced due to its inability to complete a short S.M.A.R.T.
scan. This drive (also a Samsung) was suffering a similar problem except
that initiating the S.M.A.R.T. scan would actually cause it to disappear
from the SATA bus. A check on the Samsung site showed that the drive was
out of warranty so I was up for a replacement.&lt;/p&gt;

&lt;p&gt;The Mac Pro wasn't getting used for much since I got a i7 powered Mac
Book Pro. Its main duties involved storing my iTunes library, Aperture
library and running my weather logger. It wasn't exactly a very energy
efficient machine to run all the time. It would in fact keep the study
warm overnight when the door was closed during winter.&lt;/p&gt;

&lt;p&gt;There was also a problem with replacing the failing drive: I couldn't afford
to do so. So I decided to move the weather logging to my &lt;a href="/2011/12/openwrt-on-alix/"&gt;ALIX board&lt;/a&gt;
and sell the Mac Pro to fund building a home NAS. I was able to sell the
Mac Pro very quickly on eBay for $1500 but gave myself a budget of $1000 for
the NAS. I wanted the NAS to have reliable, redundant storage, which for me
meant &lt;a href="http://www.opensolaris.org/os/community/zfs/"&gt;ZFS&lt;/a&gt;. This implied the new machine would need to run one of &lt;a href="http://oracle.com/solaris"&gt;Solaris&lt;/a&gt;,
&lt;a href="https://www.illumos.org/"&gt;illumos&lt;/a&gt;, &lt;a href="http://www.FreeBSD.org/"&gt;FreeBSD&lt;/a&gt;, &lt;a href="https://www.illumos.org/"&gt;FreeNAS&lt;/a&gt; or &lt;a href="http://smartos.org/"&gt;SmartOS&lt;/a&gt;. The requirement to run one of
these OS's ruled out an off the shelf NAS appliance.&lt;/p&gt;

&lt;p&gt;I did a lot of research into different ways to build the machine and
tried out all the OS options in virtual machines. I considered using
basic PC hardware, MiniITX, HP MicroServer, etc. Each had its own
pros and cons. The basic PC approach was possibly the cheapest but it
was the largest. MiniITX was more expensive and choice of multi hard
drive bay cases were limited. I ended up settling on the &lt;a href="http://h10010.www1.hp.com/wwpc/hk/en/sm/WF06b/15351-15351-4237916-4237917-4237917-4248009-5163345.html"&gt;HP Proliant
MicroServer&lt;/a&gt; running FreeBSD.&lt;/p&gt;

&lt;script type="text/javascript" charset="utf-8"&gt;
  $(function () {
    var alt = $(document.createElement('img')).attr('src', '/images/2012/01/_MG_0581.jpg');
    $('#inside-outside-view').toggle(function() {
      $(this).attr('src', alt.attr('src'))
    }, function() {
      $(this).attr('src', '/images/2012/01/_MG_0582.jpg')
    });
  });
&lt;/script&gt;


&lt;p&gt;&lt;figure&gt;
  &lt;img id="inside-outside-view" src="/images/2012/01/_MG_0582.jpg" width="600" height="600" alt="Inside/outside view of HP MicroServer" /&gt;
  &lt;figcaption&gt;The end result. Click/tap to toggle inside view.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/_MG_0583.jpg" width="600" height="600" alt="Fron of MicroServer with CD for size comparison" /&gt;
  &lt;figcaption&gt;CD for size comparison.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/_MG_0584.jpg" width="600" height="600" alt="Oblique view of HP MicroServer" /&gt;
  &lt;figcaption&gt;Oblique view (excuse the finger prints).&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;h2&gt;The Build&lt;/h2&gt;

&lt;p&gt;The MicroServer is a neat little unit. It uses a low power dual core AMD
Turion II CPU and comes with 2Gb ECC RAM and a 250Gb HD. I has 4 non-hot
swappable hard drive bays all packaged up in a squat little box. I ordered
mine with an extra 2Gb or RAM as ZFS likes to have plenty of RAM available
to run well.&lt;/p&gt;

&lt;p&gt;During my research hard drive prices sky rocketed due to floods
in Thailand, however I was able to get some at pre-flood prices from
&lt;a href="http://ht.com.au/"&gt;ht.com.au&lt;/a&gt;. They have since put the price up ~$40 and placed order
limits on them.&lt;/p&gt;

&lt;p&gt;For the drives I chose 2Tb Seagate Barracuda Green's. They feature SATA 3
and a 64Mb cache and run at an atypical 5900RPM. These drives seemed to be
a good balance across energy efficiency, noise, performance and price.&lt;/p&gt;

&lt;p&gt;The final parts list ended up being rather diminutive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 &amp;times; &lt;a href="http://h10010.www1.hp.com/wwpc/hk/en/sm/WF06b/15351-15351-4237916-4237917-4237917-4248009-5163345.html"&gt;HP MicroServer&lt;/a&gt; (658553-371) + 2Gb extra RAM $336.82&lt;/li&gt;
&lt;li&gt;3 &amp;times; &lt;a href="http://www.ht.com.au/cart/1/part/V0531-Seagate-Barracuda-Green-ST2000DL003-hard-drive-2-TB-SATA-600/detail.hts"&gt;2Tb Seagate Barracuda Green Hard Drives&lt;/a&gt; $394.85&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The total cost ended up being $731.67, healthily under budget.&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/IMG_0097.jpg" width="600" height="600" alt="Installing RAM into HP MicroServer" /&gt;
  &lt;figcaption&gt;Installing the extra RAM.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/IMG_0098.jpg" width="600" height="600" alt="Installing hard drives into HP MicroServer" /&gt;
  &lt;figcaption&gt;Installing the hard drives.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;h2&gt;Software&lt;/h2&gt;

&lt;p&gt;Installing FreeBSD and setting up the ZFS pool was very
straightforward. I'm running the drives in a RAIDZ configuration,
giving 3.6Tb of usable storage. I currently have two ZFS file systems
on that. One in a normal configuration and the other for photos with
&lt;code&gt;copies=2&lt;/code&gt; set.&lt;/p&gt;

&lt;p&gt;The system all ran well for a few days however on the forth day one of
the brand new drives failed and started making a terrible clicking, beeping
noise. Fortunately HT replaced it very promptly and the replacement has
been running fine since. During the time the failed drive was out for
replacement the ZFS pool continued to run fine in its degraded state, with
no data loss. Once the new drive was installed it was a simple matter of
issuing &lt;code&gt;zfs replace ada1&lt;/code&gt; and it began the process of resilvering the data
onto the new drive and all it has been running well since.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ zpool status
  pool: storage
 state: ONLINE
 scan: resilvered 1.07T in 9h32m with 0 errors on Tue Nov 29 07:13:29 2011
config:

  NAME        STATE     READ WRITE CKSUM
  storage     ONLINE       0     0     0
    raidz1-0  ONLINE       0     0     0
      ada1    ONLINE       0     0     0
      ada2    ONLINE       0     0     0
      ada3    ONLINE       0     0     0

errors: No known data errors
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After setting up the OS and file systems the only other thing I
needed to so was make the storage available to other machines on the
network. Since my house is all Macs I built &lt;a href="http://netatalk.sourceforge.net/"&gt;netatalk&lt;/a&gt; via the FreeBSD
ports collection to make the storage available via &lt;abbr title="Apple
Filing Protocol"&gt;AFP&lt;/abbr&gt;.&lt;/p&gt;

&lt;p&gt;With that done it's the sever shows up in the Finder via Bonjour and
copying/accessing data is dead simple.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2012-01-21:/technical/2011/12/openwrt-on-alix/</id>
    <title type="html">Little Linux Router Box</title>
    <published>2012-01-21T04:33:00Z</published>
    <updated>2012-01-21T04:33:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/12/openwrt-on-alix/"/>
    <content type="html">&lt;p&gt;After ongoing issues with maintaining a reliable Internet connection at
home I decided to add a router box to the network in charge of assigning
IP addresses and sharing our Internet connection with the rest of the
network.  I wanted something with at least two Ethernet ports so that
all Internet traffic would flow through the device and allow bandwidth
hogs to be identified at times when the connection appeared flooded.&lt;/p&gt;

&lt;p&gt;After a bunch of research into appropriate hardware and software I
decided on a &lt;a href="http://www.pcengines.ch/alix2d13.htm"&gt;PC Engines ALIX&lt;/a&gt; single board computer (alix2d13). The
ALIX is a small board about the size of a CD case with the following
features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;500Mhz AMD Geode (x86 compatible) CPU&lt;/li&gt;
&lt;li&gt;256Mb RAM&lt;/li&gt;
&lt;li&gt;2 &amp;times; USB ports&lt;/li&gt;
&lt;li&gt;3 &amp;times; 10/100 Ethernet ports&lt;/li&gt;
&lt;li&gt;Mini-PCI socket (for WiFi if desired)&lt;/li&gt;
&lt;li&gt;RS-232 serial port&lt;/li&gt;
&lt;li&gt;CompactFlash socket&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Along with the board I ordered one of &lt;a href="http://www.pcengines.ch/case1d2u.htm"&gt;PC Engines cases&lt;/a&gt;
(case1s2u) to go with it.&lt;/p&gt;

&lt;p&gt;For the software I settled on &lt;a href="https://openwrt.org/"&gt;OpenWRT&lt;/a&gt;. I chose it for a number of
reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Good support for ALIX boards.&lt;/li&gt;
&lt;li&gt;Designed to run from Flash and read only file systems.&lt;/li&gt;
&lt;li&gt;Great binary package manager that allows additional software to be
installed.&lt;/li&gt;
&lt;li&gt;Lightweight &lt;a href="http://www.lua.org/"&gt;Lua&lt;/a&gt; based Web UI available (&lt;a href="http://luci.subsignal.org/"&gt;LuCI&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;After learning to use the excellent OpenWRT build system I was able to
build a custom CompactFlash image for the board to run. I also created a
package for my &lt;a href="/technical/2010/09/weather-station-software/"&gt;weather logging software&lt;/a&gt; so that the
ALIX can do all my &lt;a href="/personal/2010/09/weather-station/"&gt;weather station&lt;/a&gt; logging.&lt;/p&gt;

&lt;p&gt;This setup has been extremely reliable. I've pushed all services on to
it that my ADSL modem and AirPort base station used to be responsible
for. Including maintaining the PPPoE connection to my ISP. I'd certainly
recommend a set up like this to anyone who is looking for a small
dedicated home router.&lt;/p&gt;

&lt;p&gt;If you don't like the prospect of building your own custom OS image I'd
also highly recommend &lt;tt&gt;&lt;a href="http://m0n0.ch/wall/"&gt;m0n0wall&lt;/a&gt;&lt;/tt&gt;, which is a &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt; derived
router system. I ran this on the ALIX initially and it was very easy
to get up an running (write image to CF card, boot from card - default
settings worked fine but can be changed via a web UI) and very reliable.&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/_MG_0562.jpg" width="600" height="258" alt="Front view" /&gt;
  &lt;figcaption&gt;Front with three LEDs. The behaviour of the LEDs can
  be customised in OpenWRT. I have the left one indication power and
  the middle one indicating activity on the WAN port. The other one is
  currently unused.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/_MG_0569.jpg" width="600" height="600" alt="Top view with CD for size comparison" /&gt;
  &lt;figcaption&gt;Top of case, showing size in comparison to a CD case.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;&lt;figure&gt;
  &lt;img src="/images/2012/01/_MG_0567.jpg" width="600" height="600" alt="alix2d13 board" /&gt;
  &lt;figcaption&gt;The ALIX board itself with the following connected: WAN
  and LAN Ethernet, 8Gb &lt;a href="http://www.lacie.com/au/products/product.htm?id=10425"&gt;MosKeyto USB flash drive&lt;/a&gt;,
  weather station USB cable and 32Mb CF card that the system runs
  off.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-12-11:/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview/</id>
    <title type="html">Fun With objc_setAssociatedObject and UIAlertView</title>
    <published>2011-12-11T06:26:00Z</published>
    <updated>2011-12-11T06:26:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/12/fun-with-objc-setassociatedobject-and-uialertview/"/>
    <content type="html">&lt;p&gt;When it comes time to present errors or other messages in iOS with
&lt;a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAlertView_Class/UIAlertView/UIAlertView.html"&gt;UIAlertView&lt;/a&gt; it is immediately obvious that a more convenient interface
would involve the use of blocks. A &lt;a href="https://github.com/search?type=Repositories&amp;amp;language=&amp;amp;q=uialertview&amp;amp;repo=&amp;amp;langOverride=&amp;amp;x=14&amp;amp;y=17&amp;amp;start_value=1"&gt;search on GitHub&lt;/a&gt;
shows just about every iOS developer has had the same thought and had a crack at it.&lt;/p&gt;

&lt;p&gt;After reviewing the better options (I.e. those that actually had a
README with more than a few lines of content) on GitHub it appeared
that one of the challenges was how to handle memory. This stems from
the wrapper becoming the delegate for the UIAlertView but not having a
strong reference from the caller. I saw various solutions to this, most
involving adding a extra retain call to keep everything around until the
delegate methods were called.&lt;/p&gt;

&lt;p&gt;Since my project is using ARC I looked for a solution that
didn't involve marking the wrapper file as non-ARC and
invoking &lt;code&gt;retain&lt;/code&gt;. The solution I came up with was to use
&lt;a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocAssociativeReferences.html"&gt;&lt;code&gt;objc_setAssociatedObject&lt;/code&gt;&lt;/a&gt;. This Objective-C runtime
function allows one object to be associated with another using various
memory management strategies. I used this to associate the UIAlertView
blocks based wrapper with the UIAlertView.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;init&lt;/code&gt; method the wrapper instance is associated with its UIAlertView:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;objc_setAssociatedObject(alertView, _cmd, self, OBJC_ASSOCIATION_RETAIN);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that I'm using the implicit second argument to the method, its
selector, &lt;code&gt;_cmd&lt;/code&gt; as the key for the associated object. This was
suggested in a &lt;a href="http://twitter.com/bbum/status/3609098005"&gt;tweet by Bill Bumgarner&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then in &lt;code&gt;alertView:didDismissWithButtonIndex:&lt;/code&gt;, the association
is removed, &lt;code&gt;dealloc&lt;/code&gt; of the wrapper called as a result and the
&lt;code&gt;UIAlertView&lt;/code&gt; also released.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SEL key = @selector(initWithTitle:message:);
objc_setAssociatedObject(self.alertView, key, nil, OBJC_ASSOCIATION_RETAIN);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The full &lt;a href="https://gist.github.com/1392611"&gt;MIT licensed code&lt;/a&gt; is available as a &lt;a href="https://gist.github.com/1392611"&gt;gist on GitHub&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-12-08:/technical/2011/12/ios-launch-image-is-not-a-splashscreen/</id>
    <title type="html">The iOS Launch Image is Not a Splash Screen</title>
    <published>2011-12-07T20:29:00Z</published>
    <updated>2011-12-07T20:29:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/12/ios-launch-image-is-not-a-splashscreen/"/>
    <content type="html">&lt;p&gt;At work we're currently having an iOS app that I'm working on styled
by a designer. The second screen we were supplied was a pretty splash
screen with a big logo on it. We responded saying that we didn't want
to use the launch image like that. Our designer responded saying that
was fine but the majority of the clients nowadays require heavy emphases
on corporate branding therefore it was a standard practice to cater to
those requirements. It's a shame that this is what people are are asking
for since its is not the intended use of the launch image.&lt;/p&gt;

&lt;p&gt;Justin Williams recently had the following clear-cut words to say on the
topic of splash screens in his &lt;a href="http://carpeaqua.com/2011/12/04/on-magazines-and-the-ipad/"&gt;On Magazines and the iPad&lt;/a&gt;
article (emphasis from the article):&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Remember, kids. The first rule of mobile development is that &lt;em&gt;no one
gives a fuck about your brand&lt;/em&gt;. A splash screen with a giant logo
is something that makes editors and marketing directors feel good,
but to a user it just feels like a meaningless delay. You know that
feeling of frustration you get each time there’s a 15-second preroll
before a video on the web? That’s what a splash screen with logos and
advertisements is.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The Apple &lt;a href="http://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/MobileHIG.pdf"&gt;iOS Human Interface Guidelines&lt;/a&gt; include the
following suggestions:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Avoid taking space away from the content people care about. For
example, displaying a second, persistent bar at the top of the screen
that does nothing but display branding assets means that there’s less
room for content. Consider other, less intrusive ways to display
pervasive branding, such as subtly customizing the background of a
screen.&lt;/p&gt;

&lt;p&gt;Display a launch image that closely resembles the first screen of the
application. This practice decreases the perceived launch time of your
application.&lt;/p&gt;

&lt;p&gt;Avoid displaying an About window or a splash screen. In general, try
to avoid providing any type of startup experience that prevents people
from using your application immediately.&lt;/p&gt;

&lt;p&gt;Supply a launch image to improve user experience.&lt;/p&gt;

&lt;p&gt;Avoid using your launch image as an opportunity to provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An "application entry experience," such as a splash screen&lt;/li&gt;
&lt;li&gt;An About window&lt;/li&gt;
&lt;li&gt;Branding elements, unless they are a static part of your
application’s first screen&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Because users are likely to switch among applications frequently, you
should make every effort to cut launch time to a minimum, and you
should design a launch image that downplays the experience rather than
drawing attention to it.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The launch image is designed to make the perceived launch time of you app
feel faster by showing something resembling the interface that will be loaded
as quickly as possible. Displaying a logo does nothing but draw attention
to how quickly your app loads and adds nothing to the user's experience.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-09-24:/technical/2011/09/custom-search-engine-safari/</id>
    <title type="html">Add a Custom Search Engine to Safari</title>
    <published>2011-09-24T05:34:00Z</published>
    <updated>2011-09-24T05:34:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/09/custom-search-engine-safari/"/>
    <content type="html">&lt;p&gt;In my ongoing efforts to distance myself from Google I started using
&lt;a href="http://duckduckgo.com/"&gt;DuckDuckGo&lt;/a&gt; as my default search engine. I tried the DDG Safari
extension but didn't really like it, especially
since it needed to add an entire new toolbar to the browser. Other
suggestions for adding DDG to Safari involved &lt;a href="http://hints.macworld.com/article.php?story=20030514035516436"&gt;hacking the binary&lt;/a&gt;
or other extensions, which I wasn't interested in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; There an easier way to achive what I describe below: Just
add a hosts file entry for search.yahoo.com that points at DuckDuckGo's
IP address and set you search engine to Yahoo! in Safari. &lt;a href="http://help.duckduckgo.com/customer/portal/articles/255650"&gt;See DuckDuckGo
for the full instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My solution to the problem was to hijack the Bing option in the default
search box for use with DDG. &lt;strong&gt;Note:&lt;/strong&gt; This solution assumes you will
never want to go to the &lt;code&gt;www.bing.com&lt;/code&gt; domain, not a problem for me. The
steps to implement it are:&lt;/p&gt;

&lt;p&gt;Add an entry for &lt;code&gt;www.bing.com&lt;/code&gt; to &lt;code&gt;/etc/hosts&lt;/code&gt; that points the domain to
your local machine:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;127.0.0.1    www.bing.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next configure an Apache virtual machine to respond to the &lt;code&gt;www.bing.com&lt;/code&gt;
domain and redirect the request to Duck Duck Go (or your search engine
of choice). This works because DDG accepts the search query in the same
query string parameter, &lt;code&gt;q&lt;/code&gt;, as Bing and ignores the other Bing related
params.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/etc/apache2/extra/httpd-vhosts.conf&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerName www.bing.com
    RewriteEngine On
    RewriteRule ^/search(.*)$ http://duckduckgo.com/$1 [redirect,last]
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For this to work you will need to have "Web Sharing" enabled in the Sharing
preferences pane and have the the following line included in
&lt;code&gt;/etc/apache2/httpd.conf&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Include /private/etc/apache2/extra/httpd-vhosts.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Restart Apache (&lt;code&gt;sudo apachectl graceful&lt;/code&gt;) and set your search engine
to Bing in Safari. Do a search and you should end up at the DDG
results. One of the neat features of DDG is its &lt;a href="http://duckduckgo.com/bang.html"&gt;!bang syntax&lt;/a&gt;,
which allows you to search to 100s of sites directly. One of which is
&lt;code&gt;!g&lt;/code&gt; for those times when you need to fall back on Google.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-08-27:/technical/2011/08/strip-trailing-whitespace-xcode-4/</id>
    <title type="html">Strip Trailing Whitespace in Xcode 4</title>
    <published>2011-08-27T09:36:00Z</published>
    <updated>2011-08-27T09:36:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/08/strip-trailing-whitespace-xcode-4/"/>
    <content type="html">&lt;p&gt;Xcode has a bad habit of adding trailing whitespace to code, which is a pet
peeve of mine. It introduces irrelevant changes into diffs and is particularly
glaring when commiting code with &lt;a href="http://gitx.frim.nl/"&gt;GitX&lt;/a&gt;, which highlights it in red. In &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;
and now &lt;a href="http://www.vicoapp.com/"&gt;Vico&lt;/a&gt; I have bound the strip trailing whitespace in current document
action to ⌃⌥⌘S (control-option-command-s). This makes it quick and easy.
Xcode makes adding these types of actions a bit harder but I came up with a
solution that uses the Behaviours functionality in Xcode 4. This is how I did
it:&lt;/p&gt;

&lt;p&gt;Create a shell script that invokes &lt;code&gt;sed&lt;/code&gt; on each git tracked file that is
modified. Since Xcode doesn't tell the script what the current file was and
I didn't want to run sed over every file every time, processing tracked files
with modifications was the best solution I could come up with. Note that the
script also only prcocesses &lt;code&gt;.m&lt;/code&gt; and &lt;code&gt;.h&lt;/code&gt; files. I have my copy of the script
in &lt;code&gt;~/Documents/strip.sh&lt;/code&gt;, be sure to give it the execute permission.&lt;/p&gt;

&lt;script src="https://gist.github.com/1175182.js?file=strip.sh"&gt;&lt;/script&gt;


&lt;p&gt;Next you need to add a behaviour to Xcode. Go to the Xcode preferences and
click the Behaviours section, then click the + button. Name the behaviour and
give it a keyboard shortcut. In the right pane check Run and choose the script
you saved above. That's it. Now you can kill off that nasty whitespace with
ease.&lt;/p&gt;

&lt;p&gt;&lt;a href="/images/2011/08/xcode-behaviours-preferences.png" rel="prettyPhoto[xcode]"&gt;&lt;img src="/images/2011/08/xcode-behaviours-preferences-small.png" width="600" height="423" alt="Xcode 4 Behaviours Preferences" /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-08-27:/technical/2011/08/monochrome-thumbnails/</id>
    <title type="html">Monochrome Thumbnails</title>
    <published>2011-08-27T08:54:00Z</published>
    <updated>2011-08-27T08:54:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/technical/2011/08/monochrome-thumbnails/"/>
    <content type="html">&lt;p&gt;Ever since this version of my site went live I've been meaning to
post about the generation of the monochrome thumbnails on the &lt;a href="/"&gt;front page&lt;/a&gt;.
When I was building the site I wanted to include recent items
from my Flickr photostream. However with the predominantly monochrome
design I didn't like the look of all the colour they added. So I looked into
having monochrome versions of the thumbnails shown.&lt;/p&gt;

&lt;p&gt;The first thing I investigated was Javascript image processing libraries. The
only main contender in that space was &lt;a href="http://pixastic.com/"&gt;Pixastic&lt;/a&gt;. It worked but its cross browser
support wasn't great at the time. So I moved on to writing a tool that I
could run locally.&lt;/p&gt;

&lt;p&gt;I decided the tool should generate a single image with
both the colour and monochrome versions in it (a technique known as spriting).
Using a single image means only one HTTP request instead of forty. Being a
programmer with an interest in Cocoa programming I created a small command line
tool that used the Flickr API to get the details of the last twenty images in
my photostream, fetch them and then use Core Image to convert them to
monochrome, add both the colour and monochrome versions to the output image and
finally save the result.&lt;/p&gt;

&lt;p&gt;This worked great, however when I stopped hosting my site on my Mac I thought I
would need to run the process periodically on my Linux server, which ruled out
Core Image. I took this as another opportunity to learn something new and
rewrote it in Lua using imlib2 bindings. I had to make some additions to the
imlib bindings, which are &lt;a href="https://github.com/wezm/lua-imlib2"&gt;published on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I used the Lua version for some time but never bothered to set it up
on the server. I wasn't uploading photos all that frequently and it
was simple enough to run locally and rsync the result. I've recently
switched back to the Mac version as it was simpler to get up and running
on my new laptop.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/wezm/monothumb"&gt;code is on GitHub&lt;/a&gt; if anyone wants to do something similar. The
Cocoa version is on the master branch, the Lua version is on the
&lt;a href="https://github.com/wezm/monothumb/tree/lua"&gt;lua branch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The current version of the processed thumbnails is shown below.&lt;/p&gt;

&lt;div style="overflow-x: auto; overflow-y: hidden;"&gt;
  &lt;img src="/images/photos.jpg"  /&gt;
&lt;/div&gt;

</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-06-06:/personal/2011/06/06/touch-typing/</id>
    <title type="html">Touch Typing</title>
    <published>2011-06-06T07:15:00Z</published>
    <updated>2011-06-06T07:15:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/personal/2011/06/06/touch-typing/"/>
    <content type="html">&lt;p&gt;Being a professional programmer I spend plenty of time in front of a
keyboard. Unfortunately I never learned to touch type. Instead I developed my
own style of typing that uses all my fingers but requires me to look at the
keyboard. I've made a couple of attempts over the years to break this habit
but always reverted to my old ways, primarily due to the large speed difference.&lt;/p&gt;

&lt;p&gt;The topic came up during our Monday meeting today and it renewed my desire to break
the habit. I've decided that committing publicly may help motivate me.&lt;/p&gt;

&lt;p&gt;As the first step in this process I've painstakingly typed this whole post
without looking at my hands. It's taken a long time, let's hope that improves
quickly.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:www.wezm.net,2011-03-13:/personal/2011/03/polyphasic-sleep-experiment-over/</id>
    <title type="html">Polyphasic Sleep Experiment Over</title>
    <published>2011-03-13T10:34:00Z</published>
    <updated>2011-03-13T10:34:00Z</updated>
    <link rel="alternate" href="http://www.wezm.net/personal/2011/03/polyphasic-sleep-experiment-over/"/>
    <content type="html">&lt;p&gt;For anyone following along you may have noticed a lack of updates on my
&lt;a href="/personal/2011/01/polyphasic-sleep-schedule/"&gt;polyphasic sleep schedule&lt;/a&gt;. Sadly, as is frequently the case it
seems when people document their experiences with a sleep schedule, mine has
also come to an end. There were a number of factors, but ultimately getting
sick as a result of the schedule was the tipping point.&lt;/p&gt;

&lt;p&gt;In the weekend of my sixth week I attended a friends house warming. I had
intended to leave in time to be home for my core sleep however due to the
nominated chef of the eventing arriving late that wasn't the case. I tried
taking my evening nap in the car but I didn't sleep properly. When I got home
I slept for the core three hours.&lt;/p&gt;

&lt;p&gt;The following day I had a family lunch to attend. This time I had to take my
midday nap in the car and I didn't sleep in that one either, however I did
feel refreshed for a couple of hours. My evening nap coincided with the trip
home (my Dad was driving). Again this one was of little value.&lt;/p&gt;

&lt;p&gt;During Monday I came down with cold like symptoms as well as a persistent
headache. I went to bed early Monday night but got up on time. However after
only a couple of hours I was nodding off. I grabbed another nap but still felt
super tired. I slept for another hour and half but didn't feel well enough to
go to work. I tried doing some reading but was falling asleep so I went to bed
again and slept from 10 until 1. After that sleep I felt heaps better and the
cold symptoms had greatly reduced. Tuesday night I resumed a monophasic
schedule and returned to work on Wednesday.&lt;/p&gt;

&lt;p&gt;On Wednesday it was great to not feel tired and significantly, be able to
remain awake and productive on the train. I also felt more productive at work
since I felt more switched on and not just fighting to remain awake.&lt;/p&gt;

&lt;p&gt;Going into the experiment I underestimated the social aspect. I didn't think I
had that many social events these days and that those I did have I could work
around. This proved more difficult than I thought.&lt;/p&gt;

&lt;p&gt;If I were to do it again I would not be a strict around only having a three
hour core sleep and three naps. I think that once I'd experienced the shift
from light to deep naps I would take a nap whenever I felt it was needed
(within reason). The problem with sticking rigidly to the schedule is that
there's no leeway for bad naps or anything like that.&lt;/p&gt;

&lt;p&gt;So all in all it was an interesting experiment but for now I don't think it
works for me long term. I've lost about three hours of useful time but I am
enjoying being able to go the whole day without napping, not worrying about
where I'll be, come nap time and not having to worry about being invited out
to things. Its also great to have a pleasant, productive train ride again.&lt;/p&gt;
</content>
  </entry>
</feed>


