<?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>tadhg.com &#187; tech</title>
	<atom:link href="http://tadhg.com/wp/tag/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://tadhg.com/wp</link>
	<description>Wherein some things Tadhg are discussed</description>
	<lastBuildDate>Fri, 03 Sep 2010 06:52:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MapDroyd</title>
		<link>http://tadhg.com/wp/2010/08/08/mapdroyd/</link>
		<comments>http://tadhg.com/wp/2010/08/08/mapdroyd/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 00:10:01 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=3152</guid>
		<description><![CDATA[I like it when I think that an app should exist and then find that it does. That’s what happened when I realized that a) I couldn’t use my phone’s GPS capabilities with its native (Google Maps) map application without a data connection and b) that it should be possible to download maps that work [...]]]></description>
			<content:encoded><![CDATA[<p>I like it when I think that an app should exist and then find that it does. That’s what happened when I realized that a) I couldn’t use my phone’s GPS capabilities with its native (Google Maps) map application without a data connection and b) that it should be possible to download maps that work with GPS but no data connection.</p>
<p>The answer: <a class="reference external" href="http://www.mapdroyd.com/">MapDroyd</a>. It does precisely that, letting you download vector maps to your phone and see where you are on them. I’ve used it a little bit over the last three days, and it’s been pretty good. There have been a few odd bits on the maps—a major street in central Manchester appeared to be missing, for example—but overall it’s been great, and the utility of having maps of more or less everywhere that can point to where you are on them should not be underestimated.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/phone/" rel="tag">phone</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/27/1-in-6-shocked-by-cellphone-bill/">1 in 6 Shocked by Cellphone Bill</a> <span class="related-post-date timestamp">Thu 27 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/22/a-triumph-of-design/">&#64;: A Triumph of Design</a> <span class="related-post-date timestamp">Mon 22 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/26/the-future-of-tabletop-games-dd-on-the-microsoft-surface/">The Future of Tabletop Games? <cite>D&amp;D</cite> on the Microsoft Surface</a> <span class="related-post-date timestamp">Fri 26 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/08/08/mapdroyd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travel, Ebooks, and Real Books</title>
		<link>http://tadhg.com/wp/2010/08/01/travel-ebooks-and-real-books/</link>
		<comments>http://tadhg.com/wp/2010/08/01/travel-ebooks-and-real-books/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 16:27:18 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=3137</guid>
		<description><![CDATA[Despite my techie nature, I’ve never been enamored of books in electronic format. I love the feel of books, and while I have no trouble reading large amounts on screens of various kinds, I don’t like the idea of doing so for books.

I like reading to be a focused activity, and the fact that books [...]]]></description>
			<content:encoded><![CDATA[<p>Despite my techie nature, I’ve never been enamored of books in electronic format. I love the feel of books, and while I have no trouble reading large amounts on screens of various kinds, I don’t like the idea of doing so for books.<br />
<span id="more-3137"></span><br />
I like reading to be a focused activity, and the fact that books are monofunction devices absolutely makes this focus easier to achieve. Simply having the option of switching activities on a computer (or whatever computer-like device I might read ebooks on) makes focusing that much harder. That’s certainly true when I watch movies on my computer. I don’t want the same thing to happen with reading. Even though it’s clearly a choice, the very presence of that choice is disruptive.</p>
<p>Dedicated ereading devices such as the Kindle might be an answer to this, but I haven’t come across any I find compelling, and I have no intention of supporting any that use a closed and authoritarian model. On top of that, there’s my love of physical books.</p>
<p>Despite all of the above reservations, I find myself considering some other approach, because physical books take up a lot of space. I’ve always been willing to deal with this in the past, but have recently found myself running closer and closer to the practical limits of what I can carry while travelling. This is despite packing reasonably well (perhaps not up to Monika standards, but not bad) and exploiting quite ruthlessly the ability of my <a href="http://tadhg.com/wp/2007/09/27/jackets-of-holding/" title="Jackets of Holding" >Jacket of Holding</a> to carry almost as much as my bag.</p>
<p>I generally err on the side of carrying too many books, but on my recent trip to Italy miscalculated and only brought three, two of which I read on the way out. The way back required at least two as well, so I was a book short. Physical space considerations are what caused me to bring only three books, and so I’m forced to admit that if I had some ereading device (which could be my phone, not necessarily another piece of hardware) this is simply not a problem I would run into.</p>
<p>So I’m going to have to experiment, start investigating getting books onto my Nexus One and my iPad, and seeing whether acceptable software can be found. This is a step I’m still feeling wary about taking, a testament to how emotionally attached I am to the physical book form.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/books/" rel="tag">books</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/reading/" rel="tag">reading</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/travel/" rel="tag">travel</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2009/02/27/giving-up-on-a-goal-for-2009/">Giving Up On A Goal For 2009</a> <span class="related-post-date timestamp">Fri 27 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/12/30/december-2008-reading-report/">December 2008 Reading Report</a> <span class="related-post-date timestamp">Tue 30 Dec 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/12/19/2009-reading-plan/">2009 Reading Plan</a> <span class="related-post-date timestamp">Fri 19 Dec 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/12/07/december-reading-list/">December Reading List</a> <span class="related-post-date timestamp">Sun 07 Dec 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/11/24/book-list/">Book List</a> <span class="related-post-date timestamp">Mon 24 Nov 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/10/06/fantasy-novel-roundup/">Fantasy Novel Roundup</a> <span class="related-post-date timestamp">Mon 06 Oct 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/03/16/cheery-thoughts-after-light-reading/">Cheery Thoughts after Light Reading</a> <span class="related-post-date timestamp">Sun 16 Mar 2008</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/10/01/librarything-unread-book-meme/">LibraryThing Unread Book Meme</a> <span class="related-post-date timestamp">Mon 01 Oct 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/05/10/slow-reading-progress/">Slow Reading Progress</a> <span class="related-post-date timestamp">Thu 10 May 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/04/19/book-buying-episode/">Book-Buying Episode</a> <span class="related-post-date timestamp">Thu 19 Apr 2007</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/08/01/travel-ebooks-and-real-books/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>8-Bit Cities</title>
		<link>http://tadhg.com/wp/2010/07/12/8-bit-cities/</link>
		<comments>http://tadhg.com/wp/2010/07/12/8-bit-cities/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 04:35:14 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=3090</guid>
		<description><![CDATA[As a geek of my generation, I cannot help but find an eight-bit map of San Francisco (there are maps of other cities too) a wonderful thing. It became even cooler when I found out it was programmed in Python.
Tags: coding, culture, techRelated PostsiPad First Impressions: Consumption Machine Sun 23 May 2010Your Online Life Might [...]]]></description>
			<content:encoded><![CDATA[<p>As a geek of my generation, I cannot help but find <a href="http://8bitcity.com/map?San%20Francisco" title="8-bit San Francisco" >an eight-bit map of San Francisco</a> (there are maps of other cities too) a wonderful thing. It became even cooler when I found out it was programmed in Python.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/culture/" rel="tag">culture</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/">iPad First Impressions: Consumption Machine</a> <span class="related-post-date timestamp">Sun 23 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/">Your Online Life Might be an Open Book</a> <span class="related-post-date timestamp">Mon 24 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/">Profiling Political Leanings by Browsing History</a> <span class="related-post-date timestamp">Fri 30 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/10/wordpress-2-9-upgrade/">WordPress 2.9 Upgrade</a> <span class="related-post-date timestamp">Sun 10 Jan 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/07/12/8-bit-cities/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some Futurist Speculation on Screen Interfaces</title>
		<link>http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/</link>
		<comments>http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/#comments</comments>
		<pubDate>Sat, 29 May 2010 06:52:46 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[interfaces]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2977</guid>
		<description><![CDATA[The current interface upheaval is centered on touchscreens. I think this is an important step, and one which may allow for some significantly different interaction paradigms to emerge. I wonder how long touchscreens will remain dominant, however, even though the interfaces they help spawn may stick around for a long time.

Screens are becoming more and [...]]]></description>
			<content:encoded><![CDATA[<p>The current interface upheaval is centered on touchscreens. I think this is an important step, and one which may allow for some significantly different interaction paradigms to emerge. I wonder how long touchscreens will remain dominant, however, even though the interfaces they help spawn may stick around for a long time.<br />
<span id="more-2977"></span><br />
Screens are becoming more and more advanced, meaning they’re getting smaller and smaller while supporting higher and higher resolutions. It’s not unrealistic to think that soon displays could be embedded in glasses, and once there, why not contact lenses? How far away are contact lenses that either have their own onboard computers or can receive a signal from a small device (like a phone)?</p>
<p>There are clearly obstacles to be overcome before that point, but it doesn’t seem all that far away. Another question is whether or not it will be possible for these devices to tell where you’re looking (this might be easier for a pair of glasses to do than contacts). If they can tell where you’re looking, they can overlay whatever you like onto what you’re looking at.</p>
<p>This isn’t a new idea, but it’s interesting to me how close it seems right now.</p>
<p>If we reach that point, then screens will have gone from being small in comparison to computers in the early stages, then large in comparison to computers today (that is, for desktop setups, where people generally want them to be as large as possible) back down to small again. On the other hand, the computer will also be small, so the largest part of a computer may end up being the input devices.</p>
<p>We might be relatively close to a setup where you sit down at your desk, and you have a keyboard (maybe I’m a dinosaur, but I don’t think keyboards are going away anytime soon; they’re too efficient—especially if you use something like Vim), a very small computer, and a motion tracker somewhat similar to the ones currently used for the Wii. All those, and your contact lenses, which might be passive receptors but might also need to emit something for the motion tracker to pick up. What that gives you, essentially, is as much screen real estate as you want, and something very close to those Hollywood-style holographic displays you can touch—with the one major difference that only you would be able to see your interface.</p>
<p>The only part of this that’s really missing right now is the contact lenses part. Computing power is already sufficient to calculate the three-dimensional view from a given point—maybe not well enough make you think you’re seeing something real, but certainly well enough to give you the correct angle for viewing a GUI.</p>
<p>After that, the next part is for it to figure out where your hands are. It might get to the point where it can let you type without a keyboard, although people might keep them for the feeback. But it should be easy enough at that stage to detect where your fingers are, thus allowing for three-dimensional “touch” interfaces.</p>
<p>I’m sure there are already research projects working on this kind of thing. I hate making predictions about future technologies, but I’d be surprised if this stuff weren’t available within twenty years.</p>
<p>What happens with interface design will be fascinating. Being able to manipulate computer artifacts with your hands, in three dimensions, will eliminated the need for a lot of abstractions, and I think that’s how much of the early work will go, just as that’s how the touch interfaces now are going. However, the increasing volume of information, personal and otherwise, will require abstractions of some kind; otherwise there’s just too much to deal with. What’s most interesting to me is not the “ease of use” side of things, but rather what will happen when you combine these (effectively) touchable holographic interfaces with a focus on user power and efficiency.</p>
<p>Here’s one idea: meta keys that can let you move the cursor with your eyes, and then “click” with another key (I refer to keys, but these could be foot taps, or who knows what, although here I’m aiming at something that doesn’t requires much movement of the hands, because I still think that keeping the hands in a typing position is likely to be fastest) to do what the mouse does today, but without having the mouse. That would already make editing better; I’d love to have the ability to do that in Vim right now.</p>
<p>Note that current touch interfaces eschew the concept of a pointer, figuring that the pointer is an unecessary throwback given the presence of touch ability. But control by visual attention could well bring it back, and similar things apply to many other interface approaches. In some ways the danger is that old lessons and methods will be forgotten in favor of alluring new playthings.</p>
<p>I have no qualms about suggesting that in a new order of interfaces where three-dimensional holographic touch is available, I’ll probably still want to use Vim. I suspect that Vim is the most effective interface I use every day. In fact, it’s the most powerful text manipulation tool I’ve found in years of searching (no, I haven’t used Emacs, and it may well be Vim’s equal, but most of this applies to it also) Cosidering that it doesn’t use any of the new interface technologies, and in fact obviates the need for the now-ancient mouse, that’s impressive, and important: a tremendous amount of interface power can be created not by focusing on making everything easier, but on exploring what increaing levels of abstraction and user learning can do—and, hopefully, combining that with the best of the revolutionary pieces yet to come.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/future/" rel="tag">future</a>, <a href="http://tadhg.com/wp/tag/interfaces/" rel="tag">interfaces</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/18/thunderbird-muttator-and-filters/">Thunderbird, Muttator, and Filters</a> <span class="related-post-date timestamp">Thu 18 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/12/using-vim-with-thunderbird/">Using Vim with Thunderbird</a> <span class="related-post-date timestamp">Fri 12 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/22/imap-jj-esc-and-bclose-in-vim/"><tt class="docutils literal"><span class="pre">:imap</span> <span class="pre">jj</span> <span class="pre">&lt;Esc&gt;</span></tt> and <tt class="docutils literal"><span class="pre">:Bclose</span></tt> in Vim</a> <span class="related-post-date timestamp">Mon 22 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/08/mapdroyd/">MapDroyd</a> <span class="related-post-date timestamp">Sun 08 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>1 in 6 Shocked by Cellphone Bill</title>
		<link>http://tadhg.com/wp/2010/05/27/1-in-6-shocked-by-cellphone-bill/</link>
		<comments>http://tadhg.com/wp/2010/05/27/1-in-6-shocked-by-cellphone-bill/#comments</comments>
		<pubDate>Fri, 28 May 2010 06:51:32 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[economics]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2972</guid>
		<description><![CDATA[Ars Technica reports on a new FCC survey [PDF] which found that about 30 million Americans have experienced unpleasant surprise at unexpected jumps in their cellphone bills. I’ll take this opportunity to complain about AT&#38;T, who recently decided to simply tack a data plan (at $30/month) onto my bill when I switched my SIM card [...]]]></description>
			<content:encoded><![CDATA[<p><a class="reference external" href="http://arstechnica.com/telecom/news/2010/05/new-shocking-statistics-on-bill-shock.ars">Ars Technica reports</a> on a new <a class="reference external" href="http://hraunfoss.fcc.gov/edocs_public/attachmatch/DOC-298414A1.pdf">FCC survey</a> [PDF] which found that about 30 million Americans have experienced unpleasant surprise at unexpected jumps in their cellphone bills. I’ll take this opportunity to complain about AT&amp;T, who recently decided to simply tack a data plan (at $30/month) onto my bill when I switched my SIM card into my new Nexus One—and this wasn’t a request, they just did it and informed me by text message. I was able to get them to credit my account with the amount, which works since I’ve left them for T-Mobile, but that was extremely irritating.</p>
<p>In addition, the amount they charge for text messages is simply ludicrous, all the more so given that I had to pay not merely to send but also to receive them. Finally, I hate the fact that they concentrate on “minutes” so much while refusing to make talk minutes fungible—other services should be expressed in minute cost, e.g. one text message should deduct one minute of voice from your account. I realize they have every incentive not to do this, but it’s still extremely irritating. So far T-Mobile seem better; it looks like my T-Mobile bill will be around the same as, or maybe slightly more than, my AT&amp;T bill, but now I have an unlimited data plan as part of that charge.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/economics/" rel="tag">economics</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/phone/" rel="tag">phone</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2007/02/12/cellphone-plans/">Cellphone Plans</a> <span class="related-post-date timestamp">Mon 12 Feb 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/09/24/the-allure-of-the-iphone/">The Allure of the iPhone</a> <span class="related-post-date timestamp">Mon 24 Sep 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/07/22/consumer-ephemera/">Consumer Ephemera</a> <span class="related-post-date timestamp">Sun 22 Jul 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2007/02/22/razr-annoyances/">Razr Annoyances</a> <span class="related-post-date timestamp">Thu 22 Feb 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/08/mapdroyd/">MapDroyd</a> <span class="related-post-date timestamp">Sun 08 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/01/travel-ebooks-and-real-books/">Travel, Ebooks, and Real Books</a> <span class="related-post-date timestamp">Sun 01 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/29/consumer-serendipity/">Consumer Serendipity</a> <span class="related-post-date timestamp">Thu 29 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/13/consumers-lament/">Consumer’s Lament</a> <span class="related-post-date timestamp">Tue 13 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/20/market-efficiency-in-action/">Market Efficiency in Action</a> <span class="related-post-date timestamp">Tue 20 Apr 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/27/1-in-6-shocked-by-cellphone-bill/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Online Life Might be an Open Book</title>
		<link>http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/</link>
		<comments>http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/#comments</comments>
		<pubDate>Tue, 25 May 2010 06:09:57 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2964</guid>
		<description><![CDATA[My friends Will Moffat and James Home, and their friend Peter Burns, created a site to highlight just how exposed your Facebook updates are: Openbook. It’s an interface to Facebook’s public search API, and the first thing you should probably do with it is search for a phrase from one of your recent status updates. [...]]]></description>
			<content:encoded><![CDATA[<p>My friends <a class="reference external" href="http://hamstersoup.com/">Will Moffat</a> and <a class="reference external" href="http://jameshome.com/">James Home</a>, and their friend <a class="reference external" href="http://github.com/rictic/">Peter Burns</a>, created a site to highlight just how exposed your Facebook updates are: <a class="reference external" href="http://youropenbook.org/">Openbook</a>. It’s an interface to Facebook’s public search API, and the first thing you should probably do with it is search for a phrase from one of your recent status updates. If it shows up, change your privacy settings!<br />
<span id="more-2964"></span><br />
The purpose of the site is to pressure Facebook into making its privacy controls <a class="reference external" href="http://youropenbook.org/proposal.html">far simpler</a>, which is a noble goal. The current system is so bad it’s been <a href="http://www.nytimes.com/interactive/2010/05/12/business/facebook-privacy.html" title="Facebook Privacy: A Bewildering Tangle of Options" >called out</a> by the <cite>New York Times</cite>, among others, and over time the set of who can see things about you by default <a href="http://mattmckeon.com/facebook-privacy/" title="The Evolution of Privacy on Facebook" >has expanded significantly</a>.</p>
<p>They’ve done a great job of exposing this, resulting in <a class="reference external" href="http://youropenbook.org/about.html">quite a lot of publicity</a></p>
<p>It’s worth it to spread the word about this—otherwise, only the internet-savvy will protect their privacy, and Facebook will find it easier to get away with the exposure of your personal data.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/culture/" rel="tag">culture</a>, <a href="http://tadhg.com/wp/tag/internet/" rel="tag">internet</a>, <a href="http://tadhg.com/wp/tag/privacy/" rel="tag">privacy</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/">iPad First Impressions: Consumption Machine</a> <span class="related-post-date timestamp">Sun 23 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/12/8-bit-cities/">8-Bit Cities</a> <span class="related-post-date timestamp">Mon 12 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/">Profiling Political Leanings by Browsing History</a> <span class="related-post-date timestamp">Fri 30 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/22/literacy-and-online-life/">Literacy and Online Life</a> <span class="related-post-date timestamp">Tue 22 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/09/02/the-devils-music/">The Devil’s Music</a> <span class="related-post-date timestamp">Thu 02 Sep 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/23/courtney-stoker-patriarchy-and-geek-misogyny/">Courtney Stoker, Patriarchy, and Geek Misogyny</a> <span class="related-post-date timestamp">Mon 23 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/22/nurture-not-nature/">Nurture, not Nature</a> <span class="related-post-date timestamp">Sun 22 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/20/lightsabers-are-still-cool/">Lightsabers are Still Cool</a> <span class="related-post-date timestamp">Fri 20 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/10/best-way-to-quit-a-job-ever/">Best Way to Quit a Job Ever</a> <span class="related-post-date timestamp">Tue 10 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/08/mapdroyd/">MapDroyd</a> <span class="related-post-date timestamp">Sun 08 Aug 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad First Impressions: Consumption Machine</title>
		<link>http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/</link>
		<comments>http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/#comments</comments>
		<pubDate>Mon, 24 May 2010 01:52:52 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[consciousness]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2960</guid>
		<description><![CDATA[I got an iPad for work on Friday, and have been playing around with it. I would not have bought one for myself, and have grave misgivings about the device, primarily due to its highly proprietary, locked-down, walled-garden approach.
That being said, I think it’s an extremely slick, well-designed device, and may represent the first steps [...]]]></description>
			<content:encoded><![CDATA[<p>I got an iPad for work on Friday, and have been playing around with it. I would not have bought one for myself, and have grave misgivings about the device, primarily due to its highly proprietary, locked-down, walled-garden approach.</p>
<p>That being said, I think it’s an extremely slick, well-designed device, and may represent the first steps towards a new phase in accessing computer and/or internet artifacts.<br />
<span id="more-2960"></span><br />
Before I get to that, I want to note that I hated having to synch it to iTunes before I could use it. For a “next-generation” device, one that supposedly breaks with older computing paradigms, that seemed rather pathetic. Also, I can’t stand iTunes, and the iPad setup was the only time I’d started it in the years I’ve had my Macbook Pro.</p>
<p>Once that was out of the way, however, it was all slick and smooth thereafter. Using the device: easy. Installing applications: easy. Browsing the web: easy.</p>
<p>The interface is, as promised, extremely intuitive. It works as you expect it to work. It’s also just fun to use, somehow.</p>
<p>So what’s the problem? Well, all of the criticisms about its closed model remain true. That it’s not easy to tinker with, that applications have to be approved by Apple, that getting data on and off it has to be managed by iTunes or some other application—these are all really bad things, in my opinion. That ground has been covered before, and if you’re interested you can read <a href="http://www.boingboing.net/2010/04/02/why-i-wont-buy-an-ipad-and-think-you-shouldnt-either.html" title="Why I won’t buy an iPad (and think you shouldn’t, either)" >Cory Doctorow’s take</a>, which I largely agree with.</p>
<p>What struck me even more than those issues, however, is just how geared towards consumption the iPad is. You add functionality via one mechanism: the App Store. While you can get some things for free there, the name makes clear that it’s about buying things. You can get content through the iTunes store. Many of the other apps, like the amazon.com application (or the Kindle application), are focused on making it easy to buy things.</p>
<p>Beyond that, the activities the device is suited for are consumption activities. Reading, browsing, buying, and watching videos are all really easy. I haven’t tried games on it yet, but I suspect that while games on it will be fun, they won’t (yet, at least) be as deep as games on dedicated platforms or on fully general-purpose computers. It does, however, support “casual games” quite well.</p>
<p>Up until this point, all general-purpose computing devices have been geared towards productivity of some kind. Even if they ended up being used as gaming boxes or as entertainment and netsurfing devices, they were designed for production of some kind, usually writing, programming, or management. This is not the case with the iPad. Regardless of whether or not you could actually edit video, or create music, or write efficiently, on it, its primary purpose is consumption. As such, I think it represents a significant break in the history of computing and the internet as the first mass-market, general-purpose device that is geared towards consuming rather than both consuming and producing.</p>
<p>This raises a question, one that is critical to assessing the validity of many of the criticisms of it (such as Doctorow’s): have computers been combined production/consumption machines up until now merely due to technological limitations, or is that combination an essential part of what a computer is? I think that what Jobs has done, deliberately and effectively, is tried to separate those two parts and get rid of the irritating bits that support production so that consumption can be made accessible and easy to more and more people.</p>
<p>Furthermore, Apple recognized that what made this attempted break with computing history possible was the touch interface. Crucially, the touch interface removes a layer of abstraction. Now there’s no cursor to move around with a mouse, and no commands to invoke via unknown (or clumsily announced) keystrokes. No abstraction, and hence almost no need for training. In many ways, the iPad is a device aimed squarely at <a href="http://tadhg.com/wp/2010/02/11/internet-illiteracy/" title="Internet Illiteracy" >the people who can’t tell the difference between an article about Facebook’s login page and Facebook’s login page itself</a>.</p>
<p>This is in many ways an inevitable step. URLs aren’t the best-designed things in the world (having the hierarchy go specific-to-general for domains and general-to-specific for resources on a domain, for example, is clearly screwy), and turning sites (accessible by URLs) into applications (accessible like other applications, by an easy launch mechanism) is probably inevitable too. But there’s clearly a loss with this, as abstraction in computing generally means power. That is, being able to manipulate resources with abstractions gives the user power, and abstracting things out before they reach the user takes power away from the user while making the smaller set of tasks they’re still able to do easier.</p>
<p>Many people will be in favor of this tradeoff; I’m not one of them, although I’d feel a lot better about it if it were a transient state that one could get past on a device (which I hope will be the case with the post-iPad tablets that emerge) rather than the state the device desires to keep its users in (which is the iPad’s approach).</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/consciousness/" rel="tag">consciousness</a>, <a href="http://tadhg.com/wp/tag/culture/" rel="tag">culture</a>, <a href="http://tadhg.com/wp/tag/internet/" rel="tag">internet</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/usability/" rel="tag">usability</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/07/12/8-bit-cities/">8-Bit Cities</a> <span class="related-post-date timestamp">Mon 12 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/">Your Online Life Might be an Open Book</a> <span class="related-post-date timestamp">Mon 24 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/11/internet-illiteracy/">Internet Illiteracy</a> <span class="related-post-date timestamp">Thu 11 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2006/11/23/power-to-the-users/">Power to the Users</a> <span class="related-post-date timestamp">Thu 23 Nov 2006</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/">Profiling Political Leanings by Browsing History</a> <span class="related-post-date timestamp">Fri 30 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>sabbatical.close()</title>
		<link>http://tadhg.com/wp/2010/05/16/sabbatical-close/</link>
		<comments>http://tadhg.com/wp/2010/05/16/sabbatical-close/#comments</comments>
		<pubDate>Mon, 17 May 2010 06:36:56 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[CrossFit]]></category>
		<category><![CDATA[diet]]></category>
		<category><![CDATA[document formats]]></category>
		<category><![CDATA[exercise]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reStructuredText]]></category>
		<category><![CDATA[roleplaying]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[sports]]></category>
		<category><![CDATA[T]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[tennis]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2942</guid>
		<description><![CDATA[After a highly enjoyable, productive, and extended period, it’s time for me to return to the world of paid work.
I’m quite happy with the things I’ve done during my time off. Many of them are important only to me, but then, it’s been my time off.

Here are some of the things I’ve done since leaving [...]]]></description>
			<content:encoded><![CDATA[<p>After a highly enjoyable, productive, and extended period, it’s time for me to return to the world of paid work.</p>
<p>I’m quite happy with the things I’ve done during my time off. Many of them are important only to me, but then, it’s been my time off.<br />
<span id="more-2942"></span><br />
Here are some of the things I’ve done since leaving Metaweb that I consider significant:</p>
<ul>
<li><strong>CrossFit</strong>. I’m approaching the one year mark, and it’s hard to overstate the importance of that for me. This is the first time in my life I’ve managed to keep an exercise routine of any kind going for that long. Not coincidentally, I’m also in the best shape of my life. I now feel that some kind of regular, intense, exercise has a similar place in my life to my morning pages—that is, something I I regard as mandatory and more or less permanent.
</li>
<li><strong>Diet</strong>. Not just <a href="http://tadhg.com/wp/2009/07/20/considering-carnivorism/" title="Considering Carnivorism" >switching back to eating meat</a>, but also radically cutting down on sugar and processed foods. This also has a lot to do with my being in good shape.
</li>
<li><strong>Document format</strong>. Until this year, I hadn’t found a text-based document format I liked, but I have now finally settled on <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>. One of the effects of this is that I shifted to doing all of my writing in a text editor rather than doing some of it in word processors. Another effect is that all of my writing is now much more amenable to programmatic manipulation.
</li>
<li><strong>Programming my own environment</strong>. Following from the previous item, I spent quite a bit of time working on solutions to various small niggles in my workflows, so that far less of my time is consumed by setup for writing. Some examples of this include scripts to insert the template for blog posts into my editor, scripts to publish to my blog directly from my editor, scripts to do word counting precisely as I wish it to be done, and many other small utilities that remove minor annoyances that I previously encountered almost every day. In many respects this kind of thing is precisely what programming and computers are for: to make it easier to create, and to lessen the gap between a thought and expression of that thought.
</li>
<li><strong>Digital organization</strong>. This includes <a href="http://tadhg.com/wp/2009/05/04/version-control-recovery/" title="Version Control Recovery" >recovering my subversion repository</a>, restoring my blog to proper working order, and various other steps that have made my digital domain much more manageable. This is bound up with the previous item too.
</li>
<li><strong>Switching to Vim</strong>. This was probably a long time coming, but nevertheless required a fair amount of work, not least in porting all my scripts for jEdit over to it. I’ve been extremely happy with Vim. I think that to most people this might sound trivial; how many people would regard switching word processors as an “achievement”? But a text editor is different from a word processor, and switching to Vim isn’t like switching between non-modal text editors. This, combined with moving all my writing to text editors and thus to Vim, is a profound change for me, and one that I’m very happy I took the time to get through.
</li>
<li><strong>WordPress plugins</strong>. <a href="http://tadhg.com/wp/wordpress-plugins/" title="WordPress Plugins" >I wrote some of these</a> to improve my blog after I got it working again.
</li>
<li><strong>PyWordCount</strong>. My word counting script/Vim plugin is done, but I have to finish the documentation for it and make it public. It’s significant to me because it’ll be my first self-contained public Python project, and also because it’s an outgrowth of the document format switch, the Vim switch, and the focus on programming my own environment to a much greater degree.
</li>
<li><strong>Q’Rith</strong>. I ran my first roleplaying sessions in 15 years, and am currently running my first roleplaying campaign in 15 years, in a world that I’ve created and am quite happy with so far.
</li>
<li><strong>Tennis</strong>. I started playing it again, and don’t know why I ever stopped.
</li>
</ul>
<p>Those are the main highlights. Many of them are internal, or are things that only I notice, but I think the effect they’ve had on me is actually quite major, and in positive ways.</p>
<p>As for what’s next, I’ll write about that tomorrow.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/crossfit/" rel="tag">CrossFit</a>, <a href="http://tadhg.com/wp/tag/diet/" rel="tag">diet</a>, <a href="http://tadhg.com/wp/tag/document-formats/" rel="tag">document formats</a>, <a href="http://tadhg.com/wp/tag/exercise/" rel="tag">exercise</a>, <a href="http://tadhg.com/wp/tag/food/" rel="tag">food</a>, <a href="http://tadhg.com/wp/tag/games/" rel="tag">games</a>, <a href="http://tadhg.com/wp/tag/goals/" rel="tag">goals</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/restructuredtext/" rel="tag">reStructuredText</a>, <a href="http://tadhg.com/wp/tag/roleplaying/" rel="tag">roleplaying</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/sports/" rel="tag">sports</a>, <a href="http://tadhg.com/wp/tag/t/" rel="tag">T</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/tennis/" rel="tag">tennis</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/version-control/" rel="tag">version-control</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a>, <a href="http://tadhg.com/wp/tag/wordpress/" rel="tag">WordPress</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/03/30/2010-goals-first-quarter-review/">2010 Goals: First Quarter Review</a> <span class="related-post-date timestamp">Tue 30 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/01/2010-goals/">2010 Goals</a> <span class="related-post-date timestamp">Fri 01 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/31/crossfit-and-coding-and-meat/">CrossFit and Coding (and Meat)</a> <span class="related-post-date timestamp">Thu 31 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/05/16/sabbatical-close/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Profiling Political Leanings by Browsing History</title>
		<link>http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/</link>
		<comments>http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 19:44:52 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2898</guid>
		<description><![CDATA[Slate has put together a tool that gives a very rough indication of a user’s political tendencies by checking which sites on a list the user has visited; each of the sites has a score based on readership by people with declared political affiliations.
It doesn’t actually read your browser history per se, instead just checking [...]]]></description>
			<content:encoded><![CDATA[<p><a class="reference external" href="http://www.slate.com/"><cite>Slate</cite></a> has put together a <a href="http://www.slate.com/id/2252247/" title="Escape From the Echo Chamber: An interactive test of how open-minded your news diet is." >tool that gives a very rough indication of a user’s political tendencies</a> by checking which sites on a list the user has visited; each of the sites has a score based on readership by people with declared political affiliations.</p>
<p>It doesn’t actually read your browser history per se, instead just checking to see if you’ve visited the home pages of the sites on its list.<br />
<span id="more-2898"></span><br />
There are obviously many flaws with this approach, the first being the limitation to just two viewpoints, “liberal” and “conservative” (in the American senses). In addition, it can’t account for how you feel about any particular news source. And the list of sites it checks for is (almost inevitably) quite limited; a number of sites I visit regularly for news content don’t show up at all (<a class="reference external" href="http://counterpunch.com/">counterpunch.com</a>, for example). It would be far more interesting if the list of sites were larger—only 112 were used in the study that it was based on.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/culture/" rel="tag">culture</a>, <a href="http://tadhg.com/wp/tag/politics/" rel="tag">politics</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/08/23/courtney-stoker-patriarchy-and-geek-misogyny/">Courtney Stoker, Patriarchy, and Geek Misogyny</a> <span class="related-post-date timestamp">Mon 23 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/06/controlling-discourse-in-the-internet-era/">Controlling Discourse in the Internet Era</a> <span class="related-post-date timestamp">Fri 06 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/05/proposition-8-overturned-in-california/">Proposition 8 Overturned in California</a> <span class="related-post-date timestamp">Thu 05 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/12/8-bit-cities/">8-Bit Cities</a> <span class="related-post-date timestamp">Mon 12 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/06/08/best-in-lifethe-greatest-joy/">Best in Life/The Greatest Joy?</a> <span class="related-post-date timestamp">Tue 08 Jun 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/24/your-online-life-might-be-an-open-book/">Your Online Life Might be an Open Book</a> <span class="related-post-date timestamp">Mon 24 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/23/ipad-first-impressions-consumption-machine/">iPad First Impressions: Consumption Machine</a> <span class="related-post-date timestamp">Sun 23 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/21/the-city-and-sim-city/">The City and <cite>Sim City</cite></a> <span class="related-post-date timestamp">Fri 21 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/18/money-motivation-and-social-organization/">Money, Motivation, and Social Organization</a> <span class="related-post-date timestamp">Tue 18 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/20/market-efficiency-in-action/">Market Efficiency in Action</a> <span class="related-post-date timestamp">Tue 20 Apr 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/04/30/profiling-political-leanings-by-browsing-history/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Improving a Python Word Counting Function</title>
		<link>http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/</link>
		<comments>http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 20:33:36 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2892</guid>
		<description><![CDATA[This post could be summarized as “regular expressions are a lot faster than naive for loops”.
I’ve been working on improving the script I use for live wordcount in Vim, partly for performance and partly so that I can package it up as a plugin and share it with other people. Along the way I’ve improved [...]]]></description>
			<content:encoded><![CDATA[<p>This post could be summarized as “regular expressions are a lot faster than naive for loops”.</p>
<p>I’ve been working on improving the script I use for live wordcount in Vim, partly for performance and partly so that I can package it up as a plugin and share it with other people. Along the way I’ve improved the speed of the script rather significantly, and will go through the key part of that change here.<br />
<span id="more-2892"></span><br />
The core part of the script, unsurprisingly, is the <tt class="docutils literal"><span class="pre">count_words()</span></tt> function. As is common, it treats groups of letters surrounded by spaces as “words”. New lines also mark the end of a word. So do a variety of other characters, such as em dashes—in fact, one of the motivations for writing my own wordcount was because I wanted em dashes to be recognized as word separators.</p>
<p>In the following code, <tt class="docutils literal"><span class="pre">self.WORD_SEPS</span></tt> and <tt class="docutils literal"><span class="pre">self.LINE_SEPS</span></tt> are lists containing characters that separate words and lines. <tt class="docutils literal"><span class="pre">self.REPEATER_SEPS</span></tt> contains characters like “-”, which in my opinion does not separate words when used singly (e.g. “twenty-three” is one word) but does when used consecutively; “&#8211;” is a simple way to write an em dash when you’re restricted to ASCII. <tt class="docutils literal"><span class="pre">self.IGNORE</span></tt> is a list of characters that cannot form words on their own but aren’t necessarily separators, either.</p>
<p>The code is quite naive in its approach. It goes through the text letter by letter, checks the letter to see whether or not it’s in one of those lists, adjusts the count accordingly, and also stores <tt class="docutils literal"><span class="pre">previous_char</span></tt> in order to be able to handle the repeater separators.</p>
<pre class="python literal-block">
def count_words(self, text):
    words, lines = 0, 1
    word, previous_char = 0, None
    lineword_separators = self.LINE_SEPS + self.WORD_SEPS
    repeater_test = lambda c, pc: bool(
        c in self.REPEATER_SEPS and pc in self.REPEATER_SEPS)
    separator_test = lambda c, pc: bool(
        char in lineword_separators or repeater_test(c, pc))
    for char in text:
        if separator_test(char, previous_char):
            word = 0
            if char in (self.LINE_SEPS):
                lines = lines + 1
        elif char in (self.IGNORE):
            pass
        else:
            #it’s part of a word.
            if not word:
                words = words + 1
                word = 1
        previous_char = char

    return (words, lines)
</pre>
<p>With that code as the central function, the script takes about three seconds to process a text file that’s approximately 400K/68,000 words.</p>
<p>The new version eliminates the need for a separate list of repeater separators, is fewer lines of code, and is faster:</p>
<pre class="python literal-block">
def count_words(self, text):

    def ors(l): return r&quot;|&quot;.join([re.escape(c) for c in l])
    def retext(text, chars, sub):
        return re.compile(ors(chars)).sub(sub, text)

    lines = text and len(re.compile(ors(self.LINE_SEPS)).split(text)) or 0

    text = retext(text, self.WORD_SEPS + self.LINE_SEPS, u&quot; &quot;)
    text = retext(text.strip(), self.IGNORE, u&quot;&quot;)
    words = text and len(re.compile(r&quot;[ ]+&quot;).split(text)) or 0

    return (words, lines)
</pre>
<p>The basic approach here is different. Rather than going through the text and evaluating it character by character, instead it replaces all of the characters in the separator lists with spaces, removes all the characters in the ignore list, uses <tt class="docutils literal"><span class="pre">split()</span></tt> to get a list of all the words in the text, and then counts the length of that list.</p>
<p>The most awkward part of it is having to construct the regular expressions out of the lists of characters, which is what the <tt class="docutils literal"><span class="pre">ors()</span></tt> function does. I could have replaced the lists with regular expressions, but I want it to be easy for users to alter the lists to suit their own preferences, and so left them as plain lists.</p>
<p>(Note that I’m restricted to Python 2.3 here since this needs to run in MacVim; hence the old-style <tt class="docutils literal"><span class="pre">and</span></tt> and <tt class="docutils literal"><span class="pre">or</span></tt> instead of new-style ternary expressions.)</p>
<p>Using that code instead of the previous version, and operating on the same 400K/68,000-word file, the script takes about 0.12 seconds—a 25-fold speed increase. Since this is a “live” wordcount, one that has to recount the entire file whenever you do something other than typing or adding a single new line, that’s an important difference, and it makes it much more usable when working with large files.</p>
<p>I had no illusions that my original version was anything close to optimal when I first wrote it, but I didn’t realize that the speed gains from doing it better would be so significant. Python’s regular expression handling is done by a C module, and I suspect that C module is quite highly optimized indeed. So, if speed is important, let highly-optimized C do the work, instead of doing it in your own code.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/">Better Word Count in jEdit</a> <span class="related-post-date timestamp">Sun 19 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/02/python-script-for-subversion-status/">Python Script for Subversion Status</a> <span class="related-post-date timestamp">Sun 02 Aug 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Market Efficiency in Action</title>
		<link>http://tadhg.com/wp/2010/04/20/market-efficiency-in-action/</link>
		<comments>http://tadhg.com/wp/2010/04/20/market-efficiency-in-action/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 00:18:43 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[economics]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2868</guid>
		<description><![CDATA[It should be clear that having better access to information than others will make it pretty easy to make money in market trading. And:

While markets are supposed to ensure transparency by showing orders to everyone simultaneously, a loophole in regulations allows marketplaces like Nasdaq to show traders some orders ahead of everyone else in exchange [...]]]></description>
			<content:encoded><![CDATA[<p>It should be clear that having better access to information than others will make it pretty easy to make money in market trading. And:</p>
<blockquote><p>
While markets are supposed to ensure transparency by showing orders to everyone simultaneously, a loophole in regulations allows marketplaces like Nasdaq to show traders some orders ahead of everyone else in exchange for a fee. </p>
<div class="block-cite">—Charles Duhigg. <a href="http://www.nytimes.com/2009/07/24/business/24trading.html?_r=3&#038;ref=business">“Stock Traders Find Speed Pays, in Milliseconds”</a>. <a href="http://www.nytimes.com/"><em>The New York Times</em></a>, 23 July 2009.</div>
</blockquote>
<p>That seems like quite the loophole.<br />
<span id="more-2868"></span><br />
Predictably, the major players are exploiting it:</p>
<blockquote><p>
The deep-pocket bank/brokerages actually pay the NYSE and the NASDAQ to “colocate” their behemoth computers ON THE FLOOR OF THE EXCHANGES so they can shave off critical milliseconds after they’ve gotten a first-peak [<em>sic</em>] at incoming trades. </p>
<div class="block-cite">—Mike Whitney. <a href="http://www.counterpunch.org/whitney04162010.html">“High-Frequency Trading as High-Tech Robbery”</a>. <a href="http://www.counterpunch.org/"><em>CounterPunch</em></a>, 16 April 2010.</div>
</blockquote>
<p>The players on Wall Street are not going to stop doing this kind of thing anytime soon. Their entire existence is predicated on finding stuff like this and profiting from it. Call it arbitrage, cheating, deceit, exploitation, whatever, but it’s what makes them hugely rich, and if one avenue is closed off they’ll find another. Regulation would certainly help, but what’s really needed is more direct (and democratic) connections between people and their money—much of the dodgy financial history of the last thirty years is of Wall Street figuring out how to induce the shepherds of other people’s money (pension fund managers, corporate officers, public officials) to make bad bets, and then cleaning up thereafter. This is pervasive enough to have <a href="http://tadhg.com/wp/2009/10/09/yankee-stadium-and-whats-wrong-with-america/" title="Yankee Stadium and What’s Wrong with America" >significantly warped the economy of New York’s cultural events</a>, and it’s not getting any better.</p>
<p>The moral hazard in inducements to gamble with other people’s money should be clear. The technology certainly exists today to make concentrations of “public” wealth (as pension funds and, indeed, corporations ostensibly are) much more responsive to that public, but this would require wiping away a large chunk of the entrenched financial interests (and they have the money to fight that, clearly).</p>
<p>It almost goes without saying that cheating, particularly of the kind outlined by <cite>The New York Times</cite> and Mike Whitney above, should be forbidden both right now and in any future better market arena, but fixing things like that just isn’t enough. The whole thing needs to be changed utterly (note that it would be possible to change it utterly while retaining capitalism and democracy, incidentally—an anarchist revolution isn’t necessarily required here, although hypothetically a true anarchist revolution would solve these and a lot of other problems).</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/economics/" rel="tag">economics</a>, <a href="http://tadhg.com/wp/tag/politics/" rel="tag">politics</a>, <a href="http://tadhg.com/wp/tag/power/" rel="tag">power</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2007/06/24/danah-boyd-on-online-class-divisions/">danah boyd on Online Class Divisions</a> <span class="related-post-date timestamp">Sun 24 Jun 2007</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/06/some-recent-web-reading-on-economics/">Some Recent Web Reading on Economics</a> <span class="related-post-date timestamp">Tue 06 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/18/money-motivation-and-social-organization/">Money, Motivation, and Social Organization</a> <span class="related-post-date timestamp">Tue 18 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/14/whats-really-happening-in-greece/">What’s Really Happening in Greece</a> <span class="related-post-date timestamp">Fri 14 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/04/building-the-bubble/">Building the Bubble</a> <span class="related-post-date timestamp">Tue 04 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/23/the-history-of-debt/">The History of Debt</a> <span class="related-post-date timestamp">Fri 23 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/03/bullying-just-a-hunch/">Bullying: Just a Hunch</a> <span class="related-post-date timestamp">Thu 03 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/10/30/plug-fun/">Plug Fun</a> <span class="related-post-date timestamp">Fri 30 Oct 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/06/18/passwords-please/">Passwords Please</a> <span class="related-post-date timestamp">Thu 18 Jun 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2008/10/03/safe-in-the-hands-of-henry-paulson/">Safe in the Hands of Henry Paulson</a> <span class="related-post-date timestamp">Fri 03 Oct 2008</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/04/20/market-efficiency-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Growl Notifications</title>
		<link>http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/</link>
		<comments>http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:43:22 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2814</guid>
		<description><![CDATA[I use a notification system for OS X called Growl, which provides a single channel for various applications to use when they have something to tell me. I mainly use it for IM and email. I’m fairly happy with it, but one issue that irked me was dealing with clearing a bunch of the notifications [...]]]></description>
			<content:encoded><![CDATA[<p>I use a notification system for OS X called <a class="reference external" href="http://growl.info/">Growl</a>, which provides a single channel for various applications to use when they have something to tell me. I mainly use it for IM and email. I’m fairly happy with it, but one issue that irked me was dealing with clearing a bunch of the notifications off the screen.<br />
<span id="more-2814"></span><br />
You can set them to disappear on their own, but then you run the risk of missing them if you’re away from your keyboard, or if you just don’t happen to catch their content in time. So I set mine to all stay on the screen until they’re dismissed. In order to dismiss them, you either click to close each one individually, or you can restart Growl from the OS menu bar.</p>
<p>To do the latter, you more or less have to use the mouse, and that eventually began to annoy me. I looked around, and found that there was a commandline controller called <tt class="docutils literal"><span class="pre">growlctl</span></tt>, but that it was no longer included in Growl releases. It can be found in the Extras section of the Growl 0.7.6 release, though, which they still have available for download.</p>
<p>I downloaded that, installed it (which really just means moving it to somewhere on your path), and verified that it does indeed still work. I then created a rather simple script:</p>
<pre class="literal-block">
/usr/local/bin/growlctl restart
</pre>
<p>And put it in my homedir, calling it <tt class="docutils literal"><span class="pre">gr.sh</span></tt>. <a class="reference external" href="http://en.wikipedia.org/wiki/Quicksilver_(software)">Quicksilver</a> knows that it’s there, so now clearing the notifications requires, at most, the following keystrokes: <tt class="docutils literal"><span class="pre">&lt;Ctrl-Space&gt;gr&lt;Enter&gt;</span></tt>. Itch scratched.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/os-x/" rel="tag">OS X</a>, <a href="http://tadhg.com/wp/tag/personal/" rel="tag">personal</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/11/26/open-source-thanks/">Open Source Thanks</a> <span class="related-post-date timestamp">Thu 26 Nov 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/02/python-script-for-subversion-status/">Python Script for Subversion Status</a> <span class="related-post-date timestamp">Sun 02 Aug 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#64;: A Triumph of Design</title>
		<link>http://tadhg.com/wp/2010/03/22/a-triumph-of-design/</link>
		<comments>http://tadhg.com/wp/2010/03/22/a-triumph-of-design/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 04:50:26 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[reStructuredText]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2782</guid>
		<description><![CDATA[The New York Museum of Modern Art has added the &#64; symbol to its architecture and design collection. Originating perhaps as a Latin abbreviation for “toward”, it showed up on one of the early Underwood typewriters (possibly the Underwood 1; it was definitely on the Underwood No. 5) and was used for “at the rate [...]]]></description>
			<content:encoded><![CDATA[<p>The New York Museum of Modern Art has <a class="reference external" href="http://www.nytimes.com/2010/03/22/arts/design/22iht-design22.html">added the &#64; symbol to its architecture and design collection</a>. Originating perhaps as a Latin abbreviation for “toward”, it showed up on one of the early <a class="reference external" href="http://en.wikipedia.org/wiki/Underwood_Typewriter_Company">Underwood</a> typewriters (possibly the Underwood 1; it was definitely on the Underwood No. 5) and was used for “at the rate of”, which usage still survives.<br />
<span id="more-2782"></span><br />
But it’s really being recognized as a landmark of design because of its use as the separator between username and hostname—specifically, in email addresses, chosen by <a class="reference external" href="http://en.wikipedia.org/wiki/Ray_Tomlinson">Ray Tomlinson</a> in <a href="http://news.bbc.co.uk/2/hi/in_depth/sci_tech/2000/dot_life/1586229.stm" title="H@ppy birthday to you" >1971</a>.</p>
<p>It has <a href="http://en.wikipedia.org/wiki/@" title="@" >plenty of other uses</a>, and while we’re here I’ll note that I use it as an imformal extension to reStructuredText: I surround links that have titles with &#64; symbols and have a script run through the text to insert the actual reST necessary to support that (which, sadly, does require a custom directive).</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/design/" rel="tag">design</a>, <a href="http://tadhg.com/wp/tag/language/" rel="tag">language</a>, <a href="http://tadhg.com/wp/tag/restructuredtext/" rel="tag">reStructuredText</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/12/moving-from-word-processors-to-restructuredtext/">Moving From Word Processors to reStructuredText</a> <span class="related-post-date timestamp">Sun 12 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/12/29/2009-goals-review/">2009 Goals Review</a> <span class="related-post-date timestamp">Tue 29 Dec 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/">Better Word Count in jEdit</a> <span class="related-post-date timestamp">Sun 19 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/14/blog-workflow-with-restructuredtext/">Blog Workflow with reStructuredText</a> <span class="related-post-date timestamp">Tue 14 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/03/22/a-triumph-of-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Future of Tabletop Games? D&amp;D on the Microsoft Surface</title>
		<link>http://tadhg.com/wp/2010/02/26/the-future-of-tabletop-games-dd-on-the-microsoft-surface/</link>
		<comments>http://tadhg.com/wp/2010/02/26/the-future-of-tabletop-games-dd-on-the-microsoft-surface/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 02:15:35 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[entertainment]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[roleplaying]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2717</guid>
		<description><![CDATA[Microsoft Surface is an advanced touchscreen display built into a table, backed by a fairly advanced suite of software for gesture recognition. I hadn’t seen many compelling uses for this technology&#8230; until SurfaceScapes, a group at the Carnegie-Mellon Entertainment Technology Center, released demos of Surfaces customized to hangle playing miniature-based D&#38;D on them.

I strongly recommend [...]]]></description>
			<content:encoded><![CDATA[<p><a class="reference external" href="http://en.wikipedia.org/wiki/Microsoft_Surface">Microsoft Surface</a> is an advanced touchscreen display built into a table, backed by a fairly advanced suite of software for gesture recognition. I hadn’t seen many compelling uses for this technology&#8230; until <a class="reference external" href="http://www.etc.cmu.edu/projects/surfacescapes/">SurfaceScapes</a>, a group at the <a class="reference external" href="http://en.wikipedia.org/wiki/Entertainment_Technology_Center">Carnegie-Mellon Entertainment Technology Center</a>, released demos of Surfaces customized to hangle playing miniature-based <cite>D&amp;D</cite> on them.<br />
<span id="more-2717"></span><br />
I strongly recommend watching the video of the demos, and reading the commentary and an interview with the project lead:</p>
<ul>
<li><a class="reference external" href="http://blogs.msdn.com/surface/archive/2009/10/19/dungeons-dragons-done-right-on-microsoft-surface.aspx">“Dungeons &amp; Dragons done right on Microsoft Surface”</a>.
</li>
<li><a class="reference external" href="http://blogs.msdn.com/surface/archive/2009/12/08/bringing-d-d-to-microsoft-surface.aspx">“SurfaceScapes Follow-up: Bringing D&amp;D to Microsoft Surface”</a>.
</li>
<li><a class="reference external" href="http://blogs.msdn.com/surface/archive/2009/12/16/new-gameplay-video-with-d-d-on-surface.aspx">“New gameplay video with D&amp;D on Surface”</a>.
</li>
</ul>
<p>Some of it is quite clumsy, but the potential is clearly there. And looks amazing. While this could definitely aid the playing of <cite>D&amp;D</cite>, there are many games that could benefit from this kind of treatment. Specifically, any games that benefit both from having people physically present and that would also benefit from computation and helpful interfaces (yes, I’m looking at you, <cite>Twilight Imperium</cite>) could get a huge boost from this technology.</p>
<p>It’s a long way away from being available or affordable, and probably a long way from being easily modifiable, too. But we don’t seem to be that far from having commonplace enhanced tabletop games. In the meantime, for roleplaying games there’s the <a class="reference external" href="http://www.rptools.net/">RPTools</a> suite—a suite which may well eventually be a big part of an open source tabletop gaming toolset.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/entertainment/" rel="tag">entertainment</a>, <a href="http://tadhg.com/wp/tag/games/" rel="tag">games</a>, <a href="http://tadhg.com/wp/tag/roleplaying/" rel="tag">roleplaying</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/08/inkscape/">Inkscape</a> <span class="related-post-date timestamp">Mon 08 Mar 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/02/26/ai-and-games/">AI and Games</a> <span class="related-post-date timestamp">Thu 26 Feb 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/08/08/mapdroyd/">MapDroyd</a> <span class="related-post-date timestamp">Sun 08 Aug 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/07/19/intelligence-scores-and-roleplaying-game-combat/">Intelligence Scores and Roleplaying Game Combat</a> <span class="related-post-date timestamp">Mon 19 Jul 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/02/clearing-growl-notifications/">Clearing Growl Notifications</a> <span class="related-post-date timestamp">Fri 02 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/01/anaqrest/">Anaq’rest</a> <span class="related-post-date timestamp">Thu 01 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/03/30/2010-goals-first-quarter-review/">2010 Goals: First Quarter Review</a> <span class="related-post-date timestamp">Tue 30 Mar 2010</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/02/26/the-future-of-tabletop-games-dd-on-the-microsoft-surface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some Vim Script Implementation, Testing, and Hackery</title>
		<link>http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/</link>
		<comments>http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 07:50:47 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Jython]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2690</guid>
		<description><![CDATA[As a result of my porting over jEdit (Jython) macros to Vim, I now have a fair amount of (Python) Vim scripts, and have learned some things about how to set up those scripts. I&#8217;ll go through some of that below, and hopefully other people writing Python scripts for Vim will find it useful.

In jEdit, [...]]]></description>
			<content:encoded><![CDATA[<p>As a result of my porting over <a class="reference external" href="http://jedit.org/">jEdit</a> (Jython) macros to <a class="reference external" href="http://www.vim.org/">Vim</a>, I now have a fair amount of (Python) Vim scripts, and have learned some things about how to set up those scripts. I&#8217;ll go through some of that below, and hopefully other people writing Python scripts for Vim will find it useful.<br />
<span id="more-2690"></span><br />
In jEdit, you invoke macros either by selecting them from a menu (clearly unacceptable) or by opening the <a class="reference external" href="http://www.jedit.org/users-guide/action-bar.html">Action Bar</a> (Ctrl-Enter, for me) and then typing the name of the macro, where “name” means the non-extension part of the filename. I put my macro files went in a subdirectory of the macros directory, and there were namespace issues—all macro names had to be unique, and also couldn&#8217;t match any internal jEdit actions. Furthermore, you couldn&#8217;t pass arguments to them. Despite those issues, it was a powerful and quick piece of functionality, and I wanted to make Vim at least match it.</p>
<p>You can put Python directly into Vim script files, but I wanted to do that as minimally as possible. I added a Vim script that would (essentially) include a Python file, and then I had that Python file import from other Python files as necessary. The Python file includes a class, <tt class="docutils literal"><span class="pre">TBase</span></tt>, that contains the functions I want to run; as much code as possible is kept out of those functions and is in other files—files which ideally are individually testable.</p>
<p>To get to those functions from within Vim, I did this:</p>
<pre class="literal-block">
if filereadable($HOME.&quot;/.vim/plugin/tadhg/tadhg.py&quot;)
    pyfile $HOME/.vim/plugin/tadhg/tadhg.py
endif

&quot; Create the commands pointing the Python in tadhg.py:
if !exists(&quot;:T&quot;)
  command! -range -nargs=+ T python tadhgbase = TBase('rs=&lt;line1&gt; rf=&lt;line2&gt;'); tadhgbase('&lt;args&gt;')
endif

nmap &lt;D-CR&gt; :T
</pre>
<p>That code goes in a Vim script that goes in <tt class="docutils literal"><span class="pre">~/.vim/plugins/tadhg/</span></tt>; it&#8217;s loaded when Vim is. This means that the code in <tt class="docutils literal"><span class="pre">tadhg.py</span></tt> is evaluated at Vim start, so the <tt class="docutils literal"><span class="pre">TBase</span></tt> class is available. Furthermore the user Ex mode command “T” creates a new instance of <tt class="docutils literal"><span class="pre">TBase</span></tt> and then calls it with whatever the user enters after “T”. Finally, Command-Enter is mapped to enter Ex mode and type “T ”, which is quite close indeed to the jEdit functionality I had, but without the disadvantages. I have much more control over the namespace, and I can pass arguments.</p>
<p>When the T command is invoked, a new <tt class="docutils literal"><span class="pre">TBase</span></tt> instance is created and it gets passed the range start and range end line numbers from Vim, which is pretty important for some of the functions. Then the new instance is called, with the argument of whatever was typed after “T ”.</p>
<p>This is the code for handling that latter aspect:</p>
<pre class="python literal-block">
def __call__(self, argstring):
    &quot;&quot;&quot;
    The first arg is the command; the rest are arguments to that command.
    &quot;&quot;&quot;
    args = argstring.split(u&quot; &quot;)

    #Need to extract the keyword args out of args
    kwargs = dict([(arg.split(&quot;=&quot;)[0], arg.split(&quot;=&quot;)[1]) for arg in s.split(&quot; &quot;) if &quot;=&quot; in arg])
    args = [arg for arg in s.split(&quot; &quot;) if &quot;=&quot; not in arg]

    if args and args[0] in self.__class__.__dict__.keys():
        import types
        f = self.__class__.__dict__[args[0]]
        if type(f) == types.FunctionType:
            if args[1:]:
                f(self, *args[1:])
            else:
                f(self)
    else:
        print &quot;no command by that name&quot;
</pre>
<p>In other words, if the first (non-keyword) argument matches the name of a function in the class, run it and pass the rest of the (non-keyword) arguments to it. If I ever need keyword arguments as well, I&#8217;ll add the ability to pass them along too.</p>
<p>In order to actually manipulate Vim from these scripts, you have to use <tt class="docutils literal"><span class="pre">import</span> <span class="pre">vim</span></tt>. When I started writing this, I wasn&#8217;t sure how I&#8217;d test that, and I tried to keep the meat of the code in other files, e.g.:</p>
<pre class="python literal-block">
def mpc(self):
    &quot;&quot;&quot;
    Count the words, then insert them into the document's word count line.
    &quot;&quot;&quot;
    from write_wordcount import WriteWordcount
    wwc = WriteWordcount(tadhgbase)
    wwc.vim_main(vim)
</pre>
<p>(Note that I use <tt class="docutils literal"><span class="pre">import</span> <span class="pre">sys;</span> <span class="pre">sys.path.append(myscriptdir)</span></tt> at the top of the file to make these imports work.)</p>
<p>One of the advantages of this construction is that <tt class="docutils literal"><span class="pre">WriteWordCount</span></tt> can theoretically be used as a standalone script, on any file, and also that its <tt class="docutils literal"><span class="pre">vim_main</span></tt> method takes <tt class="docutils literal"><span class="pre">vim</span></tt> as an argument. For testing purposes, I had to created a <tt class="docutils literal"><span class="pre">MockVim</span></tt> class, which currently looks like this:</p>
<pre class="python literal-block">
class MockVimBuffer(object):

    def __init__(self):
        self.lines = []

    def __contains__(self, item):
        return item in self.lines

    def __iter__(self):
        return self.lines.__iter__()

    def __getitem__(self, index):
        return self.lines.__getitem__(index)

    def __setitem__(self, index, value):
        return self.lines.__setitem__(index, value)

class MockVimCurrent(object):

    def __init__(self):
        self.__dict__[&quot;buffer&quot;] = MockVimBuffer()

    def __setattr__(self, attr, value):
        if attr == &quot;buffer&quot;:
            self.__dict__[&quot;buffer&quot;].lines = value
        else:
            self.__dict__[attr] = value

class MockVim(object):

    def __init__(self):
        self.current = MockVimCurrent()
        self.commands = []

    def eval(self, command):
        command_list = {
            &quot;&amp;ft&quot;: lambda: self.rawmodes,
            &quot;exists('b:TotalWordCount')&quot;: lambda: False,
            &quot;tvar&quot;: lambda: self.tvar,

        }
        return command_list.get(command, lambda: &quot;&quot;)()

    def command(self, command):
        self.commands.append(command)
</pre>
<p>The <tt class="docutils literal"><span class="pre">eval</span></tt> method in <tt class="docutils literal"><span class="pre">MockVim</span></tt> simply returns whatever was appropriate for various tests I was running; I should change it to return <tt class="docutils literal"><span class="pre">self.command_list.get(command,</span> <span class="pre">lambda:</span> <span class="pre">&quot;&quot;)()</span></tt> instead, and make <tt class="docutils literal"><span class="pre">command_list</span></tt> an instance variable so that the various tests can manipulate it as needed instead of having to put specific commands in the base code.</p>
<p>Because the methods in <tt class="docutils literal"><span class="pre">TBase</span></tt> pass <tt class="docutils literal"><span class="pre">vim</span></tt> along to the instances or methods of the modules they import, testing those modules is relatively simple: in the test, you create a new <tt class="docutils literal"><span class="pre">MockVim</span></tt> object, call it <tt class="docutils literal"><span class="pre">vim</span></tt>, and then pass it along instead.</p>
<p>So everything is great (and testable). Unless, that is, you (meaning me) lapse from full test-driven development discipline and bits and pieces of functionality creep into <tt class="docutils literal"><span class="pre">TBase</span></tt>. Because <tt class="docutils literal"><span class="pre">TBase</span></tt> has that <tt class="docutils literal"><span class="pre">import</span> <span class="pre">vim</span></tt> line at the top of it and running it when you&#8217;re not actually in Vim produces an <tt class="docutils literal"><span class="pre">ImportError</span></tt>.</p>
<p>The right way to deal with this is to refactor <tt class="docutils literal"><span class="pre">TBase</span></tt> to take <tt class="docutils literal"><span class="pre">vim</span></tt> as one of its initialization arguments, and then have it set that as an instance variable, and then pass that in its methods, while also altering the line in the parent Vim script to:</p>
<pre class="literal-block">
command! -range -nargs=+ T python import vim; tadhgbase = TBase(vim, 'rs=&lt;line1&gt; rf=&lt;line2&gt;'); tadhgbase('&lt;args&gt;')
</pre>
<p>That way <tt class="docutils literal"><span class="pre">TBase</span></tt> is much easier to test, since the fake <tt class="docutils literal"><span class="pre">vim</span></tt> can be passed in at test time. However, for a bunch of reasons I didn&#8217;t want to do that just yet, partly because it means some reasonably heavy refactoring of pieces of code that I use every day—without tests, because the whole issue here is that <tt class="docutils literal"><span class="pre">TBase</span></tt> isn&#8217;t testable. So I wanted a way to make it testable while altering as little of its existing code (which I know currently works, after all) as possible. This took me a while to figure out, and is rather hacky—but it works.</p>
<p>First, in the test file, do this:</p>
<pre class="python literal-block">
from mockvim import MockVim
#Hack a mock Vim into the global namespace so that we can actually test:
import __builtin__
mv = MockVim()
__builtin__.mv = mv
from tadhg import TBase
</pre>
<p>Then alter the <tt class="docutils literal"><span class="pre">import</span> <span class="pre">vim</span></tt> line above the <tt class="docutils literal"><span class="pre">TBase</span></tt> class to instead read:</p>
<pre class="python literal-block">
try:
    import vim
except ImportError:
    import __builtin__
    vim = __builtin__.mv
</pre>
<p>What this really does is hack a giant global variable, <tt class="docutils literal"><span class="pre">vim</span></tt>, into all of the Python that&#8217;s run after those lines in the test file. Normally doing this seems like a rather bad idea, but it&#8217;s also rather necessary to handle the less-than-ideal situation I&#8217;m dealing with. Once I have the test harness using this hackery running properly, I&#8217;ll feel a lot better about switching over to a better architecture.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/jython/" rel="tag">Jython</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/">Better Word Count in jEdit</a> <span class="related-post-date timestamp">Sun 19 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/02/python-script-for-subversion-status/">Python Script for Subversion Status</a> <span class="related-post-date timestamp">Sun 02 Aug 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/17/jedit-macros-in-python/">jEdit Macros in Python</a> <span class="related-post-date timestamp">Fri 17 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First Post With Vim</title>
		<link>http://tadhg.com/wp/2010/02/14/first-post-with-vim/</link>
		<comments>http://tadhg.com/wp/2010/02/14/first-post-with-vim/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 04:05:48 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Jython]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2682</guid>
		<description><![CDATA[Over the last couple of weeks I’ve been hacking away on scripts to customize Vim, replicating the scripts I made for jEdit. I’m more or less done, and this blog post is being written in MacVim. This hopefully means that when I’m done with it I’ll be able to publish it from within Vim, the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last couple of weeks I’ve been hacking away on scripts to customize Vim, replicating the scripts I made for jEdit. I’m more or less done, and this blog post is being written in <a class="reference external" href="http://code.google.com/p/macvim/">MacVim</a>. This hopefully means that when I’m done with it I’ll be able to publish it from within Vim, the same as with <a class="reference external" href="http://jedit.org/">jEdit</a>.<br />
<span id="more-2682"></span><br />
Writing scripts for Vim has been rather different from writing them for jEdit. jEdit is an editor with a robust API; Vim is an editor that kind of gives the user access to the API all the time, via keyboard commands, and scripting for it often consists of simply passing keystrokes. As an example, this is the Jython code for getting the current selection in a jEdit macro:</p>
<pre class="python literal-block">
text = init.textArea.getSelectedText()
</pre>
<p>This is the Python for getting the current visual selection in Vim:</p>
<pre class="python literal-block">self.vim.command('normal gv&quot;wygv')
self.vim.command(&quot;let tvar = getreg(’t’)&quot;)
text = unicode(self.vim.eval(&quot;tvar&quot;), &quot;utf-8&quot;)
</pre>
<p>From a programming perspective, jEdit is clearly a lot nicer to deal with.</p>
<p>I have two primary reasons for making the switch:</p>
<ul>
<li>Future proofing: I couldn’t switch to the various pre-release versions of jEdit 4.3 because I couldn’t get my Jython scripts to work with them, and that made me worry that there simply weren’t enough people scripting jEdit in Python to make it likely that the plugin allowing Jython macros would be supported. Given how useful my scripts are, that would have trapped me with jEdit 4.2, or some future version, if support for JythonInterpreter flagged. Vim, on the other hand, seems to have a lot of people scripting for it in Python, and I don’t see Python support simply disappearing anytime soon with a new release.
</li>
<li>Power/speed: I’m someone who’s quite inclined towards keyboard shortcuts in all applications, and this means Vim should be a highly efficient environment.
</li>
<li>Mentality: Related to the previous point, I think that being able to manipulate text more powerfully will reinforce the approach of scripting as many steps as possible, rather than doing them (no matter how efficiently) manually. Even over the last couple of weeks, I’ve noticed that I’m more inclined to write scripts than to put up with various manual steps in my daily workflow.
</li>
</ul>
<p>So far I’ve mainly worked to replicate my jEdit setup in Vim, with a few small improvements here and there; the largest one is probably the live word count, which means that I can glance at the status line to see the current word count instead of having to select the text to be counted and then invoke the word counter. I’ve also tweaked it so it only counts the relevant parts of the document—for example, in this blog post, it doesn’t count the title or the datestamp.</p>
<p>I don’t intend to abandon jEdit, and have a feeling that I’ll use it for various things here and there, but I’ve switched over the Vim for the majority of my writing and programming.</p>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/jython/" rel="tag">Jython</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/">Better Word Count in Vim</a> <span class="related-post-date timestamp">Sun 17 Jan 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/">Better Word Count in jEdit</a> <span class="related-post-date timestamp">Sun 19 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/02/python-script-for-subversion-status/">Python Script for Subversion Status</a> <span class="related-post-date timestamp">Sun 02 Aug 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/17/jedit-macros-in-python/">jEdit Macros in Python</a> <span class="related-post-date timestamp">Fri 17 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/02/14/first-post-with-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Better Word Count in Vim</title>
		<link>http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/</link>
		<comments>http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 07:40:14 +0000</pubDate>
		<dc:creator>Tadhg</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Jython]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[text editing]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://tadhg.com/wp/?p=2596</guid>
		<description><![CDATA[I’m currently trying out Vim (again), and have made more progress this time, mainly due to Seth’s help. The key things that have made it better:

:set hidden. Absolutely critical, this. Stops Vim from complaining when you try to switch buffers and your current buffer has unsaved changes.

bufexplorer. Makes switching buffers a lot easier.

A better Python [...]]]></description>
			<content:encoded><![CDATA[<p>I’m currently trying out Vim (<a href="http://tadhg.com/wp/2009/08/09/time-to-try-vim/" title="Time to Try Vim" >again</a>), and have made more progress this time, mainly due to <a class="reference external" href="http://araxia.net/blog/seth">Seth</a>’s help. The key things that have made it better:</p>
<ul>
<li><tt class="docutils literal"><span class="pre">:set</span> <span class="pre">hidden</span></tt>. Absolutely critical, this. Stops Vim from complaining when you try to switch buffers and your current buffer has unsaved changes.
</li>
<li><a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=42">bufexplorer</a>. Makes switching buffers a lot easier.
</li>
<li><a href="http://hlabs.spb.ru/vim/python3.0.vim" title="Python 3.0" >A better Python syntax file</a>. I didn’t like the defaults.
</li>
<li>My own indentation and syntax files for reStructuredText.
</li>
</ul>
<p>Really, though, the key first one was <tt class="docutils literal"><span class="pre">:set</span> <span class="pre">hidden</span></tt>. Before that I felt that I had completely misunderstood Vim’s file management model.<br />
<span id="more-2596"></span><br />
Once I got the syntax highlighting to a reasonable state, I ported my <a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/" title="Better Word Count in jEdit" >word count macro</a> over to Vim. This wasn’t too hard after the inevitable character encoding problems. For working within Vim scripts, I strongly suggest using the following:</p>
<pre class="python literal-block">
ulines = [unicode(line, &quot;utf-8&quot;) for line in vim.current.buffer]
</pre>
<p>(Assuming your Vim encoding is set to UTF-8, of course.)</p>
<p>The Vim version of my script isn’t as versatile yet as the jEdit version, because I don’t know how to make it work with only selected lines (something that’s easy in jEdit). Apart from that, though, it seems to work quite well; the next version of it might do “live” word count in the status bar.</p>
<p>I’m currently writing this in Vim, or kind of: the actual writing is in Vim, but the creation of the file and the template, the automated expansion of various reStructuredText entities, output to reStructuredText, and the publication, are in jEdit as I haven’t ported those over yet.</p>
<p>The script:</p>
<pre class="python literal-block">
function! WordCount()
python &lt;&lt; EOF
import re
import vim

class WordCounter(object):
    &quot;&quot;&quot;
    Vim script for better word count.
    &quot;&quot;&quot;

    LINE_SEPARATORS = (
        &quot;\r&quot;,
        &quot;\n&quot;
    )

    WORD_SEPARATORS = (
        &quot; &quot;,        # space
        &quot;\t&quot;,       # tab
        &quot;/&quot;,        # slash
        &quot;&amp;&quot;,        # ampersand
        ’&quot;’,        # double quotation mark, straight
        u&quot;\u201C&quot;,  # double quotation mark, left
        u&quot;\u201D&quot;,  # double quotation mark, right
        u&quot;\u2018&quot;,  # single quotation mark, left
        u&quot;\u2013&quot;,  # en dash
        u&quot;\u2014&quot;,  # em dash
        &quot;&gt;&quot;,        # greater than symbol
        &quot;&lt;&quot;,        # less than symbol
        &quot;+&quot;,        # plus
        &quot;=&quot;,        # equals
    )

    REPEATER_SEPARATORS = (
    #These are only separators if they’re present consecutively, e.g. -- or ..
        &quot;-&quot;,
        &quot;.&quot;
    )

    IGNORE = (
    #Not separators per se, but should not be treated as word content
        &quot;’&quot;,        # single quotation mark, straight
        u&quot;\u2019&quot;,  # single quotation mark, right
        &quot;(&quot;,        # left parenthesis
        &quot;)&quot;,        # right parenthesis
        &quot;[&quot;,        # left bracket
        &quot;]&quot;,        # right bracket
        &quot;{&quot;,        # left curly bracket
        &quot;}&quot;,        # right curly bracket
        &quot;|&quot;,        # bar
        &quot;-&quot;,        # hyphen
        &quot;#&quot;,        # hash mark
        &quot;.&quot;,        # period
        &quot;_&quot;,        # underscore
        &quot;`&quot;,        # backtick
        &quot;\\&quot;,        # backslash
    )

    def word_count(self):

        ulines = [unicode(line, &quot;utf-8&quot;) for line in vim.current.buffer]
        text = u&quot;\n&quot;.join(ulines)

        chars = len(text) #Pretty sure I want the actual char count, not the adjusted char count.

        text = self.remove_directives(text)
        text = self.adjust_for_rest(text)
        words, lines = self.count_words(text)

        print &quot;chars: %s, words: %s, lines: %s&quot; % (chars, words, lines)

    def remove_directives(self, text):
        textlines = text.split(&quot;\n&quot;)
        newlines = []
        comment = re.compile(r&quot;[ ]*\.\. [a-zA-Z0-9_\|]&quot;)
        argument = re.compile(r&quot;    :[^\:]*:&quot;)
        for line in textlines:
            if not comment.match(line) and not argument.match(line):
                newlines.append(line)
        return &quot;\n&quot;.join(newlines)

    def adjust_for_rest(self, text):
        &quot;&quot;&quot;
            Go through each of the special cases for reST.
        &quot;&quot;&quot;
        text = self.rest_adjust_pipe_space(text)

        return text

    def rest_adjust_pipe_space(self, text):
        &quot;&quot;&quot;
            Special-case &quot;|\ &quot; to make sure e.g. &quot;|Hypnotic Specter|\ s&quot;
            doesn’t get counted as three words.

            |Incinerate|\ s |Hypnotic Specter|\ —|Hypnotic Specter|\ s
            The above line should be counted as five words.
        &quot;&quot;&quot;
        spacere = re.compile(r&quot;\|\\ ([^ ]{1})&quot;)
        finds = spacere.findall(text)
        text = spacere.sub(&quot;|\g&lt;1&gt;&quot;, text)
        return text

    def count_words(self, text):
        words, lines = 0, 1
        #go through the text character by character:
        word, previous_character = 0, None
        for character in text:
            if character in (self.LINE_SEPARATORS + self.WORD_SEPARATORS) or (character in self.REPEATER_SEPARATORS and previous_character in self.REPEATER_SEPARATORS):
                #it’s a separator
                word = 0
                if character in (self.LINE_SEPARATORS):
                    lines = lines + 1
            elif character in (self.IGNORE):
                pass
            else:
                #it’s part of a word.
                if not word:
                    words = words + 1
                    word = 1
            previous_character = character

        return (words, lines)

WordCounter().word_count()
EOF
endfunction

if !exists(&quot;:WW&quot;)
  command! WW  :call WordCount()
endif
</pre>
<p>Tags: <a href="http://tadhg.com/wp/tag/coding/" rel="tag">coding</a>, <a href="http://tadhg.com/wp/tag/jython/" rel="tag">Jython</a>, <a href="http://tadhg.com/wp/tag/python/" rel="tag">python</a>, <a href="http://tadhg.com/wp/tag/software/" rel="tag">software</a>, <a href="http://tadhg.com/wp/tag/tech/" rel="tag">tech</a>, <a href="http://tadhg.com/wp/tag/text-editing/" rel="tag">text editing</a>, <a href="http://tadhg.com/wp/tag/vim/" rel="tag">Vim</a>, <a href="http://tadhg.com/wp/tag/writing/" rel="tag">writing</a></p><h4 class='related-posts-header'>Related Posts</h4><ul class="related-posts-list"><li class="related-post"><a href="http://tadhg.com/wp/2010/02/14/first-post-with-vim/">First Post With Vim</a> <span class="related-post-date timestamp">Sun 14 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/16/sabbatical-close/">sabbatical.close()</a> <span class="related-post-date timestamp">Sun 16 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/04/29/improving-a-python-word-counting-function/">Improving a Python Word Counting Function</a> <span class="related-post-date timestamp">Thu 29 Apr 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/02/16/some-vim-script-implementation-testing-and-hackery/">Some Vim Script Implementation, Testing, and Hackery</a> <span class="related-post-date timestamp">Tue 16 Feb 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/19/better-word-count-in-jedit/">Better Word Count in jEdit</a> <span class="related-post-date timestamp">Sun 19 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/09/24/rtf_word_restructuredtext-toolchain/">RTF/Word–reStructuredText Toolchain</a> <span class="related-post-date timestamp">Thu 24 Sep 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2010/05/28/some-futurist-speculation-on-screen-interfaces/">Some Futurist Speculation on Screen Interfaces</a> <span class="related-post-date timestamp">Fri 28 May 2010</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/08/02/python-script-for-subversion-status/">Python Script for Subversion Status</a> <span class="related-post-date timestamp">Sun 02 Aug 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/28/better-rest-wordpress-pipeline/">Better reST–WordPress Pipeline</a> <span class="related-post-date timestamp">Tue 28 Jul 2009</span></li><li class="related-post"><a href="http://tadhg.com/wp/2009/07/17/jedit-macros-in-python/">jEdit Macros in Python</a> <span class="related-post-date timestamp">Fri 17 Jul 2009</span></li></ul>]]></content:encoded>
			<wfw:commentRss>http://tadhg.com/wp/2010/01/17/better-word-count-in-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
