Tuesday, October 15 2002

My other PDA is made of wood pulp

I was sitting in a meeting today with my iBook, and a late arrival walked up and asked if we could chat for a bit afterwards. Normally when he needs to talk to me, it’s either to pick my brain on some operational aspect of the service, or see if I’m willing to commit my team to supporting the latest project that’s steam-rollering down on him.

In this case, he wanted to talk about Stickies. Seems he’s been writing a replacement for the current OS X version, and decided that I might have useful input to offer. Something to do with the cascade of 30+ notes covering almost every square inch of my screen, taking full advantage of multiple fonts, text color, note colors, minimization, etc. Also physical post-its attached to flat surfaces on the laptop.

(Continued on Page 97)

Saturday, July 12 2003

The Passing of Tom Emmett

[excerpted from John M. Browning, American Gunmaker, by John Browning and Curt Gentry. © 1964 by the Browning Co. and Curt Gentry.]

The Brownings depended on Tom Emmett for all odd jobs, either at the store or in their homes. He professed no specialized skill but would tackle any job and get it done. On this day he was up on a stepladder near the ceiling of the shop, by the line shaft, taking measurements. His job kept him near the shaft for so short a time that he did not ask to have the power shut off. Nobody paid any attention to what he was doing, except John. He remarked to Ed, “Tom shouldn’t be working up there with the power on.” Ed looked over his shoulder and said, “Oh, he’ll be through in a minute, and I need the lathe.” It happened just then, while John was looking straight at Tom.

(Continued on Page 92)

Tuesday, July 15 2003

Mystery Hill on the level

It happened in 1980, I think. My father and I were vacationing in Michigan, in the general vicinity of Manistee, when some of the local kids told us about a special place they were calling Mystery Hill, where if you put your car in neutral, it would roll uphill.

It’s a fairly common optical illusion that often results in the creation of a cheesy tourist trap. By happy coincidence, on the day we went out to see it, my father had a toolbox in the back of his truck. It contained a carpenter’s level. We set it down on the allegedly-uphill road and let the universe reveal the truth of the matter.

Thursday, July 24 2003

Color combinations for web sites

I’ve stumbled across two interesting tools recently. The first is the Mac application ColorDesigner, which generates random color combinations with lots of tweakable knobs. The second is Cal Henderson’s online color-blindness simulator, designed to show you how your choice of text and background colors will appear to someone with color-deficient vision.

I decided to try to merge the two together into a single web page, using Mason and Cal’s Graphics::ColorDeficiency Perl module. It’s not done yet, but it’s already fun to play with: random web colors.

Right now, the randomizer is hardcoded, but as soon as I get a chance, I’ll be adding a form to expose all of the parameters.

Thursday, June 24 2004

…sticks where it’s supposed to…

Let’s say, hypothetically speaking, that one had recently had an unpleasant encounter with some pavement. And, purely for the sake of argument, let’s say that the clothing one was wearing mostly protected one’s body from being damaged by this encounter, but allowed a relatively small patch of skin to be, in the vernacular, “rubbed raw.”

What over-the counter remedies would one find best suited to dealing with this situation? My list (which isn’t at all hypothetical, more’s the pity):

  • Bayer aspirin
  • Bactine Pain Relieving Cleansing Wipes
  • Nexcare Non-Stick Pads (which, I’m pleased to report, do not, in fact, stick)
  • Nexcare Micropore Paper First Aid Tape (which sticks to hairy arms without subsequently removing said hair)
  • Band-Aid Hurt-Free Cleansing & Infection Protection Foam (which penetrates more deeply than the wipes)

First-aid products might not be a sexy market, but they’ve improved a lot since I last fell off of a two-wheeled vehicle, sometime in the early Seventies.

Friday, July 2 2004

New toy: Motorola v600

Okay, I don’t really have much use for the camera side of my new cellphone; I’m a quality snob who thinks his 5 megapixel digicam is adequate for 4x6 snapshots and web galleries and nothing more, and I’m more interested in switching to larger film than to digital. Still, when you buy a new toy, in this case replacing my Ericsson T68 to get better reception and MP3 ringtones, you should at least try out the features.

How’s the camera? Functional for quick, on-the-spot documentation, but nothing more. For instance, when I was leaving the Reno Hilton (lame casino, skip the steakhouse, eat at Asiana) Wednesday morning, I spotted a big Harley parked on the sidewalk next to a large sign that boldly stated “No motorcycle parking on sidewalk.” That would have been worth a quick snap.

It takes 640x480 pictures, and claims to offer a 4x zoom. Zoom, my ass. This is pure marketing-speak. The viewfinder is what zooms; the resulting picture is either a 320x240 or 160x120 crop. Quality is nothing to write home about, but sufficient for amusement.

