Pianobar command-line Pandora client

I’m a full-time [Pandora](http://www.pandora.com) listener. Spend the time and make yourself a good station. There really isn’t any going back.

Surprisingly enough, no enterprising Mac dev has made a good native Pandora player. There are a fair number out there that embed the Flash player into a thin [WebKit](http://en.wikipedia.org/wiki/WebKit) shell. That works well enough but it’s no improvement over a background browser tab or [Pandora’s Desktop client](http://www.pandora.com/desktop_app) based on [Adobe Air](http://www.adobe.com/products/air/). Although [Flash 10.1](http://labs.adobe.com/technologies/flashplayer10/) should bring improvements, the continuing holy-war between Apple and Flash remains testament to sub-par performance and stability of Flash on the Mac. Having the Adobe AIR runtime[Flash] loaded with Pandora chews a minimum 7%-10% CPU and can be much worse. ArsTechnica reported [40-50% usage](http://arstechnica.com/business/news/2008/06/pandoras-desktop-client-convenient-to-use-faces-challenges.ars).

Check out the [Pianobar client](http://github.com/PromyLOPh/pianobar), which is arguably more full-featured than any other solution and uses minimal resources. You’ll need to have [MacPorts](http://www.macports.org/) or [Homebrew](http://github.com/mxcl/homebrew) correctly installed in order to install Pianobar, but you probably do if you’ve made it this far into my post.

To install with MacPorts:

1. sudo port install libao faad2 libmad cmake git-core
2. git clone git://github.com/PromyLOPh/pianobar.git
3. cd pianobar
4. cmake . && make && sudo make install

Then you run it with the pianobar command:

Welcome to pianobar! Press ? for a list of commands.
[?] Username: [email protected]
[?] Password:
(i) Login… Ok.
(i) Get stations… Ok.
0) Classical Music Medley Radio
1) q Hemancuso Radio
2) Ray LaMontagne Radio
3) Stevie Wonder Radio

[?] Select station: 1

And you’re up and running. While playing you can get a list of available commands by pressing ?

+ love current song
– ban current song
a add music to current station
c create new station
d delete current station
e explain why this song is played
g add genre station
h song history
i print information about current song/station
j add shared station
m move song to different station
n next song
p pause/continue
q quit
r rename current station
s change station
t tired (ban song for 1 month)
u upcoming songs
x select quickmix stations
b bookmark song/artist

As you can see, it’s full featured and then some.

PSA: Mini DisplayPort to Dual-Link DVI Adapter works great with Dell 3007WFP

Apple’s move to Mini DisplayPort on the unibody MacBook and MacBook Pro line has caused me a fair amount of consternation regarding upgrading given that my [Dell 3007WFP-HC](http://accessories.us.dell.com/sna/productdetail.aspx?c=us&l=en&s=dhs&cs=19&sku=222-7175) only supports dual-link DVI and Apple’s $100 [Mini DisplayPort to Dual-Link DVI Adapter](http://store.apple.com/us/product/MB571Z/A) has gotten quite a lot of bad press with respect to its stability. Last year [Michael Tsai](http://mjtsai.com/blog/2009/03/06/macbook-pro-mini-displayport-dual-link-dvi/) wrapped up the the current state of affairs quite well:

The current state of affairs is that:

  • The software update is not yet available, and Apple has no estimate of when it will be.
  • Nobody sells a 30-inch display that can directly connect to a Mini DisplayPort.
  • Dell makes a 30-inch display with a full-size DisplayPort, but (as far as I know) there is no adapter to connect it to a Mini DisplayPort.

As I happily type this post on a new Core i7 MacBook Pro connected to my 3007WFP via the adapter I’m happy to say that this issue with the [adapter]((http://store.apple.com/us/product/MB571Z/A)) appear resolved and I thought I’d issue a short public service announcement letting others know. I’ve had not a single issue and have spent considerable time with the monitor connected directly to the adapter as well as through my [IOGEAR GCS1782 2-Port Dual-Link DVI KVMP Switch](http://www.newegg.com/product/product.aspx?Item=N82E16817399033). Also, Circuit Assembly now makes a $13 [DisplayPort to Mini DisplayPort adapter](http://estore.circuitassembly.com/products/Mini-Displayport-to-Displayport-Adapter-Cable.html) that Jon is quite happy on his [Dell 2408WFP](http://www.dell.com/us/en/dfo/peripherals/monitor_2408wfp/pd.aspx), which supports DisplayPort.

Folding towels

“Autonomously folding a pile of 5 previously-unseen towels.”

Some Foursquare Badges I’d Like to See

Don’t get me wrong, Foursquare is a fun little social network and beautifully adapted to the iPhone platform. But their points system incentivizes some activities that I think are detrimental to the environment as a whole.

So in the interests of making things more awesome, I’ve designed some Foursquare Badges intended to shame users into more appropriate behaviors:

A must-have if the Boston Top 10 is any indication.

You’re checking into the venue “Phone Booth in front of Whole Foods” from your cell phone?

Obviously, Foursquare would have to add a relationship status for this to work.

For the Mayor of your local “Starbucsk Coffee”.

Make friends with Cosmo on Foursquare and buy some shirts or mugs featuring these sweet badges.

Highway Gothic is the New Helvetica

Unless you’ve been living under a rock for the past few years, you know Helvetica. It powers your iPhone. It makes your Jon Shea’s underpants. It fills out your wedding registry.


But as a typeface designed for neutrality—used unironically in tax forms and corporate media for decades—Helvetica’s current rebirth as a “hip” marketing tool almost certainly has a shelf life. And with bad tv and so-so cinema leaning heavily on the typeface to establish branding, I’d say we’re already looking at the beginning of the decline.

So what’s the next trend in the world of typograhpy? Take a look up during holiday travel this season and you can’t fail to miss it: the FHWA Series fonts, and the innumerable spin-offs they’ve inspired.

Don’t believe me? How do you think satellite radio monopolist XM is reminding everyone that they’re the future of audio communication?


And if you’re looking for a light, hip web publishing platform that redefines the nature of the blog, here’s the first thing you see:


Even Southwest Airlines, one of the most obvious competitors to the Interstate Highway System, is using the typeface to let travelers know that their bags fly free:


I can’t say why highway fonts are experiencing such a marketing revival. When legibility and quick transfer of information are not a priority, the typefaces are rather homely, with their chopped ascenders and bloated x-heights giving them a stubby, pot-bellied look.

It could be the same instincts of subversion and reinvention among designers that put Hevletica back on the marquee. Or perhaps it’s an attempt to tap America’s nostalgic association of the open road with change, freedom, and adventure.

But whatever the ethos behind it, it’s clear the long-overlooked FHWA style is making a comeback in advertising. If Helvetica is the best way to say “everyone else is doing it”, Highway Gothic is the best way to say “everyone else is doing it wrong.”

Awesome MediaWiki Bug

Poor, lonely <font>. You were irritating to use, and so you were kicked out of the treehouse in favor of stylesheets by HTML 4.01. But cheer up <font>; you can still be extremely annoying! Just try a Wikipedia vanity search, with a few of your pedantic modifiers thrown in for good measure—let’s use <font face=cursive size=50>:

Not only that, <font>, but your old and even more annoying buddy <table> is back in the game, too. And when you two team up,  there’s almost no limit to the amount of carnage you can create:


This works across browsers, though there are obvious differences in how they render the horribly mangled code these querys will produce. It’s the best lesson in input santization since since Little Bobby Tables.

If you’re good, you can theoretically purpetrate some serious mayhem with this bug—and considering how widely MediaWiki is used around the web, that could be a real problem.

In reality, though, the trickery is probably limited by the abilty of your dirty, dirty inputs to generate search results; without those, it looks like most of your code modifications get cancelled.

That having been said, I endorse using this exploit only for your own personal amusement, not serious destruction. You have been warned.

Revisionism at its Finest

James Iry posted a really amusing “history” of programming languages over on his blog, One Div Zero. I laughed till I cried. He bills it as “mostly wrong,” but he’s not far from the truth.

Just for a taste, here’s one of my favourite quotes from the History

Haskell gets some resistance due to the complexity of using monads to control side effects. Wadler tries to appease critics by explaining that “a monad is a monoid in the category of endofunctors, what’s the problem”

Good times

cd to git_root

When I’m wailing on a project in bash, I frequently find myself wanting to cd back to the project root. Since we use git, this is the same as the git_root directory. So I wrote a bash function that looped through the directories in the current path and found the one that contained the .git/ directory.

Luckily, I thought to ask on #git if there was an easier way before I posted my script (because no one likes to look like a noob on their own blog). It turns out there’s a one liner. I’ve posted it here, with a little padding so that I can feel like I made a contribution.

function gr {
    ## If the current working directory is inside of 
    ## a git repository, this function will change
    ## it to the git root (ie, the directory that 
    ## contains the .git/ directory), and then print
    ## the new directory.    
    git branch > /dev/null 2>&1 || return 1
    cd "$(git rev-parse --show-cdup)".

Why The TUAW Dell Mini 9 Road Test is a Fail

Normally, I try to keep a strict “do not feed the trolls” policy, but I’m not above a good Internet fight now and again. And let me tell you, TUAW’s “Road Test” of an OS X hacked Dell Mini 9 is certainly bad enough to risk a few punches over.

“My first real work with the mini 9 began in November, when I decided to acclimate myself to its diminutive keyboard by using it during NaNoWriMo (National Novel Writing Month) to work on a novel.”

Fantastic test case for a computer designed for mobility and web access—a monumental, offline task involving hours of ass-in-chair typing. The reason people still fetishize the heavy, zero-connectivity Smith-Corona for this task is because it’s nearly perfect for it.

And yes, I have written a novel, so I would know.

“Sure, it worked for a little bit, and then began to irritate me when the gestures would fail. I decided to use a cheap micro-mouse instead, which meant that two of the USB ports were now filled — one with the cable for the mouse, and the other for the Sprint wireless broadband dongle that I use when I’m on the road.”

So wait—that’s three USB ports, which is one more than any but the most expensive Apple-branded laptop. The laptop I own only Mac laptop I can afford has only two, and since I’m stuck with the early 2006 model, other than two-fingered scroll, none of the mouse gestures work, either.

“My fingers felt like they were tripping over each other when I was typing, to the point that I found that I was actually taking longer to type emails on the mini 9 than it took me to tap them in on an iPhone!”

The choadiness and inaccuracy of my fingers is a matter of record. I’m typing this on a Mini 9, right now. Not suffering. Quotation marks are a pain. They are infinitely worse on the iPhone—the author could at least learn to lie plausibly.

“16GB is not enough capacity to load an OS, a complete office suite, and actually do some work.”

I’m sorry if this guy couldn’t run the Mail Merge Wizard, but no one I know wants a netbook so they can use Office. If you’re seriously writing blog posts in Word or coding pages in Dreamweaver, there are tons of fastlight, and awesome text editors, writing programs, and blogging tools out there for OS X. Can’t store all your music? Put it on a server and mount it with ExpanDrive. Even Photoshop has lighter alternatives.

Once the OS is on (and it fits on 8GB machines), hard drive space should be a non-issue. If not, you’re doing it wrong.

“Next, the limited screen resolution (1024 x 600) of the mini 9 made it virtually impossible to use some Mac apps that have default minimized screen sizes that are larger than that. Those apps simply had to be removed from the device, and I was stuck with a somewhat crippled hackb00k that didn’t have the software tools I normally use.”

What tools? The author is completely non-specific in what he could and couldn’t do, which is infuriating behavior for a reviewer. It’s not like he’s just avoiding brand names—aside from basic text entry, he fails to name even the tasks he attempted to carry out. How is this supposed to be helpful to anyone?

Some solutions do exist to keep peace in the battle between windows and screen space. That having been said, a netbook is “somewhat crippled” by definition. Anyone conisdering a Mini 9 needs to take careful stock of what exactly they intend to do. For broswer, mail, text editing, writing, blogging, and IM, I’ve got no beefs.

I don’t mean to belittle the author of this piece, but even his solutions are ridiculous. The 25,000 iPhone apps he cites are nothing even close to what a netbook brings you. Terminal, real SSH, multitasking, a little thing called root access, and gobs of other critical real-world features are all still only available on jailbroken phones—and I wouldn’t expect Apple to change that anytime soon. Let’s not even mention the AppStore’s strict and largely arbitrary acceptance protocol.

The sort of hybrid touch device he suggests is similarly inapplicable to this situation. It would cost far more than regular laptop, and be at least as large and cumbersome. When low cost and small size are the only reasons anyone would ever buy a netbook, I can’t see how this product would fill a similar niche.

The OS X hackbook appeals to hardscrabble, substance-over-style users who value stripped-down, efficient tools. The author of this post owns a MacBook Air, which, with its ludicrous debut price and limited features, is the epitome of all we hate about Apple. Working with a Mini 9 doesn’t live up the Jobsian Ideal, but for those of us who can manage sleeping on a bed with fewer than four pillows, it’s a Mac by any other name.

OS X is a phenomenal work environment. I’d never chose to use anything else. But for way too long, it’s been chained to machines that are, if not overpriced, certainly a financial hardship. The ability to elude this monetary burden, combined with optimized portability, is a fantastic thing—and you shouldn’t need to be the World’s Toughest Writer to appreciate that.

Older Posts

Page 1 of 2