<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>This and that. Brick and brack.</description><title>Mintyfresh</title><generator>Tumblr (3.0; @mintyfresh)</generator><link>http://blog.damacy.net/</link><item><title>Installing PostgreSQL Server on OS X 10.6 using MacPorts</title><description>&lt;p&gt;Installing PostgreSQL server using MacPorts used to be a simple matter. For some reason, using the latest MacPorts 2.0.3 on Snow Leopard seems to break the relatively simple install process.&lt;/p&gt;

&lt;p&gt;The main problem is the install process doesn&amp;#8217;t create the &lt;code&gt;postgres&lt;/code&gt; user and group. This is done during the &lt;code&gt;destroot&lt;/code&gt; phase of the install process, which doesn&amp;#8217;t seem to be run automatically anymore.&lt;/p&gt;

&lt;p&gt;Luckily, you can manually run the &lt;code&gt;destroot&lt;/code&gt; phase. The following example shows you how to install PostgreSQL 8.4 server:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port install postgresql84-server
sudo port destroot postgresql84-server
sudo port clean postgresql84-server
&lt;/pre&gt;

&lt;p&gt;Now you can happily create the defaultdb and assign the proper user and group ownership.&lt;/p&gt;

&lt;p&gt;Note that the problem only seems to happen on Snow Leopard, and not on Lion.&lt;/p&gt;</description><link>http://blog.damacy.net/post/13149137818</link><guid>http://blog.damacy.net/post/13149137818</guid><pubDate>Mon, 21 Nov 2011 22:19:00 -0800</pubDate><category>MacPorts</category><category>OS X</category></item><item><title>Compiling MacPorts Python on Lion using GCC</title><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Edit&lt;/strong&gt;: As of November 21, 2011, this is fixed. See &lt;a href="https://trac.macports.org/ticket/30031"&gt;&lt;a href="https://trac.macports.org/ticket/30031"&gt;https://trac.macports.org/ticket/30031&lt;/a&gt;&lt;/a&gt; for more information.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I use MacPorts for my Python installations. With the latest Xcode 4.2, MacPorts uses &lt;code&gt;clang&lt;/code&gt; as the default compiler. This causes all sorts of fun with decimal arithmetics, such as:&lt;/p&gt;

&lt;pre class="sh_python"&gt;
$ python
Python 2.6.7 (r267:88850, Oct 28 2011, 17:33:57) 
[GCC 4.2.1 Compatible Apple Clang 3.0] on darwin
&amp;gt;&amp;gt;&amp;gt; from decimal import Decimal
&amp;gt;&amp;gt;&amp;gt; Decimal(10)/Decimal(5)
Decimal('8.955976040786690048E-10')
&lt;/pre&gt;

&lt;p&gt;Note that Python is compiled with Clang 3.0.&lt;/p&gt;

&lt;p&gt;The fix is to compile Python with GCC. The easiest way to accomplish this is to edit the &lt;code&gt;Portfile&lt;/code&gt; and for MacPorts to use a specific compiler.&lt;/p&gt;

&lt;p&gt;MacPorts keeps a local version of available Python ports at:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For example, Python 2.6 is at:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/python26
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Edit &lt;code&gt;Portfile&lt;/code&gt; and add the following line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;configure.compiler gcc-4.2
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I add it in the &lt;code&gt;# ensure that correct compiler is used&lt;/code&gt; section, before &lt;code&gt;configure.cc&lt;/code&gt; is used, like so:&lt;/p&gt;

&lt;pre class="sh_log"&gt;
# ensure that correct compiler is used
configure.compiler gcc-4.2
build.args-append       MAKE="${build.cmd} CC=${configure.cc}"
destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
&lt;/pre&gt;

&lt;p&gt;Now recompile python:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port -n upgrade --force python26
&lt;/pre&gt;

&lt;p&gt;After waiting for a while everything will be OK again:&lt;/p&gt;