Other than that, the phone’s features are quite nice. It has the usual mix of vibrate, speakerphone, BlueTooth, GPRS, games, messaging, etc., and adds MP3 ringtones with quite reasonable fidelity. The reception is also living up to its promise so far, giving me a much stronger signal inside my house, where the Ericsson was prone to dropping calls unless I stood in the sweet spot facing the correct direction.

Motorola doesn’t support Macs for their phones, and Apple hasn’t added SyncML support to iSync, but they still work together over BlueTooth. You can copy phonebook entries, MP3s, and pictures back and forth, and with Ross Barkman’s modem scripts and configuration database, it was easy to set up GPRS and configure my PowerBook to use the phone for wireless Internet access.

And if you call me, everyone nearby will be blessed with the sound of The Carol of the Old Ones. I briefly considered the orgasm scene from When Harry Met Sally, a classic geek sound file, but I still remember what happened when we used it as the out-of-paper noise on our NeXT printer, and my boss tried to print a large document while carrying on a phone conversation with his very young daughter.

It’s easy to switch to a secondary ringtone, so I’m thinking the opening song from Hand Maid May would work nicely.

Thursday, July 8 2004

Apple’s Dashboard: sample gadget

I’m not really a programmer; I’ve been a Perl hacker since ’88, though, after discovering v1.010 and asking Larry Wall where the rest of the patches were (his reply: “wait a week for 2.0”). If I’m anything, I’m a toolsmith; I mostly write small programs to solve specific problems, and usually avoid touching large projects unless they’re horribly broken in a way that affects me, and no one else can be persuaded to fix them on my schedule.

So what does this have to do with learning Japanese? Everything. I’m in the early stages of a self-study course (the well-regarded Rosetta Stone software; “ask me how to defeat their must-insert-CD-to-run copy-protection”), and authorities agree that you must learn to read using the two phonetic alphabets, Hiragana (ひらがな, used for native Japanese words) and Katakana (カタカナ, used for foreign words). A course that’s taught using Rōmaji (phonetic transcriptions using roman characters) gives you habits that will have no value in real life; Rōmaji is not used for much in Japan.

So how do you learn two complete sets of 46 symbols plus their variations and combinations, as well as their correct pronunciations? Flashcards!

The best software I’ve found for this is a Classic-only Mac application called Kana Lab (link goes direct to download), which has a lot of options for introducing the character sets, and includes recordings of a native speaker pronouncing each one. I’ve also stumbled across a number of Java and JavaScript kana flashcards, but the only one that stood out was LanguageBug, which works on Java cellphones (including my new Motorola v600).

When the misconceptions about Apple’s upcoming Dashboard feature in OS X 10.4 were cleared up (sorry, Konfabulator, it will kill your product not by being a clone, but simply by being better), I acquired a copy of the beta (why, yes, I am a paid-up member of the Apple Developer Connection) and took a look, with the goal of building a functional, flexible flashcard gadget.

Unfortunately, I’ve spent the past few years stubbornly refusing to learn JavaScript and how it’s used to manipulate HTML using the DOM, so I had to go through a little remedial course. I stopped at a Barnes & Noble on Sunday afternoon and picked up the O’Reilly JavaScript Pocket Reference and started hacking out a DHTML flashcard set, using Safari 1.2 under Panther as the platform.

Note: TextEdit and Safari do not a great DHTML IDE make. It worked, but it wasn’t fast or pretty, especially for someone who was new to JavaScript and still making stupid coding errors.

I got it working Tuesday morning, finished off the configuration form Wednesday afternoon, and squashed a few annoying bugs Wednesday night. Somewhere in there I went to work. If you’re running Safari, you can try it out here; I’ve made no attempt to cater to non-W3C DOM models, so it won’t work in Explorer or Mozilla.

There’s a lot more it could do, but right now you can select which character sets to compare, which subsets of them to include in the quiz, and you can make your guesses either by clicking with the mouse or pressing the 1-4 keys on the keyboard. I’ve deliberately kept the visual design simple, not just because I’m not a graphic designer, but also to show how Apple’s use of DHTML as the basis for gadgets makes it possible for any experienced web designer to come in and supply the chrome.

So what does it take to turn my little DHTML web page into a Dashboard gadget?

(Continued on Page 2024)

Monday, July 12 2004

Why I just deleted Konfabulator

