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

<channel>
	<title>Seven steps</title>
	<atom:link href="http://trevoke.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevoke.net/blog</link>
	<description>Martial arts and technology, $DEITY what a mix!</description>
	<lastBuildDate>Thu, 11 Mar 2010 14:42:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Teaching kusanku to sankyu</title>
		<link>http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/</link>
		<comments>http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 14:42:42 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[Martial Arts]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[isshinryu]]></category>
		<category><![CDATA[kusanku]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=222</guid>
		<description><![CDATA[Last night, after some kicking drills and sparring, sensei entrusted the adult class to me and told us to work on kusanku. The &#8216;adult class&#8217; yesterday consisted of three sankyu.
I looked at the clock, rubbed my hands together and said &#8220;Alright everyone, we have twenty-five minutes&#8217; worth of kusanku. Let me know if you have [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, after some kicking drills and sparring, sensei entrusted the adult class to me and told us to work on kusanku. The &#8216;adult class&#8217; yesterday consisted of three sankyu.<br />
I looked at the clock, rubbed my hands together and said &#8220;Alright everyone, we have twenty-five minutes&#8217; worth of kusanku. Let me know if you have questions or doubts.&#8221;<br />
When we had finished walking through it, I looked at the clock. I&#8217;d spent twenty minutes on the form, and they all looked happy. I don&#8217;t think I really stood still for more than a few seconds at a time during those twenty minutes.<br />
It reminded me of the first time I led the adult class, and I spent twenty-five minutes on seisan kata. I distinctly remember that it did not go quite as smoothly. It is usually hard to convince ranks under shodan that seisan is a very important, subtle kata, full of knowledge to be examined <img src='http://trevoke.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  It&#8217;s a realization they must come to by themselves.</p>
<p>My favorite moment of those twenty minutes (besides the part where they all had a big smile, at the end), was one of the signature kusanku moves (koza dachi, right hand shuto to the throat, left hand behind your head like in seiuchin). I knelt by each one, adjusted the position of their rear foot with my hands, then stood up and watched their faces light up as the lesson sank in &#8211; in the proper stance, the legs and hips are looser, and thus the hips can turn more and still be more comfortable!</p>
<p>I _like_ teaching.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/&amp;title=Teaching+kusanku+to+sankyu" title="Add 'Teaching kusanku to sankyu' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Teaching kusanku to sankyu' to digg" alt="Add 'Teaching kusanku to sankyu' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/&amp;title=Teaching+kusanku+to+sankyu" title="Add 'Teaching kusanku to sankyu' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Teaching kusanku to sankyu' to reddit" alt="Add 'Teaching kusanku to sankyu' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/" title="Add 'Teaching kusanku to sankyu' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Teaching kusanku to sankyu' to Technorati" alt="Add 'Teaching kusanku to sankyu' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/&amp;h=Teaching+kusanku+to+sankyu" title="Add 'Teaching kusanku to sankyu' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Teaching kusanku to sankyu' to Newsvine" alt="Add 'Teaching kusanku to sankyu' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/&amp;title=Teaching+kusanku+to+sankyu" title="Add 'Teaching kusanku to sankyu' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Teaching kusanku to sankyu' to Stumble Upon" alt="Add 'Teaching kusanku to sankyu' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Teaching+kusanku+to+sankyu&amp;url=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/" title="Add 'Teaching kusanku to sankyu' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Teaching kusanku to sankyu' to SlashDot" alt="Add 'Teaching kusanku to sankyu' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/&amp;t=Teaching+kusanku+to+sankyu" title="Add 'Teaching kusanku to sankyu' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Teaching kusanku to sankyu' to FaceBook" alt="Add 'Teaching kusanku to sankyu' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Teaching+kusanku+to+sankyu&amp;c=http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/" title="Add 'Teaching kusanku to sankyu' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Teaching kusanku to sankyu' to MySpace" alt="Add 'Teaching kusanku to sankyu' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2010/03/11/teaching-kusanku-to-sankyu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo on a Dell Inspiron Mini 10</title>
		<link>http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/</link>
		<comments>http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:06:11 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[inspiron]]></category>
		<category><![CDATA[mini]]></category>
		<category><![CDATA[poulsbo]]></category>
		<category><![CDATA[psb]]></category>
		<category><![CDATA[ssd]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=215</guid>
		<description><![CDATA[There are a few gotchas:
1) If you have a SSD drive, you need to modprobe pata_sch to see it.
2) when using GRUB, install it on whatever drive the hard drive is, even if it&#8217;s /dev/sdc &#8212; and let your FSTAB use /dev/sda. Chances are that /dev/sda is your liveUSB.
3) In the kernel, in the I2C [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few gotchas:<br />
1) If you have a SSD drive, you need to <em>modprobe pata_sch</em> to see it.<br />
2) when using GRUB, install it on whatever drive the hard drive is, even if it&#8217;s /dev/sdc &#8212; and let your FSTAB use /dev/sda. Chances are that /dev/sda is your liveUSB.<br />
3) In the kernel, in the I2C options, don&#8217;t let it pick automatically &#8211; instead, select the algorithm options in the menu that appears (I don&#8217;t know it off-hand, will edit this post later to add the important information). This will allow you to install the kernel driver for the poulsbo card (kmod-psb, I believe).</p>
<p>For the rest, so far, it seems that the howto on the Gentoo wiki is good. I installed e17 very painlessly.</p>
<p>Wireless was a bit trickier.<br />
I needed to use gentoo-sources-2.6.33, which at the time of this writing was masked as ~x86. A big advantage though is that it has support for the Atom processor (and the proper driver for the broadcom card!).<br />
Enable the &#8220;B43&#8243; driver in the kernel.<br />
Then, follow the instructions given 
<a  href="http://linuxwireless.org/en/users/Drivers/b43#fw-b43-lp" onclick="javascript:pageTracker._trackPageview('/external/linuxwireless.org/en/users/Drivers/b43?fw-b43-lp');" >here</a>:</p>
<blockquote><p>git clone http://git.bu3sch.de/git/b43-tools.git<br />
cd b43-tools/fwcutter<br />
make<br />
cd ..
</p></blockquote>
<p>Use version 4.174.64.19 of Broadcom&#8217;s proprietary driver. (The tarball is mislabeled as &#8220;4.178.10.4&#8243;, but it is actually 4.174.64.19.)<br />
Download and extract the firmware from this driver tarball (Gentoo&#8217;s installation directory for this is /lib/firmware):</p>
<blockquote><p>export FIRMWARE_INSTALL_DIR=&#8221;/lib/firmware&#8221;<br />
wget http://downloads.openwrt.org/sources/broadcom-wl-4.178.10.4.tar.bz2<br />
tar xjf broadcom-wl-4.178.10.4.tar.bz2<br />
cd broadcom-wl-4.178.10.4/linux<br />
sudo ../../fwcutter/b43-fwcutter -w &#8220;$FIRMWARE_INSTALL_DIR&#8221; wl_apsta.o
</p></blockquote>
<p>At the time of this writing, although the b43-firmware is available and promises to give us what we need, the b43-fwcutter tool is only at version 12, and not 13, so it can&#8217;t be used. This is why we need to use <em>git</em> to download the latest version and correctly build the firmware by hand.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/&amp;title=Gentoo+on+a+Dell+Inspiron+Mini+10" title="Add 'Gentoo on a Dell Inspiron Mini 10' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to digg" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/&amp;title=Gentoo+on+a+Dell+Inspiron+Mini+10" title="Add 'Gentoo on a Dell Inspiron Mini 10' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to reddit" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Technorati" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/&amp;h=Gentoo+on+a+Dell+Inspiron+Mini+10" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Newsvine" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/&amp;title=Gentoo+on+a+Dell+Inspiron+Mini+10" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to Stumble Upon" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Gentoo+on+a+Dell+Inspiron+Mini+10&amp;url=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/" title="Add 'Gentoo on a Dell Inspiron Mini 10' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to SlashDot" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/&amp;t=Gentoo+on+a+Dell+Inspiron+Mini+10" title="Add 'Gentoo on a Dell Inspiron Mini 10' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to FaceBook" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Gentoo+on+a+Dell+Inspiron+Mini+10&amp;c=http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/" title="Add 'Gentoo on a Dell Inspiron Mini 10' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Gentoo on a Dell Inspiron Mini 10' to MySpace" alt="Add 'Gentoo on a Dell Inspiron Mini 10' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2010/03/01/gentoo-on-a-dell-inspiron-mini-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Country alert levels #funny</title>
		<link>http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/</link>
		<comments>http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 17:39:25 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[country alert levels]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=211</guid>
		<description><![CDATA[Let&#8217;s break the monotony with something funny:
The English are feeling the pinch in relation to recent terrorist threats? and have raised their security level from &#8220;Miffed&#8221; to &#8220;Peeved.&#8221; Soon, ?though, security levels may be raised yet again to &#8220;Irritated&#8221; or even &#8220;A? Bit Cross.&#8221; The English have not been &#8220;A Bit Cross&#8221; since the blitz [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s break the monotony with something funny:</p>
<p>The English are feeling the pinch in relation to recent terrorist threats? and have raised their security level from &#8220;Miffed&#8221; to &#8220;Peeved.&#8221; Soon, ?though, security levels may be raised yet again to &#8220;Irritated&#8221; or even &#8220;A? Bit Cross.&#8221; The English have not been &#8220;A Bit Cross&#8221; since the blitz in 1940 ?when tea supplies all but ran out.</p>
<p>Terrorists have been re-categorized from ?&#8221;Tiresome&#8221; to a &#8220;Bloody Nuisance.&#8221; The last time the British issued a? &#8220;Bloody Nuisance&#8221; warning level was in 1588 when threatened by the Spanish Armada.??</p>
<p>The Scots raised their threat level from &#8220;Pissed Off&#8221; to &#8220;Let&#8217;s get the? Bastards&#8221; They don&#8217;t have any other levels. This is the reason they have? been used on the front line of the British army for the last 300 years.</p>
<p>??The French government announced yesterday that it has raised its terror ?alert level from &#8220;Run&#8221; to &#8220;Hide&#8221;. The only two higher levels in France are? &#8220;Collaborate&#8221; and &#8220;Surrender.&#8221; The rise was precipitated by a recent fire?that destroyed France&#8217;s white flag factory, effectively paralyzing the ?country&#8217;s military capability.</p>
<p>It&#8217;s not only the French who are on a? heightened level of alert.<br />
Italy has increased the alert level from &#8220;Shout ?loudly and excitedly&#8221; to &#8220;Elaborate Military Posturing.&#8221; Two more levels ?remain: &#8220;Ineffective Combat Operations&#8221; and &#8220;Change Sides.&#8221;?</p>
<p>?The Germans also increased their alert state from &#8220;Disdainful Arrogance&#8221; to?&#8221;Dress in Uniform and Sing Marching Songs.&#8221; They also have two higher? levels: &#8220;Invade a Neighbour&#8221; and &#8220;Lose&#8221;.?</p>
<p>?Belgians, on the other hand, are all on holiday as usual, and the only ?threat they are worried about is NATO pulling out of Brussels.</p>
<p>??The Spanish are all excited to see their new submarines ready to deploy. ?These beautifully designed subs have glass bottoms so the new Spanish navy ?can get a really good look at the old Spanish navy.??</p>
<p>Americans meanwhile and as usual are carrying out pre-emptive strikes, on?all of their allies, just in case.?</p>
<p>?And in the southern hemisphere&#8230;</p>
<p>??New Zealand has also raised its security levels &#8211; from &#8220;baaa&#8221; to &#8220;BAAAA!&#8221;. ?Due to continuing defense cutbacks (the airforce being a squadron of spotty ?teenagers flying paper aeroplanes and the navy some toy boats in the Prime?Minister&#8217;s bath), New Zealand only has one more level of escalation, which? is &#8220;I hope Australia will come and rescue us&#8221;.??</p>
<p>Australia , meanwhile, has raised its security level from &#8220;No worries&#8221; to?&#8221;She&#8217;ll be right, mate&#8221;. Three more escalation levels remain: &#8220;Crikey!&#8217;, &#8220;I ?think we&#8217;ll need to cancel the barbie this weekend&#8221; and &#8220;The barbie is? cancelled&#8221;. So far no situation has ever warranted use of the final? escalation level.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/&amp;title=Country+alert+levels+%23funny" title="Add 'Country alert levels #funny' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Country alert levels #funny' to digg" alt="Add 'Country alert levels #funny' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/&amp;title=Country+alert+levels+%23funny" title="Add 'Country alert levels #funny' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Country alert levels #funny' to reddit" alt="Add 'Country alert levels #funny' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/" title="Add 'Country alert levels #funny' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Country alert levels #funny' to Technorati" alt="Add 'Country alert levels #funny' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/&amp;h=Country+alert+levels+%23funny" title="Add 'Country alert levels #funny' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Country alert levels #funny' to Newsvine" alt="Add 'Country alert levels #funny' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/&amp;title=Country+alert+levels+%23funny" title="Add 'Country alert levels #funny' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Country alert levels #funny' to Stumble Upon" alt="Add 'Country alert levels #funny' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Country+alert+levels+%23funny&amp;url=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/" title="Add 'Country alert levels #funny' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Country alert levels #funny' to SlashDot" alt="Add 'Country alert levels #funny' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/&amp;t=Country+alert+levels+%23funny" title="Add 'Country alert levels #funny' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Country alert levels #funny' to FaceBook" alt="Add 'Country alert levels #funny' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Country+alert+levels+%23funny&amp;c=http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/" title="Add 'Country alert levels #funny' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Country alert levels #funny' to MySpace" alt="Add 'Country alert levels #funny' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2010/01/20/country-alert-levels-funny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New gem: ListBrowser</title>
		<link>http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/</link>
		<comments>http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 00:01:19 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[listbrowser]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=209</guid>
		<description><![CDATA[~~~~ ListBrowser README ~~~~
I was working on a parser for a very specific tree structure, and was frustrated that there wasn’t a simple way to parse it in irb. &#8220;What??&#8221;, I thought. &#8220;I have to use my brain?! God forbid!&#8221;. So I set to using my brain a little more to create this tool. It’s [...]]]></description>
			<content:encoded><![CDATA[<p>~~~~ ListBrowser README ~~~~</p>
<p>I was working on a parser for a very specific tree structure, and was frustrated that there wasn’t a simple way to parse it in irb. &#8220;What??&#8221;, I thought. &#8220;I have to use my brain?! God forbid!&#8221;. So I set to using my brain a little more to create this tool. It’s not much, but maybe it’ll make someone’s life a little easier.</p>
<p>Install: (set up gemcutter)<br />
gem install ListBrowser</p>
<p>It can be used in irb, and really should be used there &#8211; when you call it on a tree structure, you’ll get a menu with a list of choices on how you want to go through whatever structure you gave it.</p>
<p>In my particular, special case, I would do something like this:</p>
<p>require ‘sgf_parser’ # For my tree structure require ‘list_browser’ # For this.</p>
<p>tree = SgfParser::Tree.new :filename => &#8220;kogo.sgf&#8221;</p>
<p>ListBrowser.new tree.root, ‘parent’, ‘children’, ‘properties’</p>
<p># And follow the menu!</p>
<p> In my particular case, I would not need to enter those strings, as they<br />
 just happen to be the names I chose for my tree structure, but they should<br />
 serve as a good enough example!</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/&amp;title=New+gem%3A+ListBrowser" title="Add 'New gem: ListBrowser' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'New gem: ListBrowser' to digg" alt="Add 'New gem: ListBrowser' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/&amp;title=New+gem%3A+ListBrowser" title="Add 'New gem: ListBrowser' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'New gem: ListBrowser' to reddit" alt="Add 'New gem: ListBrowser' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/" title="Add 'New gem: ListBrowser' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'New gem: ListBrowser' to Technorati" alt="Add 'New gem: ListBrowser' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/&amp;h=New+gem%3A+ListBrowser" title="Add 'New gem: ListBrowser' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'New gem: ListBrowser' to Newsvine" alt="Add 'New gem: ListBrowser' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/&amp;title=New+gem%3A+ListBrowser" title="Add 'New gem: ListBrowser' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'New gem: ListBrowser' to Stumble Upon" alt="Add 'New gem: ListBrowser' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=New+gem%3A+ListBrowser&amp;url=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/" title="Add 'New gem: ListBrowser' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'New gem: ListBrowser' to SlashDot" alt="Add 'New gem: ListBrowser' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/&amp;t=New+gem%3A+ListBrowser" title="Add 'New gem: ListBrowser' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'New gem: ListBrowser' to FaceBook" alt="Add 'New gem: ListBrowser' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=New+gem%3A+ListBrowser&amp;c=http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/" title="Add 'New gem: ListBrowser' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'New gem: ListBrowser' to MySpace" alt="Add 'New gem: ListBrowser' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2010/01/15/new-gem-listbrowser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby SgfParser now really working!</title>
		<link>http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/</link>
		<comments>http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 18:18:51 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[weiqi]]></category>
		<category><![CDATA[baduk]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[sgf]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=207</guid>
		<description><![CDATA[Thanks @alfmikula, it saves properly and has even been gemified. I will soon push it to gemcutter and maybe put a homesite on Rubyforge, not sure.
It can be found at http://github.com/Trevoke/SGFParser for now, get the code while it&#8217;s hot!  
Send to:
]]></description>
			<content:encoded><![CDATA[<p>Thanks @alfmikula, it saves properly and has even been gemified. I will soon push it to gemcutter and maybe put a homesite on Rubyforge, not sure.<br />
It can be found at http://github.com/Trevoke/SGFParser for now, get the code while it&#8217;s hot! <img src='http://trevoke.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/&amp;title=Ruby+SgfParser+now+really+working%21" title="Add 'Ruby SgfParser now really working!' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Ruby SgfParser now really working!' to digg" alt="Add 'Ruby SgfParser now really working!' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/&amp;title=Ruby+SgfParser+now+really+working%21" title="Add 'Ruby SgfParser now really working!' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Ruby SgfParser now really working!' to reddit" alt="Add 'Ruby SgfParser now really working!' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/" title="Add 'Ruby SgfParser now really working!' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Ruby SgfParser now really working!' to Technorati" alt="Add 'Ruby SgfParser now really working!' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/&amp;h=Ruby+SgfParser+now+really+working%21" title="Add 'Ruby SgfParser now really working!' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Ruby SgfParser now really working!' to Newsvine" alt="Add 'Ruby SgfParser now really working!' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/&amp;title=Ruby+SgfParser+now+really+working%21" title="Add 'Ruby SgfParser now really working!' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Ruby SgfParser now really working!' to Stumble Upon" alt="Add 'Ruby SgfParser now really working!' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Ruby+SgfParser+now+really+working%21&amp;url=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/" title="Add 'Ruby SgfParser now really working!' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Ruby SgfParser now really working!' to SlashDot" alt="Add 'Ruby SgfParser now really working!' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/&amp;t=Ruby+SgfParser+now+really+working%21" title="Add 'Ruby SgfParser now really working!' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Ruby SgfParser now really working!' to FaceBook" alt="Add 'Ruby SgfParser now really working!' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Ruby+SgfParser+now+really+working%21&amp;c=http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/" title="Add 'Ruby SgfParser now really working!' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Ruby SgfParser now really working!' to MySpace" alt="Add 'Ruby SgfParser now really working!' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/31/ruby-sgfparser-now-really-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git : moving a remote branch</title>
		<link>http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/</link>
		<comments>http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 22:08:43 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[move]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=204</guid>
		<description><![CDATA[One can&#8217;t actually move a remote branch, but you can copy a branch and delete a branch, so&#8230;
Copy oldbranch in repo to newbranch.
git push {repo} {oldbranch}:heads/{newbranch}
Ex: git push origin foobranch:barbranch
renames foobranch to barbranch
Remove a remote branch: it’s all about the colon:
git push &#60;remote_repo&#62; :heads/&#60;branch&#62;
Example: git push origin :heads/some-branch removes some-branch from the remote repo (apparently [...]]]></description>
			<content:encoded><![CDATA[<p>One can&#8217;t actually move a remote branch, but you can copy a branch and delete a branch, so&#8230;</p>
<p>Copy oldbranch in repo to newbranch.</p>
<pre class="brush: plain;">git push {repo} {oldbranch}:heads/{newbranch}</pre>
<p>Ex: git push origin foobranch:barbranch<br />
renames foobranch to barbranch</p>
<p>Remove a remote branch: it’s all about the colon:</p>
<pre class="brush: plain;">git push &lt;remote_repo&gt; :heads/&lt;branch&gt;</pre>
<p>Example: git push origin :heads/some-branch removes some-branch from the remote repo (apparently git push origin :some-branch works as well).</p>
<p>This works for removing a tag as well: git push origin :sometag</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/&amp;title=Git+%3A+moving+a+remote+branch" title="Add 'Git : moving a remote branch' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Git : moving a remote branch' to digg" alt="Add 'Git : moving a remote branch' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/&amp;title=Git+%3A+moving+a+remote+branch" title="Add 'Git : moving a remote branch' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Git : moving a remote branch' to reddit" alt="Add 'Git : moving a remote branch' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/" title="Add 'Git : moving a remote branch' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Git : moving a remote branch' to Technorati" alt="Add 'Git : moving a remote branch' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/&amp;h=Git+%3A+moving+a+remote+branch" title="Add 'Git : moving a remote branch' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Git : moving a remote branch' to Newsvine" alt="Add 'Git : moving a remote branch' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/&amp;title=Git+%3A+moving+a+remote+branch" title="Add 'Git : moving a remote branch' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Git : moving a remote branch' to Stumble Upon" alt="Add 'Git : moving a remote branch' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Git+%3A+moving+a+remote+branch&amp;url=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/" title="Add 'Git : moving a remote branch' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Git : moving a remote branch' to SlashDot" alt="Add 'Git : moving a remote branch' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/&amp;t=Git+%3A+moving+a+remote+branch" title="Add 'Git : moving a remote branch' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Git : moving a remote branch' to FaceBook" alt="Add 'Git : moving a remote branch' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Git+%3A+moving+a+remote+branch&amp;c=http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/" title="Add 'Git : moving a remote branch' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Git : moving a remote branch' to MySpace" alt="Add 'Git : moving a remote branch' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/29/git-moving-a-remote-branch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random constrained permutations in Ruby</title>
		<link>http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/</link>
		<comments>http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 18:50:20 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[permutations]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=199</guid>
		<description><![CDATA[Look, Ma, these are my baby steps in algorithms!
# list is the elements to be permuted
# y is the number of results desired
# z is the number of elements per result
# equalizer keeps track of who got used how many times
def constrained_permutations list, y, z
  list.uniq! # Never trust the user. We want no [...]]]></description>
			<content:encoded><![CDATA[<p>Look, Ma, these are my baby steps in algorithms!</p>
<pre class="brush: ruby;"># list is the elements to be permuted
# y is the number of results desired
# z is the number of elements per result
# equalizer keeps track of who got used how many times
def constrained_permutations list, y, z
  list.uniq! # Never trust the user. We want no repetitions.
  equalizer = {}
  list.each { |element| equalizer[element] = 0 }

  results = []
  # Do this until we get as many results as desired
  while results.size &lt; y
    pool = []
    puts pool
    least_used = equalizer.each_value.min
    # Find how used the least used element was
    while pool.size &lt; z
      # Do this until we have enough elements in this resultset
      element = nil
      while element.nil?
        # If we run out of &quot;least used elements&quot;, then we need to increment
        # our definition of &quot;least used&quot; by 1 and keep going.
        element = list.shuffle.find do |x|
          !pool.include?(x) &amp;&amp; equalizer[x] == least_used
        end
        least_used += 1 if element.nil?
      end
      equalizer[element] += 1
      # This element has now been used one more time.
      pool &lt;&lt; element
    end
    results &lt;&lt; pool
  end
  return results
end

constrained_permutations [0,1,2,3,4,5,6], 6, 2
=&gt; [[4, 0], [1, 3], [2, 5], [6, 0], [2, 5], [3, 6]]
constrained_permutations [0,1,2,3,4,5,6], 6, 2
=&gt; [[4, 5], [6, 3], [0, 2], [1, 6], [5, 4], [3, 0]]
</pre>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/&amp;title=Random+constrained+permutations+in+Ruby" title="Add 'Random constrained permutations in Ruby' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Random constrained permutations in Ruby' to digg" alt="Add 'Random constrained permutations in Ruby' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/&amp;title=Random+constrained+permutations+in+Ruby" title="Add 'Random constrained permutations in Ruby' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Random constrained permutations in Ruby' to reddit" alt="Add 'Random constrained permutations in Ruby' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/" title="Add 'Random constrained permutations in Ruby' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Random constrained permutations in Ruby' to Technorati" alt="Add 'Random constrained permutations in Ruby' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/&amp;h=Random+constrained+permutations+in+Ruby" title="Add 'Random constrained permutations in Ruby' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Random constrained permutations in Ruby' to Newsvine" alt="Add 'Random constrained permutations in Ruby' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/&amp;title=Random+constrained+permutations+in+Ruby" title="Add 'Random constrained permutations in Ruby' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Random constrained permutations in Ruby' to Stumble Upon" alt="Add 'Random constrained permutations in Ruby' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Random+constrained+permutations+in+Ruby&amp;url=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/" title="Add 'Random constrained permutations in Ruby' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Random constrained permutations in Ruby' to SlashDot" alt="Add 'Random constrained permutations in Ruby' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/&amp;t=Random+constrained+permutations+in+Ruby" title="Add 'Random constrained permutations in Ruby' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Random constrained permutations in Ruby' to FaceBook" alt="Add 'Random constrained permutations in Ruby' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Random+constrained+permutations+in+Ruby&amp;c=http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/" title="Add 'Random constrained permutations in Ruby' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Random constrained permutations in Ruby' to MySpace" alt="Add 'Random constrained permutations in Ruby' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/17/random-constrained-permutations-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inter-array permutations in Ruby</title>
		<link>http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/</link>
		<comments>http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 17:51:06 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[food for thought]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[permutations]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=193</guid>
		<description><![CDATA[I don&#8217;t really have a better name for this. It&#8217;s also not completely clean, but it works. I had, almost a year ago (362 days ago), written a blog post about 
lexicographic permutations. That was about permutations of elements within one array.
Someone on ruby-forum asked about permutations between multiple arrays. I 
found something in C#, [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t really have a better name for this. It&#8217;s also not completely clean, but it works. I had, almost a year ago (362 days ago), written a blog post about 
<a  href="http://trevoke.net/blog/2008/12/20/lexicographic-permutations-in-ruby" onclick="javascript:pageTracker._trackPageview('/external/trevoke.net/blog/2008/12/20/lexicographic-permutations-in-ruby');" >lexicographic permutations</a>. That was about permutations of elements within one array.<br />
Someone on ruby-forum asked about permutations between multiple arrays. I 
<a  href="http://stackoverflow.com/questions/710670/c-permutation-of-an-array-of-arraylists" onclick="javascript:pageTracker._trackPageview('/external/stackoverflow.com/questions/710670/c-permutation-of-an-array-of-arraylists');" >found something in C#</a>, which I was happy to transcribe to Ruby and tweak a little.</p>
<pre class="brush: ruby;">def array_permutations array, index=0
  # index is 0 by default : start at the beginning, more elegant.
  return array[-1] if index == array.size - 1 # Return last element if at end.
  result = []
  array[index].each do |element| # For each array
    array_permutations(array, index + 1).each do |x| # Permute permute permute
      result &lt;&lt; &quot;#{element}, #{x}&quot;
    end
  end
  return result
end</pre>
<p>So, we get this:</p>
<pre class="brush: ruby;">first = ['one', 'two']
second = ['three', 'four']
third = 'five', 'six']
result = array_permutations [first, second, third]
=&gt; [&quot;one, three, five&quot;, &quot;one, three, six&quot;, &quot;one, four, five&quot;, &quot;one, four, six&quot;, &quot;two, three, five&quot;, &quot;two, thre
e, six&quot;, &quot;two, four, five&quot;, &quot;two, four, six&quot;]</pre>
<p>Magic!</p>
<p>&#8212;&#8212;<br />
Edit &#8211; of course, my solution is hackish, and someone came up with a quicker and more elegant solution:</p>
<pre class="brush: ruby;">def fancy_array_permutation array
  return array[0] if array.size == 1
  first = array.shift
  return first.product( fancy_array_permutation(array) ).map {|x| x.flatten.join(&quot; &quot;)}
end</pre>
<p>This gives the same result as above.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/&amp;title=Inter-array+permutations+in+Ruby" title="Add 'Inter-array permutations in Ruby' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Inter-array permutations in Ruby' to digg" alt="Add 'Inter-array permutations in Ruby' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/&amp;title=Inter-array+permutations+in+Ruby" title="Add 'Inter-array permutations in Ruby' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Inter-array permutations in Ruby' to reddit" alt="Add 'Inter-array permutations in Ruby' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/" title="Add 'Inter-array permutations in Ruby' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Inter-array permutations in Ruby' to Technorati" alt="Add 'Inter-array permutations in Ruby' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/&amp;h=Inter-array+permutations+in+Ruby" title="Add 'Inter-array permutations in Ruby' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Inter-array permutations in Ruby' to Newsvine" alt="Add 'Inter-array permutations in Ruby' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/&amp;title=Inter-array+permutations+in+Ruby" title="Add 'Inter-array permutations in Ruby' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Inter-array permutations in Ruby' to Stumble Upon" alt="Add 'Inter-array permutations in Ruby' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Inter-array+permutations+in+Ruby&amp;url=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/" title="Add 'Inter-array permutations in Ruby' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Inter-array permutations in Ruby' to SlashDot" alt="Add 'Inter-array permutations in Ruby' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/&amp;t=Inter-array+permutations+in+Ruby" title="Add 'Inter-array permutations in Ruby' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Inter-array permutations in Ruby' to FaceBook" alt="Add 'Inter-array permutations in Ruby' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Inter-array+permutations+in+Ruby&amp;c=http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/" title="Add 'Inter-array permutations in Ruby' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Inter-array permutations in Ruby' to MySpace" alt="Add 'Inter-array permutations in Ruby' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/17/inter-array-permutations-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open source is wide open: Calling RAKE tasks</title>
		<link>http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/</link>
		<comments>http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 19:38:25 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=189</guid>
		<description><![CDATA[
Open source is wide open: Calling RAKE tasks.
Good to know.
Send to:
]]></description>
			<content:encoded><![CDATA[<p>
<a  href="http://railsblogger.blogspot.com/2009/03/in-queue_15.html" onclick="javascript:pageTracker._trackPageview('/external/railsblogger.blogspot.com/2009/03/in-queue_15.html');" >Open source is wide open: Calling RAKE tasks</a>.</p>
<p>Good to know.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/&amp;title=Open+source+is+wide+open%3A+Calling+RAKE+tasks" title="Add 'Open source is wide open: Calling RAKE tasks' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'Open source is wide open: Calling RAKE tasks' to digg" alt="Add 'Open source is wide open: Calling RAKE tasks' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/&amp;title=Open+source+is+wide+open%3A+Calling+RAKE+tasks" title="Add 'Open source is wide open: Calling RAKE tasks' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'Open source is wide open: Calling RAKE tasks' to reddit" alt="Add 'Open source is wide open: Calling RAKE tasks' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/" title="Add 'Open source is wide open: Calling RAKE tasks' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'Open source is wide open: Calling RAKE tasks' to Technorati" alt="Add 'Open source is wide open: Calling RAKE tasks' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/&amp;h=Open+source+is+wide+open%3A+Calling+RAKE+tasks" title="Add 'Open source is wide open: Calling RAKE tasks' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'Open source is wide open: Calling RAKE tasks' to Newsvine" alt="Add 'Open source is wide open: Calling RAKE tasks' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/&amp;title=Open+source+is+wide+open%3A+Calling+RAKE+tasks" title="Add 'Open source is wide open: Calling RAKE tasks' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'Open source is wide open: Calling RAKE tasks' to Stumble Upon" alt="Add 'Open source is wide open: Calling RAKE tasks' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=Open+source+is+wide+open%3A+Calling+RAKE+tasks&amp;url=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/" title="Add 'Open source is wide open: Calling RAKE tasks' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'Open source is wide open: Calling RAKE tasks' to SlashDot" alt="Add 'Open source is wide open: Calling RAKE tasks' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/&amp;t=Open+source+is+wide+open%3A+Calling+RAKE+tasks" title="Add 'Open source is wide open: Calling RAKE tasks' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'Open source is wide open: Calling RAKE tasks' to FaceBook" alt="Add 'Open source is wide open: Calling RAKE tasks' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=Open+source+is+wide+open%3A+Calling+RAKE+tasks&amp;c=http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/" title="Add 'Open source is wide open: Calling RAKE tasks' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'Open source is wide open: Calling RAKE tasks' to MySpace" alt="Add 'Open source is wide open: Calling RAKE tasks' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/15/open-source-is-wide-open-calling-rake-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On re-reading old code</title>
		<link>http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/</link>
		<comments>http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 17:07:51 +0000</pubDate>
		<dc:creator>Trevoke</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://trevoke.net/blog/?p=185</guid>
		<description><![CDATA[I came across this beauty:
def same_modality? list
  check = list[0][0]
  list.each do &#124;i&#124;
    return false if check != i[0]
  end
  return true
end
This was &#8220;necessary&#8221; because I got an array of one-element arrays back, and I wanted to check whether or not that one element was the same across [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this beauty:</p>
<pre class="brush: ruby;">def same_modality? list
  check = list[0][0]
  list.each do |i|
    return false if check != i[0]
  end
  return true
end</pre>
<p>This was &#8220;necessary&#8221; because I got an array of one-element arrays back, and I wanted to check whether or not that one element was the same across the array.</p>
<p>Three seconds of thinking made me realize that just maybe, I could do this:</p>
<pre class="brush: ruby;">list.uniq.size == 1</pre>
<p>I -like- Ruby.</p>
<!-- Social Bookmarking Reloaded BEGIN --><div class="social_bookmark"><em>Send to:</em><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/&amp;title=On+re-reading+old+code" title="Add 'On re-reading old code' to digg"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/digg.png" title="Add 'On re-reading old code' to digg" alt="Add 'On re-reading old code' to digg" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/&amp;title=On+re-reading+old+code" title="Add 'On re-reading old code' to reddit"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/reddit.png" title="Add 'On re-reading old code' to reddit" alt="Add 'On re-reading old code' to reddit" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/" title="Add 'On re-reading old code' to Technorati"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/technorati.png" title="Add 'On re-reading old code' to Technorati" alt="Add 'On re-reading old code' to Technorati" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.newsvine.com/_wine/save?u=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/&amp;h=On+re-reading+old+code" title="Add 'On re-reading old code' to Newsvine"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/newsvine.png" title="Add 'On re-reading old code' to Newsvine" alt="Add 'On re-reading old code' to Newsvine" /></a><br /><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/&amp;title=On+re-reading+old+code" title="Add 'On re-reading old code' to Stumble Upon"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/stumbleupon.png" title="Add 'On re-reading old code' to Stumble Upon" alt="Add 'On re-reading old code' to Stumble Upon" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?title=On+re-reading+old+code&amp;url=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/" title="Add 'On re-reading old code' to SlashDot"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/slashdot.png" title="Add 'On re-reading old code' to SlashDot" alt="Add 'On re-reading old code' to SlashDot" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/share.php?u=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/&amp;t=On+re-reading+old+code" title="Add 'On re-reading old code' to FaceBook"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/facebook.png" title="Add 'On re-reading old code' to FaceBook" alt="Add 'On re-reading old code' to FaceBook" /></a><a class="social_img" onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,border=0,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.myspace.com/Modules/PostTo/Pages/?t=On+re-reading+old+code&amp;c=http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/" title="Add 'On re-reading old code' to MySpace"><img src="http://trevoke.net/blog/wp-content/plugins/social-bookmarking-reloaded/myspace.png" title="Add 'On re-reading old code' to MySpace" alt="Add 'On re-reading old code' to MySpace" /></a></div>
<!-- Social Bookmarking Reloaded END -->]]></content:encoded>
			<wfw:commentRss>http://trevoke.net/blog/2009/12/09/on-re-reading-old-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
