version: desktop | mobile

Dave's Free Press

the Slightly Less Bad And Wrong Blog Edition

 

Recent posts

Less important journals

Search




Subscribe

rss

Journals that link here

Powered by

Bryar 3.0!
geeky silly politics rant weird meta religion music transport drinking perl culture london photography olympics cooking hacking language sport media rsnapshot holidays books web spam film whisky bryar yapc palm telecoms review cars travel etiquette bastards clothes lolcats amazon curry security home unix phone go environment bbc latin anglo-saxon privacy linux maths gps work
Fri, 4 Jul 2008

On Poverty: an rant

or rather, the definition of poverty.

Did you know that "fuel poverty" is defined as having to spend more than 10% of your income to heat a room to 21°C, or 70°F? Those people would be less poor if they turned the fucking thermostat down and put on a jumper.

And then the normally respectable Joseph Rowntree Foundation has said that the minimum acceptable standard of living costs £13,400 for a single person. Apparently the "essentials" that that will get you include booze, chocolate, a DVD player, CD player and a TV. If you have two children, then it is essential to spend £225 on a birthday present for each of them.

Delving into the details, apparently some people think that croissants are essential, that they need takeaway pizza, and that a suit is both essential and would cost only £40. Mind you, they only expect that shit suit to last two years before having to be thrown away.

FUCK OFF.

Of those, the only one that is even arguable is a CD player if you have children, on the grounds that good music is educational.

Posted at 00:17:29 by David Cantrell
keywords: politics | rant
Permalink | 0 Comments
Sat, 28 Jun 2008

2008 in books, part the second

Most of these reviews can also be found on Amazon.

In the second quarter of 2008, I read the following books:

1. The Outstretched Shadow, by Mercedes Lackey and James Mallory
This is high fantasy - magic, unicorns, knights, demons, the works. I don't normally buy such things as my experience is that the genre is overwhelmingly unimaginative and poorly written. This was yet another of my freebies from Tor though, so given that I didn't have to spend any of my hard-earned cash on it, I thought I'd give it a go. And I was mostly right, it is unimaginative. But it's well-written. The authors have made the protagonist a whiny little shit of a teenager, and he really does come across like that. Of course, the story is flimsy with far too many coincidences and superpowers that just happen to manifest themselves at the crucial time - but this is fantasy, and there's magic, so just suspend your disbelief, alright? If you like fantasy, buy this. If you don't, then it's at least worth looking for in the library. I was sufficiently impressed that I'll track down the sequel second-hand at some point.
2. Blindsight, by Peter Watts
Hard sci-fi with a dash of horror, where the tech is an integral part of the storyline instead of just being a backdrop. And there's also a wide range of characters, some likeable, some hateable, all feeling fleshy and real, and some interesting philosophical musings. The author backs it up with copiously referenced notes at the end about the science used, much of which has at least a grounding in current knowledge and research. The author has made the book available online under a creative-commons licence after not getting much distribution in physical form - why the publishers dropped the ball on this I have no idea. And by the way, since Watts put it online for free, demand has apparently soared, and it's been re-printed, so it shouldn't be too hard to track down a copy and pay money for it. Please do so.
3. Starfish, by Peter Watts
Wow, Watts has put a lot of stuff up on his website for free. Starfish explores a somewhat similar setting to Blindsight (see previous review). The characters are even more dysfunctional and hateable than in the later novel, and the first three quarters of the book are inventive. Unfortunately, the end falls into the rather tired cliché of an Evil Corporation oppressing the characters For The Good Of Humanity. A shame. Mind you, it does give him a hook on which to hang the next story in this trilogy.
4. Maelstrom, by Peter Watts
Maelstrom is the sequel to Starfish (see previous review) and carries on pretty much at the exact point that the previous book left off. I'm not entirely convinced by his technological extrapolations, but that's a hazard of reading fiction involving a subject that you're an expert in. No doubt my mother has the same problem with books whose crucial plot elements involve embroidery. Again, a good beginning and middle is let down by its ending. But again, the scene is set for the final installment in the trilogy.
5. βehemoth, by Peter Watts
The final part in the "Rifters" trilogy carries on where its predecessors left off, and in much the same style. The exception is that being the end of the trilogy there's nothing to hang off the end and so that redeeming feature that the others had is missing. The plot moves slowly and is confused. Conspiracies within conspiracies and some really quite tasteless scenes of torture only detract further from what is at best a mediocre book. And that's my conclusion about the whole series - some great ideas, but poorly executed. Not worth buying, so I'm glad I didn't.
6. Lord of the Isles, by David Drake
Extruded Fantasy Product, which very closely follows the formula of "[fantasy name 1], a young [peasant occupation] in the kingdom of [fantasy place name 1], has his world turned upside down when he discovers that he is the heir of [fantasy name 2], a legendary [heroic occupation]. This awakens incredible [powers / skills / magic] in him, which is immediately put to the test, as [fantasy name 2]'s ancient enemy [fantasy bad guy name] and his army of [fantasy monsters] converge on [fantasy place name 1] to destroy the heir and steal the throne. Can [fantasy name 1] survive a perilous journey to [fantasy place name 2] in order to find the [powerful item] that will save both him and his kingdom?" (thanks to this guy for ths summary). Worth reading? Well, the story progresses in small chunks, like it was written for serialisation in some pulp magazine. That makes it suitable for mindlessly filling a few minutes a day on a bus. So yes, worth reading. Not worth paying full price for though.
7. Crystal Rain, by Tobias Buckell
The background that Buckell uses for this story makes a refreshing change from the normal run of science fiction, most of which is derived quite clearly from western European (and by extension American, which is as near as damnit the same thing) societies. Buckell uses the Caribbean instead. The opposing societies - and the reasons that they are in opposition at all - are inventive, characters' motivations and actions make sense. All round it's a jolly well-written and well-told yarn. I suppose that the ending could be seen as being somewhat deus ex machina if you were to read a plot summary, but with all the little details scattered earlier in the book it isn't really like that. Worth paying for (although this was yet another Tor freebie), and I'll be ordering its follow-up "Ragamuffin".
8. Sun of Suns, by Karl Schroeder
A story of pirates and a desperate search for treasure, with a sub-plot of resistance by a conquered people (this isn't explored in much depth and only eally serves to make one of the main characters' backgrounds a bit more interesting). The setting is a world of a several thousand mile bubble of air floating in space, which contains several miniature suns, the control of which defines nations. There is negligible gravity and for reasons that are never made clear, electronics don't work. This leads to dramatic if somewhat silly action, with jet-powered wooden airships, sword-fights in 3D, and so on. If cut judiciously it would make a great feature-length film - probably best done as a cartoon though, as shooting a whole feature to appear to be in zero G would be very hard. There are some minor inconsistencies in the environment (another reason to film it as a cartoon - cartoon physics are somewhat more forgiving!), and minor plot threads left dangling, but over all it's great fun. Recommended, and added to my shopping list.
9. The Four Just Men, by Edgar Wallace
Edgar Wallace was a hack. This, the first of his very many crime novels, is at heart a reversed rip-off of Sherlock Holmes, whose adventures were entertaining Strand readers at about the same time. Instead of a brilliant detective bringing justice to criminals, we have brilliant criminals bringing their own brand of justice to those who deserve it. The criminals themselves are likeable enough. However, their characters and motivations are barely sketched out. Indeed, it is two of their victims who are, so to speak, painted in colour when everyone else is merely sketched in pencil. And where in a Sherlock Holmes story you would, by the end, know exactly what happened and how, the reader of this story has very little idea how the Four Just Men knew, for example, how their target was guarded. Even so, the very short story is an enjoyable enough read, let down by the very last page, which is a terribly inept attempt at clearing up all the loose ends. As the author died a long time ago, the book is out of copyright and available from manybooks.net to download for free in several formats. I recommend grabbing a copy.
10. The Black Cloud, by Fred Hoyle
Hoyle is most well-known as an astronomer. However, he also dabbled in writing science fiction. And, I'm sorry to say, he wasn't very good at it, at least if this, his most well-known story, is anything to go by. The story itself is actually a fairly imaginative and well thought out example of the catastrophic fiction so popular with British authors of the time - doom, gloom, a new ice age. But it's the wooden characters, the wholly implausible actions of those "off-stage", poor dialogue and over-long expository sections that consign this to the dustbin of literature. As an example of its sub-genre it's interesting, but as a story it ain't. Only recommended for collectors.
11. We, by Yevgeny Zamyatin
It's unfortunate that this tale of emancipation and discovery in a dreary ultra-totalitarian state, one far beyond what Orwell or Huxley later wrote about, is so difficult to engage with, because I really want to like it. It's beautifully written and the protagonist's anguish feels real. But I just couldn't, and have, after carrying the book around in my pocket for a good few months reading a page here and there, eventually admitted defeat. I'm not going to finish it. Even so, although it's not for me the underlying quality is obvious. I hesitate to recommend buying it, but it's worth finding in your local library. It is also available online here in an English translation.
12. Spirit Gate, by Kate Elliott
Another electronic freebie from Tor - and if it was on paper I'd have never even considered picking it up. The cover art is just terrible, almost as if it's designed to make people not read it - it's a badly drawn (and I mean *really* badly drawn picture of someone strapped to an eagle with some shitty faux-tribal ... thing in the background. Frankly, I'd be embarrassed to be seen with it. The story itself, however, isn't too bad. There's rather too many loose ends and a few concepts and events that are merely mentioned in passing yet are apparently terribly important to the characters. Maybe they'll get cleared up in the sequel, but it seems to me that a good book should stand alone. Also the geography is somewhat confused, making it hard to keep track of how one place is related to another, and the broad sweep of the story is hardly original. On the other hand, it's easy to read in small chunks on the train. Don't buy it at full price, get it second hand and if you don't like it, leave it on a train for someone else to read.
13. Ventus, by Karl Schroeder
First impressions are rather disappointing - it looks like it's going to be a hum-drum fantasy with a sci-fi explanation, and takes a long time to get going, all the while interspersed with some expository sections that make one really worry about whether the plot will be allowed to naturally develop. Thankfully, things improve about a third of the way in, and while the story still doesn't feel fully developed (to be fair it is the author's first book) it does at least become entertaining. Unfortunately you never get a feel for the main characters. In fact, it's a very minor character, one who another editor could well have insisted was cut out, who is the most interesting. The "birth" of a conscious AI and its crisis of confidence is handled deftly, and I wish it had been introduced earlier and had a bigger role to play. Overall, I'm glad I read this, but also glad it was a free download from the author. If I'd bought it based on the strength of the author's other work, I'd have felt somewhat cheated.
14. The Magician's Nephew, by C.S.Lewis
There's a new Narnia film coming out soon, and seeing the ads on the sides of buses reminded me that I'd meant to re-read the series, because of all the fuss about it being supposedly christian propaganda dressed up as childrens' entertainment. This is the first (chronologically speaking) book in the series, and is apparently the one that Lewis wanted people to read first. I didn't spot any glaring propaganda. Sure, there's a creation myth, but christians hardly have a monopoly on that. Indeed, they stole theirs, so if Aslan's creation of Narnia counts of christian propaganda, then the bible must be babylonian propaganda. Anyway, the book itself is a very short, quick read. Recommended for children, and for adults who remember reading it when they were smaller. If the rest of the series is of the same quality (and my memory from umpty years ago is that it is) then Narnia is one of the classics of childrens' literature that everyone should own, and put it on their shelves next to Winnie The Pooh. You do own Winnie The Pooh, right?
15. Butcher Bird, by Richard Kadrey
A fantasy with refreshingly little magic at least to start with, and what there is is - again, at least at the beginning - fairly original. Unfortunately the story just doesn't hang together very well. It feels like the author had several good ideas (and many of them are indeed very good), wrote a scene around that, and then glued them all together with some cut n paste mythology. As a novel it just doesn't work. Sorry.
Posted at 18:11:18 by David Cantrell
keywords: books | culture | review
Permalink | 1 Comment
Fri, 27 Jun 2008

How to Save The Planet, in one easy step

Hippies would have you believe that you can Save the Planet and your wallet by unplugging your devices instead of leaving them on stand-by. They are wrong. If we assume that each of twenty devices in my flat is wasting 2W for the 23 hours a day that they're not in use (all of which are pessimistic estimates), then that's wasting 3.3 mega-Joules a day. That sounds like quite a lot. It is, however, just under 1kWh (the unit in which electricity is metered) so costs about 10p a day, or £3 a month.

Here's a much better way of saving energy, emitting less "carbon" (carbon is in fact Just Fine, it's carbon dioxide that will destroy the planet), and coincidentally saving quite a bit more money.

