RubyMine, Firefox, and Exception Backtraces

I use RubyMine and Firefox for most of my day-to-day Ruby on Rails development, and in spite of my best efforts, I sometimes get exceptions that result in the display of Ruby backtraces instead of the web page I asked for.

While the backtrace helpfully lists the places in my code (or Rails, or the Ruby libraries, etc) that we traversed on the way to the crash site, opening the file in RubyMine to see more context requires copying the path, invoking a RubyMine keyboard shortcut for open-file, and pasting. Work.

After a lot of this copy and pasting, it occurred to me to join Firefox’s ability to invoke a program for a particular URL scheme, and the command-line wrapper that RubyMine can produce to open files in a running RubyMine instance.

This gist is the result: it’s a Rails initializer that produces “mine:” links in backtraces. It starts with instructions on setting up Firefox and the RubyMine wrapper; once you’ve followed them, you’ll get links in the backtrace that’ll take you directly to the source where an exception occurred.

(Note: I’m using this while working on a Ruby 1.8.7 / Rails 2.3.4 application, and as you can see, it monkey-patches the backtrace functions in Exception; I fully expect to have to update it for newer Ruby and Rails versions – if you find that changes are needed, or have other suggestions, please let me know in a comment. Thanks!)

5:21 pm — GeneralComments (0)

A Christmas Tradition, from 1976

Continuing the tradition started three years ago, here’s my Dad’s third “obscure” Christmas card, from 1976:

(The small image is a little blurry – click on it for the full-size image.)

Previously: 1975 1974 1973

10:52 pm — GeneralComments (0)

A Christmas Tradition, from 1975

Continuing the tradition started two years ago, here’s my Dad’s third “obscure” Christmas card, from 1975:

Previously: 1974 1973

8:00 am — GeneralComments (3)

Running away to the circus… for a few minutes

I surprised Gina tonight with a trip to see Cirque du Soleil’s “Kooza,” which just opened in Portland. She didn’t figure it out until she saw the tent, so that’s nice: I kept throwing her off with false answers to her questions: Her: “Is this an event where I’ll have to introduce myself?” Me: “Oh, yes, everyone will.”

To cut to the chase, this was my favorite Cirque experience; I’ve seen several of their shows over the years, starting with a private performance for Apple folks in the San Francisco Civic Auditorium, sometime in the late ’80s. This time, the music was great, and the athletic performances were stellar — especially the new “Wheel of Death,” which, even with our under-the-end view, was pretty amazing.

The clowns were great, too, and Cirque’s sense of humor is always my favorite part of the show. Funny story: y’know how they pick people from the audience, and you wonder whether those people are “plants”? I now have firsthand experience that they’re not: tonight they picked me. In the five or so minutes I was up there, I got dragged around the stage, had my leg humped by one clown, the other picked a fight with me, and the ringmaster tased all three of us. (If you get picked for this, do nothing when he tases you the first couple of times. He’ll point at the other two, twitching on the stage, then tase you again – then you fall to the floor too, twitching like the others. Twitch some more when he tases your crotch.)

All in all, an incredible evening. Go see the show – it’s a lot of fun, even without me in it. Who knows – perhaps you’ll be!

11:02 pm — GeneralComments (0)

Open Source Bridge: Exciting the attentions of the Ingenious

I’m reading “The Invention of Air” by Steven Johnson, which talks a lot about Joseph Priestly’s experiments with electricity, discovery of oxygen, etc, and also about the scientific community of the time: Priestly had many interactions with (and got much encouragement from) Benjamin Franklin; Thomas Jefferson is also involved in the story, but I’m not to that spot in the tale yet.

Where I am in the book (p71), there’s a quote, the last paragraph from a September 1753 letter from Franklin to botanist Peter Collinson:

These Thoughts, my dear Friend, are many of them crude and hasty, and if I were merely ambitious of acquiring some Reputation in Philosophy, I ought to keep them by me, ’till corrected and improved by Time and farther Experience. But since even short Hints and imperfect Experiments in any new Branch of Science, being communicated, have oftentimes a good Effect, in exciting the attentions of the Ingenious to the Subject, and so become the Occasion of more exact disquisitions and more compleat Discoveries, you are at Liberty to communicate this Paper to whom you please; it being of more Importance that Knowledge should increase, than that your Friend should be thought an accurate Philosopher.

(You can read the whole letter, which details Franklin’s recent researches into electricity, here — it starts on p148, ends on p153.)

I’m inspired to post this here because I happened to have just registered to attend Portland’s Open Source Bridge conference, coming up June 1-4 — the open source movement is the next Age of Enlightenment.

2:06 pm — GeneralComments (0)

A Christmas tradition, from 1974

Last year I started a new tradition and posted my Dad’s first “obscure” Christmas card from 1973; this year’s reposted card appears just in time, because technical difficulties knocked this site off the air for the last couple of weeks.

Here’s Dad’s 1974 card – it’s one of his easier ones, made even easier when I tell you that those white dots on the right were made with a punch and go through the card. Merry Christmas!

11:41 pm — GeneralComments (2)

My 25 things

