<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-3376508392331888241</id><updated>2009-11-07T23:33:13.892-08:00</updated><title type="text">curious-attempt-bunny</title><subtitle type="html">Inquisitive guinea pig =&gt;
neugieriges Versuchskaninschen =&gt; curious attemptbunny</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://curious-attempt-bunny.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default?start-index=26&amp;max-results=25" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>348</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/curious-attempt-bunny" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-2886145314926883562</id><published>2009-11-07T23:25:00.000-08:00</published><updated>2009-11-07T23:33:13.921-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">Late to the Party</title><content type="html">I just worked my way through this fantastic game. Great stuff! Could it be that you haven't played &lt;a href="http://en.wikipedia.org/wiki/Portal_%28video_game%29"&gt;Portal&lt;/a&gt; already?&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Y6ljFaKRTrI&amp;hl=en&amp;fs=1&amp;rel=0"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Y6ljFaKRTrI&amp;hl=en&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-2886145314926883562?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/ycWN8ty0JBI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/2886145314926883562/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=2886145314926883562" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2886145314926883562" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2886145314926883562" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/ycWN8ty0JBI/late-to-party.html" title="Late to the Party" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/11/late-to-party.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-854281379414886109</id><published>2009-11-07T10:28:00.000-08:00</published><updated>2009-11-07T10:40:12.863-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="mac" /><title type="text">Wow, Mac Wins</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_AGVcmhlbFXA/SvW-3_uLIzI/AAAAAAAAAVQ/DSBjAKfO9xY/s1600-h/mac+wins.png"&gt;&lt;img style="float:right; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 100px; height: 117px;" src="http://2.bp.blogspot.com/_AGVcmhlbFXA/SvW-3_uLIzI/AAAAAAAAAVQ/DSBjAKfO9xY/s400/mac+wins.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5401433197307962162" /&gt;&lt;/a&gt;I was just cleaning up my pile of computer bits, and I found a USB hard drive that I've not used in a while. After browsing the contents I felt it was time to wipe it clean. I wanted to format it to be Windows friendly just in case. Linux felt like the best tool for the job there, and a combo of fdisk and mkfs.vfat accomplished that pretty quickly. I wanted to find a good tool to test the disk for bad sectors (testdisk?) and that's when I noticed:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;OMG. I haven't even installed Firefox in Ubuntu since installing 9.04 back in April! I just don't use Linux any more. Mac has won me over that completely.&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-854281379414886109?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/Gj7x8PH-rkw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/854281379414886109/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=854281379414886109" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/854281379414886109" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/854281379414886109" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/Gj7x8PH-rkw/wow-mac-wins.html" title="Wow, Mac Wins" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_AGVcmhlbFXA/SvW-3_uLIzI/AAAAAAAAAVQ/DSBjAKfO9xY/s72-c/mac+wins.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/11/wow-mac-wins.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-8762394886643068113</id><published>2009-10-23T19:40:00.000-07:00</published><updated>2009-10-23T20:08:17.610-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dht" /><category scheme="http://www.blogger.com/atom/ns#" term="hadoop" /><title type="text">Distributed Solutions: What is out there?</title><content type="html">I've been reading the Hadoop book mainly to learn more about the MapReduce approach to scaling solutions. Pig is interesting but not update-oriented. Hive sounds like the closest Hadoop tool but that's not right either:&lt;br /&gt;&lt;br /&gt;"Hive is based on Hadoop which is a batch processing system. ... For Hive queries response times for even the smallest jobs can be of the order of 5-10 minutes and for larger jobs this may even run into hours." [&lt;a href="http://wiki.apache.org/hadoop/Hive"&gt;more&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;I'm looking for something that can distribute a large set of data across a number of machines, and then be able to let me coordinate processing the data in such a way that each machine works on whatever portion of the data it has held locally. That's why Hadoop was sounding so promising. The other requirement I have is that the data can be supplemented on the fly. Some lag is acceptable, but ultimately I think this eliminates Hadoop also as it's append-only approach is incompatible here.&lt;br /&gt;&lt;br /&gt;A basic Distributed Hash Table that supports partitioning of the data would be perfect if it has some way of knowing what data it "owned" locally. Infinispan looks like it might be a good fit once it matures. Unfortunately "the ability to move the code to where the data is and execute it there" [&lt;a href="https://jira.jboss.org/jira/browse/ISPN-39"&gt;issue&lt;/a&gt;] is part of the last milestone on their road map horizon. &lt;br /&gt;&lt;br /&gt;Hmm. Infinispan, Project Voldemort, and Riak. They will all know what data they have cached locally. And that's half way to being able to execute a job in a partitioned way. The other half is either modeling some concept of which node as the "primary" cache of some data, or having a way of resolving any duplication of work between nodes. Hadoop solves this problem by having an indexer that keeps track of which nodes own what and where everything has been replicated to.&lt;br /&gt;&lt;br /&gt;What's the solution for a technology that hasn't necessarily been designed with this consideration in mind? What do people do when they have outgrown their RDBMS and still want to be able to process large volumes of data for quick ad-hoc queries?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-8762394886643068113?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/A1dDdsNbWq8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/8762394886643068113/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=8762394886643068113" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8762394886643068113" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8762394886643068113" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/A1dDdsNbWq8/distributed-solutions-what-is-out-there.html" title="Distributed Solutions: What is out there?" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/distributed-solutions-what-is-out-there.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-8268843966586100548</id><published>2009-10-17T12:58:00.000-07:00</published><updated>2009-10-17T13:24:56.772-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><title type="text">Firefox 3.5: Firefox doesn't know how to open this address, because the protocol (foo) isn't associated with any program.</title><content type="html">Humph. I'm not having any success creating a new protocol that maps to an external application in Firefox. I have these in my &lt;code&gt;prefs.js&lt;/code&gt;:&lt;code&gt;&lt;pre&gt;user_pref("network.protocol-handler.app.foo",&lt;br /&gt;  "/Applications/TextEdit.app/Contents/MacOS/TextEdit");&lt;br /&gt;user_pref("network.protocol-handler.expose.foo", true);&lt;br /&gt;user_pref("network.protocol-handler.external.foo", true);&lt;br /&gt;user_pref("network.protocol-handler.warn-external.foo", false);&lt;/pre&gt;&lt;/code&gt;Have you got it working?&lt;br /&gt;&lt;br /&gt;I've seen these: &lt;a href="http://support.mozilla.com/en-US/kb/The+protocol+is+not+associated+with+any+program"&gt;knowledge base entry&lt;/a&gt;, &lt;a href="http://kb.mozillazine.org/Register_protocol"&gt;registering a protocol&lt;/a&gt;, and &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=312953"&gt;path not found error&lt;/a&gt;. This one I didn't get to the bottom of: &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=173010"&gt;whitelisting protocols&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's my &lt;code&gt;about:config&lt;/code&gt; which shows my default settings as well:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_AGVcmhlbFXA/StonJPlZfXI/AAAAAAAAAVI/nRDBElcDDw4/s1600-h/firefox-about-config.png"&gt;&lt;img style="display:block;text-align:center;cursor:pointer; cursor:hand;width: 550px; padding: 0px; border: 0px;" src="http://2.bp.blogspot.com/_AGVcmhlbFXA/StonJPlZfXI/AAAAAAAAAVI/nRDBElcDDw4/s400/firefox-about-config.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5393666543485287794" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-8268843966586100548?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/KnW8kj_0Qpw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/8268843966586100548/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=8268843966586100548" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8268843966586100548" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8268843966586100548" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/KnW8kj_0Qpw/firefox-35-firefox-doesnt-know-how-to.html" title="Firefox 3.5: Firefox doesn't know how to open this address, because the protocol (foo) isn't associated with any program." /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_AGVcmhlbFXA/StonJPlZfXI/AAAAAAAAAVI/nRDBElcDDw4/s72-c/firefox-about-config.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/firefox-35-firefox-doesnt-know-how-to.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-2590349533016214559</id><published>2009-10-16T22:44:00.000-07:00</published><updated>2009-10-16T22:51:05.132-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop" /><title type="text">Hadoop Streaming: java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127</title><content type="html">So, my most recent problem was that my hadoop streaming job was failing, and the tracking url was listing this exception under "Failed/Killed&lt;br /&gt;Task Attempts":&lt;code&gt;&lt;pre&gt;java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127&lt;br /&gt; at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:311)&lt;br /&gt; at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:540)&lt;br /&gt; at org.apache.hadoop.streaming.PipeMapper.close(PipeMapper.java:132)&lt;br /&gt; at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57)&lt;br /&gt; at org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java:36)&lt;br /&gt; at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:358)&lt;br /&gt; at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)&lt;br /&gt; at org.apache.hadoop.mapred.Child.main(Child.java:170)&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;Digging around in the logs directory I found a fuller explanation:&lt;code&gt;&lt;pre&gt;env: groovy: No such file or directory&lt;br /&gt;java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127&lt;/pre&gt;&lt;/code&gt;My groovy script was failing to launch - presumably because groovy wasn't visible on the path. My hacked solution was to hardcode the path to groovy in my script:&lt;code&gt;&lt;pre&gt;#!/usr/bin/env /Users/user/Applications/groovy-1.6-RC-2/bin/groovy&lt;/pre&gt;&lt;/code&gt;And then, voila! It worked!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-2590349533016214559?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/1XV-DOgykoQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/2590349533016214559/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=2590349533016214559" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2590349533016214559" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2590349533016214559" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/1XV-DOgykoQ/hadoop-streaming-javalangruntimeexcepti.html" title="Hadoop Streaming: java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/hadoop-streaming-javalangruntimeexcepti.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-7186216204705105617</id><published>2009-10-16T21:55:00.000-07:00</published><updated>2009-10-16T22:04:24.990-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop" /><title type="text">Hadoop Streaming: Cannot run program</title><content type="html">I'm working from the Hadoop book, and I'm noticing some gaps. When I ran hadoop using streaming like this, my job hangs:&lt;code&gt;&lt;pre&gt;$ hadoop jar $HADOOP_INSTALL/contrib/streaming/hadoop-0.20.1-streaming.jar \&lt;br /&gt;  -input movies.input.txt -output output -mapper movies.map.groovy \&lt;br /&gt;  -reducer movies.reduce.groovy &lt;br /&gt;packageJobJar: [/tmp/hadoop-user/hadoop-unjar2417163781720808364/] [] /var/folders/Ht/HtruzsCeGAukVrRT16Q4+k+++TI/-Tmp-/streamjob7394763723023597419.jar tmpDir=null&lt;br /&gt;09/10/16 21:13:46 INFO mapred.FileInputFormat: Total input paths to process : 1&lt;br /&gt;09/10/16 21:13:47 INFO streaming.StreamJob: getLocalDirs(): [/tmp/hadoop-user/mapred/local]&lt;br /&gt;09/10/16 21:13:47 INFO streaming.StreamJob: Running job: job_200910162029_0008&lt;br /&gt;09/10/16 21:13:47 INFO streaming.StreamJob: To kill this job, run:&lt;br /&gt;09/10/16 21:13:47 INFO streaming.StreamJob: /Users/user/Applications/hadoop-0.20.1/bin/../bin/hadoop job  -Dmapred.job.tracker=localhost:8021 -kill job_200910162029_0008&lt;br /&gt;09/10/16 21:13:47 INFO streaming.StreamJob: Tracking URL: http://localhost:50030/jobdetails.jsp?jobid=job_200910162029_0008&lt;br /&gt;09/10/16 21:13:48 INFO streaming.StreamJob:  map 0%  reduce 0%&lt;br /&gt;^C&lt;/pre&gt;&lt;/code&gt;The tracking URL is handy, from there I could see that hadoop streaming wasn't able to run my groovy mapper:&lt;code&gt;&lt;pre&gt;Caused by: java.io.IOException: Cannot run program "movies.map.groovy": error=2, No such file or directory&lt;br /&gt; at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)&lt;br /&gt; at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:166)&lt;br /&gt; ... 19 more&lt;/pre&gt;&lt;/code&gt;I was missing the &lt;a href="http://hadoop.apache.org/common/docs/r0.20.0/streaming.html#Package+Files+With+Job+Submissions"&gt;-file parameter&lt;/a&gt;. This now gets me to my next error...&lt;code&gt;&lt;pre&gt;$ hadoop jar $HADOOP_INSTALL/contrib/streaming/hadoop-0.20.1-streaming.jar \&lt;br /&gt;  -input movies.input.txt -output output -mapper movies.map.groovy \&lt;br /&gt;  -reducer movies.reduce.groovy -file movies.map.groovy -file movies.reduce.groovy&lt;/pre&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-7186216204705105617?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/evfP0q-wYkc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/7186216204705105617/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=7186216204705105617" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7186216204705105617" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7186216204705105617" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/evfP0q-wYkc/hadoop-streaming-cannot-run-program.html" title="Hadoop Streaming: Cannot run program" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/hadoop-streaming-cannot-run-program.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-2933764351314592205</id><published>2009-10-16T21:49:00.000-07:00</published><updated>2009-10-16T21:54:18.843-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop" /><title type="text">Hadoop: HDFS in a bad state</title><content type="html">I managed to get to the position where I could not copy files to my HDFS:&lt;code&gt;&lt;pre&gt;$ hadoop fs -copyFromLocal movies.input.txt movies.input.txt &lt;br /&gt;09/10/16 21:20:43 WARN hdfs.DFSClient: DataStreamer Exception:&lt;br /&gt;org.apache.hadoop.ipc.RemoteException: java.io.IOException:&lt;br /&gt;File /user/user/movies.input.txt could only be replicated to&lt;br /&gt;0 nodes, instead of 1&lt;/code&gt;&lt;/pre&gt;Formating my HDFS didn't help. &lt;a href="http://localhost:50070/dfshealth.jsp"&gt;http://localhost:50070/dfshealth.jsp&lt;/a&gt; was reporting that I had no live nodes. In the end I blew away my &lt;code&gt;/tmp/hadoop-user&lt;/code&gt; directory and followed up with a &lt;code&gt;hadoop namenode -format&lt;/code&gt; for good measure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-2933764351314592205?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/5ce0PKCXxuU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/2933764351314592205/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=2933764351314592205" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2933764351314592205" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2933764351314592205" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/5ce0PKCXxuU/hadoop-hdfs-in-bad-state.html" title="Hadoop: HDFS in a bad state" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/hadoop-hdfs-in-bad-state.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-6266500374113969040</id><published>2009-10-16T20:25:00.000-07:00</published><updated>2009-10-17T09:47:45.320-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop" /><title type="text">Hadoop: Error: JAVA_HOME is not set.</title><content type="html">If you get this when trying to use Hadoop:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;$ start-dfs.sh &lt;br /&gt;starting namenode, logging to /Users/user/Applications/hadoop-0.20.1/bin/../logs/hadoop-user-namenode-merlyn.local.out&lt;br /&gt;localhost: starting datanode, logging to /Users/user/Applications/hadoop-0.20.1/bin/../logs/hadoop-user-datanode-merlyn.local.out&lt;br /&gt;localhost: Error: JAVA_HOME is not set.&lt;br /&gt;localhost: starting secondarynamenode, logging to /Users/user/Applications/hadoop-0.20.1/bin/../logs/hadoop-user-secondarynamenode-merlyn.local.out&lt;br /&gt;localhost: Error: JAVA_HOME is not set.&lt;/pre&gt;&lt;/code&gt;Then edit &lt;code&gt;conf/hadoop-env.sh&lt;/code&gt; (I couldn't easily google this info).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Edit&lt;/b&gt;: I missed &lt;a href="http://hadoop.apache.org/common/docs/r0.20.0/quickstart.html"&gt;this&lt;/a&gt;: &lt;em&gt;Unpack the downloaded Hadoop distribution. In the distribution, edit the file conf/hadoop-env.sh to define at least JAVA_HOME to be the root of your Java installation.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;The file is helpful once you know it is relevant: &lt;br /&gt;# The only required environment variable is JAVA_HOME.  All others are&lt;br /&gt;# optional.  When running a distributed configuration it is best to&lt;br /&gt;# set JAVA_HOME in this file, so that it is correctly defined on&lt;br /&gt;# remote nodes.&lt;br /&gt;export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home&lt;/strike&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-6266500374113969040?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/itn7qzx3lvk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/6266500374113969040/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=6266500374113969040" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6266500374113969040" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6266500374113969040" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/itn7qzx3lvk/hadoop-error-javahome-is-not-set.html" title="Hadoop: Error: JAVA_HOME is not set." /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/hadoop-error-javahome-is-not-set.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-7453089073874464343</id><published>2009-10-04T22:03:00.000-07:00</published><updated>2009-10-04T22:20:54.191-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dd" /><category scheme="http://www.blogger.com/atom/ns#" term="p2v" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualbox" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu" /><title type="text">P2V: Hassles Cloning a Linux Installation as a Virtual Machine</title><content type="html">After some reading around, I settled on these tools to get the job done:&lt;ul&gt;&lt;li&gt;A Knoppix boot disc&lt;/li&gt;&lt;li&gt;An 8Gb USB pen drive&lt;/li&gt;&lt;li&gt;VirtualBox&lt;/li&gt;&lt;li&gt;dd, and fdisk&lt;/li&gt;&lt;/ul&gt;All free to use, all robust.&lt;br /&gt;&lt;br /&gt;I took a look at my partition table on my physical Ubuntu box:&lt;code&gt;&lt;pre&gt;$ fdisk -l /dev/hda&lt;br /&gt;Disk /dev/hda: 100.0 GB, 100030242816 bytes&lt;br /&gt;255 heads, 63 sectors/track, 12161 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;&lt;br /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/hda1               1         522     4192933+  83  Linux&lt;/pre&gt;&lt;/code&gt;Next, I copied the contents of hda1 to my pen drive:&lt;code&gt;&lt;pre&gt;$ dd if=/dev/hda1 of=/media/usb/hda1.raw bs=4096&lt;/pre&gt;&lt;/code&gt;I also copied the MBR:&lt;code&gt;&lt;pre&gt;$ dd if=/dev/hda of=/media/usb/mbr.raw bs=512 count=1&lt;/pre&gt;&lt;/code&gt;Back to my host computer and my fresh VirtualBox VM. I booted the VM using Knoppix, and then created the same partition layout (using fdisk expert mode to change the number of heads and sectors to match). I rebooted for good measure.&lt;br /&gt;&lt;br /&gt;After booting again in Knoppix I copied first the hda1 into place:&lt;code&gt;&lt;pre&gt;$ dd if=/media/usb/hda1.raw of=/dev/hda1 bs=4096&lt;/pre&gt;&lt;/code&gt;Then I copied the MBR:&lt;code&gt;&lt;pre&gt;$ dd if=/media/usb/mbr.raw of=/dev/hda bs=512 count=1&lt;/pre&gt;&lt;/code&gt;I rebooted, and my cloned system wouldn't start. Restarting with Knoppix, I confirmed that I have the following problem:&lt;code&gt;&lt;pre&gt;$ sudo mount /dev/hda1 ~/temp&lt;br /&gt;mount: /dev/hda1: can't read superblock&lt;/pre&gt;&lt;/code&gt;Now, I've tried this a number of different ways: without the mbr writing step, without tweaking the heads and sectors to match, with a partition larger than the original one - all to no avail.&lt;br /&gt;&lt;br /&gt;I'm not finding other people with this same problem. Does anyone have any ideas?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-7453089073874464343?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/g9_7bIfggN8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/7453089073874464343/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=7453089073874464343" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7453089073874464343" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7453089073874464343" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/g9_7bIfggN8/p2v-hassles-cloning-linux-installation.html" title="P2V: Hassles Cloning a Linux Installation as a Virtual Machine" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/10/p2v-hassles-cloning-linux-installation.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-6245969741087706595</id><published>2009-08-29T23:36:00.000-07:00</published><updated>2009-08-29T23:45:42.392-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">Ruby Warrior</title><content type="html">Here's an interesting &lt;a href="http://github.com/ryanb/ruby-warrior"&gt;programming puzzle&lt;/a&gt; (thanks &lt;a href="http://www.nigelthorne.com/"&gt;Nige&lt;/a&gt;). The challenge is to write a (stateless?) control function for a warrior, and have it fight its way up the stairs to the next level. This is the level I'm stuck on:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Level 6&lt;br /&gt;&lt;br /&gt;The wall behind you feels a bit further away in this room. And you hear more cries for help.&lt;br /&gt;&lt;br /&gt;Tip: You can walk backward by passing ':backward' as an argument to walk!. Same goes for feel, rescue! and attack!.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; --------&lt;br /&gt;|C @ S aa|&lt;br /&gt; --------&lt;/pre&gt;&lt;br /&gt;  &gt; = Stairs&lt;br /&gt;  @ = groo (20 HP)&lt;br /&gt;  C = Captive (1 HP)&lt;br /&gt;  S = Thick Sludge (24 HP)&lt;br /&gt;  a = Archer (7 HP)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Available Abilities:&lt;br /&gt;&lt;br /&gt;  warrior.walk!&lt;br /&gt;    Move in given direction (forward by default).&lt;br /&gt;&lt;br /&gt;  warrior.rest!&lt;br /&gt;    Gain 10% of max health back, but do nothing more.&lt;br /&gt;&lt;br /&gt;  warrior.feel&lt;br /&gt;    Returns a Space for the given direction (forward by default).&lt;br /&gt;&lt;br /&gt;  warrior.health&lt;br /&gt;    Returns an integer representing your health.&lt;br /&gt;&lt;br /&gt;  warrior.rescue!&lt;br /&gt;    Rescue a captive from his chains (earning 20 points) in given direction (forward by default).&lt;br /&gt;&lt;br /&gt;  warrior.attack!&lt;br /&gt;    Attack the unit in given direction (forward by default).&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Give it a shot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-6245969741087706595?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/NNRkiQdVLVI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/6245969741087706595/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=6245969741087706595" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6245969741087706595" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6245969741087706595" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/NNRkiQdVLVI/ruby-warrior.html" title="Ruby Warrior" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/ruby-warrior.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-8348697026546850752</id><published>2009-08-29T18:36:00.001-07:00</published><updated>2009-08-29T18:39:39.888-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="groovy" /><title type="text">Why Groovy? Why Not Ruby?</title><content type="html">I was talking to an old friend and telling him that I was coding a lot in Groovy in my spare time. He asked me why I wasn't coding my project in Ruby. I really didn't have a good answer for him.&lt;br /&gt;&lt;br /&gt;In fact I just looked back at some old Ruby code of mine and it does in fact look very similar to the Groovy code I've been writing. Hmm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-8348697026546850752?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/pverNjvQrQ0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/8348697026546850752/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=8348697026546850752" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8348697026546850752" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8348697026546850752" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/pverNjvQrQ0/why-groovy-why-not-ruby.html" title="Why Groovy? Why Not Ruby?" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/why-groovy-why-not-ruby.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-6337683385289220866</id><published>2009-08-15T23:03:00.000-07:00</published><updated>2009-08-15T23:07:30.856-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vm" /><title type="text">Opening Ports to a Virtualbox VM</title><content type="html">If you want to be able to connect to a service running on your Virtualbox VM, this is how to go about it. (global means it applies to any Virtualbox VM you run)&lt;br /&gt;&lt;code&gt;&lt;pre&gt;$ VBoxManage setextradata global "VBoxInternal/Devices/pcnet/0/LUN#0/Config/serviceName/Protocol" TCP&lt;br /&gt;$ VBoxManage setextradata global "VBoxInternal/Devices/pcnet/0/LUN#0/Config/serviceName/GuestPort" portInVM&lt;br /&gt;$ VBoxManage setextradata global "VBoxInternal/Devices/pcnet/0/LUN#0/Config/serviceName/HostPort" portExposedAs&lt;/pre&gt;&lt;/code&gt;See the &lt;a href="http://www.virtualbox.org/manual/UserManual.html#networkingdetails"&gt;full documentation&lt;/a&gt; for more info.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-6337683385289220866?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/GjxiPCnMDDU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/6337683385289220866/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=6337683385289220866" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6337683385289220866" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6337683385289220866" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/GjxiPCnMDDU/opening-ports-to-virtualbox-vm.html" title="Opening Ports to a Virtualbox VM" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/opening-ports-to-virtualbox-vm.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-6928362667576866286</id><published>2009-08-15T22:54:00.000-07:00</published><updated>2009-08-15T22:59:54.528-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="telnetd" /><title type="text">Setting Up Telnetd</title><content type="html">Every couple of years I want to setup telnetd on my linux box again. Each time I get telnetd installed and then try and figure out why it's not started. So this time around this is what I needed to do:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;sudo apt-get install telnetd&lt;/pre&gt;&lt;/code&gt;This included openbsd-inetd for me. However:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;sudo /etc/init.d/openbsd-inetd restart&lt;/pre&gt;&lt;/code&gt;reported:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;Not starting internet superserver: no services enabled.&lt;/pre&gt;&lt;/code&gt;The missing step was to include this line in /etc/inetd.conf:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;telnet  stream tcp nowait root /usr/sbin/tcpd in.telnetd&lt;/pre&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-6928362667576866286?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/Ff8VEYpgYhw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/6928362667576866286/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=6928362667576866286" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6928362667576866286" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6928362667576866286" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/Ff8VEYpgYhw/setting-up-telnetd.html" title="Setting Up Telnetd" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/setting-up-telnetd.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-3176226156140976026</id><published>2009-08-05T19:44:00.000-07:00</published><updated>2009-08-05T19:51:32.137-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">Start the Day Laughing</title><content type="html">On my way in to work I walked past a corporate van for a company called Conejo something or rather. I bet the founders knew "conejo" meant "rabbit", yet probably not that it means &lt;a href="http://www.urbandictionary.com/define.php?term=conejo"&gt;something else&lt;/a&gt; as well!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-3176226156140976026?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/AOMA2vkVxac" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/3176226156140976026/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=3176226156140976026" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/3176226156140976026" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/3176226156140976026" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/AOMA2vkVxac/start-day-laughing.html" title="Start the Day Laughing" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/start-day-laughing.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-2993257872377720200</id><published>2009-08-04T23:28:00.001-07:00</published><updated>2009-08-05T00:02:24.458-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ai" /><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><category scheme="http://www.blogger.com/atom/ns#" term="groovy" /><title type="text">An Internal DSL in Groovy</title><content type="html">There's an approach to robotic control called &lt;a href="http://www.google.com/search?q=%22reactive+action+packages%22+firby"&gt;Reactive Action Packages&lt;/a&gt;. It's a way of specifying what to what, when, in what sequence, and with what taking priority over what. All of it specified in a robust manner and driven by external sensors. Anyway, I've coded my take on RAPs a number of times and never really been happy with the result. This time though my solution really feels right. Groovy builders work so well here:&lt;code&gt;&lt;pre&gt;&lt;br /&gt;this.brain = new NodeBuilder()&lt;br /&gt;  .code {&lt;br /&gt;    when('lost') {&lt;br /&gt;       explore()&lt;br /&gt;    }&lt;br /&gt;    when('score &lt; 1000') {&lt;br /&gt;     go('somePlace')&lt;br /&gt;     someAction()&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;The basic idea is that this DSL can be evaluated each time my robot needs to take an action. DSL statements are evaluated in sequence until one provides an action. So, if it's lost it explores. If it's not lost and it's score is under 1000 and it's already at somePlace then it does someAction. Sweet!&lt;br /&gt;&lt;br /&gt;The only gotcha to evaluating the &lt;code&gt;NodeBuilder&lt;/code&gt; result is that &lt;code&gt;closure('aString') statement1 ; statement2 }&lt;/code&gt; evaluates to a &lt;code&gt;Node&lt;/code&gt; whose &lt;code&gt;value()&lt;/code&gt; is &lt;code&gt;['aString', node1, node2]&lt;/code&gt;:&lt;code&gt;&lt;pre&gt;this.eval = { code -&gt;&lt;br /&gt;  if (code instanceof Node) {&lt;br /&gt;    return evalNode(code)&lt;br /&gt;  }&lt;br /&gt;  def iterator = code.iterator()&lt;br /&gt;  def result = null&lt;br /&gt;  while(!result &amp;&amp; iterator.hasNext()) {&lt;br /&gt;    def node = iterator.next()&lt;br /&gt;    result = eval(node)&lt;br /&gt;  }&lt;br /&gt;  return result&lt;br /&gt;}&lt;br /&gt;this.evalNode = { node -&gt;&lt;br /&gt;  def result = actions[node.name()](node.value())&lt;br /&gt;  return result&lt;br /&gt;}&lt;/pre&gt;&lt;/code&gt;&lt;code&gt;actions&lt;/code&gt; are defined easily enough:&lt;code&gt;&lt;pre&gt;this.actions = [&lt;br /&gt;  when: { args -&gt;&lt;br /&gt;    if (shell.evaluate(args[0])) {&lt;br /&gt;      return eval(args[1,-1])&lt;br /&gt;    }&lt;br /&gt;    return false;&lt;br /&gt;  },&lt;br /&gt;  explore: { "EXPLORE" },&lt;br /&gt;  go: { to -&gt;&lt;br /&gt;    def loc = shell.evaluate("loc")&lt;br /&gt;    if (loc == to) {&lt;br /&gt;      return false&lt;br /&gt;    }&lt;br /&gt;    def direction = navigator.directionTo(loc, to)&lt;br /&gt;    return "DIR $direction"&lt;br /&gt;  },&lt;br /&gt;  someAction: { "SOME_ACTION" }]&lt;/pre&gt;&lt;/code&gt;The last piece of the puzzle is setting up the &lt;code&gt;GroovyShell&lt;/code&gt; with it's context and evaluating the DSL code:&lt;code&gt;&lt;pre&gt;this.act = {&lt;br /&gt;  shell = new GroovyShell()&lt;br /&gt;  shell.setVariable("loc", loc)&lt;br /&gt;  shell.setVariable("score", score)&lt;br /&gt;  def action = eval(brain.value())&lt;br /&gt;  if (action) {&lt;br /&gt;    // do magic&lt;br /&gt;  } else {&lt;br /&gt;    println "No action chosen!"&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;/code&gt;To those who made builders a part of Groovy: thanks so much!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-2993257872377720200?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/hrZKSPCwTr4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/2993257872377720200/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=2993257872377720200" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2993257872377720200" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/2993257872377720200" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/hrZKSPCwTr4/internal-dsl-in-groovy.html" title="An Internal DSL in Groovy" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/internal-dsl-in-groovy.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-8054323270562329884</id><published>2009-08-02T17:42:00.000-07:00</published><updated>2009-08-02T17:57:57.583-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title type="text">Git At Home</title><content type="html">Setting up your own git server at home is easy enough. Once you have sshd running (or Remote Login enabled), your friends for interacting with the remote repository are:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;git clone username@machineIP:path&lt;br /&gt;git remote add remoteRepoNickname username@machineIP:path&lt;br /&gt;git push remoteRepoNickname branchName&lt;br /&gt;git pull remoteRepoNickname branchName&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I got started using &lt;a href="http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git"&gt;Pragmatic Version Control Using Git&lt;/a&gt;. There's also an online book: &lt;a href="http://progit.org/"&gt;Pro Git&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Above and beyond 'there is no server', the main thing I needed to get my head around was that git has the concept of 'staging' commits. For example:&lt;ul&gt;&lt;li&gt;&lt;code&gt;git add file&lt;/code&gt; will stage &lt;code&gt;file&lt;/code&gt;'s deltas.&lt;/li&gt;&lt;li&gt;&lt;code&gt;git status&lt;/code&gt; will show you your staged changes.&lt;/li&gt;&lt;li&gt;&lt;code&gt;git commit -m 'comment'&lt;/code&gt; will then commit your staged changes.&lt;/li&gt;&lt;li&gt;&lt;code&gt;git push remoteRepoNickname master&lt;/code&gt; then pushes your committed changes to another machine.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-8054323270562329884?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/B5t-mqRg2rI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/8054323270562329884/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=8054323270562329884" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8054323270562329884" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/8054323270562329884" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/B5t-mqRg2rI/git-at-home.html" title="Git At Home" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/08/git-at-home.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-4916048913974467487</id><published>2009-07-22T18:13:00.000-07:00</published><updated>2009-07-22T18:16:53.696-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cappuccino" /><title type="text">Cappuccino nib2cib Failure</title><content type="html">If like me you get this error from nib2cib when working on a NibApplication in Cappuccino:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;js: "/usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2410(eval)", line 78: uncaught JavaScript runtime exception: TypeError: Cannot read property "origin" from null&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Then chances are that you've included a control that's not supported. Here's the &lt;a href="http://wiki.github.com/280north/cappuccino/nib2cib"&gt;list of controls you can use&lt;/a&gt; (see the Class in the Identity Inspector in Interface Builder).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-4916048913974467487?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/qkCcmZ9hizc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/4916048913974467487/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=4916048913974467487" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/4916048913974467487" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/4916048913974467487" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/qkCcmZ9hizc/cappuccino-nib2cib-failure.html" title="Cappuccino nib2cib Failure" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/07/cappuccino-nib2cib-failure.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-9027124877672995142</id><published>2009-07-21T20:12:00.000-07:00</published><updated>2009-07-21T20:15:28.954-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">Chocholate Coated Turd</title><content type="html">What's your development teams' reaction been to the arrival of IE8? I very much enjoyed finding this in the head of a Cappuccino example app:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-9027124877672995142?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/vOnO9ZU-d0g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/9027124877672995142/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=9027124877672995142" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/9027124877672995142" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/9027124877672995142" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/vOnO9ZU-d0g/chocholate-coated-turd.html" title="Chocholate Coated Turd" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/07/chocholate-coated-turd.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-6212140017267660848</id><published>2009-07-20T18:34:00.000-07:00</published><updated>2009-07-20T18:40:20.263-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">I've Not Been Blogging...</title><content type="html">...I've been playing &lt;a href="http://www.blizzard.com/us/starcraft/"&gt;StarCraft&lt;/a&gt; instead.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.starcraft2.com/features/contests/comic-winners.xml"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 433px; height: 202px;" src="http://www.starcraft2.com/features/contests/images/US/0907-3-thumb.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-6212140017267660848?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/HsXhbI2En8w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/6212140017267660848/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=6212140017267660848" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6212140017267660848" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/6212140017267660848" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/HsXhbI2En8w/ive-not-been-blogging.html" title="I've Not Been Blogging..." /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/07/ive-not-been-blogging.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-693103838485590670</id><published>2009-05-08T14:18:00.000-07:00</published><updated>2009-06-29T16:34:56.285-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><category scheme="http://www.blogger.com/atom/ns#" term="fun" /><title type="text">Slow, Very Slow, Coding Through Treacle, And Then There's IntelliJ...</title><content type="html">&lt;a href="http://www.jetbrains.com/idea/features/ajax.html" style="display:block; background:#0d3a9e url(http://www.jetbrains.com/idea/opensource/img/all/banners/idea468x60_blue.gif) no-repeat 10px 50%; border:solid 1px #0d3a9e; margin:0;padding:0;text-decoration:none;text-indent:0;letter-spacing:-0.001em; width:466px; height:58px" alt="" title=""&gt;&lt;span style="margin: 5px 0 0 52px;padding: 0;float: left;font-size: 12px;cursor:pointer;  background-image:none;border:0;color: #acc4f9; font-family: trebuchet ms,arial,sans-serif;font-weight: normal;text-align:left;"&gt;Slower all the time&lt;/span&gt;&lt;span style="margin:0 0 0 205px;padding:18px 0 2px 0; line-height:13px;font-size:13px;cursor:pointer;  background-image:none;border:0;display:block; width:255px; color: #acc4f9; font-family: trebuchet ms,arial,sans-serif;font-weight: normal;text-align:left;"&gt;&lt;br /&gt;Hey! Perhaps an EAP release will fix it?!&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update: 8.1 is slow. I hadn't tried upgrade to 8.1.2, but I hear:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"Don’t do it.  Performance is abysmal.&lt;br /&gt;&lt;br /&gt;Enter key -&gt; beach ball of waiting&lt;br /&gt;Ctrl-space -&gt; beach ball of waiting&lt;br /&gt;&lt;br /&gt;I’m going back to 8.1"&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Update: I'm still hanging in there. Things have not improved. I've disabled most all inspections, as many plugins as I can without disabling refactoring support. I semi-regularly delete the IDEA cache. I've followed some OS X specific advice and set the IDE font to Monospaced. Along the way I upgraded to 8.1.3 (because things can't get any worse, right?). All these tweaks make it more usable, but still a very sorry state for premium software.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-693103838485590670?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/1ZEZKmhwaEQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/693103838485590670/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=693103838485590670" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/693103838485590670" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/693103838485590670" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/1ZEZKmhwaEQ/slow-very-slow-coding-through-treacle.html" title="Slow, Very Slow, Coding Through Treacle, And Then There's IntelliJ..." /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/05/slow-very-slow-coding-through-treacle.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-5017337769509812777</id><published>2009-04-27T20:48:00.001-07:00</published><updated>2009-04-27T21:05:21.168-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><title type="text">Getting Started With Cometd, Jetty, and jQuery</title><content type="html">I had difficulty getting started with these tools, so I thought I'd blog my minimal setup. This is all derived from the cometd demo who's war you can find inside the Jetty 6 webapp directory, and who's code you can find inside the contrib/cometd directory of the Jetty 6 source download.&lt;br /&gt;&lt;br /&gt;First of all you need to be able to run Jetty (and debug it). I recommend the &lt;a href="http://code.google.com/p/run-jetty-run/wiki/GettingStarted"&gt;Run Jetty Run&lt;/a&gt; plugin for Eclipse.&lt;br /&gt;&lt;br /&gt;Next you need to populate your &lt;code&gt;web.xml&lt;/code&gt; for your webapp: (it's quite possible that you don't need all these init params)&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&lt;br /&gt;  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&lt;br /&gt;  id="WebApp_ID" version="2.5"&gt;&lt;br /&gt;  &amp;lt;display-name&gt;comet2&amp;lt;/display-name&gt;&lt;br /&gt;  &amp;lt;welcome-file-list&gt;&lt;br /&gt;    &amp;lt;welcome-file&gt;index.html&amp;lt;/welcome-file&gt;&lt;br /&gt;  &amp;lt;/welcome-file-list&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;context-param&gt;&lt;br /&gt;    &amp;lt;param-name&gt;org.mortbay.jetty.servlet.ManagedAttributes&amp;lt;/param-name&gt;&lt;br /&gt;    &amp;lt;param-value&gt;org.cometd.bayeux,dojox.cometd.bayeux&amp;lt;/param-value&gt;&lt;br /&gt;  &amp;lt;/context-param&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;servlet&gt;&lt;br /&gt;    &amp;lt;servlet-name&gt;game&amp;lt;/servlet-name&gt;&lt;br /&gt;    &amp;lt;servlet-class&gt;&lt;br /&gt;      org.mortbay.cometd.continuation.ContinuationCometdServlet&amp;lt;/servlet-class&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;timeout&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;120000&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;interval&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;0&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;maxInterval&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;10000&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;multiFrameInterval&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;2000&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;logLevel&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;0&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;directDeliver&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;true&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;init-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;refsThreshold&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;10&amp;lt;/param-value&gt;&lt;br /&gt;    &amp;lt;/init-param&gt;&lt;br /&gt;    &amp;lt;load-on-startup&gt;1&amp;lt;/load-on-startup&gt;&lt;br /&gt;  &amp;lt;/servlet&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;servlet-mapping&gt;&lt;br /&gt;    &amp;lt;servlet-name&gt;game&amp;lt;/servlet-name&gt;&lt;br /&gt;    &amp;lt;url-pattern&gt;/game/*&amp;lt;/url-pattern&gt;&lt;br /&gt;  &amp;lt;/servlet-mapping&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;servlet&gt;&lt;br /&gt;    &amp;lt;servlet-name&gt;gameServlet&amp;lt;/servlet-name&gt;&lt;br /&gt;    &amp;lt;servlet-class&gt;server.GameServlet&amp;lt;/servlet-class&gt;&lt;br /&gt;    &amp;lt;load-on-startup&gt;2&amp;lt;/load-on-startup&gt;&lt;br /&gt;  &amp;lt;/servlet&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/web-app&gt;&lt;/pre&gt;&lt;/code&gt;The GameServlet is pretty much boiler plate:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;package server;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.servlet.GenericServlet;&lt;br /&gt;import javax.servlet.ServletException;&lt;br /&gt;import javax.servlet.ServletRequest;&lt;br /&gt;import javax.servlet.ServletResponse;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import org.cometd.Bayeux;&lt;br /&gt;import org.mortbay.cometd.ext.AcknowledgedMessagesExtension;&lt;br /&gt;import org.mortbay.cometd.ext.TimesyncExtension;&lt;br /&gt;&lt;br /&gt;public class GameServlet extends GenericServlet {&lt;br /&gt;  @Override&lt;br /&gt;  public void service(ServletRequest req, ServletResponse res)&lt;br /&gt;      throws ServletException, IOException {&lt;br /&gt;    ((HttpServletResponse)res).sendError(503);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  @Override&lt;br /&gt;  public void init() throws ServletException {&lt;br /&gt;    super.init();&lt;br /&gt;    Bayeux bayeux=(Bayeux)getServletContext().getAttribute(Bayeux.DOJOX_COMETD_BAYEUX);&lt;br /&gt;        new GameService(bayeux);&lt;br /&gt;        bayeux.addExtension(new TimesyncExtension());&lt;br /&gt;        bayeux.addExtension(new AcknowledgedMessagesExtension());&lt;br /&gt;  }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;The GameService pairs paths to method names. You can call the &lt;code&gt;send()&lt;/code&gt; method to send messages to clients. Mine looks like this:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;package server;&lt;br /&gt;&lt;br /&gt;import java.util.Map;&lt;br /&gt;&lt;br /&gt;import org.cometd.Bayeux;&lt;br /&gt;import org.cometd.Client;&lt;br /&gt;import org.mortbay.cometd.BayeuxService;&lt;br /&gt;&lt;br /&gt;public class GameService extends BayeuxService {&lt;br /&gt;  private GameState state = new GameState();&lt;br /&gt;&lt;br /&gt;  public GameService(Bayeux bayeux) {&lt;br /&gt;    super(bayeux, "game");&lt;br /&gt;    subscribe("/game/join", "join");&lt;br /&gt;    subscribe("/game/event", "event");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void join(final Client joiner, final String channelName, Map&amp;lt;String, Object&gt; data, final String messageId) {&lt;br /&gt;    send(joiner, "/game/state", state.getData(), null)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void event(final Client joiner, final String channelName, Map&amp;lt;String, Object&gt; data, final String messageId) {&lt;br /&gt;    // TODO&lt;br /&gt;  }  &lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;Finally, and perhaps most importantly (as this was the part that confused me the most), here's the JavaScript to talk to the comet service:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;var _connected = false;&lt;br /&gt;&lt;br /&gt;function _metaConnect(message)&lt;br /&gt;{&lt;br /&gt;  var wasConnected = _connected;&lt;br /&gt;  _connected = message.successful;&lt;br /&gt;  if (_connected &amp;&amp; !wasConnected)&lt;br /&gt;  {&lt;br /&gt;    $.cometd.startBatch();&lt;br /&gt;    $.cometd.subscribe('/game/state', this, receive);&lt;br /&gt;    $.cometd.publish('/game/join', {});&lt;br /&gt;    $.cometd.endBatch();&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function join()&lt;br /&gt;{&lt;br /&gt;  $.cometd.addListener('/meta/connect', this, _metaConnect);&lt;br /&gt;&lt;br /&gt;  var cometURL = document.location.protocol + '//' + document.location.hostname + ':' + document.location.port + '/c2/game';&lt;br /&gt;  $.cometd.init(cometURL);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function send(data) {&lt;br /&gt;  $.cometd.publish('/game/event', data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function receive(message)&lt;br /&gt;{&lt;br /&gt;  // handle message.data content&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;join();&lt;/pre&gt;&lt;/code&gt;Note that &lt;code&gt;/c2&lt;/code&gt; is the context name of my webapp in Jetty.&lt;br /&gt;&lt;br /&gt;One last point, I used the same includes in my index.html as the cometd chat example did:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&amp;lt;script type="text/javascript" src="jquery/json2.js"&gt;&amp;lt;/script&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="jquery/jquery.js"&gt;&amp;lt;/script&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="jquery/jquery.cometd.js"&gt;&amp;lt;/script&gt;&lt;/pre&gt;&lt;/code&gt;Let me know if you get up to something with comet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-5017337769509812777?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/kDQS_hL_lPI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/5017337769509812777/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=5017337769509812777" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/5017337769509812777" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/5017337769509812777" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/kDQS_hL_lPI/getting-started-with-cometd-jetty-and.html" title="Getting Started With Cometd, Jetty, and jQuery" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">9</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/04/getting-started-with-cometd-jetty-and.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-4769549025218542267</id><published>2009-04-25T13:17:00.000-07:00</published><updated>2009-04-27T18:18:13.510-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><title type="text">Jetty and Cometd Documentation Woes</title><content type="html">I've been trying to get going with Comet using Jetty and cometd-jquery. It's been an uphill battle. First off there's practically zero documentation for Cometd. I've been reverse engineering the chat example - a very poor source of documentation. I've finally gotten to a point where my JavaScript initiates a Bayeux connection. Great.&lt;br /&gt;&lt;br /&gt;Now I want to debug my app that Jetty is hosting. That's been a very frustrating experience. Jetty 6 forks a JVM for each webapp, so none my standard approaches to debugging are working for me. Jetty documentation is again very weak and it's hard to differentiate which versions of Jetty documentation refers to.&lt;br /&gt;&lt;br /&gt;Can anyone help me out?&lt;br /&gt;&lt;br /&gt;Update: IntelliJ debugs Jetty 6 out of the box (with the Jetty Integration plugin). The IntelliJ run configuration uses &lt;code&gt;-Xdebug -Xrunjdwp:transport...&lt;/code&gt; to start in debug. I guess &lt;a href="http://cwiki.apache.org/WICKET/maven-jetty-plugin.html#MavenJettyplugin-Usingeclipseexternaltools"&gt;these settings&lt;/a&gt; may work for Eclipse: &lt;code&gt;-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Update: &lt;a href="http://code.google.com/p/run-jetty-run/wiki/GettingStarted"&gt;Run Jetty Run&lt;/a&gt; for Eclipse works out of the box too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-4769549025218542267?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/6cLcSKlh5bA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/4769549025218542267/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=4769549025218542267" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/4769549025218542267" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/4769549025218542267" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/6cLcSKlh5bA/jetty-and-cometd-documentation-woes.html" title="Jetty and Cometd Documentation Woes" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/04/jetty-and-cometd-documentation-woes.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-5640969094983188665</id><published>2009-04-24T09:39:00.000-07:00</published><updated>2009-04-24T09:42:40.688-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="process" /><title type="text">Leadership Philosophy</title><content type="html">McKnight quoted in &lt;a href="http://www.poppendieck.com/llsd_review.htm"&gt;Leading Lean Software Development&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"Mistakes will be made. But if a person is essentially right, the mistakes he or she makes are not as serious in the long run as the mistakes management will make it if undertakes to tell those in authority exactly how they must do their jobs"&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-5640969094983188665?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/4X5kYwvV9_c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/5640969094983188665/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=5640969094983188665" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/5640969094983188665" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/5640969094983188665" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/4X5kYwvV9_c/leadership-philosophy.html" title="Leadership Philosophy" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/04/leadership-philosophy.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-1778411525132462862</id><published>2009-03-30T17:48:00.000-07:00</published><updated>2009-03-30T18:14:01.366-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><title type="text">Managing Ivy Dependencies In Gant</title><content type="html">Maven and IntelliJ are far from best friends. I really really don't enjoy using them together. This post is born out of that frustration. I want good, transparent dependency management, and a very very easy time integrating with my IDE.&lt;br /&gt;&lt;br /&gt;What I wanted was to actually download the jar files to inside a project's folder and have them all in one directory to make updating from the IDE a simple process.&lt;br /&gt;&lt;br /&gt;No, I don't want to use maven. Gradle is still to &lt;span style="font-style:italic;"&gt;other&lt;/span&gt; for me - I also couldn't find out from the documentation how to explicitly download the jars to a location. So, Gant is my logical choice. &lt;br /&gt;&lt;br /&gt;Right. Gant integrates well with Ivy - there's just not a lot of documentation. I wanted adding a new dependency to be as readable as this:&lt;br /&gt;&lt;b&gt;&lt;code&gt;dependency( jar:'commons-lang:commons-lang:2.3')&lt;/code&gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Here's a gant build file to do just that:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;libDirectory = 'lib'&lt;br /&gt;   &lt;br /&gt;includeTool &lt;&lt; gant.tools.Ivy  &lt;br /&gt;&lt;br /&gt;def patternForScope(scope) {&lt;br /&gt;  "$libDirectory/$scope/[artifact]-[revision].[ext]"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def dependency( map ) {&lt;br /&gt;  def elements = map.jar.split(':')&lt;br /&gt;  def opts = [ organisation: elements[0],&lt;br /&gt;    module: elements[1],&lt;br /&gt;    revision: elements[2],&lt;br /&gt;    inline:true&lt;br /&gt;  ]&lt;br /&gt;  ivy.retrieve( opts + [ pattern:patternForScope(map.scope ?: 'main') ] )&lt;br /&gt;  ivy.retrieve( opts + [ pattern:patternForScope('all') ] )&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;target ( retrieveDependencies : 'Downloads jars for lib/main, lib/test, and lib/all.' ) {  &lt;br /&gt;  delete ( dir : libDirectory )  &lt;br /&gt;  mkdir ( dir : libDirectory )  &lt;br /&gt;  dependency ( jar:'commons-lang:commons-lang:2.3' )  &lt;br /&gt;  dependency ( jar:'junit:junit:4.5', scope:'test')  &lt;br /&gt;}  &lt;br /&gt;  &lt;br /&gt;setDefaultTarget ( retrieveDependencies )&lt;/pre&gt;&lt;/code&gt;Once you've run gant this is what the resulting structure looks like:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;$ find lib&lt;br /&gt;lib&lt;br /&gt;lib/all&lt;br /&gt;lib/all/commons-lang-2.3.jar&lt;br /&gt;lib/all/junit-4.5.jar&lt;br /&gt;lib/main&lt;br /&gt;lib/main/commons-lang-2.3.jar&lt;br /&gt;lib/test&lt;br /&gt;lib/test/junit-4.5.jar&lt;/pre&gt;&lt;/code&gt;The build file here is derivative of &lt;a href="http://ca.rroll.net/2008/12/09/you-are-a-tool-if-you-arent-using-gant/"&gt;this&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-1778411525132462862?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/hw6ZjYnThpU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/1778411525132462862/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=1778411525132462862" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/1778411525132462862" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/1778411525132462862" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/hw6ZjYnThpU/managing-ivy-dependencies-in-gant.html" title="Managing Ivy Dependencies In Gant" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/03/managing-ivy-dependencies-in-gant.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-3376508392331888241.post-7323797024666735622</id><published>2009-03-25T18:06:00.000-07:00</published><updated>2009-03-25T19:04:20.618-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><title type="text">Building Test Data</title><content type="html">If your experience with building test data is anything like mine then you've tried a lot of different ways of creating test data - each with their own subtle flaws:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setup all the data in the test method&lt;/b&gt;: going this route you quickly cluttered your tests with data that didn't help the reader understand the test.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setup all the data in a file (or a database)&lt;/b&gt;: it made your tests more concise, but you ended up with "magic" numbers that depended on what was in the file or database. This made tests brittle and hard to interpret.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;You pulled all of the setup out into &lt;code&gt;setUp&lt;/code&gt; (or helper methods or helper classes)&lt;/b&gt;: much better. You were able to show the significant details, hide the mechanics of setting up test data, and gave helper methods readable names. Well, at first at least. The helper methods were hard to generalize so pretty quickly you ended up with an explosion of helper methods that became hard to manage.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Hmm&lt;/i&gt;. This is as far as I'd gotten and I've not been very happy about it.&lt;br /&gt;&lt;br /&gt;At this point perhap you'd dumped Java anyway and run off to the &lt;a href="http://ar.rubyonrails.org/classes/Fixtures.html"&gt;Ruby space&lt;/a&gt;. If you didn't then did you arrive at &lt;a href="http://www.mockobjects.com/book/test-data-builder.html"&gt;something like this&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;  Order order1 = anOrder()&lt;br /&gt;    .withLine("Deerstalker Hat", 1) // detail important to the test&lt;br /&gt;    .withLine("Tweed Cape", 1)      // detail important to the test&lt;br /&gt;    .withCustomersReference(1234)   // detail important to the test&lt;br /&gt;    .build();&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;So this approach appeals to me (read the &lt;a href="http://www.mockobjects.com/book/test-data-builder.html"&gt;"Removing Duplication At Point of Use"&lt;/a&gt; section to see why). I took the time to code up what this might look like. It feels like a ton of boiler plate:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_AGVcmhlbFXA/Scrc_bfq87I/AAAAAAAAAU8/GjP2xO116hI/s1600-h/boiler+plate+for+test+data+building.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 252px; height: 400px;" src="http://4.bp.blogspot.com/_AGVcmhlbFXA/Scrc_bfq87I/AAAAAAAAAU8/GjP2xO116hI/s400/boiler+plate+for+test+data+building.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317305292334756786" /&gt;&lt;/a&gt;&lt;code&gt;&lt;pre&gt;public class BuilderFactory {&lt;br /&gt;  public static OrderBuilder anOrder() {&lt;br /&gt;    return new OrderBuilder();&lt;br /&gt;  }&lt;br /&gt;// factory methods for each builder... &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class OrderBuilder implements Cloneable {&lt;br /&gt;  private Customer customer = new CustomerBuilder().build();&lt;br /&gt;  private List&amp;lt;OrderLine&gt; lines = new ArrayList&amp;lt;OrderLine&gt;();&lt;br /&gt;  private BigDecimal discountRate = BigDecimal.ZERO;&lt;br /&gt;  private String voucher = null;&lt;br /&gt;&lt;br /&gt;  public OrderBuilder withCustomer(Customer customer) {&lt;br /&gt;    this.customer = customer;&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public OrderBuilder withCustomer(CustomerBuilder customerBuilder) {&lt;br /&gt;    this.customer = customerBuilder.build();&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public OrderBuilder withOrderLines(List&amp;lt;OrderLine&gt; lines) {&lt;br /&gt;    this.lines = lines;&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public OrderBuilder withOrderLine(String name, int quantity) {&lt;br /&gt;    lines.add(new OrderLineBuilder().withName(name).withQuantity(quantity).build());&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public OrderBuilder withDiscount(BigDecimal discountRate) {&lt;br /&gt;    this.discountRate = discountRate;&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public OrderBuilder withGiftVoucher(String voucher) {&lt;br /&gt;    this.voucher = voucher;&lt;br /&gt;    return this;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public Order build() {&lt;br /&gt;    Order order = new Order(customer);&lt;br /&gt;    for (OrderLine line : lines) order.addLine(line);&lt;br /&gt;    order.setDiscountRate(discountRate);&lt;br /&gt;    order.setVoucher(voucher);&lt;br /&gt;    return order;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public OrderBuilder but() {&lt;br /&gt;    try {&lt;br /&gt;      return (OrderBuilder) clone();&lt;br /&gt;    } catch (CloneNotSupportedException e) {&lt;br /&gt;      throw new RuntimeException(e);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// plus all the other builders too...&lt;/pre&gt;&lt;/code&gt;What's your reaction? Do you have a more elegant solution? [&lt;a href="http://github.com/curious-attempt-bunny/scratch-space/tree/master"&gt;the code&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;I like the readability of the code that uses the builders. The real disappointment is that the &lt;a href="http://www.google.com/search?q='essence+vs+ceremony'"&gt;essence&lt;/a&gt; of all of the builder code is in the 6% of the code that defines the sensible defaults for test data, namely:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;  private Customer customer = new CustomerBuilder().build();&lt;br /&gt;  private List&amp;lt;OrderLine&gt; lines = new ArrayList&amp;lt;OrderLine&gt;();&lt;br /&gt;  private BigDecimal discountRate = BigDecimal.ZERO;&lt;br /&gt;  private String voucher = null;&lt;/pre&gt;&lt;/code&gt;The rest is all &lt;a href="http://www.google.com/search?q='essence+vs+ceremony'"&gt;ceremony&lt;/a&gt;. Are there better solutions out there?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3376508392331888241-7323797024666735622?l=curious-attempt-bunny.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/curious-attempt-bunny/~4/wLVnHu7qkb4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://curious-attempt-bunny.blogspot.com/feeds/7323797024666735622/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=3376508392331888241&amp;postID=7323797024666735622" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7323797024666735622" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3376508392331888241/posts/default/7323797024666735622" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/curious-attempt-bunny/~3/wLVnHu7qkb4/building-test-data.html" title="Building Test Data" /><author><name>Curious Attempt Bunny</name><uri>http://www.blogger.com/profile/04654980649772473807</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="11885571763902067958" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_AGVcmhlbFXA/Scrc_bfq87I/AAAAAAAAAU8/GjP2xO116hI/s72-c/boiler+plate+for+test+data+building.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total><feedburner:origLink>http://curious-attempt-bunny.blogspot.com/2009/03/building-test-data.html</feedburner:origLink></entry></feed>