It lasted about fifteen minutes on my laptop. Why? First, because the supplied widgets were primarily designed to be pretty. The weather and calendar widgets are translucent; you can’t make them not be translucent, even if you have wallpaper on your screen that makes them unreadable. The (thankfully not translucent) to-do list doesn’t allow you to edit in-place; anything you want to do with a to-do item involves popping up a bog-standard Mac dialog box and clicking “Okay”, which pretty much renders it useless as a “quick! write that down!” tool or organizing tool. Most of the other standard widgets are similarly long on chrome and short on function, to the point that I have trouble remembering them mere minutes after trying them out.

I was already underwhelmed by the contents of their user-submitted widget gallery, so I’m left with no possible reason to purchase this product, nor can I imagine it ever becoming a significant commercial success. This renders the whole “Apple stole our idea” and “Dashboard was designed to be a Konfabulator killer” claims completely moot. Konfabulator in its current form could never have made its way onto the desktops of a significant percentage of Mac users; it’s just not that interesting.

Will there be a lot of high-chrome, low-content Dashboard gadgets? Sure; as the man said, 90% of everything is crap. The difference is that you don’t need to learn a proprietary development environment to create gadgets for Dashboard. Hell, you don’t even need to learn JavaScript; Dashboard will cheerfully run Flash applications with a trivial DHTML wrapper. You can also embed Java applications, QuickTime videos, etc.

Konfabulator can’t do any of that.

If, for instance, I wanted to build a nice kana/kanji chart around this remarkable collection of QuickTime videos that demonstrate the correct stroke order for the entire hiragana and katakana syllabaries as well as all 1,945 Jōyō kanji, I could (and likely will, if only for my personal use), because a Dashboard gadget is just a web page, and web pages can have embedded QuickTime videos.

The closest thing they’ve got over in Konfab-land is the new Kanji-A-Day widget, which uses /usr/bin/curl to scrape a Japanese web site and import its content into a (cough) pretty window. Maybe that’s the one that will justify the $25 they want for the product…

Sunday, November 14 2004

Still waiting for Java

Gamer friend Scott just discovered that the reason he was having so much trouble with PCGen under Linux was that the JVM was defaulting to a rather small heap size, effectively thrashing the app into oblivion when he tried to print.

Now, while it’s true that PCGen is as piggy as a perl script when it comes to building complex data structures in memory, it’s still fundamentally a straightforward application, and yet it exceeds the default maximum heap settings. He had plenty of free RAM, gigs of free VM, and here was Sun’s Java, refusing to use any of it unless he relaunched the application with a command-line override. Doing so not only fixed printing, it made the entire application run substantially faster. Feh.

I’d noticed a slowdown with recent versions of PCGen on my Mac as well, but Apple was good enough to compile their JVM with defaults sufficient to at least make it run completely. Sure enough, though, increasing the default heap settings makes it run faster, by eliminating a whole bunch of garbage collection.

In other words, with Java, Sun has managed to replicate the Classic MacOS annoyance of adjusting memory allocation on a per-application basis, and made it cross-platform!

PCGen is still the only major Java app I have any use for on a regular basis, although there’s another one that has recently entered my arsenal of special-purpose tools, Multivalent. I have no use for 99% of its functionality, but it includes robust tools for splitting, merging, imposing, validating, compressing, and uncompressing PDF files, as well as stripping the copy/print/etc limitations from any PDF you can open and read.

There’s another Java application out there that might join the list sometime soon, Dundjinni, but first the manufacturers have to finish porting it from Windows to the Mac…

Wednesday, April 6 2005

fun with Google Maps

Looks like they ripped out my old apartment building in Columbus and replaced it with something bigger and better. Good thing, too, since it burned down at least once, while I was living there (hmm, now there’s an old Usenet post I should resurrect here; I used to use it as a great counter-example to the “ban guns because they make domestic squabbles fatal” argument).

The concrete canyon Brian and I lived in before that is still there, though, and probably unchanged. Trigger-happy towing, unsafe parking, and next door to a neighborhood pool; a bunch of kids once broke into my car just to steal the change from my ashtray so they could get in. Cute girls running around, though, and our storage closet was big enough to hide a dozen illegal immigrants in. Two dozen if they were close friends.

America’s Largest Community Of Brick Homes hasn’t changed a bit. Nearly 50,000 houses based on four floorplans, so you always knew where the bathrooms were at your friend’s houses. Not the easiest neighborhood to deliver pizza in, especially in Dominos’ 30-minutes-or-free days, but the tips were always good.

As for the first home I remember, Old Powell Road is almost unrecognizable. They got rid of the sharp curves that used to send cars into the abandoned gravel pit (that, along with date-rape attempts, was the most common reason someone would knock on our front door after dark), the formerly-toxic landfill appears to be capped and made pretty, but it’s still sparsely developed. The house is long-gone, but I knew that already.

