Archive > June 2009

Checkout Hoptoad by thoughtbot, inc.

Dave » 15 June 2009 » In Technology, rails » 2 Comments

I’ve been using Hoptoad for about two months now, and I’m sold. Hoptoad is a product by thoughbot, inc. Previously, I’ve always used the excellent exception_notification plugin. The exception_notification plugin is easy to use, and it works great. However, there are a couple of problems with it.

  1. You could flood your inbox if there is a bad problem on a popular page.
  2. It’s difficult to collect all the emails and track errors.

Enter Hoptoad. Hoptoad solves both problems, and it is super simple to use and setup. It’s free for one project and two users. If that isn’t enough for you, the premium services are very reasonable.

How does it solve both problems? First, Hoptoad will still send you an email when there is an error. However, it won’t flood your inbox if there are hundreds of the same email. Second, Hoptoad provides a simple web-based system that groups your errors by exception class. That makes it easier to track down problems. Finally, you can mark errors resolved so you don’t have to wade through noise to solve the real problems.

Hoptoad installation:

REMOVE EXCEPTION_NOTIFIER

  1. In your ApplicationController, REMOVE this line:include ExceptionNotifiable
  2. In your config/environment* files, remove all references to ExceptionNotifier.
  3. Remove the vendor/plugins/exception_notifier directory.

INSTALL HOPTOAD_NOTIFIER

From your project’s RAILS_ROOT, run:

script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git

CONFIGURATION

You should have something like this in config/initializers/hoptoad.rb.

HoptoadNotifier.configure do |config|
  config.api_key = '1234567890abcdef'  # You get your key when you sign up
end

(Please note that this configuration should be in a global configuration, and is not enrivonment-specific. Hoptoad is smart enough to know what errors are caused by what environments, so your staging errors don’t get mixed in with your production errors.)

Once you do the above, any Exception not caught by your controllers will be sent to Hoptoad where where they can be aggregated, filtered, sorted, analyzed, massaged, and searched.

Now, if you have read anything I’ve done before, you know I do a lot of asynchronous processing with Workling. By default, Hoptoad will not log errors from anything outside of your controllers. Fear not. Hoptoad provides a webservice API to send errors. Here is an example.

In workling/lib/workling/base.rb:

    # takes care of suppressing remote errors but raising Workling::WorklingNotFoundError
    # where appropriate. swallow workling exceptions so that everything behaves like remote code.
    # otherwise StarlingRunner and SpawnRunner would behave too differently to NotRemoteRunner.
    def dispatch_to_worker_method(method, options)
      begin
        self.send(method, options)
      rescue Exception => e
        raise e if e.kind_of? Workling::WorklingError
        logger.error "Workling Error: runner could not invoke #{ self.class }:#{ method } with #{ options.inspect }. error was: #{ e.inspect }\n #{ e.backtrace.join("\n") }"
        # DND: Let HopToad know of the issue
        params = options || {}
        HoptoadNotifier.notify(
          :error_class => "Workling Error - #{e.class.name}",
          :error_message => "Workling Error(#{e.class.name}): #{e.message}",
          :request => { :params => params.merge(:worker_class => self.class.name, :worker_method => method) })
        # DND: end of change
      end
    end

Now, any error not caught by your workers will be sent to Hoptoad for processing. You can use a similar method from Rake tasks or any scripts that run outside of controllers. Remember, Hoptoad will collect errors by :error_class, so you can use different classes to separate errors into bins based on where they came from.

Give Hoptoad a try. You will not be disappointed.

Continue reading...

Tags: , , ,

Bargaining for Advantage

Dave » 14 June 2009 » In Life » No Comments

Bargaining for AdvantageIt’s not a programming book, but I recommend “Bargaining for Advantage” by G. Richard Shell. You may not be making multi-million or multi-billion dollar deals (yet!), but the techniques described here work just as well when negotiating an architectural detail or project. Plus, it’s pretty interesting to read about how some of the big players made and lost their deals.

Check it out. You may find that you have a different strategy when you negotiate your next deal. Remember, deals are made all the time, and it’s not always a big business deal.

Good stuff.

Continue reading...

Tags: ,

June 6, 2009 – 65th Anniversary of The Great Crusade

Dave » 06 June 2009 » In Uncategorized » No Comments

OK, I know I’m a little off my usual topics again, but today is an anniversary.

In the early morning hours on a Tuesday morning 65 years ago today, D-Day paratroopers began jumping into the French countryside. At first light, six divisions of soldiers from the United States, Britain, and Canada began landing on the beaches of Normandy.  The beaches all had code names Omaha, Utah, Gold, Juno, and Sword. The United States landed on Omaha and Utah. The British took care of Gold and Sword, and the Canadiens landed on Juno.

