Cost of Meet(ing)

I’ve long been frustrated that meetings are not quantified, where the cost of the meeting is calculated based on the wages of those in the meeting. With that data, it would be more obvious to determine that cost/benefit of the meeting.

Some back-of-the-envelope calculations here. For four people making an average salary of $100,000 (I’m using programmer gross salaries, including benefits and vacation), a 30-minute meeting would run $96. For twelve people for two hours: $769. Twenty people for two eight-hour days (for example, training): $15,385.

Since I’ve been trying to spin up my web skills I slapped together a site that acts a bit like a timer for a meeting. It’s built on Rails, yet uses little of the framework, other than some of the JavaScript libraries and routing.

Please check it out: costofmeet.org

Advertisements

Rails testing and Emacs mode line

I’ve been diving/digging into the oh-so-excellent Rails Tutorial, by Michael Hartl, and am into chapter 3, where testing begins.

Imagine my surprise — go ahead, imagine it — when my Emacs mode line changed color.

Originally:

modeline_original

And when I ran “bundle exec rake test”, it succeeded with:

modeline_success

Then changing the test code to fail, after running “bundle exec rake test” again:

modeline_failed

Tracking down this code, I found that the guard-notiffany gem was doing this behavior, sending a change to the Emacs mode line via emacsclient, with this bit of code in lib/notiffany/notifier/emacs.rb:

        def notify(color, bgcolor)
          elisp = <<-EOF.gsub(/\s+/, " ").strip
            (set-face-attribute 'mode-line nil
                 :background "#{bgcolor}"
                 :foreground "#{color}")
          EOF
          emacs_eval(elisp)
        end

The issue there was that it just changes the mode line “permanently”. I’d prefer that the mode line colors change for a moment, then time out and revert to their previous settings.

I wrote a bit of code to do this, and modified lib/notiffany/notifier/emacs.rb locally, but there is a pending pull request that has a better implementation.

However, my hack is:

        def notify(color, bgcolor)
          elisp  = "(let ((orig-bg (face-attribute 'mode-line :background))"
          elisp << "      (orig-fg (face-attribute 'mode-line :foreground)))"
          elisp << "     (set-face-attribute 'mode-line nil"
          elisp << "                         :background \"#{bgcolor}\""
          elisp << "                         :foreground \"#{color}\")"
          elisp << "     (sit-for 3)"
          elisp << "     (set-face-attribute 'mode-line nil"
          elisp << "                         :background orig-bg"
          elisp << "                         :foreground orig-fg))"
          emacs_eval(elisp)
        end

The sit-for keeps the mode line as red or green for 3 seconds or when there is Emacs input. I prefer that, to clear the mode line more quickly, since I find the bright color distracting.

Rails Upgrade from 2.2 to 2.3

I’ve redone my site (incava.org) in Rails, and do my development under 2.2. When deploying my site onto a server running Rails 2.3, there was an error:

uninitialized constant ApplicationController

After some head-scratching, I found this, which explains the error as resulting from Rails 2.3 expecting the ApplicationController class to be in app/application_controller.rb, not, as in Rails 2.2, as app/application.rb.

I took the easy approach – also maintainable under both 2.2 and 2.3 – and simply linked application_controller.rb to application.rb, which solved the problem.