These days home looks like this:

Home sweet home

Friday, July 8 2005

Photoshop tips

Apropos of nothing, I thought I’d mention that the two most recently posted pictures here were resized in Photoshop CS, using the new(-ish) Bicubic Sharper resampling method, available in the Image Size dialogue box. I hadn’t seen any mention of it until about two weeks ago, and had been using Mac OS X’s command-line tool sips for quick resizing.

Bicubic Sharper is much better than the standard Photoshop resizing, sips, or iPhoto. It’s particularly good for rendered images with fine detail. I’ve been working on a Roborally tile set for Dundjinni, creating my basic floor texture with Alien Skin Eye Candy 5: Textures. Dundjinni expects 200x200 tiles, but Eye Candy renders best at larger sizes. Resizing down from 800x800 using the straight Bicubic method produced an unusable image. Bicubic Sharper? Dramatically better.

I found the tip in a discussion of photo-processing workflow, which makes sense. For a long time, photographers have been making Unsharp Mask the final step in their workflows, because if they sharpened at full size, the slight softness introduced by resizing for print or web use would force them to use Unsharp Mask again, which tends to look pretty nasty. Integrating it into the resizing algorithm takes advantage of the data you’re discarding, reducing the chance of introducing distracting artifacts.

Saturday, August 6 2005

Sake cheat card

After trying out a few types of sake and doing a little reading on the subject, I decided to gather up all of the useful information commonly printed on labels and menus, and arrange it on a double-sided 3x5 card. It was as much an excuse to play with the new version of Adobe Illustrator as anything else, but it should come in handy the next time I try to figure out what to buy at Mitsuwa.

Tuesday, October 4 2005

Audio cleanup?

While my Japanese class is going well so far (the pace is a bit slow, due in part to the overhead of community-college drop/add handling), I’ve found one serious annoyance: the audio CDs are crap.

There’s nothing wrong with the content; the material is presented clearly by native speakers, and the original mastering was well-done. Unfortunately, it was mastered for cassette tape, and the CDs were apparently converted from that format. How well was this done? Here’s a thousand words on the subject:

Situational Functional Japanese Audio CDs

That’s what it looked like when I loaded a track into Audacity. I can crank up the gain, but then the hiss becomes objectionable, and Audacity’s noise filter introduces some rather obnoxious artifacts, even at its gentlest setting. I’ll be using these CDs until March, so it’s worth a little time and money to me to get them cleaned up. Any recommendations for a good tool?

Friday, October 21 2005

Dodge Caravan

I got sent to Denver (okay, Longmont) for a few days to do some setup work for our office here, and the folks at Budget begged me to take a free upgrade to a minivan, to help alleviate their shortage of smaller vehicles.

Anyway, it’s got a gutless engine, poor sound insulation, and a whopping big blind spot when you’re merging, but otherwise it’s actually a pretty nice travel-mobile. Very comfortable to drive, plenty of room for adult passengers, and decent handling for its size. It’s no comparison to my Lexus RX-300, but still, a lot better than I expected.

Sunday, March 26 2006

Short Review: Nisus Writer Express

If your (Mac-only) word-processing needs fit within Writer Express’s feature list, the generally sensible UI will make it a superior alternative to Word. Within its limitations, it’s an excellent, useable program.

However, if you need table support that’s better than an ancient version of Netscape, real Word interoperability, or precision layout tools, look elsewhere. For now, at least; they’re working hard to improve the product.

Note to people with fond memories of the Mac OS Classic Nisus Writer: Express implements a subset of the old features, along with a bunch of new ones.

Customizing for Usability, Bad Haiku Edition

I’m doing 45 minutes of cardio (most) every day on my LifeFitness 5500 elliptical cross-trainer. Doctor’s orders. I like working out on this machine, and it’s certainly good for me, but I’ve always had a problem occupying my mind. In the past, I’ve simply listened to music on my iPod, generally a PopTarts mix (or, more recently, JPopTarts). Studying kanji and vocabulary for my Japanese class would be an ideal use of this time, but I never ordered the optional magazine stand, and it doesn’t look like they make it any more.

So, I stopped at an office supply store and bought the only non-ridiculous copy-holder they sold. Just setting it on top of the crosstrainer worked fairly well, but hid the display. I really needed it to sit above the display section, but there was no obvious way to accomplish this feat. And then, a moment of clarity:

How to attach this…
What mounting system will work?
Ah! Some gaffer tape!

Saturday, April 8 2006

“What do you do with a B6 notebook?”

(note: for some reason, my brain keeps trying to replace the last two words in the subject with “drunken sailor”; can’t imagine why)

