Blog


Jun

Third Day of Craftsmanship Swap


A heavy rain rattling on the windowpanes woke me up at 6 o'clock at day three of the craftsmanship swap. After a big breakfast, Steve Kim picked me up and drove me to the office.

storm

Day three - Pairing in Ruby and Java

The day started with some pairing with Doug Bradbury. We did some debugging and fixed a platform specific bug in Mac OS and did some TDD programming in Java using JUnit. It has been about five years since I last wrote any Java code. It was fun, even though I have some difficulties to admit it. Doug Branbury, Steve Kim and I went for lunch to an excellent Thai restaurant, where I ordered Pad Thai. It was so much food that I had to take a doggy bag - my first ever. After lunch I was back on the same project as yesterday with Justin Martin. It's kind of a regular Rails project apart from that they are using JRuby, having their own gem bundler thing and using Prototype and JQuery at the same time. So maybe it's not that regular when I think more about it. I'm also liking AgileZen, the project management tool that we use in this project, more and more.

Evening - The A-team takes over

At the end of the day Justin Martin invited me to join him and Eric Meyer to go to the movies and watch The A-Team. I'm actually the only one of us that is old enough to have followed the TV series during the eighties. It was one of my favorite series during that period. The A-Team movie was fun but if you ask if I can recommend it, the answer is no. After an action comedy you always feel the need to dissolve the experience with a couple of beers before hitting the sack. Steve Kim also came and joined us at the beer place.

At the hotel - Key problems

Steve Kim drove me back to the hotel around 11 pm. For some reason, in the evening when I get back to the hotel the key to the door always stops working. When I finally got into my room, it was time to write this blog post about todays experience.

Good night!

Jun

Second day at 8th Light's Office — The Craftsmanship Swap


Last night Micah Martin helped me check in to the Hampton Inn & Suites hotel next to 8th Light's office.

hotel

Thunder all through the night

The moment I opened the door to the hotel room a big thunderstorm moved in over Libertyville. The lightning and thunder came closer and closer. But for me, it felt very cosy to hear the storm outside while I was inside in my king sized bed trying to sleep after a wonderful day.

Day 2

Day two at 8th Light started with a delicious breakfast at the hotel followed by a 500 hundred meter car drive to the office. Today I had fun pairing with Justin Martin on a regular Rails project that is using JRuby instead of MRI. I'm probably going to work on that project for the rest of the week. In this project they use an interesting project management tool: AgileZen, a nice competitor to Pivotal Tracker.

Food and Smelly Clothes

After an iChat stand up with the customer and pairing, it was time for Mexican food. Justin and I drove and bought tasty Burritos. After lunch and more pairing with Justin - food again. Li-Hsuan Lung and Steve Kim took me to a nice Korean restaurant. I liked it a lot apart from having smelly clothes afterwards.

dinner

See you tomorrow

Thank you 8th Light for this day and see you again tomorrow.

Jun

First Impressions of My Craftsmanship Swap With 8th Light


This Saturday, I left a rainy Göteborg at 7 am and I arrived 2 pm to Chicago, where Paul Pagel from 8th Light came and picked me up. Paul showed me around in Chicago. We went to the Millenium park and saw the famous Cloud Gate sculpture. After that we had a couple of beers and went to a barbecue party on a big terrace with a beautiful view over the Chicago skyline. I went home pretty early since I had been up for almost 24 hours. And of course I forgot to tip the taxi driver on the way to the hotel. It's not easy being a Swede and not being used to tip all the time.

On Sunday I took the Architecture River Cruise; there was a fantastic guide telling stories about the buildings. I actually learned one thing on the boat trip: the difference between modern and post modern architecture. Modern architecture follows the rule: "less is more" while post modern let the surroundings effect the form of the building. Therefore a modern building can be placed in any city and still fit in, while a post modern building only has one right place - the current. I can highly recommend that boat trip - it was awesome.

After only two days in Chicago I'm already in love with the town.

8th Light

This Monday morning I took the train from Chicago Union Station to Libertyville. I felt very excited to join all the craftsmen at 8th light. After saying hi to everyone I got to pairprogram with Doug Bradbury. It was a multi language project (C++, Java, Ruby). But fortunately we only programed in Ruby. The application handles reservations of computers in libraries. I learned a lot of new stuff today. The most profound thing I learned or the most extreme thing I did was to pairprogram with Doug when he was on a treadmill - that's extreme programming. I also got to work in IntelliJ for the first time. It's very nice but I'm still a Textmate guy, but since Ruby 1.9 still isn't working properly with all the bundles, I'm thinking about switching editor. IntelliJ might be the one.

NoSQL at Obtiva

In the evening, we went on to the a to Obtiva office's, downtown Chicago, for a NoSQL group meeting. They had a very nice office and served some delicious food. It was an open discussion around a paper (CAP - Consistency, Availability, and Partitioning) that everyone had read beforehand. Interesting but very technical. We had to leave early since we had to catch the train back to Libertyville, a one hour train ride, so we missed the last part of the group meeting.

