<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ruby Blender</title>
	
	<link>http://blender.matthewkwilliams.com</link>
	<description />
	<lastBuildDate>Tue, 01 Sep 2009 19:42:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RubyBlender" /><feedburner:info uri="rubyblender" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Default values for Attributes</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/akK49aQbXrM/</link>
		<comments>http://blender.matthewkwilliams.com/2009/09/01/default-values-for-attributes/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:42:00 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[metaprogramming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=82</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
This is the first in a series of entries which I&#8217;m pulling over articles from an old blog, revising, etc&#8230; The Problem One of the neat things about Ruby is it&#8217;s ability to create accessor methods for you, by simply declaring attr_reader, attr_writer, or attr_accessor.&#160; However, there&#8217;s not an easy way to define a default [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>This is the first in a series of entries which I&#8217;m pulling over articles from an old blog, revising, etc&#8230;</p>
<h3>The Problem</h3>
<p>One of the neat things about <a class="zem_slink" title="Ruby (programming language)" rel="homepage" href="http://www.ruby-lang.org/">Ruby</a> is it&#8217;s ability to create accessor methods for you, by simply declaring <code>attr_reader</code>, <code>attr_writer</code>, or <code>attr_accessor</code>.&nbsp; However, there&#8217;s not an easy way to define a default value for an attribute.&nbsp;&nbsp;The original version of this code was based off of <a href="http://www.railsonwave.com/2008/4/15/create-getter-and-setter-on-a-valorized-variable/">Create getter and setter on a valorized variable</a> and ideas from Ruby Quiz #67: <a href="http://www.rubyquiz.com/quiz67.html">Metakoans</a>.&nbsp; The main difference between it and  Sandro Paganotti&#8217;s version is that you can pass in a block which will be evaluated each time it is invoked (in case the value might depend on something else).&nbsp; Additionally, it will work with <a class="zem_slink" title="Boolean datatype" rel="wikipedia" href="http://en.wikipedia.org/wiki/Boolean_datatype">boolean</a> types.</p>
<h3>The Solution</h3>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Object</li><li>&nbsp;&nbsp;def self.attribute<span class="br0">&#40;</span>*arg,&amp;block<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>name, default<span class="br0">&#41;</span> = arg</li><li>&nbsp;&nbsp;&nbsp;&nbsp;short_name = name.to_s.sub<span class="br0">&#40;</span>/\?/,&quot;&quot;<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;self.send<span class="br0">&#40;</span>:define_method, name<span class="br0">&#41;</span> <span class="br0">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if instance_variables.include? &quot;@#<span class="br0">&#123;</span>short_name<span class="br0">&#125;</span>&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.instance_eval &quot;@#<span class="br0">&#123;</span>short_name<span class="br0">&#125;</span>&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if block_given?</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;instance_eval &amp;block</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;self.send<span class="br0">&#40;</span>:define_method, &quot;#<span class="br0">&#123;</span>short_name<span class="br0">&#125;</span>=&quot;<span class="br0">&#41;</span><span class="br0">&#123;</span> |value|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.instance_eval &quot;@#<span class="br0">&#123;</span>short_name<span class="br0">&#125;</span> = value&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#125;</span></li><li>&nbsp;&nbsp;end</li><li>end</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>In order to use it, you could do something like this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Foo</li><li>&nbsp;&nbsp;attribute :bar</li><li>&nbsp;&nbsp;attribute<span class="br0">&#40;</span>:fud<span class="br0">&#41;</span> <span class="br0">&#123;</span>instance_variables.include?<span class="br0">&#40;</span>&quot;@bar&quot;<span class="br0">&#41;</span> ? @bar : ' '<span class="br0">&#125;</span></li><li>&nbsp;&nbsp;attribute :fi, <span style="">10</span></li><li>&nbsp;&nbsp;attribute :flag?, true</li><li>end</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>And, in action, it would look like this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>&gt;&gt; f=Foo.new</li><li>=&gt; #&lt;Foo:0x2ad8c6af7728&gt;</li><li>&gt;&gt; f.bar # defined, but not set to anything <span class="br0">&#40;</span>nil<span class="br0">&#41;</span></li><li>=&gt; nil</li><li>&gt;&gt; f.fud # since bar is not defined, return an empty space</li><li>=&gt; &quot; &quot;</li><li>&gt;&gt; f.fi # just return the default</li><li>=&gt; <span style="">10</span></li><li>&gt;&gt; f.flag? # and here's a boolean</li><li>=&gt; true</li><li>&gt;&gt; f.bar = <span style="">5</span> # now we set bar</li><li>=&gt; <span style="">5</span></li><li>&gt;&gt; f.fud # Since bar is set, then fud will return its value</li><li>=&gt; <span style="">5</span></li><li>&gt;&gt; f.fud = <span style="">20</span> # now we explicitly set fud, and the block is no longer used</li><li>=&gt; <span style="">20</span></li><li>&gt;&gt; f.fud # fud returns <span style="">20</span> as expected</li><li>=&gt; <span style="">20</span></li><li>&gt;&gt; f.bar # and, as expected, changing fud has no effect on bar</li><li>=&gt; <span style="">5</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>There might be a better way to do this; but one of the things I love about Ruby is that you can add new features to the language very easily.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=d92dc226-b9b3-47d9-9981-7eeb4013d521" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/akK49aQbXrM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/09/01/default-values-for-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/09/01/default-values-for-attributes/</feedburner:origLink></item>
		<item>
		<title>Arguments with Trollop</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/hRyKxsuAbrI/</link>
		<comments>http://blender.matthewkwilliams.com/2009/08/21/arguments-with-trollop/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 15:11:31 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[Command-line interface]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=78</guid>
		<description><![CDATA[Command line arguments can be a hassle to parse.  Trollop makes them easier.]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>At various points in my life, I&#8217;ve used many methods of parsing command line options, from rolling my own, to using getopt or other libraries.&nbsp; Recently I came across a new one which has its own view of how to parse commandline arguments.</p>
<p><a href="http://trollop.rubyforge.org/">Trollop</a> is, as they put it, &#8220;Yet Another Fine CommandLine Argument Parsing Library&#8221; (YAFCLAP).&nbsp; It&#8217;s goal is to be as easy as possible.&nbsp; You can install it as a single file in <code>lib</code>, or use it as a gem.&nbsp; Trollop doesn&#8217;t care.&nbsp; To install, you can download it from rubyforge, or use the ever popular:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>gem install trollop</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>(you may need to prepend <code>sudo</code>, or run it as root).</p>
<p>Let&#8217;s take a look at a simple example:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>require '&lt;a class=&quot;zem_slink&quot; title=&quot;RubyGems&quot; rel=&quot;homepage&quot; href=&quot;http://docs.rubygems.org&quot;&gt;rubygems&lt;/a&gt;'</li><li>require 'trollop'</li><li>opts = Trollop::options do</li><li>&nbsp;&nbsp;opt :host, &quot;Host to connect to&quot;, :default =&gt; &quot;localhost&quot;</li><li>&nbsp;&nbsp;opt :port, &quot;jmx remote port&quot;, :default =&gt; <span style="">4444</span></li><li>&nbsp;&nbsp;opt :interval, &quot;How often do we poll <span class="br0">&#40;</span>in seconds<span class="br0">&#41;</span>&quot;, :default =&gt; <span style="">10</span></li><li>&nbsp;&nbsp;opt :count, &quot;How many intervals, <span style="">0</span> == infinite, use ^C <span class="br0">&#40;</span>SIGINT<span class="br0">&#41;</span> to exit and write output&quot;, :default =&gt; <span style="">0</span></li><li>end</li><li>p opts</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>The first argument to opt is the name of the option.&nbsp; We don&#8217;t have to specify a switch; it&#8217;s smart enough to figure out a mapping for them.&nbsp; The second is a description of the argument.&nbsp; You can specify a default value and/or a type.&nbsp; In this example, we&#8217;ve specified defaults.&nbsp; And here it is in use:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>$ ruby trollop_simple.rb</li><li><span class="br0">&#123;</span>:interval=&gt;<span style="">10</span>, :count=&gt;<span style="">0</span>, :help=&gt;false, :host=&gt;&quot;localhost&quot;, :port=&gt;<span style="">4444</span><span class="br0">&#125;</span></li><li>$ ruby trollop_simple.rb -h</li><li>Error: option '-h' needs a parameter.</li><li>Try --help for help.</li><li>$ ruby trollop_simple.rb --help</li><li>Options:</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--host, -h &lt;s&gt;:&nbsp;&nbsp; Host to connect to <span class="br0">&#40;</span>default: localhost<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--port, -p &lt;i&gt;:&nbsp;&nbsp; jmx remote port <span class="br0">&#40;</span>default: <span style="">4444</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;--interval, -i &lt;i&gt;:&nbsp;&nbsp; How often do we poll <span class="br0">&#40;</span>in seconds<span class="br0">&#41;</span> <span class="br0">&#40;</span>default: <span style="">10</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; --count, -c &lt;i&gt;:&nbsp;&nbsp; How many intervals, <span style="">0</span> == infinite, use ^C <span class="br0">&#40;</span>SIGINT<span class="br0">&#41;</span> to</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit and write output <span class="br0">&#40;</span>default: <span style="">0</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--help, -e:&nbsp;&nbsp; Show this message</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Notice that it has set up mappings for us as well as created a nicely formatted help &#8212; though it&#8217;s a default, without a lot of information.&nbsp;&nbsp; Let&#8217;s add a version and usage:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>require 'rubygems'</li><li>require 'trollop'</li><li>opts = Trollop::options do</li><li>&nbsp;&nbsp;version &lt;&lt;EOF</li><li>jmx_mon -- we be jammin' with version zz9-za aka Arthur Dent</li><li>Don't forget your towel!</li><li>EOF</li><li>&nbsp;</li><li>&nbsp;&nbsp;banner &lt;&lt;EOF</li><li>jmx_mon is a program to monitor a jmx bean\'s value over time.</li><li>It can output the data as a csv, a graph in a pdf, or both.</li><li>&nbsp;</li><li>Usage jmx_mon <span class="br0">&#91;</span>options<span class="br0">&#93;</span></li><li>where <span class="br0">&#91;</span>options<span class="br0">&#93;</span> are:</li><li>EOF</li><li>&nbsp;&nbsp;opt :host, &quot;Host to connect to&quot;, :default =&gt; &quot;localhost&quot;</li><li>&nbsp;&nbsp;opt :port, &quot;jmx remote port&quot;, :default =&gt; <span style="">4444</span></li><li>&nbsp;&nbsp;opt :interval, &quot;How often do we poll <span class="br0">&#40;</span>in seconds<span class="br0">&#41;</span>&quot;, :default =&gt; <span style="">10</span></li><li>&nbsp;&nbsp;opt :count, &quot;How many intervals, <span style="">0</span> == infinite, use ^C <span class="br0">&#40;</span>SIGINT<span class="br0">&#41;</span> to exit and write output&quot;, :default =&gt; <span style="">0</span></li><li>end</li><li>p opts</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Now let&#8217;s see what we have:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>$ ruby trollop_simple.rb --help</li><li>jmx_mon is a program to monitor a jmx bean's value over time.</li><li>It can output the data as a csv, a graph in a pdf, or both.</li><li>&nbsp;</li><li>Usage jmx_mon <span class="br0">&#91;</span>options<span class="br0">&#93;</span></li><li>where <span class="br0">&#91;</span>options<span class="br0">&#93;</span> are:</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--host, -h &lt;s&gt;:&nbsp;&nbsp; Host to connect to <span class="br0">&#40;</span>default: localhost<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--port, -p &lt;i&gt;:&nbsp;&nbsp; jmx remote port <span class="br0">&#40;</span>default: <span style="">4444</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;--interval, -i &lt;i&gt;:&nbsp;&nbsp; How often do we poll <span class="br0">&#40;</span>in seconds<span class="br0">&#41;</span> <span class="br0">&#40;</span>default: <span style="">10</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp; --count, -c &lt;i&gt;:&nbsp;&nbsp; How many intervals, <span style="">0</span> == infinite, use ^C <span class="br0">&#40;</span>SIGINT<span class="br0">&#41;</span> to</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit and write output <span class="br0">&#40;</span>default: <span style="">0</span><span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --version, -v:&nbsp;&nbsp; Print version and exit</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--help, -e:&nbsp;&nbsp; Show this message</li><li>&nbsp;</li><li>$ ruby trollop_simple.rb -v</li><li>jmx_mon -- we be jammin' with version zz9-za aka Arthur Dent</li><li>Don't forget your towel!</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>We now have a nicer usage, as well as version.&nbsp; Also, it will stop automagickally if we ask for help or the version.</p>
<p>All of the options are placed in the opts hash; let&#8217;s see what we can do with it:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>require 'rubygems'</li><li>require 'trollop'</li><li>&nbsp;</li><li>aliases = <span class="br0">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:MEMORY_HEAP =&gt; &quot;Heap memory usage, multiple values&quot;,</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:MEMORY_HEAP_USED =&gt; &quot;Used heap memory&quot;</li><li><span class="br0">&#125;</span></li><li>&nbsp;</li><li>opts = Trollop::options do</li><li>&nbsp;&nbsp;version &lt;&lt;EOF</li><li>jmx_mon -- we be jammin' with version zz9-za aka Arthur Dent</li><li>Don't forget your towel!</li><li>EOF</li><li>&nbsp;</li><li>&nbsp;&nbsp;banner &lt;&lt;EOF</li><li>jmx_mon is a program to monitor a jmx bean\'s value over time.</li><li>It can output the data as a csv, a graph in a pdf, or both.</li><li>&nbsp;</li><li>Usage jmx_mon <span class="br0">&#91;</span>options<span class="br0">&#93;</span></li><li>where <span class="br0">&#91;</span>options<span class="br0">&#93;</span> are:</li><li>EOF</li><li>&nbsp;&nbsp;opt :host, &quot;Host to connect to&quot;, :default =&gt; &quot;localhost&quot;</li><li>&nbsp;&nbsp;opt :port, &quot;jmx remote port&quot;, :default =&gt; 4444</li><li>&nbsp;&nbsp;opt :interval, &quot;How often do we poll <span class="br0">&#40;</span>in seconds<span class="br0">&#41;</span>&quot;, :default =&gt; 10</li><li>&nbsp;&nbsp;opt :count, &quot;How many intervals, 0 == infinite, use ^C <span class="br0">&#40;</span>SIGINT<span class="br0">&#41;</span> to exit and write output&quot;, :default =&gt; 0</li><li>&nbsp;&nbsp;opt :aliases, &quot;Print defined bean aliases &amp; exit.&quot;, :default =&gt; false</li><li>&nbsp;&nbsp;opt :towel, &quot;Don't forget this!&quot;, :default =&gt; false</li><li>end</li><li>&nbsp;</li><li>if opts<span class="br0">&#91;</span>:aliases_given<span class="br0">&#93;</span></li><li>&nbsp;&nbsp;aliases.each_pair do |key, value|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;#<span class="br0">&#123;</span>key<span class="br0">&#125;</span>: #<span class="br0">&#123;</span>value<span class="br0">&#125;</span>&quot;</li><li>&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;exit</li><li>end</li><li>&nbsp;</li><li>Trollop::die :towel, &quot;You forgot your towel.&nbsp;&nbsp;You've been eaten by a Ravenous Bugblatter Beast of Traal&quot; unless opts<span class="br0">&#91;</span>:towel<span class="br0">&#93;</span></li><li>&nbsp;</li><li>p opts</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>We&#8217;ve added two more options, one for printing out aliases, and another indicating whether or not you have your towel &#8212; with deadly results should you forget.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>$ ruby trollop_simple.rb -a&nbsp;&nbsp;&nbsp;&nbsp;</li><li>MEMORY_HEAP: Heap memory usage, multiple values</li><li>MEMORY_HEAP_USED: Used heap memory</li><li>&nbsp;</li><li>$ ruby trollop_simple.rb&nbsp;&nbsp; </li><li>Error: argument --towel You forgot your towel.&nbsp;&nbsp;You've been eaten by a Ravenous Bugblatter Beast of Traal.</li><li>Try --help for help.</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>There&#8217;s more that you can do with trollop; the website and documentation gives more examples.&nbsp; However, I&#8217;d suggest considering trollop the next time you need to parse the command line.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=7aad43fc-5a6d-4cd5-a19b-87519b5c2bdc" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/hRyKxsuAbrI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/08/21/arguments-with-trollop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/08/21/arguments-with-trollop/</feedburner:origLink></item>
		<item>
		<title>Database Paranoia — ActiveRecord Callbacks</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/lVr6fILx7ww/</link>
		<comments>http://blender.matthewkwilliams.com/2009/08/20/database-paranoia-activerecord-callbacks/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:27:52 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=75</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
On a particular, nameless, heterogenous project using ruby on rails, ant, and shell scripts, there was an instance where data was not being properly cleaned before going into the database (primarily due to user errors in property files which were used by ant to feed the database).&#160;&#160; As a result, the database was filled with [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>On a particular, nameless, heterogenous project using <a class="zem_slink" title="Ruby on Rails" rel="homepage" href="http://rubyonrails.org/">ruby on rails</a>, ant, and shell scripts, there was an instance where data was not being properly cleaned before going into the database (primarily due to user errors in property files which were used by ant to feed the database).&nbsp;&nbsp; As a result, the database was filled with extraneous spaces which were causing many issues.&nbsp; A perfect illustration of <a class="zem_slink" title="Garbage In, Garbage Out" rel="wikipedia" href="http://en.wikipedia.org/wiki/Garbage_In%2C_Garbage_Out">GIGO</a>.</p>
<p>One problem was that there were multiple databases, each with their own data.&nbsp;&nbsp; By the time the issue was discovered, a fix was needed soonest, so the solution was less than elegant, but it does illustrate the use of callbacks in <a class="zem_slink" title="ActiveRecord (Castle)" rel="wikipedia" href="http://en.wikipedia.org/wiki/ActiveRecord_%28Castle%29">ActiveRecord</a>:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>module DbParanoia</li><li># This is a really stupid thing to have to back-fit; it is making</li><li># sure, however, that the users enter good data.&nbsp;&nbsp;We ensure that</li><li># strings are stripped on read and write.</li><li>&nbsp;</li><li>&nbsp;&nbsp;def trim_space</li><li>&nbsp;&nbsp;&nbsp;&nbsp;self.attributes.each do |attr|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attr.strip! if attr.instance_of? String</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;end</li><li>&nbsp;</li><li>&nbsp;&nbsp;alias_method :after_find, :trim_space</li><li>&nbsp;&nbsp;alias_method :before_save, :trim_space</li><li>end</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>The above module is using the after_find and before_save callbacks to make sure that:</p>
<ol>
<li>Any spaces coming back from the database are trimmed.</li>
<li>Any new records and/or updates will have the spaces trimmed.</li>
</ol>
<p>You can use this method to perform pretty much any sort of validation or data manipulation of the data of an ActiveRecord class.&nbsp; Other callbacks include:</p>
<ul>
<li>after_create</li>
<li>after_destroy</li>
<li>after_save</li>
<li>after_update</li>
<li>after_validation</li>
<li>after_validation_on_create</li>
<li>after_validation_on_update</li>
<li>before_create</li>
<li>before_destroy</li>
<li>before_save</li>
<li>before_update</li>
<li>before_validation</li>
<li>before_validation_on_create</li>
<li>before_validation_on_update</li>
</ul>
<p>You can read more about ActiveRecord::Callbacks at <a href="http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html">http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html</a>.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=32531c0f-5714-4592-8a9c-073b5100fecd" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/lVr6fILx7ww" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/08/20/database-paranoia-activerecord-callbacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/08/20/database-paranoia-activerecord-callbacks/</feedburner:origLink></item>
		<item>
		<title>Ruby Bindings and Scope</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/iz_UoyWAmlo/</link>
		<comments>http://blender.matthewkwilliams.com/2009/08/19/ruby-bindings-and-scope/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 21:06:33 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[Local variable]]></category>
		<category><![CDATA[scope]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=71</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
One of the features of Ruby&#8217;s Kernel module (which is imported into Object, so it&#8217;s available in every class) is the binding.&#160; The binding allows you to keep a pointer to the scope at a particular location in your application and then later evaluate code from that location. For example (and this came up as [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>One of the features of Ruby&#8217;s Kernel module (which is imported into Object, so it&#8217;s available in every class) is the binding.&nbsp; The binding allows you to keep a pointer to the scope at a particular location in your application and then later evaluate code from that location.</p>
<p>For example (and this came up as the result of a <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/344180">question</a> on the ruby talk&nbsp; mailing list), one of the things you can do is obtain a list of the local variables of a method:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>def my_vars<span class="br0">&#40;</span>a<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;b=a</li><li>&nbsp;&nbsp;c=b+a</li><li>&nbsp;&nbsp;puts local_variables</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>returns the three variables, a, b, and c.&nbsp; That&#8217;s fine, we&#8217;re still within the scope of the method.&nbsp; But how about outside of our method?&nbsp; This is where #binding and the Binding class come into play:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>def outside<span class="br0">&#40;</span>b<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;puts eval<span class="br0">&#40;</span>&quot;local_variables&quot;, b<span class="br0">&#41;</span></li><li>end</li><li>&nbsp;</li><li>def my_vars<span class="br0">&#40;</span>a<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;b=a</li><li>&nbsp;&nbsp;c=b+a</li><li>&nbsp;&nbsp;outside<span class="br0">&#40;</span>binding<span class="br0">&#41;</span></li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<p>One thing to note: in order to work with the binding, we have to #eval code within its scope.&nbsp; Thus the call to #eval with the method we are invoking and the binding.&nbsp; This leads to the question from the mailing list:</p>
<blockquote><p>we already have #has_block? to see if a block was passed. So how about<br />
a #has_arguments? to query if _any_ arguments have been passed &#8212; <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/344180">Intransition</a></p></blockquote>
<p>So how would we go about writing a #has_arguments? &#8212; here is a first stab:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Object</li><li>&nbsp;&nbsp;def has_arguments?<span class="br0">&#40;</span>b<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;vars = eval<span class="br0">&#40;</span>&quot;local_variables&quot;,b<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;return false if vars.length == 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;vars.each do |v|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false if eval<span class="br0">&#40;</span>&quot;#<span class="br0">&#123;</span>v<span class="br0">&#125;</span>.nil?&quot;,b<span class="br0">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;return true</li><li>&nbsp;&nbsp;end</li><li>end</li><li>&nbsp;</li><li>class Foo</li><li>&nbsp;&nbsp;def initialize<span class="br0">&#40;</span>first=nil<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#40;</span>has_arguments? binding<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;We're defined&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;Not!&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;end</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>The only real drawback here is that we&#8217;ve got to pass in the binding itself.&nbsp; Let&#8217;s try again:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Object</li><li>&nbsp;&nbsp;def has_arguments?<span class="br0">&#40;</span>&amp;b<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;vars = eval<span class="br0">&#40;</span>&quot;local_variables&quot;,b.binding<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;return false if vars.length == 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;vars.each do |v|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false if eval<span class="br0">&#40;</span>&quot;#<span class="br0">&#123;</span>v<span class="br0">&#125;</span>.nil?&quot;,b<span class="br0">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;return true</li><li>&nbsp;&nbsp;end</li><li>end</li><li>&nbsp;</li><li>class Foo</li><li>&nbsp;&nbsp;def initialize<span class="br0">&#40;</span>first=nil<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#40;</span>has_arguments? <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="br0">&#41;</span> # note the empty block</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;We're defined&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;Not!&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;end</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>In this case, instead of explicitly calling #binding, we&#8217;re passing in an empty block &#8212; the block has it&#8217;s own scope, but it happens to contain the scope of then enclosing method.&nbsp; It&#8217;s still not perfect, however:</p>
<ol>
<li>You need to pass in an empty block.</li>
<li>It fails if you have local variables other than those passed in as arguments. (Pointed out by <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/344265">Joel VanderWerf</a>)</li>
</ol>
<p>Ok, it&#8217;s got some serious flaws (Charles Nutter posted a different way of <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/344267">solving</a> the problem, which does work for all cases, and doesn&#8217;t use #binding).&nbsp; But it does give an idea of what you can do with #binding.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=226ed4f0-8ead-4e3e-b046-04359bd0ae8b" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/iz_UoyWAmlo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/08/19/ruby-bindings-and-scope/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/08/19/ruby-bindings-and-scope/</feedburner:origLink></item>
		<item>
		<title>What’s #method_missing missing?</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/hD0j50769C4/</link>
		<comments>http://blender.matthewkwilliams.com/2009/08/18/whats-method_missing-missing/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 18:57:54 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=67</guid>
		<description><![CDATA[#method_missing is a useful feature in ruby.  However, there's something that many people miss when using it.]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>#method_missing is a very useful part of the <a class="zem_slink" title="Ruby (programming language)" rel="homepage" href="http://www.ruby-lang.org/">ruby language</a>.&nbsp; However, there&#8217;s one common mistake that developers make when using it.&nbsp; They forget to add a call to #super.</p>
<p>Let&#8217;s take a look:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>$ irb</li><li>&gt;&gt; class Foo</li><li>&gt;&gt;&nbsp;&nbsp; end</li><li>=&gt; nil</li><li>&gt;&gt; f=Foo.new</li><li>=&gt; #&lt;Foo:0xb75122fc&gt;</li><li>&gt;&gt; f.i_do_not_exist</li><li>NoMethodError: undefined method `i_do_not_exist' for #&lt;Foo:0xb75122fc&gt;</li><li> from <span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:<span style="">5</span></li><li>&gt;&gt; class Foo</li><li>&gt;&gt;&nbsp;&nbsp; def method_missing<span class="br0">&#40;</span>symbol,*args<span class="br0">&#41;</span></li><li>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; if <span class="br0">&#40;</span>symbol.to_s === &quot;i_do_not_exist&quot;<span class="br0">&#41;</span></li><li>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts &quot;Yes, actually you do&quot;</li><li>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</li><li>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; end</li><li>&gt;&gt;&nbsp;&nbsp; end</li><li>=&gt; nil</li><li>&gt;&gt; f.i_do_not_exist</li><li>Yes, actually you do</li><li>=&gt; nil</li><li>&gt;&gt; f.i_exist</li><li>=&gt; nil</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Unfortunately, we no longer get the error when we try to invoke a method which does not exist.&nbsp; When we add an invocation to super, it&#8217;ll behave as expected:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>&gt;&gt; class Foo</li><li>&nbsp;&nbsp;def method_missing<span class="br0">&#40;</span>symbol,*args<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#40;</span>symbol.to_s === &quot;i_do_not_exist&quot;<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;Yes, actually you do&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;end</li><li>end</li><li>&gt;&gt;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&nbsp;&nbsp; =&gt; nil</li><li>&gt;&gt; f.i_exist</li><li>NoMethodError: undefined method `i_exist' for #&lt;Foo:0xb75122fc&gt;</li><li> from <span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:<span style="">31</span>:in `method_missing'</li><li> from <span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:<span style="">35</span></li><li>&gt;&gt; f.i_do_not_exist</li><li>Yes, actually you do</li><li>=&gt; nil</li><li>&gt;&gt; </li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>&nbsp;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=8932e6ed-06b0-4874-b604-9b9af7c6ffd4" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/hD0j50769C4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/08/18/whats-method_missing-missing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/08/18/whats-method_missing-missing/</feedburner:origLink></item>
		<item>
		<title>After long silence</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/s8oBMmt3OB4/</link>
		<comments>http://blender.matthewkwilliams.com/2009/04/10/after-long-silence/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 17:26:57 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/2009/04/10/after-long-silence/</guid>
		<description><![CDATA[The hiatus has been due to me having been really sick with a weird neurological disorder.&#160; I didn&#8217;t do any coding at all for over 2 months.&#160; I&#8217;m starting to feel better, but I still have my good days and bad.&#160; So, there will be updates.&#160; Hopefully before not too much longer.]]></description>
			<content:encoded><![CDATA[<p>The hiatus has been due to me having been really sick with a weird neurological disorder.&nbsp; I didn&#8217;t do any coding at all for over 2 months.&nbsp; I&#8217;m starting to feel better, but I still have my good days and bad.&nbsp; So, there will be updates.&nbsp; Hopefully before not too much longer.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=d7796f09-badf-84e7-ba70-2c546b3fdf71" /></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/s8oBMmt3OB4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/04/10/after-long-silence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/04/10/after-long-silence/</feedburner:origLink></item>
		<item>
		<title>Overriding operators: two dimensional arrays</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/ANwgMyR0nQ8/</link>
		<comments>http://blender.matthewkwilliams.com/2009/02/23/overriding-operators-two-dimensional-arrays/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 21:53:32 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=58</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
Image via Wikipedia One of the neat things about ruby is that, in general, operators are methods, so they can be overridden. When working with multidimensional arrays, some languages allow you to do the following: a&#91;0,0&#93; whereas ruby uses: a&#91;0&#93;&#91;0&#93; Which makes sense, since Ruby implements it as an array of arrays and you&#8217;re chaining [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Array_of_array_storage.svg"><img title="A two-dimensional array stored as a one-dimens..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Array_of_array_storage.svg/202px-Array_of_array_storage.svg.png" alt="A two-dimensional array stored as a one-dimens..." width="202" height="145" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Array_of_array_storage.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>One of the neat things about ruby is that, in general, operators are methods, so they can be overridden.  </p>
<p>When working with multidimensional arrays, some languages allow you to do the following:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>a<span class="br0">&#91;</span><span style="">0</span>,<span style="">0</span><span class="br0">&#93;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>whereas ruby uses:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>a<span class="br0">&#91;</span><span style="">0</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span style="">0</span><span class="br0">&#93;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Which makes sense, since Ruby implements it as an array of arrays and you&#8217;re chaining methods to get to the element.  But, since we can override the [] method, we can then say a[0,0].</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Grid</li><li>&nbsp;&nbsp;attr_reader :cols, :rows</li><li>&nbsp;</li><li>&nbsp;&nbsp;# initialize our grid and optionally prepopulate it.</li><li>&nbsp;&nbsp;# klass can behave in the following fashions:</li><li>&nbsp;&nbsp;# nil -- nil</li><li>&nbsp;&nbsp;# a value <span class="br0">&#40;</span>like &quot;&quot;, 0, true<span class="br0">&#41;</span> -- that value</li><li>&nbsp;&nbsp;# a class which responds to new -- an instance of that class</li><li>&nbsp;&nbsp; def initialize<span class="br0">&#40;</span>rows=1, cols=1, klass = nil<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;@rows = rows</li><li>&nbsp;&nbsp;&nbsp;&nbsp;@cols = cols</li><li>&nbsp;&nbsp;&nbsp;&nbsp;@grid = <span class="br0">&#40;</span>0 ... @rows<span class="br0">&#41;</span>.collect do |y|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>0 ... @cols<span class="br0">&#41;</span>.collect do |x|</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if klass.nil? then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elsif klass.respond_to? :new</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;klass.new</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;klass</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;end</li><li>&nbsp;</li><li># This method allows us to say +grid<span class="br0">&#91;</span>x, y<span class="br0">&#93;</span>+ instead of +grid<span class="br0">&#91;</span>y<span class="br0">&#93;</span><span class="br0">&#91;</span>x<span class="br0">&#93;</span>+</li><li>&nbsp;&nbsp;def <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#40;</span>x, y=nil<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>x,y<span class="br0">&#41;</span> = x if x.instance_of? Array</li><li>&nbsp;&nbsp;&nbsp;&nbsp;@grid<span class="br0">&#91;</span>y<span class="br0">&#93;</span><span class="br0">&#91;</span>x<span class="br0">&#93;</span></li><li>&nbsp;&nbsp;end</li><li>&nbsp;</li><li>&nbsp;&nbsp;# This method allows us to set the value of a grid grid entry via</li><li>&nbsp;&nbsp;# +grid<span class="br0">&#91;</span>x, y<span class="br0">&#93;</span>+ instead of +grid<span class="br0">&#91;</span>y<span class="br0">&#93;</span><span class="br0">&#91;</span>x<span class="br0">&#93;</span>+</li><li>&nbsp;&nbsp;def <span class="br0">&#91;</span><span class="br0">&#93;</span>=<span class="br0">&#40;</span>*args<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#40;</span>args<span class="br0">&#91;</span><span style="">0</span><span class="br0">&#93;</span>.instance_of? Array<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span><span class="br0">&#40;</span>x, y<span class="br0">&#41;</span>,value<span class="br0">&#41;</span> = args</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>x,y,value<span class="br0">&#41;</span> = args</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;@grid<span class="br0">&#91;</span>y<span class="br0">&#93;</span><span class="br0">&#91;</span>x<span class="br0">&#93;</span> = value</li><li>&nbsp;&nbsp;end</li><li>&nbsp;</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>So, it can be used like this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>$ irb</li><li>&gt;&gt; require 'grid'</li><li>=&gt; true</li><li>&gt;&gt; g=Grid.new</li><li>=&gt; #&lt; Grid:0xb747d760 @cols=<span style="">1</span>, @rows=<span style="">1</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span>nil<span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li><li>&gt;&gt; g=Grid.new<span class="br0">&#40;</span><span style="">2</span>,<span style="">2</span><span class="br0">&#41;</span></li><li>=&gt; #&lt; Grid:0xb747bb04 @cols=<span style="">2</span>, @rows=<span style="">2</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span>nil, nil<span class="br0">&#93;</span>, <span class="br0">&#91;</span>nil, nil<span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li><li>&gt;&gt; g=Grid.new<span class="br0">&#40;</span><span style="">2</span>,<span style="">2</span>,<span style="">0</span><span class="br0">&#41;</span></li><li>=&gt; #&lt; Grid:0xb7479aac @cols=<span style="">2</span>, @rows=<span style="">2</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span><span style="">0</span>, <span style="">0</span><span class="br0">&#93;</span>, <span class="br0">&#91;</span><span style="">0</span>, <span style="">0</span><span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li><li>&gt;&gt; g=Grid.new<span class="br0">&#40;</span><span style="">2</span>,<span style="">2</span>,String<span class="br0">&#41;</span></li><li>=&gt; #&lt; Grid:0xb7477810 @cols=<span style="">2</span>, @rows=<span style="">2</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span>&quot;&quot;, &quot;&quot;<span class="br0">&#93;</span>, <span class="br0">&#91;</span>&quot;&quot;, &quot;&quot;<span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li><li>&gt;&gt; g=Grid.new<span class="br0">&#40;</span><span style="">2</span>,<span style="">2</span>,false<span class="br0">&#41;</span></li><li>=&gt; #&lt; Grid:0xb74755d8 @cols=<span style="">2</span>, @rows=<span style="">2</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span>false, false<span class="br0">&#93;</span>, <span class="br0">&#91;</span>false, false<span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li><li>&gt;&gt; g<span class="br0">&#91;</span><span style="">0</span>,<span style="">0</span><span class="br0">&#93;</span></li><li>=&gt; false</li><li>&gt;&gt; g<span class="br0">&#91;</span><span style="">0</span>,<span style="">0</span><span class="br0">&#93;</span>=true</li><li>=&gt; true</li><li>&gt;&gt; g</li><li>=&gt; #&lt; Grid:0xb74755d8 @cols=<span style="">2</span>, @rows=<span style="">2</span>, @grid=<span class="br0">&#91;</span><span class="br0">&#91;</span>true, false<span class="br0">&#93;</span>, <span class="br0">&#91;</span>false, false<span class="br0">&#93;</span><span class="br0">&#93;</span> &gt;</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>It&#8217;s an interesting technique &#8212; and given that most people think of arrays/coordinates in pairs, I think that it can make the code more &#8220;readable&#8221;.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=30343586-84a3-448c-aba1-0d2582ae77c6" alt="Enhanced by Zemanta" /></a></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/ANwgMyR0nQ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/02/23/overriding-operators-two-dimensional-arrays/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/02/23/overriding-operators-two-dimensional-arrays/</feedburner:origLink></item>
		<item>
		<title>To Paren, or not to Paren</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/3qOfa4ZPZV0/</link>
		<comments>http://blender.matthewkwilliams.com/2009/02/20/to-paren-or-not-to-paren/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 19:11:53 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[paradigm]]></category>
		<category><![CDATA[philosophy]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=54</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
To paren, or not to paren: that is the question: Whether &#8217;tis nobler in the mind to suffer The bugs and errors of maintenance programs, Or to take arms against a host of typos, And by debugging end them? To hack: to slash; No more; and by a slash to say we end The heart-ache [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<blockquote><p>To paren, or not to paren: that is the question:</p>
<p>Whether &#8217;tis nobler in the mind to suffer</p>
<p>The bugs and errors of  maintenance programs,</p>
<p>Or to take arms against a host of typos,</p>
<p>And by <a class="zem_slink" title="Debugging" rel="wikipedia" href="http://en.wikipedia.org/wiki/Debugging">debugging</a> end them?  To hack: to slash;</p>
<p>No more; and by a slash to say we end</p>
<p>The heart-ache and the thousand natural shocks</p>
<p>Of <a class="zem_slink" title="Cut, copy, and paste" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cut%2C_copy%2C_and_paste">cut and paste</a> code, &#8217;tis a maturation</p>
<p>Devoutly to be wished.  To hack, not slash;</p>
<p>Not slash: perchance to code: ay, there&#8217;s the rub;</p>
<p>For in that new programme what code may come</p>
<p>When we have shuffled off this unix box,</p>
<p>Must give us pause:  there&#8217;s the respect</p>
<p>That makes wuffy of so long life;</p>
<p>&#8211; Not <a class="zem_slink" title="William Shakespeare" rel="lastfm" href="http://www.last.fm/music/William%2BShakespeare">William Shakespeare</a></p></blockquote>
<p>There&#8217;s been a good deal of conversation of late on comp.lang.ruby as to whether or not to use <a class="zem_slink" title="Parenthesis (rhetoric)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Parenthesis_%28rhetoric%29">parentheses</a>.  And when to use them.  <a class="zem_slink" title="Ruby (programming language)" rel="homepage" href="http://www.ruby-lang.org/">Ruby</a> is such that parentheses are optional, except, of course, when they&#8217;re not.  Here&#8217;s some examples of where they are not:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:002:0&amp;gt; &quot;parenthesis&quot;.length<span class="br0">&#40;</span><span class="br0">&#41;</span></li><li>=&amp;gt; 11</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:003:0&amp;gt; &quot;parenthesis&quot;.length</li><li>=&amp;gt; 11</li><li>&nbsp;</li><li>...</li><li>&nbsp;</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:009:0&amp;gt; class &lt;a class=&quot;zem_slink&quot; title=&quot;Foo&quot; rel=&quot;wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Foo&quot;&gt;Foo&lt;/a&gt;</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:010:1&amp;gt; attr_accessor :bar, :groo</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:011:1&amp;gt; attr_reader<span class="br0">&#40;</span>:gruff<span class="br0">&#41;</span></li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:012:1&amp;gt; end</li><li>=&amp;gt; nil</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:013:0&amp;gt; f=Foo.new</li><li>=&amp;gt; #&lt;foo:0x2a98ad0bc0&gt;</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:014:0&amp;gt; f.gruff</li><li>=&amp;gt; nil</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:015:0&amp;gt; f.bar</li><li>=&amp;gt; nil</li><li>&nbsp;</li><li>&lt;/foo:0x2a98ad0bc0&gt;</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Notice that Ruby also doesn&#8217;t care if you use parenthesis or not for the arguments; in this case it doesn&#8217;t matter whether or not the parenthesis are there, because the meaning is clear, at least to the compiler.  And now, for something completely different, an instance where meaning is not clear to the compiler.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:016:0&amp;gt; class Foo</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:017:1&amp;gt; def fud<span class="br0">&#40;</span>thing<span class="br0">&#41;</span></li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:018:2&amp;gt; thing.reverse</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:019:2&amp;gt; end</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:020:1&amp;gt; end</li><li>=&amp;gt; nil</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:021:0&amp;gt; f.fud &quot;hi&quot;</li><li>=&amp;gt; &quot;ih&quot;</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:022:0&amp;gt; f.fud &quot;hi&quot; ? true : false</li><li><span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:22: warning: string literal in condition</li><li>NoMethodError: undefined method `reverse' for true:TrueClass</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from <span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:18:in `fud'</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from <span class="br0">&#40;</span>irb<span class="br0">&#41;</span>:22</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from /usr2/jest/tools//lib/ruby/site_ruby/1.8/rubygems/dependency.rb:19</li><li>irb<span class="br0">&#40;</span>main<span class="br0">&#41;</span>:023:0&amp;gt; f.fud<span class="br0">&#40;</span>&quot;hi&quot;<span class="br0">&#41;</span> ? true : false</li><li>=&amp;gt; true</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>In the first instance, it is trying to evaluate<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>&quot;hi&quot; ? true : false</li></ol></div></pre><!--END_DEVFMTCODE--><br />
and then pass it to f.fud.  This doesn&#8217;t work very well, since true does not have a reverse method.  We&#8217;re running into an issue of order of operation.  However, when we do<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>f.fud<span class="br0">&#40;</span>&quot;hi&quot;<span class="br0">&#41;</span> ? true : false</li></ol></div></pre><!--END_DEVFMTCODE--><br />
then we are successful.  &#8220;hi&#8221; can be reversed and the result can be checked for non-nil-ness.  In this (admittedly simplistic) example, the parenthesis were needed in order to achieve a satisfactory result.</p>
<p>In terms of background, I learned C 20 years ago.  I cut my teeth on basic back in 1980.  So I&#8217;ve been around for a little while.  I mention this because several posters mentioned that one&#8217;s preference for using parenthesis may depend on one&#8217;s background, with those who come from C potentially more likely to use parenthesis whether they were needed or not.</p>
<p>I am of the opinion that parenthesis can make the code harder to read.<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>attr_accessor :first, :last</li><li>has_many :pets</li></ol></div></pre><!--END_DEVFMTCODE--><br />
is easier to my eyes and far easier to read as it mimics &#8220;natural&#8221; language than<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>attr_accessor<span class="br0">&#40;</span>:first, :last<span class="br0">&#41;</span></li><li>has_many<span class="br0">&#40;</span>:pets<span class="br0">&#41;</span></li></ol></div></pre><!--END_DEVFMTCODE--><br />
However, I realize that it is a personal choice.  So my rule of thumb is to not use parenthesis, except where there is a question of clarity.  I think that writing clear, maintainable code is more important than adhering to a rule of always using parenthesis.  I like that Ruby, like <a class="zem_slink" title="Unix" rel="wikipedia" href="http://en.wikipedia.org/wiki/Unix">Unix</a>, generally has more way than one to do a thing.  I understand that there are people who prefer one way of doing a thing.  For those people, there&#8217;s <a class="zem_slink" title="Python (programming language)" rel="homepage" href="http://www.python.org/">Python</a>.  I&#8217;m kidding, of course &#8212; you can adhere to doing things a single way, such as always using parenthesis, in Ruby.   To me, however, it would lessen my enjoyment of the language.  And I write code in Ruby because it makes me happy to do so.</p>
<p>So, what do you think?  Is there a compelling reason to use parentheses?</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_a.png?x-id=62d457e3-7200-4aaa-a4ff-19722542ab42" alt="Enhanced by Zemanta"></a></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/3qOfa4ZPZV0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/02/20/to-paren-or-not-to-paren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/02/20/to-paren-or-not-to-paren/</feedburner:origLink></item>
		<item>
		<title>my_methods revisited</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/EmgaZhGBUjI/</link>
		<comments>http://blender.matthewkwilliams.com/2009/02/19/my_methods-revisited/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 11:00:58 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=50</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
In irbrc goodness, I touched briefly on my_methods, a method of discovering the methods of an object which are distinct from those inherited from Object. The method looks like this: class Object&#160;&#160;def my_methods&#160;&#160;&#160;&#160;&#40;self.methods - Object.methods&#41;.sort&#160;&#160;endend I have since had the idea of extending it &#8212; now you can also choose to see only the methods [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>In <a href="http://blender.matthewkwilliams.com/2009/02/18/irbrc-goodness/">irbrc goodness</a>, I touched briefly on my_methods, a method of discovering the methods of an object which are distinct from those inherited from Object.  The method looks like this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Object</li><li>&nbsp;&nbsp;def my_methods</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>self.methods - Object.methods<span class="br0">&#41;</span>.sort</li><li>&nbsp;&nbsp;end</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--><br />
I have since had the idea of extending it &#8212; now you can also choose to see only the methods which are implemented by an object&#8217;s Class.  You can see it in use here (code at the end):<br />
$ irb<br />
>> class Object<br />
>>     def my_methods(_super=false)<br />
>>         _methods = (_super) ? self.class.superclass.new.methods : Object.methods<br />
>>         (self.methods &#8211; _methods).sort<br />
>>       end<br />
>>   end<br />
=> nil<br />
>> class Foo < String<br />
>>   def fud<br />
>>     puts &#8220;fud&#8221;<br />
>>     end<br />
>>   end<br />
=> nil<br />
>> f=Foo.new<br />
=> &#8220;&#8221;<br />
>> f.my_methods<br />
=> ["%", "*", "+", "<<", "[]&#8220;, &#8220;[]=&#8221;, &#8220;all?&#8221;, &#8220;any?&#8221;, &#8220;between?&#8221;, &#8220;capitalize&#8221;, &#8220;capitalize!&#8221;, &#8220;casecmp&#8221;, &#8220;center&#8221;, &#8220;chomp&#8221;, &#8220;chomp!&#8221;, &#8220;chop&#8221;, &#8220;chop!&#8221;, &#8220;collect&#8221;, &#8220;concat&#8221;, &#8220;count&#8221;, &#8220;crypt&#8221;, &#8220;delete&#8221;, &#8220;delete!&#8221;, &#8220;detect&#8221;, &#8220;downcase&#8221;, &#8220;downcase!&#8221;, &#8220;dump&#8221;, &#8220;each&#8221;, &#8220;each_byte&#8221;, &#8220;each_line&#8221;, &#8220;each_with_index&#8221;, &#8220;empty?&#8221;, &#8220;entries&#8221;, &#8220;find&#8221;, &#8220;find_all&#8221;, &#8220;fud&#8221;, &#8220;grep&#8221;, &#8220;gsub&#8221;, &#8220;gsub!&#8221;, &#8220;hex&#8221;, &#8220;index&#8221;, &#8220;inject&#8221;, &#8220;insert&#8221;, &#8220;intern&#8221;, &#8220;is_binary_data?&#8221;, &#8220;is_complex_yaml?&#8221;, &#8220;length&#8221;, &#8220;ljust&#8221;, &#8220;lstrip&#8221;, &#8220;lstrip!&#8221;, &#8220;map&#8221;, &#8220;match&#8221;, &#8220;max&#8221;, &#8220;member?&#8221;, &#8220;min&#8221;, &#8220;next&#8221;, &#8220;next!&#8221;, &#8220;oct&#8221;, &#8220;partition&#8221;, &#8220;reject&#8221;, &#8220;replace&#8221;, &#8220;reverse&#8221;, &#8220;reverse!&#8221;, &#8220;rindex&#8221;, &#8220;rjust&#8221;, &#8220;rstrip&#8221;, &#8220;rstrip!&#8221;, &#8220;scan&#8221;, &#8220;select&#8221;, &#8220;size&#8221;, &#8220;slice&#8221;, &#8220;slice!&#8221;, &#8220;sort&#8221;, &#8220;sort_by&#8221;, &#8220;split&#8221;, &#8220;squeeze&#8221;, &#8220;squeeze!&#8221;, &#8220;strip&#8221;, &#8220;strip!&#8221;, &#8220;strip_tags&#8221;, &#8220;sub&#8221;, &#8220;sub!&#8221;, &#8220;succ&#8221;, &#8220;succ!&#8221;, &#8220;sum&#8221;, &#8220;swapcase&#8221;, &#8220;swapcase!&#8221;, &#8220;to_f&#8221;, &#8220;to_i&#8221;, &#8220;to_str&#8221;, &#8220;to_sym&#8221;, &#8220;tr&#8221;, &#8220;tr!&#8221;, &#8220;tr_s&#8221;, &#8220;tr_s!&#8221;, &#8220;unpack&#8221;, &#8220;upcase&#8221;, &#8220;upcase!&#8221;, &#8220;upto&#8221;, &#8220;zip&#8221;]<br />
>> f.my_methods(true)<br />
=> ["fud"]<br />
>></p>
<p>Here&#8217;s the promised code:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>class Object</li><li>&nbsp;&nbsp;def my_methods<span class="br0">&#40;</span>_super=false<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;_methods = <span class="br0">&#40;</span>_super<span class="br0">&#41;</span> ? self.class.superclass.new.methods : Object.methods</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>self.methods - _methods<span class="br0">&#41;</span>.sort</li><li>&nbsp;&nbsp;end</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/EmgaZhGBUjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/02/19/my_methods-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/02/19/my_methods-revisited/</feedburner:origLink></item>
		<item>
		<title>irbrc goodness</title>
		<link>http://feedproxy.google.com/~r/RubyBlender/~3/G9FPc5ORMWc/</link>
		<comments>http://blender.matthewkwilliams.com/2009/02/18/irbrc-goodness/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 22:26:13 +0000</pubDate>
		<dc:creator>Matt Williams</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[irbc]]></category>

		<guid isPermaLink="false">http://blender.matthewkwilliams.com/?p=47</guid>
		<description><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
Here&#8217;s my (current) .irbrc, with comments # I am including gems in my irb session.&#160;&#160;Therefore, the next requirerequire 'rubygems'&#160;# wirble is a wonderful gem which add nice features to irbrequire 'wirble'&#160;# Dr. Nic's useful helper gem.&#160;&#160;It makes it so you can say:#&#160;&#160; foo.map_by_bar# instead of having to say:#&#160;&#160; foo.map&#123;&#124;f&#124; f.bar&#125;# more to the point you [...]]]></description>
			<content:encoded><![CDATA[<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3643</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3651</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3654</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>1925</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>2290</b><br />
<br />
<b>Warning</b>:  implode() [<a href='function.implode'>function.implode</a>]: Argument must be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3242</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3265</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3306</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3357</b><br />
<br />
<b>Warning</b>:  array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/aetheric/public_html/blender/wp-content/plugins/devformatter/geshi/geshi.php</b> on line <b>3502</b><br />
<p>Here&#8217;s my (current) .irbrc, with comments</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li># I am including gems in my irb session.&nbsp;&nbsp;Therefore, the next require</li><li>require 'rubygems'</li><li>&nbsp;</li><li># wirble is a wonderful gem which add nice features to irb</li><li>require 'wirble'</li><li>&nbsp;</li><li># Dr. Nic's useful helper gem.&nbsp;&nbsp;It makes it so you can say:</li><li>#&nbsp;&nbsp; foo.map_by_bar</li><li># instead of having to say:</li><li>#&nbsp;&nbsp; foo.map<span class="br0">&#123;</span>|f| f.bar<span class="br0">&#125;</span></li><li># more to the point you can do</li><li>#&nbsp;&nbsp; people.map_by_first_and_last</li><li># instead of</li><li>#&nbsp;&nbsp; people.map<span class="br0">&#123;</span>|p| <span class="br0">&#91;</span>p.first, p.last<span class="br0">&#93;</span><span class="br0">&#125;</span></li><li>require 'map_by_method'</li><li>&nbsp;</li><li># what_methods is a way to see which methods, when performed on an object, return a particular value:</li><li># &gt;&gt; &quot;hi&quot;.what? 'h'</li><li># &quot;hi&quot;.chop! == &quot;h&quot;</li><li># &quot;hi&quot;.chop == &quot;h&quot;</li><li># =&gt; <span class="br0">&#91;</span>&quot;chop!&quot;, &quot;chop&quot;<span class="br0">&#93;</span></li><li>require 'what_methods'</li><li>&nbsp;</li><li># pretty print --&gt; provides a &quot;pretty&quot; view of an object</li><li>require 'pp'</li><li>&nbsp;</li><li># auto indent irb; it's useful for when you're just experimenting</li><li>IRB.conf<span class="br0">&#91;</span>:AUTO_INDENT<span class="br0">&#93;</span>=true</li><li>&nbsp;</li><li># start wirble <span class="br0">&#40;</span>with color<span class="br0">&#41;</span></li><li>Wirble.init</li><li>#Wirble.colorize</li><li>&nbsp;</li><li># What are the methods which belong only to an object, and not those inherited from Object</li><li>class Object</li><li>&nbsp;&nbsp;def my_methods</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span class="br0">&#40;</span>self.methods - Object.methods<span class="br0">&#41;</span>.sort</li><li>&nbsp;&nbsp;end</li><li>end</li><li>&nbsp;</li><li># strip html tags from a string</li><li>class String</li><li>&nbsp;&nbsp;def strip_tags</li><li>&nbsp;&nbsp;&nbsp;&nbsp;self.gsub<span class="br0">&#40;</span>/&lt;\S<span class="br0">&#91;</span>^&gt;&lt;<span class="br0">&#93;</span>*&gt;/,&quot;&quot;<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;end</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>I&#8217;ve shown mine.  Show me yours?</p>
<p>Here are links to the referenced <a class="zem_slink" title="RubyGems" rel="homepage" href="http://docs.rubygems.org">rubygems</a>:</p>
<ul>
<li><a href="http://rubyfurnace.com/docs/what_methods-1.0.0/">what_methods</a></li>
<li><a href="http://drnicwilliams.com/category/ruby/gems/map_by_method/">map_by_method</a></li>
<li><a href="http://pablotron.org/software/wirble/">wirble</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=6bfc1632-06a2-45af-97a9-fbae9b25aa85" alt="Enhanced by Zemanta" /></a></div>
<img src="http://feeds.feedburner.com/~r/RubyBlender/~4/G9FPc5ORMWc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blender.matthewkwilliams.com/2009/02/18/irbrc-goodness/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blender.matthewkwilliams.com/2009/02/18/irbrc-goodness/</feedburner:origLink></item>
	</channel>
</rss>
