DCRUG: Enumerators & MongoDB [Videos]

12 12 2009

On Thursday evening, the DC Ruby User Group held its December meetup. There were three speakers scheduled to talk:

There is an effort started by Ross Karchner to try to record as many DC Tech Events as possible so I’m going to start bringing my Flip Mino camera to events I attend. I had it with me yesterday and recorded the first two talks before I ran out of battery.

So here is the fist talk by Doug:

And the second talk by Kyle:

Unfortunately, I ran out of battery before Camille talk so I could not record that one. But if you are interested in her topic, you can pick up the following two books which she recommended:

Rubynation slides: Concurrent Programming with Ruby and Tuple Spaces

13 06 2009

Here are the slides from my talk at RubyNation today.

I enjoyed giving the talk and I appreciate all the great questions that followed.

4 Interesting Events in the DC Area

10 04 2009

If you are software developer or entrepreneur based in the Washington DC area, there are a few interesting events coming up that I would like to share with you.

Bootstrap Maryland in College Park on May 2nd

Bootstrap Maryland

Jared Goralnick is putting together an interesting conference for entrepreneurs. “Bootstrap Maryland brings together young entrepreneurs and the necessary tools for running a lean and successful technology business.”

becamp in Charlottesville, VA on May 8-9

I attended last year’s becamp in Charlottesville and it was a great event. There is a small but very interesting tech community in Charlottesville and people drove from Richmond or Northern Virginia.

Charlottesville is also a great city. If you’ve never been there, becamp is your excuse to go visit. It’s the home of the best public school in the country and there is a lot to visit around Charlottesvile: wineries, Monticello, The Lawn, etc…

Developer Day in Falls Church, VA on May 30

I drove down to Durham, NC for the first developer day a few weeks ago and it was definitely worth the 4 hour drive. Now, our friends at Viget are bringing Developer Day to Falls Church. Highly recommended if you are a Ruby developer.

RubyNation in Reston, VA on June 12-13


The second edition of RubyNation is coming in June 12-13. They started announcing the speakers and it seems like a it will be another great conference.

My Review Of Developer-Day in Durham

23 03 2009

This Saturday, I attended Developer-Day in Durham, NC. Overall, the conference was outstanding. Priced at $50, it was definitely worth the 4-hour trip from Washington DC. Below you will find a quick review of each of the talks.

Refactoring Your Wetware by Andy Hunt

Andy Hunt of the Pragmatic Programmers gave us a brief overview of his latest book: Pragmatic Thinking And Learing. He described the way our brains are wired and offered advice to take advantage of what we know about our brain’s architecture.

Andy started by explaining the concepts of Systems Thinking, as described in The Fifth Discipline. Systems Thinking is when you get out of the habit of thinking of things as discrete objects, but as systems instead. Once you start looking at objects as belonging in a system, you began to see how they are interconnected. Having graduated from the UVA Engineering School where Systems Engineering is the most popular department and working with Ahson Wardak, a Systems Engineering PHD candidate, I’ve had some exposure to the discipline and concept.

Andy followed by describing neuroplasticity, the fact that your brain can grow new neurons if you exercise it. He then moved to a discussion on The Dreyfus Model of skills acquisition. In summary, the best way to become an expert is through deliberate practice: 10 years of practice! Imitate the experts, then assimilate, then innovate.

Andy explained that the brain has two sides: the left and right brain, which he would rather call the Linear Mode and Rich Mode, respectively. Think of the Linear Mode as the mode that is prevalent with geeks and the rich mode as the one that is non-verbal, non-rational, synthetic, non-linear, asynchronous like a search engine, analogical, spatial, intuitive, holistic… The Rich Mode of your brain sometimes has trouble putting into words what it is processing but this is where the innovation/ideas comes from. A lot of inventors report that they discovered things in their dreams. Therefore, Andy suggested to try out Free-Form Journaling: wake up every morning and write down 3 pages of stuff (by hand, no typing) before you do anything else. Don’t censor yourself. Write about anything.

Then, Andy explained how our memory is not very good or, I quote, ‘is a piece of shit’ so it is important to write down things. When you think of a new idea, write it down. If you don’t keep track of your ideas, then you stop having great ideas. Once you have an idea, the best way to explore it is with a mind map (on paper, no computers). Once you are done with the mind map, putting that information in a personal wiki can be helpful.

Finally, he challenged the audience to try meditation and warned us against multi-tasking. The benefits of meditation far outlasts the actual practice itself. Multi-tasking is really bad for your brain so avoid context switching.

