<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
  <title type="text">Texas Expat</title>
  <subtitle type="text"></subtitle>
  <id>http://texasexpat.net/</id>
  <link rel="alternate" type="application/xhtml+xml" href="http://texasexpat.net/" />
  <link rel="self" type="application/atom+xml" href="http://texasexpat.net/atom.xml"/>
  <author>
    <name>Trevor Fountain</name>
    <email>trevor@blazinggriffin.com</email>
  </author>
  <rights>Creative Commons Attribution-NonCommercial 3.0 Unported</rights>
  <generator uri="http://www.sixapart.com/movabletype/" version="5.01">Movable Type</generator>
  
  
  <updated>2012-05-05T16:26:39Z</updated>
  <entry>
    <title type="text">I Want a Girl Who Reads</title>
    <summary type="text">"So, what do you go for in a girl?"He crows, lifting a lager to his lipsGestures where his mate sitsDowns his glass"He prefers titsI prefer ass.What do you go for in a girl?"I don't feel comfortableThe air left the room...</summary>
    <content type="html"><![CDATA[<p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">"So, what do you go for in a girl?"<br />He crows, lifting a lager to his lips<br />Gestures where his mate sits<br />Downs his glass<br />"He prefers tits<br />I prefer ass.<br />What do you go for in a girl?"</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I don't feel comfortable<br />The air left the room a long time ago<br />All eyes are on me<br />Well, if you must know</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I want a girl who reads<br />Yeah. Reads.<br />I'm not trying to call you a chauvinist<br />Cos I know you're not alone in this<br />but...</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I want a girl who reads<br />Who needs the written word<br />&amp; uses the added vocabulary<br />She gleans from novels and poetry<br />To hold lively conversation<br />In a range of social situations</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I want a girl who reads<br />Who's heart bleeds at the words of Graham Greene<br />Or even Heat magazine<br />Who'll tie back her hair while reading Jane Eyre<br />and goes cover to cover with each waterstones three for two offer<br />but I want a girl who doesn't stop there</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I want a girl who reads<br />Who feeds her addiction for fiction<br />With unusual poems and plays<br />That she hunts out in crooked bookshops for days and days and days<br />She'll sit addicted at breakfast, soaking up the back of the conflakes box<br />And the information she gets from what she reads makes her a total fox<br />Cos she's interesting &amp; unique<br />&amp; her theories make me go weak at the knees</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">I want a girl who reads</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">A girl who's eyes will analyse<br />The menu over dinner<br />Who'll use what she learns to kick my ass in arguments<br />so she always ends the winner<br />But she'll still be sweet and she'll still be flirty<br />Cos she loves the classics and the classics are dirty<br />So late at night she'd always have me in a stupor<br />As she paraphrases the raunchier moments from the works of Jilly Cooper</p><p style="color: rgb(65, 65, 65); font-family: verdana; font-size: 12px; line-height: 16px; ">See, some guys prefer asses<br />Some prefer tits<br />And I'm not saying that I don't like those bits<br />But what's more important<br />What supercedes<br />For me<br />Is a girl a with passion, wit and dreams<br />So I want a girl who reads</p> ]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2012/05/i-want-a-girl-who-reads</id>
    <link rel="alternate" href="http://texasexpat.net/2012/05/i-want-a-girl-who-reads" type="application/xhtml+xml" hreflang="en" />
    <published>2012-05-05T16:22:50Z</published>
    <updated>2012-05-05T16:26:39Z</updated>
  </entry>
  <entry>
    <title type="text">Convert for Alfred</title>
    <summary type="text">Download One of my least favourite things in life is converting between units of measurement, especially when cooking. All my mum&#8217;s recipes use imperial units, you see, yet my kitchen&#8217;s supply of measuring widgets is exclusively metric. Constantly launching a...</summary>
    <content type="html"><![CDATA[<div style="float:right;padding:4px;margin:4px 8px;background-color:#fff;border:1px solid #ddd"><a href="/media/Convert.zip"><img src="/media/alfred.png" alt="Alfred"><h2 style="text-align:center"><strong>Download</strong></h2></a></div>

<p>One of my least favourite things in life is converting between units of measurement, especially when cooking. All my mum&#8217;s recipes use imperial units, you see, yet my kitchen&#8217;s supply of measuring widgets is exclusively metric. Constantly launching a web browser and running the conversion through Google is just tiresome &#8212; but having just made the switch from Quicksilver to <a href="http://www.alfredapp.com">Alfred</a>, I decided to have a go at building an <a href="http://www.alfredapp.com/powerpack">Alfred Extension</a> to do quick unit conversions using Google&#8217;s calculator API.</p>

<p>To use it, <a href="/media/Convert.zip">download the extension</a> and install it via Alfred&#8217;s preferences window. Summon Alfred as usual, then make unit conversions with:</p>

<pre><code>convert AMOUNT UNIT to UNIT
</code></pre>

<p>It can handle anything Google knows about, so queries like</p>

<ul>
<li>&#8220;convert 500 grams to lbs&#8221;</li>
<li>&#8220;convert 375 fahrenheit to celsius&#8221;</li>
<li>&#8220;convert 2 cups to liters&#8221;</li>
</ul>

<p>will work just fine. For brevity&#8217;s sake, you can omit the &#8216;to&#8217;. Happy trans-cultural baking!</p>
]]>
</content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2011/10/convert-for-alfred</id>
    <link rel="alternate" href="http://texasexpat.net/2011/10/convert-for-alfred" type="application/xhtml+xml" hreflang="en" />
    <published>2011-10-09T10:34:31Z</published>
    <updated>2011-10-09T11:03:16Z</updated>
  </entry>
  <entry>
    <title type="text">You&apos;re acting under the impression that &quot;getters and setters&quot; are some kind of special concept.</title>
    <summary type="text">They&#8217;re not &#8212; they&#8217;re just fancy names for (usually) boring methods, propagated by Java/C# wanks who don&#8217;t believe autogenerated code could ever be a bad idea. Suppose we have a class (in C++): class Foo { private: int value; public:...</summary>
    <content type="html"><![CDATA[<p>They&#8217;re not &#8212; they&#8217;re just fancy names for (usually) boring methods, propagated by Java/C# wanks who don&#8217;t believe autogenerated code could ever be a bad idea. Suppose we have a class (in C++):</p>

<pre><code>class Foo {
private:
  int value;
public:
  void setValue(int v);
  int getValue();
};

void Foo::setValue(int v)
{
    this-&gt;value = v;
}

int Foo::getValue()
{
    return this-&gt;value;
}
</code></pre>

<p>Suppose we also have (somewhere else) an instance of <code>Foo</code>:</p>

<pre><code>Foo *aFoo = new Foo();
</code></pre>

<p>Trick question: what&#8217;s returned by <code>aFoo-&gt;getValue();</code> at this point? </p>

<p>Instances of <code>Foo</code> can&#8217;t do much, but they can hold integer values. Here&#8217;s how we set/access the <code>value</code> property of a <code>Foo</code> instance:</p>

<pre><code>aFoo-&gt;setValue(10);
std::cout &lt;&lt; aFoo-&gt;getValue() &lt;&lt; std::endl;
</code></pre>

<p>Instances of class <code>Foo</code> have two methods: <code>getValue()</code> and <code>setValue(int)</code>. The semantics of these methods happen to involve manipulating the (private) property <code>value</code>, but they&#8217;re fundamentally <em>no different than any other methods</em>. If we don&#8217;t care about encapsulating the <code>value</code> property (you&#8217;re familiar with this concept, yes?) we could just as easily design <code>Foo</code> as:</p>

<pre><code>class Foo {
public:
  int value;

  Foo(int v);
};
</code></pre>

<p>and set/access the <code>value</code> property with:</p>

<pre><code>aFoo-&gt;value = 10;
std::cout &lt;&lt; aFoo-&gt;value &lt;&lt; std::endl;
</code></pre>

<p><strong>This is perfectly valid, and often OK</strong>. So why have the so-called &#8216;getter and setter&#8217; methods at all? They let us impose constraints on the <code>value</code> property. For instance, we might want to ensure that instances of <code>Foo</code> can only hold even-numbered values, and that, while they may store negative values internally, we should always expose a positive value. We can&#8217;t have constraints like that using public properties; instead, we restrict access to the <code>value</code> property (making it private) and ensure that all access we do allow goes through controlled methods (<code>getValue()</code> and <code>setValue()</code>):</p>

<pre><code>void Foo::setValue(int v)
{
    // Ensure the new value is always an even number, setting
    // it to `v-1` if it is odd.
    this-&gt;value = v - (v%2);
}

int Foo::getValue()
{
    // Ensure that, regardless of the sign of `value` we always 
    // return a positive number (i.e. the absolute value of `value`).
    if (this-&gt;value &lt; 0) {
        return -this-&gt;value;
    } else {
        return this-&gt;value;
    }
}
</code></pre>
]]>
</content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2011/05/youre-acting-under-the-impression-that-getters-and-setters-are-some-kind-of-special-concept</id>
    <link rel="alternate" href="http://texasexpat.net/2011/05/youre-acting-under-the-impression-that-getters-and-setters-are-some-kind-of-special-concept" type="application/xhtml+xml" hreflang="en" />
    <published>2011-05-31T16:17:36Z</published>
    <updated>2011-05-31T16:19:53Z</updated>
  </entry>
  <entry>
    <title type="text">c_progressbar</title>
    <summary type="text">I do a lot of programming, in a lot of different languages. Each language evokes a particular sort of mindset when I&#8217;m using it, as well: Python and Objective-C are for games, Ruby and C are for research, PHP is...</summary>
    <content type="html"><![CDATA[<p>I do a lot of programming, in a lot of different languages. Each language evokes a particular sort of mindset when I&#8217;m using it, as well: Python and Objective-C are for games, Ruby and C are for research, PHP is for webdev. Within each mindset, though, there&#8217;s a fair amount of blending &#8212; and I can&#8217;t tell you how often I wish I was writing in Ruby when I find myself writing in C. </p>

<p>My usual workflow for research-oriented coding involves prototyping a tool or model in Ruby (fast to write, easy to understand), then porting the final, working version into C for use with real data (my models are usually trained on massive statistical corpora, something Ruby is, unfortunately, ill-equipped to handle). This is all well and good, but I always miss the usability that I can so easily sprinkle into the Ruby version. <a href="http://ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html"><code>OptionParser</code></a> is one such gem; <a href="http://0xcc.net/ruby-progressbar/"><code>Ruby/ProgressBar</code></a> is another.</p>

<p>In a moment of frustration, I re-implemented <code>Ruby/ProgressBar</code> in pure, unadulterated C99. If you&#8217;re interested in that sort of thing, you can grab a copy from my <a href="http://github.com/doches/progressbar">GitHub</a> repository:</p>

<pre><code>git clone git@github.com:doches/progressbar.git
</code></pre>

<p>For comparison, here is how you use a progressbar in Ruby:</p>

<pre><code>require 'rubygems'
require 'progressbar'

progress = ProgressBar.new("Loading",100)
(0..99).each do |i| 
  # Do some stuff
  progress.inc
end
progress.finish
</code></pre>

<p>&#8230;and in C:</p>

<pre><code>#include "progressbar.h"

progressbar *progress = progressbar_new("Loading",100);
for(int i=0;i&lt;100;i++) {
  // Do some stuff
  progressbar_inc(progress);
}
progressbar_finish(progress);
</code></pre>

<p>More examples, including custom formatting and indeterminate progress, are in <code>test/progressbar_demo.c</code>.</p>
]]>
</content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2010/08/c-progressbar</id>
    <link rel="alternate" href="http://texasexpat.net/2010/08/c-progressbar" type="application/xhtml+xml" hreflang="en" />
    <published>2010-08-30T12:40:25Z</published>
    <updated>2010-08-30T12:56:50Z</updated>
  </entry>
  <entry>
    <title type="text">CogSci 2010</title>
    <summary type="text">I just got back from CogSci 2010, to which I had successfully submitted a paper, &#8220;Meaning Representation in Natural Language Categorization.&#8221; Unfortunately, I wasn&#8217;t invited to present it as a talk &#8212; but on the upside, I was invited to...</summary>
    <content type="html"><![CDATA[<p>I just got back from <abbr title="The Annual Meeting of the Cognitive Science Society"><a href="http://www.cognitivesciencesociety.org/conference2010/">CogSci 2010</a></abbr>, to which I had successfully submitted a paper, &#8220;Meaning Representation in Natural Language Categorization.&#8221; Unfortunately, I wasn&#8217;t invited to present it as a talk &#8212; but on the upside, I <em>was</em> invited to present it as a <a href="http://texasexpat.net/media/cogsci_2010_poster.pdf">poster</a>. As a consequence, I may now write the following sentence, of which I am more proud than practically anything I have done in my life to date:</p>

<blockquote>
Fountain, T. & Lapata, M. (2010). Meaning Representation in Natural Language Categories. In S. Ohlsson & R. Catrambone (Eds.), <em>Proceedings of the 32nd Annual Conference of the Cognitive Science Society</em>. Austin, TX: Cognitive Science Society.
</blockquote>

<p>Squee.</p>

<p>The work I presented deals with whether corpus co-occurrence can be used as a stand-in for norming data, at least in the context of a categorization task; as part of that work I collected a rather large amount of data that I am now making <a href="http://bit.ly/categorization">publicly available</a>. The dataset extends the McRae et al feature norms by grouping the words in forty-one categories, and includes norming data, integrated into the standard McRae features, for each of the newly-added category labels.</p>
]]>
</content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2010/08/cogsci-2010</id>
    <link rel="alternate" href="http://texasexpat.net/2010/08/cogsci-2010" type="application/xhtml+xml" hreflang="en" />
    <published>2010-08-27T17:51:24Z</published>
    <updated>2010-08-27T18:05:26Z</updated>
  </entry>
  <entry>
    <title type="text">Levelheaded for iPhone</title>
    <summary type="text">For over a year now I&#8217;ve been wanting to start writing games for the iPhone and iPod Touch &#8212; in mid-February I was finally seized by the bug and sat down to figure it all out. The learning curve was...</summary>
    <content type="html"><![CDATA[<p>For over a year now I&#8217;ve been wanting to start writing games for the iPhone and iPod Touch &#8212; in mid-February I was finally seized by the bug and sat down to figure it all out. The learning curve was pretty huge, frankly &#8212; I remember realizing one evening that I was writing code in a language I didn&#8217;t know (Objective C) using an IDE I&#8217;d never used before (XCode) to work with an API I&#8217;d previously avoided like the plague (OpenGL). </p>

<p>Fun stuff.</p>

<p>On the upside, running your own code on the iPhone is <strong>really</strong> cool &#8212; I haven&#8217;t felt this much like I was &#8220;hacking&#8221; (in the classical sense of the term) in a long time. The upshot of it all is that I&#8217;ve just released my first game, <a href="http://levelheadedgame.com">Levelheaded</a>, for the iPhone. It&#8217;s a port of my old Global Game Jam project from last year, Jarhead, updated for the iPhone&#8217;s touch input and limited screen real estate. Now, onward with the marketing!</p>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2010/03/levelheaded-for-iphone</id>
    <link rel="alternate" href="http://texasexpat.net/2010/03/levelheaded-for-iphone" type="application/xhtml+xml" hreflang="en" />
    <published>2010-03-09T17:18:36Z</published>
    <updated>2010-08-27T16:19:04Z</updated>
  </entry>
  <entry>
    <title type="text">Latex Sugar (for Espresso)</title>
    <summary type="text"> As a follow-on to my ConfigParser sugar for the ever-awesome Espresso, I&#8217;ve written a workable sugar that turns Espresso into a full-featured LaTeX editor. Syntax highlighting, basic itemizers, templates for figures, tables, and common documents, plus code completion for...</summary>
    <content type="html"><![CDATA[ <p>As a follow-on to my ConfigParser sugar for the ever-awesome Espresso, I&#8217;ve written a workable sugar that turns Espresso into a full-featured LaTeX editor. Syntax highlighting, basic itemizers, templates for figures, tables, and common documents, plus code completion for a large number of commonly used LaTeX functions. </p>

<p>The code is hosted on <a href="http://github.com/doches/Latex.sugar" title="GitHub/doches">GitHub</a>; I&#8217;d appreciate a comment if you&#8217;re using the Sugar, just to help keep me motivated to work on the thing. Similarly, if you feel like contributing I&#8217;d <em>love</em> to accept patches or pull requests.</p>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2010/01/latex-sugar</id>
    <link rel="alternate" href="http://texasexpat.net/2010/01/latex-sugar" type="application/xhtml+xml" hreflang="en" />
    <published>2010-01-30T17:17:50Z</published>
    <updated>2010-08-27T16:18:23Z</updated>
  </entry>
  <entry>
    <title type="text">ConfigParser Sugar (for Espresso)</title>
    <summary type="text">I&#8217;ve recently fallen in love with MacRabbit&#8217;s lovely new text editor for OS X, Espresso. For one, it&#8217;s a fantastic editor &#8212; not quite as swiss-army-esque as the stalward TextMate, but close. Unlike TextMate, Espresso is downright gorgeous &#8212; and...</summary>
    <content type="html"><![CDATA[<p>I&#8217;ve recently fallen in love with <a href="http://macrabbit.com" title="MacRabbit">MacRabbit</a>&#8217;s lovely new text editor for OS X, <a href="http://macrabbit.com/espresso/" title="Espresso">Espresso</a>. For one, it&#8217;s a fantastic editor &#8212; not quite as swiss-army-esque as the stalward TextMate, but close. Unlike TextMate, Espresso is downright gorgeous &#8212; and gorgeous in a way that doesn&#8217;t interfere with actually using the thing. A great tool, beautifully designed, and with a deliciously extensible core to boot. </p>

<p>Naturally, this last bit is what <em>really</em> got me hooked. Espresso plugins are called &#8216;Sugars&#8217;, and can provide truly ludicrous extensions to the editor. Want to add a syntax highlighter for a new language? Specialized code folding for a certain coding idiom? Autocomplete and suggestion tools for a library? You can do it, and (almost) entirely in XML. Beautiful.</p>

<p>The first thing I did after downloading the trial version was hunt around for relevant Sugars, which I found to be somewhat sparse. Espresso is, unfortunately, quite a young editor. For instance, I couldn&#8217;t find a Sugar for working with configuration files produced/read by Python&#8217;s <a href="http://docs.python.org/library/configparser.html">ConfigParser</a> module &#8212; something I desperately need for a super-secret project I&#8217;m working on. Several hours of reading, writing, and frantic github searching later, I present:</p>

<h2>ConfigParser.sugar</h2>

<p>An Espresso Sugar providing syntax highlighting for configuration files layed out according to <a href="http://www.faqs.org/rfcs/rfc822.html" title="ConfigParser, .conf, and .ini">RFC 822</a>. Among other things, 
it understands Windows .ini files and config files produced by Python&#8217;s ConfigParser module. </p>

<h1>Installation</h1>

<p>Clone the Github project somewhere, with the following:</p>

<pre><code>git clone git://github.com/doches/ConfigParser.sugar.git ./ConfigParser.sugar
</code></pre>

<p>And then link it to your syntaxes directory:</p>

<pre><code>ln -s "$(pwd)/ConfigParser.sugar" "/Users/$(whoami)/Library/Application Support/Espresso/Sugars/"
</code></pre>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/11/configparser-sugar</id>
    <link rel="alternate" href="http://texasexpat.net/2009/11/configparser-sugar" type="application/xhtml+xml" hreflang="en" />
    <published>2009-11-30T17:15:28Z</published>
    <updated>2010-08-27T16:16:30Z</updated>
  </entry>
  <entry>
    <title type="text">The Flixel Experience</title>
    <summary type="text">Learning Actionscript3 and working with Flixel these last few weekends has been an absolute joy. Two weeks ago I sat down, knowing absolutely nothing about Actionscript coding, and banged out Invaders &#8212; a bog-simple Space Invaders clone with a minimalist...</summary>
    <content type="html"><![CDATA[<p>Learning Actionscript3 and working with Flixel these last few weekends has been an absolute joy. Two weeks ago I sat down, knowing <em>absolutely nothing</em> about Actionscript coding, and banged out <a href="http://www.kongregate.com/games/Doches/invaders">Invaders</a> &#8212; a bog-simple Space Invaders clone with a minimalist streak and a misguided theme of non-violence. It was, to say the least, a terrible game. But I wrote it in something like eight hours &#8212; eight hours at the start of which I didn&#8217;t even know the language.</p>

<p>Actionscript 3 is fantastic. Flixel is beautiful.</p>

<p>Last weekend I thought I&#8217;d try it again, and got myself immersed in building another simple game, a little avoidance game where you navigate a ship through a cluttered trench. Owing to (unfortunate) science-related obligations, I had to put it away for the week &#8212; but a few hours of polishing menus and hacking audio this afternoon brought it up to something like a completed state. It&#8217;s nothing special, but you can play <a href="http://www.kongregate.com/games/Doches/trench-run">Trench Run</a> on Kongregate if you&#8217;re so inclined. There are certainly worse ways to spend your next 97 seconds.</p>

<p>The Flixel community, while small, is growing by leaps and bounds, and is already more vibrant than other development communities I&#8217;ve been involved with. I made heavy use of <a href="http://timsworld.nfshost.com/">Timothy Hely</a>&#8217;s ludicrously detailed <a href="http://bit.ly/19B5MQ">Flixel tutorial</a> in creating both games, and had to poke around IRC for a bit to get some questions answered. The library itself is open source as well, so a little bit of hacking is all that ever stood between me and an (albeit) ugly solution to whatever problems I might encounter. A new version of Flixel is supposed to drop any day now, and I can&#8217;t wait!</p>

<p>One thing I would dearly love to see though: an official Flixel repository on Github or the like. There are enough people who&#8217;d love to contribute back to the library (myself included, I&#8217;d like to think) that this could turn into something huge rather quickly. Go Flixel! Go!</p> 

<em><strong>Ed.</strong> -- Ask, and ye shall receive: <a href="http://wiki.github.com/AdamAtomic/flixel/">Flixel on GitHub</a>.</em>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/10/the-flixel-experience</id>
    <link rel="alternate" href="http://texasexpat.net/2009/10/the-flixel-experience" type="application/xhtml+xml" hreflang="en" />
    <published>2009-10-03T16:12:44Z</published>
    <updated>2010-08-27T16:15:08Z</updated>
  </entry>
  <entry>
    <title type="text">Clusterfuck: A Subversive Job-Distribution Tool</title>
    <summary type="text"> I should start this off by making something clear: I am an extremely lazy programmer. I long ago adopted the Ruby mantra that programmer time is more precious than machine time, and tend to write most of my code...</summary>
    <content type="html"><![CDATA[ <p>I should start this off by making something clear: I am an extremely lazy programmer. I long ago adopted the Ruby mantra that programmer time is more precious than machine time, and tend to write most of my code in a way that is clear and comprehensible, with little regard for speed of execution.</p>

<p>When working with massive NLP datasets, this is perhaps not an entirely good idea.</p>

<p>Lately my experiments have begun to take up more and more <em>days</em> to complete. Part of this, of course, is Ruby&#8217;s fault &#8212; the language, or at least the current interpreter, is far from fast &#8212; and part of the blame lies with me, for writing fundamentally lazy code. I have, however, come up with something of an interesting fix for the problem by parallelizing almost all of my big experiments. Easily done, really &#8212; but I then realized that I don&#8217;t have access to any of the department&#8217;s clusters. But I <em>do</em> have a login that works on all of the public-access machines in the (huge) undergraduate labs.</p>

<p><em>Bingo</em>.</p>

<p>Enter <a href="http://github.com/doches/clusterfuck" title="clusterfuck on GitHub">clusterfuck</a>, a subversive job-distribution tool I&#8217;ve been working on to solve this niggly little dilemma. It&#8217;s basically a tool for automating the process of ssh-ing into multiple machines and starting jobs on each of them, writ large. It&#8217;s installable via GitHub (I&#8217;ll push a gem out to <a href="http://gemcutter.org" title="Gemcutter">Gemcutter</a> when I have a nice, polished version ready) and configured rake-style via clusterfiles:</p>

<pre><code>Clusterfuck::Task.new do |task|
    task.hosts = %w{clark asimov}
    task.jobs = ["hostname","hostname","hostname","hostname"]
    task.temp = "fragments"
    task.username = "SSHUSERNAME"
    task.password = "SSHPASSWORD"
    #task.debug = true
end
</code></pre>

<p>You kick off a batch of cluster jobs via the command <code>clusterfuck</code> (which takes a clusterfile as an argument, or defaults to <code>clusterfile</code> if it exists). This example file will run the command <code>hostname</code> four times on two machines (two each, unless one goes down or is slow to respond) and save the output of each command into a directory <code>fragments</code>. A bit of a toy example to be sure, but replacing the uninteresting <code>hostname</code> job with something more time-consuming and extend the list of hosts to, say, several dozen idle machines can get large, decomposable jobs completed in a fraction of the time necessary to run &#8216;em on a single machine. </p>

<p>Why &#8220;clusterfuck&#8221;? The early versions of this tool were, to say the least, somewhat unreliable, and had a frustrating tendency to leave cpu-intensive processes floating around. Needless to say, the network admins were <em>not happy</em> about this state of affairs, and the entire thing turned into a giant, well, you get the idea. </p>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/09/clusterfuck</id>
    <link rel="alternate" href="http://texasexpat.net/2009/09/clusterfuck" type="application/xhtml+xml" hreflang="en" />
    <published>2009-09-20T15:02:50Z</published>
    <updated>2010-08-27T15:03:23Z</updated>
  </entry>
  <entry>
    <title type="text">Getting Started With Flixel on OS X</title>
    <summary type="text">The other day I stumbled across Flixel, a brilliant collection of ActionScript3 classes for building Flash games. Flixel is a pure ActionScript library, meaning it&#8217;s intended for use without the Flash IDE. It&#8217;s mind-bogglingly new, but has a nascent community...</summary>
    <content type="html"><![CDATA[<p>The other day I stumbled across Flixel, a brilliant collection of ActionScript3 classes for building Flash games. Flixel is a pure ActionScript library, meaning it&#8217;s intended for use <strong>without</strong> the Flash IDE. It&#8217;s mind-bogglingly new, but has a nascent community that&#8217;s growing larger by the day. Most tutorials and things I&#8217;ve found for Flixel tend to be focused on Windows development though, using either FlashDevelop or FlexBuilder. I couldn&#8217;t find a guide to getting started with Flixel development on OS X, so I thought I&#8217;d put on my tutoring hat and write one myself &#8212; this post (and posts to follow) should get you started developing Flixel-based games on OS X, using nothing but the free Flex SDK and a text editor.</p>

<h4><strong>Install Flex SDK:</strong></h4>

<ul>
<li>Download the Flex SDK from <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk">http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk</a></li>
<li>Unzip the file we just downloaded (flex_sdk_3.4.zip) and copy the resulting folder (flex_sdk_3.4) somewhere out of mind. I stuck mine in <code>~/Library</code> (<User Directory>/Library).</li>
<li>Now we need to tell terminal where to find the Flex tools. Open up Terminal (Applications/Utilities/Terminal) and type <code>open ~/.profile</code>. This opens up your bash profile in TextEdit; add this line to the end of the file:
<code>export PATH=~/Library/flex_sdl_3.4/bin:PATH</code> (if you put the flex_sdk_3.4 folder somewhere other than ~/Library, use that path here instead).
Save the file and quit TextEdit</li>
<li>Close and re-open Terminal (or type <code>source ~/.profile</code>, either works), and make sure everything works by typing <code>mxmlc -help</code>. You should get a screenful of text, starting with the line &#8220;Adobe Flex Compiler (mxmlc).&#8221; Success!</li>
</ul>

<h4><strong>Flixel</strong></h4>

<ul>
<li>Download Flixel from <a href="http://flixel.org/flixel_v1.25.zip">http://flixel.org/flixel_v1.25.zip</a></li>
<li>Unzip flixel_v1.25.zip</li>
<li>In your Terminal window, change into the newly-created flixel folder. If you downloaded and unzipped Flixel to your Downloads folder, you can do this by typing <code>cd ~/Downloads/flixel_v1.25/</code>.</li>
<li>Compile the Mode example with the Flex compiler by typing <code>mxmlc Mode.as</code>. You should see something like:</li>
</ul>

<pre>    Loading configuration file /Users/doches/Library/flex_sdk_3.4/frameworks/flex-config.xml
    /Users/<YourUserName>/Downloads/flixel_v1.25/Mode.swf (380608 bytes)
</pre>

<ul>
<li>Alright! If you look in the flixel_v1.25 folder you should now see Mode.swf &#8212; double click on this to open it up in the Flash Player (or type <code>open Mode.swf</code> in Terminal).</li>
</ul>

<p>Ok &#8212; that&#8217;s everything we need to build Flash games using Flixel. I'd write a bit more about actually using the library, but that's definitely been taken care of by other, more talented, folks than I...</p> ]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/09/getting-started-with-flixel</id>
    <link rel="alternate" href="http://texasexpat.net/2009/09/getting-started-with-flixel" type="application/xhtml+xml" hreflang="en" />
    <published>2009-09-18T16:09:17Z</published>
    <updated>2010-08-27T16:11:08Z</updated>
  </entry>
  <entry>
    <title type="text">Holy Crap! Wikirunner featured on IndieGames.com!</title>
    <summary type="text"> I am absolutely abuzz with joy. My entry for Mini-LD #12, Wikirunner, is on the front page of IndieGames.com! From the post: Wikirunner is an a chase game inspired by Jeremy Bushnell&#8217;s Wikipedian Tag. Created for Mini Ludum Dare...</summary>
    <content type="html"><![CDATA[ <p>I am absolutely abuzz with joy. My entry for Mini-LD #12, <a href="http://www.expatgames.net/wikirunner.html">Wikirunner</a>, is on the front page of <a href="http://www.indiegames.com/blog/2009/09/freeware_game_pick_wikirunner.html">IndieGames.com!</a> </p>

<p>From the post:</p>

<blockquote>
  <p>Wikirunner is an a chase game inspired by Jeremy Bushnell&#8217;s Wikipedian Tag. Created for Mini Ludum Dare #12 (the theme was &#8216;Wikipedia&#8217;), two players are given a random Wikipedia page each, and then &#8216;the chaser&#8217; must try to navigate his or her way to the same page as their opponent, while &#8216;the runner&#8217; must try to stay off the same page as the chaser for as long as possible.</p>
  
  <p>Both players can only move to another Wiki page if it has some relevance to the page they are currently on - so for example, you could move from &#8216;London Olympics&#8217; to &#8216;2012&#8217;, but not from &#8216;Russia&#8217; to &#8216;kangaroo&#8217;. The chaser also gets two goes for every one of the runner&#8217;s goes, to give him a fair chance. The game can be played in a 2-player hotseat style, or 1 vs AI, or AI vs AI (if you want to watch how the program thinks).</p>
  
  <p>By far the most fun mode is an AI chaser vs a player runner. It&#8217;s interesting to see the choices the AI makes - at one point I changed to &#8216;Canada&#8217;, so the AI jumped over to a page on &#8216;Dumbledore&#8217;s Army&#8217;. Escaping to the Wiki page for &#8216;Iraq&#8217;, the program then tried to follow me by bringing up the page for &#8216;The Manchester Evening News&#8217;, which just so happens to be my local newspaper strangely enough.</p>
</blockquote>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/09/indiegames</id>
    <link rel="alternate" href="http://texasexpat.net/2009/09/indiegames" type="application/xhtml+xml" hreflang="en" />
    <published>2009-09-15T16:11:16Z</published>
    <updated>2010-08-27T16:12:42Z</updated>
  </entry>
  <entry>
    <title type="text">Timelapses, etc.</title>
    <summary type="text"> One of the things folks like to do in Ludum Dare is record timelapse videos of the compo. Usually these are screenshots over the 48 hour period, one every couple of seconds; other times they&#8217;re webcam shots of the...</summary>
    <content type="html"><![CDATA[ <p>One of the things folks like to do in <a href="http://www.ludumdare.com/compo">Ludum Dare</a> is record timelapse videos of the compo. Usually these are screenshots over the 48 hour period, one every couple of seconds; other times they&#8217;re webcam shots of the participants over the same timeframe, again every couple of seconds. I&#8217;ve never successfully put together a timelapse video, partly because I never got the tools sorted out beforehand and partly because I always manage to screw up the recording somehow. </p>

<p>Not this time, though.</p>

<p>I&#8217;ve got a pretty good set-up going: screenshots every two seconds under both windows and linux, autostarting on login for both (No forgetting!) and saving to an empty harddrive formatted to fat32 so both OSes can access it. Images are tagged with the time in a consistent format, too, so I can make sure they&#8217;re all in the right order after the dust settles and I get around to encoding the thing. In case you&#8217;re interested in repeating this feat for yourself, let me describe the software and hardware setup: One desktop, dual booting Linux and Vista + one Macbook, running OS X and equipped with built-in iSight camera. On Linux (Ubuntu, 64bit) I&#8217;m using <code>scrot</code> with a <a href="http://www.ludumdare.com/wiki/ld15:linuxtimelapsemakefile">custom makefile</a>, dumping JPEGs of my screen every 2 seconds. On Windows I&#8217;m using Keeyai&#8217;s excellent <a href="http://keeyai.com/projects-and-releases/chronolapse/">Chronolapse</a>, a tool that I&#8217;m pretty sure came out of an earlier LD. I&#8217;m also using Chronolapse to merge everything together in the end, because it works with screenshots saved as a series of images and can do picture-in-picture compositing. For OS X I&#8217;m using <a href="http://www.klieme.com/EyeSight.html">EyeSight</a> to take pictures with the iSight camera every 2 seconds. The laptop is sitting off to the side when I&#8217;m not using it, so that image will either show me working on the desktop, on the laptop, or not working at all (e.g. sleeping). </p>

<p>Not bad, eh? And all free software to boot. </p>]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/08/timelapses</id>
    <link rel="alternate" href="http://texasexpat.net/2009/08/timelapses" type="application/xhtml+xml" hreflang="en" />
    <published>2009-08-28T16:08:00Z</published>
    <updated>2010-08-27T16:09:10Z</updated>
  </entry>
  <entry>
    <title type="text">Ludum Dare #15</title>
    <summary type="text">Just in time, it&#8217;s Ludum Dare #15 &#8212; yet another weekend-long extravaganza featuring little food, less sleep, and a whole lot of rapid game dev. For once I&#8217;ve actually assembled something beforehand: a motley collection of initialization scripts, configuration files,...</summary>
    <content type="html"><![CDATA[<p>Just in time, it&#8217;s <a href="http://www.ludumdare.com/compo">Ludum Dare #15</a> &#8212; yet another weekend-long extravaganza featuring little food, less sleep, and a whole lot of rapid game dev. For once I&#8217;ve actually assembled something beforehand: a motley collection of initialization scripts, configuration files, and subsystems I jokingly call an engine. It&#8217;s available for review over at <a href="http://github.com/doches/Bebop/">GitHub</a>, if you&#8217;re into that sort of thing or if you&#8217;re coming from Ludum Dare itself and want to keep me honest.</p>

<p>This ought to be a good compo, and for a slew of reasons. The last compo, back in may, netted over a hundred submissions &#8212; breaking records we didn&#8217;t even know we were keeping. As for me, I&#8217;ve been all fired-up about this sort of indie development lately, partly thanks to <a href="http://twitter.com/mvromer">mvromer</a>&#8217;s influence, and partly due to attending the splendiferous <a href="http://www.edinburghinteractivefestival.com/">Edinburgh Interactive Festival</a>. Hopefully I&#8217;ll get enough work done during the week, meet all my goals and whatnot, that I can participate without inducing too much research-guilt. I guess we&#8217;ll see.</p> ]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/08/ludum-dare-15</id>
    <link rel="alternate" href="http://texasexpat.net/2009/08/ludum-dare-15" type="application/xhtml+xml" hreflang="en" />
    <published>2009-08-23T16:06:17Z</published>
    <updated>2010-08-27T16:07:50Z</updated>
  </entry>
  <entry>
    <title type="text">Best. Comment. Ever.</title>
    <summary type="text">So this morning I threw a new load of data collection experiments up on Mechanical Turk. Among other things, I'm giving people long lists of pairs of words (i.e. "apple/fruit") and asking them to rank how typical the first word...</summary>
    <content type="html"><![CDATA[So this morning I threw a new load of <a href="https://www.mturk.com/mturk/searchbar?requesterId=A3P9VORNJ4R1CJ&amp;selectedSearchType=hitgroups">data collection experiments up on Mechanical Turk</a>. Among other things, I'm giving people long lists of pairs of words (i.e. "apple/fruit") and asking them to rank how typical the first word is among members of the second. In my instructions I give an example, using religion:<br /><br /><blockquote>
For example, you might rate 'Christianity/Religion' as a 7, because Christianity is a very typical religion, 'Humanism/Religion' as a 3, because Humanism is a somewhat unlikely religion, and 'Pastafarianism/Religion' as a 1, because Pastafarianism isn't like other religions at all.
</blockquote>

This afternoon I recieved the following angry email:<br /><br /><blockquote>
<pre>Greetings from Amazon Mechanical Turk,

An Amazon Mechanical Turk user is contacting you from the Amazon
Mechanical Turk website.  Please review the message below and respond to
the message as you see fit.

Sincerely,
Amazon Mechanical Turk
http://requester.mturk.com
1200 12TH AVE South, SUITE 1200
SEATTLE, WA 98144-2734 USA
Message from Susan XXXXXX (XXXXXXXXXXXX@msn.com)
---------------------------------
Customer ID: A3VXXXXXXXXXXX
Hello,
 I cannot in good conscience work on your hits, although I am one of the higher educated 
monkeys around here with a high acceptance %.

 Who are you to decide Pastafarianism rates a 1 on the religion scale? That is bordering 
on blasphemy, and showing extreme bias against His Noodly Appendage. May he forgive 
you. Ramen.
</pre>
</blockquote>

Cheer.]]></content>
    <category term="/" scheme="http://texasexpat.net/" label="" />
    <id>http://texasexpat.net/2009/05/best-comment-ever</id>
    <link rel="alternate" href="http://texasexpat.net/2009/05/best-comment-ever" type="application/xhtml+xml" hreflang="en" />
    <published>2009-05-29T15:59:52Z</published>
    <updated>2010-08-27T16:01:28Z</updated>
  </entry>
  
</feed>