Thougths

One hard thing coming from Sweden to USA, is to program on an american keyboard. Since we have the letters å, ä, ö, in our alphabet, the important "programmer keys" are positioned differently. So there's some fumbling on the keyboard while trying to find the right keys.

Building

Closing

So far it has been a great experience. I love the town and the people. I'm very glad for having this opportunity to travel from Sweden to Chicago and getting to know the 8th Light guys. Finally a big thank to Micah Martin and CJ Kihlbom for making this a reality. Now it's time get some sleep before a new exciting day at 8th Light.

Feb

Mirror Images with CarrierWave


Inspired by this post on how to create mirror images with Paperclip, I decided to write up how to do the same thing with CarrierWave. It's a nice example of how CarrierWave's Uploader class makes manipulating files very easy.

This assumes you've already generated an uploader and probably mounted it on a model somewhere. If this doesn't make sense to you, check out the CarrierWave documentation.

Add this method to you uploader:

def add_mirror_effect(mirror_length)
  manipulate! do |img|
    mirror_rows = img.rows * mirror_length

    gradient = Magick::GradientFill.new(0, 0, mirror_rows, 0, "#888", "#000")
    gradient = Magick::Image.new(img.columns, mirror_rows, gradient)
    gradient.matte = false

    flipped = img.flip
    flipped.matte = true
    flipped.composite!(gradient, 0, 0, Magick::CopyOpacityCompositeOp)

    new_frame = Magick::Image.new(img.columns, img.rows + mirror_rows)
    new_frame.composite!(img, 0, 0, Magick::OverCompositeOp)
    new_frame.composite!(flipped, 0, img.rows, Magick::OverCompositeOp)
    new_frame
  end
end

This will first create a gradient. It will then flip the image and use that gradient as the alpha channel for the flipped image. Finally it will create a new image, putting the original, and the faded out mirror image together.

Next, add a version to your Uploader, which calls the new add_mirror_effect method:

version :with_mirror do
  process :add_mirror_effect => 0.2
end

That's it! The end result should look something like this:

class AvatarUploader < CarrierWave::Uploader::Base
  include CarrierWave::RMagick

  version :with_mirror do
    process :resize_to_fill => [200, 200]
    process :add_mirror_effect => 0.2
  end

private

  def add_mirror_effect(mirror_length)
    manipulate! do |img|
      mirror_rows = img.rows * mirror_length

      gradient = Magick::GradientFill.new(0, 0, mirror_rows, 0, "#888", "#000")
      gradient = Magick::Image.new(img.columns, mirror_rows, gradient)
      gradient.matte = false

      flipped = img.flip
      flipped.matte = true
      flipped.composite!(gradient, 0, 0, Magick::CopyOpacityCompositeOp)

      new_frame = Magick::Image.new(img.columns, img.rows + mirror_rows)
      new_frame.composite!(img, 0, 0, Magick::OverCompositeOp)
      new_frame.composite!(flipped, 0, img.rows, Magick::OverCompositeOp)
    end
  end

end

For extra props, put the add_mirror_effect method in a module and include it in your Uploader.

Aug

BizConf Reflections


In my post about the business value of conferences I mentioned that I would attend the conference BizConf, which I now have. This is a short review of my experience there.

It was hard to believe that this was BizConf's first year. The organizers did a great job making sure that everything ran smoothly and everyone had the best experience possible. I certainly had. The setting—the Ritz-Carlton on Amelia Island—was fantastic. While I spent most of the time inside, I managed to find some time to enjoy the beach.

Beach sunrise on Amelia Island

The reason I spent most of my time inside was that the sessions and conversations at the conference were so amazing. Limiting the number of attendees to just 75 people really helped define the conference as a place of great discussions among peers.

Since there were usually four simultaneous sessions the number of attendees in each sessions was very small—sometimes less than 10 people—which made the sessions very intimate and interactive. Some of them were just really fascinating group discussions with incredibly knowledgeable and experienced people like Jerry Weinberg and Johanna Rothman.

I was amazed by the consistent high quality of all the sessions. I was going to try to list some of my favorite sessions, but there were just too many of them! The content ranged from tactical to strategic. A great mix of simple, practical advice and higher level talks about the purpose of running a business.

The small group made everyone seem very approachable. And since the attendees were 75 of the nicest, most brilliant people in the business, the conversations were really great. This was my favorite part of BizConf by far. Having so many peers to discuss the challenges of running a business with was worth the price of admission alone.

Some of the great people at BizConf

One big difference compared to most other conferences I've been to was how few people had their laptops up during the sessions. Lark said it best:

You can tell a great conference... when there's no chance to tweet! #bizconf was rich, full-time intensity!

I realize that I'm rambling a bit here. I apologize. What it comes down to is this: Will I be back next year?

Hell yeah!