The best kittens, technology, and video games blog in the world.

Thursday, August 27, 2009

Lasik retrospective

Ready for Take Off by vyxle from flickr (CC-NC)

It's been over six month since I had my eye operation, so it's time for a quick retrospective.

I was a fairly atypical patient. Before operation I had mild short-sightedness, about -1.5 in each eye. It wasn't annoying enough for me to ever bother with glasses or contact lenses. I might had some use for them if I ever bothered driving or something like that, but driving in London is a ridiculous idea. And perhaps not even that, I cycled without problems for years.

If you think about it, there are surprisingly few common activities that require highly precise long distance vision. Most of our lives are spent in small rooms, interacting with people and objects no further than a few meters away from us, and the only benefit from long distance vision is knowing that the bus is coming towards you and you should stay off road, not its registration number. Long-sightedness seems like a much worse problem in modern civilization - what use is precise distant vision if you cannot even read what's on the screen, or see faces of people standing next to you clearly?

Anyway, perhaps more due to my transhumanist drive towards self-improvement than an actual pressing need, I decided to go for surgery. To get laser eye correction you need your vision to be stable - unlike with glasses and lenses you cannot change the lasering every couple of years. And you need money, as unfortunately NHS doesn't yet fund corrective eye surgery. What good is socialized medicine, if the only time I needed it I had to pay with my own money? Oh well, that's a rant for another day. Here's the clinic I used.

What operation looks like

Before the operation I underwent a series of eye tests with a lot of fancy machinery. There was obviously the "focus on the picture" machine, looking at letters through a series of lenses, and also machines I haven't seen before - one that puffed into my eyes and observed effects of puffing (I was supposed not to blink), and another that projected rotating light line onto my eye, also no blinking allowed. And there were a few more tests I don't remember too well.

On the day of operation, it went really quickly. First I got anesthetizing eye drops and had to wait there for half an hour or so. Then I was laid on a table, and the operation begun. To prevent blinking some plastic contraption was put around my eye, keeping the eyelid open. Water was poured onto it to clean it up and lubricate, and then some big machine pressed it so it stayed in place. Normally eyes wander around all the time, it feels really weird to have an eye in place and pressed upon. Really weird. It was time for the first laser - it cut a flap in my eye. Then the machine was removed and the flap was moved aside by the surgeon. Of course with a flap removed from my eye, I could barely see anything, it was extremely blurry. I was told to look at a green dot in front of my, while then the second laser reshaped my eye. After a few seconds the lasering was over, and the surgeon put the flap back on its place. I was given a minute of rest, and the same procedure was applied to the second eye. The whole thing lasted perhaps 10 minutes.

After that, I was left in a darkened room to rest for 20 minutes. A good thing I remembered to take my MP3 player with me, otherwise I would be bored to death (of course no reading allowed). Then a quick vision check, I got a bunch of eye drops and was sent home.

First weeks after operation

There was no waiting for the results - I instantly had superclear vision. But obviously that's not the end of story. Eyes after operation are extremely sensitive and fragile - it takes some time for them to heal. I was issued with a long list of activities that I wasn't allowed to do - no Tube on the first day (due to some air pressure issues). Not letting water or sweat into the eyes for the first week. Going outside only with sunglasses. No exercise, no alcohol, no cycling, no make up, no flying, no swimming, no gym, I think the list pretty much implied no sex too, even though it wasn't spelled explicitly. And a complicated schedule of eye drop - lubricating ones to take every 1-2 hours for a week, anesthetic every two hours on treatment day, antibiotic four times a day for 6 days, steroids every 2 hours for 3 days, then every 4 hours for another three days. And sleeping at night only with very uncomfortable eye shields, to make sure they don't touch the pillow.

Fortunately most of the limitations were lifted within a week - the ones that were left for longer were swimming, long list of sports I don't care about like football and skiing, and definitely under no circumstances rubbing, touching, or putting pressure on my eyes. Then a few appointments to check progress (1 day, 1 week, 2 months, 6 months) and that's pretty much it.

There was no pain involved. My eyes were extremely ridiculously oversensitive to sunlight at first - hence the sunglasses - but that passed quickly. They were also very dry, and I had to use lubricating eye drops for a few months. At first it was every 1-2 hours, just as the leaflet said, then it was maybe twice a day, and now I perhaps use them once a week if my eyes feel particularly dry, but usually I don't bother.

