book review: The Angel’s Game

Carlos Ruiz Zafon is a talented writer and a miraculous self-promoter. The Angel’s Game — like The Shadow of the Wind — will leave you convinced that you’ve read a better book than you have. But that doesn’t mean you shouldn’t read it.

In the case of TAG, the approach is fairly straightforward. Ruiz Zafon reverentially invokes the institution of Literature in all its forms, from a refuge for the young; to the pretentious journalistic elevation of copyediting into a sacred crusade; to the fucking smell of books; to the invocation of Dickens to canonize the institution of the blood- and melodrama-soaked potboiler.

This is all fine so far as it goes. Its real purpose is to telegraph what’s about to come — to create a theology of letters in which pulp holds a place of esteem no less dignified than nominally loftier stuff. Ruiz Zafon is going to give us pulp. He wants us to understand it to be exalted pulp.

I think this perspective is basically right. It reminds me of Michael Chabon’s essays insisting that literature can include acts of imagination, excitement, adventure and the fantastic. As I steel myself for this year’s Man Booker long list, it’s good to be reminded that “good” books don’t necessarily have to be about terminal illness and divorce.

Still, I do think that this framing is at least a little self-serving. Which is fine: Ruiz Zafon delivers a real page-turner, and ably adorns it with literary allusions and devices (albeit occasionally heavy-handed ones). The book has some problems with pacing, and the emotional pallette favors breadth over depth. But it’s pretty great entertainment, ably weaving together thrills, supernatural horror, sexual tension, tragic romance, satire, noir and light comedy.

But I do worry that I will remember that this book is good more than I’ll remember what the book is about. That’s certainly the case with The Shadow of the Wind — I remember where I read it, I and I remember liking it, but I remember terribly little of the book itself, which is pretty unusual for me. Perhaps TAG will fare better.

book review: Foucault’s Pendulum

Eh. It’s clever, writing a book like this one as a follow-up to his own debut. Diving headlong into mystic Christian conspiracy theories, Eco cleverly parodies himself while leveling a broader critique against the human temptation toward gnosis and syncretism. The action surrounding our main characters is also pretty fun.

But the damn thing’s just way too long. Eco tells us over and over again that these imagined connections are meaningless, which makes it difficult to wade through hundreds of pages of historical arcana. By the end, exhaustion had distracted me from his characters’ stories and struggles. A decent editor could have made this great. As it stands, Eco can’t resist the temptation to show off, whether through his own (always modestly disclaimed!) flights of historical fancy, or with inserted experimental fiction that left me cold.

As a sidenote: it was legitimately fascinating to see so much occultism cleanly laid out. I found myself wondering if Mike Mignola used this as a blueprint for his Hellboy universe or if the grail conspiracies are just well-established. But it’s all there: the Templars, Ultimate Thule, Aggartha and on and on…

book review: Nemesis

Pretty brutal. I’m ashamed to admit this is the first Roth I’ve read — my mom sent this to me — but based on his reputation and my sense of the book, it’s hard for me to imagine this is among his best.

The problem is really just length. Roth wants to throw together some research about summer camp and polio and musings about theodicy. The polio asserts itself through the decimation of various basically interchangeable children surrounding the protagonist, who’s a youth educator. But he’s a flat and boringly noble character, devoid of psychology aside from overdeveloped senses of duty and guilt. These ensure that polio will destroy him utterly, even after the crisis of the epidemic has passed. And that could could be interesting.

But instead of that tragic flaw’s artful revelation, the dynamics of it are dumped on us by the narrator in the book’s last ten pages. It feels rushed and unnecessary. Those ten pages are solid, and include this gut-punch about bitterness:

“I’ll never be me as I was me in the past. I’ll be this instead for the rest of my life. I’ll never know delight again.”

Oof. Preach. Anyway it’s more of a sermon than anything else.

Still, great prose and a quick read. It’s really just a novella, though. Could easily have been a proper novel but you get the feeling the author’s heart wasn’t in it.

book review: Alif the Unseen

Though not totally meritless, it’s safe to say this was not a favorite of mine. I had two primary objections.

