14 January 2010

Colourizing mercurial output when piping to less

Filed under: Uncategorized — Tags: — bookweevil @ 10:43 am

From at least version 1.3.1 onwards, it looks like mercurial will colourize the output of commands like “hg diff” (for instance), making them much easier to read on-screen.

However, when it detects that output is going to a pipe rather than a terminal, it normally turns colourization off.

You can turn it back on using the “–color=always” argument; and if you’re piping to “less”, then “less -R” will cause it to recognize ANSI colour escape sequences. For example:

  hg diff --color=always | less -R

5 May 2009

Some literature on considerations of morality in economic theory

Filed under: Uncategorized — bookweevil @ 7:11 pm

Beckert, Jens, Bettina Hollstein, Edward W. Lehman, David Marsden, and Amitai Etzioni. 2007. Amitai Etzioni – Twenty years of ‘The Moral Dimension: Toward a New Economics’. Socioecon Rev (December 4): mwm021. doi:10.1093/ser/mwm021.

Bowles, Samuel. 1998. Endogenous Preferences: The Cultural Consequences of Markets and Other Economic Institutions. Journal of Economic Literature 36, no. 1 (March): 75-111. doi:10.2307/2564952.

Farina, Francesco, Frank Hahn, and Stefano Vannucci. 1996. Ethics, rationality, and economic behaviour. Oxford University Press.

Harsanyi, John C. 1955. Cardinal Welfare, Individualistic Ethics, and Interpersonal Comparisons of Utility. Journal of Political Economy 63, no. 4 (January 1): 309. doi:10.1086/257678.

Hausman, Daniel M., and Michael S. McPherson. 2006. Economic analysis, moral philosophy, and public policy. Cambridge University Press.

Rabin, Matthew. 1998. Psychology and Economics. Journal of Economic Literature 36, no. 1 (March): 11-46. doi:10.2307/2564950.

6 March 2009

when converting flv files to mp3’s with vlc, mp3’s are at half-speed

Filed under: audio conversion, Uncategorized — bookweevil @ 10:52 pm

The solution is here (and here)…

“I added samplerate=44100 to the transcode section of my parameter string and the speed is back to normal!”

I also found I had to encapsulate the output as mp4, and then re-convert the mp4 to get raw mp3.

So the parameter string used by VLC ended up being:


7 October 2007

AMQ (another misattributed quotation)

Filed under: Uncategorized — bookweevil @ 11:38 am

Dr Samuel Johnson, of dictionary fame, is widely quoted as having said “God Himself, sir, does not propose to judge a man until his life is over.” But in fact, Dale Carnegie appears to have invented the quote, in How to Win Friends and Influence People.

13 September 2007

I must go down to the sea again

Filed under: Uncategorized — bookweevil @ 10:58 pm

I must go down to the sea again, to the lonely sea and the sky
I left my vest and socks there – I wonder if they’re dry?

— Spike Milligan

sea fever

Filed under: Uncategorized — bookweevil @ 10:53 pm

Sea Fever

I must go down to the sea again, to the lonely sea and the sky,
And all I ask is a tall ship and a star to steer her by;
And the wheel’s kick and the wind’s song and the white sail’s shaking,
And a grey mist on the sea’s face, and a grey dawn breaking.

I must go down to the seas again, for the call of the running tide
Is a wild call and a clear call that may not be denied;
All I ask is a windy day with the white clouds flying,
And the flung spray and the blown spume, and the seagulls crying.

I must go down to the seas again, to the vagrant gypsy life,
To the gull’s way and the whale’s way, where the wind’s like a whetted knife;
And all I ask is a merry yarn from a laughing fellow-rover,
And a quiet sleep and a sweet dream when the long trip’s over.

— John Masefield

28 August 2007

Sorrows of Werther

Filed under: Uncategorized — bookweevil @ 12:43 pm
Werther had a love for Charlotte
  Such as words could never utter;
Would you know how first he met her?
  She was cutting bread and butter.

Charlotte was a married lady,
  And a moral man was Werther,
And for all the wealth of Indies,
  Would do nothing for to hurt her.

So he sighed and pined and ogled,
  And his passion boiled and bubbled.
Till he blew his silly brains out,
  And no more was by it troubled.

Charlotte, having seen his body
  Borne before her on a shutter,
Like a well-conducted person,
  Went on cutting bread and butter.

— W. Makepeace Thackeray

15 August 2007

wine dimples

Filed under: Uncategorized — bookweevil @ 10:18 pm

Heh, nifty.

Almost overwhelming scientific evidence reveals that it’s possible to work out the price of a bottle of wine without seeing the label:

Well, OK, “overwhelming” might be overstating it a bit. “Scientific” and “evidence” likewise. But it could be a handy trick, particularly if someone works it out for wine prices in countries other than Britain. The magic formula (this one for white wine):

Price of bottle = (Dimple depth in mm + £3.49) / 4.3144 – about a pound

The dimples are apparently called “punts” and there’s no agreement on exactly what they’re for. My favourite suggestion is that they used to make the bottle more stable – a flat bottom would need only a slight bump to make it unstable.

29 June 2007

about a novelist

Filed under: Uncategorized — bookweevil @ 8:34 pm

Nick Hornby on waiting to become a novelist:

I always presumed that I would be a writer, without actually doing any writing. I think I thought I was going to get a phone call from somebody one day saying they had a vacancy for a novelist. When I realised that this wasn’t going to happen I thought it was about time to do something.
– Nick Hornby

28 April 2007


Filed under: Uncategorized — bookweevil @ 9:35 am

Welcome to the blog of the Book Weevil. I trust your stay will be a pleasant one; do let me know if there’s anything I can do to make it more comfortable, by posting a comment.

Create a free website or blog at