Apple

Sad, really


A 1.25GHz G4 PowerBook plays World of Warcraft far better than a 2.0GHz Intel Core Duo Macbook, even with 2GB of RAM, even with the video settings set lower on the MacBook. Civ IV, on the other hand, runs fine, something that’s not true on the G4. There’s got to be a bug in the video drivers, because that just doesn’t make sense, even with shared video memory.

[and why did I buy a MacBook instead of a MacBook Pro? Partially because I already have gaming hardware at home (and, at least for now, a work-owned MacBook Pro with 2GB of RAM), partially because I wanted the slightly smaller form factor and increased battery life, partially because Sony launched the α100 with a 135mm f/1.8 Zeiss lens…]

[by the way, I replaced the stock drive with a 160GB Seagate from OWC. I never even booted off of the supplied 60GB drive; I just moved it into an external enclosure and copied everything over with SuperDuper!]

[Update: I expected the problem to be related to the variety of shapes and textures used for player-character armor and weapons, so that having more people around made the performance worse. Nope, it’s geometry. I can run through a crowd in Undercity at 15 f/s, but I can’t stare at a single complex building (such as Light’s Hope Chapel, with no players in sight) without the frame rate dropping to 4-5 f/s. The crowds of people around the bridge in Ironforge aren’t what slows the MacBook down to 2 f/s; it’s the buildings themselves. The game is perfectly playable away from architecture.]

[Update: Damn. I mean, damn. I just finished putting the latest Boot Camp beta on the MacBook, and tested WoW under Windows. The frame rate was 3-5 times higher, across the board. Exact same hardware, exact same game settings, ridiculously fast. So I turned the settings up, restarting every time to see when it would choke, and found myself riding past the bank in Ironforge at 10 f/s with every setting at maximum, on Saturday night at 9pm. I realize that a reliable OS can’t let random drivers get as chummy with the hardware as Windows does, but damn. “Dear Apple. Fix this. Love, J”.]

Did you know?


Why doesn’t anyone ever tell me these things?

First, I learn from Daring Fireball that holding down the Shift key turns your Mac mouse’s vertical scroll-wheel into a horizontal scroll wheel.

Then, just now, I accidentally hit my scroll-wheel while watching a video in QuickTime Player, and it scrubbed through the video. Remarkably useful.

Stupid Apple Tricks


YouTube stopped working a while back on my Quad G5. Videos played, but with no sound. All other forms of video worked fine, and the exact same video would work if I downloaded it manually and ran it from a different FLV player.

I reinstalled Flash, I wiped caches to make sure I didn’t have an old version of the YouTube flash player, grabbed the latest version of Firefox and tried it there, etc, etc. No change. It wasn’t a big problem, since I usually don’t surf from that machine, but I finally spent a few minutes chanting Google incantations and found the answer:

Run the Audio MIDI Setup utility and change the Audio Output Format back to 44100 Hz

The Time Machine paradox


[disclaimer: developers who didn’t attend WWDC don’t have copies of the Leopard beta yet, and when they do send me one, I won’t be able to discuss how things actually work, so this is based solely on what Apple has stated on their web site]

When I heard the initial description of Apple’s upcoming Time Machine feature, it sounded like it was similar to NetApp Filer snapshots, or possibly the Windows volume shadow copy feature that’s been announced for Vista (and is already in use in Server 2003). The answers, respectively, are “not really” and “yes and no”.

Quoting:

The first time you attach an external drive to a Mac running Mac OS X Leopard, Time Machine asks if you’d like to back up to that drive.

Right from the start, Time Machine in Mac OS X Leopard makes a complete backup of all the files on your system.

As you make changes, Time Machine only backs up what changes, all the while maintaining a comprehensive layout of your system. That way, Time Machine minimizes the space required on your backup device.

Time Machine will back up every night at midnight, unless you select a different time from this menu.

With Time Machine, you can restore your whole system from any past backups and peruse the past with ease.