First, Becks got it about right when she said “I’ve never read a book that got technology as wrong as this.” Much of the technobabble reads like this Onion article. It’s gibberish — nonsense that’s clearly been passed by a technologist for vocabulary-correction, but which is conceptually empty. I can usually forgive this (though after been recently treated to the very high technical standards of Cory Doctorow’s work, I’m less inclined to do so that I used to be). But in this case the nonsense is used both to define the various maguffins that drives much of the story and to provide the too-tidy resolution that our protagonist drops in the climax. And where the hell did Wilson get the idea that overloaded computers can melt? It’s completely laughable.

Second, I was pretty uncomfortable with the book’s politics. I have complaints about the facile approach to political unrest — the restoration of mobile broadband is treated as if it’s the same thing as a popular uprising’s successful conclusion. But these are superficial compared to my discomfort with Wilson’s sympathy for Islamist counterpoints to the repressive secular state that employs the book’s villains. I’m very ready to admit the beauty, wisdom and historical richness of muslims’ faith. I’m less prepared to accept Wilson’s glib assumption of compatibility between her readership’s liberal cosmopolitan values and her religion’s ethics and politics. Of course the imam wouldn’t really object to popular music. Of course our plucky female lead wears her veil out of choice. I’m sure it’s right that this culture is misunderstood and often subjected to ignorant racism. But that doesn’t mean its attitudes toward women and personal liberty aren’t genuinely noxious. Wilson doesn’t ignore this completely, but she’s much too ready to retreat into mysticism when it comes up.

I understand Wilson to be a convert to Islam herself (married to an Egyptian man) so I don’t want to accuse her of cultural ignorance, or to underestimate the difficulty of reconciling her identity and values with the religious culture she’s chosen. I’m sure that’s been a difficult and very personal process, and one that I have no right to criticise. But, speaking purely as an outside observer, the philosophical gymnastics that seem to be required don’t survive the translation to the page. Frankly, she’s got some nerve to snipe at western fiction for its substantive bankruptcy. Her work ignores those depths.

OK. Enough of that. What’s good about this book? Well, Wilson’s a comic book writer (I suspect this explains a bunch of the silly GR Stephenson comparisons that Becks notes). She has a talent for keeping the action moving and for letting her imagination stretch to interesting locales, characters, scales. They don’t always feel fully sketched-out — perhaps she’s used to collaborating with an artist on that? — but she does often succeed. I particularly enjoyed the inclusion of the djinn, even if the narrative bridge constructed to them — the Alf Yeom — didn’t really make much sense.

Still, I don’t think the book succeeds. The scaffolding’s there (though it’s at least one act too long), but the foundation’s incoherent. Not recommended.

book review posts incoming

I haven’t figured out a decent way to automate this, it turns out. Maybe I’ll write a Goodreads WordPress plugin.

Italo Calvino on the lifecycle of social networks

In Ersilia, to establish the relationships that sustain the city’s life, the inhabitants stretch strings from the corners of the houses, white or black or gray of black-and-white according to whether they mark a relationship of blood, of trade, authority, agency. When the strings become so numerous that you can no longer pass among them, the inhabitants leave: the houses are dismantles; only the strings and their supports remain.

From a mountainside, camping within their household goods, Ersilia refugees look at the lbyrinth of taut strings and poles that rise in the plain. That is the city of Ersilia still, and they are nothing.

They rebuild Ersilia elsewhere. They weave a similar pattern of strings which they would like to be more complex and at the same time more regular than the other. Then they abandon it and take themselves and their houses still farther away.

Then, when traveling in the territory of Ersilia, you come upon the ruins of the abandoned cities, without the walls which do not last, without the bones of the dead which the wind rolls away: spiderwebs of intricate relationships seeking a form.


adding Airplay to a Sonos with Raspberry Pi

I mostly like my Sonos system. The downsides: I had a controller die on me out of warranty; it’s a bit pricey; and it doesn’t have Airplay support. This last one, at least, turns out to be fixable, thanks to a few open source projects and the Raspberry Pi.

