Archive for December, 2006

Stupid microwave trick

December 27th, 2006

While many modern microwaves have an “express cook” button, allowing you to heat something for one minute just by pressing “1,” other less-user-centered devices do not.

In these cases, to heat something for a minute, most people press Time-1-0-0-Start. Instead, press Time-6-0-Start. Same 60 seconds, one fewer keypress.

What hotels should do

December 27th, 2006

The Chandler, AZ SpringHill Suites has both the Gideons’ Holy Bible and The Book of Mormon in the desk drawer.

How about they place a copy of The God Delusion in each room instead?

My Toronto Star crossword puzzle fetcher

December 26th, 2006

On weekday afternoons, the Toronto Star publishes an eight-page PDF edition, “Star PM.” I download this for one reason: the free crossword puzzle.

But sometimes I forget to download this, and since there’s no archive, I lose the opportunity to do that day’s crossword. So I wrote a script to automatically fetch today’s Star PM and save it to my hard drive. Then, I went one better. Using the CoreGraphics Python module, I remove pages 1-7 of the PDF, so I store only the crossword puzzle. Then, it prints the PDF to my default printer.


## Toronto Star crossword puzzle fetcher
##
## Paul Schreiber <misc at paulschreiber dot com>
## http://paulschreiber.com/
## 1.0 -- 26 December 2006
##
## Licensed under a CreativeCommons-Attribution License:
## http://creativecommons.org/licenses/by/2.5/
##
## Usage: starpm.py <directory to store crossword puzzles>

How to fix Safari if it can’t view plugin content

December 25th, 2006

For a while, I haven’t been able to view plugin content (Flash, QuickTime, etc.) in Safari. I decided to do some quick regression to determine the source of the problem.

First, I viewed the pages in another browser, Camino, and they appeared correctly. So my plugins themselves were not corrupt.

Next, I logged in as a different user and viewed the pages in Safari. They appeared correctly. So Safari itself was fine.

Third, I logged back in as my original user and looked for potential culprits:

  • I renamed ~/Library/Safari to ~/Library/Safari.orig and launched Safari. No luck—it was still broken.
  • I deleted ~/Library/Caches/Safari and relaunched Safari. No luck.
  • Then, I moved aside ~/Library/Preferences/com.apple.Safari.plist and relaunched Safari. Aha! That was it.

Now, I didn’t want to lose all of my Safari preferences, so I deleted the newly-created com.apple.Safari.plist and put my old one back in place. I went into Terminal and issues this command:
defaults read com.apple.Safari

I searched through the pages of results, looking for anything relevant. I spotted “Saft Block Plugin,” but it was set to 0, or false. Wait — then I saw that WebKitPluginsEnabled had somehow been set to false.

I ran this command:
defaults write com.apple.Safari WebKitPluginsEnabled 1

and relaunched Safari and I was back in business.

Why C++ sucks

December 14th, 2006

If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor, and when was the last time you needed one? —Tom Cargil, C++ Journal (via KDE)