Just prior to the invasion, General Eisenhower read what is now an historic passage:

“You are about to embark upon the great crusade, toward which we have striven these many months.”

Obviously, you can read about the Normandy invasions everywhere, so I’m not going to describe all the events again here. I will, however, talk a little bit about my experiences touring the area as well as introduce you to Charles Durning.

Who is Charles Durning? You probably know him by his movies. His film career began in 1965. Some credits include “The Sting”, “Dog Day Afternnon”, “North Dallas Forty”, “The Best Little Whorehouse in Texas”, “O Brother, Where Art Thou?”, and dozens of others. What you may not know about Charles Durning is that he survived two most horrific periods in WWII. You wouldn’t know because like many veterans of that era, he rarely spoke about it until years later when asked.

Durning was awarded the Silver Star and three Purple Hearts. He was among the first wave of troops that landed on Omaha Beach. Suffice to say, the nickname of “Bloody Omaha” is descriptive because of the more than 2,200 casualties suffered on 6 JUN 1944.

By 17 JUN 1944, Durning was back in England recovering from  shrapnel wounds in the left and right thighs, the right hand, the frontal region of the head, and the anterior left chest wall. He was pronounced fit again on 6 DEC 1944, just in time for the Battle of the Bulge and his second historical experience.

In 2008, Durning received France’s National Order of the Legion of Honor (each year France honors 100 veterans that served with distinction in France). At the ceremony, he described his experiences during the Battle of the Bulge. Early in the battle, Durning was stabbed 8(!) times during a hand-to-hand fight with a young German soldier. The fight did not end until Durning was able to reach for a rock and bludgeon the German soldier to death. He said when it was over he wept with the dead German soldier in his arms.

Soon after, Durning was taken prisoner and would have been shot on the spot were if not for an english speaking German officer that accepted his surrender and had his wounds tended to (the 8 stab wounds – one to the chest). As a prisoner now, Durning was led to a small town called Malmedy. It is here that the infamous Malmedy massacre took place. At Malmedy, some 150 prisoners were rounded up and dozens were executed. Durning and two others of his group managed to escape the carnage. There were many incidents in an around Malmedy, resulting in 72 bodies being discovered.

Durning was on the TV show “Rescue Me” this year. It was here that I was reminded of his service and felt the urge to talk about it. I’m thankful for men like Charles Durning and thousands of other’s like him. Like most veterans, I agree that the true heros are the ones that didn’t make it back.

I was lucky enough to pay a short visit to Normandy many years ago. The visit was far too short, but I was able to stand on Omaha and Utah beaches and see what men like Durning faced. Think about 2-3 football fields of open beach to cross with an amphitheater of cliffs all around. Unlike what you see in the movies, it’s not the machine guns right in front of you that are the most dangerous. It’s those to the side. This is one of the reasons some units saw casualty rates of over 50% in the first few minutes of the landings. Powerful stuff.

In this time of robots and smart bombs, we will thankfully never again see mass invasions and infantry action. I only hope it isn’t replaced with something far worse. So today, while you are enjoying a wonderful Saturday, send a “Thank You” to those men and women that started the Great Crusade to clear Europe of Nazi tyranny 65 years ago today.

Continue reading...

Tags: ,

Platform Engineers or Rock Star Engineers

Dave » 03 June 2009 » In Technology » 2 Comments

I’ve hired a lot of engineers over the years, and one of the first things I’m always asked to add to the job description is “must have experience in XXXX platform.” I sometimes put it on there to make people happy, but I rarely will disregard an engineer because they do not have a lot of experience in a particular platform. Give me a Rock Star, or even a very good/great engineer, and I guarantee you that person will run circles around the average engineer with platform experience. Now, if you can find the Rock Star with platform experience — BONUS! The only time I deviate from this plan is if the project calls for someone to “just get it done and fast.” Then I need to pay more attention to platform experience because I don’t have time to wait for the new platform to be learned.

I’ve lost track of how many times this simple fact has been proven to me. The qualities of a great engineer carry over to any platform, and a great engineer will pick up a new platform quickly — mostly because they love learning new things. If you’re starting out in software development, concentrate on being a great engineer. That’s far more valuable than an engineer that knows a platform.

What makes a great engineer? To me, it’s pretty simple. You have a passion and ability to craft outstanding, maintainable, and testable code. You know your algorithms, design patterns, and data structures like the back of your hand. Finally, you posses the other skills necessary to round things out — communication, time management, risk assessment, strategic and detailed design, and quick decision making (and sticking to those decisions). You can write a loop in Java? I don’t really care. You understand dependency injection or how an outer join works. Now we’re talking.

What do you think?

Continue reading...

Tags: