<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>transfixed but not dead! &#187; ruby</title>
	<atom:link href="http://transfixedbutnotdead.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://transfixedbutnotdead.com</link>
	<description>my ramblings on life, work &#38; anything left in-between</description>
	<lastBuildDate>Fri, 03 Feb 2012 16:03:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='transfixedbutnotdead.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0a317653027efb1ab2bf8adde3dcb067?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>transfixed but not dead! &#187; ruby</title>
		<link>http://transfixedbutnotdead.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://transfixedbutnotdead.com/osd.xml" title="transfixed but not dead!" />
	<atom:link rel='hub' href='http://transfixedbutnotdead.com/?pushpress=hub'/>
		<item>
		<title>Sequence, Selection and Iteration</title>
		<link>http://transfixedbutnotdead.com/2010/07/05/sequence-selection-and-iteration/</link>
		<comments>http://transfixedbutnotdead.com/2010/07/05/sequence-selection-and-iteration/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 19:34:46 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=1053</guid>
		<description><![CDATA[My bit of procrastination this afternoon was watching this entertaining and interesting keynote from RailsConf 2010 given by Robert Martin. Here is the direct YouTube link Don&#8217;t worry its not Rails or even Ruby loaded. The keynote goes through an interesting history of programming languages and on route Robert mentions Fortran, Lisp, Algol, BASIC, Simula, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=1053&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My bit of procrastination this afternoon was watching this entertaining and interesting keynote from RailsConf 2010 given by <a href="http://www.objectmentor.com/omTeam/martin_r.html">Robert Martin</a>. </p>
<span style="text-align:center; display: block;"><a href="http://transfixedbutnotdead.com/2010/07/05/sequence-selection-and-iteration/"><img src="http://img.youtube.com/vi/mslMLp5bQD0/2.jpg" alt="" /></a></span>
<p>Here is the direct <a href="http://www.youtube.com/watch?v=mslMLp5bQD0">YouTube link</a></p>
<p>Don&#8217;t worry its not Rails or even Ruby loaded.  The keynote goes through an interesting history of programming languages and on route Robert mentions Fortran, Lisp, Algol, BASIC, Simula, BCPL, B, C, Scheme, Smalltalk, C++, Perl, Java, Ruby, Erlang, C#, F#, Haskell and Clojure.  </p>
<p>Hopefully I didn&#8217;t miss one?   Strangely can&#8217;t recall Python being mentioned!?</p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/1053/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/1053/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/1053/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=1053&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2010/07/05/sequence-selection-and-iteration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>URL, Devel::Declare and no strings attached</title>
		<link>http://transfixedbutnotdead.com/2009/12/16/url-develdeclare-and-no-strings-attached/</link>
		<comments>http://transfixedbutnotdead.com/2009/12/16/url-develdeclare-and-no-strings-attached/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:55:24 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Devel::Declare]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=753</guid>
		<description><![CDATA[This Hacker News article caught my eye yesterday which pointed to a blog post about having a raw URL within a Ruby program using some clever shenanigans. (They you go, I saved you having to click through to find all the links yourself!) Some examples from blog post: Very clever indeed. Of course there will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=753&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://news.ycombinator.com/item?id=994716">Hacker News article</a> caught my eye yesterday which pointed to a <a href="http://ozmm.org/posts/urls_in_ruby.html">blog post</a> about having a raw <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL</a> within a Ruby program using some <a href="http://gist.github.com/255948">clever shenanigans</a>. <em>(They you go, I saved you having to click through to find all the links yourself!)</em></p>
<p>Some examples from blog post:<br />
<pre class="brush: ruby;">
# display this JSON request
puts http://github.com/defunkt.json

# =&gt; &quot;He nose the truth.&quot;
require 'json'
url = http://twitter.com/statuses/show/6592721580.json
JSON.parse(url.to_s)['text']   
</pre></p>
<p>Very clever indeed.  Of course there will be some edge cases but it does show you how far you can stretch Ruby.  <em>NB. Didn&#8217;t work in 1.9 for me but worked with minor warning in 1.8.2 (yes I know it old but thats what shipped with Mac OSX Tiger).</em></p>
<p>So how far can we stretch Perl?  Well with <a href="http://search.cpan.org/dist/Devel-Declare/">Devel::Declare</a> it can be stretched all the way:</p>
<p><pre class="brush: perl;">
use Modern::Perl;
use JSON qw(decode_json);
use URLDSL;

# print the json
say http://twitter.com/statuses/show/6592721580.json;

# =&gt; &quot;He nose the truth.&quot;
say decode_json( http://twitter.com/statuses/show/6592721580.json )-&gt;{text};
</pre></p>
<p>So Perl also has no strings attached <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Devel::Declare allow us to extend the Perl syntax in a robust and easy fashion:<br />
<pre class="brush: perl;">
package URLDSL;
use Modern::Perl;
use Devel::Declare ();
use LWP::Simple ();
use base 'Devel::Declare::Context::Simple';

sub import {
    my $class  = shift;
    my $caller = caller;
    my $ctx    = __PACKAGE__-&gt;new;
    
    Devel::Declare-&gt;setup_for(
        $caller,
        { 
            http =&gt; { 
                const =&gt; sub { $ctx-&gt;parser(@_) },
            },
        },
    );
    
    no strict 'refs';
    *{$caller.'::http'} = sub ($) { LWP::Simple::get( $_[0] ) };
}

sub parser {
    my $self = shift;
    $self-&gt;init(@_);
    $self-&gt;skip_declarator;          # skip past &quot;http&quot;

    my $line = $self-&gt;get_linestr;   # get me current line of code
    my $pos  = $self-&gt;offset;        # position just after &quot;http&quot;
    my $url  = substr $line, $pos;   # url &amp; everything after &quot;http&quot;
    
    for my $c (split //, $url) {
        # if blank, semicolon or closing parenthesis then no longer a URL
        last if $c eq q{ };
        last if $c eq q{;};
        last if $c eq q{)};
        $pos++;
    }    
    
    # wrap the url with http() sub and quotes
    substr( $line, $pos,          0 ) = q{&quot;)};
    substr( $line, $self-&gt;offset, 0 ) = q{(&quot;http};
    
    # pass back changes to parser
    $self-&gt;set_linestr( $line );

    return;
}

1;
</pre></p>
<p>&nbsp;</p>
<p>Here is a low level synopsis of how it worked:</p>
<ul>
<li>Devel::Declare tells the perl parser to call parser() when it hits <code>http</code> keyword</li>
<li><code>http://twitter.com/statuses/show/6592721580.json</code> example triggers this (perl has no problem naturally distinguishing &#8220;http&#8221; keyword from &#8220;http://&#8221;)</li>
<li>Get line of code in question (<code>my $line = $self-&gt;get_linestr; </code>)
<li>parser() skips along the URL data following &#8220;http&#8221; (<code>$self-&gt;offset</code>) until it reaches a space, semicolon or a closing bracket (this covers &#8220;most&#8221; cases though comma could be an issue).  This marks the end of the URL data</li>
<li>We now in essence change <code>http://twitter.com/statuses/show/6592721580.json</code> into <code>http("http://twitter.com/statuses/show/6592721580.json")</code></li>
<li>And plonk the changed line back to the parser (<code>$self-&gt;set_linestr($line);</code>) and let it continue along its merry way</li>
<li>NB. http() sub was already imported into calling space and returns a <a href="http://search.cpan.org/dist/libwww-perl/lib/LWP/Simple.pm">LWP::Simple::get</a> of the requested URL</li>
</ul>
<p>&nbsp;</p>
<p>Now is URLDSL useful in the real world?   It can screw up syntax highlighting a bit (though WordPress highlighter coped extremely well, unlike <a href="http://gist.github.com/256992">Github</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Its robust enough to cope with normal string interpolation:<br />
<pre class="brush: perl;">
my $id = '6592721580';
say decode_json( http://twitter.com/statuses/show/$id.json )-&gt;{text};
</pre></p>
<p>So perhaps I should upload it to CPAN? (earmarked for ACME:: perhaps!?).  Anyone think this is useful little helper module then I wrap it up the next time I get a free moment.</p>
<p>The exercise as been fruitful in allowing me to get my head into the amazing Devel::Declare module for the first time. </p>
<p>I&#8217;ve used the Devel::Declare::Context::Simple class which simplifies things.  Unfortunately there isn&#8217;t a POD on this yet but the main Devel::Declare docs nicely demonstrate the correct mechanics so its easy to adapt from this.</p>
<p>I also found this <a href="http://lumberjaph.net/blog/index.php/2009/11/09/modules-i-like-develdeclare/">blog post by franck cuny</a> to be extremely helpful.  As was delving through the source code of <a href="http://cpants.perl.org/dist/used_by/Devel-Declare">other modules that used Devel::Declare</a></p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/753/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/753/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/753/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=753&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/12/16/url-develdeclare-and-no-strings-attached/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Anything you can DO I can DO better</title>
		<link>http://transfixedbutnotdead.com/2009/12/05/anything-you-can-do-i-can-do-better/</link>
		<comments>http://transfixedbutnotdead.com/2009/12/05/anything-you-can-do-i-can-do-better/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 20:49:05 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=732</guid>
		<description><![CDATA[Here is a simple world count in Ruby from recent post at Refactormycode.com: If you know Ruby then you know this isn&#8217;t very idiomatic. Here is something closer to would normally see in Ruby world: But the style of the original code is something I&#8217;ve seen often in Perl: Now if brevity was key to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=732&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a simple world count <a href="http://refactormycode.com/codes/856-count-words-in-a-string">in Ruby</a> from recent post at <a href="http://refactormycode.com">Refactormycode.com</a>:<br />
<pre class="brush: ruby;">
s = &quot;The green hat is the twin of the green hat&quot;
h = Hash.new(0)
s.split.each do |w|
  h[w.downcase] += 1
end
</pre></p>
<p>If you know Ruby then you know this isn&#8217;t very idiomatic.  Here is something closer to would normally see in Ruby world:<br />
<pre class="brush: ruby;">
h = s.downcase.split.inject(Hash.new(0)) { |h,k| h[k] += 1; h }
</pre></p>
<p>But the style of the original code is something I&#8217;ve seen often in Perl:<br />
<pre class="brush: perl;">
my $s = &quot;The green hat is tHe twin of the green hat&quot;;
my %h; 
for my $w (split /\s+/, $s) {
    $h{ lc $w }++;
}
</pre></p>
<p>Now if brevity was key to better code then you could do this:<br />
<pre class="brush: perl;">
my %h; $h{$_}++  for split /\s+/, lc $s;
</pre></p>
<p>But I think its better to <a href="http://perldoc.perl.org/functions/do.html">do</a> something like this:<br />
<pre class="brush: perl;">
my %words = do { 
    my %h;
    $h{$_}++  for split /\s+/, lc $s;
    %h;
};
</pre></p>
<p>OK this is not a great example of do blocks and isn&#8217;t even as <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a> compared to original code.  But I do find this more <a href="http://en.wikipedia.org/wiki/Aesthetics">aesthetic</a> IMHO.</p>
<p>Perhaps a better example of what do blocks can do is to produce another naff example!<br />
<pre class="brush: perl;">
my $num_string = do {
    my $num = get_random_num_between_1_and_3();
    if    ($num == 1) { 'one' }
    elsif ($num == 2) { 'two' }
    elsif ($num == 3) { 'three' }
};
</pre></p>
<p>do blocks return the last evaluated result.  And result can be plural:<br />
<pre class="brush: perl;">
my $year = get_year();
my ($champions, $runners_up) = do {
    if    ($year == 2003) { ('England', 'Australia')    }    
    elsif ($year == 2007) { ('South Africa', 'England') }
};

say &quot;Rugby World champions for $year: $champions  Runners up: $runners_up&quot;;
</pre></p>
<p>So do blocks are useful tools in helping to make code more focused and avoid unnecessary pollution of variables into calling namespace. </p>
<p>But we can either move up another notch by using <a href="http://en.wikipedia.org/wiki/Anonymous_function">anonymous subroutines</a>:<br />
<pre class="brush: perl;">
my ($champions, $runners_up) = sub {
    given ($_[0]) {
        when (2003) { return ('England', 'Australia')    }
        when (2007) { return ('South Africa', 'England') }
    }
}-&gt;( get_year() );
</pre></p>
<p>This anon sub <i>block</i> is built and then immediately executed by the <code>-&gt;()</code> bit.</p>
<p>So works much like a do block except we can short circuit flow with <i>return</i> thus enabling us more freedom and control over what these blocks of code can do. </p>
<p>Using do / anon sub blocks is something that Perl can definitely learn from Ruby.  Here is another recent example of do usage that I like a lot (<a href="http://refactormycode.com/codes/986-a-dvorak-keyboard-layout-cypher#refactor_254397">see has</a>).</p>
<p>NB. Another advantage of the do / anon sub block approach is that at anytime the block gets big or its needed elsewhere then it doesn&#8217;t take much to turn it into a proper subroutine.</p>
<p>&nbsp;</p>
<p>I&#8217;ll end with my obligatory autobox solution of the original code:<br />
<pre class="brush: perl;">
my $s = &quot;The green hat is tHe twin of the green hat&quot;;

my %words = $s-&gt;lc-&gt;split( qr{\s+} )-&gt;hash_count-&gt;flatten;

sub autobox::Core::ARRAY::hash_count {
    my $list = shift;
    my %h;
    $h{$_}++ for @$list;
    \%h;
}
</pre></p>
<p>You can even do:<br />
<pre class="brush: perl;">
'The green hat is the twin of the green hat'-&gt;lc-&gt;split( qr{\s+} )-&gt;hash_count-&gt;flatten;
</pre></p>
<p>But I can&#8217;t think where something like this would ever be useful in the real world?   Though it is nice to look at when running it via the extremely useful <a href="http://search.cpan.org/dist/Devel-REPL/">Devel::REPL</a> <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/732/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/732/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/732/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=732&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/12/05/anything-you-can-do-i-can-do-better/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Between thought and expression</title>
		<link>http://transfixedbutnotdead.com/2009/11/21/between-thought-and-expression/</link>
		<comments>http://transfixedbutnotdead.com/2009/11/21/between-thought-and-expression/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 10:38:42 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=690</guid>
		<description><![CDATA[Comparing computer languages can usually be interesting, sometimes informative, often amusing and in lots of cases just damn annoying! Still this recent Hacker News post about Python vs Clojure did catch my eye. Despite the fact the author of the blog post had pulled the Python code from answers to Project Euler the pythonista&#8217;s quite [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=690&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Comparing computer languages can usually be interesting, sometimes informative, often amusing and in lots of cases just damn annoying!</p>
<p>Still this recent <a href="http://news.ycombinator.com/item?id=881642">Hacker News post</a> about <a href="http://www.bestinclass.dk/index.php/2009/10/python-vs-clojure-evolving/">Python vs Clojure</a> did catch my eye</a>.</p>
<p>Despite the fact the author of the blog post had pulled the Python code from <a href="http://pyeuler.wikidot.com/problems-1-10">answers</a> to <a href="http://projecteuler.net">Project Euler</a> the pythonista&#8217;s quite correctly cried foul because it wasn&#8217;t well written idiomatic python example and so was an unfair comparison.</p>
<p>There&#8217;s a lot of code out there posted on those intertubes over the years.  However languages and practises evolve but unfortunately intertube posts can remain set in stone!  Perl is often weighed down by its past history on the intertubes.  One good way forward is just to produce more Modern Perl posts.</p>
<p>Anyway i digress, so moving on lets take a look at the <a href="http://projecteuler.net/index.php?section=problems&amp;id=4">Euler 4 &#8211; Finding Palindroms</a>.  This was the Clojure example that was put forward in the blog post:</p>
<p><pre class="brush: plain;">
(reduce max
    (filter #(let [s (str %)]
               (= (seq s) (reverse s)))
            (for [x (range 100 1000)
                  y (range 100 1000)]
              (* x y))))
</pre></p>
<p>Now in reply to this a <a href="http://blog.hackers-cafe.net/2009/10/re-python-vs-clojure.html">much more idiomatic python example</a> was provided:</p>
<p><pre class="brush: python;">
print max(s for s in (x * y 
    for x in range(111, 1000) 
    for y in range(x, 1000))
    if list(str(s)) == list(reversed(str(s))))
</pre></p>
<p>This uses Python&#8217;s list comprehension.  Definitely a very powerful construct.  However i do find i get lost very quickly when trying to follow long nested comprehension&#8217;s <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>In this same Python post there is also mention of a <a href="http://twitter.com/yukihiro_matz/status/4901341641">twitter post</a> by <a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto">Yukihiro Matz</a>, the creator of Ruby.   Matz provided the following Ruby example:</p>
<p><pre class="brush: ruby;">
p [*100..1000].product([*100..1000]).map{|x,y| x*y}.select{|s|s=s.to_s; s==s.reverse}.max
</pre></p>
<p>Despite being formatted for twitter (ie. one line) i found it easy to follow through the logic.</p>
<p>Ruby &amp; Python are not the only languages that can produce an elegant solution!  So not to be out done here is a Perl example.  In fact its the exact same code repeated three times but formatted differently: </p>
<p><pre class="brush: perl;">
use Modern::Perl;
use List::Util q(max);

# twitter one liner
say max grep { $_ eq reverse $_ } map { my $x = $_; map { $x * $_ } 100..1000 } 100..1000;


# again in lispy style format
say 
  max 
    grep { $_ eq reverse $_ } 
      map {
        my $x = $_;
        map { $x * $_ } 100..1000;
      } 100..1000;

# and finally in my preferred more perlish alignment
say max 
    grep { $_ eq reverse $_ } 
    map {
        my $x = $_;
        map { $x * $_ } 100..1000;
    } 100..1000;
</pre></p>
<p>The perl code speaks for itself.. its wonderfully clear and succinct.  Also its fast, each version runs in under a second on my machine!</p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/690/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/690/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/690/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=690&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/11/21/between-thought-and-expression/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Squatting?</title>
		<link>http://transfixedbutnotdead.com/2009/08/20/why-squatting/</link>
		<comments>http://transfixedbutnotdead.com/2009/08/20/why-squatting/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 09:02:19 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Camping]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Squatting]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=533</guid>
		<description><![CDATA[Below are two tutorial examples of Camping, a Web Microframework written in Ruby. Alongside them are my two conversions written in Squatting, a Camping-inspired Web Microframework for Perl, written by John Beppu &#160; The Camping Short, Short Example: The Squatting Short, Short Example: &#160; The Camping Tutorial Two: The Squatting Tutorial Two: I&#8217;m not going [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=533&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Below are two tutorial examples of <a href="http://camping.rubyforge.org">Camping</a>, a Web Microframework written in Ruby.</p>
<p>Alongside them are my two conversions written in <a href="http://search.cpan.org/dist/Squatting/">Squatting</a>, a Camping-inspired Web Microframework for Perl, written by <a href="http://search.cpan.org/~beppu/">John Beppu</a></p>
<p>&nbsp;</p>
<p>The Camping Short, Short Example:<br />
<pre class="brush: ruby;">
require 'camping'

Camping.goes :HomePage

module HomePage::Controllers

  # The root slash shows the `index' view.
  class Index &lt; R '/'
    def get
      render :index 
    end
  end

  # Any other page name gets sent to the view
  # of the same name.
  #
  #   /index -&gt; Views#index
  #   /sample -&gt; Views#sample
  #
  class Page &lt; R '/(\w+)'
    def get(page_name)
      render page_name
    end
  end

end

module HomePage::Views

  # If you have a `layout' method like this, it
  # will wrap the HTML in the other methods.  The
  # `self &lt;&lt; yield' is where the HTML is inserted.
  def layout
    html do
      title { 'My HomePage' }
      body { self &lt;&lt; yield }
    end
  end

  # The `index' view.  Inside your views, you express
  # the HTML in Ruby.  See http://code.whytheluckystiff.net/markaby/.
  def index
    p 'Hi my name is Charles.'
    p 'Here are some links:'
    ul do
     li { a 'Google', :href =&gt; 'http://google.com' }
     li { a 'A sample page', :href =&gt; '/sample' }
    end
  end

  # The `sample' view.
  def sample
    p 'A sample page'
  end
end
</pre></p>
<p>The Squatting Short, Short Example:<br />
<pre class="brush: perl;">
use strict;
use warnings;

{
  package ShortShortExample;
  use base 'Squatting';
}

{
  package ShortShortExample::Controllers;
  use Squatting ':controllers';
  
  our @C = (

    C( 
      Index =&gt; [ '/' ],
      get   =&gt; sub {
        my ( $self ) = @_;
        $self-&gt;render( 'index' );
      },
    ),
    
    C(
      Page =&gt; [ '/(\w+)' ],
      get  =&gt; sub {
        my ( $self, $page_name ) = @_;
        $self-&gt;render( $page_name );
      }
    ),
    
  );
}

{
  package ShortShortExample::Views;
  use Squatting ':views';
  use HTML::AsSubs;
    
  our @V = (
    
    V(  'html',
      
      layout =&gt; sub {
        my ( $self, $v, @yield ) = @_;
        html(
          title ( 'My HomePage' ),
          body ( @yield ),
        )-&gt;as_HTML;
      },
      
      index =&gt; sub {
        my ( $self, $v ) = @_;
        return (
          p ( 'Hi my name is Charles.' ),
          p ( 'Here are some links:'   ),
          ul (
            li ( a( { href =&gt; 'http://google.com' },  'Google' ) ),
            li ( a( { href =&gt; '/sample' },  'a sample page'    ) ),
          ),
        );
      },
      
      sample =&gt; sub {
        my ( $self ) = @_;
        p ( 'A sample page' );
      },
            
    ),
  );
}

1;
</pre></p>
<p>&nbsp;</p>
<p>The Camping Tutorial Two:<br />
<pre class="brush: ruby;">
require 'camping'

Camping.goes :Nuts

module Nuts::Controllers
  class Index &lt; R '/'
    def get
      @t = Time.now.to_s
      render :sundial
    end
  end
end

module Nuts::Views
  def layout
    html do
      head do
        title { &quot;Nuts And GORP&quot; }
      end
      body { self &lt;&lt; yield }
    end
  end

  def sundial
    p &quot;The current time is: #{@t}&quot;
  end
end
</pre></p>
<p>The Squatting Tutorial Two:<br />
<pre class="brush: perl;">
use strict;
use warnings;

{
  package Nuts;
  use base 'Squatting';
}

{ 
  package Nuts::Controllers;
  use Squatting ':controllers';
  
  our @C = (
    C(
      Index =&gt; [ '/' ],
      get   =&gt; sub { 
        my ( $self ) = @_;
        my $v = $self-&gt;v;
        $v-&gt;{t} = localtime;
        $self-&gt;render( 'sundial' );
      },
    ),
  );
}

{
  package Nuts::Views;
  use Squatting ':views';
  use HTML::AsSubs;
  
  our @V = (
    V(  'html',
    
      layout =&gt; sub { 
        my ( $self, $v, @yield ) = @_;
        html (
          head ( 'Nuts And GORP' ),
          body ( @yield ),
        )-&gt;as_HTML;
      },
      
      sundial =&gt; sub {
        my ( $self, $v ) = @_;
        p ( &quot;The current time is: $v-&gt;{t}&quot; );
      },
    ),
  );
}

1;
</pre></p>
<p>I&#8217;m not going to say much more at this point because I think the code above clearly expresses what&#8217;s going on.  So just enjoy <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>/I3az/</p>
<p>&nbsp;</p>
<p>Postscript:</p>
<p>The two Camping tutorials were written by <a href="http://en.wikipedia.org/wiki/Why_the_lucky_stiff">Why the lucky stiff</a> the author of Camping.  These are no longer available on web because _why was regurgitating them from his own repo/website onto GitHub.   </p>
<p>I wrote the Squatting ports of the tutorial back in October 2008 so luckily I had pulled down these Camping tutorials.  I found that porting _why&#8217;s excellent Camping tutorials were a good way of learning Squatting.</p>
<p>The plan was always to post these on my blog.   In fact I have a long list of stuff to post ranging from just a few scribbles to completed prose.   I&#8217;m just trying to be &#8220;logical&#8221; about the order of these posts!</p>
<p>So why (excuse the pun!) post these now?    The reason will be obvious to most readers&#8230;.  _why&#8217;s strange disappearance from the web overnight.</p>
<p>I not going to conjecture further but I hope all is OK.   So this post is my little ode to _why.</p>
<p>Below are some links on this strange event:</p>
<ul>
<li><a href="http://news.ycombinator.com/item?id=773106">_why is no more (Hacker News)</a></li>
<li><a href="http://news.ycombinator.com/item?id=774384">_why&#8217;s best twitter posts (Hacker News)</a></li>
<li><a href="http://ejohn.org/blog/eulogy-to-_why/">Eulogy to _why (John Resig)</a></li>
<ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/533/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/533/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/533/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=533&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/08/20/why-squatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Moose Roles to create Singleton Methods</title>
		<link>http://transfixedbutnotdead.com/2009/06/03/using-moose-roles-to-create-singleton-methods/</link>
		<comments>http://transfixedbutnotdead.com/2009/06/03/using-moose-roles-to-create-singleton-methods/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:14:09 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[moose]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[roles]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[singleton methods]]></category>
		<category><![CDATA[smalltalk]]></category>

		<guid isPermaLink="false">http://transfixedbutnotdead.com/?p=388</guid>
		<description><![CDATA[Randal Schwartz recently posted this bit of Smalltalk code on his Methods and Messages blog p := 4 @ 3. p changeClassTo: (p class copy superclass: p class). p class methodDictionary at: #negated put: (p class methodDictionary at: #transpose). p negated My exposure to Smalltalk is limited to a quick look at Seaside web framework [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=388&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Randal Schwartz recently posted this bit of <a href="http://methodsandmessages.vox.com/library/post/why-i-like-smalltalk-lots-of-reflection.html">Smalltalk code</a> on his <a href="http://methodsandmessages.vox.com/">Methods and Messages blog</a></p>
<p><code>p := 4 @ 3.<br />
p changeClassTo: (p class copy superclass: p class).<br />
p class methodDictionary at: #negated put: (p class methodDictionary at: #transpose).<br />
p negated<br />
</code></p>
<p>My exposure to Smalltalk is limited to a quick look at <a href="http://seaside.st">Seaside web framework</a> which is a bit like learning Rails instead of starting with Ruby <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   </p>
<p>I can just about grok what this code does.  Thankfully <a href="http://talklikeaduck.denhaven2.com">Rick DeNatale</a> provided a nice <a href="http://talklikeaduck.denhaven2.com/2009/05/30/singleton-methods-in-smalltalk-and-ruby">Ruby conversion</a></p>
<p>Here is Rick&#8217;s subset of Smalltalk&#8217;s Point which replicates what the first Smalltalk line &#8220;p := 4 @ 3.&#8221; does:</p>
<p><pre class="brush: ruby;">
class Point
  attr_accessor :X, :y    # :X should be lowercase but Wordpress keeps converting it to a smiley!

  def initialize(x, y)
    @x, @y = x, y
  end

  def negated
    self.class.new(-x, -y)
  end

  def transpose
    self.class.new(y, x)
  end

  def inspect
    &quot;#{@x} @ #{@y}&quot;
  end
end


p = Point.new(4,3)

p.negated          # =&gt; -4 @ -3
p.transpose        # =&gt; 3 @ 4
</pre></p>
<p>So <em>negated</em> &amp; <em>transpose</em> methods return new Point objects so all very straightforward so far.</p>
<p>In the Smalltalk code the object <em>negated</em> method gets amended to use the <em>transpose</em> method instead.<br />
You can do this in Ruby by opening up the objects method like so:</p>
<p><pre class="brush: ruby;">
def p.negated
  transpose
end

p.negated          # =&gt; 3 @ 4
p.transpose        # =&gt; 3 @ 4
</pre></p>
<p>Nice eh!  The Ruby world refer to this has a Singleton Method.  These are methods which are defined in the object and not the class.   </p>
<p><em>I highly recommend watching this <a href="http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SOR.mp4">excellent video talk</a> by Dave Thomas which provides excellent lucidity to how Ruby objects work.</em></p>
<p>Now how about Perl?   I suspect you can use some MOP meta magic to do same but did you know that <a href="http://search.cpan.org/dist/Moose/lib/Moose/Role.pm">Moose Roles</a> can be applied directly to objects?</p>
<p>Here&#8217;s is the Ruby Point code in Perl using classic Moose.<br />
<pre class="brush: perl;">
{
    package Point;
    use Moose;

    has x =&gt; ( isa =&gt; 'Int', is =&gt; 'rw' );
    has y =&gt; ( isa =&gt; 'Int', is =&gt; 'rw' );

    sub negated {
        my $self = shift;
        $self-&gt;new( x =&gt; -$self-&gt;x, y =&gt; -$self-&gt;y );
    }

    sub transpose {
        my $self = shift;
        $self-&gt;new( x =&gt; $self-&gt;y, y =&gt; $self-&gt;x );
    }

    sub inspect { say &quot;$_[0]-&gt;{x} \@ $_[0]-&gt;{y}&quot; }
    
    no Moose;
}


my $p = Point-&gt;new( x =&gt; 4, y =&gt; 3 );

$p-&gt;negated-&gt;inspect;     # =&gt; -4 @ -3
$p-&gt;transpose-&gt;inspect;   # =&gt; 3 @ 4
</pre></p>
<p>So all works same as the Ruby example.   Now if we create a role like so:</p>
<p><pre class="brush: perl;">
{
    package Negated;
    use Moose::Role;
    
    requires 'transpose';
    
    sub negated { 
        my $self = shift;
        $self-&gt;transpose;
    }
    
    no Moose::Role;
}
</pre></p>
<p>You can then &#8220;apply&#8221; it to any object like so:<br />
<pre class="brush: perl;">
Negated-&gt;meta-&gt;apply( $p );
$p-&gt;negated-&gt;inspect;     # =&gt; 3 @ 4
$p-&gt;transpose-&gt;inspect;   # =&gt; 3 @ 4
</pre></p>
<p>Lovely jubbly!   </p>
<p>And as we&#8217;ve gone down this Moose Role route we might as well wrap it all up like this:<br />
<pre class="brush: perl;">
{
    package Point;
    use Moose;

    with qw/DoesNegated DoesTranspose/;
    
    has x =&gt; ( isa =&gt; 'Int', is =&gt; 'rw' );
    has y =&gt; ( isa =&gt; 'Int', is =&gt; 'rw' );

    sub inspect { say &quot;$_[0]-&gt;{x} \@ $_[0]-&gt;{y}&quot; }
    
    no Moose;
}

{
    package DoesNegated;
    use Moose::Role;
        
    sub negated {
        my $self = shift;
        $self-&gt;new( x =&gt; -$self-&gt;x, y =&gt; -$self-&gt;y );
    }
    
    no Moose::Role;
}

{
    package DoesTranspose;
    use Moose::Role;
        
    sub transpose {
        my $self = shift;
        $self-&gt;new( x =&gt; $self-&gt;y, y =&gt; $self-&gt;x );
    }
    
    no Moose::Role;
}

my $p = Point-&gt;new( x =&gt; 4, y =&gt; 3 );

DoesTranspose-&gt;meta-&gt;apply( $p, alias =&gt; { transpose =&gt; 'negated' } );

$p-&gt;negated-&gt;inspect;     # =&gt; 3 @ 4
$p-&gt;transpose-&gt;inspect;   # =&gt; 3 @ 4
</pre></p>
<p>This time I used the &#8220;alias&#8221; option to rename the applied method on the Moose hoof <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>And u can keep applying roles to  objects at your hearts content adding or replacing methods<br />
as many times as u like.</p>
<p>/I3az/</p>
<p>Some references:</p>
<ul>
<li><a href="http://search.cpan.org/dist/Moose/lib/Moose/Cookbook/Roles/Recipe3.pod">Moose Cookbook Roles Recipe 3</a>
<li><a href="http://stackoverflow.com/questions/813266/what-to-do-with-an-object-that-should-no-longer-be-used-in-perl/817666#817666">my Stackoverflow answer about applying roles on objects</a>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/388/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/388/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/388/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=388&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/06/03/using-moose-roles-to-create-singleton-methods/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
<enclosure url="http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SOR.mp4" length="285514197" type="video/mp4" />
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>New Year Resolutions</title>
		<link>http://transfixedbutnotdead.com/2009/01/14/new-year-resolutions/</link>
		<comments>http://transfixedbutnotdead.com/2009/01/14/new-year-resolutions/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:25:13 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=146</guid>
		<description><![CDATA[Actually I&#8217;m not into New Year Resolutions&#8230; so there goes that title However I wanted to revisit and re-emphasise why I&#8217;m blogging Bit of back history&#8230; programming as always been the thing I&#8217;ve enjoyed most however I&#8217;ve often been diverted (far too easily!) by other things (including being an I.T. Manager for some years &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=146&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Actually I&#8217;m not into New Year Resolutions&#8230; so there goes that title <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>However I wanted to revisit and re-emphasise why I&#8217;m <a href="http://draegtun.wordpress.com/2006/08/11/the-big-bang/">blogging</a></p>
<p>Bit of back history&#8230;  programming as always been the thing I&#8217;ve enjoyed most however I&#8217;ve often been diverted (far too easily!) by other things (including being an I.T. Manager for some years &amp; doing an unsuccessful CRM start up with a partner).</p>
<p>When I became a freelance consultant back in 2002 my aim was to get back into the nitty gritty of programming.   However I was still being pulled in other I.T. &amp; Market Research directions.  So when I started this blog back in August 2006 it was like putting a line in the sand.</p>
<p>During all this time Perl was my main programming language of choice. However I did very briefly dabble in Python on couple of projects and also had a short term love affair with Ruby (don&#8217;t we all!).  </p>
<p>In fact more than anything it was this Ruby affair that made me put a line in the sand back in 2006.   Perl was always the bread winner but Ruby showed me that Perl was also fun again like it was when I first picked it up back in 1995.</p>
<p>So my &#8220;New Year Resolution&#8221; is to keep on this track and blog more about what I&#8217;m doing with Perl.  I find the best way to improve and/or learn something new is to do it.  Second best way is to document it (ie. blog).   And the by-product of this is an excellent resource to fall back to especially has my memory isn&#8217;t what it use to be!</p>
<p>I&#8217;ll do my best not to get <a href="http://xkcd.com/386/">distracted</a> while on route <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />    </p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=146&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2009/01/14/new-year-resolutions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Sometimes we forget how lucky we are to have Perl</title>
		<link>http://transfixedbutnotdead.com/2008/12/05/lucky_to_have_perl/</link>
		<comments>http://transfixedbutnotdead.com/2008/12/05/lucky_to_have_perl/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 23:55:28 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=65</guid>
		<description><![CDATA[After a bit of doom &#38; gloom over last few days on use.perl.org at least we can have a warm feeling about things we take for granted in the Perl world&#8230;.  http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/ /I3az/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=65&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After a bit of doom &amp; gloom over last few days on use.perl.org at least we can have a warm feeling about things we take for granted in the Perl world&#8230;.</p>
<p><a title="My RubyGems development tools and workflow" href="http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/"> http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/</a></p>
<p>/I3az/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=65&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/12/05/lucky_to_have_perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Template Toolkit with Squatting</title>
		<link>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/</link>
		<comments>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 12:04:53 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Camping]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Squatting]]></category>
		<category><![CDATA[Template Toolkit]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=45</guid>
		<description><![CDATA[Been playing with Squatting recently. Its a Perl Web microframework inspired by Camping. For someone like me who is still converting some old CGI apps to Catalyst then this looks like an interesting alternative. I use Template Toolkit quite a bit so here&#8217;s a boilerplate for using TT with Squatting&#8230;.. And here are the templates&#8230;. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=45&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Been playing with <a href="http://search.cpan.org/dist/Squatting/">Squatting</a> recently.   Its a Perl Web microframework inspired by <a href="http://code.whytheluckystiff.net/camping">Camping</a>.  For someone like me who is still converting some old CGI apps to Catalyst then this looks like an interesting alternative.</p>
<p>I use Template Toolkit quite a bit so here&#8217;s a boilerplate for using TT with Squatting&#8230;..</p>
<p><pre class="brush: perl;">
use strict;
use warnings;

{
    package App;
    use base 'Squatting';

    BEGIN {
        our %CONFIG = (
            TT =&gt; {
                config   =&gt; { INCLUDE_PATH =&gt; '.' },
                postfix  =&gt; '.tt',
                site_tit =&gt; 'TT loves Squatting!',
            }
        );

    }
}

{
    package App::Controllers;
    use Squatting ':controllers';

    our @C = (

        C(
            Home =&gt; [ '/' ],
            get  =&gt; sub {
                my ( $self )  = @_;
                my $v         = $self-&gt;v;
                $v-&gt;{ tit }   = 'welcome to my homepage';
                $self-&gt;render( 'home' );
            },
        ),
        
        C(
            Page =&gt; [ '/path/to/page' ],
            get  =&gt; sub {
                my ( $self ) = @_;
                my $v        = $self-&gt;v;
                $v-&gt;{ tit  } = 'here is another page!';
                $v-&gt;{ list } = [ 'one', 'two', 'three' ];
                $self-&gt;render( 'page' );
            },
        ),

    );
}

{
    package App::Views;
    use Squatting ':views';
    use Template;

    our @V = (

        V(
            'html',
            tt =&gt; Template-&gt;new( $App::CONFIG{ TT }-&gt;{ config } ),

            layout =&gt; sub {
                my ( $self, $v, $body ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ site_tit } = $App::CONFIG{ TT }-&gt;{ site_tit };
                $v-&gt;{ body     } = $body;
                
                my $output;
                $tt-&gt;process( 'layout'. $App::CONFIG{ TT }-&gt;{ postfix }, $v, \$output)
                    or return view_error( $tt-&gt;error );
                return $output;
            },

            _ =&gt; sub {
                my ( $self, $v ) = @_;
                my $tt = $self-&gt;{ tt };
                $v-&gt;{ R } = \&amp;R;
                
                my $output;
                $tt-&gt;process( $self-&gt;{template} . $App::CONFIG{ TT }-&gt;{ postfix }, $v, \$output) 
                    or return view_error( $tt-&gt;error );
                return $output;
            }

        ),
    );
    
    sub view_error {
        my ( $error ) = shift;
        warn $error;
        return &quot;&lt;pre&gt;&quot; . $error . &quot;&lt;/pre&gt;\n&quot;;   # really need to HTML encode $error here
    }
}

1;
</pre></p>
<p>And here are the templates&#8230;.</p>
<p>layout.tt<br />
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
   &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;

&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
	&lt;title&gt;[% site_tit %]&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
[% body %]
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>home.tt<br />
<pre class="brush: xml;">
&lt;h1&gt;Hello.. [% tit %]&lt;/h1&gt;

&lt;a href=&quot;[% R('Page') %]&quot;&gt;Have a look here&lt;/a&gt;
</pre></p>
<p>page.tt<br />
<pre class="brush: xml;">
&lt;h1&gt;Hello again... [% tit %]&lt;/h1&gt;

&lt;p&gt;$v-&gt;{list}...&lt;/p&gt;

&lt;ul&gt;
    [% FOREACH item IN list %]
    &lt;li&gt;[% item %]&lt;/li&gt;
    [% END %]
&lt;/ul&gt;

&lt;a href=&quot;[% R('Home') %]&quot;&gt;back to home&lt;/a&gt;
</pre></p>
<p>Stash variables in Squatting (ie. variables that can used between controller &amp; the view/template) can be set/get by $self-&gt;v<br />
<em>NB. &#8220;v&#8221; is for variables and shouldn&#8217;t be confused in anyway with &#8220;view&#8221; ;-(</em></p>
<p>Using &#8220;layout[.tt]&#8221; method/template is optional in Squatting (and Camping) so u can drop this and it will just render the view/template only.  The code uses &#8220;layout&#8221; thus home.tt &amp; page.tt renders as [% body %] via layout.tt</p>
<p>R() returns the route used by the specified controller ( for eg. R(&#8216;Page&#8217;) returns &#8220;/path/to/page&#8221; ).  This is quite a handy subroutine to export to TT templates!</p>
<p>So see it working just name above program &#8220;App.pm&#8221; and put in same directory as the template files and just do <code>squatting App</code> and then point your browser to http://localhost:4234/</p>
<p>Hopefully more on Squatting soon.  So if u fancy a bit of fun web programming then give Squatting a go!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=45&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/10/21/using-template-toolkit-with-squatting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
		<item>
		<title>Doodling with Moose (intermission)</title>
		<link>http://transfixedbutnotdead.com/2008/03/14/doodling-with-moose-intermission/</link>
		<comments>http://transfixedbutnotdead.com/2008/03/14/doodling-with-moose-intermission/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 10:40:31 +0000</pubDate>
		<dc:creator>draegtun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[moose]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://draegtun.wordpress.com/?p=25</guid>
		<description><![CDATA[Gosh&#8230; don&#8217;t recall WordPress munging up my code before (when using &#60;pre&#62; or &#60;code&#62;)? As soon has I tried to edit the content online it got garbled up and became messy. So as long has u don&#8217;t edit it then its fine. It&#8217;s probably why I normally do the content offline and then post it! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=25&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Gosh&#8230;  don&#8217;t recall WordPress munging up my code before (when using &lt;pre&gt; or &lt;code&gt;)?   As soon has I tried to edit the content online it got garbled up and became messy.   So as long has u don&#8217;t edit it then its fine.  It&#8217;s probably why I normally do the content offline and then post it!  (however I&#8217;ve had problems with that also&#8230; thats for another post!)</p>
<p>Anyway I wanted tart up the code and noticed that WordPress blogs comes with syntaxhighlighter Goodle Code project&#8230;.</p>
<p><a href="http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/">http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/</a></p>
<p>Certainly looked good but didn&#8217;t come with a Perl option ;-(   (big oversight&#8230;  and it appears someone as posted the necessary &#8220;data&#8221; to the project but code simply hasn&#8217;t been included!)</p>
<p>Anyway I used Ruby as syntax language for the Perl code and it works pretty well (no surprises!).   However it didn&#8217;t format long lines correctly so had to manually put in some newlines/tabs into the code to make it look good (hence extra lines).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/draegtun.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/draegtun.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/draegtun.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/draegtun.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/draegtun.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=transfixedbutnotdead.com&amp;blog=351142&amp;post=25&amp;subd=draegtun&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://transfixedbutnotdead.com/2008/03/14/doodling-with-moose-intermission/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/29cb106071d163d703484e63839d89cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">draegtun</media:title>
		</media:content>
	</item>
	</channel>
</rss>
