and has 0 comments
Greg Bear is the type of writer that I just have to love: he writes hard SciFi, but easy to read, he doesn't bullshit the reader with too much technobabble and, even if his writing is by no means simplistic, he doesn't bore you with how some person or another feels unless it propels the subject forward. Blood Music is also of a subgenre that I love: global pandemic, so I have to also love the book. So take that into account when you read my review.

The book starts with a preposterous idea: that cells can become intelligent. A brilliant scientist, but one that has always cut corners to get around, discovers this almost by accident and... well... cuts a few corners. The result is something that feels like John Saul's The God Project, but soon leaves it and reaches for the stratosphere. The end is typical Greg Bear, astounding and megalomaniac.

Blood Music has some flaws. One of them is that it is really a very short book, an extension of the original 1983 short story that won the Nebula. The other is that it is written in 1983 (similar to The God Project) and so the science background is both grandiose and a bit obsolete. But it is a good book and one that ponders on the significance of identity, thought, society and ultimately: the essence of reality. I've read it in about three days, so you have no possible excuse for not trying it.

and has 1 comment
I was in the mood for horror, something really disturbing and hopefully on the sci-fi side, and so I went scouring the net for good horror books. Origin, by J.A. Konrath, was suggested by some guy or another, so I started reading it.

The problem is that the book is not much more than an easy thriller. The writing doesn't suck, but neither does it shine; the subject is intriguing, but treated in a screenplay fashion, with not much depth and only a few characters; the book is easy to read and really short; the plot has numerous holes in it. But worst of all, it doesn't really scare! While some of the scenes were - let's say - gory, they were not horror, but rather expected consequences of previous actions.

What is it about? The United States government (who else, tsk, tsk, tsk) has found a strange sarcophagus while excavating the Panama canal. For a century the secret is kept and the subject examined in a specially built facility underground. In the sarcophagus is a massive creature with red skin, hooves, horns and wings. After 100 years of slumber, it awakens. What is it? A devil, THE devil, an alien, a strange prehistoric creature? You will have to read the book in order to get an answer to that question.

Bottom line: I read it in less than a week, didn't hate it, didn't love it, it was good for passing the time, but I would not recommend it for anything but a vacation, to read on the way or in other boring moments.

and has 0 comments
Another song that I've been listening obsessively for the last day or two. I am fascinated by the mouth on that girl. So filthy the words, so beautiful a smile, so machinegun the speed. Not something that I would have associated with Manhattan , either. Here is the video, I will paste the lyrics below, because you may not understand them from the song alone :) You may also understand why at first I didn't believe it was on a TV music station, where I heard it the first time.



Hey, I can be the answer
I’m ready to dance when the vamp up
And when I hit that dip, get your camera
You could see I been that bitch since the Pamper
And that I am that young sis, the beacon
The bitch who wants to compete and
I could freak a 'fit, that pump with the peep and
You know what your bitch become when her weave in
I just wanna sip that punch with your peeps and
Sit in that lunch if you're treatin'
Kick it with ya bitch who come from Parisian
She know where I get mine from, and the season
Now she wanna lick my plum in the evening
And fit that ton-tongue d-deep in
I guess that cunt getting eaten (4x)

I was in the 212
On the uptown A, nigga you know what’s up or don’t you?
Word to who made ya
I’m a rude bitch, nigga, what are you made up of?
I’m-a eat ya food up, boo
I could bust your eight, I’m-a do one too, fuck ya gon' do?
I want you to make bucks, I’m a look-right nigga, bet ya do want to fuck…
Fuck him like ya do want to cum
You're gay to get discovered in my two-one-deuce
Cock-a-licking in the water by the blue bayou
Caught the warm goo in your doo-rag too, son?
Nigga you’re a Kool-Aid dude
Plus your bitch might lick it, wonder who let you come to one-two
With ya doo-doo crew son… fuck are you into, huh?
Niggas better oooh-run-run
You could get shot, homie, if ya do want to
Put ya guns up, tell your crew don’t front
I’m a hoodlum nigga, you know you were too once
Bitch I’m 'bout to blew up too
I’m the one today, I’m the new shit, boo, young Rapunzel
Who are you, bitch, new lunch?
I’m-a ruin you, cunt (4x)

Ayo (ayo), I heard you're riding with the same tall, tall tale
Telling them you made some (made some)
Saying you're grinding but you ain't going nowhere
Why you procrastinate girl? (-nate girl)
You got a lot, but you just waste all yourself
They'll forget your name soon (name soon)
And won't nobody be to blame but yourself, yeah

What you gon' do when I appear?
W-when-when I premiere?
Bitch, the end of your lives are near
This shit been mine, mine (x2)

Bitch, I’m in the 212
With the fifth cocked nigga, its the two-one-zoo
Fuck you gon' do, when your goon sprayed up?
Bet his bitch won't get him, betcha you won't do much
See, even if you do want to bust
Your bitch’ll get you cut and touch you crew up too, Pop
You're playing with your butter like your boo won’t chew cock
The gun, too -- where you do eat poon, hon?
I’m fucking with you, cutie-q
What’s your dick like homie, what are you into, what’s the run, dude?
Where do you wake up? Tell your bitch keep hating, I’m the new one too, huh?
See, I remember you when you were
The young new face, but you do like to slumber, don’t you?
Now your boo up too, hon
I'm-a ruin you, cunt

What you gon' do when I appear?
W-when-when I premiere?
Bitch, the end of your lives are near
This shit been mine, mine (x2)


Programming Game AI by Example is one of those books that would have changed my life had I had read them when I was 15. Mat Buckland is taking a really high tech portion of game making and turning it into child's play. With source code!

From the very beginning we are being told that AI in games is different from what we would normally associate with Artificial Intelligence. AI in games is the thing that makes game agents look smart, but let the user enjoy the game the most. In other words, something that seems smart, but is just stupid enough for you to continue playing.

The book is comprised of ten chapters, heavy with code, but very well structured. The main tool in use are Finite State Machines, but we first get a mechanics physics lecture in chapter 1 where we learn what a vector is and how to normalize it and how to use this in the game physics. Moving to chapter 2, we learn what a state machine is and how to optimize memory by making each one a singleton, how to compose them and why more exciting aspects of artificial intelligence, like say neural networks, are not used more in games. We delve further into methods to optimize what we have learned to make it practical: prioritized dithering, partitioning, BSP, quad and oct trees, fuzzy-Q logic, cell space partitioning, all with code examples, in chapter 3. Chapter 5 is reserved for graphs, Dijkstra, A* and such. Chapter 6 goes into integrating Lua into your games, as a good tool to define and tweak the innards of your game before compiling it all for performance into a single code base. Raven, the example game engine, is detailed in chapter 7. Path planning is described in chapter 8, complete with many optimizations and tricks to make an algorithmic movement of units look natural and smart. Chapter 9 is about goal driven agent behaviour, where we learn how to make an agent define goals and act upon those goals. The composite pattern is suggested as a good solution for goals within goals. We end with a very interesting chapter about fuzzy logic. The basis of this is to fuzzify a situation, infer a behaviour, then defuzzify into a usable algorithmic value.

The bottom line is that this is a very easy book to read, explaining matter-of-factly how to easily create the intelligence in games like Fifa or Counter Strike. The code examples are extensive, but not necessary to understand the gist of things. At the end, it is both a fascinating and intriguing read as well as a good reference book for when you actually need this stuff.