I’m not happy about Facebook’s greedy terms of service, so rather than hand them content that they’re going to keep and monetize forever, I’m posting my “25 things you didn’t know about me” here…

  1. I ignore chain-letter-like things, which is why it’s taken me so long to give in and make this list (and why I haven’t tagged 25 more of my friends – you can thank me later).
  2. I started kindergarten when I was four.
  3. My partner Gina got me on Craigslist.
  4. Hearing “The Star Spangled Banner” usually makes me tear up, for about four different reasons.
  5. I’ve visited 38 states, mostly in one summer journey in my own small airplane.
  6. The least authentic of those visits was to Montana, where I did a touch-and-go at the southeasternmost airport, and only briefly put one wheel down.
  7. The most authentic of those visits was in Albany, Missouri, where I was introduced to the town doctor by his cousin who’d picked me up on the road into town (and I wasn’t even hitchhiking). The doctor bought me lunch (at one of the two open restaurants in town), showed me his restored car collection, took me on rounds at the hospital and introduced me to his patients, let me buy him & his wife dinner (at the other), put me up for the night, and gave me the keys to one of the cars to drive myself back to the airport in the morning.
  8. I can open champagne with a sword, one of many important things I learned from my father.
  9. The only times I cut class in junior high school was to watch the film & TV companies that often shot near where we lived (in a trailer park in Malibu). I was there when Fonzie jumped the shark.
  10. My first job was in the kitchen of the Sandcastle restaurant in Malibu, the blue and white building outside Jim Rockford’s trailer’s front door.
  11. I got into computers by getting lost my first time in Santa Monica, near a closed pizza place, a sketchy-looking bar, and the first computer store in the world. My first job in computers was entering BASIC programs from a book there – I never finished the book, and was never paid. (Hi Greg!)
  12. When I was into citizen’s band radio in the mid-70′s, my handle was “Condor”.
  13. I see a lot of movies: around 200 last year, around 80 so far this year (mostly at the Portland International Film Festival, underway now). The only genre I don’t bother with is horror.
  14. I value my oldest friends exceedingly highly; though I’m rarely in touch with them, I think of them often and miss them deeply.
  15. I once drove from Santa Monica to Malibu with my late best friend Lad, with my seat fully reclined and me unable to see, in traffic. I worked the pedals, he steered. This was about the limit of our high-school hijinks.
  16. My favorite movie line is when Harold gives Maude a coin stamped with “Harold loves Maude”, and she throws it off the pier and says “So I’ll always know where it is.”
  17. Everything I know about bowling, I learned from watching Dad: Get a heavy ball. Throw it really hard.
  18. My favorite film is “The Shawshank Redemption.”
  19. Baseball is pretty much the only sport I like watching, yet I don’t like extra innings; nine is enough. (Worst baseball decision ever: at a San Jose Giants game, I turned down a job offer from Mark’s friend Pierre at then-nascent EBay. I think the Giants lost that day, too.)
  20. I play guitar, but not very well. Other instruments I’ve attempted include drums, cello, piano, flute, banjo, ukulele, clarinet, and French horn.
  21. I never snuck into extra movies at the multiplex until my Dad got me to, when I was nearly 30. Now we rarely do, because we need to get home to the dog.
  22. Nowadays, I write software mostly in Ruby. Other languages I’ve been paid to use include BASIC, Fortran, Pascal, C, C++, Bourne shell, Postscript, c-shell, Perl, Bash shell, Java, Javascript, and Python, roughly in that order. Oh, also: 6502, 6800, 8080/Z80, 68000, and ARM assembly languages.
  23. I have a high-school diploma *and* a California high school equivalence certificate.
  24. Our dog is named after the little girl in “To Kill a Mockingbird”, of course.
  25. I own a straitjacket. Surprised?
8:37 am — GeneralComments (4)

A Christmas tradition, from 1973

Christmas was a big holiday for my Dad: each year, he’d send out custom Christmas cards with obscure messages. He’d look forward to the phone calls that would result — people asking for hints, or badgering him for the new low of that year’s wordplay. He’d usually chide them (truthfully) that I’d gotten the answer in only a minute or so – I think my fondness for solving puzzles was inherited from his fondness for creating them.

It’s been 35 years since the first of these cards – I’m starting a new tradition, posting them here for the holidays. Here’s the first one.

10:33 am — GeneralComments (4)

As the polls close…

“I find I’m so excited, I can barely sit still or hold a thought in my head. I think it is the excitement only a free man can feel, a free man at the start of a long journey whose conclusion is uncertain. I hope I can make it across the border. I hope to see my friend, and shake his hand. I hope the Pacific is as blue as it has been in my dreams. I hope.”

- Red, “The Shawshank Redemption”

5:50 pm — GeneralComments (1)

I drink your milkshake

I like chocolate milkshakes, in ways that the HTML “<strong>” tag can’t really convey.

So a couple of years ago, to keep myself from going all Elvis in my senectitude, I adopted a rule: I’d only have a milkshake as we reached each thermometer milestone of 10 degrees Fahrenheit: I’d have one on the first day we hit 80°, one when we hit 90°, another at 100°, and should we hit 110°, I’d still be able to celebrate.

Unfortunately, I was cheated: I was out of town for the first two 90° days, then we went straight to 100°. (And no 110°, boo hoo.)

This year, I’m not taking any chances: I’m starting at 70°. I deserve it, too: we haven’t hit 70° yet this year, and we’re almost halfway through April already. I further deserve it because Cool Moon has been open since last November, just across the park, and I’ve been able to resist.

Tomorrow, however, the forecast is for 75° – Cool Moon, I’m coming for you.

11:16 am — GeneralComments (0)
Next Page »