The ingredients:

This last one is important for making the Sonos start listening to its line-in when Airplay begins to be used.

Getting your Raspberry Pi on your wifi network is a bit of a pain. You’ll need to compile Shairport’s dependencies and install some modules from CPAN. SoCo’s doesn’t leave you with a working installation, but the codebase is fine if you use it directly.

With all the pieces in place, you just need a script like this to switch the Sonos:

import re, sys
from soco import SonosDiscovery, SoCo

def main():
    sd = SonosDiscovery()
    possible_matches = sd.get_speaker_ips()
    speaker_info = {}
    for ip in possible_matches:
        s = SoCo(ip)
            speaker_info[ip] = s.get_speaker_info()
        except Exception, e:
            speaker_info[ip] = {}
    for (ip, speaker) in speaker_info.items():
        if[1], speaker.get('zone_name', ''), re.I) is not None:
            s = SoCo(ip)

if __name__ == '__main__':

and then to start the Shairport daemon like so:

perl /home/pi/sonos-airplay/ -d -w /home/pi/sonos-airplay/ -l 100 --apname="Sonos" --play_prog="/home/pi/.virtualenvs/sonos/bin/python /home/pi/sonos-airplay/ bedroom"

This will call the script every time a new Airplay client connects.

For good measure, here’s the /etc/init.d/shairport startup file I’m using:

# /etc/init.d/shairport
case "$1" in
        echo "Starting Shairport Server for $PIUSER "
        kill `cat /home/pi/sonos-airplay/`
        echo "Shairport Server stopped"
        echo "Usage: /etc/init.d/shairport {start|stop}"
        exit 1
exit 0

It all works pretty well! The only real downside is the volume: Airplay’s pretty quiet. I should be able to automate the volume adjustment on the Sonos — SoCo exposes that functionality as well, and Shairport can call scripts upon client disconnect, too, to reset the volume. But I haven’t had a chance to write that yet.

Anyway, if folks start wandering in from Google and find this useful or desirable, let me know. I could probably make this all a bit more reusable without a ton of trouble (distributing a Raspberry Pi filesystem image might be the easiest thing, really).

UPDATE: Hmm. Subsequent investigation of the Sonos’s line-in level adjustment capabilities reveals that the SoCo portion of this might be unnecessary: there is indeed some capacity for adjusting amplification on the line-in. Better still, there’s some sort of line-in activity detection! I think I might stick with my script anyway: I have a Sonos unit on the porch that’s usually powered off; I’ll probably just adjust the script’s logic to pipe the line-in to it if it’s activated. Still, for most users the Shairport stuff should be sufficient.

pie charts are fine and you all need to calm down

I mean, yikes.

So look. I’m obviously no designer. And I agree that the pie charts in that blog post, which are clearly cherry-picked for maximum terribleness, are terrible.

But usually pie charts are fine. I’m not going to bother collecting examples that demonstrate this, because unless you’ve led an unusually brief or interesting life, you’ve seen thousands of them and understood them perfectly well.

But I realize this isn’t going to stop you. You have been to the Seminars. You have received the Texts. You have studied the words of the Prophet Tufte, and you have concluded that they demand jihad. I’m not going to convince you otherwise.

I’ll make my case anyway.

To me, pie charts are handy for conveying information about the relative components of a whole because they do so through visual cues of both area and angle. If you need to show the relative sizes of multiple wholes, you can do that by varying the pies’ size! Fun times, but I suppose it’s not for everyone.

But I would like to request that you not join the pie-haters I sometimes see advocating for donut graphs or treemaps as alternatives. These have all of the problems of pie charts, but they throw away one of the two visual cues. (Treemaps can be useful for expressing hierarchies, and donut graphs are useful for… er. Well. Sometimes you can put a number in the middle of them!)

If your graph is confusing, it’s probably a bad graph and you should try to make a different one. But let’s not pretend that there’s a Platonic Graph that we’re working toward just because some dweeb in an eye-tracking lab eked out a few milliseconds’ worth of statistical significance. Real graphs used for Science usually look like this (to be honest, even that red line is a bit decadent). It’s not great, but it gets the job done. Science is pretty much going fine despite a lot of shitty-looking graphs.

