Archive

Posts Tagged ‘reading’

Clearing out my bookcase

November 9th, 2006

(or, more accurately, 6 bookcases…)

I’m going to be moving soon, and I’m not looking forward to trying to move all my books. So, as part of a general clean-out, I’ve decided to give lots of my books away on BookMooch.

For those who don’t know it, the site operates on a really simple premise: you give away your books – other people give you books in return. There are a few more rules than that, but not very many. I’ve been using it for a few months, and it works really well.

I’ve about 175 books listed so far, and I’m still finding more in boxes that never even made it as far as my bookcases last time I moved six years ago. Let’s see how many I can get rid off before I need to box them all up and move them again…

Tony

The MBA Reading List

November 23rd, 2005

Joel has posted the initial draft of his Management Training Reading List, with 75 “must read” books on general business, software management, and corporate biography.

I think I’ve read 42 of the 75, and some of the others certainly look like I should read them. But I’m not going to aim for the 75 – I have no real interest in reading a book on Subversion, for example!

The inclusion of a Corporate Biography section is interesting, as these are generally underrated amongst the tiny subset of geeks who actually read business books. And although Joel claims these are “every worthwhile history of a software/computer company that we can find”, he also includes the history of Ben and Jerrys! I’m not entirely sure why this one is there. It’s certainly an interesting story, but if you’re going to step outside the technology sphere, then there are lots of other interesting choices.

Anyway, here are 25 books he’s missed to round it up to neat 100:

(Disclaimer, most of this is from memory, and from my bookshelves at home. A lot of my books are in the office, so I’ve probably forgot a lot of obvious things!)

Tony

MT Amazon Reading List

November 11th, 2004

I’ve been asked which plugin I’m using to generate my “reading list” over on the sidebar. Like any true geek, of course, I actually wrote my own. Of course I’m generally into reuse where possible, but I wanted to learn how to write MT plugins, and it seemed like a good place to start. It also helped that I didn’t like any of the 3rd party plugins out there for this. There are probably much better ones available now. Mine also isn’t very good, but it’s part of a bigger plan…

Over the last year or so I’ve gradually been drinking the semantic web kool-aid. I’m sure I’ll rant more about this later, but I don’t believe it’s going to happen the way most people have been pushing for it, but I’m now convinced that it’s going to happen.

Of course I’m part of the problem for making it happen, as I’m a data geek. I collect structured information. My friends laugh at the fact that I could run queries to tell you how much I’ve spent on milk in the last year, but I find the information useful. (Well maybe not that information, exactly, but the general principle of being able to analyze my spending…)

Unfortunately most of the people wanting to make the semantic web happen are also data geeks who believe in structured information, even though the vast majority of the world aren’t. This is a very big problem for traditional semweb thinking, but I no longer think it matters very much.

But, in the meantime, I want to do stuff with my structured information. Such as the list of books I’ve read.

The first problem was how to store them. I’m reasonably well known to be a database guy. I also have a simple framework for building simple web apps to manage databases, so I considered building one for managing my books. But that seemed like too much hassle for now – I really wanted to just edit a file when I started reading a new book.

Faced with this problem, most techies these days seem to instinctively reach for XML. Personally I can’t stand it. I really hate how verbose it is. Unfortunately a large part of the Semantic Web work is also based around XML. Theoretically you can express your RDF in other ways, but really almost everyone is using XML. This used to bother me as I thought I’d need to do this, but now I believe that the more obscure and arcane we can make this stuff the better, as then everyone will want tools to do it, and only masochists will end up doing it by hand.

So for my books I, instead, reached instinctively for YAML. I thought for a while about what information I’d want to store, before realising that I was much too lazy to want to type any information that could be found elsewhere. So my YAML file really just includes the ISBN of the book, and the rough date that I read it. Of course I don’t usually read a book in one day – I quite often read 4 or 5 books simultaneously over a period, just to get an interplay of ideas happening. And there are lots of books I start, read about half of, and don’t get round to finishing for months, or sometimes even years (if at all). I spent a while trying to find a sensible way to model that, before deciding it was all much to complex, and I’d be happy enough with just entering a rough date.

So I ended up with a very basic YAML file:

---
books:
 
   - isbn    : "0596007515"
     title   : "Ggl Hacks"
     date    : "2004-11-01"
     current : 1
 
   - isbn    : "0439977789"
     title   : "Ruby / Smoke"
     date    : "2004-11-01"
 
   - isbn    : "075093204X"
     title   : "Decline and Fall Everybody"
     date    : "2004-10-09"

The ‘title’ field is there just as a placeholder to aid human readability. It never actually gets used anywhere, so I can fill it with shorthand etc. The ‘current’ field is for books I’m still reading. This is my token concession to the “I started this a month ago but haven’t finished yet” problem.

The next phase is to turn that into a more detailed YAML file that includes proper titles, Amazon links, cover URLs etc.

I have a small perl script to do that:

#!/usr/bin/perl
 
use strict;
use warnings;
 
use YAML;
use Net::Amazon ();
use Cache::File ();
 
my $yaml = YAML::LoadFile(shift || "reading-yaml.txt");
my @out = map expanded_data($_), @{ $yaml->{books} };
print Dump { books => \@out };
 
sub expanded_data {
  my $book = shift;
  my $property = get_book(sprintf "%010s", $book->{isbn});
  return {
    %$book,
    isbn  => sprintf( "%010s", $book->{isbn} ),
    title => $property->title,
    img   => $property->ImageUrlSmall,
    url   => $property->url,
  };
}
 
BEGIN {
  my %amzn_opt = (
      token        => "MY_AMAZON_KEY",
      affiliate_id => "tmtm-20",
      cache        => Cache::File->new(
        cache_root      => '/tmp/amzn_cache',
        cache_umask     => 000,
        default_expires => '30 day',
      ),
  );
  my $us = Net::Amazon->new(%amzn_opt);
  my $uk = Net::Amazon->new(%amzn_opt, locale => "uk");
 
  sub get_book {
    my $isbn = sprintf "%010s", shift;
    my $resp = $uk->search( asin => $isbn );
    $resp = $us->search( asin => $isbn ) unless $resp->is_success;
    die "Can't find $isbn" unless $resp->is_success;
    my ($property) = $resp->properties;
    return $property;
  }
}

It simply reads in my raw book file, uses Amazon Web Services to look up more data about the books, (storing the data in cache for 30 days to speed the whole thing up on later runs), and throws out a new YAML file with more fields. Amazon US has slightly more likelihood of having cover scans, so I check it first falling back on the UK if there’s no results there. I pick up a lot of my books in the US anyway, so it isn’t that much of an issue, although I occasionally a different cover from the one that I have.

Then I have a simple MT plugin, called mt-reading.pl which I drop straight into my MT/cgi-bin/plugins/ directory:

package MT::Plugin::ReadingList;
 
use lib '/usr/local/MT/cgi-bin/lib';
 
use MT::Template::Context;
use Data::BookList;
 
MT::Template::Context->add_container_tag(
  ReadingList => sub {
    ( my $ctx, $args ) = @_;
    my $builder = $ctx->stash('builder');
    my $tokens = $ctx->stash('tokens');
 
    my $yaml_src = $args->{src}
      or return $ctx->error("No YAML source file specified.");
 
    my $list = Data::BookList->new($yaml_src)
      or return $ctx->error("Invalid YAML source file");
 
    my $content = "";
    for my $book ( $list->reading_list($args) ) {
      $ctx->stash( book => $book );
      $content .= $builder->build( $ctx, $tokens );
    }
    return $content;
 
  }
);
 
MT::Template::Context->add_tag(
  ReadingListBook => sub {
    my $book = shift->stash('book');
    my $args = shift || {};
    $book->{cover} ||= sprintf qq{<a xhref="%s" mce_href="%s" ><img
      border="0" alt="%s" xsrc="%s" mce_src="%s" /></a>},
        $book->{url}, $book->{title}, $book->{img} || "";
    return exists $args->{display}
      ? $book->{ $args->{display} }
      : $book->{cover};
  }
);
 
1;

This simply adds two new tags ‘ReadingList’ and ‘ReadingListBook’ that I can add to my MT templates, and have them expanded at build time.

So, in my template I include something like this:

<p>Recent Reading</p>
<div class="book">
  <MTReadingList src="/path/to/reading.yaml" lastn="9">
    <$MTReadingListBook display="cover" $>
  </MTReadingList>
</div>

The only remaining piece is the Data::BookList module, which is a simple ‘load the data from YAML, and return whichever ones I want’:

package Data::BookList;
 
use strict;
use warnings;
 
use YAML;
 
sub new {
  my ($class, $src) = @_;
  my $books = YAML::LoadFile($src) or return;
  bless { _booklist => $books->{books}, }, $class;
}
 
sub reading_list {
  my ($self, $args) = @_;
  my @books = @{ shift->{_booklist} };
  if (exists $args->{current}) {
    @books = grep $_->{current}, @books;
  }
  if (exists $args->{lastn}) {
    @books =
      (sort { $b->{date} cmp $a->{date} } @books)[ 0 .. $args->{lastn} - 1 ];
  }
  return @books;
}
 
1;

This allows me to ask for only ‘current’ books and/or the ‘lastn’ books: currently 9 for my blog. I plan to add more features here later, but for now this does what I need.

In some ways this is all over-complicated if all I wanted was a ‘recent reading’ section on my blog. But I find the separation of concerns useful. Managing my raw data is distinct from fetching information about it, which is distinct from slicing that data up, which is distinct from presenting it on my blog. So, when I find an ontology for expressing all this in RDF I should really only to write a new presentation script.

Of course, in practice, the ontology will specify some fields that I don’t currently store, so I’ll probably need to also expand the amazon lookup code, and it’ll probably want me to do my dates differently, etc., but that’s the theory anyway!

Tony , , ,

California Bookstores

April 22nd, 2003

On the other hand, I’m happy to relate that the bookstores in Campbell still have lots of very comfortable seating, and managed to relieve me of much more money than the ones in Boston.

Tony

Boston bookstores

April 18th, 2003

Last time I was in Boston I ranted about how all the bookstores have been gradually removing all their armchairs, and generally becoming much less nice places to just hang out and read all the books.

It’s gotten worse. Last time, the Borders in the Cambridgeside Galleria had moved almost all its comfortable seats into the coffee shop, probably in an attempt to persuade people to at least buy some coffee if they’re going to sit and read the books. This time those seats are completely gone. I could only find 2 comfy seats in the entire shop, and of course the chances of getting one of those to sit in are pretty slim. I’d already selected about 8 books from the shelves before noticing this – and I’m sure I’d have bought at least 2 or 3 of them. Instead I set them all down on a table, and returned to MIT coop.

This is obviously a policy to try to cut down on people reading without buying, but in my case at least it’ll actually stop me buying too.

Tony

Article Depth

April 17th, 2003

I picked up a few magazines in the airport lounge yesterday to read on the plane, including Esquire, a magazine I used to read fairly regularly, but haven’t really read at all in a few years.

It seemed to have quite a few interesting articles, including an interview with Martin McGuinness, and an investigation into why the British still have such a fixation on World War II.

But neither of these articles, nor in fact anything in the magazine, turned out to have any depth whatsoever. I guess I’ve just become to used to magazines like the New Yorker where most of the articles turn out to be interesting, even if they’re on topics I wouldn’t normally have any interest in whatsoever.

Tony

The Decline of Harvard Coop

January 16th, 2003

I used to be a big fan of Harvard Coop. Any time I’d be in Boston, I’d end up spending quite a lot of it just sitting in the Coop reading. Each day I’d walk around, pick up a pile of maybe 8-10 books, find a comfortable seat, and gradually divide them into 3 piles – those that looked interesting on the shelf, but really aren’t; those that I’ll definitely buy; and those that I’m unsure about, or that I’m keen to read some of, but probably not to buy. And I’d usually end up buying 10-20 books on an average trip to Boston.

When I was in Boston again last summer, I noted with dismay that the comfortable seats on the middle floor had vanished. There were still the two in the basement, and a couch on the top floor, but the middle floor now just had the hard seats at tables, and those in the coffee shop area. Today I noted with even more dismay that the entire top floor is now also hard seats. The only comfortable seats remaining are the two in the basement. Which of course means that there’s virtually no chance of actually getting one. And as a result I spent much less time there than usual and only bought 2 books.

MIT Coop still has 4 comfortable seats by the window, so I can sit there and read OK. And the Borders downtown still has quite a few (although they’ve been rearranged in a very strange configuration). So these will now be getting more of my trade. (The Barnes and Noble downtown is terrible…)

I read somewhere once that Barnes and Noble were trying to position themselves as an alternative to the library, rather than other bookstores.
But I’m wondering if in general there’s a move away from the “our bookshop is really comfortable; come sit here all day and read our books” type of approach.

Tony ,

Big Brother isn’t watching

October 7th, 2002

Old George Orwell got it backward. Big Brother isn’t watching. He’s singing and dancing. He’s pulling rabbits out of a hat. Big Brother’s busy holding your attention every moment you’re awake. He’s making sure you’re always distracted. He’s making sure you’re fully absorbed. He’s making sure your imagination withers. Until it’s as useful as your appendix. He’s making sure your attention is always filled. And this being fed, it’s worse than being watched. With the world always filling you, no one has to worry about what’s in your mind. With everyone’s imagination atrophied, no one will ever be a threat to the world.

– Chuck Palahniuk, Lullaby

Tony

When is the winter of our discontent?

October 1st, 2002

‘Welcome, all your Will-loving R3 fans, to the Ritz at Swindon, where tonight (drum roll), for your DELECTATION, for your GRATIFICATION, for your EDIFICATION, for your JOLLIFICATION, for your SHAKESPEARIFICATION, we will perform Will’s Richard III, for the audience, to the audience, BY THE AUDIENCE!’

There was a moment’s pause and then the curtains reopened, revealing Richard at the side of the stage. He limped up and down the boards, eyeing the audience malevolently past a particularly ugly prosthetic nose.

‘Ham!’ yelled someone at the back.

Richard opened his mouth to speak and the whole audience erupted in unison:

When is the winter of our discontent?’

Now,’ replied Richard with a cruel smile, ‘is the winter of our discontent…’.

A cheer went up to the chandeliers high in the ceiling. The play had begun. Richard III was one of those plays that could repeal the law of diminishing returns; it could be enjoyed over and over again.

‘… made glorious summer by this son of York,’ continued Richard, limping to the side of the stage. On the word ’summer’ six hundred
people placed sunglasses on and looked up at an imaginary sun.

‘… to the lascivious pleasing of a lute …’ continued Richard, saying ‘lute’ loudly as several other members of the audience gave alternative suggestions.

‘I that am rudely stamp’d…’ muttered Richard, as the audience took its cue and stamped the group with a crash that reverberated around the auditorium.

The production was the only show at the Ritz; it was empty the rest of the week. Keen amateur thespians and Shakespeare fans would drive from all over the country to participate, and it was never anything but a full house. A few years back a French troupe had performed the play in French to rapturous applause; a troupe went to Sauvignon a few months later to repay the gesture.

‘… and that so lamely and unfashionable, that dogs bark at me …’

The audience barked loudly, making a noise like feeding time at the dogs’ home. Outside in the alley several cats new to the vicinity momentarily flinched, while more seasoned moggies looked at each other with a knowing smile.

They went on, the actors doing sterling work and the audience parrying with quips that ranged from the intelligent to the downright vulgar.

The play was the Garrick cut and lasted only about two and a half hours; at Bosworth fields most of the audience ended up on the stage as they helped re-enact the battle. Richard, Catesby and Richmond had to finish the play in the aisle as the battle raged about them. A pink pantomime horse appeared on cue when Richard offered to swap his kingdom for just such a beast, and the battle finally ended in the foyer…

— Jasper Fforde, The Eyre Affair.

Tony

Them: Adventures With Extremists

May 6th, 2002

I spent most of the last few series of The Mark Thomas Product wondering just how far he’s going to have to go before someone actually kills him. This book provokes the same reaction.

The cover sums it up better than I can: Is there really a secret room from which a tiny elite rules the world, and if so, can it be found? Them: Adventures with Extremists is a romp into the heart of darkness involving twelve-foot lizard-men, PR-savvy Ku Klux Klansmen, Ian Paisley, Hollywood limousines, kidnapped sex slaves, David Icke, and Nicolae Ceausescu’s shoes. While Jon Ronson attempts to locate the secret room, he is chased by men in dark glasses, unmasked as a Jew at a Jihad training camp, and witnesses CEOs and leading politicians undertake a bizarre owl ritual in the forests of northern California.

I’d read the Ian Paisley section of a few years ago in the Independent magazine, so I had a good idea of what to expect, style-wise: a dark humour, more from letting the subject of his writing speak for themselves, rather than actually satirising them directly – Louis Theroux style. However, I hadn’t realised how connected the entire book would be: I was expecting a series of similar unrelated tales of encounters with other figures. Instead this book is more of a travelogue as Ronson tries to discover whether or not the Bilderberg Group really rule the world. (The Paisley chapter is actually almost out of place). The story is wonderfully told, although surprisingly sympathetic towards many of the characters.

There was apparently an accompanying Channel 4 series that I really need to see now…

Tony