Tuesday, 28 August 2007

On Gravitas

Gravitas is a novel by S. Christopher, centered around a character named Ben, and his evolution at the edge of his thirties. In a few words, Ben lives in a medium-sized American city (that could be Portland, for instance); he's a senior programmer in a small software company; he has a geeky housemate.

The novel has no other real purpose than to depict Ben's life and mind. That has shaped the narrative style, which proceeds by an accumulation of scenes, not necessarily in chronological order, rather than by a well-formed, developing plot. Ben is, by many criteria, successful, but by other traits, he's not strictly in tune with his environment: sometimes he appears to shift by a half-tone, maybe more, leading him to be a spectator of himself (and others). The love (and pain) that a girl will inflict on him will force him out of his shell, at least for a period, and he will live this event as a small, strange trauma, maybe the first of his life, not counting his own birth.

Minor themes are recurrent through the book, indicating that it's better constructed than it would be obvious at a first glance.

One of those themes is the disappearance -- of days, people, words, that seem to slip through Ben's memory, as if reality wouldn't let itself be captured easily as a mind representation, by someone who is reluctant to engage in it fully.

Another theme might be abstraction. I don't find a better word for that capacity -- or defect -- that some people have, to perceive things through an emotionless prism, like one would look at a piece of software, including oneself.

The author uses a dense, rich form of English, full of images. This prolixity suits well the introspective nature of the book.

I enjoyed Gravitas. On an ideal shelf, it would be between P.K.Dick's non-sci-fi novels and Meredith's Egoist.

Monday, 6 August 2007

mysql command-line tricks

I use the MySQL shell a lot. A couple of tricks can make it more usable:

First, prompt customisation. I work with lots of different databases on different hosts. So, I customised my prompt via an environment variable:

export MYSQL_PS1="\\d@\\h> "

This makes mysql display the database name and the hostname instead of the fixed string "mysql":
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 143955 to server version: 5.0.27-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

test@counterfly>

Secondly, readline configuration. When editing long SQL statements, I prefer to use vi-like keybindings. That can be selected by adding the following lines to your ~/.inputrc file:
$if Mysql
set keymap vi
set editing-mode vi
$endif

You can then navigate history and edit like like you would do (almost) in vi. See your readline manual for more details.