<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Groovy Bar &#38; Grill</title>
	<atom:link href="http://groovybargrill.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://groovybargrill.wordpress.com</link>
	<description>Don't just sit there.</description>
	<lastBuildDate>Thu, 05 May 2011 14:59:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='groovybargrill.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Groovy Bar &#38; Grill</title>
		<link>http://groovybargrill.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://groovybargrill.wordpress.com/osd.xml" title="Groovy Bar &#38; Grill" />
	<atom:link rel='hub' href='http://groovybargrill.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ReverseEcho.groovy</title>
		<link>http://groovybargrill.wordpress.com/2008/12/09/reverseechogroovy/</link>
		<comments>http://groovybargrill.wordpress.com/2008/12/09/reverseechogroovy/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 03:23:50 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/?p=132</guid>
		<description><![CDATA[There&#8217;s a great line from the movie, The Truman Show, that explains why Truman never questioned his life circumstances: &#8220;We accept the reality of the world with which we&#8217;re presented.&#8221; It&#8217;s the same with Java. We didn&#8217;t know how tedious it was until Groovy showed us a better way. Just how tedious is Java. Let&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=132&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a great line from the movie, The Truman Show, that explains why Truman never questioned his life circumstances: &#8220;We accept the reality of the world with which we&#8217;re presented.&#8221; It&#8217;s the same with Java. We didn&#8217;t know how tedious it was until Groovy showed us a better way.<br />
Just how tedious is Java. Let&#8217;s look at an example that prints out the reverse of the command line arguments (e.g. &#8220;This is a test&#8221; prints out as &#8220;tset a si sihT&#8221;)
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
<tr><!-- start source code -->
<td nowrap="nowrap" valign="top" align="left"><code><font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font><font color="#000000">ReverseEcho&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;static&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">main</font><font color="#000000">(</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">args</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;args.length&nbsp;-&nbsp;</font><font color="#990000">1</font><font color="#000000">;&nbsp;i&nbsp;&gt;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;i--</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">j&nbsp;=&nbsp;args</font><font color="#000000">[</font><font color="#000000">i</font><font color="#000000">]</font><font color="#000000">.length</font><font color="#000000">()&nbsp;</font><font color="#000000">-&nbsp;</font><font color="#990000">1</font><font color="#000000">;&nbsp;j&nbsp;&gt;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;j--</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#000000">args</font><font color="#000000">[</font><font color="#000000">i</font><font color="#000000">]</font><font color="#000000">.charAt</font><font color="#000000">(</font><font color="#000000">j</font><font color="#000000">))</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#2a00ff">&#34;&nbsp;&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font></code></p>
</td>
<p>  <!-- end source code --><br />
   </tr>
</table>
</div>
<p>When you don&#8217;t know any better, well, that&#8217;s what you have to do: set up nested for loops and traverse in reverse. You&#8217;re happy as a bit in a bucket until Groovy comes along and presents a new reality.
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
<tr><!-- start source code -->
<td nowrap="nowrap" valign="top" align="left"><code><font color="#000000">args.reverseEach&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">print&nbsp;</font><font color="#2a00ff">&#34;${it.reverse()}&nbsp;&#34;</font><br />
<font color="#000000">}</font></code></p>
</td>
<p>  <!-- end source code --><br />
   </tr>
</table>
</div>
<p>Yep, Groovy really makes it that easy. <code>args</code> is an implicitly defined list that contains the command line arguments. <code>reverseEach()</code> is a shortcut (a concept mostly absent in Java) for <code>reverse().each()</code> and iterates over each element in the list in reverse order. <code>reverse()</code> is also a GDK method on string and does exactly what you might think, it creates a new string which is the reverse of the original.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=132&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2008/12/09/reverseechogroovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Fibonacci.groovy</title>
		<link>http://groovybargrill.wordpress.com/2008/12/09/fibonaccigroovy/</link>
		<comments>http://groovybargrill.wordpress.com/2008/12/09/fibonaccigroovy/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 23:49:22 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/?p=76</guid>
		<description><![CDATA[One of the ugliest constructs in Java is the for loop. The enhanced for in Java 5 improved readability but Groovy has alternatives that are even better. Let&#8217;s take a look. Here is Java code (from Java Examples in a Nutshell, 2nd Ed.) that prints the first 20 Fibonacci numbers: public&#160;class&#160;Fibonacci&#160;{ &#160;&#160;public&#160;static&#160;void&#160;main(String[]&#160;args)&#160;{ &#160;&#160;&#160;&#160;int&#160;n0&#160;=&#160;1,&#160;n1&#160;=&#160;1,&#160;n2; &#160;&#160;&#160;&#160;System.out.print(n0&#160;+&#160;&#34;&#160;&#34;&#160;+&#160;n1&#160;+&#160;&#34;&#160;&#34;); &#160;&#160;&#160;&#160;for&#160;(int&#160;i&#160;=&#160;0;&#160;i&#160;&#60;&#160;18;&#160;i++)&#160;{ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=76&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the ugliest constructs in Java is the <code>for</code> loop. The enhanced <code>for</code> in Java 5 improved readability but Groovy has alternatives that are even better. Let&#8217;s take a look. Here is Java code (from <em>Java Examples in a Nutshell</em>, 2nd Ed.) that prints the first 20 Fibonacci numbers:
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
<tr><!-- start source code -->
<td nowrap="nowrap" valign="top" align="left"><code><font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font><font color="#000000">Fibonacci&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;static&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">main</font><font color="#000000">(</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">args</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">n0&nbsp;=&nbsp;</font><font color="#990000">1</font><font color="#000000">,&nbsp;n1&nbsp;=&nbsp;</font><font color="#990000">1</font><font color="#000000">,&nbsp;n2;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#000000">n0&nbsp;+&nbsp;</font><font color="#2a00ff">&#34;&nbsp;&#34;&nbsp;</font><font color="#000000">+&nbsp;n1&nbsp;+&nbsp;</font><font color="#2a00ff">&#34;&nbsp;&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;</font><font color="#990000">18</font><font color="#000000">;&nbsp;i++</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">n2&nbsp;=&nbsp;n1&nbsp;+&nbsp;n0;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#000000">n2&nbsp;+&nbsp;</font><font color="#2a00ff">&#34;&nbsp;&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">n0&nbsp;=&nbsp;n1;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">n1&nbsp;=&nbsp;n2;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font></code>
</td>
<p><!-- end source code --><br />
</tr>
</table>
</div>
<p>Typical stuff; <code>for</code> is utilized to execute a loop a certain number of times, in this case eighteen. Groovy handles this much better.
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
<tr><!-- start source code -->
<td nowrap="nowrap" valign="top" align="left"><code><font color="#000000">def&nbsp;list&nbsp;=&nbsp;</font><font color="#000000">[</font><font color="#990000">0</font><font color="#000000">,&nbsp;</font><font color="#990000">1</font><font color="#000000">]</font><br />
<font color="#ffffff"></font><br />
<font color="#990000">20.</font><font color="#000000">times&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">print&nbsp;</font><font color="#2a00ff">&#34;${list.last()}&nbsp;&#34;</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">list&nbsp;&lt;&lt;&nbsp;list.sum</font><font color="#000000">()</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">list&nbsp;=&nbsp;list.tail</font><font color="#000000">()</font><br />
<font color="#000000">}</font></code></p>
</td>
<p>  <!-- end source code --><br />
   </tr>
</table>
</div>
<p>Because everything&#8217;s an object in Groovy, <code>20</code> is an Integer with all the extra methods supplied by the GDK. The <code>times()</code> method effectively executes the closure <code>20.intValue()</code> number of times. </p>
<p>There&#8217;s some cool stuff going on with the Groovy list too; Instead of using 3 variables to track 2 values, we use a variable size list. Each iteration of the closure prints the last element in the list. Next, we sum up all the list elements and push the value onto the end of the list. <code>list.trail()</code> then lops off the first element in the list so we&#8217;re left with the next two numbers in the Fibonacci series.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=76&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2008/12/09/fibonaccigroovy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>gMd5Sum</title>
		<link>http://groovybargrill.wordpress.com/2008/08/18/gmd5sum/</link>
		<comments>http://groovybargrill.wordpress.com/2008/08/18/gmd5sum/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 11:35:48 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/?p=35</guid>
		<description><![CDATA[I&#8217;ve written a Groovy version of winMd5Sum, a MD5 checksumming utility. Visit the gMd5Sum page for download and more. One of my objectives was to explore Java&#8217;s system tray feature (so you&#8217;ll need Java 6.) It works (clicking on the red X in the upper right hand corner minimizes the application to the system tray) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=35&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a Groovy version of <a href="http://www.nullriver.com/products">winMd5Sum</a>, a MD5 checksumming utility.</p>
<p>Visit the gMd5Sum <a href="http://groovybargrill.wordpress.com/gmd5sum/">page</a> for download and more.</p>
<p>One of my objectives was to explore Java&#8217;s system tray feature (so you&#8217;ll need Java 6.) It works (clicking on the red X in the upper right hand corner minimizes the application to the system tray) but SwingBuilder has no implementation (as far as I can tell) so it&#8217;s coded wholly outside SwingBuilder. I haven&#8217;t attached a popup menu to the tray icon yet, that&#8217;s on the roadmap.</p>
<p>SwingBuilder has some hidden features that aren&#8217;t necessarily very intuitive. For example, I set the system look and feel with this code:</p>
<pre><code>UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());</code></pre>
<p>until I ran across this (much Groovier) method:</p>
<pre><code>swing.lookAndFeel 'system'
</code></pre>
<p>source code is now available on the google code <a href="http://code.google.com/p/gmd5sum/">site</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=35&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2008/08/18/gmd5sum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Grails != Groovy</title>
		<link>http://groovybargrill.wordpress.com/2007/10/06/grails-groovy/</link>
		<comments>http://groovybargrill.wordpress.com/2007/10/06/grails-groovy/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 12:45:11 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Bar]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/2007/10/06/grails-groovy/</guid>
		<description><![CDATA[Anyone remember the Amiga? My memory may be a bit fuzzy, but I remember its architecture as being light-years ahead of its time. One of its most remarkable features was its ability to display millions of colors at a time when the PC was limited to 16. Because of its advanced color and graphic capabilities, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=23&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Anyone remember the Amiga? My memory may be a bit fuzzy, but I remember its architecture as being light-years ahead of its time. One of its most remarkable features was its ability to display millions of colors at a time when the PC was limited to 16. Because of its advanced color and graphic capabilities, it eventually became the basis for NewTek&#8217;s Video Toaster, an advanced (for its time) and inexpensive (for its time) video processing system. We&#8217;re talking at least 15 years ago, when video on the PC wasn&#8217;t even a pipe dream.</p>
<p>So, where am I going with this? The Amiga&#8217;s strengths were its downfall. It was relegated to a niche market and eventually withered on the vine. It seems to me that a disproportionately large portion of the buzz around Groovy (what buzz there is) is centered around Grails. Now, Grails may be great, but Groovy is so much more. If Grails becomes the primary reason to adopt Groovy and then loses its head-to-head bout with ROR, Groovy may go the way of the Amiga: excellent but ignored.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=23&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2007/10/06/grails-groovy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Groovy TimeBox</title>
		<link>http://groovybargrill.wordpress.com/2007/04/11/groovy-timebox/</link>
		<comments>http://groovybargrill.wordpress.com/2007/04/11/groovy-timebox/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 10:05:21 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/2007/04/11/groovy-timebox/</guid>
		<description><![CDATA[Here&#8217;s my humble solution to the TimeBox quiz posted over at GroovyQuiz. A couple of things I think are noteworthy Populating a comboBox with a range is slick. comboBox(items:1..12) results in Integers with values 1 &#8211; 12 inserted into the combo box model. Getting the selected value is even slicker: cb.selectedItem. SwingBuilder doesn&#8217;t make it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=14&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> Here&#8217;s my humble solution to the <a href="http://groovyquiz.com/groovyquiz/main/quiz/2">TimeBox quiz</a> posted over at GroovyQuiz.</p>
<p><img src="http://groovybargrill.files.wordpress.com/2007/04/timebox.jpg" alt="Screenshot" /></p>
<p><img src="http://groovybargrill.files.wordpress.com/2007/04/timebox-02.jpg" alt="Screenshot" /></p>
<p>A couple of things I think are noteworthy</p>
<ol>
<li>Populating a comboBox with a range is slick. comboBox(items:1..12) results in Integers with values 1 &#8211; 12 inserted into the combo box model. Getting the selected value is even slicker: cb.selectedItem.</li>
<li>SwingBuilder doesn&#8217;t make it any easier to work with layout managers, at least as far as I could see. Not that I expected it to but it would have been nice.</li>
<li>Lesson learned: &#8217;5&#8242; as Integer is NOT the same as &#8217;5&#8242;.toInteger().</li>
<li>Because I used SwingWorker, Java 6 is required.</li>
</ol>
<p><a href="http://groovybargrill.files.wordpress.com/2007/04/timebox.doc" title="Timebox">download</a> and rename to Timebox.jar</p>
<p>[Update: Rather than repost code as I make changes, I'll provide a link to download the code and include a current screen shot so you can determine if you've got the most recent version]</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=14&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2007/04/11/groovy-timebox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>

		<media:content url="http://groovybargrill.files.wordpress.com/2007/04/timebox.jpg" medium="image">
			<media:title type="html">Screenshot</media:title>
		</media:content>

		<media:content url="http://groovybargrill.files.wordpress.com/2007/04/timebox-02.jpg" medium="image">
			<media:title type="html">Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Grails Finds Multiple ApplicationBootStrap Files</title>
		<link>http://groovybargrill.wordpress.com/2007/03/07/grails-finds-multiple-applicationbootstrap-files/</link>
		<comments>http://groovybargrill.wordpress.com/2007/03/07/grails-finds-multiple-applicationbootstrap-files/#comments</comments>
		<pubDate>Thu, 08 Mar 2007 02:42:13 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Grails]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/2007/03/07/grails-finds-multiple-applicationbootstrap-files/</guid>
		<description><![CDATA[GRAILS-920 [Update: Three weeks and no affirmation about this issue. I get the same error  on my work PC, so I don't think it's my environment. Nevertheless, I upgraded to Java 6 U1 and now I merely get the "native2ascii" error. Grails is unusable since I can't generate any views. Guess I'll wander over and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=13&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://jira.codehaus.org/browse/GRAILS-920">GRAILS-920</a></p>
<p>[Update: Three weeks and no affirmation about this issue. I get the same error  on my work PC, so I don't think it's my environment. Nevertheless, I upgraded to Java 6 U1 and now I merely get the "native2ascii" error. Grails is unusable since I can't generate any views. Guess I'll wander over and take a look at <a href="http://code.google.com/webtoolkit/">GWT</a>.]</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=13&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2007/03/07/grails-finds-multiple-applicationbootstrap-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Groovy Principle of Least Surprise Violation?</title>
		<link>http://groovybargrill.wordpress.com/2007/02/26/groovy-principle-of-least-surprise-violation/</link>
		<comments>http://groovybargrill.wordpress.com/2007/02/26/groovy-principle-of-least-surprise-violation/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 02:21:07 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Bar]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/2007/02/26/groovy-principle-of-least-surprise-violation/</guid>
		<description><![CDATA[Anyone else surprised this code works? class Book { private title } def book = new Book() book.title = 'Principle of Least Surprise' assert book.title == 'Principle of Least Surprise' Since title is private, shouldn&#8217;t I have to access it via getters and setters?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=12&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Anyone else surprised this code works?<br />
<code><br />
class Book {<br />
private title<br />
}</code></p>
<p><code>def book = new Book()<br />
book.title = 'Principle of Least Surprise'<br />
assert book.title == 'Principle of Least Surprise'</code></p>
<p>Since <code>title</code> is private, shouldn&#8217;t I have to access it via getters and setters?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=12&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2007/02/26/groovy-principle-of-least-surprise-violation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Groovy Category Example</title>
		<link>http://groovybargrill.wordpress.com/2006/09/14/groovy-category-example/</link>
		<comments>http://groovybargrill.wordpress.com/2006/09/14/groovy-category-example/#comments</comments>
		<pubDate>Fri, 15 Sep 2006 02:43:42 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">http://groovybargrill.wordpress.com/2006/09/14/groovy-category-example/</guid>
		<description><![CDATA[I cut my Java teeth on an old edition of Java Examples in a Nutshell. I thought it might be a good exercise to translate some of the Java code to Groovy. By the second example in the book I realized I was right. The example prints out every number from 1 to 100, except [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=10&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I cut my Java teeth on an old edition of Java Examples in a Nutshell. I thought it might be a good exercise to translate some of the Java code to Groovy. By the second example in the book I realized I was right. The example prints out every number from 1 to 100, except that if the number the number is divisible by 5 it prints &#8220;fizz,&#8221; if it is divisible by 7 it prints &#8220;buzz,&#8221; and if it is divisible by both 5 and 7 it prints &#8220;fizzbuzz.&#8221;</p>
<p>Like most examples in the book, the Java code is not exactly exemplary, as evidenced here:</p>
<p><title></title>          <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->          <!-- ======================================================== --> <!-- = Java Sourcecode to HTML automatically converted code = --> <!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = --> <!-- =     Further information: http://www.java2html.de     = --></p>
<p class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="left" nowrap="nowrap" valign="top"><code> <font color="#7f0055"><strong>public class </strong></font><font color="#000000">FizzBuzz </font><font color="#000000">{</font><br />
<font color="#ffffff">    </font><br />
<font color="#ffffff">    </font><font color="#7f0055"><strong>public static </strong></font><font color="#7f0055"><strong>void </strong></font><font color="#000000">main</font><font color="#000000">(</font><font color="#000000">String</font><font color="#000000">[] </font><font color="#000000">args</font><font color="#000000">) {</font><br />
<font color="#ffffff">        </font><font color="#7f0055"><strong>for </strong></font><font color="#000000">(</font><font color="#7f0055"><strong>int </strong></font><font color="#000000">i = </font><font color="#990000">1</font><font color="#000000">; i &lt;= </font><font color="#990000">100</font><font color="#000000">; i++</font><font color="#000000">) {</font><br />
<font color="#ffffff">            </font><font color="#7f0055"><strong>if </strong></font><font color="#000000">(((</font><font color="#000000">i % </font><font color="#990000">5</font><font color="#000000">) </font><font color="#000000">== </font><font color="#990000">0</font><font color="#000000">) </font><font color="#000000">&amp;&amp; </font><font color="#000000">((</font><font color="#000000">i % </font><font color="#990000">7</font><font color="#000000">) </font><font color="#000000">== </font><font color="#990000">0</font><font color="#000000">))</font><br />
<font color="#ffffff">                </font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#2a00ff">"fizzbuzz"</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">            </font><font color="#7f0055"><strong>else if </strong></font><font color="#000000">((</font><font color="#000000">i % </font><font color="#990000">5</font><font color="#000000">) </font><font color="#000000">== </font><font color="#990000">0</font><font color="#000000">)</font><br />
<font color="#ffffff">                </font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#2a00ff">"fizz"</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">            </font><font color="#7f0055"><strong>else if </strong></font><font color="#000000">((</font><font color="#000000">i % </font><font color="#990000">7</font><font color="#000000">) </font><font color="#000000">== </font><font color="#990000">0</font><font color="#000000">)</font><br />
<font color="#ffffff">                </font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#2a00ff">"buzz"</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">            </font><font color="#7f0055"><strong>else</strong></font><br />
<font color="#ffffff">                </font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#000000">i</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">        </font><font color="#000000">} </font><font color="#000000">System.out.print</font><font color="#000000">(</font><font color="#2a00ff">" "</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">    </font><font color="#000000">}</font><br />
<font color="#000000">}</font></code></td>
</tr>
</table>
<p><!-- =       END of automatically generated HTML code       = --> <!-- ======================================================== -->I like self-documenting code so rather than use comments to explain the logic, I try to write code that is readable by non-programmers. Using a Groovy Category to add a method to an existing Java class makes that job easier. Since the Category examples on the Groovy site are not very intuitive, I thought I&#8217;d share an example here:</p>
<p><title></title>          <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->          <!-- ======================================================== --> <!-- = Java Sourcecode to HTML automatically converted code = --> <!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = --> <!-- =     Further information: http://www.java2html.de     = --></p>
<p class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="left" nowrap="nowrap" valign="top"><code> <font color="#000000">use </font><font color="#000000">(</font><font color="#000000">Multiplicity.</font><font color="#7f0055"><strong>class</strong></font><font color="#000000">) {</font><br />
<font color="#ffffff">  </font><font color="#000000">range = </font><font color="#990000">1..100</font><br />
<font color="#ffffff">  </font><font color="#000000">range.each </font><font color="#000000">{</font><font color="#000000">number -&gt;</font><br />
<font color="#ffffff">    </font><font color="#7f0055"><strong>if </strong></font><font color="#000000">(</font><font color="#000000">number.isMultipleOf</font><font color="#000000">(</font><font color="#990000">5</font><font color="#000000">) </font><font color="#000000">&amp;&amp; number.isMultipleOf</font><font color="#000000">(</font><font color="#990000">7</font><font color="#000000">)) {</font><br />
<font color="#ffffff">      </font><font color="#000000">print </font><font color="#2a00ff">"fizzbuzz"</font><br />
<font color="#ffffff">    </font><font color="#000000">} </font><font color="#7f0055"><strong>else if </strong></font><font color="#000000">(</font><font color="#000000">number.isMultipleOf</font><font color="#000000">(</font><font color="#990000">5</font><font color="#000000">)) {</font><br />
<font color="#ffffff">      </font><font color="#000000">print </font><font color="#2a00ff">"fizz"</font><br />
<font color="#ffffff">    </font><font color="#000000">} </font><font color="#7f0055"><strong>else if </strong></font><font color="#000000">(</font><font color="#000000">number.isMultipleOf</font><font color="#000000">(</font><font color="#990000">7</font><font color="#000000">)) {</font><br />
<font color="#ffffff">      </font><font color="#000000">print </font><font color="#2a00ff">"buzz"</font><br />
<font color="#ffffff">    </font><font color="#000000">} </font><font color="#7f0055"><strong>else </strong></font><font color="#000000">{</font><br />
<font color="#ffffff">      </font><font color="#000000">print </font><font color="#2a00ff">"${number}"</font><br />
<font color="#ffffff">    </font><font color="#000000">}</font><br />
<font color="#ffffff">    </font><font color="#000000">print </font><font color="#2a00ff">" "</font><br />
<font color="#ffffff">  </font><font color="#000000">}</font><br />
<font color="#000000">}</font><br />
<font color="#ffffff">  </font><br />
<font color="#7f0055"><strong>class </strong></font><font color="#000000">Multiplicity </font><font color="#000000">{</font><br />
<font color="#ffffff">  </font><font color="#7f0055"><strong>static </strong></font><font color="#7f0055"><strong>boolean </strong></font><font color="#000000">isMultipleOf</font><font color="#000000">(</font><font color="#000000">Integer dividend, Integer divisor</font><font color="#000000">) {</font><br />
<font color="#ffffff">    </font><font color="#000000">dividend % divisor == </font><font color="#990000">0</font><br />
<font color="#ffffff">  </font><font color="#000000">}</font><br />
<font color="#000000">}</font></code></td>
</tr>
</table>
<p><!-- =       END of automatically generated HTML code       = --> <!-- ======================================================== -->This is what I like about Groovy. Not only is there less code (fewer keystrokes) but (and maybe more importantly) there is less to read in order to grasp the logic.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=10&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2006/09/14/groovy-category-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Groovy Log Splitter</title>
		<link>http://groovybargrill.wordpress.com/2006/08/29/groovy-log-splitter/</link>
		<comments>http://groovybargrill.wordpress.com/2006/08/29/groovy-log-splitter/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 02:46:06 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">https://groovybargrill.wordpress.com/2006/08/29/groovy-log-splitter/</guid>
		<description><![CDATA[Matt and Blaine are having fun writing Ruby log splitters. I couldn&#8217;t pass up the opportunity to write one in Groovy, so here it is:   baseFilename = args.size() &#62; 0 ? args[0] : "split.log"   maxLines = args.size() == 2 ? args[1] : 500000   fileCount = 0   lineCount = 0   inputFile = new File(baseFilename)   writer = newWriter(baseFilename)   inputFile.eachLine {     if (lineCount &#62;= maxLines) {       writer = newWriter(baseFilename)     }     writer.append("${it}\n")     lineCount++   }      def newWriter(filename) {     lineCount = 0     new File("${fileCount++}_${filename}")   }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=9&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.secosoft.net/2006/08/25/simple-ruby-log-splitter/">Matt</a> and <a href="http://blog.blainebuxton.com/">Blaine</a> are having fun writing Ruby log splitters. I couldn&#8217;t pass up the opportunity to write one in Groovy, so here it is:</p>
<p><title></title>           <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->          <!-- ======================================================== --> <!-- = Java Sourcecode to HTML automatically converted code = --> <!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = --> <!-- =     Further information: http://www.java2html.de     = --></p>
<p class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="left" nowrap="nowrap" valign="top"><code> <font color="#ffffff">  </font><font color="#000000">baseFilename = args.size</font><font color="#000000">() </font><font color="#000000">&gt; </font><font color="#990000">0 </font><font color="#000000">? args</font><font color="#000000">[</font><font color="#990000">0</font><font color="#000000">] </font><font color="#000000">: </font><font color="#2a00ff">"split.log"</font><br />
<font color="#ffffff">  </font><font color="#000000">maxLines = args.size</font><font color="#000000">() </font><font color="#000000">== </font><font color="#990000">2 </font><font color="#000000">? args</font><font color="#000000">[</font><font color="#990000">1</font><font color="#000000">] </font><font color="#000000">: </font><font color="#990000">500000</font><br />
<font color="#ffffff">  </font><font color="#000000">fileCount = </font><font color="#990000">0</font><br />
<font color="#ffffff">  </font><font color="#000000">lineCount = </font><font color="#990000">0</font><br />
<font color="#ffffff">  </font><font color="#000000">inputFile = </font><font color="#7f0055"><b>new </b></font><font color="#000000">File</font><font color="#000000">(</font><font color="#000000">baseFilename</font><font color="#000000">)</font><br />
<font color="#ffffff">  </font><font color="#000000">writer = newWriter</font><font color="#000000">(</font><font color="#000000">baseFilename</font><font color="#000000">)</font><br />
<font color="#ffffff">  </font><font color="#000000">inputFile.eachLine </font><font color="#000000">{</font><br />
<font color="#ffffff">    </font><font color="#7f0055"><b>if </b></font><font color="#000000">(</font><font color="#000000">lineCount &gt;= maxLines</font><font color="#000000">) {</font><br />
<font color="#ffffff">      </font><font color="#000000">writer = newWriter</font><font color="#000000">(</font><font color="#000000">baseFilename</font><font color="#000000">)</font><br />
<font color="#ffffff">    </font><font color="#000000">}</font><br />
<font color="#ffffff">    </font><font color="#000000">writer.append</font><font color="#000000">(</font><font color="#2a00ff">"${it}\n"</font><font color="#000000">)</font><br />
<font color="#ffffff">    </font><font color="#000000">lineCount++</font><br />
<font color="#ffffff">  </font><font color="#000000">}</font><br />
<font color="#ffffff">  </font><br />
<font color="#ffffff">  </font><font color="#000000">def newWriter</font><font color="#000000">(</font><font color="#000000">filename</font><font color="#000000">) {</font><br />
<font color="#ffffff">    </font><font color="#000000">lineCount = </font><font color="#990000">0</font><br />
<font color="#ffffff">    </font><font color="#7f0055"><b>new </b></font><font color="#000000">File</font><font color="#000000">(</font><font color="#2a00ff">"${fileCount++}_${filename}"</font><font color="#000000">)</font><br />
<font color="#ffffff">  </font><font color="#000000">}</font></code></td>
</tr>
</table>
<p><!-- =       END of automatically generated HTML code       = --> <!-- ======================================================== --></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=9&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2006/08/29/groovy-log-splitter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
		<item>
		<title>Extraneous Period in Groovy println</title>
		<link>http://groovybargrill.wordpress.com/2006/08/16/extraneous-period-in-groovy-println/</link>
		<comments>http://groovybargrill.wordpress.com/2006/08/16/extraneous-period-in-groovy-println/#comments</comments>
		<pubDate>Wed, 16 Aug 2006 18:26:02 +0000</pubDate>
		<dc:creator>jawild59</dc:creator>
				<category><![CDATA[Groovy Grill]]></category>

		<guid isPermaLink="false">https://groovybargrill.wordpress.com/2006/08/16/extraneous-period-in-groovy-println/</guid>
		<description><![CDATA[Update: Looks like it&#8217;s a problem in GroovyTestCase. testXXX() method always outputs a &#8220;.&#8221; Update: Ah. It&#8217;s JUnit&#8217;s text-based test runner that is the culprit. Guess I shouldn&#8217;t exclusively use the GUI runner. GROOVY-1463. Running this test: class PrintlnTest extends GroovyTestCase { void testSomething() { def name = GroovyTestCase.class.simpleName assertEquals(GroovyTestCase.class.simpleName, name) assertTrue(name.length() == "GroovyTestCase".length()) println [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=7&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Update: Looks like it&#8217;s a problem in GroovyTestCase. testXXX() method always outputs a &#8220;.&#8221;</p>
<p>Update: Ah. It&#8217;s JUnit&#8217;s text-based test runner that is the culprit. Guess I shouldn&#8217;t exclusively use the GUI runner.</p>
<p><a href="http://jira.codehaus.org/browse/GROOVY-1463">GROOVY-1463</a>.</p>
<p>Running this test:</p>
<pre>class PrintlnTest extends GroovyTestCase {
  void testSomething() {
    def name = GroovyTestCase.class.simpleName
    assertEquals(GroovyTestCase.class.simpleName, name)
    assertTrue(name.length() == "GroovyTestCase".length())
    println name
    println name
  }
}</pre>
<p>produces this output:</p>
<pre>.GroovyTestCase
GroovyTestCase

Time: 0

OK (1 test)</pre>
<p>Anyone have a clue?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/groovybargrill.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/groovybargrill.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/groovybargrill.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/groovybargrill.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/groovybargrill.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=groovybargrill.wordpress.com&amp;blog=279276&amp;post=7&amp;subd=groovybargrill&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://groovybargrill.wordpress.com/2006/08/16/extraneous-period-in-groovy-println/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/922aaae7ba693870ffcfb34d96625d9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jawild59</media:title>
		</media:content>
	</item>
	</channel>
</rss>
