Sometimes in order to succeed, you have to give up

We went camping at Wallowa Lake, OR this summer.  What a beautiful place!  Of course, it took forever to get there from Bend, but it was well worth the trip.

As is typical when we go camping, Beth and I slept in our sleeping bag atop an air mattress.  This particular air mattress had been replaced several years ago because its predecessor started to leak right around the base of the circular baffles that join the top and the bottom of the air mattress together.

Well, apparently it was time for this air mattress to suffer the same structural defect.  I awoke one morning to find my hip touching the ground and realized I would need to fix this situation if I wanted a good night’s sleep going forward.

In the past, I had been able to super-inflate the mattress and use soapy water to spot the leak.  However, this leak was not cooperating — I would have to get more serious if I wanted to sleep well for the rest of the trip.  So, I took the air mattress to the lake, figuring that if I submerged the mattress, it would yield its leak(s) in the form of air bubbles.  After twenty minutes of pushing, prodding, and otherwise cajoling the mattress into giving up the secret location of the escaping air, I was defeated.  I knew it was there, but I couldn’t find the leak.

I was resigned to several more nights of subpar sleep.  I gave up.

What do you do when you are in a beautiful lake in the afternoon with an air mattress in front of you with the sun heading toward the horizon, much like your summer is sunsetting into autumn?   You jump on your air mattress and soak up some of summer’s final rays — that’s what you do!

It was a split-second after I landed on the air mattress that the telltale WHOOSH from the leak exposed its location.  I mapped the breach immediately by counting the x and y baffle “coordinates,” took the mattress back to camp, let it dry, and finally fixed the leak.

I slept just fine that night.

What I want for Christmas from Apple

Here’s my Christmas wish list for 2007 from Apple:

  1. iChat for Windows with support for video conferencing with multiple simultaneous participants. I have a friend on Windows and another friend on an iMac and it would be wonderful to be able to get us all on at the same time. Same point for my professional colleagues who are on Windows — most in DC but another in TX.
  2. A dock/port replicator for my MacBook Pro.  You want to know how tired I am of unpacking/repacking my power cord, unplugging/replugging my speakers, etc?
  3. Make it a punishable offense to steal focus. This was my number one point I was able to hold over Windows users — that OS X never steals focus from what you’re doing (usually typing). Ironically, it seems that iTunes is now the worst offender in this category.
  4. Resolution independence. I love this high-res MacBook Pro screen; I don’t love how small the letters get at high resolution. Good thing I have “the eyesight of a ten-year-old” according to my FAA medical exam.
  5. A reliable Mighty Mouse. I love my Mighty Mouse, but it has about a 50% failure rate recognizing a “right-click.” Regardless, the scrollball absolutely ROCKS.
  6. Window cycling through Spaces. I love Spaces. I don’t love not being able to cycle through all of the windows in an application (Terminal leaps to mind) when the windows are in different spaces.
  7. Rectangular text selection in Safari. Yes, I’ve filed a feature request for this. Apparently it was a duplicate, which is a great sign!

I’m sure there’s more I could ask for that would make for a nice Christmas from Apple. But if I could have only one thing off my list, it would definitely be iChat for Windows.

Whaddayasay, Santa?

BSOD on OS X

I was doing some work in Visual Studio this morning in Vista running under Parallels on my MacBook Pro.

At one point, Vista crashed and displayed the BSOD, and I had to chuckle that I was seeing one on my Mac.  Of course, OS X didn’t care….

MacBook Pro would circle-slash on boot after Leopard update

I install Leopard on my MacBook Pro on Friday evening, messed around with it a little, and then put the computer to sleep until Saturday.  On Saturday, I had reason to restart, and that’s when I saw it:  upon restart, I would get the gray Apple logo, then a spinner beneath that logo, then eventually (3 minutes?) a circle-with-a-slash-through-it where the Apple logo was.

Nuts.

I tried several things to no avail, including verifying the disk and repairing disk permissions.  I even reinstalled Leopard which actually brought the computer up again but still didn’t solve the problem upon restart.

I just now got off the phone with Apple — 47 minutes from dialing to finished with about a 10-15 minute wait before I spoke to a human.  Following his instructions, I booted the computer into “safe mode” (by holding down the Shift key after restart).  Then I deleted all my login items (via System Preferences –> Accounts).  However, the clincher (I believe) was deleting all the folders in /Library/StartupItems which included, among other things, an old Nortel Contivity VPN client.

All better now!

Auto-completion in OS X (10.4) Mail!

Imagine my surprise at 0722 on a Friday morning when I’m typing an email but my fingers are not awake yet…

In the body of the message, I typed “R” then was trying to press “option-e” in order to put an accent aigu on the “e” I was about to type. Accidentally, I pressed “option-escape” and it popped a list of words that start with R!

Yes, I still need more coffee, but coming from a Java IDE and Visual Studio which does auto-completion in code, this is a very welcome discovery!

Constant crisis

In my Rails application, I have a file in

RAILS_ROOT/lib/pcm/web_services/constants.rb

On my development machine (OS X), I am able to reference items in this file/module using the prefix “PCM::WebServices::Constants” without having to require the file. Once deployed on Linux, however, this approach broke and I had to explicitly

require 'pcm/web_services/constants'

(or any other file I needed from the lib/pcm directory) for things to work. I suspected it had something to do with case sensitivity on Linux as opposed to not-so-case-sensitivity on OS X. I was wrong.

Upon further investigation, I find I can easily reproduce the problem, although I do not yet have an explanation.  The solution to the problems are (so far):

1) Explicitly require ‘pcm/web_services/constant’ wherever I need it.  No biggie, but I prefer the “less is more” philosophy where Rails automagically loads the constant without the explicit require.

More possible solutions coming soon…

—>8— cut here —>8—

1) Create a new Rails app, e. g. $ rails constant

2) Edit the environment.rb file to add your own module with
configuration constant default values with the idea you could
“override” these by specifying them in the specific environment file:

At the end of config/environment.rb, add:

module AppConstants
  IMPORTANT_VALUE = "x" unless defined?(AppConstants::IMPORTANT_VALUE)
end

3) Create a Ruby module in the file lib/app_constants/list.rb, noting
the “top level” name of the module matches the one specified in the
environment file:

module AppConstants
  module List
    LIST_CONSTANT = "list_constant"
  end
end

3) Fire up the console and probe the constant values:

Loading development environment.

>> AppConstants::List::LIST_CONSTANT
=> "list_constant"
>> AppConstants::IMPORTANT_VALUE
=> "x"

4) Quit from the console and add development-specific value for the
constant defined in the environment file:

At the end of config/environments/development.rb, add:

module AppConstants
  IMPORTANT_VALUE = "definitely_not_x"
end

5) Fire up the console again and probe the constant values:

Loading development environment.

>> AppConstants::List::LIST_CONSTANT
NameError: uninitialized constant
Rails::Initializer::AppConstants::List
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:263:in `load_missing_constant'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:452:in `const_missing'
from (irb):1
>> AppConstants::IMPORTANT_VALUE
=> "definitely_not_x"
>> AppConstants::List::LIST_CONSTANT

NameError: uninitialized constant
Rails::Initializer::AppConstants::List
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:263:in `load_missing_constant'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dependencies.rb:452:in `const_missing'
from (irb):3

SMC Barricade and iChat

OK, so until I figure out what sort of new and improved wireless router I’m going to use in my office, I figured I might as well continue using this old SMC Barricade I have. Problem was it wasn’t allowing iChat video conferencing. After some fiddling, I finally arrived at the following settings in the “Special Application” [sic] screen that allowed the magic to happen. Might be overkill, but it works, so don’t fix it:

Barricade Settings for iChat

You can see the final port number got truncated on lines 2 and 4. For reference (and copy and paste), the ports are:

Trigger Port: 5060

Lines 1 and 3: 5060, 5190, 5220, 5222, 5223, 5298

Lines 2 and 4: 5060, 5190, 5297, 5298, 5353, 5678, 16384-16403

 

Edit 01-Oct-2007:

 

OK, so iChat AV worked for a while, but then broke.  I think I had a red herring in the above configuration.  Stay tuned…

Option + Drag + Quote

Yet another reason I love TextMate:

 

You may or may not know that when you have text selected in TextMate and you press the quotation mark it will surround the selection with quotation marks (instead of replacing the selection with a single quotation mark).

 

Also, you may or may not know that you can select an arbitrary rectangle of text in your code by option-click-dragging across multiple rows/columns.  Then anything you type replaces what you’ve selected on every line.

 

Putting these two features of TextMate together, if you have option-selected some text on multiple lines, and some of the lines have trailing space selected, then you press quotation mark, it does the Right Thing by placing the quotation mark before the trailing space on each line, as opposed to at the end of the selection on every line.  Very cool.

 

OK, it doesn’t read very well, so try it out yourself to find out what I’m talking about.  In the case where I was copying data from a spreadsheet into my Ruby code and needed to quote the values that I copied in, it was a huge time saver.