Tools

Hacking Illustrator with JavaScript


You can do some entertaining and evil things to an Illustrator document with Scriptographer. For instance, I implemented a static version of the XScreenSaver module Interaggregate in about 80 lines of code, which by itself isn’t terribly practical, but being able to generate hundreds of randomly-sized circles each with their own vectors and calculate their intersections over time does suggest some interesting art-hackery.

Useful iOS app: Systematic


I wanted something simple: an app that allowed me to enter a list of tasks and how frequently I want to do them (daily, twice a week, etc), and sort the ones I’ve been neglecting to the top. It should show me when I last did them, and have a calendar view showing my historical performance. And it doesn’t really need to do anything else. Systematic doesn’t have the calendar view yet, but it does everything else, and it’s dead simple.

You have two buttons at the top of the screen: add a task, and edit the task list. Below that is your list of tasks, with the do-soon ones at the top. Tapping on any task starts a timer that tracks how much time you’ve spent on it, and you can stop, pause, restart, or adjust the time spent. Your progress and deadline show up in small print on the task button.

In the editor, you name the task, select an icon, a frequency (once, daily, weekly, monthly), a duration (from 5 minutes to 50 hours), a repeat count (1-50 times per period), and a deadline. So, I can say that I want to practice Go-San-Go three times a week for ten minutes per session, with my success evaluated on Sundays.

And that’s it. Until the author adds the calendar view, you can only see your previous session for each task, but it uses Core Data for storage, which means everything is stored in a simple SQLite schema, and the DB itself is available from the File Sharing pane in iTunes, so it’s trivial to extract the data yourself.

$2.99, designed for iPhone-sized screen; I suspect it just looks huge on an iPad right now.

Things you can do more easily in Word than in InDesign...


[Update: “…without spending an extra $180 on a third-party tool that unlocks hidden, unsupported functionality”]

Layout a sentence that contains a mixture of English and Japanese.

In Word, you can say “use this font for Japanese characters only”, automatically leaving the rest of the sentence in a more-appropriate font. If you want to do this in InDesign, you must assign a character class to each string of Japanese text, or else layout the whole sentence in the same Japanese-capable font.

And that character class will not be applied if the sentence is used in a running header. Which means that you cannot use character-class-based styling in text that will be used as a header.

The workaround, which doesn’t work, is to use position-based nested styles in the header.

The workaround for the workaround, which doesn’t work, is to use regular-expression-based styling in the header. You can do something half-assed with regexps in a normal paragraph style, but the exact same regexp that works in the body text doesn’t work in a header style; the regexps are apparently applied before the variable substitution (which, come to think of it, is likely the problem with nested styles as well).

You can probably do Word-style font-mixing in the Japanese version of InDesign, along with vertical text, furigana, and all of the other things Word gives you in all versions, but I can’t buy that in the US. And, frankly, it’s far too expensive to ever consider trying to import a copy just to get potentially prettier printouts than Word.

[Update: it is claimed in a number of places that all of the Japanese functionality is present in the US version of InDesign, but that none of it is exposed in the UI. So, if someone sent you a document made in the Japanese version, you could print it, but not edit it. This suggests that it would be possible to export such a document to either the Tagged Text or XML formats and do some scripting work.]

Okay, I think I'm set for a while


All these years, I didn’t know they sold it in <a href=”this size:

Simichrome polish 8.82oz can

[Update: and for the serious user, 1000 gram can.]

Odd layout limitation in Word: columns


Microsoft Word has very good standards-based HTML import. It’s much more capable than OpenOffice, and advanced layout can be set with custom CSS. It’s robust enough that the majority of Word features will survive a round-trip through the HTML exporter. Your brain may explode if you try to edit the exported HTML, which IMHO is only useful for figuring out how to use their custom CSS; for sanity and source-control, write in HTML, layout with Word, print to PDF.

[and only use LaTeX if you need to do tricky things like post-process DVI and AUX files to generate cross-referenced vocabulary lists and delete content without repaginating…]

[Update: an odd limit to the importer is handling indentation of nested lists. At a certain point, it reverts to left-indented]

more...

I can haz Gatsby?


The product is actually quite useful, and I wish I’d brought back a few more packs from Kyoto, since none of the Japanese stores around here seems to carry it.

It’s basically a mentholated wet-nap, good for cooling down after a workout, sold by a company that markets primarily to pretty-boys. And, yes, there are worse versions of the ad.

Goofy Mecab error


When I ran the third Louie book through my custom-reader scripts (being nearly halfway through book 2…), it warned me about a conjugation pattern it didn’t know how to handle. This happens occasionally, since my de-conjugator is based on a limited sample of Mecab output, but the word it was complaining about was a real surprise: the yodan verb 戦ふ (written “tatakafu”, but pronounced “tatakau”), conjugated into 戦はない.

The sentence was “人の死なない戦はない”, which should be read as “Hito no shinanai ikusa wa nai”. For some reason, the context matcher did not correctly determine that “人の死なない” was a clause modifying the noun “戦”, and instead fell back all the way to a pre-1946 classical conjugation of the modern verb 戦う, which would have translated into the nonsensical “person’s won’t die won’t fight”. One of the many reasons human translators still have jobs!

(the sentence actually means “this is not a battle in which no one dies”, or perhaps “there are no wars where no one dies”; I’ll have to look at the context when I get there)

Tokyo Surfing


[Note: this is one of those “braindump so I don’t miss a step when I tell someone how to do it” posts]

Let's say that you've come across a web site that refuses to serve up its content to people located outside of a certain geographical region. For instance, "Japan" (or UK for BBC streams, etc).

There are two basic ways to go about this: pointing your web browser at an HTTP/HTTPS proxy service that's located in Japan, or opening a VPN connection to a server in Japan. I chose the second method, in part because it isn't limited to web traffic (allowing you to do things like bypass your ISP's outgoing SMTP blocking), and in part because I already knew how.

My weapons of choice were Amazon EC2, OpenVPN (free Community Edition, easy-rsa, OpenVPN GUI for Windows, and Tunnelblick for Mac), and DynDNS plus ddclient.

more...

“Need a clue, take a clue,
 got a clue, leave a clue”