Kyokuto makes some very nice notebooks. Sturdy covers in leather or plastic, convenient size, and nicely formatted refill pages. I found them at MaiDo Stationery, but Kinokuniya carries some of them as well. I like the B6 size best for portability; B5 is more of an office/classroom size, and A5 just seems to be both too big and too small. B6 is also the size that Kodansha publishes all their Japanese reference books in, including my kanji dictionary, which is a nice bonus.

[This is, by the way, the Japanese B6 size rather than the rarely-used ISO B-series. When Japan adopted the ISO paper standard, the B-series looked just a wee bit too small, so they redefined it to have 50% larger area than the corresponding A-series size. Wikipedia has the gory details.]

I really like the layout of Kyokuto’s refill paper. So much so, in fact, that I used PDF::API2::Lite to clone it. See? The script is a little rough at the moment, mostly because it also does 5mm grid paper, 20x20 tategaki report paper, and B8/3 flashcards, and I’m currently adding kanji practice grids with the characters printed in gray in my Kyoukasho-tai font. I’ll post it later after it’s cleaned up.

Why, yes, I was stuck in the office today watching a server upgrade run. However did you guess?

On a related note, am I the only person in the world who thinks that it’s silly to spend $25+ on one of those gaudy throwaway “journals” that are pretty much the only thing you can find in book and stationery stores these days? Leather/wood/fancy cover, magnet/strap/sticks to hold it shut, handmade/decorated (possibly even scented) papers, etc, etc. No doubt the folks who buy these things also carry a fountain pen with which to engrave their profound thoughts upon the page.

Or just to help them impress other posers.

Friday, May 19 2006

Automating PDF cleanup with Acrobat and AppleScript

As I mentioned earlier, I’m generating lots of PDF files that don’t work in Preview.app, and are also a tad on the large side. Resolving this problem requires the use of Adobe Acrobat and Acrobat Distiller. Automating this solution requires AppleScript. AppleScript is evil.

Just in case anyone else wants to do something like this from the command line, here’s what I ended up with, which is run as “osascript pdfcleaner.scpt myfile.pdf”:

on run argv
	set input to POSIX file ((system attribute "PWD") & "/" & (item 1 of argv))
	set output to replace_chars(input as string, ".pdf", ".ps")
	
	tell application "Adobe Acrobat 7.0 Standard"
		activate
		open alias input
		save the first document to file output using PostScript Conversion
		close all docs saving no
	end tell
	
	tell application "Acrobat Distiller 7.0"
		Distill sourcePath POSIX path of output
	end tell
	
	set nullCh to ASCII character 0
	set nullFourCharCode to nullCh & nullCh & nullCh & nullCh
	tell application "Finder"
		set file type of input to nullFourCharCode
		set creator type of input to nullFourCharCode
	end tell
	
	tell application "Terminal"
		activate
	end tell
end run
	
on replace_chars(this_text, search_string, replacement_string)
	set AppleScript's text item delimiters to the search_string
	set the item_list to every text item of this_text
	set AppleScript's text item delimiters to the replacement_string
	set this_text to the item_list as string
	set AppleScript's text item delimiters to ""
	return this_text
end replace_chars

[I wiped out the file type and creator code to make sure that the resulting PDFs opened by default with Preview.app, not Acrobat; I swiped that code from Daring Fireball. The string-replace function came from Apple’s AppleScript sample site.]

Thursday, June 1 2006

TextWrangler

I want a better text editor. What I really, really want, I think, is Gnu-Emacs circa 1990, with Unicode support and a fairly basic Cocoa UI. What I’ve got now is the heavily-crufted modern Gnu-Emacs supplied with Mac OS X, running in Terminal.app, and TextEdit.app when I need to type kanji into a plain-text file.

So I’ve been trying out TextWrangler recently, whose virtues include being free and supporting a reasonable subset of Emacs key-bindings. Unfortunately, the default configuration is J-hostile, and a number of settings can’t be changed for the current document, only for future opens, and its many configuration options are “less than logically sorted”.

What don’t I like?

First, the “Documents Drawer” is a really stupid idea, and turning it off involves several checkboxes in different places. What’s it like? Tabbed browsing with invisible tabs; it’s possible to have half a dozen documents open in the same window, with no visual indication that closing that window will close them all, and the default “close” command does in fact close the window rather than a single document within it.

Next, I find the concept of a text editor that needs a “show invisibles” option nearly as repulsive as a “show invisibles” option that doesn’t actually show all of the invisible characters. Specifically, if you select the default Unicode encoding, a BOM character is silently inserted at the beginning of your file. “Show invisibles” won’t tell you; I had to use /usr/bin/od to figure out why my furiganizer was suddenly off by one character.

