Monday, 18 February 2008

Chronicles of an Age of Darkness

As a reader of fantasy novels growing up, I was pleased to realise that some of the novels I was reading, were written by a guy living in another part of New Zealand. While I wasn't the most discerning reader, never having met a fantasy or science fiction book I didn't like, I really enjoyed the one or two of these novels which I stumbled across.

They were novels from the ten book series Chronicles of an Age of Darkness by Hugh Cook. Unfortunately they didn't sell well and the publisher, Corgi, stopped publishing them. What made this really unfortunate was that Hugh planned two more ten book series in the same setting, which would have been a phenomenal amount of quality reading.

It turns out that the novels are not easy to get these days and I wanted to collect the series, to both have them for the satisfaction of it, and also just to be able to enjoy reading some great novels. I had two of the novels in my book collection in storage at my parents place. The Wizards and the Warriors (book one) and The Women and the Warlords (book three).

As I had to travel up to Auckland to attend a visa interview at the US consulate there, I decided to see what second hand bookshops I could find and to try and track down the books I was missing there.

I found The Walrus and the Warwolf (book four) for 8$NZ in a second hand bookstore just a side street over from Queen street near the library. At first I thought it was rather expensive, but then again it had been quite a few years since I had bought a second hand book.

Having heard there were several second hand bookstores over in Devonport, I took the ferry over to take a look. The first second hand book store did have one of his books, but it was a little expensive so I decided to leave it for the moment. The next had a great selection of science fiction and fantasy novels at very reasonable prices. I picked up a second copy of The Wizards and the Warriors (book one) there for 5$NZ, just because it was in great condition and so cheap. I also picked up The Wordsmiths and the Warguild (book two) and The Wishstone and the Wonderworkers (book six) there.

Now in America, I have been taking advantage of the internet and not being located in some small and distant country, in order to buy the remaining books I am missing. I had The Wicked and the Witless (book five) sent over from the UK for around 10 pounds. And I ordered The Wazir and the Witch (book seven), The Werewolf and the Wormlord (book eight) and The Worshippers and the Way (book nine) from a second hand bookstore in Tasmania, Australia for around 50$US. Just one more to go, book ten, but that sells for an extortionate amount if you want the Corgi edition in a decent condition (35$AU plus shipping from Australia on ebay).

Hugh has repackaged a couple of his books, including book ten, through a print on demand site called But they are very expensive at around 40$US and don't have the attractive look of the Corgi edition.

I should mention will also be republishing The Walrus and the Warwolf at some stage in the near future. And Hugh also provides one or two of his books in readable form through his web site - but it is of course much better to have the paper copy in hand.

A picture taken of the first half of my collection to identify which I already own as of January 2008.

2008-01-25 - Books - Hugh Cook

Another picture of the books I have bought since I arrived in the states. Book six I read on the plane over, and is the same copy as in the other picture.

2008-02-18 - Books - Hugh Cook

One more to go!

McGregors tearooms in Palmerston

While travelling around the south island recently, I accidentally stopped in the small town of Palmerston on the way back to Ashburton from Moeraki. Actually, I think we stopped there because someone wanted some of McGregors famous mutton pies. Personally, I like a good cup of tea, so stopping at a tearoom is always a pleasure and never a chore.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 01 - Storefront

You go up to the counter, grab a tray, load on the baked goods or pies you want to buy and eat, and then proceed to the till to pay for what you have and order a pot of tea or two. After which you meander over to a table, picking one - it doesn't matter which, they haven't had time to clean any of them yet. It may have featured a lotto counter (which wasn't working of course), but it was an authentic tearoom experience.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 02 - Tea

As soon as we sat down, having cleaned off our own table, the tea arrived. It was remarkable how fast it arrived. And it was good. It has a bubbly "the detergent wasn't washed out" sort of look, but it was one of the better cups of tea I have had in a while.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 06 - Top cuppa

And they had sugar buns. If there is one thing I like to eat with a cup of tea, it isn't a biscuit (or cookie as they say in the states), but a good slightly stale sugar bun. This wasn't stale and it wasn't the greatest, but it completed the tea experience.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 07 - Sugar bun

No raspberry jam or lemon curd.. clearly it was not made by a sugar bun appreciator.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 08 - Sugar bun innards

They also sold bran muffins. I tried a little of this, but it wasn't very memorable.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 03 - Bran muffin

And of course, their famous mutton pies. This looks like a mutton ball placed inside a pie pastry shape. It didn't taste amazing, but after having lived through several years in pie barren Iceland, any pie which isn't a bad pie (Couplands?) is a good pie.

2008-01-14 - Travelling - McGregors bakery in Palmerston - 04 - Mutton pie

2008-01-14 - Travelling - McGregors bakery in Palmerston - 05 - Mutton pie innards

If I am ever back in Palmerston, this is the first place I will visit. Actually, given that Palmerston is off the main road, it will probably be the only place I visit there. Or the only reason I would even go there..

Comb honey

There are two types of "home country" food cravings for me.

The first is the craving I have overseas for something which I cannot obtain in the country I am currently living in. I don't tend to ever end up eating these foods when I return to New Zealand.

The second is the craving I have for things when I have returned to New Zealand and I see these things on the shelf in a store. Things I don't remember that I like eating. These I tend to eat and enjoy, assuming I consider the price worthwhile. Of these foods, one is comb honey. But I usually see it in the tourist stores in the airport as I am departing from the country, at extortionate tourist prices (for instance 20$NZ for a small container full).

I was in Ashburton shopping one morning with my father and he suggested we check out the new farmer's market they have there. After a short walk in the sun down the exceptionally wide Ashburton streets we reached it. There were about twenty or so stalls with people selling fresh vegetables, meat products (salmon sausages anyone? I sampled them and they weren't one of lifes treasures), flowers and other assorted things. One of them was selling honey and had a stack of comb honey on the table for 4$NZ a piece. I immediately walked up and bought one.

2007-12-22 - Ashburton Farmer's Market Comb Honey - 377

2007-12-22 - Ashburton Farmer's Market Comb Honey - 379

2007-12-22 - Ashburton Farmer's Market Comb Honey - 381

Modifying Python frame locals

Occasionally I find myself wanting to modify the locals dictionary of a Python frame. Ideally it might have been possible by doing the following:

import sys
def f():
v = 1
sys._getframe().f_locals["v"] = 2
return v
But this does not work and v will be unchanged. As far as I can tell, within an acceptable range of effort, it is not possible to modify the local variables of a frame.

One situation where this is useful, is when you are doing code reloading. When you identify a new version of a class, you don't actually want to replace the old version. Instead you want to take the easier approach and update the old version to be the same as the new version.
def UpdateReferences(oldRef, newRef):
currentFrame = sys._getframe()
for referrer in gc.get_referrers(oldRef):
if type(referrer) is types.MethodType:
newRef2 = types.MethodType(newRef, referrer.im_self, referrer.im_class)
UpdateReferences(referrer, newRef2)
elif type(referrer) is types.FrameType:
if referrer is currentFrame:
# Problem case. Local variable replacement..

oldGlobals = existingFile.globals
for k, v in newClass.__dict__.iteritems():
if isinstance(v, types.UnboundMethodType):
f = v.im_func
# Duplicate the function but bound to the original globals dictionary.
g = types.FunctionType(f.func_code, oldGlobals, f.func_name,
f.func_defaults or ())
g.__doc__ = f.__doc__
if f.__dict__ is not None:
g.__dict__ = f.__dict__.copy()
# If the function already existed, update all references to it.
if hasattr(oldClass, k):
UpdateReferences(f, g)
# Inject the updated function on the original class.
setattr(oldClass, k, g)
There are other situations when writing support tools for a custom framework, where in order to allow programmers using it to write straightforward code, the inability to modify the local variables is a roadblock to the simplest solution - or to being able to do it at all.

If anyone knows of an acceptable way to do this, I would be interested in hearing about it.