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!
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.)
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.
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.
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.
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!
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() {In Ruby, this can be expressed as...
if (cart == null) cart = new Cart();
return cart;
}
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!
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!
Slow news is good news?
I rarely read news online. You might think that leaves me out of crucial blogosphere zeitgeist or military-industrial-political news, but nope: my co-workers filter the web for me, forwarding articles about OpenLaszlo, net neutrality, software-as-a-service, and media business models; and I read messenger-bag-loads of books and magazines. Each month, I read Harper's cover-to-cover, with a liberal (heh) dose of the Atlantic, Utne Reader, MIT Technology Review, San Francisco, and occasional forays into The Economist, and the Sunday New York Times. Then a year or two after things happen, I read non-fiction books: The Looming Tower, the Great Deluge, the Assault on Reason, the Shock Doctrine, that sort of thing.
Reasoned slow analysis with editors and proofreaders and fact-checkers, passages I can go back to years later (without the internet way-back machine), passages that authors will have to stand by for decades, footnotes -- yeah, I'll pay for that. What would the invasion of Iraq look like two years later? A fiasco. What about the Thanskgiving 2007 travel breakdown? Check back in two years and I'll have read some reasoned analysis, complete with footnotes.
TurboTax Wins Me Over
After I posted a complaint yesterday, TurboTax responded to me with superstar customer service. Bob Meighan, the VP of TurboTax, posted a response to my blog entry, and Becca from customer support wrote me a long detailed response, in which she offered to refund my fee for the online service. She explained that with a situation like that, real-time tech support would probably have been able to help me, and pointed out that perhaps my anti-virus software was the culprit. On my PC, I run an out-of-date version of Symantec Anti-Everything, which I haven't tweaked at all (assuming that I'm just hosed no matter what) so Becca might well be right about my anti-virus software interfering.
So, I'm getting my $109 back, and next year I'll use TurboTax Online again.
My original point, with all of this, was that sometimes RIA's can be better than desktop applications, even for single-user applications where security matters. By sending all the information over the relatively straightforward, universal https protocol, application developers can shield users from network vicissitudes, while still providing as much security as direct connections from desktop to server.
Granted, in an RIA model for TurboTax, I'm sending my financial information to Intuit, who then has the chance to do Evil Things with it -- but really, when I hit send on TurboTax Desktop, I have no more reason to believe that Intuit isn't caching and analyzing my data than I do with TurboTax Online. Once my financial information leaves my LAN, it's basically "out there," and I have no illusions about "privacy."
TurboTax Web vs TurboTax Desktop
I just finished filing my 2006 taxes, an activity made significantly more difficult by TurboTax. The desktop edition of TurboTax was unable to update itself, on my PC running Windows XP, despite hours and hours of trying. The one-click update didn't work; it didn't give me any feedback at all about whether it succeeded. The manual update looked like it worked, but the application kept telling me that I needed to get updated forms, which were not yet available from TurboTax. In September of 2007, the software promised that the forms would be ready by January 12, 2007. Er, what? In October of 2007, I got email from TurboTax saying that those forms were now ready -- bizarre since everyone else needed these forms in April 2007. (I'm not talking about obscure forms here; just Schedule C.) So I try again to update my desktop TurboTax, and once again it fails. I go through some insane machinations from the support site ("open the command prompt and run this command: ping -mysterious -incantation) to discover that my fragment size was insufficent. More TurboTax forums, and I learn that I have to set the MTU size on my router. Joy, joy -- my cable gateway (blazingly fast, blazingly expensive) doesn't allow the user to set the MTU. I don't blame Cisco, here -- I blame TurboTax, for not being able to cope with a net connection that handles everything else I throw at it. BitTorrent? Fine! Downloading 50mb installers? Fine! Sustained ssh connections for days? Fine! Downloading tax forms: nope. Ridiculous.
At this point I mailed Intuit for support. They got back to me a few days later, and told me to do the things I had already done, which I had explained in my support request that I'd already done them. They told me to call them for support during business hours. I have a job, people. TurboTax was supposed to be convenient and there was supposed to be readily available technical support.
But I needed to get my taxes done, and I could see that getting on the phone with them wasn't going to be helpful. I realized that I could avoid this subtle network incompatibility if I used the web-based TurboTax. Alas, web-based TurboTax can't import an incomplete return from desktop TurboTax, so I had to re-enter all my information. The tab key didn't work as nicely to move between fields as it did on the desktop application, but it was usable. After spending an hour or two filling out forms, my taxes were submitted and accepted.
The lesson for TurboTax is... if connecting with your big fragment sizes fails with a desktop application, try making the connection over http or https. Yes, even desktop applications can connect over http.
And: Intuit, make live tech support available by phone 24/7 before October 15, not just before April 15.
GORE OBAMA CLINTON CLINTON
Al Gore for President.
Barack Obama for Vice President.
Bill Clinton for Ambassador to the United Nations.
Hillary Clinton for Secretary of Health and Human Services.
Wes Clark for Secretary of State.
Dennis Kucinich for Secretary of Labor.
Ron Paul for Secretary of Homeland Security.
John McCain for Secretary of Defense.
Max Cleland for Secretary of Veterans' Affairs.
Jerry Brown for Secretary of Housing and Urban Development.
Michael Pollan for Secretary of Agriculture.
another reason to love OS X
At home, I put my macbook pro on the left of my widescreen monitor. At work, I put my macbook pro on the right of my 19" monitor. My mac automatically recognizes not only that I have hot-swapped a DVI monitor, but also which monitor I have plugged in, and where I last positioned that monitor. For total icing on the cake, I can configure the relative virtual vertical position of the two monitors, so that I can move the cursor straight across from the top of my laptop screen to the middle of the external display.
I love you, OS X. You complete me.
doctors with cel phone
Metropolitan Medical Group is the practice I've been looking for. Check this out: I emailed my doctor a question about a prescription yesterday. Nothing urgent. He emailed me back, at midnight on sunday, saying he would call the pharmacy in the morning. The next morning he called me to tell me he had called the pharmacy, and told me to call him back on his cel phone if there were any problems. There was, in fact, a problem -- the pharmacy wanted to fill the wrong dosage -- so I called the doctor back on his cel phone. He answered, he knew exactly the medication and dosage we were talking about, and said he'd call the pharmacy and straighten it out right away.
And then, while I'm composing this entry, the receptionist called me to let me know that the doctor had talked to the pharmacist himself and made sure that the dosage would be correct. This is unheard-of service.
Boutique medicine? Hardly! I pay a yearly fee of $79, and they take my insurance, so it's $20 per visit. They usually have same-day appointments, with a PA if a doctor isn't available, and their office is three blocks from my house. Amazing.
quick slow-food oatmeal
I have discovered the perfect quick slow-food breakfast. I take a half cup of steel-cut organic oats, add a half cup of water, soak overnight, then microwave it in the morning for two minutes. I add some maple syrup and cream, and it's dreamy. It has way more heft than instant oatmeal, it's super-fast, and it's incredibly inexpensive.
heart of the city
I was getting ready for bed around ten tonight when I heard a ruckus outside. I live at Third and Mission, in the heart of San Francisco, along the corridor between the ball park and union square, with views of the Bay Bridge, the financial district, and Market Street from my living room. When something starts to happen, I know it before KRON-4 has a chance to get reporters on the scene. First there was a roaring crowd; waves of cheering and shouting that roused me from my cozy bed to peer out the windows searching for the source. Mission Street jammed up, and New Montgomery got gridlocked. Third Street was taken over by pedestrians; cars couldn't get through the crowds. Sirens and police cars converged a few blocks south of here. What was going on?
I tried the tv, thinking maybe local news would know what's up. Nope, just the same annoying sports guy talking about boxing. Was it the Giants? Did Barry Bonds just do something actually worthy of celebration? Nope, the Giants are in Miami tonight. Okay, can the local papers help me? Nope, their news feeds have no mention of
"right now." How can you google for "why are people yelling outside my window?" I heard chanting -- what were they saying? It wasn't "peace now!" and it wasn't "impeach bush!" or "out of iraq now!"
Mystified and curious, I pulled on a pair of jeans and a sweatshirt and went downstairs. On the way down, other building residents asked each other what was going on, but no one had answers. Not even the concierge knew, and he could see the traffic piling up just beyond the rotating doors.
Finally on the sidewalk, I entered the stream of people, and start demographing them: mostly 20 somethings, not hipster, not sporty, more middle-American than we usually see in these parts, gaggles of straight kids with a distinct smell of beer. The first guy I approach has fresh stitches in his eyebrow and a bruised face. He ignores my questions and walks on; it's kind of a "28 days later" moment. Next I approach a girl who probably can vote but can't drink, with sweaty curly blond hair. "What's going on? Where's everybody coming from?" I ask. "Concert," she replies. "Who?" "Rage," she answers, and I know she means Rage Against the Machine. The light changes and the pedestrian stream is interrupted for a minute while a few cars progress through the Third and Mission intersection. I ask the next group of people, again, "What's going on?" Again the reply is "Concert." "Who?" "Rage." Why is everyone speaking in single-world sentences? Come on, I have a faux-hawk and I'm wearing a hoody and surfer shoes, you can talk to me! At least they assume that I know who "Rage" is.
I do, in fact, know who Rage is, and I'm a little worried. Rage is nothing if not political. If they drove a stadium full of drunk Californians to cheering that rivals Critical Mass, well, I bet some Starbucks windows will get smashed tonight. Lord knows there are plenty of candidates in this neighborhood.
Half an hour later, there are more sirens, less shouting. Law and order is reasserting itself. More honking; the cars are taking over the streets again. I want to be here for the revolution. I don't think the smell of the crowds or the sound of gridlock will be televised.
UPDATE: The concert was Rock The Bells an all-day hip-hop/funk/punk festival at McCovey Cove Parking Lot, and included Rage, indeed, but also Wu-Tang Clan, Public Enemy, Mos Def, Nas, Cypress Hill, and other bands I'm too old to know about.
Philz Coffee
This coffee is insanely good. This coffee is so good that I have taken a bus across town for a single cup. This coffee is so good that upon taking the first sip I have to yell repeatedly about how fucking awesome it is. This coffee is so good that I'm willing to pay $2.75 for a cup. Hell, I'd pay twice that. This coffee is a different beverage entirely than Starbucks and Peets or even IntelligentsiA and Cafe Trieste.
Philz Coffee is the wonder of which I speak. There are three locations, all in San Francisco, and I recommend that everyone make it a point to once in their lives have a cup of Philz, even if it means driving two thousand miles across the desert in the summer. (Okay, that's a bit hyperbolic, even for me.)
Upon walking into Philz, the customer is greeted with a list of twenty coffee blends. A loving description is available on the menu, or the bouncy hipsters behind the counter will help you choose the right one. I asked for something like Kona or Jamaican Blue Mountain, and they steered me to the "So Good" blend. It's not necessary to call these kids barristas... "angels" would hit the mark better. The angel takes a single scoop of whole beans from one of several dozen tubs, grinds them, pours them into a puffy paper filter, then pours super-hot water over the beans. She adds cream and sugar to my specifications, then hands me the glorious product of this endeavor. The top layer is a thick froth; the liquid is exquisite. It has all the beautiful rich coffee flavor with none, zero, none of the bitterness. The lack of bitterness is what separates Philz from everything else ever. This is when the yelling starts; I spend a few minutes unable to contain my astonishment and joy at the deliciousness of this coffee.
...all of which explains why, at 11 am on a Sunday with the New York Times delivered to my door, I'm contemplating a trek across town to purchase another heavenly concoction. My god. Go drink this coffee, then tell me I'm wrong.
Philz Coffee, 24th at Folsom, Fourth at Berry, or 18th and Castro, San Francisco. www.PhilzCoffee.com.
personal geek security pack
I always carry these items, in a tiny Pelican case in my backpack:
- Prepaid phone card
- BARTticket (or the local equivalent)
- Cash. $20, $50, or $100 is all good, but in twenties or smaller denominations.
- 4 quarters(Think parking meter.)
- Duct tape, in a flat "roll"
- Gu Energy Gel! Food goo with caffeine
- Painkiller of your choice. I like ibuprofen, but if you've got an extra vicodin sitting around, throw that in too. Most 911 first responders can't give you morphine, you know. So if you live the kind of lifestyle where (say) dislocating your shoulder or dropping a couch on your toe is not unlikely, it'd sure be nice to have real painkillers around. Your mileage may vary!
- LED Flashlight. I use an Inova
- USB thumb drive with recovery software for your favorite OS's. The Sony USM-H Micro Vault is 1.5cm x 3cm x 2.7mm.
- Pocketknife. My dad turned me on to Columbia River Knife and Tool. IMHO, a single tough blade beats the leatherman on weight vs utility and volume vs utility for civilized situations. (I don't go to Borneo much, do you? Although it is a pleasure to answer in the affirmative when someone says, "anybody got pliers?" If this matters to you, put a small pocketknife if in the emergency pack, and carry the leatherman in your pocket.)
- A lighter. When the power goes out, a flashlight is nice, but I dare you to find a lighter in your apartment in the middle of the night aided only by a flashlight. This item pairs with a stock of candles in a well-known location in your apartment.
Don't keep this in your wallet! One of the use cases for this packet is "I lost my wallet." (Or, more likely, "someone stole my wallet.")
Any suggestions for other things to add?
nullifying backups
While playing with stickam, I decided to demonstrate how I cook dinner to my huge audience. This involved separating frozen meat patties by banging them on the desk. I stopped this maneuver before completion, because my giant external hard drive, also located on the desk, started to whine. Loudly. After cooking and eating my tasty dinner, I returned to the hard drive. I figured the heads had gotten misaligned. With the power off, I tried tapping it gently. I tried tapping it harder. The whine was still there, and prohibitively loud. I figure the medium is probably compromised but I can use it for storage that can be ephemeral. (Damn it.) Today I turned it on again because my iTunes is setup to download podcasts there, and I needed some fresh podcasts. Hey! Writing data to the disk stopped the whining!
So can I ever rely on this disk again?
[UPDATE] No, I can never rely on this disk again, and I should be punished for entertaining the thought that I could. For that matter, I should never rely on a single point of failure for critical data. Time for me to work on my strongspace setup.
handy shell tools for finding large files
Heard over and over in development shops everywhere: "We're out of disk space! Who is the spacehog?" "Not me! It must be your project!" "Let's delete temp files | log files | core dumps | stuff that looks old." I will spare you the lecture on the heartbreak of irreplaceable data loss, and instead I provide a few one-line shell goodies to identify where the disk space is going, with human-readable text reports sufficient for mailing to all your co-workers.
The classic command for analyzing disk usage is
$ du -k
which will print something like this
32 Documents/Standards/sac-1.3/doc/org/w3c/css/sac/helpers
568 Documents/Standards/sac-1.3/doc/org/w3c/css/sac
568 Documents/Standards/sac-1.3/doc/org/w3c/css
568 Documents/Standards/sac-1.3/doc/org/w3c
568 Documents/Standards/sac-1.3/doc/org
That lists the size in kilobytes, followed by the file name. Output like this quickly gets unreadable. We can apply some concepts of information visualization to improve this output. Let's put the most important stuff at the end, by adding a sort command:
$ du -k Documents | sort -n
The last few lines of this list the biggest directories and their size in kilobytes:
80180 Documents/Reference/docs/api/java
82924 Documents/Reference/docs/api/javax
110788 Documents/Speed Download 4
205708 Documents/Reference/docs/api
251800 Documents/Reference/docs
254668 Documents/Reference
434216 Documents
Comparing six-digit numbers at a glance requires brain work. To make it easier, get human-readable output from du, by replacing the -k flag with -h. Now a line of output looks like this:
4.1M Documents/Standards
That breaks our sort, though; sort -n is numeric, and 2M is less than 4K. Wrong. Let's just throw out any du output less than 1 mb. I do that by piping the output through sed. I also want to limit how deep we descend into directories, since directories sizes include the summarry of their children's sizes. On the mac, pass in a -d depth flag; on linux, use --maxdepth=depth.
$ du -h -d 3 . | sed -e /\n*[KB]/d | sort -n
Then to get just the highlights, pipe that through a tail command, to select just the last 30 or so big guys:
$ du -h -d 3 . | sort -n | sed -e /\n*[KB]/d | tail -30
But wait, this is kind of stupid; I'm asking sort to sort a whole lot of stuff, then promptly throwing out most of the sorted things. Let's switch the order of the sed and the sort, which will make the sort smaller and faster.
$ du -h -d 3 . | sed -e /\n*[KB]/d | sort -n | tail -30
Props to Unix Power Tools and Jeffrey Friedl's Mastering Regular Expressions. We're just mortals, here, folks, but we're living in a well-documented world.
On the mac, for an easier way to do this, try OmniDiskSweeper.