The key thing that they all have in common is the creation of copy-on-write snapshots of the data on a volume, at a set schedule. The key feature of NetApp’s version that isn’t available in the other two is that the backup is transparently stored on the same media as the original data. Volume Shadow Copy and Time Machine both require a separate volume to store the full copy and subsequent snapshots, and it must be at least as large as the original (preferably much larger).

NetApp snapshots and VSC have more versatile scheduling; for instance, NetApps have the concept of hourly, daily, and weekly snapshot pools that are managed separately, and both can create snapshots on demand that are managed manually. TM only supports daily snapshots, and they haven’t shown a management interface (“yet”, of course; this is all early-beta stuff).

VSC in its current incarnation is very enterprise-oriented, and it looks like the UI for gaining access to your backups is “less than user-friendly”. I’ve never seen a GUI method of accessing NetApp snapshots, and the direct method is not something I’d like to explain to a typical Windows or Mac user. TM, by contrast, is all about the UI, and may actually succeed in getting the point across about what it does. At the very least, when the family tech-support person gets a call about restoring a deleted file, there’s a chance that he can explain it over the phone.

One thing VSC is designed to do that TM might also do is allow valid backups of databases that never close their files. Apple is providing a TM API, but that may just be for presenting the data in context, not for directly hooking into the system to ensure correct backups.

What does this mean for Mac users? Buy a backup disk that’s much larger than your boot disk, and either explicitly exclude scratch areas from being backed up, or store them on Yet Another External Drive. What does it mean for laptop users? Dunno; besides the obvious need to plug it into something to make backups, they haven’t mentioned an “on-demand” snapshot mechanism, simply the ability to change the time of day when the backup runs. Will you be able to say “whenever I plug in drive X” or “whenever I connect to the corporate network”? I hope so. What does it mean for people who have more than one volume to back up? Not a clue.

Now for the fun. Brian complained that Time Machine is missing something, namely the ability to go into the future, and retrieve copies of files you haven’t made yet. Well, the UI might not make it explicit, but you will be able to do something just as cool: create alternate timelines.

Let’s say that on day X, I created a file named Grandfather, on X+20 a file named Father, and on X+40 a file named Me. On X+55, I delete Grandfather and Father. On X+65, I find myself missing Grandfather and bring him back. On X+70, I find myself longing for a simpler time before Father, and restore my entire system to the state it was in on X+19. There is no Father, there is no Me, only Grandfather. On X+80, I find myself missing Me, and reach back to X+69 to retrieve it.

We’re now living in Grandfather’s time (X+29, effectively) with no trace of Father anywhere on the system. Just Me.

Now for the terror: what happens if you set your clock back?

English can be so confusing...


I think boingboing put the adjective in the wrong place. Let me fix it for them…

Tomorrow, seven activists in seven cities across the US will picket Apple Stores, handing out information about the dangers of the DRM hidden in Apple's iTunes.

I think my version better carries the flavor of this important event.

more...

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.]

The New MacBook: not for me


When I first looked at one, I saw some reflections from the glossy screen, but it wasn’t obnoxious. Also, while I didn’t particularly like the keyboard (anything short of a Matias Tactile Pro simply can’t be good), it wasn’t worse than my current PowerBook, just different.

Today, the local Apple Store had them set out near the windows. Afternoon sun bouncing off of the buildings across the street gave me a more realistic test of the screen’s usability, and it failed. The reflections produced by diffused store lighting were easy to ignore; the image of the street outside was not. I see a big market in add-on glare hoods.

I wouldn’t have been in the market for one for a few more months anyway, but now I’m definitely waiting to see if they deal with the problem. Right now, I’m more likely to buy a Pro in September, just because of the screen. There’s not much size (or weight) difference between the MacBook and the 15-inch MacBook Pro, and the high-glare screen is still an option.

Also, the exterior of the matte black models were all smudged with fingerprints, visible from ten feet away, and they just put them on display…

PDF::API2, Preview.app, kanji fonts, and me