I end this review with a quote from Dijkstra that was also mentioned in the book: The question of whether Machines Can Think... is about as relevant as the question of whether Submarines Can Swim. Very nice book and a recommended read.

I loved the first Avatar animated series. It was deep, funny and yet innocent. A perfect kid show, but one in which an adult could find finer underlying levels of understanding. So it is no wonder that I eagerly awaited the release of Legend of Korra.

Now, that the first season is over, I can have an opinion on it. The show is not about a little kid anymore, it's about a teenager avatar. She, for she is a female, lives in a technological steampunkish world, something that is pretty hard to understand, considering she is the granddaughter of Ang, the hero of the first series, and it all happens merely 70 years afterwards. The innocence of childhood is replaced by the impetuosity of teen age, complete with mood swings, romantic feelings and a strong false sense of infallibility. The elemental countries are now united, so the only possible threat can come from a terrorist organization. There are moments of real fun, but not that many.

Bottom line: it's a completely different show! While in the first Avatar one could find strong moral values underlying what the characters did and the viewer would watch the show waiting to see what would Ang do next in the face of overwhelming adversity, now the focus is on what the avatar girl is feeling when she is not the center of attention and how she gets angry and motivated to use power to solve things. Not something terribly surprising in an American show, but really disturbing in a sequel to such beautiful a series.

So, while the show is nicely animated, the world interesting and the story passable, the overwhelming feeling I get is disappointment. I really do hope something will come out of the next seasons, which I will watch religiously, but let's face it: I do it for Ang.

and has 2 comments

I was not going to write a chess post so soon, as I haven't really been playing lately and it might give the impression that I am either a good player or that I lost interest in other areas, like software developing. (I assure you, I did not, as I still waste spend most of my time at work, coding).

However, this opening seems a natural continuation of my previous post on the Sicilian Wing Gambit. There the b pawn was moved to b4 to counteract Black's attempt to control the center with c5. In the Polish opening, White starts directly with b4, denying Black moves like c5 and even hindering the development of their queen side knight.

The Polish, Sokolsky or Orangutan opening has been successfully used by international master Alexey Sokolsky, hence the name. He was not Polish though :) and I don't even care why someone would name a chess opening from an ugly orange ape (the video below explains it, though).

I will attempt to use several resources in this post. First, a PGN of the opening as a statistic of chess games played starting with b4.