I enjoyed Andy’s talk and I will definitely pick up his book in the near future.

Evolving Your Git Workflow by Jason Rudolph

In this talk, Jason Rudolph showed us a few special git commands and how we can take advantage of them to improve our workflow.

He started showing us the power of git bisect by walking us through a debug session using the command. He used git bisect to find out when a bug was introduced in his codebase using the following commands:

git bisect start head %%commitid%%
git bisect log
git bisect good
git bisect bad

He then showed how you can automate the whole process with:

git bisect run %%command%%

I thought that was one of the coolest things I’ve ever seen!

After having used git to do some ‘Biology’, he proceeded to show how git can help us with ‘Archaeology’. The latter is the ability to be able to clearly tell what happened in the past by looking at the history of a code base (through a version control system log). It is important for your projects to have a clear, well-defined archaeology, so that new programmers can look back and figure out why things were done in a certain way. Jason shows us how git makes that easier. For example, with git, you can amend commit messages or your can commit changes from one file in two different commits. Pretty slick!

In the third section of his talk, Jason showed that branching in git is easy, cheap (41 bytes), fast, and have low ceremony. Therefore, there is no excuse not to branch and we should Branch All The F***** Time (BATFT).

Optimizing Perceived Performance by David Eisinger

In this talk, David showed us how improving the perceived performance of a web page can greatly improve the user experience. David used a sample application called DBDB (DoucheBag DataBase) to illustrate his idea which got the crowd laughing a lot.

David showed us a few client side techniques that we can use to make our application appear like it is loading faster. He advocates the use of Unobstrusive Javascript with jQuery (with jRails).

Lightning Talks

After lunch, we had the lightning talks. Here is a set of links from the talks:

Getting Girls With Musical Magic and Ruby by Jess Martin and Chad Humphries

Jess and Chad showed us how they are using Ruby to make mashups. Check out Girl Talk for a good demonstration of this style of music.

Jess wrote some ruby code that wraps Sox to create mashups. He built a really slick frontend for it (CHOP40) which lets you select some tracks and automatically mashes them up for you. I’ve been a big fan of the style (especially diplo‘s stuff) so it was cool to see the techniques behind this art form.

From Paralysis to Static Analysis by Aaron Breda

At every conference I go, I always have a moment where I kinda zone out (thinking about cool stuff I could do with the stuff I just learned about). It usually lasts only for one/two talks before I get my focus back. Unfortunately for Aaron, it happened during his talk this time :-/ ( I’m curious to know if it happens to every one so let me know in the comments. )

From what I picked up though, Aaron and Chad should be awarded some kind of heroes award for the work they are putting into upgrading rcov to Ruby 1.9. Thank you guys!

Scala: A Modern Programming Language by Clinton Nixon

Clinton gave us a great introduction to the Scala programming language. Scala was created in 2001 by Martin Odersky. It runs on the JVM, compiles beforehand or JIT. It is a functional language where everything is an object (like in Ruby) and it supports actor-based concurrency (so it is future-proof with the trend to have more cores on CPUs).

Pros: interoperability, scalability, beauty (of course that is subjective)

Cons: JVM (if you do not like that, though I think this is a pro rather than a con), hard to navigate libraries if you do not know Java, small user base, no killer frameworks/libraries.

Clinton posted his slides at http://crnixon.org/talks and they are the kinda of slides that you can read and learn from without seeing the presentation so go check them out.

I really enjoyed this talk since I’ve been meaning to learn more about Scala and this served as a great introduction.

Page Caching Resurrected: A Fairy Tale by Ben Scofield

Ben’s talk was great. He showed us a creative use of Rails Metal with page caching. The idea can be summarized as follow:

  • Cache your page with only the content that will be seen by all users.
  • Have your page make a javascript call to get user specific content in the background.
  • To make that javascript call be fast, use Rails metal in the back end to return the needed data fast.

I’ve been using this technique at ShareMeme and messagepub with the exception of the use of Rails Metal. For example, at messagepub, most pages are cached and we fetch the menu bar and navigation links with JavaScript after they are displayed. Therefore it turns out our Rails action with the most hit is the action that fetches the menu bar (since everything else ends up being served by the web server) therefore it would make sense to use Metal for that action to reduce the delay before the user sees the menu.


I can’t decide which was my favorite moment of the conference: whether it was seeing git bisect in action, learning about Scala, listening to a mashup that was created with Ruby, or seeing a cool use of Rails Metal.

This was a great conference with really good talks both in content and delivery. Thanks to Viget, Relevance, and Ben Scofield for putting it together. I look forward to the next one in Washington DC.

