<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Easily Distracted &#187; Geek</title>
	<atom:link href="http://www.stevenbrown.ca/blog/archives/category/geek/feed" rel="self" type="application/rss+xml" />
	<link>http://www.stevenbrown.ca/blog</link>
	<description>Ooooh, shiny!</description>
	<lastBuildDate>Thu, 13 May 2010 07:22:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>DIY Wireless Booster</title>
		<link>http://www.stevenbrown.ca/blog/archives/970</link>
		<comments>http://www.stevenbrown.ca/blog/archives/970#comments</comments>
		<pubDate>Fri, 13 Nov 2009 04:07:55 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=970</guid>
		<description><![CDATA[To access the Internet on my desktop computer, I must use wireless. Unfortunately, it&#8217;s about as far away from the access point as possible: opposite corners of the house and different floors. And the wireless card I&#8217;ve got in my desktop is a little old and pretty cheap. Basically, I&#8217;ve had to battle with a [...]]]></description>
			<content:encoded><![CDATA[<p>To access the Internet on my desktop computer, I must use wireless.  Unfortunately, it&#8217;s about as far away from the access point as possible: opposite corners of the house and different floors.  And the wireless card I&#8217;ve got in my desktop is a little old and pretty cheap.  Basically, I&#8217;ve had to battle with a poor connection for years.  Often, I would have to manually move the antenna an inch this way or that, try reconnecting, and repeat.  I vented to my friend, Shirley, about my connection, and she said her friend was having similar issues, so Shirley recommended she make a signal booster.  That&#8217;s something I&#8217;d been thinking about doing, and thought it was about time.  I googled how to make a booster.  Enter the Parabolic Reflector available <a href="http://www.freeantennas.com/projects/template2/index.html">here</a>.  I&#8217;m sure there are lots others, but this is the one I decided to try out.</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0283.JPG"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0283-300x225.jpg" alt="Desktop antenna with booster" title="Desktop antenna with booster" width="300" height="225" class="alignnone size-medium wp-image-975" /></a></p>
<p>I made 3 of them.  the first was made entirely with paper and tinfoil and it worked fine, but I figured I would try making a couple more with different materials: 2 different strengths of card.  It&#8217;s good I did that too, as I ended up using 2 of them and giving the paper prototype to Shirley&#8217;s friend who most likely has better things to do than build paper parabolas.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   (I, on the other hand, do not.)</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0277.JPG"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0277-300x225.jpg" alt="Gluestick?  Check.  Scissors?  Check." title="Gluestick?  Check.  Scissors?  Check." width="300" height="225" class="alignnone size-medium wp-image-974" /></a></p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0293.JPG"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/IMG_0293-300x225.jpg" alt="Access point hidden away, with booster pointed down slightly (towards my room)" title="Access point hidden away, with booster pointed down slightly (towards my room)" width="300" height="225" class="alignnone size-medium wp-image-971" /></a></p>
<p>What does it do?  It turns your omni-directional antenna into a directional antenna with a stronger signal.  The tinfoil does the radio wave reflecting and the shape (the parabola) just happens to be an efficient way to do that.  Using this new direction, I&#8217;ve &#8220;pointed&#8221; the antenna on my wireless router towards my room &#8211; even on a bit of an angle through the floor.  In my room, on my desktop PC, I&#8217;ve just pointed it horizontally in the direction of the access point.</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/wireless_strength.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/11/wireless_strength-300x117.png" alt="Wireless signal strength over a few days" title="Wireless signal strength over a few days" width="300" height="117" class="alignnone size-medium wp-image-976" /></a></p>
<p>The results have been great.  Without any home-made boosters, I received 25-35%, with one on the access point, i received 35-55%, and with one on both the access point and my desktop antennas, I&#8217;m receiving a pretty steady 62-68% (see the graph, above).  I still receive disconnects, but it&#8217;s now <em>much</em> easier to reconnect&#8230; usually happens automatically on the first try &#8211; I don&#8217;t even have to do anything!</p>
<p>So if you&#8217;re having wireless issues, give it a shot!  It certainly doesn&#8217;t cost much.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/970/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Canadian Income Tax 2009</title>
		<link>http://www.stevenbrown.ca/blog/archives/879</link>
		<comments>http://www.stevenbrown.ca/blog/archives/879#comments</comments>
		<pubDate>Wed, 15 Jul 2009 02:05:03 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[taxes]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=879</guid>
		<description><![CDATA[If you have any trouble understanding how income tax works or is calculated, play around on this webpage and see if it helps you. (It probably won&#8217;t, but you might have fun not learning anything!) It lets you dynamically compare different income taxes within Canada using a pretty graph and it lets you calculate your [...]]]></description>
			<content:encoded><![CDATA[<p>If you have any trouble understanding how income tax works or is calculated, play around on <a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/05/itax/canitax2009.html"><strong>this webpage</strong></a> and see if it helps you.  (It probably won&#8217;t, but you might have fun not learning anything!)  It lets you dynamically compare different income taxes within Canada using a pretty graph and it lets you calculate your own (simplified) tax results, whether your income is salary or hourly based.</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/05/canitax.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/05/canitax-300x145.png" alt="canitax" title="canitax" width="300" height="145" class="alignnone size-medium wp-image-880" /></a></p>
<h3>Why Did I do this?</h3>
<p>I didn&#8217;t do my taxes; an accountant did.  But when I was reading about them, I stumbled upon a couple webpages and became interested in the differences among the provinces and territories within Canada and<br />
different income ranges.  That&#8217;s what started this mini Javascript project.</p>
<h3>This is not a work of art</h3>
<p>I wrote it mostly on the bus using my recently acquired Dell Mini 12 netbook (on Windows XP&#8230; ew).  And from that experience, I can firmly say that writing even very simple things, it&#8217;s good to have a fair amount of time set aside in a relaxed environment.  I would write a couple things here and there for 20 minutes or so&#8230; then not look at it again for a few days&#8230; it took me 5 minutes to figure out what I wanted to do the next time I opened it.  The only times I made significant progress was when I sat down for more than an hour.  The code wasn&#8217;t really designed, it was just&#8230; written.  It&#8217;s messy, there&#8217;s lots of hard-coding, poorly named fields and variables (didn&#8217;t help with figuring out what I was doing last time), and if it were anything serious, I&#8217;d rewrite large chunks of it.  And make it prettier.  But as it stands, it&#8217;s just kinda fun.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In addition to being curious about the taxes in Canada, I was also interested in trying a javascript graphing library. I had been impressed with different javascript-generated graphs on the web and wondered how difficult they were to create.  I used FLOT (with lots of copying and pasting from examples), and it seemed to work alright, but it depends on JQuery, which I wasn&#8217;t familiar with.  Actually, I&#8217;m still not very familiar with it&#8230; and wrote almost everything in regular javascript. I know it&#8217;s worth learning, but I guess I&#8217;ll save<br />
that for another time. <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Let me know of any errors in tax calculation.. or code design, for that matter.  There&#8217;s lots of those, but I&#8217;m sure I&#8217;m not aware of all of them!  hah.</p>
<p><em>(I&#8217;ve been sitting on this post for about 2 months now.  hah! Figured I might as well publish it.)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/879/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File List Applet &#8211; now with more autotools!</title>
		<link>http://www.stevenbrown.ca/blog/archives/846</link>
		<comments>http://www.stevenbrown.ca/blog/archives/846#comments</comments>
		<pubDate>Mon, 23 Mar 2009 04:40:31 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[applet]]></category>
		<category><![CDATA[autotools]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[FileListApplet]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=846</guid>
		<description><![CDATA[I decided that before I did any more work on the applet, I would improve its installation process to make it easier for people to try it out. So, the process to get and build the source now looks like this: Download Browse source here. Download the source: bzr branch http://stevenbrown.ca/src/FileListApplet Install Install dependencies (Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>I decided that before I did any more work on <a href="http://www.stevenbrown.ca/blog/archives/497">the applet</a>, I would improve its installation process to make it easier for people to try it out.  So, the process to get and build the source now looks like this:</p>
<h3>Download</h3>
<ul>
<li>Browse source <a href="http://stevenbrown.ca/src/FileListApplet/">here</a>.</li>
<li>Download the source: <code>bzr branch http://stevenbrown.ca/src/FileListApplet</code></li>
</ul>
<h3>Install</h3>
<ol>
<li>Install dependencies (Ubuntu package names given): <code>sudo apt-get install python-xdg python-gnome2-desktop python-gtk2 python-pyinotify</code></li>
<li>Branch the source using the <code>bzr</code> command, above.</li>
<li><code>cd</code> into the directory.</li>
<li><code>./configure --prefix=/usr</code> <strong>(the prefix is important!)</strong></li>
<li><code>make</code></li>
<li><code>sudo make install</code></li>
<li>If the applet does not show up in your <em>Add to Panel</em> menu, try restarting the bonobo-activation-server: <code>killall bonobo-activation-server</code>.</li>
</ol>
<h3>Autotools</h3>
<p>Autotools is pretty much the standard in source package management on linux.  Except for the name, there is nothing <em>automatic</em> about <em>auto</em>tools.  Every encounter I&#8217;ve had with autotools has usually defeated me and left me frustrated and leaving whatever I was working on to do something else.  For me, because I had labeled it the next step, it basically stalled the entire project for a while. Most people tend to copy and paste other projects&#8217; autotools setup, but I figured that was overkill for my purposes and I didn&#8217;t find anything that quite suited me.  I looked at <a href="http://www.gnome.org/~seth/gnome-blog/">gnome-blog</a>, but it seemed like some stuff wasn&#8217;t quite working properly and some was completely unnecessary&#8230; in fact, this seemed to be a trend when looking at the autotools stuff in projects.  Why is this?  Autotools is not simple and due to this simple fact, I think it fails completely on many levels.  Developers massage it enough to get it working, but few actually understand it all &#8211; I know I sure don&#8217;t!  So please forgive the sloppiness and feel free to send patches. <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I gave up doing a couple things, like getting the revision number (<code>bzr revno</code>) and including it in the version string (see <code>configure.ac</code>). I know it&#8217;s probably something super simple, but I couldn&#8217;t seem to pass a variable containing a string as the version&#8230;.</p>
<p>I feel that GNOME, as a platform for development, could seriously benefit from some kind of frontend to autotools that handled GNOME development nicely and hid as much as possible from the developer (including all those nasty config files that pollute the package tree).  Anyway, I did <em>not</em> have an enjoyable time grappling with autotools, but I&#8217;ll end this mini-rant here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/846/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Laptop&#8217;s New Life</title>
		<link>http://www.stevenbrown.ca/blog/archives/828</link>
		<comments>http://www.stevenbrown.ca/blog/archives/828#comments</comments>
		<pubDate>Mon, 09 Mar 2009 00:59:00 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=828</guid>
		<description><![CDATA[My laptop has had its fair share of problems, mostly because it&#8217;s aging; I bought it nearly 6 years ago!! I&#8217;m actually impressed it&#8217;s aged so well! A few days ago, the display started to flicker with increasing frequency and become distorted shortly after turning it on. Here&#8217;s a video showing the problem: (Warning: contains [...]]]></description>
			<content:encoded><![CDATA[<p>My laptop has had its fair share of problems, mostly because it&#8217;s aging; I bought it nearly 6 years ago!!  I&#8217;m actually impressed it&#8217;s aged so well!  A few days ago, the display started to flicker with increasing frequency and become distorted  shortly after turning it on.  Here&#8217;s a video showing the problem: <em>(Warning: contains a little bad language &#8211; woops&#8230;)</em>  </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/jCYVfGVGWyY&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jCYVfGVGWyY&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>(Link to video <a href="http://www.youtube.com/watch?v=jCYVfGVGWyY"><strong>here</strong></a> if embedded object doesn&#8217;t show up.)</p>
<p>Last night, I took it apart and tried wiggling every LCD-related wire I could find,  hoping to affect the display&#8217;s output and conclude it was a fixable loose connection.</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/03/laptop_in_pieces.jpg"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/03/laptop_in_pieces-300x224.jpg" alt="Laptop in Pieces" title="Laptop in Pieces" width="300" height="224" class="alignnone size-medium wp-image-833" /></a></p>
<p>Nope.  Fine.  Who needs a screen anyway?</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2009/03/img_8575.jpg"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2009/03/img_8575-300x224.jpg" alt="Screenless Laptop" title="Screenless Laptop" width="300" height="224" class="alignnone size-medium wp-image-832" /></a></p>
<p>I now have a very compact desktop &#8211; it even includes wireless, keyboard, mouse and speakers!  It just needs a monitor.  I haven&#8217;t decided whether I will make it a pseudo media PC to stream things from my desktop to the TV (a little work), or just to have it replace the family computer (almost no work!).  The family usually gets my computer hand-me-downs.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, looks like I&#8217;ll need a new laptop sometime soon.  I vowed to go smaller with my next laptop, but I&#8217;m not sure if a netbook would suffice.  Of course, I would like it to run Linux (Ubuntu?), have long battery life, reasonable storage, support WPA2, have a built-in 1.3MP camera, and all that good stuff.  Bluetooth would be nice, too.  Let me know if you have any suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/828/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reading &#8211; XP and Design Patterns</title>
		<link>http://www.stevenbrown.ca/blog/archives/825</link>
		<comments>http://www.stevenbrown.ca/blog/archives/825#comments</comments>
		<pubDate>Mon, 09 Mar 2009 00:57:49 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Extreme Programming]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=825</guid>
		<description><![CDATA[I got a few books out from the library, recently, which I&#8217;ve been reading on the bus. I&#8217;m currently alternating between Extreme Programming Explained: Embrace Change and The Joy of Patterns: Using Patterns for Enterprise Development. I wish I had read the XP book before being project manager for my Software Engineering project at University, [...]]]></description>
			<content:encoded><![CDATA[<p>I got a few books out from the library, recently, which I&#8217;ve been reading on the bus.  I&#8217;m currently alternating between <a href="http://www.amazon.com/Extreme-Programming-Explained-Embrace-Change/dp/0321278658" >Extreme Programming Explained: Embrace Change</a> and <a href="http://www.amazon.com/Joy-Patterns-Using-Enterprise-Development/dp/0201657597" >The Joy of Patterns: Using Patterns for Enterprise Development</a>.  I wish I had read the XP book before being project manager for my Software Engineering project at University, a couple years ago.  But perhaps having gone through that experience allows me to relate to the material more directly.  It&#8217;s easy to read and the author, <a href="http://en.wikipedia.org/wiki/Kent_Beck" >Kent Beck</a> (one of the fathers of XP), identifies the reasons behind the development methodology, and the problems they help solve.  I&#8217;ve always had this feeling of agreement with XP practices, many of which seem like common sense, but haven&#8217;t always been able to articulate the reasons.  Thankfully, the author does not have this problem.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I&#8217;m about 50 pages in, and it&#8217;s quite good, so far.</p>
<p>I picked up the Design Patterns book because the one I wanted, <a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612" >Design Patterns: Elements of Reusable Object-Oriented Software</a>, wasn&#8217;t there.  (The library has 3 copies of it, but it&#8217;s always out with a wait-list of people requesting it.  This list now includes me.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )  Anyway, the one I picked up is extremely terse.  There are UML diagrams provided, sample code, and a problem description&#8230; but not much in way of explanation.  It&#8217;s format is kind of like this: there&#8217;s this problem, how do we address it?  <em>Boom, here&#8217;s a pattern.  Boom, here&#8217;s a diagram.  Done.  Next.</em>  Or&#8230; <em>but we could improve on this pattern with this other pattern.  Boom, another diagram.</em>  Why?  <em>Figure it out.</em></p>
<p>This book is fine if you&#8217;ve been exposed to the patterns previously, and need a refresher, but it is not a good source to learn from.  I&#8217;m familiar with some of the patterns, but even then, they may be called something different, or implemented slightly different, and it&#8217;s been a while, so it takes me longer to understand than if there was more explanation.  Looking forward to picking up the other patterns book.  If you have not been exposed to design patterns before, or are a relative beginner programmer, and definitely if you are not familiar with UML diagrams, <em>avoid</em> this book.  It&#8217;s a book on design patterns (not a simple topic) that&#8217;s less than 200 pages, so you can&#8217;t really expect a thorough resource.  I&#8217;m about half way through it.  On one hand, I&#8217;m curious what such a small book has to offer, but on the other, I&#8217;m not sure I&#8217;ll finish it.  I&#8217;ll probably concentrate on the XP book, for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/825/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2008 In Review</title>
		<link>http://www.stevenbrown.ca/blog/archives/550</link>
		<comments>http://www.stevenbrown.ca/blog/archives/550#comments</comments>
		<pubDate>Thu, 01 Jan 2009 02:18:06 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Recreation]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Family]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Vancouver]]></category>
		<category><![CDATA[weather]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=550</guid>
		<description><![CDATA[Life This year has been pretty big. Naturally following up with lots of events from last year, these are some quick memories. My nephew, Rayden, was born on Feb 12th, six weeks early! This caused the father (my brother) to be indisposed for my dad&#8217;s (2nd) marriage on Feb 14th. I got bumped up to [...]]]></description>
			<content:encoded><![CDATA[<h3>Life</h3>
<p>This year has been pretty big.  Naturally following up with lots of events from <a href="http://www.stevenbrown.ca/blog/archives/253">last year</a>, these are some quick memories. My nephew, Rayden, was born on Feb 12th, six weeks early! This caused the father (my brother) to be indisposed for my dad&#8217;s (2nd) marriage on Feb 14th. I got bumped up to best man (but didn&#8217;t have to do much) and had a rather empty hotel room to myself in Vegas. I <a href="http://www.stevenbrown.ca/blog/archives/296">attended</a> the Open Web Vancouver conference. I went to Whistler mountain for the <a href="http://www.stevenbrown.ca/blog/archives/303">first time</a> in <em>years</em> and plan on going again soon. I went on a fantastic <a href="http://www.stevenbrown.ca/blog/archives/319">road trip</a> down the west coast of the United States, something I will <em>never</em> forget. I slacked off most of the summer but managed to do quite a bit of <a href="http://www.stevenbrown.ca/blog/archives/323">rollerblading</a> and <del datetime="2009-01-06T00:47:16+00:00">outdoor activity</del> hanging out with Kurt (visiting from Brazil). My brother, now a father, <a href="http://www.stevenbrown.ca/blog/archives/329">married</a> the mother of his child on August 3rd.  I was best man at this wedding, as well &#8211; with more responsibilities, but they were well received and totally worth it.  Our beloved cat, Sky, met an early and terribly <a href="http://www.stevenbrown.ca/blog/archives/406">unfortunate end</a>. We had our first encounter with bed bugs who are now the sworn enemy of our household. Vancouver, a city that sometimes doesn&#8217;t get snow all year, had its <a href=http://en.wikipedia.org/wiki/Climate_of_Vancouver">whitest Christmas <em>ever</em></a> with 60cm (2 ft) of snow! Perhaps we should have seen <a href="http://www.stevenbrown.ca/blog/archives/301">snow in April</a> as a sign&#8230;.?</p>
<p>That reminds me: Happy Holidays for 2008! Guess I was a little late on that&#8230;  Here are some pictures of our insane weather in Vancouver.</p>

<a href='http://www.stevenbrown.ca/blog/archives/550/img_8320' title='img_8320'><img width="150" height="150" src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/img_8320-150x150.jpg" class="attachment-thumbnail" alt="Our House" title="img_8320" /></a>
<a href='http://www.stevenbrown.ca/blog/archives/550/img_8345' title='img_8345'><img width="150" height="150" src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/img_8345-150x150.jpg" class="attachment-thumbnail" alt="Front-End Loader" title="img_8345" /></a>
<a href='http://www.stevenbrown.ca/blog/archives/550/img_8356' title='img_8356'><img width="150" height="150" src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/img_8356-150x150.jpg" class="attachment-thumbnail" alt="Parking Lot" title="img_8356" /></a>
<a href='http://www.stevenbrown.ca/blog/archives/550/img_8316' title='img_8316'><img width="150" height="150" src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/img_8316-150x150.jpg" class="attachment-thumbnail" alt="Back Yard" title="img_8316" /></a>
<a href='http://www.stevenbrown.ca/blog/archives/550/img_8360' title='img_8360'><img width="150" height="150" src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/img_8360-150x150.jpg" class="attachment-thumbnail" alt="Merry Xmas!" title="img_8360" /></a>

<h3>Geekery</h3>
<p>With my free time, I think I was able to really exercise my geekiness in 2008.  I released a couple updates to the Rhythmbox <a href="http://www.stevenbrown.ca/blog/?s=jump-to-playing">Jump-to-Playing</a> plugin, which led me to submit my <a href="http://bugzilla.gnome.org/show_bug.cgi?id=557152">first patch</a> to an upstream project!  Said patch was accepted and will be in the next version of Rhythmbox!  Yay.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   It was just for some XML UI description, but it feels nice to have helped improve (even a tiny bit) a project that will be installed on thousands of computers in the next cycle.  I also released a usable proof-of-concept GNOME Panel <a href="http://www.stevenbrown.ca/blog/archives/497">File List Applet</a> which has stayed on my panel and I find quite useful. And I&#8217;ve done a couple little <a href="http://www.stevenbrown.ca/blog/archives/tag/scripts">scripts</a> and <a href="http://www.stevenbrown.ca/blog/archives/tag/how-to">how-to&#8217;s</a> that fall under the &#8220;nerd&#8221; category quite nicely. Oh yeah, and significant <a href="http://www.stevenbrown.ca/blog/archives/category/website">website</a> updates. Next website <em>todo item</em> is to customize the attachment page for my theme, I think&#8230;. Also, I joined Twitter.  And Identi.ca. And LinkedIn&#8230;.</p>
<h3>Art</h3>
<p>Not many artsy things done this year. But with the significant <a href="http://www.stevenbrown.ca/blog/archives/487">improvements</a> of tablet handling in Linux, I did some random <a href="http://www.stevenbrown.ca/blog/archives/311">doodles</a> and a <a href="http://www.stevenbrown.ca/blog/archives/523">birthday card</a>. I may not do it very often, but I still enjoy drawing, thank goodness.</p>
<h3>Blog Stats for 2008</h3>
<p>My Blog is by no means high traffic, but stats are fun! (These stats were obtained using the wordpress.com Stats plugin, and exclude the Feed stats, because I use Feedburner for that&#8230; although, I&#8217;m thinking I should revert that, now that I mostly use wordpress.com Stats.)</p>
<p><strong>Top 3 Referrers:</strong></p>
<ol>
<li><a href="http://live.gnome.org/RhythmboxPlugins/ThirdParty">http://live.gnome.org/RhythmboxPlugins/ThirdParty</a> (402)</li>
<li><a href="http://live.gnome.org/Boston2008/GUIHackfest">live.gnome.org/Boston2008/GUIHackfest</a> (209)</li>
<li><a href="http://siuyee.com">siuyee.com</a> (126)</li>
</ol>
<p><strong>Top 3 Posts and Pages:</strong></p>
<ol>
<li><a href="http://www.stevenbrown.ca/blog/archives/160">Pidgin 2.1 UI Ideas</a> (1,053)</li>
<li><a href="http://www.stevenbrown.ca/blog/archives/155">2D Game Art and the Virtual Console</a> (580)</li>
<li><a href="http://www.stevenbrown.ca/blog/archives/254">Rhythmbox Plugin: Jump to Playing 0.2</a> (455)</li>
</ol>
<p><strong>Top 3 Search Engine Terms: </strong></p>
<ol>
<li>rhythmbox (327)</li>
<li>bug (174)</li>
<li>pidgin (165)</li>
</ol>
<p><strong>Top 3 Clicks:</strong></p>
<ol>
<li><a href="http://developer.pidgin.im/attachment/ticket/2367/pidgin201gui.jpg">Pidgin UI screenshot attached to a bug</a> (57)</li>
<li><a href="http://pidgin.im/~seanegan/new-conversation-window.png">Pidgin UI mockup</a> (50) by <a href="http://www.bomahy.nl/hylke/blog/">Hylke Bons</a></li>
<li><a href="http://farm1.static.flickr.com/222/522406933_78f4d17560_o.jpg">SF2 HD Ken</a> (42)</li>
<p>The fourth was <a href="http://launchpad.net/desktopdrawers">launchpad.net/desktopdrawers</a> with 38 clicks, so it&#8217;s kinda cool I helped advertise a small project a little. (A project I&#8217;ve submitted patches to, no less. <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )
</ol>
<h3>Thanks</h3>
<p>Thank you, everyone, for a wonderful 2008. It&#8217;s been interesting, and despite a failing economy, I&#8217;m looking positively toward 2009.</p>
<p>Happy New Year!  (あけましておめでとうございます！)  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/550/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>1024&#215;768 Desktop</title>
		<link>http://www.stevenbrown.ca/blog/archives/541</link>
		<comments>http://www.stevenbrown.ca/blog/archives/541#comments</comments>
		<pubDate>Mon, 22 Dec 2008 05:44:03 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[HCI]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=541</guid>
		<description><![CDATA[Lots of people customize their desktops. Many don&#8217;t, but I do.. a little. Here&#8217;s mine: I actually had to remove the Time Tracker (Hamster) applet to scale my 1280&#215;1024 desktop down to 1024, but I think that was all. And I only just decided to try moving the Tomboy and Deskbar applets over to the [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of people customize their desktops.  Many don&#8217;t, but I do.. a little.  Here&#8217;s mine:</p>
<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/1024x768desktopusage_annotations.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/1024x768desktopusage_annotations-300x225.png" alt="1024x768desktopusage_annotations" title="1024x768desktopusage_annotations" width="300" height="225" class="alignnone size-medium wp-image-542" /></a></p>
<p>I actually had to remove the Time Tracker (Hamster) applet to scale my 1280&#215;1024 desktop down to 1024, but I think that was all.  And I only just decided to try moving the Tomboy and Deskbar applets over to the top-left corner&#8230; looks a little odd, but it&#8217;s much more accessible.  It&#8217;s good to try out new things, right?  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   (When the keyboard will do, <code>Alt+F12</code> and <code>Alt+F3</code> for Tomboy and Deskbar, and <code>Super(windows-key)+Space</code> for Gnome-Do are good shortcuts to keep in mind.)</p>
<p>How about you?  (If you run Ubuntu, read <a href="https://lists.ubuntu.com/archives/ubuntu-devel/2008-December/027022.html">this</a> &#8211; which is why I tried scaling my 1280 desktop to a 1024, in the first place).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/541/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7</title>
		<link>http://www.stevenbrown.ca/blog/archives/516</link>
		<comments>http://www.stevenbrown.ca/blog/archives/516#comments</comments>
		<pubDate>Thu, 11 Dec 2008 16:30:54 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=516</guid>
		<description><![CDATA[I just upgraded from 2.6.3 (using my &#8220;wp-upgrade&#8221; script), and It&#8217;s fantastic! Go watch a video about the biggest features. It even includes an &#8220;automatic upgrade!!&#8221; This pretty much deprecates my script, unless you want to maintain snapshots of each version. (I&#8217;m not sure if anyone other than me was using it to begin with&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded from 2.6.3 (using <a href="http://www.stevenbrown.ca/blog/archives/335">my &#8220;wp-upgrade&#8221; script</a>), and It&#8217;s <em>fantastic</em>!  Go watch a <a href="http://wordpress.org/development/2008/12/coltrane/">video about the biggest features</a>.  It even includes an &#8220;automatic upgrade!!&#8221;  This pretty much deprecates my script, unless you want to maintain snapshots of each version.  (I&#8217;m not sure if anyone other than me was using it to begin with&#8230; but anyhow&#8230;.)  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/12/screenshot-blog-file-browser.png" alt="Screenshot: wp-upgrade Snapshots" title="Screenshot: wp-upgrade Snapshots" width="375" height="394" class="alignnone size-full wp-image-517" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/516/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.10 (Intrepid Ibex) and Tablets</title>
		<link>http://www.stevenbrown.ca/blog/archives/487</link>
		<comments>http://www.stevenbrown.ca/blog/archives/487#comments</comments>
		<pubDate>Mon, 03 Nov 2008 07:54:30 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Gimp]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Intrepid Ibex]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[sketches]]></category>
		<category><![CDATA[tablets]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=487</guid>
		<description><![CDATA[I just had to mention this: The latest version of Ubuntu finally supports input hotplugging. What this means is that you can plug in your tablet at any point and start taking advantage of its pressure sensitivity, etc. Previously, it would only work correctly if Ubuntu (the X server part of it) started with the [...]]]></description>
			<content:encoded><![CDATA[<p>I just had to mention this: The latest version of Ubuntu <em>finally</em> supports input hotplugging.  What this means is that you can plug in your tablet at any point and start taking advantage of its pressure sensitivity, etc.  Previously, it would only work correctly if Ubuntu (the X server part of it) started with the tablet plugged in.  Let me just say: <strong>OMG</strong>, I&#8217;ve been waiting for this for <em>years</em>!  Seriously.  I hadn&#8217;t been keeping up with every detail on the release (and I&#8217;m surprised I hadn&#8217;t seen mention of this yet), but I always plug in my USB tablet and run a quick test with new releases.  This time, it actually worked!  My test turned into a quick (and random) doodle:<br />
<a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/tornadoodle.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/tornadoodle-300x204.png" alt="" title="tornadoodle" width="300" height="204" class="alignnone size-medium wp-image-488" /></a></p>
<h3>How to Test</h3>
<p>Plug in your tablet.</p>
<p>Run <a href="http://gimp.org/">GIMP</a> (included with Ubuntu by default).<br />
<code>Applications > Graphics > GIMP Image Editor</code></p>
<p>Enable Extended Input devices in GIMP.<br />
<code>Edit > Preferences > Input Devices > Configure Extended Input Devices</code><br />
<a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimpprefsinputdevs.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimpprefsinputdevs-300x248.png" alt="" title="gimpprefsinputdevs" width="300" height="248" class="alignnone size-medium wp-image-489" /></a></p>
<p>Find your tablet under the Device dropdown (mine is a Wacom Graphire) and select <code>Screen</code> or <code>Window</code> for the <code>Mode</code>.  (It defaults to disabled.)<br />
<a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimpconfigureextended.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimpconfigureextended-300x215.png" alt="" title="gimpconfigureextended" width="300" height="215" class="alignnone size-medium wp-image-490" /></a></p>
<p>Create a new image, select the paintbrush tool and start drawing.  To play with the features of your tablet, expand the <code>Brush Dynamics</code> section in the paintbrush options window (should be below the toolbox, where you selected the paintbrush).  Here you can adjust things that pressure of your pen will control, like size and opacity.  Fun stuff!<br />
<a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimptoolbox.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/11/gimptoolbox-89x300.png" alt="" title="gimptoolbox" width="89" height="300" class="alignnone size-medium wp-image-491" /></a></p>
<p>It&#8217;s <a href="http://www.ubuntu.com/getubuntu/releasenotes/810#Limited%20support%20for%20Wacom%20tablet%20hotplugging">not perfect</a> (only works with the stylus &#8211; eraser doesn&#8217;t work without configuring), but it&#8217;s a <em>HUGE</em> step!!  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   And the fact that this also includes the latest version of GIMP (2.6) makes this upgrade an absolute no-brainer for linux graphic-philes.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I found the new UI in GIMP a little strange at first, because I became so accustomed to the old one, but it is much better.  </p>
<h3>Upgrade Problems</h3>
<p>Related to the upgrade, I lost wireless connectivity with my laptop upon doing it because the <code>hostap_cs</code> driver is used.  I forgot about this issue that I had with previous releases and my super-cheap 1000yen wireless card.  Blacklisting the <code>hostap_cs</code> driver and forcing the <code>orinoco_cs</code> driver fixed my problem again.  The lesson: the upgrade wasn&#8217;t perfect and it should never be assumed that they will be &#8211; please backup your stuff!  But <em>do</em> do the upgrade!  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/487/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>open-with for the command-line</title>
		<link>http://www.stevenbrown.ca/blog/archives/474</link>
		<comments>http://www.stevenbrown.ca/blog/archives/474#comments</comments>
		<pubDate>Fri, 31 Oct 2008 00:20:49 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[eog]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.stevenbrown.ca/blog/?p=474</guid>
		<description><![CDATA[Update 2008/11/18: Use xargs Here&#8217;s a bash script that you can pipe output into and tell it to run a specific program with the output as arguments. I&#8217;ve named it open-with and placed it in my personal script directory: /home/steve/bin/. Look within the script at a couple of the examples for how to use it. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 2008/11/18</strong>: Use <code>xargs</code> <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Here&#8217;s a bash script that you can pipe output into and tell it to run a specific program with the output as arguments.  I&#8217;ve named it <code>open-with</code> and placed it in my personal script directory: <code>/home/steve/bin/</code>.  Look within the script at a couple of the examples for how to use it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">PROG</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">DESC</span>=<span style="color: #ff0000;">&quot;Read arguments from standard input and run a specified program
with them.  Meant to be used as output for a pipe.&quot;</span>
&nbsp;
&nbsp;
<span style="color: #007800;">USAGE</span>=<span style="color: #ff0000;">&quot;OUTPUT | <span style="color: #007800;">$PROG</span> <span style="color: #000099; font-weight: bold;">\&quot;</span>PROGRAM-NAME [OPTIONS AND ARGUMENTS]<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
&nbsp;
<span style="color: #007800;">EXAMPLES</span>=<span style="color: #ff0000;">&quot;
# List (with details), all the files that include <span style="color: #000099; font-weight: bold;">\&quot;</span>downloads<span style="color: #000099; font-weight: bold;">\&quot;</span> in their name:
  find /home/ -iname <span style="color: #000099; font-weight: bold;">\&quot;</span>*downloads*<span style="color: #000099; font-weight: bold;">\&quot;</span> | <span style="color: #007800;">$PROG</span> <span style="color: #000099; font-weight: bold;">\&quot;</span>ls -l<span style="color: #000099; font-weight: bold;">\&quot;</span>
&nbsp;
# Queue all AVI files in current directory in vlc:
  ls *.avi | <span style="color: #007800;">$PROG</span> vlc
&nbsp;
# View all time-related icons with eye-of-gnome:
  find /usr/share/icons/gnome/ -iregex <span style="color: #000099; font-weight: bold;">\&quot;</span>.*[^mul]time.*<span style="color: #000099; font-weight: bold;">\&quot;</span> | open-with eog
&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> Usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;DESCRIPTION: <span style="color: #007800;">$DESC</span>&quot;</span> ; <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;USAGE: <span style="color: #007800;">$USAGE</span>&quot;</span> ; <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;EXAMPLES: <span style="color: #007800;">$EXAMPLES</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Quick check to see it's being called correctly, if not, print Usage and exit</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${#@}</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
	Usage
	<span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">files</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>						<span style="color: #666666; font-style: italic;"># empty array</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-r</span>					<span style="color: #666666; font-style: italic;"># read from stdin</span>
<span style="color: #000000; font-weight: bold;">do</span>
	files+=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REPLY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>			<span style="color: #666666; font-style: italic;"># add result of read to array</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># assume $1 is a valid program</span>
$<span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${files[@]}</span>&quot;</span>				<span style="color: #666666; font-style: italic;"># pass arguments to specified program</span></pre></div></div>

<h3>Motivation</h3>
<p>You&#8217;re sitting at the command line and have a list of images (in different locations) that you would like to browse.  Most image viewers let you iterate over a set of images, but only within the same directory.  What would be great is if they accepted input from stdin through a pipe!</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> my_list_of_images <span style="color: #000000; font-weight: bold;">|</span> my_image_viewer</pre></div></div>

<p>I didn&#8217;t find anything that did that, but using the <code>open-with</code> script, you can do something similar:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> my_list_of_images <span style="color: #000000; font-weight: bold;">|</span> open-with my_image_viewer</pre></div></div>

<p><a href="http://www.stevenbrown.ca/blog/wordpress/../files/2008/10/open-with-eog.png"><img src="http://www.stevenbrown.ca/blog/wordpress/../files/2008/10/open-with-eog-300x252.png" alt="" title="open-with-eog" width="300" height="252" class="alignnone size-medium wp-image-482" /></a><br />
Browsing a select list of images is actually kind of nice.  It&#8217;s like a playlist for your image viewer &#8211; a viewlist.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Anyway, I&#8217;m sure there&#8217;s some problems with this script.  Feel free to provide suggestions in the comments.  But I certainly don&#8217;t want to look at it for a while&#8230;.</p>
<h3>I hate shell scripting</h3>
<p>With a passion.  It&#8217;s not a great surprise&#8230; many programmers do.  I&#8217;m willing to go on record and state that I hate it even more than PERL programming.  I rarely do it, and when I decide to try something that seems like it would be simple, it turns out taking forever due mostly to quirks.  The rest of this post is a bit about how I went about writing this script, which ended up being mostly given to me by some <code>#bash</code> gurus on IRC.  And it&#8217;s a bit of a rant.</p>
<p>Although not many GUI programs seem to accept stdin as input, most accept filenames as arguments:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ eog image1.jpg image2.jpg image3.jpg <span style="color: #ff0000;">&quot;/home/steve/image seven.jpg&quot;</span></pre></div></div>

<p>So I figured I would just have to convert the list of images into an acceptable format: quoted, absolute filenames, separated by space.  Doing this depends entirely on the format the list is currently in, but it&#8217;s likely a list of unquoted filenames separated by newlines:</p>
<pre>
/home/steve/image1.jpg
/home/steve/my images/wow.jpg
/tmp/anotherimage.png
</pre>
<p>For me, my test list looked like this:</p>
<pre>
/usr/share/icons/gnome/48x48/stock/generic/stock_timezone.png
/usr/share/icons/gnome/16x16/stock/generic/stock_timezone.png
/usr/share/icons/gnome/16x16/stock/generic/stock_timer.png
/usr/share/icons/gnome/16x16/stock/generic/stock_timer_stopped.png
/usr/share/icons/gnome/16x16/stock/form/stock_form-time-field.png
/usr/share/icons/gnome/24x24/stock/generic/stock_timezone.png
/usr/share/icons/gnome/24x24/stock/generic/stock_timer.png
/usr/share/icons/gnome/24x24/stock/generic/stock_timer_stopped.png
/usr/share/icons/gnome/24x24/stock/form/stock_form-time-field.png
</pre>
<p>I was looking for icons of <em>clocks</em> or representations of <em>time</em>, and I obtained that list using <code>find</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span></pre></div></div>

<p>So I can&#8217;t pipe it into my image viewer, but I can use the output as the command-line arguments if I change the newlines to spaces.  <code>find</code> has an option for formatting the output which is perfect:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span> <span style="color: #660033;">-printf</span> <span style="color: #ff0000;">&quot;'%p' &quot;</span>
<span style="color: #ff0000;">'/usr/share/icons/gnome/48x48/stock/generic/stock_timezone.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/16x16/stock/generic/stock_timezone.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/16x16/stock/generic/stock_timer.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/16x16/stock/generic/stock_timer_stopped.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/16x16/stock/form/stock_form-time-field.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/24x24/stock/generic/stock_timezone.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/24x24/stock/generic/stock_timer.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/24x24/stock/generic/stock_timer_stopped.png'</span> <span style="color: #ff0000;">'/usr/share/icons/gnome/24x24/stock/form/stock_form-time-field.png'</span></pre></div></div>

<p>That&#8217;s great for me, because I&#8217;m using <em><code>find</code></em>.  But not very useful if I&#8217;m not, so I wanted something more generic.  Of course, there are many ways to do this, and again, I&#8217;m by no means a command-line guru.  But here&#8217;s how I started:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^/&quot;/'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> :a <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'$!N;s/\n/&quot; /; ta'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'\n'</span> <span style="color: #ff0000;">'&quot;'</span></pre></div></div>

<p>This wrapped the lines in double-quotes and join them together with a space in between.  The <code>find</code> command is the same as before, minus the formatting because that&#8217;s what I was trying to find an alternative to.  The output of <code>find</code> is piped into <code>sed</code>, which adds a <code>"</code> at the beginning of each line.  This output is then sent to another <code>sed</code> which replaces the newline character at the end of each line with a closing double-quote and a space, joining all lines into a single line.  Finally, that output is piped into <code>tr</code> which replaces the one remaining newline with a final double-quote.</p>
<p>If the files don&#8217;t include spaces or other troublesome characters (mine didn&#8217;t), then you could get away with simply changing the newlines into spaces.  But again, I wanted something generic.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'\n'</span> <span style="color: #ff0000;">' '</span></pre></div></div>

<p>Anyway, now that we have something that creates the desired input, we just have to wrap it in back-ticks and put the whole mess as the argument to the image viewer!  In my case, I&#8217;m using eye-of-gnome (or eog).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ eog <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^/&quot;/'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> :a <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'$!N;s/\n/&quot; /; ta'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">'\n'</span> <span style="color: #ff0000;">'&quot;'</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>Wait a second.  That doesn&#8217;t actually work.  Why not?  Running the backtick contents by itself seemed to produce the correct output.  Copying this output verbatim as arguments to <code>eog</code> worked as expected.  The problem was that when the quoted arguments were manually entered on the command-line, bash (silently) escapes the filenames, removing the quotes, adding backslashes before space,s etc.  But when the pipeline is wrapped in backticks, the result is not escaped, and <code>eog</code> complains about not being able to find files that begin with quotes.  Fine.  I was not about to write a bash &#8220;escape&#8221; script &#8211; something like that should already exist, right?  And it should be built in to bash!  Perhaps it&#8217;s even called &#8220;<code>escape</code>&#8220;.  Well, if there exists such a built-in, I couldn&#8217;t find it.  But I had to be going about this the wrong way.  Heading over to IRC, it was kind of difficult to explain the problem, but <code>ferret</code> eventually gave me the meat of the script above:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">files</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> -r; <span style="color: #000000; font-weight: bold;">do</span> files+=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REPLY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iregex</span> <span style="color: #ff0000;">&quot;.*[^mul]time.*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; eog <span style="color: #ff0000;">&quot;<span style="color: #007800;">${files[@]}</span>&quot;</span></pre></div></div>

<p>It worked!  I thanked him and began studying it.  There were still a couple things I didn&#8217;t understand:</p>
<ul>
<li>Why two angle brackets with a space between them? I understand the first one is probably redirecting input, but I don&#8217;t understand that one next to the opening parenthesis.  <br /><strong>Answer:</strong> The <code>&lt;(command)</code> actually puts <code>command</code>&#8216;s output in a temporary file and produces that filename.  So <code>&lt;(command)</code> becomes <code>tempfile</code>.  (Thanks, <code>kojiro</code>.)</li>
<li>If I open some video or audio files in <code>totem</code> using <code>open-with</code>, there&#8217;s an odd delay.  Using <code>vlc</code> doesn&#8217;t produce a delay, however.</li>
</ul>
<p>And to think this was originally going to be a micro-blog post in Twitter and identi.ca.  Wow.  It&#8217;s safe to say I still hate shell scripting.  <img src='http://www.stevenbrown.ca/blog/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.stevenbrown.ca/blog/archives/474/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
