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.

Summary

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'))

client.create!(notification)

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





Easy Cross-Platform Messaging with MessagePub

13 03 2009

I have not been blogging very actively lately because I’ve been really busy with ShareMeme and a new product which I am proud to introduce to you: MessagePub

Message Pub

MessagePub is a easy-to-use REST API that lets you send messages to people on different communication platforms. We currently support: AIM, SMS, Google Chat, Twitter, Email, or Phone (text-to-speech). We will keep adding more platforms as we go.

The API lets you schedule messages to be sent in the future, set up an escalation schedule (e.g. if you don’t find this person on AIM, email them 20 minutes later, etc…), and it takes care of saving and sending you back any replies from your recipients.

Because it is a REST API, it can be used very easily with ActiveResource in Ruby. In this blog post, I will go through an example of using ActiveResource to interface with MessagePub. In later blog posts, I will cover the messagepub gem.

For more information on the API and how to use it with other languages besides Ruby, check out the documentation.

In order to use the MessagePub API, you have to sign up on messagepub.com to obtain an API Key. It is free to get started because we give away 100 free credits for your to try it out when you sign up.

Once you have an API Key, you can get started very quickly with ActiveResource. The main resource that you will be interacting with is a Notification. You can create a Notification, list all your Notifications, and get a particular Notification. A notification can have more than one recipient but when you send the messages it will not send the message to all the recipients at the same time. There is an escalation parameter that you can set to determine how long to wait before sending the message to the next recipient. The default value is 10 minutes if you do not explicitly set it. If you want to send the messages to all the recipients at the same time, simply set the escalation for the notification to zero.

Let’s look at some code:

require 'rubygems'
require 'activeresource'

class Notification < ActiveResource::Base
  # Remember to put in your API key.
  self.site = "http://YOURAPIKEY@messagepub.com/"
end

Make sure to replace your API key in the URL. That’s it! Now you are ready to start creating notifications.

# Create a new notification
notification = Notification.new(:body => 'You have a message waiting for you in your inbox',
  :escalation => 30,
  :recipients => {
      :recipient => [
        {:position => 1, :channel => 'email', :address => 'joe@example.com'},
        {:position => 2, :channel => 'twitter', :address => 'sharememeinc'},
        {:position => 3, :channel => 'phone', :address => '1234567890'}
      ]}
 )
notification.save

You’ve just created a notification. How easy was that? As soon as you run this code, an email will be sent to joe@example.com. After 30 minutes (since escalation = 30), if Joe never replied or acknowledged receipt of the email, a twitter message will be sent to ‘sharememeinc’. 30 minutes after the twitter message was sent, if ‘sharememeinc’ never replied, MessagePub will call the phone number (’1234567890′) and read them the message.

Of course, if at any point, the recipient acknowledges receipt of the message, the chain is halted.

You don’t always have to take advantage of the escalation feature. If you only need to send the message to one person, just add one recipient and there is no need to specify the position of the recipient. For example, to send a text message to ’12356789′, you can do the following:

notification = Notification.new(:body => 'This is the body of the SMS text message',
            :recipients => { :recipient => [{:channel => 'sms', :address => '1234567890'} ]})
notification.save

I hope you will find this helpful and I look forward to hear your feedback on MessagePub.








Follow

Get every new post delivered to your Inbox.