Configuring it to use the same flavor of Unicode as TextEdit and other standard Mac apps is easy once you find it in the preferences, but fixing damaged text files is a bit more work. TextWrangler won’t show you this invisible BOM character, and /usr/bin/file doesn’t differentiate between Unicode flavors. I’m glad I caught it early, before I had dozens of allegedly-text files with embedded 文字化け. The fix is to do a “save as…”, click the Options button in the dialog box, and select the correct encoding.

Basically, over the course of several days, I discovered that a substantial percentage of the default configuration settings either violated the principle of least surprise or just annoyed the living fuck out of me. I think I’ve got it into a “mostly harmless” state now, but the price was my goodwill; where I used to be lukewarm about the possibility of buying their higher-end editor, BBEdit, now I’m quite cool: what other unpleasant surprises have they got up their sleeves?

By contrast, I’m quite fond of their newest product, Yojimbo, a mostly-free-form information-hoarding utility. It was well worth the price, even with its current quirks and limitations.

Speaking of quirks, my TextWrangler explorations yielded a fun one. One of its many features, shared with BBEdit, is a flexible syntax-coloring scheme for programming languages. Many languages are supported by external modules, but Perl is built in, and their support for it is quite mature.

Unfortunately for anyone writing an external parser, Perl’s syntax evolved over time, and was subjected to some peculiar influences. I admit to doing my part in this, as one of the first people to realize that the arguments to the grep() function were passed by reference, and that this was really cool and deserved to be blessed. I think I was also the first to try modifying $a and $b in a sort function, which was stupid, but made sense at the time. By far the worst, however, from the point of view of clarity, was Perl poetry. All those pesky quotes around string literals were distracting, you see, so they were made optional.

This is still the case, and while religious use of use strict; will protect you from most of them, there are places where unquoted string literals are completely unambiguous, and darn convenient as well. Specifically, when an unquoted string literal appears in list context followed by the syntactic sugar “=>” [ex: (foo => “bar”)], and when it appears in scalar context surrounded by braces [ex: $x{foo}].

TextWrangler and BBEdit are blissfully unaware of these “bareword” string literals, and make no attempt to syntax-color them. I think that’s a reasonable behavior, whether deliberate or accidental, but it has one unpleasant side-effect: interpreting barewords as operators.

Here’s the stripped-down example I sent them, hand-colored to match TextWrangler’s incorrect parsing:

#!/usr/bin/perl

use strict;

my %foo;
$foo{a} = 1;
$foo{x} = 0;

my %bar = (y=>1,z=>1,x=>1);

$foo{y} = f1() + f2() + f3();

sub f1 {return 0}
sub f2 {return 1}

sub f3 {return 2}

Sunday, November 12 2006

Pygments

This seems like a nice tool for syntax-coloring code. I rarely feel the need for this feature myself, but it’s nice when it works, and this one works a lot better than BBedit’s, although it shares a less-extreme version of the coloring bug I found when I was testing TextWrangler.

I don’t have nice things to say about the download/install process and documentation, though; it looks like the Python community is trying to come up with something similar to CPAN, but it doesn’t seem to be ready for general release yet.

Tuesday, November 21 2006

Truth in advertising

Spotted this at Border’s today. I like products that match their descriptions…

Lighted Magnifier

The name is effective, though. When I pointed it out to Jeff so he could laugh at it too, the woman in line behind him asked to see it, and ended up buying one.

It’s probably nice, but I think the Zelco Lumifier is better for carrying around. It’s my furigana tool.

Friday, December 22 2006

The Guardian of my World

A while back, I mentioned that I was tinkering with jQuery for updating my pop-up furigana. This dovetails nicely with my attempts to improve my Japanese reading skills, which currently involve working my way through Breaking into Japanese Literature and ボクのセカイをまもるヒト.

The first one is a parallel text with all vocabulary translated on the same page. I wish he’d formatted it a bit differently, and my teacher isn’t pleased with some of the translation, but it’s a useful learning tool, and there’s a free companion audiobook on the web site.

The second is the first in a new light novel series from Nagaru Tanigawa, also responsible for The Melancholy of Haruhi Suzumiya, and it includes furigana for almost all of the kanji. My goal is to read it, not translate, but I have to look up an awful lot of vocabulary, and there’s not enough room on the page to annotate.

So I’m typing it in, and using a Perl script to add my shiny new pop-up furigana.

(and, yes, I’m deliberately over-annotating; I don’t actually need many of those annotations, but someone else might, and it’s not that much work)