&lt;pre class="sh_python"&gt;
$ python
Python 2.6.7 (r267:88850, Oct 29 2011, 21:09:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
&amp;gt;&amp;gt;&amp;gt; from decimal import Decimal
&amp;gt;&amp;gt;&amp;gt; Decimal(10)/Decimal(5)
Decimal('2')
&lt;/pre&gt;

&lt;p&gt;Note that Python is now compiled with GCC 4.2.1.&lt;/p&gt;

&lt;p&gt;The steps I described is a hack and the next time you perform &lt;code&gt;port selfupdate&lt;/code&gt; your changes will be wiped out. But I imagine this bug will be fixed before you have to update Python again. If you want to do things properly by setting up your own local repository, see the &lt;a href="http://guide.macports.org/chunked/development.local-repositories.html"&gt;MacPorts guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You should obviously recompile all versions of MacPorts Python you use, as this bug isn&amp;#8217;t isolated to 2.6.&lt;/p&gt;

&lt;p&gt;For more detailed discussions on the bug, see:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="https://trac.macports.org/ticket/31444"&gt;The MacPorts ticket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://bugs.python.org/issue11149"&gt;The Python ticket&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For information on selecting the right compiler for MacPorts, see the &lt;a href="https://trac.macports.org/wiki/UsingTheRightCompiler"&gt;wiki page&lt;/a&gt;.&lt;/p&gt;</description><link>http://blog.damacy.net/post/12104768819</link><guid>http://blog.damacy.net/post/12104768819</guid><pubDate>Sat, 29 Oct 2011 22:16:00 -0700</pubDate><category>MacPorts</category><category>OS X</category></item><item><title>Automatically Unmount External Drives On Sleep</title><description>&lt;p&gt;One of the features I want with my laptop is to be able to put it to sleep  and be ready to go. Ideally I can accomplish this by simply closing the lid.&lt;/p&gt;

&lt;p&gt;There are two issues that prevent me from doing this currently on OS X Lion:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;p&gt;If I&amp;#8217;m using an external monitor, instead of going to sleep, Lion moves all the windows to the external monitor&lt;sup id="fnref:p9377132648-3"&gt;&lt;a href="#fn:p9377132648-3" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When I&amp;#8217;m at home, I always have external drives connected to my laptop. I have to consciously unmount the drives or else I get the dreaded &amp;#8220;disk not ejected properly&amp;#8221; message when I wake up the laptop.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Currently there doesn&amp;#8217;t appear to be a way to affect the lid closing behavior so I just have to manually put the laptop to sleep. However, there is a way to automatically unmount external drives on sleep.&lt;sup id="fnref:p9377132648-1"&gt;&lt;a href="#fn:p9377132648-1" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;The primary tool I&amp;#8217;m using is &lt;a href="http://www.bernhard-baehr.de/"&gt;SleepWatcher&lt;/a&gt;, a daemon which monitors sleep and wakeup events of a Mac. I&amp;#8217;ll walk through the installation of SleepWatcher and the creation of associated scripts to unmount external drives on sleep and mount them on wakeup.&lt;/p&gt;

&lt;h3&gt;Installing SleepWatcher&lt;/h3&gt;

&lt;p&gt;If you use &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt;, it&amp;#8217;s as simple as:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;code&gt;sudo port install sleepwatcher&lt;/code&gt; to install the binary, man page, launchd configuration file, and system-wide sleep and wake up scripts.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo port load sleepwatcher&lt;/code&gt; to load the launchd configuration.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;If you don&amp;#8217;t use MacPorts, download the latest version of SleepWatcher from &lt;a href="http://www.bernhard-baehr.de/"&gt;&lt;a href="http://www.bernhard-baehr.de/"&gt;http://www.bernhard-baehr.de/&lt;/a&gt;&lt;/a&gt; and follow the instructions in the ReadMe.rtf.&lt;/p&gt;

&lt;h3&gt;Create the .sleep script&lt;/h3&gt;

&lt;p&gt;The system-wide sleep script iterates through each user&amp;#8217;s home directory looking for a &lt;code&gt;.sleep&lt;/code&gt; script and executes the script as the user&lt;sup id="fnref:p9377132648-4"&gt;&lt;a href="#fn:p9377132648-4" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;. Follow these steps to create the script:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;code&gt;cat &amp;gt; $HOME/.sleep&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Paste the following into your terminal:&lt;/li&gt;
&lt;/ol&gt;&lt;pre class="sh_sh"&gt;
#!/bin/sh
osascript -e 'tell application "Finder" to eject disks'
&lt;/pre&gt;

&lt;ol&gt;&lt;li&gt;⌃D (Ctrl-D) to terminate the input stream.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;chmod +x $HOME/.sleep&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;At this point you can test to see if your script is working properly by running &lt;code&gt;$HOME/.sleep&lt;/code&gt;. Your external hard drives should be unmounted.&lt;/p&gt;

&lt;h3&gt;Create the .wakeup script&lt;/h3&gt;

&lt;p&gt;This script is used to mount any &lt;abbr title="Hierarchical File System"&gt;HFS&lt;/abbr&gt; volumes that the laptop knows about upon waking up. Follow these steps to create the script:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;code&gt;cat &amp;gt; $HOME/.wakeup&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Paste the following into your terminal:&lt;/li&gt;
&lt;/ol&gt;&lt;pre class="sh_sh"&gt;
#!/bin/sh
/usr/sbin/diskutil list | \
  awk '/Apple_HFS/ {print $NF}' | \
  xargs -I{} /usr/sbin/diskutil mount {}
&lt;/pre&gt;

&lt;ol&gt;&lt;li&gt;⌃D (Ctrl-D) to terminate the input stream.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;chmod +x $HOME/.wakeup&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Test the script by running &lt;code&gt;$HOME/.wakeup&lt;/code&gt;. Your external drives should be mounted.&lt;/p&gt;

&lt;p&gt;That&amp;#8217;s it. Now when you sleep your computer, any external drives should automatically be unmounted&lt;sup id="fnref:p9377132648-2"&gt;&lt;a href="#fn:p9377132648-2" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt;. Upon wakeup, any &lt;abbr title="Hierarchical File System"&gt;HFS&lt;/abbr&gt; volumes should automatically be mounted.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p9377132648-3"&gt;
&lt;p&gt;Basically, with more than one monitor hooked up to the laptop, the lid acts as an on/off switch for the laptop monitor. &lt;a href="#fnref:p9377132648-3" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p9377132648-1"&gt;
&lt;p&gt;I&amp;#8217;m only dealing with external USB/Firewire &lt;abbr title="Hierarchical File System"&gt;HFS&lt;/abbr&gt; drives. The one test I ran with a USB key fob and Samba network share worked fine. Test everything out in your own environment! &lt;a href="#fnref:p9377132648-1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p9377132648-4"&gt;
&lt;p&gt;Since I&amp;#8217;m always logged in as an admin user, I created my &lt;code&gt;.sleep&lt;/code&gt; and &lt;code&gt;.wakeup&lt;/code&gt; scripts in my home directory. If you log in as a user that can&amp;#8217;t mount/unmount drives, then you should modify the system-wide &lt;code&gt;rc.sleep&lt;/code&gt; and &lt;code&gt;rc.wakeup&lt;/code&gt; scripts, or create your &lt;code&gt;.sleep&lt;/code&gt; and &lt;code&gt;.wakeup&lt;/code&gt; scripts in the admin user&amp;#8217;s home directory. &lt;a href="#fnref:p9377132648-4" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p9377132648-2"&gt;
&lt;p&gt;There is still a chance that this may not work if a process has a file lock on a specific volume. In my testing this has worked fine with Time Machine, which will stop the backup properly. &lt;a href="#fnref:p9377132648-2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.damacy.net/post/9377132648</link><guid>http://blog.damacy.net/post/9377132648</guid><pubDate>Thu, 25 Aug 2011 09:00:05 -0700</pubDate><category>OS X</category><category>tips</category></item><item><title>MacPorts Maintenance</title><description>&lt;p&gt;I use MacPorts to install add-ons for my Mac in an isolated way from the core OS. This is the routine I go through to keep my ports up to date and as lean as possible.&lt;/p&gt;

&lt;p&gt;I typically run updates once a month, and this is the procedure I use.&lt;/p&gt;

&lt;p&gt;The first thing is to update MacPorts itself:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port selfupdate
&lt;/pre&gt;

&lt;p&gt;I keep older versions of ports around for one update revision in case I need to roll back, so let&amp;#8217;s remove those inactive ports.&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port uninstall inactive
&lt;/pre&gt;

&lt;p&gt;Are any leaves that we can get rid of&lt;sup id="fnref:p5452028534-1"&gt;&lt;a href="#fn:p5452028534-1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
port echo leaves
&lt;/pre&gt;

&lt;p&gt;To uninstall the leaves:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port uninstall leaves
&lt;/pre&gt;

&lt;p&gt;Now we can upgrade our ports:&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
sudo port upgrade outdated
&lt;/pre&gt;

&lt;p&gt;And you&amp;#8217;re all set until the next update.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p5452028534-1"&gt;
&lt;p&gt;&lt;a href="http://guide.macports.org/#using.common-tasks"&gt;&lt;a href="http://guide.macports.org/#using.common-tasks"&gt;http://guide.macports.org/#using.common-tasks&lt;/a&gt;&lt;/a&gt;. You can mark certain ports as requested, preventing them from being reported as leaves, i.e.: &lt;code&gt;sudo port -d setrequested autoconf help2man p5-locale-gettext m4 automake libtool pkgconfig&lt;/code&gt; &lt;a href="#fnref:p5452028534-1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.damacy.net/post/5452028534</link><guid>http://blog.damacy.net/post/5452028534</guid><pubDate>Fri, 13 May 2011 09:00:05 -0700</pubDate><category>MacPorts</category><category>tips</category><category>OS X</category></item><item><title>To a Mentor, Bart Jackson</title><description>&lt;p&gt;There are two managers and one teacher whom I would consider my mentors. When I was 21, my manager, Bart Jackson, shaped so many aspects of my life with just couple sentences during a meeting.&lt;/p&gt;

&lt;p&gt;&amp;#8220;If you want something done, get anyone to do it. If you want something done right, get George to do it.&amp;#8221;&lt;/p&gt;

&lt;p&gt;With that, he set me on a never-ending pursuit of craftsmanship.&lt;/p&gt;

&lt;p&gt;I worked for Bart in the IT department at The North Face&lt;sup id="fnref:p4898688731-1"&gt;&lt;a href="#fn:p4898688731-1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;. With almost no experience whatsoever, I suddenly found myself in charge of the entire networking infrastructure of the headquarters, the warehouse, 20 or so stores around the country, and offices in Glasgow and Toronto.&lt;/p&gt;

&lt;p&gt;Of course it wasn&amp;#8217;t all at once. Bart very smartly had me introduce PCs here and there to replace dumb terminals, allowing me to build up my confidence and trust with our customers. But it was a fast ride from teaching accounting how to use Lotus-123&lt;sup id="fnref:p4898688731-2"&gt;&lt;a href="#fn:p4898688731-2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; to developing complex databases that ran the whole business. I studied far more for work in those three years than for the UC Berkeley classes I was attending at the same time.&lt;/p&gt;

&lt;p&gt;That was the easy part. I learned that technical challenges can be tough but usually have tangible and tidy solutions. For most issues that we encounter, the willingness of people to change their process or frame of reference is a much tougher nut to crack.&lt;/p&gt;

&lt;p&gt;Bart allowed me to reach far beyond my knowledge, and deep into my capabilities. He allowed me to learn professionalism and self-discipline with invisible guidance, rather than imposing his will on me. Most importantly, he created the space for me to nurture my critical thinking and creative skills by giving me more freedom, not more constraints.&lt;/p&gt;

&lt;p&gt;I learned that Bart spent most of his time removing obstacles for his team. He was very good at keeping the bullshit from our group, but always keeping us informed. He also made sure the good work of the department was acknowledged throughout the company. We were able to interact with our customers in a very positive, cooperative, and productive way.&lt;/p&gt;

&lt;p&gt;This pride and self-confidence came at the expense of others. The context of being better is almost always in comparison with another department or another person. While some people (like me) thrived on the competition, the effect was demoralizing for others. This too, is something that I carry with me and try very hard not to repeat.&lt;/p&gt;

&lt;p&gt;I kept in touch with Bart off and on after we both left The North Face, with the communication trailing off the past 5 years. We never made the transition from a professional relationship to a friendship. Few weeks ago, I received a Facebook friend request from him and I was delighted.&lt;/p&gt;

&lt;p&gt;There, on his wall, a single post announced his memorial, with the comments full of fond farewells and how he will be missed.&lt;/p&gt;

&lt;p&gt;I won&amp;#8217;t miss Bart, because it&amp;#8217;s clear to me how much I&amp;#8217;ve incorporated him into my work ethics, my management style, and indeed, my personality.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p4898688731-1"&gt;
&lt;p&gt;&lt;a href="http://www.thenorthface.com"&gt;http://www.thenorthface.com&lt;/a&gt; &lt;a href="#fnref:p4898688731-1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4898688731-2"&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Lotus_1-2-3%C2%A0"&gt;http://en.wikipedia.org/wiki/Lotus_1-2-3 &lt;/a&gt;&lt;a href="#fnref:p4898688731-2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.damacy.net/post/4898688731</link><guid>http://blog.damacy.net/post/4898688731</guid><pubDate>Sun, 24 Apr 2011 09:26:00 -0700</pubDate><category>Musing</category></item><item><title>Form and Function</title><description>&lt;p&gt;Form and function is a difficult balance to strike, even in something as trivial as a mobile phone case.&lt;/p&gt;

&lt;p&gt;I recently crashed on my bike while riding to work one morning. I skidded along the pavement rounding a slick corner at high speeds. In the process, I shredded the corner of the Apple Bumper&lt;sup id="fnref:p4574046628-1"&gt;&lt;a href="#fn:p4574046628-1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; on my iPhone 4.&lt;/p&gt;

&lt;p&gt;I got the bumper when Apple was giving them away for free, and have had a lukewarm relationship with it. Because it was designed to fit the iPhone form factor so perfectly, I had two problems with the bumper:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;I could not use my Etymotic&lt;sup id="fnref:p4574046628-3"&gt;&lt;a href="#fn:p4574046628-3" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; headphones without removing the bumper since the headphone cutout will only accept jacks shaped like the Apple supplied headphones.&lt;/li&gt;
&lt;li&gt;The USB connector from my older iPod nano won&amp;#8217;t fit on the phone with the case on.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;The headphone issue was a big deal as I often ride BART&lt;sup id="fnref:p4574046628-2"&gt;&lt;a href="#fn:p4574046628-2" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt; to and from San Francisco. I need the noise isolation because the trains are just so loud. It&amp;#8217;s also the perfect time to catch up with some podcasts.&lt;/p&gt;

&lt;p&gt;Why use the bumper at all? Well, the glass-on-both-sides design makes it difficult to set the phone down on a variety of surfaces. The bumper gives it enough lift so that&amp;#8217;s no longer a worry. Really, that was the only reason for me—until I crashed.&lt;/p&gt;

&lt;p&gt;I had always thought that if the bumper wears out I would just go without, but imagining what a naked phone would have been like after the crash made me reconsider.&lt;/p&gt;

&lt;p&gt;I did what any good tech geek would do and spent far too much time scrutinizing the specs and reviews online for a $20 item. The Griffin Elan Form Graphite&lt;sup id="fnref:p4574046628-4"&gt;&lt;a href="#fn:p4574046628-4" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt; seemed to fit the bill:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;Fairly unobtrusive&lt;/li&gt;
&lt;li&gt;Black&lt;/li&gt;
&lt;li&gt;Allows me to set the phone down, front or back, on a hard surface&lt;/li&gt;
&lt;li&gt;Has cutouts that eliminate the problems I had with my headphones and USB connector&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;When I put the case on, my iPhone immediately ceased to look and feel like an iPhone anymore. The clean lines are replaced by weird angles and bumps. The shininess of the case competed with the iPhone. And worst of all, it made the whole phone feel cheap to hold in my hand.&lt;/p&gt;

&lt;p&gt;One of the things I enjoy the most about the iPhone 4 is the feel of the glass. There&amp;#8217;s a certain silkiness and softness to the touch. With the new case which covers the entire back, I can&amp;#8217;t enjoy that really nice sensation of just touching the phone while I&amp;#8217;m walking or on the train.&lt;/p&gt;

&lt;p&gt;While I admire the industrial design of the iPhone 4, holding it raw with the steel band was uncomfortable for me while talking on the phone. The bumper felt perfect. The Griffin, not so much.&lt;/p&gt;

&lt;p&gt;So, there is something to be said about form over function. On paper, the Griffin is a better fit for my use case. But there is the very tangible pleasure of using the Apple Bumper which I never thought about until now, when I miss it.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p4574046628-1"&gt;
&lt;p&gt;&lt;a href="http://store.apple.com/us/product/MC668ZM/B%C2%A0"&gt;http://store.apple.com/us/product/MC668ZM/B &lt;/a&gt;&lt;a href="#fnref:p4574046628-1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4574046628-3"&gt;
&lt;p&gt;&lt;a href="http://www.etymotic.com/ephp/er4.html%C2%A0"&gt;http://www.etymotic.com/ephp/er4.html &lt;/a&gt;&lt;a href="#fnref:p4574046628-3" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4574046628-2"&gt;
&lt;p&gt;&lt;a href="http://www.bart.gov/%C2%A0"&gt;http://www.bart.gov/ &lt;/a&gt;&lt;a href="#fnref:p4574046628-2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4574046628-4"&gt;
&lt;p&gt;&lt;a href="http://www.griffintechnology.com/products/elan-form-graphite-iphone4%C2%A0"&gt;http://www.griffintechnology.com/products/elan-form-graphite-iphone4 &lt;/a&gt;&lt;a href="#fnref:p4574046628-4" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.damacy.net/post/4574046628</link><guid>http://blog.damacy.net/post/4574046628</guid><pubDate>Tue, 12 Apr 2011 22:44:00 -0700</pubDate><category>musing</category></item><item><title>Converting an O'Reilly iOS app to EPUB</title><description>&lt;p&gt;I am currently learning Ruby on Rails&lt;sup id="fnref:p4253240406-6"&gt;&lt;a href="#fn:p4253240406-6" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;. Instead of diving right into Rails, I decided to learn the fundamentals of Ruby first by reading &lt;em&gt;The Ruby Programming Language&lt;/em&gt; from O&amp;#8217;Reilly&lt;sup id="fnref:p4253240406-4"&gt;&lt;a href="#fn:p4253240406-4" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;. Doing a bit of comparison shopping showed that purchasing the book as an iOS app&lt;sup id="fnref:p4253240406-5"&gt;&lt;a href="#fn:p4253240406-5" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt; was the best deal at $6.99.&lt;/p&gt;

&lt;p&gt;I downloaded the app and started reading and this is what I saw:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_liym0zc1Ws1qz4xbx.png" alt="Nasty code truncation"/&gt;&lt;/p&gt;

&lt;p&gt;Umm…completely unacceptable for a programming book. Since the app uses Stanza underneath the hood, I decided to crack open the package&lt;sup id="fnref:p4253240406-2"&gt;&lt;a href="#fn:p4253240406-2" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt; to see what&amp;#8217;s going on.&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
mkdir ~/ruby_book
cp ~/Music/iTunes/"iTunes Media/Mobile Applications/Prog Lang 1.0.ipa" ~/ruby_book
cd ruby_book
unzip "Prog Lang 1.0.ipa"
&lt;/pre&gt;

&lt;p&gt;Digging around revealed the Open Publication Structure&lt;sup id="fnref:p4253240406-3"&gt;&lt;a href="#fn:p4253240406-3" rel="footnote"&gt;5&lt;/a&gt;&lt;/sup&gt;. Some Googling quickly led me to Bob DuCharme&amp;#8217;s blog entry&lt;sup id="fnref:p4253240406-1"&gt;&lt;a href="#fn:p4253240406-1" rel="footnote"&gt;6&lt;/a&gt;&lt;/sup&gt; about the proper way to create an &lt;abbr title="electronic publication"&gt;EPUB&lt;/abbr&gt; file.&lt;/p&gt;

&lt;pre class="sh_sh"&gt;
cd "Payload/Prog Lang.app/book/"
zip -q0X "The Ruby Programming Language.epub" mimetype
zip -qXr9D "The Ruby Programming Language.epub" *
&lt;/pre&gt;

&lt;p&gt;Voilà, our very own &lt;abbr title="electronic publication"&gt;EPUB&lt;/abbr&gt; book that can be viewed using iBooks:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_liym2kH8rS1qz4xbx.png" alt="Happy iBooks"/&gt;&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p4253240406-6"&gt;
&lt;p&gt;&lt;a href="http://rubyonrails.org/"&gt;&lt;a href="http://rubyonrails.org/"&gt;http://rubyonrails.org/&lt;/a&gt;&lt;/a&gt; &lt;a href="#fnref:p4253240406-6" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4253240406-4"&gt;
&lt;p&gt;&lt;a href="http://oreilly.com/catalog/9780596516178"&gt;&lt;a href="http://oreilly.com/catalog/9780596516178"&gt;http://oreilly.com/catalog/9780596516178&lt;/a&gt;&lt;/a&gt; &lt;a href="#fnref:p4253240406-4" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4253240406-5"&gt;
&lt;p&gt;&lt;a href="http://itunes.apple.com/us/app/the-ruby-programming-language/id327742973?mt=8"&gt;&lt;a href="http://itunes.apple.com/us/app/the-ruby-programming-language/id327742973?mt=8"&gt;http://itunes.apple.com/us/app/the-ruby-programming-language/id327742973?mt=8&lt;/a&gt;&lt;/a&gt; &lt;a href="#fnref:p4253240406-5" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4253240406-2"&gt;
&lt;p&gt;In iTunes, right click the app and &lt;em&gt;Show in Finder&lt;/em&gt; to find the path of the app package. &lt;a href="#fnref:p4253240406-2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4253240406-3"&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1"&gt;&lt;a href="http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1"&gt;http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1&lt;/a&gt;&lt;/a&gt; &lt;a href="#fnref:p4253240406-3" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p4253240406-1"&gt;
&lt;p&gt;&lt;a href="http://www.snee.com/bobdc.blog/2008/03/creating-epub-files.html"&gt;&lt;a href="http://www.snee.com/bobdc.blog/2008/03/creating-epub-files.html"&gt;http://www.snee.com/bobdc.blog/2008/03/creating-epub-files.html&lt;/a&gt;&lt;/a&gt; &lt;a href="#fnref:p4253240406-1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.damacy.net/post/4253240406</link><guid>http://blog.damacy.net/post/4253240406</guid><pubDate>Thu, 31 Mar 2011 23:12:00 -0700</pubDate><category>iOS</category><category>EPUB</category></item><item><title>Video</title><description>&lt;iframe src="http://player.vimeo.com/video/3114617" width="400" height="170" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.damacy.net/post/165900141</link><guid>http://blog.damacy.net/post/165900141</guid><pubDate>Tue, 18 Aug 2009 12:33:22 -0700</pubDate></item><item><title>Lines &amp; Shapes</title><description>&lt;a href="http://linesandshapesconnectus.com/book_volume7.html"&gt;Lines &amp; Shapes&lt;/a&gt;</description><link>http://blog.damacy.net/post/91638347</link><guid>http://blog.damacy.net/post/91638347</guid><pubDate>Tue, 31 Mar 2009 12:16:47 -0700</pubDate></item><item><title>This is difficult to watch.</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/sUh6xVlndhM?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is difficult to watch.&lt;/p&gt;</description><link>http://blog.damacy.net/post/76293832</link><guid>http://blog.damacy.net/post/76293832</guid><pubDate>Fri, 06 Feb 2009 18:26:31 -0800</pubDate></item><item><title>If I Made a Commercial for Trader Joe’s (via...</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/OdB7GDZY3Pk?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;If I Made a Commercial for Trader Joe’s (via &lt;a href="http://youtube.com/user/carlsfinefilms"&gt;carlsfinefilms&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.damacy.net/post/76289179</link><guid>http://blog.damacy.net/post/76289179</guid><pubDate>Fri, 06 Feb 2009 18:00:00 -0800</pubDate></item><item><title>Origami In the Pursuit of Perfection on Vimeo (via Vimeo)</title><description>&lt;iframe src="http://player.vimeo.com/video/2188162" width="400" height="225" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Origami In the Pursuit of Perfection on Vimeo (via &lt;a href="http://vimeo.com/2188162"&gt;Vimeo&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.damacy.net/post/74481328</link><guid>http://blog.damacy.net/post/74481328</guid><pubDate>Fri, 30 Jan 2009 21:06:47 -0800</pubDate></item><item><title>F*****F</title><description>&lt;a href="http://www.trickoficon.com/"&gt;F*****F&lt;/a&gt;: &lt;p&gt;Quelle fun.&lt;/p&gt;</description><link>http://blog.damacy.net/post/67714207</link><guid>http://blog.damacy.net/post/67714207</guid><pubDate>Wed, 31 Dec 2008 12:48:29 -0800</pubDate></item><item><title>Um. Holy shit?</title><description>&lt;iframe src="http://player.vimeo.com/video/1778399" width="400" height="220" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Um. Holy shit?&lt;/p&gt;</description><link>http://blog.damacy.net/post/67438401</link><guid>http://blog.damacy.net/post/67438401</guid><pubDate>Mon, 29 Dec 2008 22:04:01 -0800</pubDate></item><item><title>We want to be heldWe want to keep it inHe and I sit in the sun...</title><description>&lt;img src="http://24.media.tumblr.com/YkDeIxU7chxs0hvuNloW2pCCo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;We want to be held&lt;br/&gt;We want to keep it in&lt;br/&gt;&lt;br/&gt;He and I sit in the sun and&lt;br/&gt;sew into each other’s skin&lt;br/&gt;with suture needles and&lt;br/&gt;thread, carving up a&lt;br/&gt;pattern of our arms as&lt;br/&gt;we float along this great&lt;br/&gt;river, close enough to &lt;br/&gt;separate the flesh&lt;br/&gt;&lt;br/&gt;We want to be healed&lt;br/&gt;We want to cut it out&lt;/p&gt;</description><link>http://blog.damacy.net/post/66808487</link><guid>http://blog.damacy.net/post/66808487</guid><pubDate>Thu, 25 Dec 2008 18:35:35 -0800</pubDate></item><item><title>Happy Christmas from AKQA</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/FgBUqJzgvBo?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Happy Christmas from AKQA&lt;/p&gt;</description><link>http://blog.damacy.net/post/65478185</link><guid>http://blog.damacy.net/post/65478185</guid><pubDate>Wed, 17 Dec 2008 19:44:41 -0800</pubDate></item><item><title>What is Bill O’Reilly smoking?</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/Zpmz2sKzg6g?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;What is Bill O’Reilly smoking?&lt;/p&gt;</description><link>http://blog.damacy.net/post/60607976</link><guid>http://blog.damacy.net/post/60607976</guid><pubDate>Wed, 19 Nov 2008 17:53:18 -0800</pubDate></item><item><title>Roads, Portishead</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/inx13j4NnQM?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;i&gt;Roads&lt;/i&gt;, Portishead&lt;/p&gt;</description><link>http://blog.damacy.net/post/60170546</link><guid>http://blog.damacy.net/post/60170546</guid><pubDate>Mon, 17 Nov 2008 12:50:09 -0800</pubDate></item><item><title>Random mystery email</title><description>&lt;p&gt;Hmm, one zebraage is far more mellifluous than one arrogant firefly.&lt;br/&gt;Gosh, the dictionary is more prissy than some wrong dragonfly!&lt;br/&gt;Hello, that Labrador is less rigid than the licentious insect!&lt;br/&gt;A robin is far less mean than that divisive wasp.&lt;br/&gt;Why is much more energy hazy than this walking stick?&lt;br/&gt;Some blood is less caudal than that obedient panther.&lt;br/&gt;Jeez, a seal is far less inconsiderate than some visceral hippopotamus.&lt;br/&gt;That Dalmatian is much more flexible than a generous cuckoo!&lt;br/&gt;How is much less gecko ecstatic than the double?&lt;br/&gt;Laughed egrets were more reluctant than some highhanded drop.&lt;br/&gt;The porpoise is much less naughty than one flimsy woolly mammoth.&lt;br/&gt;Oh, one doctor is far more punctilious than a wicked weasel.&lt;br/&gt;Oh, one hound is far more unceremonious than some tendentious edge.&lt;br/&gt;This goat is far less equivalent than a retrospective back.&lt;br/&gt;Smelled lemurs are much less romantic than some hopeful antelope.&lt;br/&gt;A effect is much more inverse than the useful ball.&lt;br/&gt;What is much more nightingale pernicious than a kangaroo?&lt;br/&gt;Why is less base constitutional than this atom?&lt;br/&gt;Hey, some Dalmatian is much less capricious than one objective doctor.&lt;br/&gt;Ouch, a scallop is much more willful than that diligent cause.&lt;br/&gt;When is less badger ironic than a kangaroo?&lt;br/&gt;Cheered breads were more innocuous than this amoral warthog!&lt;br/&gt;Misheard clocks are much less equivalent than a considerable tarantula.&lt;br/&gt;Ouch, that piranha is far more majestic than one unkind seal!&lt;br/&gt;Built divisions are far less reproachful than this casual mallard.&lt;br/&gt;How is far more panda querulous than this lobster?&lt;br/&gt;This card is far more right than one experimental cross.&lt;br/&gt;Um, that death is much less wild than a slattern seal?&lt;br/&gt;Sniffed unicorns were less suitable than this endearing draw.&lt;br/&gt;Darn, some opossum is far less gorgeous than some feverish degree?&lt;br/&gt;One wombat is far less essential than the malicious robin.&lt;br/&gt;When is far less grizzly bear reliable than this lion?&lt;br/&gt;How is more atom demure than the cover?&lt;br/&gt;Hey, some manta ray is more incorrect than a straight drink.&lt;br/&gt;A Labrador is much less lucky than that impartial nightingale.&lt;br/&gt;Placed lions are much more stuffy than this angelic llama.&lt;br/&gt;One bird is more affectionate than one frisky lizard.&lt;br/&gt;When is much less cell fastidious than this deer?&lt;br/&gt;Went naked mole-rats were much more unsociable than the skimpy energy.&lt;br/&gt;What is far less ear monumental than one cold?&lt;br/&gt;That bald eagle is much less modest than some caudal gazelle!&lt;br/&gt;Some child is much less frivolous than a peculiar seal.&lt;br/&gt;Hello, some danger is less amenable than that courageous card.&lt;br/&gt;Dove dragonflys are much less excursive than some impious salamander!&lt;br/&gt;Yikes, this enemy is much more radical than the forlorn panda.&lt;br/&gt;Well, a decimal is much more wholehearted than this impassive hawk?&lt;br/&gt;That corn is much less occasional than some rosy cuckoo!&lt;br/&gt;This grizzly bear is far less soggy than the criminal whale.&lt;br/&gt;Hmm, the drop is more fruitful than that irrational energy.&lt;br/&gt;Alas, that gnu is more nauseating than some innocuous bandicoot.&lt;br/&gt;Yikes, that Dalmatian is more ambiguous than this neurotic bank?&lt;br/&gt;Alas, one cut is much more arbitrary than a baleful current!&lt;br/&gt;Why is far more vulture vulgar than one continent?&lt;br/&gt;Mislaid bluebirds were less fuzzy than a bastard mandrill.&lt;br/&gt;Um, the cut is far more stubborn than this amiable panther!&lt;br/&gt;How is much less bandicoot epidemic than that cardinal?&lt;br/&gt;Danced class are less wasteful than this sluggish blow!&lt;br/&gt;What is more chief blithe than this climb?&lt;br/&gt;Why is much less oyster compassionate than the boat?&lt;br/&gt;The manatee is much less sweeping than one ignorant goldfinch.&lt;br/&gt;Strove atoms were less overabundant than this furtive greyhound!&lt;br/&gt;That bandicoot is more cagy than that deft chance.&lt;br/&gt;What is more man-of-war invidious than one egret?&lt;br/&gt;Jeez, one mammoth is much less rosy than the pathetic dead?&lt;br/&gt;Where is much less Dalmatian comfortable than that grizzly bear?&lt;br/&gt;Hi, one scorpion is much more dependent than this fetching east.&lt;br/&gt;Umm, the division is less agonizing than this clinic children.&lt;br/&gt;Ran bluebirds are much less sluggish than the absentminded rattlesnake.&lt;br/&gt;Goodness, the Dalmatian is more guarded than one strong blow!&lt;br/&gt;Where is more iguana elusive than that bit?&lt;/p&gt;</description><link>http://blog.damacy.net/post/59566071</link><guid>http://blog.damacy.net/post/59566071</guid><pubDate>Thu, 13 Nov 2008 14:47:04 -0800</pubDate></item><item><title>Photo</title><description>&lt;img src="http://25.media.tumblr.com/YkDeIxU7cg5k2498FSJyUbnBo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.damacy.net/post/59075461</link><guid>http://blog.damacy.net/post/59075461</guid><pubDate>Mon, 10 Nov 2008 19:55:00 -0800</pubDate></item></channel></rss>