I’d love to know why this PDF file displays its text correctly in Acrobat Reader, but not in Preview.app (compare to this one, which does). Admittedly, the application generating it is including the entire font, not just the subset containing the characters used (which is why it’s so bloody huge), but it’s a perfectly reasonable thing to do in PDF. A bit rude to the bandwidth-impaired, perhaps, but nothing more.

While I’m on the subject of flaws in Preview.app, let me point out two more. One that first shipped with Tiger is the insistence on displaying and printing Aqua data-entry fields in PDF files containing Acrobat forms, even when no data has been entered. Compare and contrast with Acrobat, which only displays the field boundaries while that field has focus. Result? Any page element that overlaps a data-entry field is obscured, making it impossible to view or print the blank form. How bad could it be? This bad (I’ll have to make a screenshot for the non-Preview.app users…).

The other problem is something I didn’t know about until yesterday (warning: long digression ahead). I’ve known for some time that only certain kanji fonts will appear in Preview.app when I generate PDFs with PDF::API2 (specifically, Kozuka Mincho Pro and Ricoh Seikaisho), but for a while I was willing to work with that limitation. Yesterday, however, I broke down and bought a copy of the OpenType version of DynaFont’s Kyokasho, specifically to use it in my kanji writing practice. As I sort-of expected, it didn’t work.

[Why buy this font, which wasn’t cheap? Mincho is a Chinese style used in books, magazines, etc; it doesn’t show strokes the way you’d write them by hand. Kaisho is a woodblock style that shows strokes clearly, but they’re not always the same strokes. Kyoukasho is the official style used to teach kanji writing in primary-school textbooks in Japan. (I’d link to the nice page at sci.lang.japan FAQ that shows all of them at once, but it’s not there any more, and several of the new pages are just editing stubs; I’ll have to make a sample later)]

Anyway, what I discovered was that if you open the un-Preview-able PDF in the full version of Adobe Acrobat, save it as PostScript, and then let Preview.app convert it back to PDF, not only does it work (see?), the file size has gone from 4.2 megabytes to 25 kilobytes. And it only takes a few seconds to perform this pair of conversions.

Wouldn’t it be great to automate this task using something like AppleScript? Yes, it would. Unfortunately, Preview.app is not scriptable. Thanks, guys. Fortunately, Acrobat Distiller is scriptable and just as fast.

On the subject of “why I’m doing this in the first place,” I’ve decided that the only useful order to learn new kanji in is the order they’re used in the textbooks I’m stuck with for the next four quarters. The authors don’t seem to have any sensible reasons for the order they’ve chosen, but they average 37 new kanji per lesson, so at least they’re keeping track. Since no one else uses the same order, and the textbooks provide no support for actually learning kanji, I have to roll my own.

There are three Perl scripts involved, which I’ll clean up and post eventually: the first reads a bunch of vocabulary lists and figures out which kanji are new to each lesson, sorted by stroke count and dictionary order; the second prints out the practice PDF files; the third is for vocabulary flashcards, which I posted a while back. I’ve already gone through the first two lessons with the Kaisho font, but I’m switching to the Kyoukasho now that I’ve got it working.

Putting it all together, my study sessions look like this. For each new kanji, look it up in The Kanji Learner’s Dictionary to get the stroke order, readings, and meaning; trace the Kyoukasho sample several times while mumbling the readings; write it out 15 more times on standard grid paper; write out all the readings on the same grid paper, with on-yomi in katakana and kun-yomi in hiragana, so that I practice both. When I finish all the kanji in a lesson, I write out all of the vocabulary words as well as the lesson’s sample conversation. Lather, rinse, repeat.

My minimum goal is to catch up on everything we used in the previous two quarters (~300 kanji), and then keep up with each lesson as I go through them in class. My stretch goal is to get through all of the kanji in the textbooks by the end of the summer (~1000), giving me an irregular but reasonably large working set, and probably the clearest handwriting I’ve ever had. :-)

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