[Update: I should mention that I’m using Jim Breen’s translation server to speed up the glossing process. The parser gets lost occasionally, but it’s still very helpful, often finding idiomatic phrases that cover several words.]

Oh, here’s the cover, courtesy of Amazon:

(Continued on Page 2658)

Monday, January 22 2007

Starting anew…

About six months ago, The Former Employer With Whom I Signed A Non-Disparagement Agreement decided to close their field offices and consolidate everything at the main office in Kirkland. Some folks were asked to relocate, some were laid off immediately, and a Lucky Few were asked to stay around for a while to manage the transition.

I fell into the third group, with the promise of a reasonable quantity of extra cash should I complete my tasks to their satisfaction. This cash was in fact received on schedule, so I have no immediate plans to test their tolerance for disparagement.

We said our goodbyes at the end of 2006, and I spent the first week of 2007 in Las Vegas, courtesy of a “three-free-nights” offer at the Luxor. While I was out there, Ooma, the company many former co-workers had already fled to, called me up to arrange interviews. I went in on the 10th, went back to meet the CEO on the 15th, accepted their offer on the 16th, flew home to Ohio to quickly see my family on the 19th, and started work today.

What do we do at Ooma? Can’t tell you. Ask again in (can’t tell you).

Thursday, May 3 2007

Best $25 we’ve spent recently

This is a remarkably useful gadget that’s paid for itself several times in the past month. What it does: connect an IDE or SATA drive via USB2 without putting it in an enclosure. It’s faster to work with the bare drive when you just need to grab some data from a failed machine or scrub a disk before reuse or service.

Monday, December 10 2007

Ooma update

Now available from Amazon.

Wednesday, December 12 2007

Don’t fear the Washlet

(all vacation entries)

…just be sure to check its aim.

Toto Washlet with expert mode

Tuesday, December 18 2007

Apple Aperture: sluggish but useful

[Update: Grrr. Aperture won’t let you updateor create GPS EXIF tags, and the only tool that currently works around the problem only supports interactively tagging images one at a time in Google Earth. Worse, not only do you have to update the Sqlite database directly, you have to update the XML files that are used if the database ever has to be rebuilt.]

I’ve played with Aperture in the past, but been put off by the terrible performance and frequent crashes. Coming back from Japan, though, I decided to give the latest version a good workout, and loaded it up with more than a thousand image files (which represented about 850 distinct photos, thanks to the RAW+JPEG mode on my DSLR).

On a MacBook with a 2GHz Core Duo and 2GB of RAM, there’s a definite wait-just-a-moment quality to every action I take, but it’s not long enough to be annoying, except when it causes me to overshoot on the straighten command. The fans quickly crank up to full speed as it builds up a backlog of adjustments to finalize, but background tasks don’t have any noticeable impact on the GUI response.

My biggest annoyance is the lack of a proper Curves tool. I’m used to handling exposure adjustments the Photoshop way, and having to split my attention between Levels, Exposure, Brightness, Contrast, and Highlights & Shadows is a learning experience. I think I’ve managed so far, and my Pantone Huey calibrates the screen well enough to make things look good.

I have three significant wishes: finer-grain control over what metadata is included in an export, real boolean searches, and the ability to batch-import metadata from an external source. Specifically, I want to run my geotagger across the original JPEG images, then extract those tags and add them to the managed copies that are already in Aperture’s database. Aperture is scriptable, so I can do it, but I hate writing AppleScripts. I could have geotagged them first, but for some reason MacOS X 10.4.11 lost the ability to mount my Sony GPS-CS1 as a flash drive, and I didn’t have a Windows machine handy to grab the logs. [Sony didn’t quite meet the USB mass-storage spec with this device; when it was released, it wouldn’t work on PowerPC-based Macs at all, and even now it won’t mount on an Asus EEE]

For the simple case of negating a keyword in a search, there’s a technique that mostly works: the IPTC Keywords field is constantly updated to contain a comma-separated list of the keywords you’ve set, and it has a “does not contain” search option. This works as long as none of your keywords is a substring of any other.

I’ll probably just write a metadata-scrubber in Perl. That will let me do things that application support will never do, like optionally fuzz the timestamps and GPS coordinates if I think precise data is too personal. The default will simply be to sanitize the keyword list; I don’t mind revealing that a picture is tagged “Japan, Hakone, Pirate Ship”, but the “hot malaysian babes” tag is personal.

Thursday, January 10 2008

Dear Nolobe,

[Update: just received an apology for the mistake, an updated license key, and a partial refund to bring my price down to the current $39 promotion.]

[Update: I can’t currently recommend this application, for the simple reason that I made the mistake of buying it four days before the release of 9.0, and they charge $29 for the upgrade. Until March, it’s only $39 for a brand-new license, but if I want 9.0, my total cost ends up being $88, which is more than the app is worth. Worse, the updater offered me the new version without mentioning the fact that it would revert to a trial license and require new payment. Fortunately, I was able to revert to 8.5.4.]

Your file-transfer app, Interarchy, is very nice. I particularly appreciate its solid support for Amazon S3. In the latest version, the thing I like most is the fact that permissions settings for uploads are now an honest-to-gosh preference, rather than being buried in some pulldown menu.

I question your decision to make the new version look like the unholy love-child of Finder and Safari, however, especially since your Bookmarks Bar and Side Bar are only cosmetically related to their inspiration, and share none of their GUI behaviors. It looks like a duck, and it sort of quacks like a duck, but it’s really just a cartoon duck, and not worth eating.

And I haven’t the slightest idea why you thought it would be a good idea to have the first item on the Bookmarks Bar be a menu containing every URL in the user’s personal Address Book. Considering that the user can’t rearrange or remove items on the Bookmarks Bar, you’re wasting an awful lot of valuable real estate on a very marginal feature.

Sunday, January 13 2008

Two-car garage, Kyoto-style

(all vacation entries)
private parking in Kyoto

Wednesday, January 30 2008

Dear Sony,

[Update: Thanks, guys; the check is in the mail. More new-camera-porn here.]

Now that you’re releasing a 24+ megapixel full-frame 35mm CMOS sensor, don’t you feel a little stupid for making some of your high-end Zeiss lenses for the Alpha line APS-C-only? I doubt you’ve actually sold many of them, given the price and scarce distribution, but still, you had to know that full-frame was a requirement for a serious player in the DSLR market, and your recent announcements show that you’re not just keeping the low end of the old Minolta lineup.

Just to be clear on this: if you put that sensor into a body that’s the equivalent of Minolta’s 7 or 9 series (pleasepleaseplease a 9!), you’ve got a customer here already waiting in line.

Wednesday, April 16 2008

Dear Google,

I like Google Earth. I even pay for the faster performance and enhanced features. A few things, though:

  • Why can’t I keep North at the top of the screen? I hate constantly double-clicking the “N” in the gaudy navigation scroll-wheel.
  • Why do you auto-enable new layers in my view, so that, for instance, I suddenly see every golf course on the planet, even though I had that entire category disabled?
  • Why can’t I switch between different sets of enabled layers?
  • Why is the “Google Earth Community” layer such a dumping ground of unsorted crap? For instance, what value does this have to anyone who’s not an airline pilot? Or this, where points scattered around the globe are all labeled, “here’s my collection of 4,728 placemarks”.

I’m sure I can come up with more if I think about it for a bit…

[update: ah, press ‘n’ for north, ‘r’ for a total view reset, and then figure out how to fix all of the KMZ files that were broken by the upgrade]

Monday, May 19 2008

Importing furigana into Word

Aozora Bunko is, more or less, the Japanese version of Project Gutenberg. As I’ve mentioned before, they have a simple markup convention to handle phonetic guides and textual notes. The notes can get a bit complicated, referring to obsolete kanji and special formatting, but the phonetic part is simple to parse.

I can easily convert it to my pop-up furigana for online use (which I think is more useful than the real thing at screen resolution), but for my reading class, it would be nice to make real furigana to print out. A while back I started tinkering with using Word’s RTF import for this, but gave up because it was a pain in the ass. Among other problems, the RTF parser is very fragile, and syntax errors can send it off into oblivion.

Tonight, while I was working on something else, I remembered that Word has an allegedly reasonable HTML parser, and IE was the first browser to support the HTML tags for furigana. So I stripped the RTF code out of my script, generated simple HTML, and sent it to Word. Success! Also a spinning beach-ball for a really long time, but only for the first document; once Word loaded whatever cruft it needed, that session would convert subsequent HTML documents quickly. It even obeys simple CSS, so I could set the main font size and line spacing, as well as the furigana size.

Two short Perl scripts: shiftjis2utf8 and aozora-ruby.

[Note that Aozora Bunko actually supplies XHTML versions of their texts with properly-tagged furigana, but they also do some other things to the text that I don’t want to try to import into Word, like replacing references to obsolete kanji with PNG files.]

Sunday, June 15 2008

Ooma goes retail!

We’ve been taking it slow, but we’ve finally got a retail trial running. If you’re in the Los Angeles area, you can finally see our product before buying one, at Best Buy.

“Now throw the switch and let us begin the battle for the planet.”
— The Brain