<?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"
	>

<channel>
	<title>Richard Crowley’s blog</title>
	<atom:link href="http://rcrowley.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://rcrowley.org</link>
	<description></description>
	<pubDate>Mon, 05 May 2008 02:02:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Teaching math</title>
		<link>http://rcrowley.org/2008/05/04/teaching-math/</link>
		<comments>http://rcrowley.org/2008/05/04/teaching-math/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:02:21 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[education]]></category>

		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://rcrowley.org/?p=74</guid>
		<description><![CDATA[A Mathematician&#8217;s Lament, by Paul Lockhart (via DHall)
I&#8217;m writing this response as I read through this fascinating paper on math in schools.  I have for many years held the belief that (at the high school level at least) anyone can make straight A&#8217;s, even if they&#8217;re doing everything in their power to challenge themselves. [...]]]></description>
			<content:encoded><![CDATA[<p><big><a href="http://www.maa.org/devlin/LockhartsLament.pdf">A Mathematician&#8217;s Lament, by Paul Lockhart</a></big> (via <a href="http://tumblelog.cowsandmilk.net/post/33589261">DHall</a>)</p>
<p>I&#8217;m writing this response as I read through this fascinating paper on math in schools.  I have for many years held the belief that (at the high school level at least) anyone can make straight A&#8217;s, even if they&#8217;re doing everything in their power to challenge themselves.  This paper, if anything, strengthens my belief.</p>
<p>When I entered college, I thought I was pretty good at math.  Then I met quite a few people that were <em>good</em> at math, so I stopped saying as much.  I still very much believe it, though.  A more surprising lesson was that I actually <em>hate</em> math classes.  What I enjoyed were classes that relied on constructing and evaluating hypotheses and algorithms based on their mathematical merits.</p>
<p>Lockhart and the many others who&#8217;ve called BS on the way math is taught to students today have a point: math is inherently creative.  Beyond that, though, they get a little overzealous.  Painting and poetry (my go-to counter-example for the alliteration and audible distinction from &#8220;math&#8221;) are commentary about the world and its people, inspired by the painters and poets coming before.  Math is an observation about the world and (less frequently) its people, based on the work of mathematicians coming before.  Inspiration does not equal groundwork.</p>
<p>&#8220;[Math] has relevance in the same way that any art does: that of being a meaningful human experience.&#8221;  This discounts the most beautiful thing about math: it elegantly describes the world in which humans experience.  Economics is a fantastic framework for teaching this very thing.  Economics is about building up simplified mathematical models of repeated observations about our world.  Teaching math through economics will work because the types of observations economics sets out to describe are far more tangible than the concepts hand-waved away by formulas memorized in math classes.</p>
<p>&#8220;&#8216;What do they want me to do?  Oh, just plug it in?  OK.&#8217; [said the fictional average student.]&#8221;  This is an all too common conversation, so much that teachers frequently reached for the canned reply, &#8220;plug and chug!&#8221;  I had the distinct torture of taking a physics class in high school where the teacher instructed us to &#8220;just take the cosine&#8221; to find the length of one side of a triangle that didn&#8217;t contain a right angle.  My classmates were happy to follow along.  I felt the need to disagree.  Teachers are not infallible and that must be accepted before the intellectual dialogue Lockhart describes can begin.</p>
<p>The lack of infallibility opens the door for other liberties, too.  Paul Graham wrote that schools are primarily <a href="http://www.paulgraham.com/nerds.html">holding pens</a>: &#8220;In fact their primary purpose is to keep kids locked up in one place for a big chunk of the day so adults can get things done.&#8221;  Without teachers&#8217; infallibility, the signal to noise ratio in the classroom would approach zero.  Operating within the constraints of order first, learning second, it isn&#8217;t at all surprising that school is about following protocol.</p>
<p>Joy of joys, there&#8217;s a whole section on High School Geometry (capitalism his).  Like the author, I found the material presented in High School Geometry fascinating and the scaffolding erected around it suffocating.  I do lots of math in my head and made absolutely no accommodations for my teacher that insisted I &#8220;show my work.&#8221;  I showed my thoughts, not my arithmetic.  But due to the infallibility discussed above, I could not tell her where to shove it.</p>
<p>Math is not an art form the same as painting or poetry.  But it is creative.  It is an experience.  And to teach it, it must be a dialogue.  We need better teachers.  To get there we need to make teaching noble again.  More realistically, we need to make teaching a financially sane decision.  Capitalism is cruel, I know, but it&#8217;ll get a whole lot worse if students learn only process and not how to progress.</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/05/04/teaching-math/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MacBook Pro updates imminent (speculation)</title>
		<link>http://rcrowley.org/2008/04/28/macbook-pro-updates-imminent-speculation/</link>
		<comments>http://rcrowley.org/2008/04/28/macbook-pro-updates-imminent-speculation/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 03:41:45 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[macbookpro]]></category>

		<guid isPermaLink="false">http://rcrowley.org/?p=73</guid>
		<description><![CDATA[I purchased a new MacBook Pro last week.  My 3 1/2 year old PowerBook has served admirably but it simply can&#8217;t keep up with me anymore.  The faint and occasional clicking from the hard disk was the final push over the Intel edge for me and I couldn&#8217;t be happier.  I decided to go with [...]]]></description>
			<content:encoded><![CDATA[<p>I purchased a new MacBook Pro last week.  My 3 1/2 year old PowerBook has served admirably but it simply can&#8217;t keep up with me anymore.  The faint and occasional clicking from the hard disk was the final push over the Intel edge for me and I couldn&#8217;t be happier.  I decided to go with the 2.4 GHz model because $750 is a lot to pay for 200 MHz.  I haven&#8217;t upgraded the memory to all 4 GB yet but that&#8217;ll come as soon as I spend some serious time with Aperture and Photoshop (CS3, finally).</p>
<p>I present this post as a warning to anyone holding off to see what Apple does next.  Because I&#8217;ve made this purchase, I&#8217;m relatively certain that the WWDC will bring glorious new MacBook Pros, probably even radically redone AirBook-style.  Maybe I&#8217;ll pawn this one off on my parents when the new ones come out (almost, but not quite not kidding).</p>
<p>A parting thought: holy crap the LED-backlit displays are bright.</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/04/28/macbook-pro-updates-imminent-speculation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starting at OpenDNS today</title>
		<link>http://rcrowley.org/2008/04/08/starting-at-opendns-today/</link>
		<comments>http://rcrowley.org/2008/04/08/starting-at-opendns-today/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 15:02:45 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[flickr]]></category>

		<category><![CDATA[opendns]]></category>

		<guid isPermaLink="false">http://rcrowley.org/?p=72</guid>
		<description><![CDATA[There are so many things to love about Flickr and especially about working at Flickr that I initially thought myself crazy for even considering leaving.  But with time came sanity and I saw the pros for leaving start to outweigh the cons.
The folks at Flickr are without a doubt the most talented group I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>There are so many things to love about Flickr and especially about working at Flickr that I initially thought myself crazy for even considering leaving.  But with time came sanity and I saw the pros for leaving start to outweigh the cons.</p>
<p>The folks at Flickr are without a doubt the most talented group I&#8217;ve ever had the honor of working with and I will miss them all.  Flickr as a whole is a dream, a place with passionate staff matching passionate members and no shortage of new ground to break into, but my piece of this puzzle was not exactly right for me.  I developed the new Flickr Uploadr desktop client as an open-source, extendable app for getting your photos and metadata onto Flickr.  The project had everything I wanted — new technology, technical difficulty, performance concerns, design quirks and the goal of open-source extendability.  But for all of that it had a fatal flaw — I am not a desktop software developer.</p>
<p>Thinking more forwardly, &#8220;I am not a desktop software developer&#8221; started to say what I really meant: &#8220;I do not want to be a desktop software developer.&#8221;  Selfish personal preference.</p>
<p>This job at OpenDNS has all the ingredients of a good time in my book — C++, maybe some map/reduce, I/O bottlenecks, oh-my-god-databases-are-slow and a whole lot of networking (the TCP/IP kind).  The people there are awesome just like Flickr&#8217;s and I have no doubt I&#8217;ll become just as attached to them.</p>
<p>(Housekeeping: it looks like the XULRunner saga on rcrowley.org has come to an end for the time being.  I almost guarantee I&#8217;ll be back to dabbling with it sometime, though, since it&#8217;d be a shame for all that practice to go to waste.  Don&#8217;t count on Windows XPCOM, though.)</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/04/08/starting-at-opendns-today/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PownceFS</title>
		<link>http://rcrowley.org/2008/03/22/powncefs/</link>
		<comments>http://rcrowley.org/2008/03/22/powncefs/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 19:51:28 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[fuse]]></category>

		<category><![CDATA[pownce]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/03/22/powncefs/</guid>
		<description><![CDATA[The magical code push finally happened!  Time to send PownceFS into the Internet.  PownceFS is a Fuse filesystem that mounts your friends&#8217; files from Pownce as a local filesystem.  Given a mountpoint, it fakes a directory for each of your friends and puts all the files they&#8217;ve uploaded inside.  Files are [...]]]></description>
			<content:encoded><![CDATA[<p>The magical code push finally happened!  Time to send PownceFS into the Internet.  PownceFS is a <a href="http://fuse.sourceforge.net/">Fuse filesystem</a> that mounts your friends&#8217; files from <a href="http://pownce.com/">Pownce</a> as a local filesystem.  Given a mountpoint, it fakes a directory for each of your friends and puts all the files they&#8217;ve uploaded inside.  Files are cached locally for a while so you can repeatedly access things without spending your life waiting on yet another API call.</p>
<h2>I can <code>ls -l</code> Mike Malone now!</h2>
<pre>rcrowley@banzai:~/powncefs$ ./powncefs.py mnt
rcrowley@banzai:~/powncefs$ ls -l mnt/
total 0
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 ajvchuk
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 andreiz
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 Andrew
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 chaddickerson
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 cowsandmilk
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 eston
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 evilcindy
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 flawedartist
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 halletecco
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 iamcal
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 ianloic
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 karaemurphy
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 katherinerose1224
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 katiejane
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 laughingsquid
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 leahculver
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 mmalone
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 philfreo
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 phil_halley
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 rcrowley
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 tychay
dr-xr-xr-x 2 rcrowley users 0 1969-12-31 16:00 waferbaby
rcrowley@banzai:~/powncefs$ ls -l mnt/mmalone/
total 41429
-r--r--r-- 1 rcrowley users    59381 1969-12-31 16:00 loveletter.jpg
-r--r--r-- 1 rcrowley users   291326 1969-12-31 16:00 mule.png
-r--r--r-- 1 rcrowley users     3830 1969-12-31 16:00 powncer.zip
-r--r--r-- 1 rcrowley users    75202 1969-12-31 16:00 sxsw_badge.jpg
-r--r--r-- 1 rcrowley users 41992791 1969-12-31 16:00 TWiT0134H.mp3
rcrowley@banzai:~/powncefs$ fusermount -u mnt
rcrowley@banzai:~/powncefs$</pre>
<h2>How can I get some, too?</h2>
<p>On Linux it&#8217;s simply a matter of installing Fuse, python-fuse and the Python OAuth library.</p>
<pre>$ sudo apt-get install python-fuse
$ cd /usr/lib/python2.5/site-packages/
$ sudo svn co http://oauth.googlecode.com/svn/code/python/oauth</pre>
<p>On a Mac I think it&#8217;s pretty easy but my Python&#8217;s wonky.  Methinks the dependencies work themselves out — can someone verify?</p>
<pre>$ sudo port install fuse-bindings-python
$ cd &lt;wherever the hell Python is&gt;
$ sudo svn co http://oauth.googlecode.com/svn/code/python/oauth</pre>
<p><big><a href="http://rcrowley.org/work/powncefs-0.1.tar.bz2">powncefs-0.1.tar.bz2</a></big> or <a href="http://svn.rcrowley.org/svn/powncefs/">http://svn.rcrowley.org/svn/powncefs/</a></p>
<h2>Nerd out with me</h2>
<p>The &#8220;architecture&#8221; (if you can really call something with 2 files an architecture) goes something like this: when you run the script a <code>PownceFS</code> object is created.  The first thing it does is authenticate with Pownce and pull down your friends list to create it&#8217;s directory structure.  Whenever necessary it makes an additional API call to Pownce to fetch the list of files for a particular user (say, if you <code>ls</code> their directory).  API calls and files are cached for 45 minutes (safely under the one hour TTL of the S3 URLs returned by the API).</p>
<p>The root of the filesystem is a <code>PownceFS.Base</code> object that contains a dictionary of usernames to <code>PownceFS.User</code> objects.  Each <code>PownceFS.User</code> contains a dictionary of filenames to <code>PownceFS.File</code> objects (look, Ma, inheritance!).</p>
<p>The main <code>PownceFS</code> object implements system call equivalents like <code>getattr</code> and <code>readdir</code> but defers the thinking to the tree of <code>PownceFS.Base</code> and friends.  Each of those objects has a <code>getattr</code> function handling all of the filesystem bookkeeping, <code>get</code> and <code>put</code> methods for manipulating children and a <code>fetch</code> method for performing any API calls that need to happen.  <code>PownceFS.File</code>s have an additional <code>read</code> method that reads the locally-cached copy of its file.</p>
<p>The point of that long-winded explanation is that the &#8220;architecture&#8221; is useful for absolutely any web service that might be a useful filesystem.  The api.py file handles all of the OAuth-y stuff and leaves powncefs.py fairly generic.  Hack!</p>
<p>Again, <a href="http://svn.rcrowley.org/svn/powncefs/">http://svn.rcrowley.org/svn/powncefs/</a>.</p>
<h2>Future plans</h2>
<p>The most obvious enhancement is to allow file uploads, which I&#8217;m planning on adding soon.  Otherwise I need to find a few minutes to loop the API calls to return more than 100 files for those Power Users.  Details, details.</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/03/22/powncefs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Oh yeah, that&#8217;s right, I went to SXSW</title>
		<link>http://rcrowley.org/2008/03/19/oh-yeah-thats-right-i-went-to-sxsw/</link>
		<comments>http://rcrowley.org/2008/03/19/oh-yeah-thats-right-i-went-to-sxsw/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 05:30:27 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[conference]]></category>

		<category><![CDATA[sxsw]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/03/19/oh-yeah-thats-right-i-went-to-sxsw/</guid>
		<description><![CDATA[I wrote this about a week ago and then forgot about it.  Best course of action is to just post it.
The hangover has ended, time for some reflection.
There were so many people this year that it expanded into new parts of the Austin Convention CenterCave System I didn&#8217;t know existed.  The increased attendance [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this about a week ago and then forgot about it.  Best course of action is to just post it.</em></p>
<p>The hangover has ended, time for some reflection.</p>
<p>There were so many people this year that it expanded into new parts of the Austin <span style="text-decoration: line-through">Convention Center</span>Cave System I didn&#8217;t know existed.  The increased attendance was most noticeable at the parties where I frequently had to request favors to gain entry.  Thanks, pals.</p>
<p>The panel schedule this year was, to say the least, weird.  There were days on end that contained nothing of interest to me, even given my temporarily broadened interests (more on that later).  Emotional design?  Gaming?  Continued beating of the Internet video dead horse?  No thanks across the board.  Where was Khoi Vinh with a followup to his excellent grid design presentation from last year?  Where were Mark Boulton and Richard Rutter with more typography?  Hell, where were the Rails folks with at least <em>something</em> technical?  Answer: they were all at the same time on Monday afternoon.  I heard someone say they put all of the good panels in parallel to force people to choose so they wouldn&#8217;t have one one ginormous panel in each block with empty houses everywhere else.  Slightly logical and incredibly annoying.</p>
<p>A quick list of favorites: the Kevin Rose led and Cal Henderson profaned panel on scalability; John Resig and company&#8217;s panel on JavaScript libraries (Alex Russell and Andrew Dupont were hilarious); and icanhascheezburger.  In other words, I didn&#8217;t learn a great deal.</p>
<p>I&#8217;ve been kicking around this idea in my head that started as my explanation for what I hope to get out of South-By: SXSW is a necessary yearly dose of design for engineers.  With as much fun as the &#8220;How to Rawk&#8230;&#8221; panels were to watch (again, learning absolutely nothing), it seems like a panel along those lines would float pretty well.  Thoughts?</p>
<p><em>Anyway I&#8217;ve finally gotten back to the <span style="text-decoration: line-through">real world</span>Internet and been hacking up some good sauce.  More on that whenever I damn well please.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/03/19/oh-yeah-thats-right-i-went-to-sxsw/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Functional programming in C</title>
		<link>http://rcrowley.org/2008/03/03/functional-programming-in-c/</link>
		<comments>http://rcrowley.org/2008/03/03/functional-programming-in-c/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 09:21:27 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/03/03/functional-programming-in-c/</guid>
		<description><![CDATA[I&#8217;ve been meaning to write this post for some time to document how I avoid the giant-if-statement-with-strcmp() problempattern when writing C programs.
The solution to every problem in C is to use pointers.  Keeping with that lemma, it&#8217;s possible, beneficial and even fun to make pointers to functions do your bidding without the pile of [...]]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;ve been meaning to write this post for some time to document how I avoid the giant-if-statement-with-<code>strcmp()</code> <del>problem</del>pattern when writing C programs.</em></p>
<p>The solution to every problem in C is to use pointers.  Keeping with that lemma, it&#8217;s possible, beneficial and even fun to make pointers to functions do your bidding without the pile of <code>if</code> or <code>switch</code> statements typical of most student programming projects.  It&#8217;s really close enough that I started calling it functional programming years ago even though this is still a far cry from Lisp/Python/JavaScript/whatever.  It doesn&#8217;t matter because C is still awesome.</p>
<h2>Use the <a href="http://www.sgi.com/tech/stl/">STL</a>, Luke</h2>
<p>I&#8217;m cheating a bit when I say functional programming in C.  The use case I&#8217;m going to present is a C++ sample but there&#8217;s no reason why you can&#8217;t hash your own table in straight C99.  I just don&#8217;t care to myself.  The example uses the STL <code>map</code> class to map strings to functions, making it trivially easy to build your own shell-like app that takes some argument and dispatches a function to make it so.  The map provides the nice dispatch-y interface but there&#8217;s no reason you couldn&#8217;t do something like this in plain C:</p>
<pre>void foo(int i) {
    printf("You called foo(%d)!\n", i);
}

void bar(void(*)(int) f) {
    (*f)(2);
}</pre>
<p>Anyone fluent in a scripting language that isn&#8217;t PHP will likely understand exactly what&#8217;s going on here.  <code>foo</code> is a simple function that does nothing interesting.  <code>bar</code> is a function that takes as its argument a pointer to a function.  That function can&#8217;t return anything and must take a single integer argument.  Many will call foul here saying that the strong type restrictions here make this sort of &#8220;functional programming&#8221; rather useless.  I say nay and cite <a href="http://svn.rcrowley.org/svn/curvr/trunk/curvr.cc">curvr.cc</a> as my example.  In any language, a function lacking any expectations for its arguments will be rather tedious.  C doesn&#8217;t give you this as a way to shoot yourself in the foot (there are so many other ways, however).</p>
<h2>Function pointer declaration</h2>
<p>The simplest way I know to explain the difficult syntax of function pointer declaration is an analogy to something easy like a character and a pointer to a character.</p>
<p><code>char c</code> : <code>char * p</code> :: <code>void foo(int i)</code> : <code>void (*)(int)</code></p>
<p>The first half declares a character, <code>c</code> and a pointer, <code>p</code> that <em>can point to</em> <code>c</code>.  Similarly, the second half declares a void function <code>foo</code> that takes an integer argument and a <em>pointer to</em> a void function that takes an integer argument.</p>
<h2>Now for the useful part</h2>
<p>Using this pattern for creating function pointers we can now define a few functions and map them in a useful way.  This is again taken from my <a href="http://svn.rcrowley.org/svn/curvr/trunk/curvr.cc">curvr.cc</a> file (more info about <a href="http://rcrowley.org/tags/curvr/">curvr</a>).</p>
<pre>// First a few function prototypes to map
int curve(Magick::Image &amp; img);
int bigcurve(Magick::Image &amp; img);
int anticurve(Magick::Image &amp; img);

// Then the map part
int main(int argc, char * * argv) {
    // Magically figure out a string called process

    // Setup the map using the address operator (&amp;)
    std::map&lt;std::string, int (*)(Magick::Image &amp;)&gt; processes;
    processes["curve"] = &amp;curve;
    processes["bigcurve"] = &amp;bigcurve;
    processes["anticurve"] = &amp;anticurve;

    // Call a function from the map
    (*processes[process])(img);

}</pre>
<p>Your code will be shorter now.  Go forth and hack.</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/03/03/functional-programming-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox 3 &#8212; more better</title>
		<link>http://rcrowley.org/2008/02/25/firefox-3-more-better/</link>
		<comments>http://rcrowley.org/2008/02/25/firefox-3-more-better/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 05:10:31 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[firefox]]></category>

		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/02/25/firefox-3-more-better/</guid>
		<description><![CDATA[
Go to about:config.
Set browser.urlbar.matchOnlyTyped to true.
Profit!

This will cause Firefox to almost revert its address-bar behavior to the familiar Firefox 2 style where it matches the beginning of URLs instead of attempting some hairbrained search.  If I&#8217;d wanted to search, I would have hit Apple+K.
]]></description>
			<content:encoded><![CDATA[<ol>
<li>Go to <code>about:config</code>.</li>
<li>Set <strong>browser.urlbar.matchOnlyTyped</strong> to <strong>true</strong>.</li>
<li>Profit!</li>
</ol>
<p>This will cause Firefox to <em>almost</em> revert its address-bar behavior to the familiar Firefox 2 style where it matches the beginning of URLs instead of attempting some hairbrained search.  If I&#8217;d wanted to search, I would have hit Apple+K.</p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/02/25/firefox-3-more-better/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More GReader hacking &#8212; immersion</title>
		<link>http://rcrowley.org/2008/02/11/more-greader-hacking-immersion/</link>
		<comments>http://rcrowley.org/2008/02/11/more-greader-hacking-immersion/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 06:44:27 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[delicious]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/02/11/more-greader-hacking-immersion/</guid>
		<description><![CDATA[First, some updates to readelicious.  I worked in Mike Malone&#8217;s patch to add a keyboard shortcut which I now can&#8217;t live without.  I also reworked some bits of it to interact nicely with the new script.
Immersion is another Greasemonkey script that will load the current entry as an &#60;iframe&#62; within Google Reader.  I made this [...]]]></description>
			<content:encoded><![CDATA[<p>First, some updates to <a href="http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/">readelicious</a>.  I worked in <a href="http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/#comment-2029">Mike Malone&#8217;s patch</a> to add a keyboard shortcut which I now can&#8217;t live without.  I also reworked some bits of it to interact nicely with the new script.</p>
<p>Immersion is another <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> script that will load the current entry as an &lt;iframe&gt; within Google Reader.  I made this one almost exclusively to look at <a href="http://abriefmessage.com/">A Brief Message</a> but it works just as well for leaving a quick comment since it doesn&#8217;t interrupt your train of thought like opening a new tab does (I tend to forget new tabs until hours later).</p>
<p>Just like readelicious, immersion adds a link to each entry but also uses &#8216;i&#8217; for keyboard access to the current entry.</p>
<p><big><a href="http://svn.rcrowley.org/svn/greasemonkey/immersion.user.js">http://svn.rcrowley.org/svn/greasemonkey/immersion.user.js</a></big> or <big><a href="http://userscripts.org/scripts/show/22685">http://userscripts.org/scripts/show/22685</a></big></p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/02/11/more-greader-hacking-immersion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>readelicious &#8212; hacking del.icio.us directly into Google Reader</title>
		<link>http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/</link>
		<comments>http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 16:25:41 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[delicious]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/</guid>
		<description><![CDATA[It&#8217;s just too many clicks to leave the ol&#8217; feed reader to see an article and save it to del.icio.us.  I&#8217;m not into that kind of commitment.  I am, however, into Greasemonkey so I headed to userscripts.org and discovered two fairly poor attempts to do what I wanted.  The first one just [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s just too many clicks to leave the ol&#8217; feed reader to see an article and save it to <a href="http://del.icio.us/">del.icio.us</a>.  I&#8217;m not into that kind of commitment.  I am, however, into <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a> so I headed to <a href="http://userscripts.org/">userscripts.org</a> and discovered two fairly poor attempts to do what I wanted.  The first one just took me to the del.icio.us/post page which is a different kind of bad solution.  The second one displayed a nice box in the page for editing the info before saving away to del.icio.us but it appeared halfway off of my screen and I didn&#8217;t have the patience to figure out why.  Here are those two:</p>
<ul>
<li><a href="http://userscripts.org/scripts/show/11233">http://userscripts.org/scripts/show/11233</a></li>
<li><a href="http://userscripts.org/scripts/show/7957">http://userscripts.org/scripts/show/7957</a></li>
</ul>
<p>Mine has many virtues.  First off it actually works and on any browser window size larger than 422 pixels.  Secondly it is visually a bit more disruptive than the small Google-styled &#8220;window&#8221; that one displays but not so obnoxious as to take you off the page entirely.  And finally, it automatically pulls the title, link and selected text from the article.  Fully featured!  As a bonus you get the timeless, classic and beautiful feel of my favorite color, <code>#eee</code>.</p>
<p>Because of the way del.icio.us&#8217; API works, it&#8217;ll ask you for your username and password the first time through but after that should behave nicely.</p>
<p><big><a href="http://svn.rcrowley.org/svn/greasemonkey/readelicious.user.js">http://svn.rcrowley.org/svn/greasemonkey/readelicious.user.js</a></big> or <big><a href="http://userscripts.org/scripts/show/22494">http://userscripts.org/scripts/show/22494</a></big></p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/02/08/readelicious-hacking-delicious-directly-into-google-reader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stop doing it yourself and use CPAN &#8212; curvr-0.2</title>
		<link>http://rcrowley.org/2008/02/05/stop-doing-it-yourself-and-use-cpan-curvr-02/</link>
		<comments>http://rcrowley.org/2008/02/05/stop-doing-it-yourself-and-use-cpan-curvr-02/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 16:32:15 +0000</pubDate>
		<dc:creator>Richard Crowley</dc:creator>
		
		<category><![CDATA[api]]></category>

		<category><![CDATA[c]]></category>

		<category><![CDATA[curvr]]></category>

		<category><![CDATA[dopplr]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://rcrowley.org/2008/02/05/stop-doing-it-yourself-and-use-cpan-curvr-02/</guid>
		<description><![CDATA[Just like the career of the average software engineer, Curvr has now grown up just a bit and started reusing other people&#8217;s code.
Dopplr integration in curvrmail
Geotagging is awesome but a bit of a pain to automate with any kind of accuracy.  I&#8217;m making a compromise here by automatically tagging things using my location according [...]]]></description>
			<content:encoded><![CDATA[<p>Just like the career of the average software engineer, Curvr has now grown up just a bit and started reusing other people&#8217;s code.</p>
<h2>Dopplr integration in <code>curvrmail</code></h2>
<p>Geotagging is awesome but a bit of a pain to automate with any kind of accuracy.  I&#8217;m making a compromise here by automatically tagging things using my location according to <a href="http://dopplr.com/">Dopplr</a>.  I had this working with my original PHP <code>curvrmail</code> script but have since switched to using <code>Flickr::Upload::Dopplr</code> just to practice some Perl.</p>
<h2><span style="text-decoration: line-through">Auto</span>Manual image rotation</h2>
<p>Since my N73 isn&#8217;t friendly enough to rotate pictures for me, I&#8217;ve added a way to specify rotation in the email you send to Curvr.  Prefixing with &#8220;L &#8221; or &#8220;l &#8221; will rotate 90 degrees counterclockwise and prefixing with &#8220;R &#8221; or &#8220;r &#8221; will rotate 90 degrees clockwise.  Note in both cases that it is a letter followed by a space followed by the normal title/tags syntax.</p>
<p>It is a bit awkward to think about in terms of left and right, since I could either be talking about the direction you rotated the camera or the direction the photo should be rotated (which itself could be rather ambiguous, so we&#8217;ll say that it is relative to the top).  So here&#8217;s the official word: the rotate syntax wants to know which direction you rotated the camera to take the picture.</p>
<h2><code>curvrconf</code> for getting API tokens</h2>
<p>Getting tokens for the Flickr and Dopplr API, while not something you need to do often, is quite a drag.  Enter <code>curvrconf</code>, the copy-and-paste simple way to get your tokens out.  All it needs is to be setup with the same API key as <code>curvrmail</code> and it&#8217;ll guide you through grabbing tokens.  For the Flickr API, setup your key for web-based auth and give it a garbage URL to return to (I use http://localhost:81/).</p>
<p>As usual, the API key is up to you.  I accidentally committed my keys/secrets/tokens to Subversion but have expired all of them so don&#8217;t even bother trying to steal my accounts.</p>
<h2>Anti-blue C code</h2>
<p>The main <code>curvr</code> program has for a long time introduced some strange blue artifacts into my photos.  I figured this was due to some underflow or overflow issues with my color maps.  I finally took the time to do some serious experimentation and it turns out that if I just favor a stronger red channel in these edge cases, the artifacts seem to go away.  Strange and beautiful indeed.  I can&#8217;t fully explain the phenomenon but believe it&#8217;s somehow related to my using the red channel as my indicator of color value (as many photographers do when converting to black &amp; white).</p>
<p>So there it is, curvr-0.2.</p>
<p>Er, here it is: <big><a href="http://svn.rcrowley.org/svn/curvr/tags/curvr-0.2">http://svn.rcrowley.org/svn/curvr/tags/curvr-0.2</a></big></p>
]]></content:encoded>
			<wfw:commentRss>http://rcrowley.org/2008/02/05/stop-doing-it-yourself-and-use-cpan-curvr-02/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