If you ask me (you haven’t) presenting information is about tradeoffs. I don’t really want to spend all day looking at things that are ugly, and that’s okay. Nicely designed graphs are pleasant! People like to look at them, which is important if you want people to look at your graphs. Even if you really think pies are inefficient, you’re kidding yourself if you think graphs are always purely made to shoot numerical truth into your readers’ brains (when was the last time you adjusted the stroke weight on an error bar?).

People have varying tastes. That’s a totally legitimate rationale for hating pie charts. And they’re not the best choice for everything. I’m on board with that, too.

(Building part of your self-conception around the fanatical endorsement of the work of the one widely-known name in information design is, I would suggest, a little sillier. But whatever floats your boat. I went through a big anime phase in college, for instance.)

Anyway: pie charts. All I really ask is that you please shut up about them.

lasercut fingerjoint enclosures; pictures & code

My last laser-cut finger-joint project (and the electronics inside) was meant to be a time machine, an emergency device, a way to bend reality. Also, it was octagonal. These aims proved to be unrealistic. I did pull off the octagonal bit, but even that was a struggle.

Less fraught projects need enclosures, too, though, and I liked the technique. You can do some super-cool stuff with lasercut materials. Like 3D printing, it removes craftsmanship as an excuse for failing to instantiate the things you imagine.

But although laser-cut construction allows for much stronger and prettier materials than 3D printing, the process of translating from two dimensions to three is trickier than you might think. There are various considerations, from the variance of the width of the source material to the width of the path burned away by the laser (“kerf”). Accounting for these things in vector graphics editing programs can be quite tedious. It’s easy to make mistakes.

The right way to do this would probably be to write a plugin for Inkscape/Illustrator. But I’m more comfortable writing Python, so that’s what I did. I wrote up a support class that facilitates the creation of finger-joints, and which handles things like kerf automatically.

The output isn’t designed to be ready-to-print. You should plan to import it to a vector editor and do subsequent work. Here, for example, is the output of a simple script I used for my latest project: output

And here’s the EPS I constructed from it and submitted to Ponoko: output edited

Note the difference in the corners of the larger piece, in particular. Some editing is necessary. But the results are quite nice!

Lasercut box=great success. Design/code to follow.

(ignore those laser scorch marks; I haven’t pulled the adhesive paper side off yet, but when I do and flip the sides, the outside should be relatively pristine)

I’ve published the code, and would love to see it expanded into a more general-purpose toolkit. Apologies for its hackiness/non-pythonicness. I assure you it’s much better than the first two drafts. This version does matrix math and everything!

book review: Fortune’s Formula

As I began this book, I was disappointed. I had picked it up after reading The Idea Factory, the fascinating history of Bell Labs: Fortune’s Formula was mentioned glowingly in the acknowledgements. Bell Labs employees — including my favorite, Claude Shannon — taking a road trip to Vegas to use their reality-bending powers of analysis to defeat the casinos? Sign me up.

Digging in, the danger signs began accumulating. Poundstone’s prose is workmanlike at best. There are endless asides about the backgrounds of various mobsters tied to the gambling industry. And while Shannon’s trips to Vegas (to beat blackjack and roulette, it turns out) are exciting and ingenious, the man was smart enough to quit once his intellectual curiosity had been satisfied. This is no Bringing Down the House. Vegas fades from the scene by the book’s halfway point.

But this is where Poundstone’s project becomes clear. His language loosens, his transitions from explanation to narrative become more fluid, and he starts calling people dopes. He enters his element, and embarks on the effort that excites him. Poundstone is not just fleshing out a fun Bell Labs footnote; he’s telling a story about arbitrage and the modern finance industry.