1. b4 e5
(1... d5 2. Bb2 Nf6 3. e3 Bf5 4. Nf3 e6 5. a3 {This line ignores the White pawn on b4 and develops normally.}
(5. b5 {Moving the b pawn forward hinders the development of the queen's knight. Black is forced to either challenge the pawn, easily defended by the a and c pawns, as well as the bishop and knight, or develop their knight to d7.})
)
(1... Nf6 2. Bb2 e6 3. b5 {With White's pawn on b5 and Black's on d7, the knight on b8 is effectively out of the game.} d5 4. e3 c5 {Taking en passant would be a mistake, as it would free White's knight.}
(4... Be7 5. Nf3 O-O 6. c4 c6 {White has a thematic move: c4, with Black forced to protect the d5 pawn and lose avenues for development.})
5. bxc6
(5. c4 {Now it would be Black's turn to blunder in taking the c pawn and helping the White bishop develop while losing a center pawn. Black is not looking good with most their pieces having reduced mobility.} Be7
(5... Nbd7)
(5... b6)
)
5... Nxc6 {At this point Black is looking good, controlling the center and having more minor pieces developed.})
2. Bb2 d6
(2... Bxb4 3. Bxe5 Nf6 4. Nf3 O-O 5. e3 {The other common continuation. Black takes the pawn on b4, but loses a center pawn. At the same time Black develops a piece while forcing White to move twice - and later three times, maybe - the strong fianchettoed bishop.})
(2... f6 {Protecting the e pawn and blocking the White bishop's attack diagonal might look good, but it is robbing the Black night of its natural development square and weakening g6.} 3. b5 d5 4. e3 Be6 {Here Black has control of the center with a strong pawn structure, but can they hold it? The knights can only be developed on awkward 7th rank squares, the bishops have to wait for them and the queen has nowhere to go. The computer gives a complete equality between sides, but is it?})
3. e3
(3. c4 Nf6 {Transposing to the English opening} 4. e3 Be7)
(3. b5 {The natural continuation of b4, blocking the Black knight.} Nf6 4. e3 Be7 {Again, an awkward position for Black: everybody has to wait for the knight on b8.})
(3. e4 Nf6 4. Nc3 Be7 5. Bc4 O-O {Two bishops aimes straight at Black's king.})
3... Nf6 4. c4
(4. Nf3 Be7 5. Be2 O-O 6. O-O {Another variation similar to many before.})
4... Be7 {Consider this the main line, yet with less than 100 games played in this move order.} *


What we can see is two major thematic moves for White: b4-b5, blocking the development of the Black knight. The other is c4, protecting b5 and challenging d5. If Black takes (d5xc4), it loses a center pawn and helps develop White's light bishop. Also, after b4 and the dark bishop fianchetto, a common White move is e3, helping in completely domineering the center dark squares.

As Black, one can observe a tendency to go for the light squares. If White's pawn reaches b5, the only real square where the Black queen knight can develop is d7. That means that the d pawn cannot depend on the protection of the queen all the time and the light bishop will have to develop first or remain blocked by the knight. In the last game in this post, for example, one can notice Black immediately sacrificing the light squared bishop for White's king knight, relieving some of the pressure on Black's king side and giving freedom for pawns to occupy e6 of even f5.

A second resource is some real life games:
Sokolsky - Byvshev - 1951
[Event "URS-ch sf"]
[Site "Lvov"]
[Date "1951.??.??"]
[Round "?"]
[White "Sokolsky, Alexey"]
[Black "Byvshev, Vasily Mikhailovich"]
[Result "1-0"]
[ECO "A00"]
[PlyCount "75"]
[EventDate "1951.??.??"]
[EventType "tourn"]
[EventRounds "19"]
[EventCountry "URS"]
[Source "ChessBase"]
[SourceDate "1998.11.10"]

1. b4 Nf6 2. Bb2 e6 3. b5 d5 4. e3 a6 5. a4 Nbd7 6. Nf3 Bd6 7. c4 c5 8. d3 O-O
9. Nbd2 b6 10. Be2 Bb7 11. O-O Qc7 12. h3 Rfe8 13. Rc1 axb5 14. axb5 Ra2 15.
Qb3 Rea8 16. Nb1 Qd8 17. Rfd1 R2a4 18. Nc3 R4a5 19. d4 Bb8 20. cxd5 exd5 21.
dxc5 bxc5 22. Nxd5 Nxd5 23. Rxd5 Bxd5 24. Qxd5 Qe7 25. Rd1 Nf8 26. Bc4 R8a7 27.
Ne5 Bxe5 28. Bxe5 Ra4 29. Bd6 Qe6 30. b6 Rd7 31. b7 Rb4 32. Qxc5 Rxd6 33. Rxd6
Rb1+ 34. Kh2 Qe7 35. Bd5 g6 36. f4 Kg7 37. Qd4+ Kh6 38. Rb6 1-0


A more recent game, Kutuzov (2277) - Burkmakin (2571) - 2004. Kutuzon wins with the Polish.
[Event "RUS-chT2"]
[Site "Sochi"]
[Date "2004.04.28"]
[Round "9.1"]
[White "Kutuzov, Denis"]
[Black "Burmakin, Vladimir"]
[Result "1-0"]
[ECO "A00"]
[WhiteElo "2277"]
[BlackElo "2571"]
[PlyCount "87"]
[EventDate "2004.04.20"]
[EventType "team"]
[EventRounds "9"]
[EventCountry "RUS"]
[Source "ChessBase"]
[SourceDate "2004.07.06"]
[WhiteTeam "13"]
[BlackTeam "02"]
[WhiteTeamCountry "RUS"]
[BlackTeamCountry "RUS"]

1. b4 e6 2. Bb2 Nf6 3. a3 d5 4. e3 Bd6 5. Nf3 Nbd7 6. c4 c6 7. Be2 e5 8. cxd5
cxd5 9. O-O O-O 10. Nc3 a6 11. Qb3 Nb6 12. Na4 Nc4 13. Bc3 b5 14. Nc5 e4 15.
Nd4 Qc7 16. h3 Re8 17. a4 Bxc5 18. bxc5 bxa4 19. Rxa4 Nd7 20. Bb4 Rb8 21. Qc3
Nde5 22. f4 exf3 23. Nxf3 Nxf3+ 24. Bxf3 Bb7 25. Qd4 Rbd8 26. Bc3 f6 27. Rb1
Ne5 28. Bh5 Nc6 29. Ba5 Qe7 30. Bxd8 Rxd8 31. Qb2 Bc8 32. Qb6 Ne5 33. c6 Nc4
34. Qd4 Qc7 35. Rc1 Rd6 36. Bf3 Kf8 37. Qc5 Nxd2 38. Bxd5 Qe7 39. Kh1 f5 40.
Rd4 Ne4 41. Bxe4 Rxd4 42. Qxd4 fxe4 43. Rf1+ Ke8 44. Rf4 1-0


We must have a loss. Meijers (2507) - Naiditsch (2641) - 2005.
[Event "BL2-Ost 0506"]
[Site "Germany"]
[Date "2005.10.23"]
[Round "1.1"]
[White "Meijers, Viesturs"]
[Black "Naiditsch, Arkadij"]
[Result "0-1"]
[ECO "A00"]
[WhiteElo "2507"]
[BlackElo "2641"]
[PlyCount "67"]
[EventDate "2005.10.23"]
[EventType "team-tourn"]
[EventRounds "9"]
[EventCountry "GER"]
[Source "ChessBase"]
[SourceDate "2006.11.23"]
[WhiteTeam "Nickelhuette"]
[BlackTeam "Bindlach"]
[WhiteTeamCountry "GER"]
[BlackTeamCountry "GER"]

1. b4 c6 2. e3 Nf6 3. Nf3 d5 4. Bb2 Bg4 5. h3 Bxf3 6. Qxf3 Nbd7 7. a4 e5 8. b5
Bd6 9. g4 O-O 10. Be2 Ne4 11. Qg2 Bb4 12. Bd3 Nd6 13. O-O e4 14. Be2 Qe7 15. f4
exf3 16. Bxf3 Nc4 17. Bd4 Nde5 18. d3 c5 19. Bxe5 Qxe5 20. dxc4 Qxa1 21. Bxd5
Qe5 22. e4 Rad8 23. g5 Ba5 24. h4 Kh8 25. Rf5 Qd4+ 26. Kh1 g6 27. Rf1 f5 28.
gxf6 Rxf6 29. c3 Bxc3 30. Nxc3 Qxc3 31. Bxb7 Rdf8 32. Rxf6 Rxf6 33. Kh2 Qd4 34.
Qg3 0-1


Note that even if I have a huge database at my disposal, most of them are not annotated at all (like these three). There is a lot of chess knowledge out there that just waits to be analysed, digitized and shared. Help me out if you can!


In this game Black quickly realizes the light bishop is going to be hindered by the queen side knight and trades it off immediately, then develops the knight to d7 while the d pawn is protected by a pawn chain.

And the final resource, a video explaining how one should play against the Polish, from Black's perspective.
[youtube:EQQugBzKefE]

As a conclusion, I liked this opening. It is uncommon for a reason, as it is rather slow and risky. White has the advantage of the first move, they should not waste it on side pawns. However it does seem more manageable than the Sicilian Wing Gambit and can easily transpose in the English opening, which I haven't played, but is in heavy use. What I did't like at either this or the wing gambit is a lack of traps. There probably are a few, but I would have to find them myself. I hope you liked it, too.

Please let me know which formula for a chess blog post you like more. I've tried several and I will continue to try in the future, but I would like some feedback from people who read about chess on my blog. Thanks!

Update October 2014:
Sergio Zaina, from Brazil, sent me this trap in the Polish:
1.b4 c6 2.Bb2 Qb6 3.a3 a5 4.c4 axb4 5.c5 Qxc5 6.axb4 1-0

and has 0 comments

A wing gambit is a way for one of the players in a game of chess to sacrifice a pawn on the b or g files in order to deflect defenders of the center. Like all gambits, it is an aggressive attempt to gain position by sacrificing material, in this case, an attempt to control the center of the board. Today I want to talk about a gambit that occurred to me while I was thinking of a way to play against the Sicilian Defence. It involves moving a pawn to b4 to counteract the Black move c5, which is also, in a way, a sort of wing attack. I liked the concept: you outflank the opponent. Looking in the chess database, this is called the Sicilian Wing Gambit.

The first thing to notice is that the b pawn is irremediably lost. Declining the gambit brings no advantages to Black whatsoever, so they must take. After c5xb4, you have lost a pawn and also blocked the c3 square, the traditional best starting point of the queen's knight. So, as white, you have moved two pawns, lost one and also the best square for one of the minor pieces, while developing none. It doesn't look good and, for that reason, this gambit has been scorned in the past as unprincipled. It has made a comeback, though. It is not something you should expect to see at world chess championships, but it is good for blitz games and for throwing your opponent off track.

Even if White appears to have lost time, material and positional advantage, there is no clear way for Black to punish them. We will examine some of the options that Black has and where they led in various database and computer simulated games. The next move of White's is a3, attacking the pawn and preparing to open the a file. Another option of White's is to immediately challenge the center with d4. We will examine both options, as well as some rare variations (of such a rare gambit), like Nf3. So here is the PGN file I've compiled. Move carefully through all variations and read the comments. It might intrigue you enough that you would adopt the Sicilian Wing Gambit as a permanent part of your chess repertoire:
1. e4 c5 2. b4 {challenges c5 in order to deflect it from d4} cxb4
(2... b6 3. bxc5
(3. Bc4 {White is not forced to take.} e6)
(3. Nf3 {A normal development plan can be attempted while deciding what to do on c5} Bb7)
(3. b5 {Or even push the pawn forward, blocking the b knight and the rook for a while} Bb7
(3... a6 {although I don't particularly like the possibilities after a6.})
4. Nc3 e6 5. Nf3 Nf6)
3... bxc5 {Here Black declined the gambit and maintained a pawn on c4.} 4. Nc3 Nc6 5. Rb1 {But White gets first to control the open b file.} g6 6. g3 Bg7 7. Bg2 Ba6 {Black has tried to revert to their original Sicilian plan, but some parts are clearly different because of the lack of the b pawns})
3. a3
(3. d4 {White might want to move for the center immediately} d5 4. e5 {But here the engines give almost one full pawn to black}
(4. exd5 Qxd5 {while here the Black queen is safe from harassment because the b4 pawn is still there.})
4... Nc6)
(3. Nf3 {This is the line suggested by a chess engine. I'll follow it through a little more.} Nf6 4. e5 Nd5 5. a3 d6 6. Bc4 dxe5 7. Nxe5 e6 8. axb4 Bxb4 9. Bb2 O-O 10. O-O Qg5 11. Re1 Nc6 12. Qf3 Bd6 {No humans have played a game like this. From here the engine mercilessly simplifies the situation.} 13. Nxc6 bxc6 14. g3 Qf5 15. Qxf5 exf5 16. Bxd5 cxd5 17. Ba3 Bxa3 18. Rxa3 {Black has managed to control the center, even if the White rooks are really active.} Be6 19. Ra5 d4 20. Na3 Rfc8 21. d3 {At this point I ended the simulation. Clearly White has failed to control the center and gained only limited mobility. Black has an extra doubled pawn and the game will probably draw.})
(3. c4 {Santasiere variation: an even more gambity move, baiting b4xc3 followed by Nc3 and gaining development and center control. The few games that played like this did not finish well for White, though.} bxc3 4. Nxc3 g6 5. Bc4 Nc6 6. Nf3 Bg7 7. O-O Nf6 8. e5 Ng4 9. d4 O-O 10. h3 Nh6 11. Bf4 d6 12. Qe2 Nf5 13. Rfd1 Qa5 14. Rac1 e6 {This is an entire game that ended in an agreed draw - Rainer-Guenter 1995})
3... bxa3
(3... d5 4. exd5 {this is the main move}
(4. f3 e5 {A single game with this situation. White has delayed too much piece development and pushing of the d pawn. Black won.})
(4. e5 {But this is met more and more in Blitz games.} Nc6 5. d4 Bf5
(5... Qb6 6. Be3 Bf5 7. Bd3 Bxd3 8. Qxd3 e6 {This is the recommendation in the video, with Black having a better game.} 9. Ne2 Nge7 10. O-O Nf5 11. axb4 Bxb4 12. c3 Be7 13. Nd2 O-O 14. Nf4 Rfd8 15. g4 Nxe3 16. Qxe3 {Black is better with the a and b passed pawns.})
6. axb4 Nxb4 7. Bb5+
(7. Na3 e6 8. c3 Nc6 {This is the situation covered in the video, Black has extra development, but difficulty in continuing it. White eyes b5 and has everything wide open.})
7... Bd7)
4... Qxd5
(4... Nf6 5. axb4 Nxd5 6. Nf3 Nxb4 7. d4 Bf5 8. Na3 e6)
5. Nf3 {Marshall variation}
(5. Bb2 {Marienbad variation} e5 6. axb4)
5... e5 6. axb4
(6. Bb2 Nc6 7. c4 {en passant would be a bad move, due to Nc3} Qe6 8. Bd3 Nf6 9. O-O Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 e4 13. d3 Qd7 14. dxe4 Bc5 15. Bxf6 Qxd1 16. Rxd1 gxf6 {Another variation from the video, stopped here as it didn't look very promising for Black.})
6... Bxb4 {White's plan backfired. Instead of a strong center and fast development, Black has the center and a strong center queen. The engines, however, show a mere 0.2pawns in advantage for Black.})
(3... e6 4. axb4 Bxb4 5. c3 Be7 {Another win for Black: a silly dark bishop, a blocked knight, but White keeps control over part of the center and controls one open semifile.})
(3... Qa5 {A possible annoying move} 4. Bb2 {But this solves most of the issues.} Nc6 5. Nf3 Nf6 6. Bd3 {Yet not all. The d pawn is effectively pinned.})
(3... Nf6 4. e5 Nd5 5. axb4 Nxb4 6. c3 N4c6 7. d4 {Black has a knight out, but White has a monster pawn chain, an open semi file and a lot of open avenues. Black will attempt to control the light squares, while White will be busy trying to achieve some sort of king safety.})
4. Nxa3 {A knight on the rim is dim, but here it prepares to go to b5, where it would force the queen to defend c7 and threaten a7} d6 5. d4 {Black wanted to stop White from having a two pawn center. Instead, even a three pawn center is possible.} Nf6 6. Bd3 {this seems to be the mainline, but even so, there are only 43 games starting like this in my game database} Nc6 {From here, engines and database, all three games, show equality between players.} *


Take notice that I am still a beginner in chess and my analysis is based on what I've compiled from the database of chess games and a video. Here is a video and the PGN of a game that played along the main line in my analysis (Vladimir Grabinsky 2361 - Albert Lyubimtsev 2148, from 2003) where White won.

[youtube:yN73tcJlsKw]

1. e4 c5 2. b4 cxb4 3. a3 bxa3 4. Nxa3 d6 5. d4 Nf6 6. Bd3 Nc6 7. c3 g6 8. Ne2 Bg7 9. O-O O-O 10. f4 Ne8 11. Kh1 Nc7 12. Qe1 a6 13. f5 b5 14. Nc2 Bd7 15. Qh4 Ne8 16. Rf3 e6 17. Qg3 {White missed an opportunity here, according to the chess engine.}
(17. Bg5 f6 18. Rh3 fxg5 19. Qxh7+ Kf7 20. Qxg6+ Ke7 21. Qxg5+ Rf6 22. Nf4 exf5 23. Re1 Kf8 24. exf5 Rh6 25. Rxe8+ Bxe8
(25. .. Qxe8 {This would have been a blunder leading to massive material loss and/or mate in about 15 moves.})
26. Qxh6 Bxh6 27. Ne6+ Ke7 28. Nxd8 Nxd8 29. Rxh6 {A much simplified position, where White has two extra pawns and Black has an exposed king.})
17. .. e5 18. Be3 Bf6 19. Raf1 Ng7 20. Bh6 {This move maintains both sides to a near equality, with a slight advantage for White.}
(20. d5 {The computer sees this option, which wins almost a pawn immediately and locks the king side from the defence of Black's pieces} Bh4 21. Qh3 Nb8 22. g4 Ne8 23. Bh6 g5 24. f6 b4 25. Ne3 a5 26. cxb4 Qc8 27. bxa5 Na6 28. Ng3 Qc5 29. Ngf5 Ra7 30. Ne7+ Kh8 31. Bxf8 h5 32. Bh6 Qxe3 33. Rxe3 Bxg4 34. Qg2 Kh7 35. Bxg5 Rxe7
(35. .. Bxg5 36. Rh3 Nxf6
(36. .. Bxh3 37. Qxg5 Bg2+ 38. Qxg2 Nxf6 39. Rxf6 Rxe7 40. Qg5 Re6 41. dxe6 fxe6 42. Rh6#)
37. Rxf6 Kg7
(37. .. Bxf6 38. Qxg4 h4 39. Qg8+ Kh6 40. Nf5+ Kh5 41. Be2#)
(37. .. Rxe7 38. Qxg4 Kg8 39. Qxg5+ Kf8 40. Rxh5 Ke8 41. Rxd6 f6 42. Qg8#) 38. Rxh5 Rc7 39. Qxg4 Rc1+ 40. Rf1 Rxf1+ 41. Bxf1 f5 42. Qxf5 Bxe7 43. Rh7+ Kg8 44. Qf7#)
36. Bxh4 Nac7 37. fxe7 f6 38. Be2 f5 39. Bxg4 hxg4 40. Rxf5 Ng7 41. Qxg4 Nce6 42. Rh5+ Nxh5 43. Qxh5+ Kg8 44. dxe6 d5 45. Rg3#)
20. .. Qe7 {-2.11/15 10 The engine recommends Ne3, which leads to a variation where for more than 20 moves white appears to be a minor piece ahead, only the score is positional only. Queens come off the board, too.} 21. Qf2 {+0.26/14 10 Alekhin's Gun always looks impressive. From here it goes downhill for Black.} gxf5 22. Rg3 f4 23. Nxf4 exf4 24. Qxf4 Nd8 25. e5 *


Update: I've updated the above game with some computer analysis.

It is important to understand that Black did not lose because of the wing gambit, but because of their own mistakes further on. According to the computer, both players had almost complete equality up to almost the 20th move, which does not bode well for White. Most chess engines give about 0.25 points to White for having the first move, so somewhere that advantage was lost. However, we are not computers.

For what I see in the various games that were played using this anti Sicilian opening, I see several key points where each side is trying to reach. A common theme is the pushing of the e pawn from e4 to e5, defending it with d4 and defending that (while cutting access to the White king) with c3. Other variations see a strong three pawn center for White, making a sham of Black's attempted Sicilian. Moving the e pawn prematurely, before getting rid of the Black b4 pawn seems to be a mistake, though, even if it immediately achieves the classic two pawn center. The a3 move seems to want to open up the a file for the rook, but in the simulations I've run, the rook doesn't seem to have an important role. Also to note is that the queen side knight will most likely take the Black pawn on a3, which takes it to the rim of the board and away from the center. So even if control of the center is achieved, maintaining it might become problematic. Gutsy c4 pawn push, goading Black to take it en passant, only works if Black falls for it and even so, not very well: the knight on c3 will remain undefended on a move like d4. The computers recommend Black ignoring that pawn and pushing to e5 with more than half a point advantage.

On Black's side, it appears as there are several strategies as well. Defending with b6 declines the gambit and leads to something similar to the original Sicilian, regardless of the desired flavour of it. Even if White is pushing the pawn to b5 and hinders the development of the Black queen side knight. While the Black pawn is still on b4, attempts to break out the center, like the Scandinavian looking d5 work better, as an exchange on that square can end with a comfortable Black queen on d5 without the threat of Nc3. In general, taking the pawn on a3 seems to be a mistake, as White will only aid in the dark bishop's development if they take and the Black pawn on b4 can be defended in multiple ways further on, invalidating the gambit. A possible annoying move for White is moving the Queen to a5 and the recommendation of the guy in the video is to move it on b6, an intriguing strategy that seems to break the opening principle of not bringing the queen out too soon. Moving the e pawn at least to e6 seems to bring benefits as well.

Even if the Sicilian Wing Gambit is not very common and thus not analysed in depth so much, it doesn't mean it can't be a useful tool. I know that most chess opening videos have more to offer than what I posted above, but given the rarity of the gambit, it only makes sense to have less information on it, no tested traps, etc. If you play this opening, please let me know. I could update this post with your real life experience playing it.

Update: I've found a page where GM Roman Dzindzichashvili considers the Wing Gambit in the Sicilian a reason to seek psychiatric help :) Here is the link.
Also, I have updated the PGN with the official names for some of the variations of the gambit.

Update 8 March 2016: I've revisited this gambit with more research and computer analysis, check it out: Sicilian Wing Gambit - Revisited

and has 0 comments
I started reading The Passage because of an Internet review. It was so exuberantly positive that I thought I would have a great time reading the story. It said "I don’t think I’m exaggerating when I say that almost everyone has heard about The Passage by Justin Cronin by now. At least the people in the booking world have." The only explanation I have now, having read the book, is that the reviewer is a bookie and they have some sick sense of choosing what they read. Ok, I am a little mean. Truth is that other people that I respect have blogged about the book and recommended it; I just can't fathom why.

Partly to blame is the writing style. Justin Cronin needs to make you understand what everyone is feeling by describing the most mundane parts of their lives and what they experienced. It's not the good type of description, where you get to know the people because of their thoughts and actions, it's just a lot of internal monologues on subjects I couldn't care less about. I feel that a good book is the one that contains mostly ideas relevant to the subject of the book and most of what these people thought or did was not. I am not very good with other people's feelings, so I thought it was all me and I continued to read through the book as a virus from South America that made people into blood thirsty immortal creatures was brought in the US in order to study how it could be used to create weapons. Not the best plot device ever, but I was already forcing myself to suspend my disbelief. (Cronin, that was your job, not mine!) Naturally, the virus escapes containment, unleashing chaos and destruction on the face of the world. I was a third into this rather long book when all the characters so painstakingly described disappear. They all die. Fast forward almost a century later. Now you see my dilemma? How can that be good writing?

Anyway, now people are living inside a high walled colony (because vampires can't enter a makeshift colony defended by lights and crossbows, but they have defeated armoured vehicles and military bunkers) and believe themselves to be the last remains of humanity. All 100 of them. I have to, again, read all about the feelings of people and how they see themselves and the world. Here we get some chapters extracted from people's diaries that are presented at some future outbreak conference. So, halfway through the book, we know it will end well. In case I was starting to enjoy the story. There are some heroic characters around, they do heroic stuff, then, another third in the book, they leave the colony. About a dozen or so. They go through vampire infested territory, losing a few people and the opportunity to know how they felt about it, and find out some important information on how to defeat the vampires. They were not the only remnants of humanity, no, humanity was nice and well fighting the vampires in the most ridiculous and inefficient manner possible. So, after completely removing another 95% of all the characters we got to know uselessly, we have a Mad Max kind of ride to other people. Lucky for me, these other people were pretty much empty plot devices so I didn't get to know how they felt one way or the other. Blessed joy!

At this point I was barely containing my impatience for the book to end. Some sort of bloody resolution to the mess I had read until then. They kill a master-vampire, they get a powerful version of the virus that makes people hybrids and retain their memories, they use a nuke! Wonderful. Then some idiotic woman decides she knows what is best and makes a completely unilateral decision based on "humanity" which pretty much dooms them all and separates the main character from his love forever, but they all accept it as "what should be". Fuming with frustration, I speed it up in order to get to the end of the book, mere tens of pages coming. And it comes. With a little religious crap and a sort of lame cliffhanger and a complete stop. Guess what? It's a bloody saga! See the book cover, there is more coming!

So I am sorry, Axe! I am sorry, Wertzone! I hated the book. It was as pointless as it wasn't making any sense. Maybe the guy can write, but I couldn't notice it because of all the ridiculous premises of the book and all the feely descriptions. I will not read the rest, I will not recommend this book and, if for some strange reason OMG, everybody is talking about this book, tell them you read it here: read something else!

and has 0 comments
Serial Experiments Lain is a strange little anime. It reminded me a bit of Dennou Coil, but the subject was more akin to the show Caprica, as it covers virtual worlds, disembodied conciousness, gods and the barriers between what is real and what is "Wired". It was also psychedelic as hell at times, full of fractured philosophical ideas that were presented in digital like flashes.

After all its 13 episodes, it is hard to say what I was left with. I enjoyed the show, but more because of its overall subject and weird presentation. I am sure I haven't understood half of what the creators were attempting to communicate. In a way, it is an abstract art anime, which might not appeal to some people and other people might like it for completely different reasons than intended, such as myself. I couldn't shake the feeling that this is what the Japanese would have done if they were making Caprica. How the characters see the connected world is interesting, as something almost occult, that can store human conciousness into protocols that are hardly well understood and that have evolved organically in time. The concepts of ego and self are also explored, when one has to ask: if I am both connected in a virtual world and have a body in the real world, where is "I" ?

All in all a pretty decent anime, something that lacked any attempt to make it artificially humorous. No highschool love stories, no weird lewd jokes, just the plain storyline. I liked it.

and has 0 comments

World of Ptavvs is a book first published in 1966, therefore it feels very dated indeed. Still, while reading the book, I've realised how I missed the style of the sci-fi back then, when the world was grand, the future was brilliant, people would all be intelligent and rational, doing what is smart and what is right, with a power of will that defined their very being. Remember Asimov? It's like that! And it's no wonder, both Larry Niven and Isaac Asimov were technical people at their core, even if they have expanded their interests in many other spheres as well. I have to reiterate this: in this time of Generation Me, when everything seems to be focused on the intensity of one's emotions, rather than on what the situation at hand is and what to do about it, when legions of film makers and young adult writers pound this insane idea that what we feel is more important than what we think and our own belief is more important than the welfare of the people around us, in these horrible times books like World of Ptavvs feel like good medicine.

Not the the book was not ridiculous in many aspects. The fusion drives, the trips towards Pluto that took a few days, a "belter" civilisation populating the main asteroid belt and moving around in ships that were essentially huge fusion bombs, the way people with terrible burns and psychic trauma would calmly talk about their ordeal to the scientific investigator come to solve the problem, the idealistic discussions that spawned out of nowhere in moments of maximum tension, the intelligent civilisation of dolphins that dream to go to space, the psionic powers... all of these were at the same time wonderful to behold and quite silly. However, I liked the book, I gobbled it up.

The plot is about this alien that can control the minds of others. Their entire civilisation is based on enslaving other populations via their Power. He is the victim of a malfunction in space and activates a retarder field that will protect him from time and space interactions until someone removes him from this stasis. Thus, he reaches Earth and remains on the bottom of the ocean for billions of years. When people get him out of his shell, all hell breaks loose, the book transforming into a space race and a philosophical introspection at the same time.

I can't make justice to the subject in a few words any more than I can do it in more words without spoiling the pleasure of the read - I've already said too much. If you feel you are in the mood for old school sci-fi, World of Ptavvs is a good book, reminiscent of the works of Asimov or van Vogt. Silly, yet grandiose at the same time.



I think that The Checklist Manifesto is a book that every technical professional should read. It is simple to read, to the point and extremely useful. I first heard about it in a Scrum training and now, after reading it, I think it was the best thing that came out of it (and it was a pretty awesome training session). What is this book about, then? It is about a surgeon that researches the way a simple checklist can improve the daily routine in a multitude of domains, but mainly, of course, in surgery. And the results are astounding: a two fold reduction in operating room accidents and/or postoperatory infections and complications. Atul Gawande does not stop there, though, he uses examples from other fields to bring his point around, focusing a lot on the one that introduced the wide spread use of checklists: aviation.

There is a lot to learn from this book. I couldn't help always comparing what the author had to say about surgery with the job I am doing, software development, and with the Scrum system we are currently employing. I think that, given he would have heard of Scrum and the industrial management processes it evolved from, Gawande would have surely talked about it in the book. There is no technical field that could not benefit from this, including things like playing chess or one's daily routine. The main idea of the book is that checklists take care of the simple, dumb things that we have to do, in order to unclutter our brain for the complex and intuitive work. It enables self discipline and allows for unexpected increases in efficiency. I am certainly considering using in my own life some of the knowledge I gained, and not only at the workplace.

What I could skim from the book, things that I marked as worthy to remember:
  • Do not punish mistakes, instead give more chances to experience and learning - this is paramount to any analytical process. The purpose is not to kill the host, but to help it adapt to the disease. Own your mistakes, analyse them, learn from them.
  • Decentralize control - let professionals assume responsibility and handle their own jobs as they know best. Dictating every action from the top puts enormous pressure on few people that cannot possibly know everything and react with enough speed to the unpredictable
  • Communication is paramount in managing complex and unexpected situations, while things like checklists can take care of simple and necessary things - this is the main idea of the book, enabling creativity and intuition by checking off the routine stuff
  • A process can help by only changing behaviour - Gawande gives an example where soap was freely given to people, together with instructions on how and when to use it. It had significant beneficial effects on people, not because of the soap per sé, but because it changed behaviour. They were already buying and using soap, but the routine and discipline of soap use was the most important result
  • Team huddles - like in some American sports, when a team is trying to achieve a result, they need to communicate well. One of the important checks for all the lists in the book was a discussion between all team members describing what they are about to do. Equally important is communicating during the task, but also at the end, where conclusions can be drawn and outcomes discussed
  • Checklists can be bad - a good checklist is precise, to the point, easy to use. A long and verbose list can impede people from their task, rather than help them, while vague items in the lists cause more harm than good
  • A very important part of using a checklist system is to clearly define pause points - they are the moments at which people take the list and check things from it. An undefined or vaguely defined pause point is just as bad as useless checklist items
  • Checklists are of two flavours - READ-DO, like a food recipe, with clear actions that must be performed in order, and DO-CONFIRM, where people stop to see what was accomplished and what is left to do, like a shopping list
  • A good checklist should optimally have between five and nine items - the number of items the human brain can easily remember. This is not a strong rule, but it does help
  • Investigate failures - there is no other way to adapt
  • A checklist gotcha is the translation - people might make an effort to make a checklist do wonders in a certain context, only to find that translating it to other cultures is very difficult and prone to errors. A checklist is itself subject to failure investigation and adaptation
  • Lobbying and greed are hurting us - a particularly emotional bit of the book is a small rant in which the author describes how people would have jumped on a pill or an expensive surgical device that would have brought the same great results as checklists, only to observe that people are less interested in something easy to copy, distribute and that doesn't bring benefits to anyone except the patients. That was a painful lesson
  • The star test pilot is dead - there was a time when crazy brave test pilots would risk their lives to test airplanes. The checklist method has removed the need for unnecessary risks and slowly removed the danger and complexity in the test pilot work, thus destroying the mythos. That also reduced the number of useless deaths significantly.
  • The financial investors that behave most like airline captains are the most successful - they balance their own greed or need for excitement with carefully crafted checklists, enabling their "guts" with the certainty that small details were not missed or ignored for reasons of wishful thinking
  • The Hudson river hero(es) - an interesting point was made when describing the Hudson river airplane crash. Even if the crew worked perfectly with each other, keeping their calm in the face of both engines suddenly stopping, calming and preparing the passengers, carefully checking things off their lists and completing each other's tasks, the media pulled hard to make only the pilot a hero. Surely he denied it every time and said that it was a crew effort because he was modest. Clearly he had everything under control. That did not happen and it also explains why the checklist is so effective and yet so few people actually employ it. We dream of something else
  • We are not built for discipline - that is why discipline is something that enables itself. It takes a little discipline to become more disciplined. A checklist ensures a kind of formal discipline in cases previously analysed by yourself. It assumes control over the emotional need for risk and excitement.
  • Optimize the system, not the parts - it is always the best choice to look at something as a whole and improve it as a whole. The author mentions an experiment of building a car from the best parts, taken from different companies. The result was a junk car that was not very good. The way the parts interact with one another is often more important than individual performance

I am ending this review with the two YouTube videos on how to use and how not to use the WHO Surgical Safety Checklist that Atul Gawande created for surgical team all around the globe.



and has 0 comments

I've stumbled upon the Latvian Gambit and wanted to test it immediately against my colleagues. As you will see in the video, it seems a wonderfully aggressive opening, something akin to Shock and Awe, riddled with traps against your opponent. The truth is that it is an unprincipled opening, abandoning material advantage in the hope that your adversary will slip up and expecting you to have the skills to attack and defend accurately as the game progresses. I did manage to capture the queen once, but only after pointing out to my opponent that he could have forked my king and rook, so that the trap would work - he hadn't noticed. In the rest of the games, none of them running the course of the video you will see, the lack of skill on both sides of the table forced me to abandon this gambit for now, instead looking for something more principled and more appropriate for my playing level.

So here is the game from TheChessWebsite:

[youtube:2flPdsk9uz4]

I've experimented with chess engines and watched other videos about the gambit and constructed a rather complex PGN file. You can play with it here. Don't forget to click on the variations to see how the game could progress. There is even a full game there, from a video that has the link in the comment.
[Event "The Latvian Gambit"]
[Site "Siderite's Blog"]
[Date "2012.04.18"]
[Round "?"]
[White "Siderite"]
[Black "Siderite"]
[Result "0-1"]
[BlackElo "2400"]
[ECO "C63"]
[Opening "Spanish"]
[Time "13:45:38"]
[Variation "Schliemann, 4.Nc3 fxe4 5.Nxe4 Nf6"]
[WhiteElo "2400"]
[TimeControl "0+60"]
[Termination "normal"]
[PlyCount "11"]
[WhiteType "human"]
[BlackType "human"]

1. e4 e5 2. Nf3 f5 3. Nxe5 (3. Bc4 3. .. fxe4 4. Nxe5 Nf6 (4. .. Qg5 5. d4
Qxg2 6. Qh5+ g6 7. Bf7+ Kd8 8. Bxg6 Qxh1+ 9. Ke2 c6) (4. .. d5 5. Qh5+ g6
6. Nxg6 hxg6 7. Qxg6+ (7. Qxh8 Kf7 8. Qd4 Be6 9. Bb3 Nc6 10. Qe3 Bh6 11. f4
Nge7) 7. .. Kd7 8. Bxd5 Nf6 9. Nc3 Qe7) 5. Nf7 Qe7 6. Nxh8 d5 7. Be2 (7.
Bb3 Bg4 {White loses the queen, one way or another} 8. f3 exf3+ 9. Kf2 Ne4+
10. Kf1 (10. Kg1 f2+ 11. Kf1 Bxd1) 10. .. fxg2+ 11. Kxg2 Bxd1)) (3. Nc3 3.
.. Nf6 {Continue as for the king gambit (reversed)}) (3. exf5 3. .. e4 4.
Ne5 Nf6 5. Be2 d6 6. Bh5+ Ke7 7. Nf7 Qe8 8. Nxh8 Qxh5 9. Qxh5 Nxh5) (3. d4
fxe4 4. Nxe5 Nf6 5. Bg5 d6 6. Nc3 dxe5 7. dxe5 Qxd1+ 8. Rxd1 h6 9. Bxf6
gxf6) 3. .. Qf6 (3. .. Nc6 4. Qh5+
{https://www.youtube.com/watch?v=lZHGgEGM6SQ} (4. Nxc6 bxc6 5. exf5 Nf6 6.
d4 d5 7. Bd3 Bd6 8. Be3 O-O 9. Nd2 Rb8 10. Rb1 Qe7 11. O-O h5 12. Nf3 Ne4
13. Bxe4 dxe4 14. Ng5 Bxf5 15. Qxh5 Rf6 16. Nh3 Qd7 17. Bg5 g6 18. Qh4 Rf7
19. Nf4 Rh7 20. Qg3 Kg7 21. Qc3 Rbh8 22. d5+ Kg8 23. h3 {correct move dxc6}
Bxh3 24. Qxc6 (24. Nxh3 Rxh3 25. gxh3 Rxh3) 24. .. Bf5 25. Nh3 Bxh3 26. Bf6
Bxg2 {Bh2+ would have been mate in 4} (26. .. Bh2+ 27. Kxh2 Bxg2+ 28. Kg3
Rh3+ 29. Kxg2 Qg4#) 27. f4 Qxc6 28. dxc6 Bf3 29. b4 Bxf4 30. Rbe1 Rh1+ 31.
Kf2 R8h2#) 4. .. g6 5. Nxg6 (5. Nxc6 dxc6) 5. .. Nf6 6. Qh4 Rg8 7. Nxf8 Rg4
8. Qh6 Rxe4+ 9. Kd1 (9. Be2 Nd4 10. Nc3 Nxe2 11. Nxe2 Qe7) 9. .. Ng4) (3.
.. Bc5 4. exf5 Bxf2+ 5. Kxf2 Qh4+ 6. Kf3 (6. Kg1 6. .. Qd4#) (6. Ke2 6. ..
Qe4+) (6. g3 Qd4+ 7. Kg2 Qxe5 8. Nc3 Qxf5 9. Bd3 Qf7 10. b3 Nf6 11. Re1+
Kd8 12. Qf3 Nc6 13. Ne4 Qe7 14. Nxf6 Qxf6 15. Qxf6+ gxf6 16. Bb2) 6. .. Nf6
(6. .. Ne7 7. Nc3 d6 8. g3 Qh5+ 9. g4 Qh4 10. Qe1 Qxe1 11. Bb5+ Nbc6 (11.
.. c6 12. Rxe1 cxb5 13. Nd3 Nc6 14. Nxb5) 12. Rxe1 dxe5 13. Rxe5 O-O 14.
Re4 h5 15. h3 Nxf5 16. Bc4+ Kh7 17. gxf5 Bxf5 18. Kg2 Bxe4+ 19. Nxe4 Rae8)
(6. .. b5)) (3. .. fxe4 4. Qh5+ g6 5. Nxg6 Nf6 6. Qe5+) (3. .. d6 4. Qh5+
g6 5. Nxg6 Nf6 6. Qh4) 4. Nc4 (4. d4 d6 5. Nc4 fxe4 6. Nc3 Qg6 7. f3 exf3
8. Qxf3 Nc6 9. Bd3 Qg4) 4. .. fxe4 5. Nc3 Qf7 (5. .. Qg6 6. d3 exd3 7. Bxd3
Qxg2 8. Be4 Qh3 {At this point black has not developed and is lost}) 6. d4
(6. Nxe4 d5) 0-1



Update: Here is another analysis of the Latvian Gambit, by Abby Marshall.
Roman Dzindzichashvili considers the Latvian gambit a sign of mental illness.
Chessexplained also has a video about it.

It was long overdue for me to read a technical book and I've decided to go for a classic from 1999 about refactoring, written by software development icons as Martin Fowler and Kent Beck. As such, it is not a surprise that Refactoring: Improving the Design of Existing Code feels a little dated. However, not as much as I had expected. You see, the book is trying to familiarize the user with the idea of refactoring, something programmers of these days don't need. In 1999, though, that was a breakthrough concept and it needed not only explained, but lobbied. At the same time, the issues they describe regarding the process of refactoring, starting from the mechanics to the obstacles, feel as recent as today. Who didn't try to convince their managers to allow them a bit of refactoring time in order to improve the quality and readability of code, only to be met with the always pleasant "And what improvement would the client see?" or "are there ANY risks involved?" ?

The refactoring book starts by explaining what refactoring means, from the noun, which means the individual move, like Extract Method, to the verb, which represents the process of improving the readability and quality of the code base without changing functionality. To the defense of the managerial point of view, somewhere at the end of the book, authors submit that big refactoring cycles are usually a recipe for disaster, instead preaching for small, testable refactorings on the areas you are working on: clean the code before you add functionality. Refactoring is also promoting software testing. One cannot be confident they did not introduce bugs when they refactor if the functionality is not covered by automated or at least manual tests. One of the most important tenets of the book is that you write code for other programmers (or for yourself), not for the computer. Development speed comes from quickly grasping the intention and implementation when reading, maintaining and changing a bit of code. Refactoring is the process that improves the readability of code. Machines go faster no matter how you write the code, as long as it works.

The book is first describing and advocating refactoring, then presenting the various refactoring moves, in a sort of structured way, akin to the software patterns that Martin Fowler also attempted to catalog, then having a few chapter written by the other authors, with their own view of things. It can be used as a reference, I guess, even if Fowler's site does a better job at that. Also, it is an interesting read, even if, overall, it felt to me like a rehearsal of my own ideas on the subject. Many of the refactorings in the catalog are now automated in IDEs, but the more complex ones have not only the mechanics explained, but the reasons for why they should be used and where. That structured way of describing them might feel like repeating the obvious, but I bet if asked you couldn't come up with a conscious description of the place a specific refactoring should be used. Also, while reading those specific bits, I kept fantasizing about an automated tool that could suggest refactorings, maybe using FxCop or something like that.

Things I've marked down from the book, in the order I wrote them down in:
  • Refactoring versus Optimization - Optimizing the performance or improving some functionality should not be mixed up with the refactoring of code, which aims to improve readability of code while preserving the initial functionality. Mixing them up is pitting the two essential stages of development one against the other.
  • Methods should use their data of their own object - one of the telltales of need to refactor is when methods from an object use data from another object. It smells like the method should be moved in the responsibility of that other object.
  • When it is easy to refactor, choose a simple design - Of course the opposite is true, as well: when you know it will be hard to refactor a piece of code, try to design it first. If not, it is better to not add unnecessary complexity. This is in line with the KISS concept.
  • Split your application into self encapsulated parts - One of the ways to simplify refactoring is to separate your application into bits that you can manage separately. If you didn't design your application like that, try to first split it, then refactor.
  • Whenever you need to write a comment, consider extracting a method with a meaningful name - or renaming methods to be more expressive.
  • Consider polymorphism when seeing a switch statement - Now that is an interesting topic in itself. Why would polymorphism help here? How could it be simpler to understand than a switch/case statement? The idea behind this is that if you have a switch somewhere, you might have it somewhere else as well. Instead of taking decisions inside each method, it is better to split that behaviour in separate classes, each describing the particular value that the switch would have operated on.
  • Test before refactoring - this would have been drilled in your head already, but if not, the book will do that to you. In order to not add faults to the program with the refactoring, make sure you have tests for the existing functionality, tests that should pass after the refactoring process, as well.
  • The Quantity pattern - Review the Quantity pattern in order to improve readability and encapsulate simple common actions performed on specific types of units.
  • Split conditionals into methods - in other words try to simplify your conditional blocks to if conditionMethod() then ifMethod() else elseMethod(). It might seem a sure way to get to a fragmented code base, with small methods everywhere, but the idea is sound. A condition, after all, is an intention. Encapsulate it into a well named method and it will be very clear what the programmer intended. Maybe the same method will be used in other places as well, and then, using polymorphism, one can get rid of the conditional altogether.
  • Use Null objects - an interesting concept that I haven't even considered before. It is easy to recognize the need for a Null object when there are a lot of checks for null. if x==null then something() else x.somethingElse() would be turned into a simple x.something() if instead of null, x would be an object that represents empty, but still has attached behavior. An interesting side effect of this is that often the Null object can be made an immutable singleton.
  • Code inside Assertions always executes - This is a gotcha I found interesting. Imagine the following code: Assert.IsTrue(SomeCondition()) Even if the Assert object is designed to not execute anything in Release mode, only compiled in Debug, the method SomeCondition() will execute all the time. One option is to use an extra condition: Assert.IsTrue(Assert.On&&SomeCondition()) or, in C#, try to send an expression: Assert.IsTrue(()=>SomeCondition())
  • Careful when replacing method parameters with parameter object in parallel processing scenarios - Which nowadays means always. Anyways, the idea is that old libraries designed for parallel processing used large value parameter lists. One might be inclined to Introduce Parameter Object, but that introduces a reference object that might lead to locking issues. Just another gotcha.
  • Separate Modifier from Query - This is a useful convention to remember. A method should either get some information (query) or change some data (modifier), not both. It makes the intention clear.

That's about it. I have wet dreams of cleaning up the code base I am working on right now, maybe in a pair programming way (also a suggestion in the book and a situation when pair programming really seems a great opportunity), but I don't have the time. Maybe this summary of the book will inspire others who have it.

and has 0 comments
This is the second book by William Golding that I am reading. Unbeknownst to me, it is part of a trilogy! Even Nobel prize winners for Literature seem to can't help but write the damn things. How is one to finish reading all they want to read?! Anyway, the guy wrote Lord of the Flies, reason for the Nobel and a story I enjoyed both as book and movie. Rites of Passage has many similarities with that book. It happens at sea, on a ship, not on an island, but just as removed from the normal rules of civilised society. It reveals dark depths of human morality. It exposes hypocrisy and narrow mindedness. Golding also won an award for it, the Booker prize this time.

So, what is it about? There is this nobleman, godson of an unidentified but very important man, travelling on a ship from England to "the Antipodes" where he is to take an important state office. The guy is the highest socially elevated person on the ship, giving him some sort of equal footing with the captain himself, who is normally king and church on his ship. Now, the book appears as the journal of said guy, of the name of Talbot, written to his godfather, as a means to thank and humour the man, restricted in his own life by the gout disease. That is where the book is at its most difficult: the language is that of an Englishman noble from the 19th century, with antiquated words and funny ways of turning them into sentences. I pride myself on having understood and finished it, but now, that I know it is part of a trilogy, I am a bit disconcerted.

Anyway, the journal of Talbot presents us with the marvellous world of a ship at sea, forcing the reader to both empathise with the man, but also share some of his opinions of the lower castes and of the social system. We get to share his view of the current events as well. He thinks of himself as noble, intellectually and morally superior to other people on the ship, while exercising a benevolent and understanding indulgence at the actions of others. He truly seems to be the most intellectual person on board, as educated in comparison with others as a college graduate is to a four grade drop out. However, he is a bit of a dick, full of condescension and of the weaknesses of all men.

The main moral of the story is that his arrogant views on the world of the ship are reasonable, if taking as true the presuppositions he makes as member of his social class and having his position on the ship. However, they are completely wrong as related to what really happened. We understand this in the second half of the book, where he relates the contents of another man's journal, who's perspectives on the situations turn our perceptions on their head. Also, the finale is quite grotesque, revealing that his blindness to the world around him is, more or less, voluntary and part of the social system he represents.

This is a difficult book to read, but one that opens eyes, so to speak. Not only we get to see how English was meant to be used (bah, Americans! :) ) but also the author is taking us through the recesses of the human mind and society and the experience of the read is a visceral and personal one. If you can handle the language and the slow pace, I recommend reading this book.

There is also a quicker option for the ones who want to see what happens without having to read the books. The To the Ends of the Earth trilogy has been adapted to a miniseries, by the BBC, of course, starring Benedict Cumberbatch.

and has 0 comments
It's been a long time since I've posted a music entry. Here is one from Hanzel und Gretyl, an Industrial Rock band with Nazi overtones singing mostly in German. Actually, I couldn't say what ideology they have, since the band contains two people from New York who are not even German! But I like their music, this one in particular (I've listened to it on repeat for a day or so). Enjoy!