After six months

Apparently my vision is "better than 20/20", which is better than human average, but not by a huge margin. No problems left, other than occasional dryness. And I cannot cry, but that's more likely a personality issue than anything related to my eyes.

So it's top human values, not superhuman values yet. But we might get there. Right now, if your vision is bad and unchanging, you should get lasered. But I can imagine that with time we might get to the point when eye lasering with simply be a smart thing to do for pretty much everyone. We are superhumans already. We are resistant to diseases that could kill wild people with vaccination, we have access to ridiculously good memory with Google search, now we can even get superior orientation in unknown territory with Google Maps and a phone. We can communicate with people who are on the other side of the world. We got so far away from our wild state, it would just be another step on the way to get better vision than they had.

What makes a good sniper game

Saber Head + Revy Body by Steve Keys from flickr (CC-BY)

As a big fan of FPS, especially stealthy/sniperish kind, I'm highly opinionated about what makes a good sniper game. Actually, ignore that part. I'm highly opinionated about pretty much everything. Yes, that's more like it. So here are my thoughts on what constitutes a good sniper game.


First - the game needs to completely and utterly ignore realism.

You know what real war is like? It's basically walking around in large groups, and not killing anyone for years and years. Most deaths are civilians - by way of intentional killing, not caring much if they live or not, and hunger and diseases that tend to accompany war. Just look at one of the cleanest wars ever - American Civil War. There were 3.1M soldiers, and 625k deaths - that's a fairly respectable 20% death rate (lets skip civilians among them), but only 213k combat deaths - barely 6.7% death rate. Yes - even in a clean war like syphilis is far more dangerous than enemy bullets. In other world, you can expect to kill 0.067 enemies in all four years of that war. Wouldn't that make an amazing game? Play 60 years 24/7 to get one kill. How interesting would that be?

This number is of course nonsense - even most combat deaths are artillery, air bombardment, tanks, machine guns, and other big military hardware. An infantryman's chance of killing anyone is just ridiculously low. It's basically years and years of walking around.

Do you want to know what are the chances of a bullet fired killing someone? The world produces something between 10-14 billion rounds of military small arms ammunition a year. Well, we don't have any war now, but using reasonable (within order of magnitude) assumptions that World War II era's ammo production was more or less the same as today's, and that 20% of military deaths were from small arms fire (as opposed to non-combat and big guns), that gives 1 kill per 17,500 rounds shot. And now imagine a typical game where you're given 100 rounds and sent against a hundred or so of enemies. Ridiculous much?

[Probably the best sniper in history]

OK, you might say, but we're talking elite snipers here, not masses of lowly grunts. Then yes, it gets much more interesting indeed. Sniper kill rates are one kill per five round or better. The best sniper in history of the world - Simo Häyhä killed between 500-800 Russians with his sniper rifle, plus over 200 with submachine gun. And he used iron sights, not any fancy hardware.

Still this completely ridiculous number of 700-1000 kills took place over 105 days - that's less that one kill per hour, even assuming he didn't overwork himself and took plenty of rest. And that's so far beyond what a typical sniper can except to get, unless of course it's a video game sniper - those get 5 kills a minute, if it goes well.

[I'm not making up rocket pistols]

Does it mean realism is completely unnecessary, and the games should be using plasma rifles, and rocket pistols instead? Well, that might be cool as well, but reasonably accurate reproduction of battlefield mechanics as an emergent property can also result in reasonably accurate balance of different kinds of weapons, and different strategies, and reproduce richness that would be difficult to program manually.

Hollywood realism

The second thing we should abandon is Hollywood realism. There are so many ridiculous tropes in movies and video games that are repeated over and over again - people shooting without aiming, or shooting machine guns while holding them in their hands, grenades having ridiculously small casualty range (in most games you're safe if 2-3 meters away, and you need to be pretty much hit in your head to die from a grenade). Fragments from real granades can hit you even more than 200 meters away. And of course in movies wounded people either die instantly, or keep fighting. Nobody is ever wounded in need of hospitalization.

I'm not a fanatic of realism. Real war sucks. If you want some, volunteer to Afghanistan. You don't even need to hurry, that war isn't going anywhere. But often just going the easy way and making it realistic does improve gameplay, so why not do it?

Elements of good sniper games

Pretty much the best sniper game ever is Crysis. Now I'll wait for half of the readers to close this tab. Done? All right. So what makes Crysis such an amazing sniper game?

First, it's a PC game. Sniper games pretty much need mouse and keyboard, no controller gets even close to that. Unfortunately more and more crappy FPS games move to consoles-only, or are console games with crappy PC ports like FarCry 2, what's not much better.

Next, you do have peripheral vision. Humans have plenty of senses they can use to know what's happening in their vicinity. In addition to narrow field of view in front of them, our eyes can see large space around us, though quite poorly. The most practical way to represent peripheral vision in game is with some sort of radar view, just like Crysis does it.

And you can stay camouflaged, while moving at reasonable pace - in so many other games you can spend five minutes quietly crawling through grass, and then being instantly killed by an enemy sniper. In Crysis as long as you're in invisibility mode (which lasts only short time between rechargings), behind cover, hidden in vegetation, or sufficiently far away, you'll be safe.

Enemies behave reasonably sanely, as far as games of this kind go, even though I'd hope for a lot more in the future. They try to get cover, and shoot where they think you might be, and if you're not careful you will die. Crysis did not have to resort to giving them ridiculous aiming powers, or other dirty tricks like that as many other games do.

What's wrong with Crysis

Hey, I like a computer game? That doesn't sound much like me, does it? So let's start talking about what's wrong with Crysis.

First, weapons balance. You're most likely to use the assault rifle for everything. It beats everything else at every distance. It has much higher chance of killing a nearby enemy without aiming than either shotgun or SMG; with single fire mode, decent scope, and Maximum Strength mode it's extremely competitive with sniper rifles on long distances; and it's far better for short to medium distance kills from concealment (where silencer is a must) than anything else. For medium distance burst fire shootouts there's no alternative. And it has far more ammo than sniper rifle and the briefly featured gauss rifle. As a bonus you get a good grenade launcher to instantly get rid of enemy vehicles. There's simply no situation where anything except assault rifle is significantly better than it.

I have some more complaints about weapons. First, ammo is ridiculously sparse. You have to salvage ammo from your kills, and each Korean has just one magazine on him, and no grenades. What of course doesn't stop him from firing infinitely many rounds, and throwing as many grenades as he feels like throwing. It's especially bad with sniper rifles - forcing you to use assault rifles on long range - or move to midrange and use assault rifle from cover, what's actually pretty cool.

Another problem I have is that cover is too strong. Yes, you can blow most kinds of cover like metal sheets, but as long as they stand they protect whoever is behind them. Games like Call of Duty 4 get it right, thin cover offers protection, but not terribly much. I blame Hollywood realism. There's also the usual problem with grenades and RPGs being ridiculously underpowered, even if not as much as in many other games.

There are also some Crysis-specific issues. Invisibility mode, while really cool, can be abused - all energy is lost if you shoot while invisible, forcing you to become visible just like with D&D Invisibility spell. But - if you turn it off, headshot, and turn it on back, you can kill someone in a crowded room without losing any energy! It's an useful combo to learn.

Also rather annoyingly many seemingly cool features are pretty much useless. Tranquilizer darts would be useful for quietly taking down enemies, except they get up in 5 minutes, and set up the alarm - making them pretty much useless. Strength mode for melee attack is quite pointless, as you can as well be invisible, and shoot your target. Speed mode can only be used while high on energy - but if you're high on energy you can get invisible for safety, and if you're low on energy and have to escape, well too bad, speed mode won't work either. Vehicles are pretty much suicidal to use - their weapons have ridiculously low accuracy compared to your small arms, low firepower, and while inside you're a sitting duck waiting to be killed.

That's all still pretty cool for a sniper game.

Games that get it wrong

First, FarCry, no matter how much I liked it when it came out. You have sniper rifle which is good for what it says on the tin, except for its severely limited range. So you had a choice of either assault rifle - which instantly killed the enemy on headshot, but you needed to be close (for headshot), and it was loud enough to alert everyone. And MP5 SMG, which is silenced, but it doesn't even kill on headshot. So in either way, you get detected straight away. But the binoculars/radar mechanism is brilliant (and reused in Crysis).

Call of Duty 4 - there are sniper rifles, but because enemies respawn almost instantly, sniping is completely and utterly useless. You cannot clear the building and then move, or even clear the building, and order your team to move. Just forget about sniping and get the assault rifle back.

Then there are sniper games like Sniper: Art of Victory, which gets everything wrong.
Concealment being hit and miss for no reason, retarded AI, no peripheral vision, amazingly crappy grenades (less than 1 meter casualty range), no penetration of even glass windows, missing point blank shots with SMG, ridiculously low ammo, especially SMG ammo (like 10 bullets), and a very long list of bugs. And these are just some of the gameplay mechanics issues. Boring missions and crappy graphics can be ignored if sniping in fun, but the game is atrocious in every possible way imaginable.

And of course every single console FPS gets sniping wrong by using a controller.

That's it. Now you can go and design a good sniping game. Good luck!

Sunday, August 23, 2009

Get better at go with gnugo

Go cat by Caramdir from flickr (CC-NC)
Usually I write about things that work quite well - who wants to learn about stuff that doesn't? Or about spectacular failures. Near misses - things that almost work but not really - are a rare subject. This post is about one of such near misses.

I'm sometimes casually playing go at KGS. My account is at 10k now, not too impressive, but then I don't play that much. That's just what my personality is like - I don't do that many things with any regularity, I start something, get really into it, and then a few weeks later my enthusiasm wanes. Not always, but it's quite typical.

So of course I would like to get better at go, without too much effort if possible. I know what's your first thought, but it's not about not losing. You know what's the biggest problem with multiplayer games? For every winner there's a loser, and 50% of people must lose, and the winners tend to be asshats without life who spend all night playing the game, making it impossible for casual players to get anywhere - sure, a casual player like me could slowly learn how to play in multiplayer mode, but losing to asshats a few times too many tends to be too discouraging.

So go is not like that. Everyone has rank assigned, and when people with different ranks are playing the weaker player gets big head start. If you win too much, your rank increases. If you lose too much, your rank decreases. So typically everyone wins half of the time, and loses half of the time - unusually convenient situation for casual players. My rate of wins and loses is pretty much independent of how good I am.

If that's the case, why am I interested in getting better? Mostly because I really hate losing due to spectacularly bad moves. Sure, there are legitimate ways of losing the game - playing too slowly and not getting enough territory, losing a big fight, the normal cases. What is not cool is losing the game by moral equivalent of putting yourself in atari, like this 9dan pro did:

How can one get better at go? First one can play a lot. That definitely helps, but there are quite a few permanoobs - players with way too many games that never progress much. And just by playing and not doing anything else it would take ages to get better.

The second way is doing go problems. They let you get better at fighting and endgame, maybe teach you some common joseki - all very useful things, but they won't teach you any big concepts, or improve your grand strategy. I've seen quite a few players who could win every fight with me, and then lose 20 points by playing some completely useless move, many times during one games.

The third thing is serious studying, like watching games of pros and good amateurs, reading Sensei's Library and books etc. I tried that, but I don't really see what's going on in pro games, and Sensei's Library is mostly targeted at dan players, so it's of limited use to me. And of course it takes a lot of time.

The fourth way, and one that I really like, is reviewing your games. You can review alone or with your fellow player - especially useful in handicap games where White can teach Black something, no matter who won. Or you can send your game to The Go Teaching Ladder, to get a review by a stronger player. Unfortunately that takes ages, and you cannot review every single game this way.

So I thought - bots aren't that horrible at go, some are near shodan level, why not use bots to do a quick review? Now certainly, it won't be as good as a human review, but it's really quick, and hopefully would be of some value.

Gnugo already has some analysis mode - it can take sgf and annotate each step with its idea of what possible moves for Black and White there are and how good they are.

Because its interface is quite inconvenient, I wrote this tiny Ruby script, so I can say annotate_sgf foo.sgf to get annotated-foo.sgf:

level = 15
annotated_sgf = File.dirname(sgf) + "/" + "annotated-" + File.basename(sgf)
system 'gnugo', '--level', "#{level}", '--output-flags', 'dv',
'--replay', 'both', '-l', sgf, '-o', annotated_sgf

And here the problems start. First, while top bots are around shodan level, gnugo is not. It's more like 8k, not horrible (I wouldn't mind a review by an 8k player), but not impressive either. Especially for weak double kyu players it might be pretty attractive.

What gnugo is pretty decent about is noticing groups that were unsettled but both players forgot about them.

Here both players ignore T16, which is obviously vital point for White group if you look at it. I haven't bothered thinking if S6 is another such point, but if gnugo think so, that's at least reason enough to check.

Here's another example - players didn't notice that Black had a ko to mess with White. Gnugo is pretty decent at endgames, and it's surprising how often double digit kyu, and weaker single digit kyu players make such big mistakes.

Gnugo can also point at players making moves that are too small. N1 is a valid move in endgame, where nothing else interesting is going on. At this point it's just small gote reduction. This is extremely common among weak players - territory is real, and influence is vague, so they're willing to fight for scraps of territory instead of grabbing major influence over the board.

Gnugo can also help you stop making unusual fuseki and joseki moves. Unfortunately it's mostly just applying its joseki dictionary without thinking much, so you must think some more if the move is really bad, or gnugo just doesn't like it. Unlike with endgame and semeai, it's hard for you to verify if gnugo is right.

So why don't I like gnugo in spite of all this? Well, I don't really think I'm learning much from it. It doesn't tell me why a move is good or bad, it doesn't create variations showing what are the consequences of different moves (even though it obviously tries them internally). It might tell you which move lost you the fight if you're really curious, but it's difficult to generalize this to new games.

Basically, I don't think I got much better thanks to gnugo. But try it if you want.

Tuesday, August 18, 2009

Richard Dawkins' The Ancestor's Tale - audiobook review

The Little Foxes by sea turtle from flickr (CC-NC-ND)
I don't really read paper books much. Hours of staring at computer and reading blogs and other stuff online are enough effort for my laser-powered eyes. More often than not when I want to read a book, I get an audiobook version of it. Yes, audio has a lot of problems, like lack of searchability, and difficulty of just skimming through less interesting bits. And virtually all audiobook recordings are way too slow. Fortunately my wonderful MP3 player supports increasing audiobook speeds. Side effects include everyone sounding considerably higher-pitched than they really do, but that's something you can really get used to it. By the way - is there any way to avoid that? I know that the most naive algorithm of resampling the original audio wave changes pitch and speed at the same time, and that's what seems to be used, but there surely have to be some smarter ways, right? Especially since I wouldn't really mind even higher speeds.

So, today's audiobook review is Richard Dawkins's The Ancestor's Tale. The audiobook version is unfortunately abridged, what's the dumbest solution to low audiobook speed problem you can think of. MP3 player manufacturers should really do something about it. Or surely there must be some programs out there to speed up audiobooks without making it unreasonably high-pitched right? At least for The Pirate Bay's version, as opposed to DRMed versions.


Anyway, the book starts with extremely long and boring preface explaining what the book is going to be about. I'm pretty sure many people will just turn it off before the real material starts. Then there are 40 concestor steps - concestor being what's more commonly known as most recent common ancestor of some clade of organisms. Yes, if you want that explained, go ahead and listen to the book preface. Or read some Wikipedia.

Then we move back concestor after concestor, and tell a story of what happened to organisms that split from our branch at that time. The first stories are about Neolithic Revolution, and Behavioral Modernity - two major changes on the way from humans being more sophisticated chimpanzees to humans as we know them. I find the notion of sudden rise of Behavioral Modernity extremely dubious - it disagrees with any molecular evidence, and the only proposed mechanism - acquisition of language - is highly dubious. Our best evidence suggest Neanderthals could most likely speak just as well as us (their FOXP2 gene is identical to ours and anatomy of their speech organs seems to allow speech), what pushes language way back to our common ancestor with Neanderthals, at least 660 thousand years ago. If that was so, it would render all theories of language-behaviour connection completely ridiculous. If Neanderthals couldn't speak, our best estimate for acquisition of language is around 200 thousand years ago, about the time Homo sapiens arose.

In the audiobook Dawkins acknowledges the problem, but postulates that maybe around 50 thousand years ago (supposed time of Behavioral Modernity revolution) language became "more advanced" as opposed to old and primitive kinds of language - this radically disagrees with the data, as modern languages take just one generation of children to reach full complexity and richness, as attested by Nicaraguan Sign Languages and all world's creoles. Yes, I'm going to argue with Dawkins a lot, about things that's not directly related to biology.

In the early chapters Dawkins talks a lot about human culture. An amazingly cool idea is that sheep and alikes "domesticated" grasses. Here's how it supposedly happened - sheep graze on grasses and other plans, what's individual grass plants are not too happy about. But - grasses take grazing reasonably well, while most other plants are far more devastated. As the result sheep give grasses marginal advantage over other plants - sure you're hurt, but the competition is hurt more, and now you have more sunlight, soil, water etc. for yourself. Isn't that great?

Something similar might have happened with domestication, and there's a very interesting domestication story - about tame silver foxes. You know the list of domesticated animals, right? Wolves (aka dogs), boars (aka pigs), aurochs (aka cows) and so on. Foxes are very definitely not on the list - few carnivores are for that matter. So how hard would it be to take a random wild species like a fox, and domesticate it into a pet? It turns out just a couple of decades by selecting for tameness. No genetic engineering or advanced biotechnology necessary. You could run this experiment on your own, given enough money for food and keeping a few hundred animals of whatever kind you want. As a side effect, selection for tameness seems to select for a variety of different characteristics useful for domestication, such foxes behave a lot more like dogs than like wild foxes. It will obviously take longer with species that breed slower than foxes, like most primates. That was your first thought, wasn't it? Domesticated marmosets!

Actually am I reviewing the audiobook or just randomly talking about various subjects vaguely related to it? Oh well, that's my blog, so you know what to expect, and staying on topic it is not! So I want to say I think Jared Diamond's argument that Europeans "had to" win the race because of geographical opportunities makes a lot less sense if you look at the data. The argument goes something like this - there are only 14 species of large domesticated animals. Therefore, there are only 14 species of large domesticable animals, and every animals that wasn't domesticated was obviously impossible to. This is bullshit, as silver foxes prove - just a couple of decades of effort, and you add another animal to the list. OK, it's not a "large" animal, so it doesn't count according to Diamond's criteria, but it proves that domesticated and easily domesticable are nowhere near the same thing.

Oh, and it's not like there weren't any other large animals elsewhere in the world. The Earth was full of them. Not only large land masses like Afroeurasia (silly name, but it makes sense here, as animals can walk from one end of it to another easily, climate issues notwithstanding), but also in Americas, and even on many small islands like Madagascar (elephant bird) and New Zealand (moa). The ones in Eurasia and Africa were just best at not getting extinct, probably by being exposed to Homo for millions of years, as opposed to suddenly.

Dawkins talks about it a lot, not just in the first chapters but all through the books. One amusing idea of his is the "wild Homo sapiens". What does it even mean? We're certainly not wild since the Neolithic Revolution, and arguable we never were. A simple question - do humans form a single species? That's an absurd question, of course they do, after all they can and do interbreed.

But isn't the criterion interbreeding in the wild? Do you know any wild Homo sapiens? Even modern hunter-gatherers are most emphatically not wild, with all the "contamination by civilization", and it's difficult position to claim that Paleolithic humans were really wild. Dawkins gives an example of a pair of grasshopper species that can interbreed perfectly well in zoos, but in the wild they never do so because they use incompatible mating songs. And according to him - how is it different from different groups of humans not interbreeding due to incompatible language and religion? Yes! Dawkins pretty much blames religion for development of human races.

Did I mention how the book doesn't bother with disclaimers, or political correctness, and whenever Dawkins disagrees with someone, he pretty much calls them names - with traditional British eloquence rather than common blogger vulgarity like I do, but it's pretty much the same thing. Oh by the way if you want some solid evidence that religion is a good barrier to human interbreeding, apparently European Ashkenazi Jews rate of interbreeding with surrounding European population, without any geographical or linguistic barriers, purely religious ones, was barely 0.5% per generation - a Jewish person was 200 more likely to mate with another Jew than with a non-Jew. It can be realistically imagined that with addition of some linguistic and geographic isolation barriers between tribes might have been much more significant, leading to a situation where an impartial observer might call different human tribes "distinct species". Of course this situation isn't permanent, and for example intermarriage rate for modern American Jews is 47%, far higher than historical rate even just a couple of decades ago. This makes such barriers temporary at worst, not enough to cause speciation, but plausible partial explanation of the origin of races.

Yes, Dawkins does talk about races. One of his claim about reality of races is how much different observers agree who belongs to which race. Like Colin Powell, who is supposedly "black". By the way, he doesn't look the slightest bit "black" to me - he's a total whitey to me, and Obama is obviously mixed race, not "black". But what do I know, I'm not American. By the way at various stages of history English-speaking people used to believe Irish, or Jews, or Southern Europeans, or Central/Eastern Europeans, or Middle Easterners, or Hispanics, or Indians etc., were "distinct races", even though they're all obviously totally white to me. Oh wait, they still believe Middle Easterners and Hispanics are "distinct races". Silly Americans. There's even plenty of Japanese people who look quite white-ish to me, even though most don't. So I don't really buy the "interobserver agreement" argument.

Dawkins talks a lot about how we shouldn't be giving to much weight to labels like species, and higher clades like phyla. There's plenty of cases like ring species, and gradual divergence of distinct clades where such thinking leads to unnecessary confusion.

Before humans

Wow, I wrote so much and I didn't even get to concestor 1 - of us, Common Chimpanzee, and Bonobo. Numeration starts from concestor 0 - ancestor of all humans. I'm not following the audiobook chapter by chapter - Dawkins talks about human issues a lot, all throughout the book. So first, I don't really buy the idea that there's some relevance of "a common ancestors of all living humans", supposedly living just a few thousand years ago, by statistical argument. Because humans reproduce sexually, we have a gene pool, and it doesn't really matter if there was such an individual or not. Imagine there's an island with 1 man and 10 women. That guy will be the common ancestor of everyone on the island starting from the next generation, but that very much does not mean all the genetic divergence only starts then. Perhaps the women are from 10 different places is the world, isolated for tens of thousands of years - genetic divergence would go hundreds of thousands years back. This is an exaggerated example, but with sufficient mixing of gene pool the time of one of the most recent common ancestors can easily be orders of magnitude than the time of the last genetic divergence.

This is less of a problem for earlier concestors. But there's a second problem. Dawkins claims there are only 40 concestors on our road from humans to concestor of all currently living organism. But that's just limits of our knowledge. It's quite likely that a few more concestors will be inserted around our merger with other Eukaryota, and then with Archaea and Bacteria. Or perhaps not. There are fairly strong limits on our knowledge of evolution that far back.

I think Dawkins commits something I'm going to call the "cladistic fallacy" - the idea that for example humans cannot possible be more closely related to Bonobo than to Common Chimpanzee, just because Bonobo and Common Chimpanzee have a common ancestor not shared by humans. This is technically defensible position, and well calibrated molecular clocks will confirm it - but how many years in the past we shared an ancestor is not a meaningful measure of relatedness!

For one, the same number of years doesn't mean the same number of generations - otherwise you would be equally related to your brother and your nephew, just because your last common ancestor in both cases is the same - that's obviously nonsense. More importantly, different evolutionary lines can diverge at different rates.

One example is Canine transmissible venereal tumor, a single-celled parasite of canines that evolved from dog tumor tissue hundreds or thousand years ago. Yes, it's a different species by all means. But it would be ridiculous to say dogs are more closely related to CTVT than to let's say coyotes. Sure, genetic clock says so, but that's not a meaningful measure of relatedness. CTVT is not a canine mammal is any meaningful sense of the word. Another such parasite is DFTD. There's also an arguable case of HeLa (Helacyton gartleri) - a similar species derived from humans - but in this case we could ignore it as a artificially created. A less drastic example are hippos and whales - yes, technically hippos are "more closely related" (as measured by time) to whales (Cetacea) than to any other Artiodactyla, but is it really the best measure? By the way, it's not really mentioned in the book, but there's an interesting even though most likely false theory that humans are more closely related to orangutans than to Chimpanzees, using similar arguments. Read if you're curious, even if it's unlikely.

Dawkins also panics for a moment about the problem of comparing all species against all others. Hippos and pigs both look like perfectly good Artiodactyla, so if you naively assume that it's a proper clade and try to just take one of these species for genetic comparisons, you might get different family trees. I understand his point, but DNA sequencing is getting ridiculously cheaper at exponential rate (I mean, genuinely not just metaphorically exponential). When the book was released apparently humans and mice were the only two mammals with fully sequenced genomes. Not any more. Right now there are at least 10 fully sequenced mammalian species. And you don't even need full sequences for genetic tree reconstruction, just a selection of a small number of representative genes will give a pretty decent approximation. It's funny how quickly books about biology get outdated.

Most of the audiobook is about different animal groups, and interesting things about them. Like how Deuterostomia (that's you) can be thought of as upside-down Protostomia (like insects). And how to explain Cambrian explosion - is it just an artifact, or was it real? How to explain the paradox of sex - why do you throw away half of your genes when you make children, instead of just cloning yourself and doubling your genetic success? How truly irreducible complexity (which we haven't found at all, so don't worry) would be a good evidence of directed panspermia, as opposed to creationism. About endosymbiosis, fish lungs, Platypus's bill, some theories on origins of life, and a lot more. Half of the stories are excluded from the abridged audiobook, unfortunately, so go on get a paper version if you want to get them all.

That's more or less what the book talks about. It's not the best Dawkins ever (especially the overly long preface annoyed me), but it's pretty decent Dawkins. Highly opinionated (and I don't always agree with his opinions), eloquent, and about something extremely interesting. It's definitely popular science, so hardly any biological background is needed. Enjoy.

Monday, August 17, 2009

Security magical thinking in ssh

I'm King of THIS hill! by ucumari from flickr (CC-NC-ND)

The authenticity of host ' (' can't be established.
RSA key fingerprint is 18:93:ea:38:81:84:ae:34:b4:56:0e:51:7c:28:ef:cd.
Are you sure you want to continue connecting (yes/no)?

How about a few bets? So many stupid things are said about security, more often than not by drastically overestimating importance of security measures to people... Should we try prediction markets instead? I haven't heard about any research on prediction markets with thought-experiment money, but they do work with both real and play money, so I'm accepting your though-experiment bets!

First, let's find a random ssh user trying to access or some other server. I bet they're not going to check the ssh key fingerprint. Instead, they'll just blindly type yes without thinking. What rates do you take?

A second bet. Let's find someone who did not bother to check the ssh key fingerprint. I bet they're not under any kind of man in the middle attack, and everything will be perfectly fine. What are your rates here?

And one more. Assume someone is under man in the middle attack. I bet they would be owned by some other channel anyway, and so ssh key fingerprint check wouldn't help them at all.

My initial guesses as for the rates are 100:1, 10000:1, 10:1. I bet 9000 internets on each one of the possibilities. Yes, I know this is ridiculous, but go on and offer counter-bets if you think I'm wrong.

Why the magical thinking?

So assuming I'm right, and the ssh key fingerprint check is useless, why don't we turn it off, or at least provide an option of doing so? This silly question is asked even with EC2 instances, where the instance key is randomly generated, so it's impossible for you to know it; and the instance already has your public key, so hopefully man in the middle attack shouldn't be possible (unless ssh works in some perverted way where that's not enough).

I bet the process goes something like this - ssh developers realized that man in the middle attack is possible. So what were their options? First, they could bother with the public key infrastructure of some sort, but seriously, that would be too much work, both for them and for admins. Second, they could just accept the possibility of man in the middle on the first connection. Both options make sense.

But no - instead they did some magical thinking, and added a completely useless security ritual, a bit of security fairy dust that magically "makes things secure" even though in reality it does nothing other than annoying the user.

It's not ssh's fault really - we're all trapped between irrational belief in importance of security, and reality of most kinds of attacks never happening due to high cost and low benefit to attackers in absence of economies of scale. So instead of reevaluating our beliefs we implement useless security rituals like that. And they work! After all, I don't see any ssh man in the middle around, do you?