Archive for December, 2009

Advantages of electronic books

December 20, 2009

I’ve seen quite a bit of stuff lately dissing ereaders and ebooks and claiming that there is no way that this new newfangled technology would ever be embraced and that it was preposterous to call it a revolution.

Electronic books and their readers are a revolution, get used to it.

If the current crop of display technology is a little slow and dodgy, that will improve, and you won’t have to buy your library again. If the first breakout product is riddled with DRM, the followers will go DRM free as a point of difference (which has already started to happen).

There are numerous advantages to ebooks over paper books:

portability

All my books could fit on a couple of memory sticks. holy smokes. Moving house will be a gazillion times easier. I can have all my books with me at work, at home, and on the bus. and at conferences. and everywhere. holy smokes.

backups

I can keep multiple copies of my books spread around different places. This will keep me happy.

smaller carbon footprint

Not chopping down trees, not using nasty inks, not shipping books from the other side of the world

searchability

The ability to do a text search of all my technical books. Or even my science fiction books. holy smokes. Just finding the book I’m after at the moment is difficult, let alone finding a particular part of the text.

declutter

I don’t want my tiny little corner of the earth completely taken up with bookshelves.
Advertisements

Migrate from blosxom to WordPress

December 19, 2009

Not perfect, but gets me most of the way there:


#!/usr/bin/env python3.1

import cgi, datetime, os, re
from os.path import join, getsize

linebreaks = re.compile(r'([^\n])\n([^\n])')

for root, dirs, files in os.walk('.'):
for name in files:
  if name.endswith('.txt'):
    fullname = os.path.join(root,name)
    ctime = datetime.datetime.fromtimestamp(os.path.getmtime(fullname))
    f = open(fullname)
    title = f.readline().strip()
    _blank = f.readline()
    body = f.read().strip()
    f.close()
    cat = root[2:]
    print("""
<item>
<title>%s</title>
<content:encoded><![CDATA[%s]]></content:encoded>
<pubDate>%s</pubDate>
<wp:post_date>%s</wp:post_date>
<wp:status>publish</wp:status>
<dc:creator><![CDATA[clintonroy]]></dc:creator>
<category><![CDATA[%s]]></category>
<category domain="category" nicename="%s"><![CDATA[%s]]></category>
</item>
""" % (title,
linebreaks.sub(r'\1 \2', body),
ctime.strftime('%a, %d %b %Y %H:%M:%S +0000'), ctime.isoformat().replace('T', ' '),
cat, cat, cat))