Ullrich Wins Stage 12

In an amazing ride, Jan Ullrich of Germany, riding for Team Bianchi, rode the 47 kilometers in 58′ 32″! Incredible. Lance came in at 01′ 36″, almost two minutes behind. Armstrong keeps the Yellow, but today’s victory brings Ullrich to within 34 seconds of catching up.

Eclipse 3.0 M2 Is Out

I just got the notice that Eclipse 3.0 M2 is now available. I’ve already been using 3.0, but judging by the release notes there’s a lot of chewy Eclipse goodness loaded in this release. I’ve already downloaded it and “installed” it, such as it is. I’ve upgrading my JDK to 1.4.2 and will fire the new Eclipse up shortly.

Update: OK, I’ve got M2 and JDK 1.4.2 installed. While it does monopolize my CPU on startup, once up it is fast! And there are lots of spiffy new features. My favorites so far are the JavaDoc and Declaration views. The JavaDoc view shows the javadoc for the selected method and the declaration view shows the declaration. Clicking on the “println” part of System.out.println results in the javadoc or the source code being shown, depending on which view is selected. Another feature, which mimics something that is in the new IntelliJ is a change indicator in the gutter on lines that you’ve changed in this editing session. Hovering over the marker shows what the line looked like before and allows you to revert changes. Very nice, indeed!

Definitions by Thomas

Last Thursday night walking up to the Long Horn Steakhouse I pointed out a large cloud formation to my 4.5 year old son, Thomas.

Me: Thomas, look at that cloud up there.
Thomas: Wow. That’s really huge!
Me: What does “huge” mean?
Thomas: It means “enormous.”
Me: …

Then last night he was playing his Thomas the Tank Engine computer game. As we were heading up for bedtime he told me about it.

Thomas: … Yeah, and I talked to Henry.
Me: And who is Henry?
Thomas: He’s the big green engine.
Me: How did you talk to Henry?
Thomas: Well, Thomas talks to Henry automatically.
Me: What does “automatically” mean?
Thomas: Well, it means you don’t have to do anything and it does it.
Me: …

He has a rather large vocabulary for his age…

Kata 6 In Lisp

I got bored tonight and had a go at writing Dave Thomas’ Kata 6 in Lisp. It just seemed like a good thing to do. The code is below. I’m not a Lisp wizard by any stretch, so I welcome any comments from Lisp mavens. It’s interesting to note that this version comes up with 2,531 matches, while my Ruby version only found 2,506. Dave says you should find 2,530. Also note that all I did was the finding. I didn’t implement the largest set, long word, etc from the original kata.

(setq anagrams (make-hash-table)) 
(setq count 0) 
(defun canon (word)   
(setq norm-word (string-downcase word))  
 (setq canon-word (sort (copy-seq norm-word) #'char-lessp))  
 (setq canon-word (intern canon-word))  
 (setf (gethash canon-word anagrams)        
 (cons norm-word              
 (gethash canon-word anagrams))))  
(with-open-file (stream "wordlist.txt")                 
(do ((line (read-line stream nil)                            
(read-line stream nil)))                   
  ((null line))
                   (setq count (+ count 1))
                   (canon line)))
  (maphash #'(lambda (key val)
              (if (= (length val) 1)
                  (remhash key anagrams)))
          anagrams)
  (format t "Total words: ~D; Total anagrams: ~D" count
         (hash-table-count anagrams))
  (maphash #'(lambda (key val)
              (print val))
          anagrams)

Update: I discovered today that instead of interning the string I could have created the hashtable with a different test, like so

 (setq anagrams (make-hash-table :test #'equal)) 

and then removed this line

 (setq canon-word (intern canon-word)) 

I Couldn’t Do This Job

Just like funeral directors, who do their jobs to help grieving families through a tough time, crime scene cleanup companies do the same thing. While I couldn’t do either job, I’m glad that there are folks who can. This story is an excellent article about this business, and a couple of the owners in particular. There are some gross details in it, and some bad language, but it’s worth reading it.

It’s Jar-Jaromir!

According to this story, there’s to be a new character in The Return of the King when it comes out in December. It’s Jar-Jaromir, half brother of Boromir and Faramir. According to the story:

The scene depicted in the trailer shows Jar-Jaromir shouting, “Gondora gonna fallsa”; he then trips over a corpse and knocks down a couple of Uruk-hai.

My favorite quote from the article is this:

[Peter] Jackson added, “I just love it when he shouts, ‘Yousa steala precious from meesa!'”

I Overdid It

I went riding again last night with grand plans to ride 12 miles, topping the 10.6 I did Monday night. Well, about 30 yards into my ride my thighs just above my knees started hurting mightily. I pressed on, thinking that I had overdone it, and I would just complete the one circuit and go home. But by the time I finished the circuit, I was feeling a little better. So I stopped, had some water and a chocolate PowerBar and decided, stupidly, to set out again. I was in pain again about a mile into this circuit and ended up walking up one particular hill. I did ultimately finish riding the circuit at a decent pace, but I was hurting. I’m still hurting today. Ibuprofen is a good thing.

So, for the time being, 5 days in a row is too much for me. My plan is to ride Friday through Monday, then off on Tuesday, ride on Wednesday, then off on Thursday (for Weight Watchers). Rinse. Lather. Repeat.

Simplicity and Consistency

Mike Clark this morning has a bit of a nudge for Rael to give Ruby a try. Mike makes the following statement that I completely agree with

The beauty of Ruby is its simplicity and consistency. With Ruby, I find myself writing code to get the job done rather than to appease the compiler.

So true! Since Ruby is a dynamic language, there are no variable types to declare, no static checking; variables are just slots. The number of lines of Ruby code to do something is far less than the equivalent Java code, and I would argue more readable. You don’t have to jump through hoops to make the compiler happy, you just write your code to do what you need done. That’s it. It’s a beautiful thing.

The fact that regular expressions are baked right into the language is also a giant plus. This is how Perl does it, and Matz basically lifted this approach when he created Ruby. Python‘s regex support is not nearly as nice since you have to create a regex and call methods on it instead of using a regex literal and using special variables to get the groups, etc. Where having baked-in regex support really shines is in not having to escape backslashed atoms in the regex. Regexen in Java are even more difficult to read than usual because every backslash is doubled to keep the Java string parser from barfing on unknown escapes.

Made It: Ten Miles!

I made my fourth trip in as many days to Tribble Mill tonight, planning on doing two circuits of the track, which would bring me to about 5.5 miles. After the second circuit I stopped for a delicious Vanilla Crisp PowerBar and to finish off my 70 oz. of water. While stopped I met another rider and we started chatting and then, re-energized, I decided to set off again. We set off together, chatting while riding, easier than the previous two circuits. After making it around again, I was at 8.42 miles and I could just taste that 10 mile mark. I decided to press on to get to 10, so I started making another circuit, then turned around after about .75 mile. When I made it back to the parking lot I made another partial circuit, riding much easier now, to cool off. Total distance: 10.6 miles. Total time: 62 minutes. Not a great time, but it’s good for me.

I had set a goal last Friday to be able to ride 10 miles at a go within one week; looks like I achieved that goal a few days early!

Hamilton Will Ride!

Holy broken collarbones, Batman! According to Lance, Tyler Hamilton, who broke his collarbone in 2 places during that terrible pile-up in Stage 1 yesterday, will ride today in Stage 2, and will ride as long as he is able. What an amazing desire to compete! Here’s a bit more on this over at Bicycling.com. This story also mentions that Jimmy Caspar, of the FDJeux.com team, will be riding with a neck brace! That’s dedication to the craft, I must say.