In particular, he’s telling the history of the Kelly Criterion, an asset allocation formula — aka betting system — mathematically proven to maximize returns over the long run, given reinvestment of winnings and quantified odds. The story of the Kelly Criterion is interesting enough. Its foundations are rooted in Information Theory, the field Shannon singlehandedly invented, in part through the revelation that information works by reducing uncertainty — and what is a gambler’s edge if not a reduction in uncertainty? It’s also fascinating to learn that despite its mathematical soundness, the Kelly Criterion apparently remains a subject of fierce debate, largely rejected by economists, finance experts and business schools thanks to a combination of practical, intellectual and cultural reasons (that it was invented by information theorists, not economists, doesn’t help its cause).

But this book is about more than that. Poundstone mounts an implicit but still quite damning case against the modern finance industry. It’s not just the slight seediness of mathematical concepts invented for roulette translating smoothly to Wall Street; it’s the gangsters we were introduced to in the book’s opening chapters make the trip, too, swept along by a conscious legal strategy (going legit) into a new form of gambling. By the time a young prosecutor named Rudolph Giuliani discovers he can use RICO, a law designed for the mob, to go after titans of finance, the story has become a fascinating moebius strip of money and risk. Is it a coincidence that Ed Thorp, the man who taught the world how to count cards, is also the analytic mind behind one of the first and most successful hedge funds in history?

Thorp comes out of this book looking like a singular genius, and a probably-ethical one, to boot. I’m convinced, but some suspicion is warranted — Poundstone seems to have gotten a lot of help from him in putting this book together. Still, the man’s record of returns and lack of indictments speak for themselves.

Aside from the Kelly Criterion and Wall Street’s strange bedfellows, there are two important takeaways to be had here:

First, Poundstone does a number on the Efficient Market Hypothesis. I think he treats it fairly, explaining the views of its proponents, its intellectual heritage and the debates surrounding it with nuance — like Thorp, Paul Samuelson is portrayed as a brilliant and towering figure (I’m going to have to remember this trick of his — what an amazing dick move). The random walk is explained, as are investment strategies that can succeed despite the market’s unpredictability. Fees and common investor mistakes are acknowledged, and he allows no confusion about what a typical investor should do: buy an index fund and ignore anyone who tells you they can beat the market.

Still, by the end of the book it’s very hard not to conclude that a few ubermenschen walk among us — people like Thorp — who can consistently identify systemic pricing errors and develop ingenious ways to profit from them. The history of hedge fund tactics is explained, and of course it turns out to be built on these manipulations, from the warrant-based delta hedge to junk bonds to leveraged buyouts.

Before you ask: yes, Poundstone considers the survivor-bias argument at length. But I was still convinced that these techniques have worked — at least until they’re disclosed and the market begins pricing them in. EMH proponents tend to hand-wave toward this pricing-in happening with calculus-like instantaneity, but the actual history makes it clear that the process has sometimes taken months or years.

Second, and following from this, it’s hard to read Fortune’s Formula and not conclude that finance has evolved toward (and probably past) a point of uselessness — perhaps even destructiveness. Why does our society reward this kind of work? To provide better prices, they say, so that capital can be allocated more efficiently. The problem is that the process has no finish line. Arbitrage opportunities are discovered, profited from, and cease to exist; but Manhattan remains steadily expensive. So new arbitrage opportunities must be discovered or invented, via the sorts of exotic financial instruments that we’ve heard so much about these past years. But the low-hanging fruit is gone — the margins on these deals are tiny, so they have to be amplified through incredible amounts of leverage. The complexity of the system inevitably sometimes reaches a point where interdependencies aren’t fully realized — Poundstone makes this point by narrating the epic destruction of LTCM — and things blow up.

Fortune’s Formula was published in 2006. Poundstone doesn’t even need the Great Recession to make his point.

A few caveats. I’m not a great consumer of books about finance. I haven’t even read The Big Short. It’s very possible that these insights are less novel than they seemed to me.

But this book taught me quite a bit of history, more than a few financial concepts, and changed the way I think about investing/gambling/risk. I’m tempted to reread it, even if just to make sure I got the thrust of the early chapters right (if I’d known who Ed Thorp would become, I would’ve paid a bit more attention — I had heard the name before, but didn’t make the connection).

Highly recommended.