If you want to get other opinions on the talks from Developer Day, see how the rest of the audience rated the speakers at speakerrate.com

Using the MessagePub gem

13 03 2009

In my last post, I showed you how you can use ActiveResource to interact with MessagePub. I’ve also wrote a gem that makes interacting with MessagePub even easier.

To get started, install the gem:

sudo gem install messagepub

Code is worth a thousand words so I’ll leave you with this code sample:

require 'rubygems'
require 'messagepub'

client = MessagePub::Client.new('YOUR API KEY')

notification = MessagePub::Notification.new
notification.body = 'So and so has added you as a friend.'
notification.escalation = 20
notification.add_recipient(MessagePub::Recipient.new(:position => 1, :channel => 'twitter', :address => 'joetheplumber'))
notification.add_recipient(MessagePub::Recipient.new(:position => 2, :channel => 'email', :address => 'joe@example.com'))


The gem is on RubyForge, the code on github and we have a Google Group where you can ask questions.

Slides from my Ramaze Talk

20 11 2008

Over the last months, I have given this talk at the South Carolina Ruby Conference in Columbia SC, RubyConf in Orlando FL, and at the NovaRug in Reston VA.

You can find the code for the mini-blog that I wrote during the Live Coding part of the talk here.

I really enjoyed giving this talk and I hope that it got people excited about Ramaze.

Autotest Notifications in Ubuntu with Mumbles

7 10 2008

Autotest is a nice utility that automatically run your rails tests whenever you make a change to one of your source files. It is part of the ZenTest package from Ryan Davis.

It would be nice if you could be notified of the test results without having to switch to the terminal window running AutoTest. Some Mac users already found a way to do this using Growl. However, that only works if you have a Mac, and I don’t have one, so I figured out a way to do something similar in Ubuntu. Let’s get going.

Step 1: Install Mumbles

Mumbles is a ‘plugin-driven, modern notification system for Gnome’. It is very similar to Growl and even speaks the Growl protocol if you want to receive growl notifications on your Ubuntu/Linux desktop. Installing Mumbles is a breeze thanks to the deb package that you can download here.

Once installed, you can start Mumbles by going to Applications -> Accessories –> Mumbles. You will then see the Mumbles icon Gnome panel applet, as shown in the picture below:

Mumbles Icon in Gnome Panel Applet

Mumbles Icon in Gnome Panel Applet

You can right-click on the Mumbles icon, and edit the preferences. In particular, you can change the theme of your notifications. I like the mumbles-round theme.

Mumble Preferences

Mumble Preferences

If you do not want Mumbles to show up in your Gnome Panel applet, you can start it from a shell using the ‘mumbles -d’ command.

If you want Mumbles to be automatically started when you login, go to System –> Preferences –> Session. On the startup tab, add mumbles with the ‘mumbles’ command.

Step 2: Test Mumbles Installation

Mumble ships with a ‘mumbles-send’ utility. To test it out, type the following in your shell: mumbles-send --help As you can see, mumbles-send takes in a title and an optional message. Let’s try it out now: mumbles-send 'Testing Title' 'This is a test of mumble-send' You should see the notification in the top right of the screen:

Step 3: Installing AutoTest

Autotest is part of the ZenTest Ruby gem. To install it, run: sudo gem install ZenTest That’s about it. Now go to the RAILS_ROOT directory of your application, and run: autotest Autotest should start running your tests.

Step 4: Adding Autotest hooks to Mumbles

To have Autotest results show up as Mumbles notifications, create a file called .autotest and save it in your $HOME directory. Copy the following content into that file:

module Autotest::Mumbles
  def self.mumbles title, msg
    system "mumbles-send \"#{title}\" \"#{msg}\""

  Autotest.add_hook :red do |at|
    errors = at.files_to_test.map { |k, v| "#{k}:\n #{v.join("\n ")}"}.join("\n\n")
    mumbles "TESTS FAILED", errors
  Autotest.add_hook :green do |at|
    #res = at.results[/\d+ tests.*$/]
    res = at.results.scan(/Finished.*failures/m).to_s.gsub(/\e\[32m/,'')
    mumbles "TESTS PASSED", res

Step 5: Verify everything is running smoothly

At this point, you should be done. Go back to your RAILS_ROOT directory and start autotest. It should now report whether the tests PASSED or FAILED via Mumbles, as shown below:

I hope this helped! Enjoy your Mumbles Autotest notifications


Get every new post delivered to your Inbox.