Archive for October, 2009

Andy Hunt/Pragmatic Thinking and Learning Presentation @ RJUG

Comments

image I attended Andy Hunt's “Refactor Your Wetware: Pragmatic Thinking and Learning” presentation given for the Richmond Java User Group/Central VA Ruby User Group October meeting Wednesday night.  Having just completed this book in September I was very interested in reinforcing what I have learned (and began practicing, ahem, mind mapping) and excited to see the author present this material.

I was impressed with the professional atmosphere and organization at this event.

Andy’s presentation centered around the book, touching on several highlights over the two hour period.  This was largely a rehash for me, which was very good, with a little bit of new material thrown in.  (There is a new Pomodoro book pragprog is publishing so there was a brief overview of Pomodoro included with a plug – which I fully support at free/sponsored events; I had just read the RSS post earlier in the day so I would have been disappointed if it were skipped!)  His slides were good – not distracting – and the presentation was delivered with animation and some really well placed humor.

Points [I remember]:

Dreyfus Model of Skill Acquisition

Mind mapping (easily my favorite technique I learned from the book)

You cannot execute a great idea if you don’t exercise your brain to get it to produce them – write down your ideas, all of them

Meditation

How context switching and multitasking damages productivity

Have a personal wiki

Book study groups – going to suggest replacing our low value formal code reviews with this in an on-going basis

 

Finally Andy said it may be possible in the near future to get some of pragprog’s non-code books in an audio book format which for anyone who has a long commute is very good news.


I’m Dangerous with Ruby!

Comments

My solution was selected as the winning solution for RubyLearning.com’s RPCFN #2 “Average Arrival Time for A Flight.”

This challenge involved averaging times of the day without the actual day in the context.  When I first started to tackle the problem I thought to myself that this will be very easy.  Then I hit the “no day” context and realized that this problem was much tougher than I anticipated.  When I finally saw the posted solutions including Chris Strom’s (blog) it was like decades old high school math came rushing back to me.  I would have never thought of plotting points on a graph but now that I’ve been exposed I’m certain I will never forget it!

My friend [and commuting body] Matt and I talked through the problem during our drive home as we sat in Virginia I-495 outer loop and I-95S traffic.  He had some ideas about plotting the problem linearly around 0 but ultimately I ended up going with making assumptions about how close the provided times were to midday and midnight.

require 'time'

SECONDS_IN_DAY = 86400
MIDNIGHT = Time.parse("12:00AM").to_i
MIDDAY = Time.parse("12:00PM").to_i

def average_time_of_day(times)
  seconds = []
  times.each {|time| seconds << Time.parse(time).to_i}
  seconds.sort!
  if (seconds.first - MIDNIGHT) < (seconds.last - MIDDAY)
    seconds.map! {|s| s < MIDDAY ? s += SECONDS_IN_DAY : s }
  end
  Time.at(seconds.inject { |sum,n| sum += n }.to_f / seconds.length).strftime("%I:%M%p").downcase
end

 

Gist: https://gist.github.com/5b371226faf83af50d7e

Interview: http://rubylearning.com/blog/2009/10/22/charles-feduke-winner-rpcfn-2/