Sunday
Mar192006

making my slow mac fast

My 867 Mhz, 512 mb ram 15" titanium powerbook g4 is not slow. The key to getting this four year old to perform is to understand and take advantage of OS X's virtual memory structure. (Oversimplifications follow, but they get the job done; my mac feels fast.)
Virtual memory is on disk; physical memory is on chips. Chips are faster than disk. To run, an application must be in physical memory. When switching applications, the new application must be "swapped in" to physical memory. If that physical memory was in use by another application, that application must be "swapped out." A standard mac-ish application takes about 100 mb of memory. Switching between a paged-in application and a paged-out application involves writing ~100 mb to disk, and reading another 100 mb from disk. 200 mb of disk access takes a non-trivial amount of time... enough to explain that annoying pause when I hit cmd-tab or click on another icon in the dock.
Running fewer applications requires less application switching, so it feels faster. This brings me to my key insight for the day: For improved performance on low-memory systems, use web apps in the browser to replace traditional desktop apps. Firefox is faster at switching between windows and tabs (all resident in physical memory, presumably) than OS X is at swapping applications between physical and virtual memory. Did someone say "the network is the computer"?
This approach is great for the things that I need to do with a portable machine: coding (editing text files on the server, using Transmit and BBEedit), email (although Mail.app can be rather slow on big mailboxes; I should probably switch to Laszlo Mail soon), and web browsing. Photoshop, no way; I don't even have photoshop installed on this machine. Nor do I run tomcat or an Open Laszlo server on this machine. I offload those jobs to the right machines, which I have access to because my employer understands: a blazing dual-opteron linux server for tomcat and OLS, and a bomber dual-2 G5 tower at work.
Diagnosing where my memory is going is possible using top, and easy using Activity Monitor or iPulse. I learned that Adium uses an astonishing amount of memory, as do dashboard clients. This mac is going to be my portable machine for a long time yet, so, goodbye Adium, goodbye cute dashboard widgets... Hello, terminal, my old friend!

Monday
Jan162006

kitty-based ergonomic problems

I'm having a problem with my work-at-home ergonomics. It's getting worse since the IT guys installed a superhot server for me to use from anywhere (so long as I do two hops of ssh tunnels for four ports) so I can do more real work from home, faster. The problem is the kitty. Darling has an oral fixation. She insists on licking my thumb or finger constantly, for hours at a time, whenever I'm around. When I'm getting ready for bed, I have to leave a hand outside the covers or else she'll paw at my face until I give her a bit of finger to nibble on. Which is okay, because I'm sleeping. The problem is programming. My hands are an easy target, so Darling sits on my left wrist and nurses on my right thumb. Sometimes she doesn't do the oral-fixation thing, she just sits across both of my wrists. Darling weighs 16 pounds. If I push her away she nudges around until she can sit down in the same place again. This is an ergonomic problem. I'm pretty sure a sixteen pound weight on my wrists while typing is not ideal. Also it makes it hard to reach for the keypad and the mouse. On the other hand, she keeps my wrists warm.
I'm going to try putting catnip on the easy chair.

Monday
Jan162006

I love my manager

I asked Sarah for a "management interlude" this morning, to help me set priorities for today. We got on the phone and the first thing she said was, "You don't have to work today, you know." That is so non-Web1.0 I love it. Because, of course, I want to work today. I told her, "Well, maybe I'll take more naps than usual, or work more in pajamas than usual." We agreed that was a good idea. Sarah has also said, she works the first eight hours a day on what's most important to Laszlo, then after that, on what she wants to do. This is perhaps the 50-hours-a-week version of the 20% project. I could do with a few fewer projects though. Side projects reproduce like bunnies who mate with other people's ideas. Current side projects:

  • secret cool thing to improve laszlomail usability

  • book chapter on visual effects for laszlo

  • laszlo viewer for delicious library

  • learn cocoa programming

Sunday
Jan152006

perfect sunday morning: coffee

This has been a perfect sunday morning. My co-worker Bruce and his wife Kira gave me a french press they hadn't been using, and I bought a quarter-pound of Mocha Java yesterday, and half-and-half, and sugar... and I woke up and made myself a perfect cup of coffee at home, for the first time ever. The french press actually let a bunch of the grounds through the screen, so I filtered it again through a paper towel. Who needs coffee filters when we've got Bounty?
But it gets better: I took my mug of coffee and got back into bed. Can you beat that? Is that beatable? Oh. Yeah... if I had a sweetie waiting for me in bed to drink coffee and cuddle and help with the crossword puzzle.
Thus my work towards rebuilding my social life! In the last week I've gotten together with friends three separate times! Four, even, two days with one person. Amazing, absolutely amazing. And now I'm going in to work for social-thing number five, helping a co-worker get started with programming while I put my book chapter together.
Good lord, it's a good day.
If you were wondering, my dreams were of the epic-fantasy variety, strongy influenced by A Feast for Crows by George R. R. Martin.

Saturday
Dec312005

tool of the week: colorzilla

Colorzilla, an extension for Firefox (including 1.5), is my favorite tool this week. I just discovered it twenty minutes ago. (Make sense of that, I dare you!)

Install it, restart firefox, then notice the little eyedropper icon in the bottom left corner of the browser window. Control-click on that icon; you get a menu. First go to "Options" and select "Auto Copy: Enabled." Choose your favorite color format from the Auto Copy menu; I like "#FFFFFF".

To sample a color: hit shift-escape, the default eyedropper invocation tool. The cursor changes to a cross. As you move the cursor around the screen, the status bar at the bottom of the window displays configurable information including the hex code of the color you're over. When you're over a color you like, either click on it, or hit shift-escape again.

NOW THE JOY: Go to a text editor and use your favorite keyboard shortcut for paste, command-v, let's say. THE HEX COLOR OF THE PIXEL YOU SAMPLED IS PASTED INTO YOUR TEXT EDITOR.

It gets better. Hit shift-escape to go into yedropper mode. Then hold down shift and click on a color you like. You're still in eyedropper mode! Shift-click on another color, and another. All of the colors you sample are accumulated in the history color palette. Ctrl-click on the eyedropper icon to get the ColorZilla menu; select Color Picker, then go to the Palettes tab. Select History from the drop down. AMAZING: this is a palette of the history of all the colors you've sampled.

One more thing: it works in Flash.

It's not as mac-ish or sexy as xScope but the auto-copy-hex-of-sampled-pixel might be enough to switch me from xscope.