I’ve been looking for a good introductory book on Erlang for quite awhile now. Unfortunately, the Concurrent Programming in Erlang book just doesn’t do it for me (plus only the first part is available online). Thankfully, it looks like the Pragmatic Programmers have come through with Programming Erlang.
The Venture Bros.
I’ve been meaning to write about The Venture Bros. since I found out about them over lunch during my interview at EA Mythic. I think that the series is quite funny and have been enjoying it ever since I first heard about it. Though I have seen reviews on the ‘net which complain that the show is infantile, others compare it to South Park and The Simpsons as well as Johnny Quest. The last comparison is apt as that is where Venture Brothers draws its inspiration, though all aspects of popular culture are referenced in the shows. My personal favorite episode thus far is Twenty Years to Midnight.
January NoVA Ruby Users Group
Unfortunately I was on vacation when the last NoVA RUG was held in January. Thankfully Luis has taken the time to place his notes online. For the February meeting we’ll have Chad Fowler as guest speaker.
December NoVA Ruby Users Group
Last night we had excellent turn-out at the Northern VA Ruby Users Group. Rich Kilmer gave an enlightening talk on Domain Specific Languages and Devin Mullins delivered an interesting performance piece on Rails plugins where he wrote code while singing about it (ensuring that the code matched his meter and rhyme). Rich’s presentation was very similar to his previous presentation on the DSL he wrote for the Coronet refueling missions for the USAF. He began by giving a definition of DSL (from Martin Fowler) and then speaking about External and Internal DSLs. Since the focus of his talk was on internal DSLs written in Ruby he provided a further division between explicit and implicit DSLs. His example of an explicit DSL was:
when_shopping do |store|
store.buy :popcorn
store.buy :soda
end
You’ll notice in the explicit case the syntax of Ruby is clearly visible and a store object is created which the buy method is invoked upon. Here is his example of an implicit DSL:
when_shopping {
buy :popcorn
buy :soda
}
In this case, the code is more declarative: when shopping buy popcorn and soda. Rich appeared to prefer the latter form. He did show an issue with the implicit form when attempting to access member variables like so:
extend ShoppingTrip::Behavior
@amount = 6
when_shopping {
buy :popcorn
buy :soda, @amount
}
This code won’t work because the block is invoked in the scope of the ShoppingTrip instance where there is no @amount variable. The explicit DSL doesn’t have this problem. When Rich makes his slides available, I’ll update this post to point to them. Devin walked through the creation of a Rails plugin while singing about what he was typing to the tune of “Dance of the Hours” by Ponchielli. He showed how you can extend your models using plugins and went through some of the files created when running script/generate plugin. Tonight, we also had Chad Fowler as a guest. It was nice to finally meet him in person, though I didn’t get much of a chance to speak with him as he was quite popular with the other attendees. He did mention that he’s left Naviance and is providing training and consulting services. Hopefully when I attend The Rails Edge in January I’ll be able to chat with him some more. I also had the pleasure of meeting Luis de la Rosa who took the plunge and went indie (though he’s supporting himself primarily through consulting, which I don’t call ‘indie’). But I’m rooting for him and hope he does well—I tried the contractor route very briefly after my break with Cisco and I can say I just don’t have the stomach for it (plus I’m the sole provider for my family and the uncertainty was just too much stress). I’d definitely like to improve my ObjC/Cocoa skills and look forward to the next CocoaDevHouse (that Luis will help organize). Next month at NoVA RUG we’ll have presentations on Rails deployment and Selenium.
TopCoder Single Round Match
Last night I participated in a “code fest” sponsored by my employer. It was great fun and the code fest was powered by TopCoder. This was my first time participating in any sort of coding competition and while I didn’t make the top three, I did place in the top ten. I’m definitely looking forward to the next company sponsored event in February. For those of you not familiar with TopCoder, they basically provide a Java application/applet called the Competition Arena. Once you login to the arena, you can then register for a Single Round Match (SRM, in TopCoder parlance), but only during the registration window (which appears to be two hours prior to the event). Once the event begins you have 75 minutes to solve problems of increasing difficulty. Each problem set is assigned a certain number of points (usually 250, 500 and 1000). You are judged both on the correctness of your program as well as the time it took you to develop and test it. Since you must develop, compile and test your code in TopCoder’s arena Java app you can only write your solution in C++, Java, C#, or VisualBasic. I wish they offered Ruby as an option (or even Python), but at this time you’re stuck with those four choices. You are allowed to choose your programming language at the problem set level (i.e. you don’t need to stick with the same language for all three). Since the majority of my experience in the past ten years has been with Java I selected that for all three of the problem sets. In retrospect, I might’ve fared better had I chosen C++ as that is what I’ve been using almost exclusively at work these past three months. I also need to manage my time better as I ran out of time just before I was going to submit my solution to the 1000 point problem—I believe that had I finished in time, I would’ve placed in the top three (I guess we’ll see when I participate in February). Once the content ends, you’re able to look at the solutions from the other participants and can challenge their solutions if you believe you’ve found a bug. If your challenge succeeds, you earn points and the person challenged loses all of the points for that problem, but if your challenge fails, you’ll lose points and the person challenged will gain points. There were a few successful and unsuccessful challenges during the competition. Looking through people’s code it was clear that the folks who had participated previously didn’t bother indenting their code properly or ensuring it was clear—they focused on getting it working in the shortest time possible. I made the newbie mistake of properly indenting my code and even writing psudocode comments as an outline prior to writing the real code (next time I’ll do this on paper if necessary). I also was hampered slightly by the Arena editor as it uses the MS Windows keybindings even on the Mac! Thus CTRL+C is copy instead of CMD+C — I kept hitting the Apple shortcuts instead of their Windows counterparts and this slowed me down as well. My colleague suggested just keeping Emacs open and copy and paste as necessary into the Arena editor. Unfortunately, I cannot post the problem sets here as they are copyrighted by TopCoder and you must have permission to republish them. But if you go to the TopCoder site, you can see many example problems. If you’re interested in petitioning TopCoder to offer Ruby as an alternative language for competitions, I urge you to email them, as I have. Update 2006-12-21: I received the following response from TopCoder and have asked them to add Ruby as an option for “Marathon Matches”
We do not allow interpreted languages like Python or Ruby in our algorithm events because their execution speeds makes them non-competitive compared to the other languages. We revisit this from time to time, but our tests have shown that the execution speed makes writing problems that keep all languages on the same approximate playing field impossible. We do offer Python as a fully supported language choice in our Marathon Match events, where we can relax the constraints because of the non time-critical nature of the event. You can find more information about Marathon events on our web site under “Marathon Matches