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
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 Lisain 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
The 2012 Olympics, which are to be held in the east end of London, in England, and which are already billions of pounds over budget, will now have to be bi-lingual in English and in a little-known language spoken by just 750,000 people. Of those 750,000, a mere 50,000 live in London (making up just 0.6% of the population), and of those 50,000, there can't be more than 10 who aren't also fluent in English.
Naturally, the extra costs incurred in hiring people fluent in Welsh for no other reason than that they are fluent in Welsh, and in translating printed and electronic materials, will not be covered by the Welsh Language Board.
nationalrail.co.uk has a new thingy called "Ask Lisa" which attempts to answer natural language questions. My conversation with it went something like this:
Q: can i take a leper on a train?
A: Customers may take up to 3 items of personal luggage free of charge
Q: am i allowed to drink thirteen bottles of champagne and vomit in a lady's shoes?
A: I'm afraid my specialty (sic) is travelling by train and I cannot answer questions about clothing.
Q: what will happen if I kill myself on a railway station?
A: To find out about a particular station, you can search on the page I'm loading for you now [in a different window]
This thing is great fun. I recommend that you all abuse it.
Posted at 23:32:30
by David Cantrell keywords: silly | transport
One of the few things that some religions have got right is condemning usury. I am appalled that ads like the one below (the link obviously doesn't go to the company in question) are legal. I'm even more appalled, of course, that there are people stupid enough to take them.
183.2%
Fuck me with a pineapple! Or rather, fuck the idiots who take those loans with a pineaple, cos that's what they're going to get.
Posted at 22:18:21
by David Cantrell keywords: rant | religion
As many of you will know, I'm a member of the Liberal Democratic party. That means that I get occasional emails from them. Today's says:
" With your help we can still ensure that Brian Paddick is the next Mayor of London... More people are coming to the same conclusion that we have: Brian Paddick is the only serious candidate for London Mayor and the only candidate deserving of a first preference vote.
" This race is far from over and we can win it with your help. "
Yeah right. Not only does he have no chance of winning, even if he did have a chance I'd not vote for him. Whoever wrote that really is sadly deluded.
Why? Because the only real power the mayor has is over transport. Ken Livingstone has an excellent record in this area, whereas Paddick has spouted a load of rubbish. He has said in the past that he wants women-only carriages on tube trains; that he would fund free wi-fi across London by slashing London Transport's communications budget (you know, the one that they use for informing people about things like tube lines being closed for maintenance, and about bus diversions; and the wi-fi would only be for the inner boroughs but you can bet that people like me in the outer boroughs wouldn't get a discount on our taxes); he has horribly illiberal ideas about increasing use of ANPR (although he rather stupidly wants to link it to "GPS technology" to identify cars entering London); he has delusions of grandeur and thinks that the mayor will have even a tiny bit of influence over building a new rail link to, errm, Scotland.
But worse than all that - he's ex-filth. He spent thirty years in the Metropolitan Police "Service". An organisation that he had to know was riddled with corruption and still is. I don't recall ever reading a single press article about him arresting officers for corruption and for wasting police time. That means that he tacitly approved.
Now, it's true, if you read his manifesto, there's a lot of good stuff in there. But read it sceptically. Make sure you ignore any part of it that promises things that have already been put underway by Mr. Livingstone, and any part of it that's not within the mayor's power. What you'll be left with is a lot of silliness, lots of very vague promises, and maybe just one or two good ideas. Sorry, but one or two good ideas ain't enough to defeat someone with a proven track record.
So, I'm going to vote for Livingstone. Johnson will be my second choice. My votes for the ineffectual members of the ineffectual London Assembly will be for Lib Dem candidates. Voting Lib Dem there can't do any harm. Won't do any good either, of course, apart from to piss the Supreme Leader off.
update: predictably, Paddick came a very distant third
Posted at 21:39:10
by David Cantrell keywords: london | politics
I'm not sure which side to laugh at in this story. Are the hippies Sticking It To The Man, or did the hippies just forget to put their brains in gear that morning?
Actually, I bet there's a more prosaic answer - some third party decided to profit from the rush of hippies wanting to buy Tibetan flags, and just added that design to their usual large order of cheap flags that they buy from their Chinese supplier, without thinking.
Posted at 18:28:37
by David Cantrell keywords: politics | silly
I'd like to express my warm thanks to the lovely people at Yahoo and in particular to their bot-herders. Until quite recently, their web-crawling bots had most irritatingly obeyed robot exclusion rules in the robots.txt file that I have on CPANdeps. But in the last couple of weeks they've got rid of that niggling little exclusion so now they're indexing all of the CPAN's dependencies through my site! And for the benefit of their important customers, they're doing it nice and quickly - a request every few seconds instead of the pedestrian once every few minutes that gentler bots use.
Unfortunately, because generating a dependency tree takes more time than they were allowing between requests, they were filling up my process table, and all my memory, and eating all the CPU, and the only way to get back into the machine was by power-cycling it. So it is with the deepest of regrets that I have had to exclude them.
In the first quarter of 2008, I read the following books:
1. Lord of Light, by Roger Zelazny
Hard to follow at first, but worth persevering with. The story itself is nothing special, and could do with the confusingly named characters and objects being explained better, but the sheer quality of the writing more than makes up for it. In places, it's more like poetry than anything else.
2. The Handmaid's Tale, by Margaret Atwood
God that was depressing! The author does a good job of bringing her character to life and describing the bizarre circumstances, it's just a shame that the end is so rushed and that it's not really finished.
3. The World in Winter, by John Christopher
A good end-of-the-world story. It's very dated, both in the scenario and language, but remember, this is from before the worries about global warming and before calling black men Sambo and assuming they were inferior was thought to be perhaps not in the best of tastes. I refuse to judge a book badly simply because of when it was written. But unfortunately, it is let down by an unconvincing ending, in which the main character's motivations and the new life he has created for himself get turned on their head for completely incomprehensible reasons. Still worth reading though if you can find it for a few pennies second-hand.
4. Hunter's Moon, by David Devereux
I couldn't help but think of Charlie Stross's Laundry while reading this. That's a good thing. Hunter's Moon is faster-paced, and requires more suspension of disbelief. I'm looking forward to reading the next one.
5. Moby Dick, by Herman Melville
The author seems to think it far more appropriate to let us all know what a well-educated fellow he is by the use of overblown pompous classical waffling, than to tell the story. Avoid this book.
6. Prison Planet, by William C. Dietz
Trash sci-fi. The ending is telegraphed right at the start, poorly executed when we get to it, and the last third of the journey is too contrived. The first two thirds makes for a good read though. This is one to buy second-hand for pennies.
7. The Hunt for Red October, by Tom Clancy
I was expecting this to be a load of gung-ho crap that had been accidentally turned into a pretty decent film, and was pleasantly surprised to find that it wasn't. There are far too many coincidences, but it's a spy thriller so they are to be expected. Worth reading.
8. Old Man's War, by John Scalzi
I got this as a free e-book when Tor were running some promotion in February. Turns out it was good enough that I've also ordered it in paperback, and its sequel.
Another free download, this one from the author's website, and his first novel. In the introduction he talks about how hard it was to sell. I'm not surprised, because as sci-fi it doesn't really work very well - an awful lot of the story just isn't sci-fi, being far more of a comedy of Hollywood manners. But the sci-fi elements would alienate the sort who normally read such things. Even so, I liked it. Not great, but enjoyable, and certainly worth the price.
10. Spin, by Robert Charles Wilson
My second free Tor download, this book has a very interesting premise, good characterisation and moves along at a good pace - not too slow, nor so fast as to seem occasionally forced. When what's been going on is finally made clear it is perhaps a little too magical for my tastes, but that doesn't detract from the book much. I see that there's a sequel. I've added that to my Amazon wishlist.
11. Farthing, by Jo Walton
Another freebie from the nice people at Tor. This is apparently a science fiction book. I mean, it must be, it's been nominated for the Nebula and all! And it's published by Tor! Of course it's sci-fi! Well, no, it's not. While it does use the common sci-fi trope of being set in an alternate history (and a rather pedestrian one at that - peace between Britain and Germany in 1941) the story itself is just a country-house detective mystery, with political meddling. A fairly competently executed one too. While it's obvious from the start whodunnit (or at least oneofwhodunnit) the whydunnit isn't clear at first, and it's fun to see the investigation flail around a bit. On the other hand, the characters are a bit two-dimensional and stereotyped. Stupid aristocrats. Nasty aristocrats. Good copper with a hidden past. Nasty Nazis. And the Jewish hero is, of course, a banker. In summary, worth reading, but wait for the paperback. The book is apparently the first in a trilogy, I'll give the second installment a try - the excerpt Tor appended was at least interesting.
Posted at 22:36:26
by David Cantrell keywords: books | culture