shinyblog

Tuesday, May 06, 2008

gowebtop calendar: my current project

gowebtop.com (free registration required) is now live with a preview of my current project, a calendar application within the gowebtop framework. For the highlights, see the gowebtop blog. I worked on this project as a freelancer through Elastic Process, a San Francisco software consultancy, for our client, Laszlo Systems.

Sunday, February 17, 2008

give them what they (say they) want

I feel guilty about walking past a hungry person and not helping them get some food, but I find it hard to believe that everyone claiming to be hungry in downtown San Francisco is only craving nutritional sustenance. An easy solution: when approached by a "hungry" person, I hand them some actual food! I usually carry a snack with a long shelf life in my backpack: a baggie of nuts, a chocolate bar, some dried fruit. So when I'm approached by someone who says they're hungry, I offer them an actual treat looking just as yummy and nutritious as it was on the shelves of Whole Foods.
The reaction I get to such offers is illuminating. An aggressive beggar in the big Westfield mall downtown literally recoiled at the offer of a bag of grape Clif Blox.. Sorry, buddy, but you need detox, not glucose. And yeah: the homeless community knows exactly where to go for free detox services, and they talk about it with more respect and dread than prison. (How do I know? Because I've talked to people who got sober for good after their 15th or 20th time through Ozanam.)
I'm not saying that I can cure poverty or drug addiction or homelessness with a 300 calorie snack. I'm just saying, here's an ethical way to cope with pleas from which our society should not ignore. Give them what they say they want.

Friday, February 01, 2008

"unsubscribe"

One of the best developments in the web this year: one-click unsubscribe links in promotional emails I must have signed up for at some point. Here's the scenario: I get some email from Random Business. I gave Random Business my email two years ago when I was interested in their random thing; I am no longer interested. I want to unsubscribe.
The old way: I'd follow a link in their email to a login screen. If I didn't remember my username and password, which I probably don't since it's been a while, I have to go through the forgot-my-password link, wait for email to arrive, then at least log in again, go to my preferences, edit my preferences, then click save and verify that I really want to unsubscribe.
The new way: At the bottom of the promotional email, there's a link that says "Click here to unsubscribe." In the very best implementation, I click on that link and get a page which says, "myemail@mysite.com has been unsubscribed from all Random Business mailings."
This was a very simple technology to put together, and could have been done a decade ago. By focusing on an everyday annoyance felt by most email users, someone was able to vastly improve the user experience. I won't quite say this builds brand loyalty (I am, after all, unsubscribing) but it does decrease lingering annoyance.
Companies with one-click unsubscribe, I salute you!

Thursday, January 31, 2008

linear time sorting, or, why remedial courses are not just for dullards

I've been listening to an introductory course on algorithms from MIT OpenCourseware. Today I learned that it is possible to sort integers in linear time!! The technique I learned this morning, counting sort, only works for a particular kind of input: a list of n integers in the range 0..k. (Or any known range; map it to 0..k for convenience.) If k is much smaller than n, you can sort in Θ(n + k). That's linear time, people!
I'm 33, an Ivy League graduate, and I just discovered it's possible to sort in linear time! Where was I in (ahem) 1998 when Roberto Tamassia was teaching this? Well, it looks like this year's equivalent class at Brown (now cs0160, then cs21) doesn't counting sort in the lecture notes. Or maybe I slept through it; I was a sophomore.
My point: reviewing a subject you used to know, from a different perspective and with more experience than you had at 18, can blow your mind with mind-blowing information that you might have missed the first time through.
WE CAN SORT INTEGERS IN LINEAR TIME! (for sets of integers meeting the requirement above.)

Tuesday, January 08, 2008

in praise of display calibration

I've been watching tv shows and dvd's on my giant LCD monitor, and wondering why it's so dark and moody and why everyone looks feverish. Somehow I convinced myself that I just shouldn't worry about it -- absolutely ridiculous when the whole point of a giant LCD display is fantastic picture quality. So here's what finally hit me, while I'm snuggled up with the sniffles: maybe calibrating my display would help. Boom! It just so happens that Mac OS X (Leopard baby!) has an expert-mode display calibration that crafts a custom gamma profile from about a dozen data points provided by the most advanced optics on the planet: my eyes.
Now people on Studio 60 have normal skin tone and it doesn't look moody so much as, well, ebullient. Which is exactly what Aaron Sorkin and Thomas Schlamme were going for, I'm pretty sure.

Friday, January 04, 2008

naive users suffer

Yesterday I wrote about discovering that my mac became distressingly slow when paired with some peripherals I hadn't used with that particular machine before. I investigated and eventually deduced that the problem was the version of USB supported by my machine's hardware. A naive user, or even a moderately powerful software user, would not have a chance of figuring out a bus bandwidth mismatch. To determine that I only had USB 1.0 support, I looked at Apple's tech specs for this powerbook, which is in itself a challenge, because the powerbooks are differentiated by parenthetical keywords like "DVI" and "Gigabit Ethernet". Again, if I'm a naive user, there's no way I could figure out which one I have. Consulting the tech specs, I found that I had two 12 Mbps USB ports. When I do the math, that sounds slow for disk access: 1 gig = 1000 Mb = around 80 seconds if everything is cruising at top speed -- bleck. But it didn't say "USB 1.0" anywhere. Tech specs of later powerbooks explicitly said USB 2.0. Combined with the observed performance problems, I concluded that the problem was the USB version.
There's no way a naive user could have figured this out. Even if they took the machine into a genius bar, they probably would have left the peripherals home, and the genius would just say, "it's operating as well as we could expect for a machine this old; if you want it faster you'd better buy a new machine."
I'm not saying I'm such a whiz with diagnosing hardware issues; far from it! My point is that many people are subject to sub-optimal user experiences because of subtle hardware and software incompatibilities.
All of which I suppose points to a more general idea: naive users of any technology or discipline suffer from their lack of expertise. My car could be tuned better; my taxes could be lower; my house could be heated more efficiently; my cel phone probably has superpowers it's hiding from me. I'm not sure what to do about this, though. Learn everything about everything? Okay! Good thing I've got another 60 years to live.

Thursday, January 03, 2008

slowed to a crawl by I/O

I'm using my PowerBook G4 Titanium as my main machine for a while -- hopefully not long, because this is insanely slow. I'm trying to understand how it was wonderful five years ago, and now painfully slow, when I'm just running a browser and iTunes and gmail notifier and not even a terminal. I figured it out: the I/O is making it seem hellaciously slow. I used to have a FireWire iPod; now I'm using a USB iPod (thank you, Marshall). I used to be satisfied with my built-in 30 gig hard disk; now I'm using an external half-terabyte disk. Here's the kicker: this machine doesn't support USB 2! It was built back when firewire seemed like it was going to win. Firewire lost, though, at least for commodity consumer peripherals, and I'm hamstrung by slow IO.
I'm picking out my next mac, and I'm having a hell of a time deciding between almost all the form factors. I need one now, can't wait until after Macworld, so buying a monster macbook pro seems like a bad idea; I'll just be kicking myself when the prices drop and a new mindblower comes out in two weeks. The iMacs have the combination of tons more computing power and disk space for less money, but I've already got a huge wonderful display. (Hmm, could I use an iMac with the built-in display and my widescreen external display? Mmm, tasty!) And of course, I adore the idea of a Mac Pro, but I got one of those a few years ago and immediately discovered I would rather have a laptop. The one that I can totally rule out is the mini; 2GB ram just isn't how I roll. Probably the thing to do is to get a Mac Pro now, and plan on getting the rumored new subnotebook as my next planned purchase. Buying components instead of all-in-one's is the most flexible, but least portable, solution.

Sunday, December 30, 2007

get your backstreet boys off my network!

If you're going to use a neighbor's open wifi connection, it's probably not a great idea to share your iTunes library. I opened my network a few days ago because I was having trouble getting my Powerbook G4 online; I couldn't get it to connect using any of the password-based security schemes. I thought I turned on MAC filtering, but the netgear router adminstration page was a bit confusing -- it shows a "Wireless Card Access List" but doesn't actually do MAC address filtering unless you've checked a box above the access list. So I thought I had a closed network, but I was wrong. Fine, I deserve to have neighbors find and share my connection.
And then I launched iTunes and saw "Ernesto's LimeWire Library" under the "shared libraries" tag. (Not really his name.) Bwahhahha! Apparently Ernesto found my open network! I bet he had no idea that he was sharing his music.
I returned to the netgear router admin, actually turned on MAC addr filtering, and bye-bye Ernesto! Whee! Now he's looking around going, damn, what happened to that open wifi?
This is a nice feeling -- I did something kind of mean but I had every right to do it. That is so rare!

Saturday, November 24, 2007

nutritious syntactic sugar

Is syntactic sugar just tasty, or does it actually improve the language? Depends on your definition of "improve," I suppose. I just found a ruby idiom in Agile Web Development with Rails that can make a very common, wordy coding task short and clear. We often have to say "give me a thing, and if it doesn't exist yet, make one for me."
In Java:
public cart findCart() {
if (cart == null) cart = new Cart();
return cart;
}
In Ruby, this can be expressed as...
def find_cart 
session[:cart] ||= Cart.new
end

The or-equals operator belongs in a dynamic language, where expressions that evaluate to booleans can also be very nice rvalues. These three lines of code show off a few things about Ruby that might be mistaken for syntactic sugar, but actually make the language better:

  • Avoid unnecessary punctuation.

  • Clean syntax for hashes make them almost as readable as member data accessors

  • Most statements are also expressions.

  • Implicit returns.

It's delicious... and nutritious!

Friday, November 23, 2007

Over-Preparedness Vindicated!

Last winter I posted the contents of my personal geek security pack: some money, some painkiller, some duct tape, a BART ticket, a snack, that sort of thing. Since then I've been carrying it around in my backpack.

In an incident involving an ice cream sandwich and an intra-pocket butter malfunction, I lost my wallet a few days ago. In Berkeley -- that's a large bay away from San Francisco. No problem! Well, okay, yeah, it was a problem, but the problem-ness was much ameliorated by having a BART ticket and twenty dollars cash in my personal geek security pack. I used the money to buy a bus ticket back to look for my wallet at the site of the ice-cream-sandwich incident, then retreated to San Francisco with the loaded BART ticket.

The wallet hasn't turned up, but I've got spare ID tucked away in a safe place (not at home!) and a bunch more cash on my refrigerator door. Over-preparedness: vindicated!

Now-- everybody go back up your data! And store the backups off-site! And put twenty bucks in a secret spot in your backpack! And for the love of Pete, don't put butter in your pockets!