Drive slower.

I recently took a round trip of about 500 miles, most of it on motorways and other fast free-flowing roads. By driving at 60mph instead of 85, I got 45 miles per gallon instead of my normal 33-ish. That means I burned 4 gallons less fuel, or 18 litres, or £24.50. Given that the energy density of diesel is about 38MJ/l, I saved 684MJ or 192 kWh. That is, in one weekend I Saved the Planet as much as I would in nearly eight months of unplugging the hifi, phone charger, etc.

And never mind how much my back thanks me for not having to do all that bending over to plug and unplug things.

Anyway, now let's see what happens if we apply my wisdom to the whole country. Let's conservatively assume that there are 1,000,000 cars, each doing 10,000 miles a year, and that they all normally do a quite good 50mpg. That means they burn 200,000,000 gallons of fuel, or about a billion litres. If everyone slows down by the same amount I did, that billion litres becomes 700 million litres, saving 300 million litres of petrol (which is cheaper than the diesel I use), or 354 million quid. That's also a saving of 12,000,000,000,000,000 joules of energy. Which is about the annual output of the Enfield power station.

What's really interesting about this is that Enfield is a very small power station, about a twelfth of the size of Drax. So while driving slower is a fuck of a lot better than unplugging your phone charger, it's also still not very effective at Saving the Planet. You should still do it though, cos it'll annoy the BMW driver behind you.

