Just goes to show you how hairy sendmail is — a single misplaced open-bracket, and suddenly your site switches into Craig-Shergold mode…
— Daniel F. BoydI 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}
It doesn’t appear that the Mai-HiME manga has been licensed for the US market yet, despite the expected popularity of the anime. Pity, really, because I’m curious how the usual hack translators would deal with the last page of the first volume. A Strange Cute Girl (one of many) has just entered Our Hero’s dorm room, stripped off her panties, and pushed him to the ground. The volume ends with a full-page panel of her straddling him, speaking the line:
私の鍵穴も開けて下さい。
Our Hero seems more shocked than excited by this statement, but it’s understandable, since he’s still discovering just how peculiar his new school (and its girls) are. Unfortunately for him, I’ve seen enough spoilers from the (very different…) anime to know that neither shock nor excitement is the right response to a bold invitation from this girl. “Fleeing in terror with his manhood protected by a sturdy shield” just about covers it.
My other response to this scene was “hey, I just read that, and only had to stop and think about one of the kanji” (鍵, which I haven’t gotten to in my writing practice yet; I know the word, and they provided furigana that made it clear). Okay, the others are extremely common, basic kanji, but the point is that I was reading rather than deciphering.
I had an epiphany this weekend at KublaCon, sometime before we ran Rory’s usual monstrous Dwarven Forge MasterMaze D&D adventure (this time with added “live” roleplaying).
I do not like cons.
I do not like gamers.
I particularly do not like loud, clueless, obnoxious, asocial, grotesquely obese, unbathed gamers whose greatest ambition in life seems to be saving money on a hotel room by sleeping on a chair in the hallway. Cons are full of people combining at least two of the above characteristics, frequently more.
In truth, I don’t much like people in general. I’d like to use the term “energy vampires”, but it looks like the woo-woo pop psychology cranks have already sucked it dry of meaning. Besides, they seem to think that only some small minority of the population consists of soul-draining monsters, whereas for me, there are very few people who do not eventually wear down my thin veneer of sociability to reveal the cranky bastard within. And I can only recharge when I’m alone.
[our event went surprisingly well, by the way]
[and a lot of cute JAL stewardesses stay in that hotel…]
Jeff learned an important lesson about technology today.
Today I did my part to keep the Cha-Cha Maru afloat. No, I didn’t send Robert a box of Chachamaru cookies, or a case of Chachamaru for kitchen. I just ordered a few more anime DVDs to add to The Great Unwatched Pile on my coffee table, which I hope to make at least a small dent in soon.
I think I’m way overdue for twin posts on music and manga, especially since I just finished region-converting my dozenth Hello!Project DVD. The latest one is the concert video Folk Songs 3, which not only has the usual cute jpop idol girls, but an older male vocalist whose work I’ve acquired an interest in recently, Gen Takayama.
And I’m still trying to relocate the reference in one of my books to the original Cha Cha Maru. I’m sure the ship in Plastic Little played some part in the naming of the robot girl in Negima, but the name 茶々丸 goes back at least to the Ashikaga period. Tea cookies, kitchen cleansers, pet hunter ships, and robot girls are an odd group to be tied together by a name, and I just want to know how it got started.
[ah, there he is! I knew I’d run across a Chachamaru in the Ashikaga period. Turns out he was even in the Ashikaga family, and a rather ruthless fellow. I doubt there’s anyone named after him.]
[…and another Chachamaru reference in anime: apparently it’s the name of a bar in Maison Ikkoku]
Every once in a while, I suddenly remember that I’m studying Japanese, and that I have the resources to figure out what things really mean, not just what other people claim they mean. Usually, this involves song lyrics or anime dialog, but today I was reminded of the trendy photographic term bokeh, and decided to sort it out.
Googling the term will turn up dozens of sites that carefully explain that bokeh refers to the quality with which a photographic lens renders the out-of-focus area of images, with a mix of technical jargon and artistic handwaving, and tell you that “boke” is the Japanese word for blur.
There are objective, measurable differences in how lenses render blurred areas of the picture. Minolta even made a monster of a portrait lens specifically designed to produce glorious blur (I tried it out side-by-side with a conventional lens here). Once artists get hold of a word, though, there’s no telling what it might mean, and I’ve seen a number of pretentious explanations of the true meaning of bokeh.
So you’ll understand my amusement when I looked it up and discovered that boke actually means “out of touch with reality”. Less politely, “idiot” or “senile fool”.
The actual Japanese photographic term is ピンぼけ (for the kana-impaired, “pinboke”). It’s a compound word; pin from the Dutch brandpunt = “focus”, and boke from the verb 暈ける (“bokeru”) = “to fade”.
[update! a comment on the Wikipedia page led me to an alternate choice: ぼけ味 (“bokeaji”), which is a combination of ピンぼけ and 味 (“aji”), meaning “flavor”. Supporting evidence for that can be found on Japanese camera sites like this and this (second one mildly NSFW).]
Oh, and the real “Japanese word for blur”? 不鮮明 (“fusenmei”). A related word that might come in handy occasionally is ぶれ (“bure”), meaning “camera shake”.
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.]
Lots of people upload videos to Youtube. Lots of people upload music videos to Youtube. Lots of people upload music videos from the 80s to Youtube. This guy cataloged a whole bunch of them. And for every one he’s got listed, there’s a half-dozen more linked to them. Days could pass before I escape this trap.