[updated to ignore engine efficiency - even if your engine is really inefficient you're still turning each litre into 38MJ of energy, just not very usefully]

Posted at 09:24:31 by David Cantrell
keywords: cars | environment | transport
Permalink | 2 Comments
Wed, 25 Jun 2008

Why you should release your company's code

Geeks often want to release some of the code they write at work as open source. But often they don't really have any good idea why they should do it, other than that it feels like the right thing to do. Well, here's a damned good reason for you, and what's more, it's one that your boss will like.

Just under two weeks ago, I released some of my code. I didn't really expect anyone else to be particularly interested in it, but releasing it couldn't do any harm. But a few days later, someone submitted a bug report. What's more, he included a patch, and regression tests.

If I hadn't released my code, it would still have bugs in it, which would no doubt bite me in the arse later and figuring out what was going wrong would waste a lot of my time. By releasing my code, I got someone else to test and fix my code for free.

So now, when your boss asks you to justify releasing the code you've written for him, point him at this post, and tell him "open source bugs get fixed by other people, for free".

The most recent version of the code in question, including the bugfix, can be found here.

Posted at 20:01:13 by David Cantrell
keywords: geeky | work
Permalink | 2 Comments
Fri, 20 Jun 2008

The Science of Insurance

My car insurance is due to be renewed soon, so I've been ringing around to get quotes. With every company I've tried, I've given them the same information, and I want the same product. Now, those of my chums who work in financey companies assure me that there's lots of Science and Reasoning behind how they calculate all their stuff, and you would have thought that insurance, being a huge part of the financial industry, would be just as sciencey.

Well, no. If it was sciencey, then for the same inputs (things like what car I drive, what accidents I've had and when, how old I am, where I live etc) then the outputs would be the same. Except that, for identical policies, I've had quotes ranging from £900 to £1,650.

There is quite obviously no science and no rational calculations behind insurance quotes, they're just making shit up.

Posted at 10:19:14 by David Cantrell
keywords: cars | rant
Permalink | 4 Comments
Wed, 11 Jun 2008

Optimising n!

If you want to add up all the numbers from 1 to n, you can do it two ways. The slow, inefficient way is to calculate:

1 + 2 + 3 + ... + n

The quick way is to remember what you were taught in school, that:

1 + 2 + 3 + 4 + 5 + 6 = (6 + 1) + (2 + 5) + (3 + 4) = 7 + 7 + 7

and that in general:

1 + 2 + ... + n = n(n+1)/2

This optimisation might not matter for small values of n, but for n = 1000000 it really makes a big difference. This got me thinking whether there was a similar trick for calculating the product of all numbers from 1 to n - that is, n-factorial, or n!.

This matters even more for n! because it gets so large so quickly that computers are unable to accurately represent the intermediate values. In fact, 20! is the largest that can be respresented on a 64 bit machine. 21! can only be approximated, as you need to use a floating point number. This means that not only is calculating really big factorials time-consuming, it's not possible at all to do it accurately with native datatypes.

I don't even know if there is a simple re-statement of n! like there is for the sum above, but I'm gonna spend a few idle minutes working on it.

Posted at 20:10:32 by David Cantrell
keywords: geeky | maths
Permalink | 1 Comment

Per-user resolv.conf files

I want per-user resolv.conf files. I've mentioned this in a couple of places and got asked why. It's so that I can have a consistent set of aliases everywhere I go (so I can, eg, type ssh sdf instead of ssh sverige.freeshell.org) and also so that the resolver will fill in my choice of domain on the end of hostnames, so I can be lazy and type ssh plough instead of ssh plough.barnyard.co.uk.

Some quick googling didn't turn up anything usefully cross-platform, but the implementation shouldn't be too hard - just set LD_LIBRARY_PATH or LD_PRELOAD and provide my own resolver library. Unfortunately, the resolver is part of libc so I need to figure out how to:

  • persuade arbitrary binaries to load an extra library;
  • have that library effectively replace bits of libc ...
  • ... even when the functions I'm replacing are called by other functions in libc

Damn, I might have to read about how the linker actually works if I'm ever to do this.

Posted at 19:10:58 by David Cantrell
keywords: geeky | unix
Permalink | 2 Comments
Mon, 2 Jun 2008

One less mouse

Hurrah! One of my glue traps finally caught a mouse. It is now quite certainly an Ex Mouse. How much is it worth for me to not post dissection photographs?

Posted at 23:16:25 by David Cantrell
keywords: home
Permalink | 3 Comments
Tue, 13 May 2008

Compact tag clouds

I've decided that using different sized text for the tag cloud works better than using different colours, but it has the drawback of eating a lot of screen space. I need to find an algorithm to pack the text in more efficiently so that it doesn't waste so much vertical space.

Actually, I already have an algorithm to do it in my head. Unfortunately it's, umm, rather inefficient. In fact I think it's O(N!) which would be fine if I only had 10 tags, but I have 52 so far, and am still occasionally adding tags.

52! is roughly 8e69. That's 8 followed by 69 zeroes. 69, dude!

Of course, this is a variant on the rectangular packing problem, which is itself a variant of the knapsack problem, which is NP-complete, so I'm going to have to come up with a heuristic that will return a reasonable (but not optimal) solution quickly.

I've decided that the best heuristic is to ask for pointers to code that other people have written that will do the job for me :-)

My constraints are that I need to fit an arbitrary number of rectangles of arbitrary size into a rectangle of fixed width but whose height can vary as necessary, with minimum wasted space. And I'd prefer a perl or javascript solution.

Use both sides of the paper. No conferring. You may begin now.

Posted at 23:44:09 by David Cantrell
keywords: geeky | meta
Permalink | 0 Comments
Sat, 10 May 2008

Ask Lisa: part the second

As an "intellectual property" lawyer, Mr. Geeklawyer knows all about stealing other peoples' ideas. So it comes as no surprise to me that shortly after I wrote about the lovely Lisa in my journal, he would do the same in his. However, as a rather unlikeable sort of chap with no friends (which to be fair isn't his fault, the concept of being nice was beaten out of him in law school) he has to stoop to offering bribes to people so that they will pay attention.

I would urge you not to read this sad little man's scribblings, and especially to not comment on them, for two reasons. First, if you don't feed his delusions of grandeur then those of us who care about him may eventually be able to wean him off his self-destructive personality-destroying addiction to the law and into a decent profession such as pimping small children, or selling hard drugs to kittens.

However, the second, and most important, reason is that I want the whisky he is offering.

Posted at 19:56:22 by David Cantrell
keywords: silly | transport
Permalink | 2 Comments

Archive

2007

Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Nov Dec
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan

2006

Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Nov Dec
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan

2005

Jan Feb Mar Apr
May Jun Jul Aug
Sep Oct Nov Dec
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan