and has 0 comments
I was waiting for the moment when I would be reading a new sci-fi book. Based on a suggestion from some source I have long forgotten, I chose David Brin's Existence, a futuristic hard science fiction book.

And at first it felt good. It described a cyberpunk near future, after some sobering disasters that rallied the world against nuclear war and global warming. It was dialog based, like the books of Asimov. It delved into the political, economical, technical and personal aspects of the world. It even started with the discovery of an alien artefact and started an exploration into the Fermi paradox, the philosophical conundrum that asks: "if there are many civilisation in the galaxy and they all reach the sophistication to go to space, where are they?".

But soon it started to feel all wrong. The different stories were fragmented, in some parts badly written, in some parts conflicting, some never connecting to one another, like Brin got some texts he had worked on and mashed them all into the book. Then the "chapters" all starting with a little media announcement or quote that explained bits of the world, but in a reporter editorial style that said nothing and brought nothing new to the table. And then it started with the goading: an idea was forming, the characters were reaching a realization or another, and before the reader got to see what it was, another chapter was starting.

My conclusion after finishing the book is that, while filled with interesting ideas and also having a main plot that is, indeed, ingenious, this was not a good book! I've spent the time to read the acknowledgements at the end only to find I was right: Brin did publish a lot of the stuff in the book in short stories here and there. And after finishing all that material, he speeded things up to show the "future", because he really had been disconnected from all the stories he started, reaching that annoying fast-forward effect one often finds in the works of writing amateurs. And the thing is, David Brin is not an amateur - at least he shouldn't be after all the books he has written and prizes he has won. One possible reason is that it is the first book after a hiatus of 10 years. I hate to say it, but it looks like he needed some money and this is the way he chose to do it: frame a couple short stories, a couple essays and an old Usenet into a longer novella that feels like the patched mess it actually is.

The bottom line is that I can't recommend this book. The main idea is interesting, but it can be summarized in a few words, which I won't do for fear of spoiling it for you in case you do decide to read Existence.

and has 0 comments

Recently Microsoft released a tool that checks your site for web design issues, with focus on Internet Explorer 10. So I've added a few things, like more thorough gradients for the important quotes, touch behaviour for Microsoft Touch APIs and a color and logo for the tile that you guys will be placing on your Windows 8 desktop!

But even more importantly, I've found a bug in the chess board algorithm in IE: some of the boards would just show an ugly dialog error and not display anything. I fixed the bug and also made the boards appear only when the screen is scrolled on the PGNs. That means you will be able to open chess posts or even the chess category, even in IE, with the caveat that you will experience slower scrolling as each PGN becomes visible. On Chrome and Firefox and probably IE9 and IE10 there will be no visible delays, but I am still using Internet Explorer 8, so for you Windows XP guys, there is a huge usability increase!

and has 1 comment
As you may have guessed from my previous chess posts, I am a chess beginner and a gambiteer. I like to play the strange moves and see my opponents squirm in positions that they were not expecting and were not prepared for. That is why the proposition in this post is gambit galore and also to be taken with a grain of salt.

My idea is that there could be common themes for the three Gambits in the title, since they start almost the same way. You have the Smith-Morra Gambit, where White answers Black's Sicilian Defence with d4 and then c3 in the accepted version:1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 * then you have the Danish Gambit, where White's move order is the same in response to King's pawn defence: 1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Nxc3 * and then there is the similar response from Black to the King's pawn opening, called the Elephant gambit: 1. e4 e5 2. Nf3 d5 3. exd5 *

You might notice that in the Elephant, I did not offer up a second pawn on c6. This is because the main line is pawn to e4 and also White has the opportunity to take e5 with the knight, which is the computer recommendation as well. The problem is that after Black's response Qe2 to the main line or the Bd6 computer recommendation after Nxe5, the Elephant doesn't appear at all like the Danish/Morra and, instead, threads into its own territory, somewhere closer to the Latvian gambit, but not by much. However, in this post I will be stretching the imagination and will be trying to squish the big Elephant into the Morra mold and see where it takes me.

I have just finished watching a two hour video presentation of the Morra accepted line, by IM Andrew Martin, and there are also a lot of tutorials for the Danish, from beginner to very advanced levels. Not so for the Elephant, which seems to be even less favoured than the Latvian, to which GM Roman Dzindzichashvili answered with a refutation and some very rude words to its efficacity. All that I could find about it are lines that have no connection with the Danish/Morra style and that is because of that pesky White knight on f3.

If my thesis holds ground, then I will be talking here about a chess system that has some similar ideas and theory for at least three major openings: The Sicilian Defence and King's pawn for both White and Black! Also, threading on less travelled ground, there is a good chance online and club players will be unnerved by it.

So let's get into it. I will start with the Smith-Morra main line. This means the most played version in database games, by players who know theory and open that way because it was proven to be the best way. There is little chance you will see the same moves in club level games.

1. e4 c5 2. d4 cxd4 3. c3 dxc3 4. Nxc3 Nc6 5. Nf3 d6 6. Bc4 e6 7. O-O Nf6 8. Qe2 Be7 9. Rd1 e5 10. h3 O-O 11. Be3 a6 12. Rac1 *

This is the position in which White wants to get. I tweaked a little the game so that at move 11. Black moved to the second most used line in the database, the a6 system, rather than Be6 and exchange light bishops. What I want to evidence here is the position of the White pieces: both rooks are connected and on open or semi-open files, cramping Black's development, the bishops are out and about, aiming at the Black king, the knights are developed and the queen is on a very crucial square, controlling yet another file and the essential e2-c4 diagonal.Black has not finished development, has pinned pawns and weaknesses like b6 where a knight may find outpost. There is a lot of potential for attack and, even before reaching this position, a lot of possible traps in which Black could fall. Even the main line has only about 100 games in the database at this point, so it is not very common, even if it is a pretty solid opening.

Let's move to the Danish and compare.

1. e4 e5 2. d4 exd4 3. c3 dxc3 4. Nxc3 Nc6 5. Bc4 Nf6 6. Nf3 d6 7. Qb3 (7. O-O Be7 8. Qe2 O-O 9. h3 a6 10. Rd1 b5 11. Bb3) 7... Qd7 8. Ng5 Ne5 9. Bb5 c6 10. f4 cxb5 11. fxe5 *

Seems to be a different beast altogether. I've added a variation that plays like the Morra, the single game in the database like that (Sipek-Urbanec 1995). The b5 push is also found in the Morra. So, what are the differences here? The most important to me seems the absence of the Black pawn on e6. That means White can attack much quicker and Black must defend more aggressively, too. The e4 pawn is unopposed and, in some games, that proves decisive for White. The pawn on c7 is still there, so the Black queen will have to maneuver on light squares instead of dark.

A possible conclusion would be that, even if they seem similar, the Danish and Morra gambits are quite different. But are they?

A White queen on e2 would support the e4 pawn in its push forward and make room for a rook on d1, just like in the Morra. The dark bishop can pin or eventually trade with the knight on f6 or even move to e3 or f4, supporting the e4 pawn as it moves to e5 and making room for a rook on c1. A computer analysis on a Danish game played in the Morra fashion shows equality when Black still has an extra pawn.

Now, some of the readers may scoff and conclude that I am trying to fit the proverbial triangle shape into the round hole using brute force, that attempting to take one opening and play it like another is an imperfect chimera, destined to be an abomination. However, I must remind you that I am not a master player, nor a professional one. I have no time to learn tons of theory just to win a game. My purpose for this research (which may still fail to achieve anything) is to find a gambit based system that uses the same principles for any opponent response. In time, each variation can be improved and branched off from the main system, but at the start all I need is for it to work.

Let's get back, then. How about playing a Morra game in the Danish way? Well, the Danish gambit is even rarer than the Smith-Morra and the games in my database are primarily focused on the exposed f7 square. It could work, I guess, but it would seem even more unnatural and, lacking proper theory, a beginner like me could easily mess it up. I will, therefore, use the Morra as the template to which all others must conform.

Besides, if you think fitting the Danish to the Morra was difficult, the Elephant comes next!

In the database there are only two games that start like a Morra Elephant and they both are won by White, which is not good for us. Only when it gets to the standard position of knight protecting the single center pawn, the transposed games suddenly reach 73! It seems this position can be more easily achieved by playing the Scandinavian defence! In the next board I will present the main line for the Elephant, then the Morra Elephant and at the same time the way to reach the same position from the Scandinavian. The rest will continue from the Elephant line, but, actually, it will be based more on Scandinavian games.

1. e4 e5 (1... d5 {The Scandinavian Defence} 2. exd5 c6 3. dxc6 Nxc6 4. Nf3 e5 {And we reach the position would would have liked from the Morra Elephant.}) 2. Nf3 d5 3. exd5 e4 (3... c6 {And here is a Morrafication of the Elephant} 4. dxc6 Nxc6 5. Bb5 Bd6 6. O-O Nge7 7. d4 e4 8. Ne5 Bxe5 9. dxe5 O-O 10. Qxd8 Rxd8 11. Nc3 Nxe5) 4. Qe2 {This is how the Elephant is mainly played.} Nf6 5. Nc3 Be7 6. Nxe4 O-O 7. d3 Nxd5 8. Qd1 Nc6 9. Be2 Bf5 10. O-O Qd7 *

Ooh! This seems completely different. White still has that extra tempo and he uses it to pin the Black knight on c6, which leaves e5 undefended. Black's bishop on f8 did not have time to get out, so moving the queen on e7 like in the Morra would block it and the entire king side. The move Bd6 is the only one that can defend the pawn and this gives White at least the opportunity to swap the bishop with the knight and mess up the Black pawn structure on the queen side. If White does not take, as in the example above, then the only possible move to protect the knight is to use the other knight on e7, thus forever altering the structure of the game.

It seems no amount of force will twist the Elephant into a Morra gambit a tempo behind. A Morra with a lost tempo doesn't even appear to work! Besides, in order to get here, White had to ignore the opportunity in the beginning to take on e5 with the knight, as suggested by the computer; a much safer route to the same dysfunctional position can be achieved from the Scandinavian defence.

The Elephant hides some interesting traps that have nothing to do with the Morra or the Danish and has more in common with the Latvian gambit that with the two systems above. The Latvian, if you remember, offers up two pawns in order to gain the tempo White is awarded in the start of a chess game. The Elephant can be played in the same way, only to lose two center pawns, so not so good. The similarities with the Morra/Danish are deceiving. A tempo behind, Black cannot use the same ideas, having to defend instead of attack.

Conclusion: It is a very difficult thing to find a defence for Black that works the same way as an opening for White, because of the extra tempo. Even so, the Elephant only begins like the Morra, it has nothing else in common. The Morra gambit itself is only similar to the Danish and, while I think they can be molded in the same shape, it would be a tortuous adventure that I am not sure will get me where I want.

I hope you have gained a little understanding of the differences between the three gambits and how simple differences like the position of a pawn or an extra tempo can change a game of chess.

and has 0 comments
We live now in a world where people get the same education, see the same movies, read the same books - if at all. We then watch the ones around us and see only ourselves and we get bored. That is why, I believe, we start to see various mental illnesses or strange behaviours as interesting. That is why, I think, The Drowning Girl, by Caitlín R. Kiernan has received so wonderful reviews.

That doesn't mean the book is not brilliant. Kiernan paints the world as seen from the eyes of a lesbian paranoid schizophrenic, combining ideas from paintings, old legends and written stories into a whirlpool of staggering creativity. However, I do have to wonder, would the book have received the same amount of positive reviews if the main character was a straight man?

All that aside, I have tried to keep an open mind when reading the book and I have found that the way the author mingles stories and goes back and forth, keeping the reader on their tows, is both excellent and terribly irritating. It builds up a lot of tension that needs to be released into a grand finale. However, the climax of the book seemed to me to be somewhere in the middle, with the ending lagging and wasting into pointless mental delusions.

It is hard for me to recommend or not recommend this book. It is clearly well written and very inspired. It not only delightfully weird, but also draws information and data from all kinds of art fields and mingles them together in an interesting way. The construction of the book aside, though, leaves a plot that doesn't really mean anything. It's the maelstrom of thoughts and feelings of a mentally troubled person with a slight mystical component which, even till the end, is not really clear if it is only in her mind or has some factual truth.

I did enjoy one thing, though, the idea that something can be "true", but not "factual". If you think about it, it makes sense, but usually words like "truth" hold an objective mask on them, when most of the uses of those words are actually subjective. Yep, it's true :) I also liked the way details about the artists led to connections to other works and facts, that a thorough analysis of art can show hidden worlds and interesting perspectives.

As a conclusion, what leapt into mind when trying to find a book that is similar to this was Geek Love, by Katherine Dunn. In a word: freaky. The Drowning Girl is much more interesting, though, and doesn't try so hard to shock with the character's sexuality or personal weirdness. But in the end, having read it, I felt like it said nothing. An interesting journey towards nowhere in particular.

We all know that the best way to prevent SQL injection is to use parameters, either in stored procedures or in parameterized queries. Yet on some occasions we meet code that replaces every single quote with two single quotes. The question arises: OK, it's ugly, but isn't it enough?

I have recently found out of something called "Unicode Smuggling" which uses the database against itself to bypass protection as described above. More details here: SQL Smuggling , but the basic idea is this: if the replacement scheme is implemented in the database and uses VARCHAR or maybe the code uses some non-unicode string, then the protection is vulnerable to this by leveraging what is known as Unicode Homoglyphs. If you feel adventurous and want to examine thoroughly the ways Unicode can be used maliciously, check out UTR#36.

Here is an example:
CREATE PROC UpdateMyTable
@newtitle NVARCHAR(100)
AS
/*
Double up any single quotes
*/
SET @newtitle = REPLACE(@newtitle, '''','''''')

DECLARE @UpdateStatement VARCHAR(MAX)

SET @UpdateStatement = 'UPDATE myTable SET title=''' + @newtitle + ''''

EXEC(@UpdateStatement)

Note the use of VARCHAR as the type of @UpdateStatement. This procedure receives a string, doubles all single quotes, then creates an SQL string that then is executed. This procedure would be vulnerable to this:
EXEC UpdateMyTable N'ʼ;DROP TABLE myTable--'

The first character in the provided string is not a single quote, but the Unicode character U+02BC . SQL will silently convert this into a single quote when stored in a VARCHAR. The injection will work.

Small demo in MS-SQL:
DECLARE @nhack NVARCHAR(100) = N'ʼ;DROP TABLE myTable--'
DECLARE @hack VARCHAR(100) = N'ʼ;DROP TABLE myTable--'
SELECT UNICODE(@nhack),UNICODE(@hack) -- Results: 700 39

More discussing this here: Can I protect against SQL Injection by escaping single-quote and surrounding user input with single-quotes?

I've often encountered this situation: a stored procedure needs to display a list of records ordered by a dynamic parameter. In Transact SQL, the Microsoft SQL server, one cannot do this elegantly in any way. I will list them all and tell you what the problem with each is.

First of all, let's start with an example. Assume we have a table called Test with a lot of rows, which has a datetime column which has an index on it. Let's call that TheDate to avoid any SQL keywords. We want to do something like this:
SELECT TOP 10 * FROM Test ORDER BY TheDate ASC

Notice that I want to get the top 10 rows, which means I only need a small part of the total. I also order directly by TheDate. In order to release a piece of code we also need to test it for performance issues. Let's look at the execution plan:


Now, let's try to order it dynamically on a string parameter which determines the type of the sort:
SELECT TOP 10 * FROM Test ORDER BY CASE WHEN @sort='ASC' THEN TheDate END ASC, TheDate DESC

As you see, I've used CASE to determine the sort order. There is no option to give a parameter as the sort order. The execution plan is this:


Surprise! The execution plan for the second query shows it is ten times slower. What actually happens is that the entire table is sorted by the case expression in a intermediate table result, then 10 items are extracted from it.

There must be a solution, you think, and here is an ingenious one:
DECLARE @intSort INT = CASE WHEN @sort='ASC' THEN 1 ELSE -1 END
SELECT TOP 10 * FROM Test ORDER BY CAST(TheDate AS FLOAT)*@intSort ASC

I transform the datetime value into a float and then I use a mathematical expression on it, multiplying it with 1 or -1. It is the simplest expression possible under the circumstances. The execution plan is:


Bottom line, there is no exception to the rule: when you order by an expression, SQL Server does not use indexes, even if the expression is easily decompilable. Don't get mislead by the apparent functional programming style of SQL syntax. It doesn't really optimize the execution plan in that way.. Even if the column is an integer, it will not work. Ordering by TheInteger is fundamentally faster than ordering by -TheInteger.

And now the solution, ugly as it may be (imagine the select is a large one, with joins and where conditions):
IF @sort='ASC' 
BEGIN
SELECT TOP 10 * FROM Test ORDER BY TheDate ASC
END
ELSE
BEGIN
SELECT TOP 10 * FROM Test ORDER BY TheDate DESC
END

Yes, the dreaded duplication of code. But the execution plans are now equivalent: 50%/50%.

This post was inspired by real events, where the production SQL server went into overdrive trying to create and manage many temporary result tables from a stored procedure that wanted to avoid duplication using the CASE method.

Update: there is, of course, another option: creating an SQL string in the stored procedure that is dynamically modified based on the sort parameter, then the SQL executed. But I really dislike that method, for many reasons.

More information from another blogger: Conditional Order By. They also explore rank using windows functions and in one of the comments there is a reference to SQL 2008 "Grouping Sets" which I have not covered yet.

and has 0 comments
You know the format, let's get this out of the way. First, the series I've already been talking about:



  • Doctor Who - a weird Christmas special introduced another companion. She is cute and perky and doesn't take commands well. Also, she dies twice already. It doesn't seem to stop her.
  • Torchwood - no Christmas special and no news on a fifth season. I wonder if it will ever reappear.
  • Criminal Minds - still on hold, but not totally rejected yet.
  • Dexter - A weird seventh season sees Dexter in love, running away from mobsters and being helped by his police sergeant to cover up kills or even commit them. Then it all ended in a ridiculous fashion. Hint: watch Dexter's face when Deb jumps at the recently shot person in the last episode: it seems to say That is NOT how this is done! Stop it, just stooop!
  • Fringe - Fringe is not better. I still watch it in order to avoid sci-fi withdrawal symptoms.
  • True Blood - I can't wait for season 6. I do fear for its quality, but I also have high hopes.
  • Weeds - the series has ended, finally, when all life has been squeezed out of it. I am glad it is over.
  • The Good Wife - season 4 is running strong... ish. There are some new ideas introduced in the show that don't really fit well or seem to be needed in the picture, like Kalinda's husband.
  • Haven - season 3 of Haven pits Audrey against a killer that takes people's skins. And she is also to disappear on a certain date in order to stop the troubles. And she is also courted by two guys who are insanely in love with her. What is a girl to do?
  • Lost Girl - removed from my watching list.
  • Falling Skies - season three has not started yet. I am curious how it will continue. Plus it's sci-fi.
  • Southpark - some funny episodes in the October batch. Could have been better. Still good.
  • The Killing - still on my watch list, being a police show and all.
  • Suits - third season is about to start. It doesn't make much sense, but I like it.
  • Breaking Bad - the fifth season has ended and there will not be a sixth. Still haven't had the inclination to watch it.
  • Californication - the sisth season is about to begin. I can't wait.
  • Beavis&Butt-head - It seems the show was quietly axed. I haven't heard anything about it for a long time.
  • Homeland - I've seen two seasons of Homeland and it's pretty cool. Claire Danes is a bipolar CIA agent that fights to prove an American soldier rescued from the Talibans has been turned. She is also in love with him. Not much sense when you put it that way, but a lot of tension. The show is another American adaptation from an Israeli show.
  • The Walking Dead - pretty hard stuff added this season, making it interesting again. Some characters even die! Almost got to "want" status.
  • Game of Thrones - the show follows the books faithfully, even when removing some bits or rearranging others. However I feel it failed to fully capture the atmosphere of the book. We'll see how it goes.
  • L5 - no second episode for a long time now and with the current economic climate, I doubt it will continue. Too bad.
  • Mad Men - season six is to premier in 2013. I will keep watching it, because it is just great.
  • Misfits - all new characters in Misfits, with some stories interesting, but now more towards shocking and/or disgusting. I've removed the "want" status from it, because the quality of the show is not as great as when it started.
  • Sherlock - the third season of the series will begin probably late 2013. I liked it, even if a bit too... Moffaty? I really don't want to see more and more people acting like Doctor Who. One is enough.
  • Spartacus - Vengeance - War of the Damned will start soon, in January. Too bad it ends the show, but then again, maybe it will be something meaningful and slim, without boring filler episodes.
  • My Babysitter's a Vampire - vampire teens, with seer and wizard friends and fighting against the evil in their highschool? It's silly, but at least it knows it is silly. I watch it because it is easy fun.
  • Continuum - a second season has been confirmed, but I don't know when it will start. Rather boring, but sci-fi, you know.
  • Copper - a BBC America drama about Irish immigrants set "Five Points". I really liked it, with its depiction of rampant corruption and racism and classism at the beginnings of the city of New York.
  • Longmire - a second season has been confirmed. I really like the show, even if about a rural cop in the middle of nowhere.
  • Political Animals - it feels interesting and profound, but it is not really so. The impression is strong, though, and I may still had watched it if it weren't cancelled.
  • The Newsroom - my wife loves this. I will watch the second season, but I can't decide if I like it or not.

And now for new shows:

  • 666 Park Avenue - A show about the devil! I haven't started watching it, and it was cancelled already.
  • A Young Doctor's Notebook - This is not really a series, but a mini series. Four episodes, each 20 minute long, about a Russian freshly graduated doctor coming to work in a really remote village. The show is brutal and funny at the same time. I doubt there will be a second season, but this one is worth it. Starring John Hamm and Daniel Radcliff.
  • Arrow - I watch this, even if I don't really know why. It is yet another superhero series where the main strength of the guy is that he shoots arrows. I can't recommend it.
  • Beauty and the Beast - Incredibly beautiful people acting as both beauty and beast in this ridiculous show that attempts to place the story in modern times. The beauty is, obviously, a cop.
  • Blackout - God know I tried to like this show about political and personal corruption in England, but I couldn't. It starts bleak and intense, but quickly devolves into the surreal.
  • Battlestar Galactica - Blood and Chrome - so far William Adama is introduced as a young and cocky pilot in a series of webisodes. The show has everything I loved about the first two seasons of BSG 2004. I can't wait for more.
  • Elementary - the American Sherlock doesn't look or feel at all like a Sherlock. Instead it looks and feels exactly like so many US shows about gifted people helping the police. I still watch it, but the show is really not what it should have been.
  • Emily Owens M.D. - I was caught into one of those times when one wants to see a true doctor show, with actual cases and medical dilemmas. No. Instead this crappy show seems like the poor brother of Gray's Anatomy, with those silly happy songs in the background whenever the female protagonist speaks with other women that are not her evil boss or highschool nemesis (I am not kidding, they added the highschool nemesis thing)
  • Hatfields and McCoys - This American Civil War miniseries was filmed in Romania and stars Kevin Costner. I really wanted to see it, but didn't get around to it, yet.
  • Hit and Miss - A new show I really know nothing about. Six episodes so far.
  • Hunted - Oh, Melissa George as a secret undercover agent (and I do mean undercover). Beautiful, smart, trained to kill and yet fragile as a woman, she leads the show well until... it is put on hold! BBC really screwed up abandoning this show. Cinemax is in negotiations to continue doing it, in collaboration with BBC. Fingers crossed.
  • Last Resort - The show started really well. An American submarine is ordered to nuke Pakistan, but through a secondary network. They request that the order be sent via the primary network, and they are shot upon. They manage to escape and hold fort on a remote island, threatening to launch on any country that even approaches the island. A great premise with very good actors. Unfortunately, the show started to lag a little, then suddenly was cancelled. I would like to believe that it was a nerve they touched with the script, but more likely there are too many stupid people deciding to watch reality shows instead.
  • Made in Jersey - they tried to make "Working Girl" a series, with a New Jersey girl, no less, making it as a lawyer in the big city. It was a complete flop and it was quickly cancelled.
  • Parade's End - another miniseries. The trailer looks really promising and I haven't read the book. As soon as I watch it you will know.
  • Primeval - New World - I can't really say I don't want to see it. It is the American continuation or spin off from the British Primeval show. But it just feels bad in every way, even if Zane from Eureka stars as the lead character.
  • Restless - a miniseries. A young woman finds out that her mother worked as a spy for the British Secret Service during World War II and has been on the run ever since. The synopsis sounds interesting. Two episodes so far, that I have yet to watch.
  • Revolution - can you imagine a sci-fi show that I refused to watch? This is a horrible show, something that combines Xena with Flash Forward. Yes, it is possible. And it sucks!
  • Ripper Street - this is not yet another Jack the Ripper show, instead it is set just after the killings stopped. A bit like Copper, with the police force of the time solving gruesome murders. Haven't got around to watch it, but it might be nice.
  • Secret State - a British miniseries starring Gabriel Byrne. Four episodes, rather captivating, but lacking a proper resolution. Not to mention a happy ending, which British seem to avoid completely :)
  • The Fear - A Brighton crime boss turns entrepreneur and then he goes crazy. Like mentally ill crazy. I haven't started watching this miniseries, but it might be interesting.
  • The Mob Doctor - another promising series that gets cancelled for no good reason. This doctor woman is forced to work for the mod in order to get her younger brother out of debt. She is a brilliant doctor and she has to jumble her official cases with the off the ledger ones. Really interesting, even if a bit bland.
  • Transporter - they decided to do a Transporter series. I couldn't get through half of the first episode. Everything that Jason Statham did well in the show, the ridiculous and pompous ass they placed as a lead did wrong. Every good redeeming quality of a movie that, let's face it, wasn't that great is lacking here. Avoid this waster of time!
  • Vegas - Well, if we have to watch series about cops, at least let them be good ones. Vegas is a good alternative to Longmire, with the action set in the early years of Las Vegas where a farmer and former MP gets to become the sheriff of the town. Interpreted by Dennis Quaid, his character and the local mobster, also well interpreted by Michael Chiklis, make this series interesting and worth watching.
  • Wizards versus Aliens - OK, go ahead: laugh! I did watch a TV series made exclusively for young children where a family of wizards fights a ship of evil aliens set to consume every bit of magic in the galaxy. It is an alternative to The Sarah Jane Adventures, only even sillier. I had fun.

There are several miniseries and shows that just arrived on my radar. No point in discussing something I know nothing about, yet. So far a lot of the shows I loved were cancelled, while stinking refuse of TV series thrive. I am almost to the point of not caring anymore. I hope my short list (yes, I was humblebragging) will help you decide which shows to watch or not watch.

Until the next post in the series about series!

and has 0 comments
I was looking for something on my blog using my iPad and I noticed that the format of the blog was horrible. It used a "mobile" mode by default. That meant no Javascript, fixed width, etc. Pretty nasty. There is a link at the bottom of the page that says "View web version" which changes the "m=1" parameter in the query to 0, which makes it accessible as it should have been.

I will be investigating this and how to address it. Meanwhile, there is the workaround of clicking the link mentioned above.

and has 0 comments
I want to present to you a game I had last night that was both spectacular and really silly :) You know when you look at chess master games and you are either bored by their precision or befuddled by their ingenuity? Well, this is only a really good show, the equivalent of big budget action movies.
1. e4 c5 2. b4 {The Wing Gambit, a weird anti Sicilian move that I want to
master.} cxb4 3. a3 bxa3 4. Bxa3 {At this point White has control of the
center and a developed minor piece. The rook also has a semi open file
available.} a6 5. Bc4 d6 6. Nf3 e6 7. O-O Be7 8. d4 Nf6 9. Re1 O-O 10. Nc3
Nc6 {Even if I wrote a blog entry on the Wing Gambit, I remembered nothing
and my opponent was so terrified that he tried to protect everything with
unnecessary pawn moves.} 11. e5 {I had no plan and it shows. I was planning
to take on e5 with the rook, eventually, or free my queen by actively
moving the knight on f3.} Ne8 12. Bd3 d5 13. Bb2 {I've decided that I
needed that bishop and moved it to protext the defenceless knight. However,
that is no longer an active square for it.}

(13. Bxe7 Qxe7 14. Na4 Nb4 15.
Bf1 b5 16. Nc5 {The computer suggested this weird continuation, were both
knights are trying to find outposts in the opponent's teritory.})

13. .. f6
14. Nh4 {I had come up with a daring stratagem, enacted in the next few
moves. Can you spot it?} Nxd4

(14. .. fxe5 15. Bxh7+ Kxh7 16. Qh5+ Kg8 17.
Ng6 exd4 18. Ne2 Nf6 19. Qh8+ Kf7 20. Nxf8 Qxf8 21. Qh3 Kg8 {Houdini
recommends a different approach for Black, something that would have
brought it into an advantageous position.})

15. Bxh7+ {The attack begins
with a minor piece sacrifice.}

(15. Nxd5 Qxd5 16. Bxd4 f5 17. Nf3 {The
computer had other ideas, which were almost as wild as what I was
considering.})

15. .. Kxh7 16. Qh5+

(16. Qxd4 fxe5 17. Rxe5 Bxh4 18. Rh5+ Kg8 19. Rxh4 Qf6 20. Qxf6 Nxf6 {The computer would have equalized quickly
in this situation, a most boring continuation that I refused out of hand. I
didn't check the king to swap a bishop for a knight.})

16. .. Kg8 17. Ng6 fxe5

(17. .. Nf5 18. Rad1 Nh6 19. Nxd5 exd5 20. Rxd5 Qc7 21. exf6 Bxf6 22.
Nxf8 Bg4 23. Qg6 Bf5 24. Qh5 Qf7 25. Qxf7+ Kxf7 26. Bc1 Kxf8 27. Bxh6 Bxc2
28. Bd2 {A violent variation from Houdini, something that you have to check
out because there is a lot to learn from it. However, the game did not go
that way at all.})

18. Qh8+ Kf7 19. Nxf8 {Here I publicly prove my idiocy.
The position before taking the rook was mate in 6 moves. As such, I got
cold feet at the apex of my attack. Just a few more seconds of thought and
I would have seen the continuation that the computer saw.}

(19. Nxe5+ Kf6
20. Qh4+ g5 21. Qh6+ Kf5 22. Qg6+ Kf4 23. g3# {A beautiful ending and
something that I should have seen. A pawn mate, with the king banished to
my side of the board and none of the Black pieces taken except three
pawns!})

19. .. Bxf8 {Now, my win in this game was almost completely the
merit of my opponent. I did wild and beautiful moves, but none of them were
actually accurate. At each point he could have come up on top, if he played
correctly.}

(19. .. Nf6 20. Rxe5 Qxf8 21. Qxf8+ Bxf8 22. Nxd5 Nf3+ 23. gxf3
exd5 24. Re3 {The computer would have quickly simplified the position and
taken advantage of its material gain. It would have made quick work of my
apparent king safety as well.})

20. Rxe5 Nf6 {I believe at this point Black
was considering cornering my queen. It would have required freeing the
rook, though, which was impossible.}

(20. .. Qf6 21. Re3 g6 22. Qh7+ Qg7
23. Qh4 Nf5

(23. .. Nxc2 24. Rf3+ Kg8 25. Nxd5 Qxb2 26. Rxf8+ Kxf8 27. Qe7+ Kg8 28. Qxe8+ Kh7 29. Qe7+ Kh6 30. Qh4+)

24. Rf3 Be7 25. Qf4 Bf6 26. Qb4 {A
long dance leading nowhere. My queen banished and the Black king
protected.})

21. Nxd5 {I saw this move that would have gained a pawn, freed
my rook and removed the only Black developed piece.} exd5

(21. .. Be7 22.
Qxd8 Bxd8 23. Nb4 Nf5 24. Nd3 {The computer would not have gone for it.})


22. Bxd4 Be6 23. Rae1 Bg4 24. Qh4 Qd7 25. h3 Bf5 26. R5e3 Nh7 27. Qh5+ {At
this point I was despondent. I had time trouble, my beautiful attack ended
in a big flop and the only thing I could think of was harassing Black's
pieces in an attempt to catch one off guard and gain the material
advantage.}

(27. Bxg7 Kxg7 (27. .. Bxg7 28. Re7+ Qxe7 29. Rxe7+ Kf8 30. Qb4
Bf6 31. Rxh7+ Kg8 32. Qxb7 Rf8 33. Rc7 Bg6 34. Qxa6)

28. Re7+ Qxe7

(28. .. Bxe7 29. Rxe7+ Qxe7 30. Qxe7+ Kg8 31. Qxb7 Rd8 32. Qxa6)

29. Rxe7+ Bxe7 30.
Qxe7+ Kg8 31. Qxb7 Rd8 32. Qxa6 Rd7 {The computer saw this continuation
which is pretty much forced. An interesting combo, but I doubt I could have
mated the king with only a queen against three pieces. I doubt I could have
won.}) 27. .. Kg8 28. Rf3 Bxc2 29. g4 {At this point I only had one idea
left: moving the g pawn front and use it to mate the king. It was as
transparent as it was desperate, but I think my opponent was completely
thrown off his game by the crazy maneuvres I had used.}

(29. Rc3 Be4 30. f3
Bf5 31. g4 {Houdini would also have pushed the g4 pawn, but with backup and
tempo. Again, something to be learned from that. Check out the wild
continuation it found.} Be6 32. Qe5 Re8 33. Rc7 {threatening the queen, but
also g7.} Bxg4 {completely crazy: this is a queen exchange, but the
computer saw the possibility to gain a pawn in the process.} 34. Rxd7 Rxe5
35. Rxg7+ {two can play that game. See how White is going for the pawns in
this insane position, as well.} Bxg7 36. Bxe5 Ng5 {Again, insane! Why not
move the bishop? because the knight can be developed and a new threat (f3)
can be declared.} 37. Kf2 Nxf3 38. Rd1 Nxe5 39. hxg4 Nxg4+ 40. Kf3 Ne5+ 41.
Ke2 Nc6 42. Rxd5 {White would not have won this, but was crazy game.})

29. .. b5 {His plan, to push his passed pawns and gain huge material advantage
or completely block my pieces from attacking would have worked, but it
needed some preparatory moves on the king side, which were not made.} 30.
g5 Be4 31. g6 {The bishop move came too late. I was threatening mate and
the only option to save the situation was the sacrifice of the bishop.}
Bxg6 32. Qxg6 b4 {Again, Black helps me out with a useless pawn move.} 33.
Re5 b3 34. Rxd5 {Enamored by wild moves I did this. The idea was that if
the queen was not defending g7, I could then take the f8 bishop with yet
another sacrifice and mate at g7. I completely missed that the rook could
be taken by the king, avoiding the mate.}

(34. Rh5 {Houdini went instead
for a safe mate in 7 which I missed, even if my initial plan was to move
the rook to h5, but I then forgot about it.} Ng5 35. Rxg5 Bd6 36. Qxg7+
Qxg7 37. Rxg7+ Kh8 38. Rf5 Bh2+ 39. Kxh2 a5 40. Rh5# {Another beautiful
computer mate.})

34. .. Qxd5 35. Rxf8+ Nxf8 {My always greedy opponent was
kind enough to not see the mate. I had time trouble and no matter the
material advantage, I had no time to finish the game without a blunder such
as this.}

(35. .. Kxf8 36. Qxg7+ Ke8 37. Qxh7 Rc8 38. Qh8+ Kd7 39. Qg7+ Kd6
40. Qg3+ Ke7 41. Qh4+ {The only solution for White was to check ad
infinitum, which was not possible if both sides played well. The game was
lost.})

36. Qxg7# 1-0


The game started as a whim. I wanted to do something, I didn't really feel like anything, so I started a chess game, expecting to lose. I am usually a fan of aggressive, off the book, starting positions so, when I was confronted by the Sicilian defence, I decided to try the Wing Gambit. Now, I know I wrote a blog entry about it, but I did not remember anything from it and it would have been unfair to read the blog entry while playing, so I went with the first three moves and then winged it (get it?).

I want to thank Black for helping me along, as with the silly moves I did it was impossible to win if it weren't for his valuable assistance >:)

There are comments in the game as long as several variations. What I want you to pay special attention to is the variation at move 19. If I would had seen it, and I should have had, the game would have been over in a spectacular fashion in only 25 moves. Other variations show how the game could have ended if Black has played well.

Enjoy!

Oh, the monster of a book! If you want to learn to do genetic programming, then this is the book for you. If you need an interesting presentation of what genetic programming is, then this book is way too heavy.

Let's start with the beginning. Genetic Programming: On the Programming of Computers by Means of Natural Selection (Complex Adaptive Systems) is a scientific book written by John R. Koza to explain why, how and what to do to make your computer find solutions to problems by using natural selection algorithms to automatically create programs to solve them. This is not a new field and a lot of research has been done in it, but this book takes it almost to the level of encyclopaedic knowledge.

First, Koza submits the idea that genetic programming can be used in most problems where computers are been used. That's a bold claim, but he proceeds on demonstrating it. He takes problem classes, provides code to create the programs that solve them, shows results and statistical analysis on the results and explains what the algorithm did to create said program at specific iterations. That's a lot to take in. If you are working on a program and you are using the book, you are more likely to find it extremely useful, both as a source for information and as a reference that can always be consulted.

However, if you are a casual reader like myself, reading all that code and statistical analysis in the subway can be difficult. And it's a lot of book, too. So, after some consideration, realising that I have no current project on which to apply the knowledge within the book, I've decided to stop reading it. I got to about a quarter of it, so I can safely say that it is a very thorough and well written book. You just have to need it in a certain way.

and has 0 comments



I have to say that most of the books I start reading, I am also finishing, no matter how bad they are. I will not be finishing Guns, Germs and Steel, but not because it is a bad book, but because it is too thorough.

I know, it sounds bad for me, but this book, as with the next one I am going to review, are true science books, going through all the arguments, all the proof, anecdotes and theories before making a point. It is not an overly large book, but each passage has meaning and there is a ton of data that must be assimilated in order to be able to say I read the book. Alas, I don't feel like assimilating this much and reading it to the end, just in order to pretend I've read it would be pointless.

The book, written by Jared Diamond, is trying to explain why some regions of the world are more developed than others, why some people are oppressed, while other are the oppressors, why some people get along fine having farms and cities and a thriving economy while others are fighting to stay fed or secure. The author immediately dismisses the idea of racial superiority. Given the biological incentives to stay alive and the selection process that still goes on in less developed areas of the globe, it would be silly to consider those people genetically inferior to well fed Westerners from countries where the leading cases of death are random diseases or accidents. So the reason must be something else.

Having done a lot of living and studying in Papua New Guinea and Polynesia, he has direct knowledge of the way people live there and extensive knowledge of their history. Especially Polynesia he considers a rich bed of "natural experiments" as the many islands have spawned numerous social, political, military and food systems that eventually had to interact. He doesn't stop here, though, giving examples from all parts of the world, the native Americans, Africa, Eurasia, etc.

As far as I could ascertain reading only half of the book, the reason the world looks like it does today is because of a lucky assortment of domesticable animals and crop plants that appeared in the Fertile Crescent. The advantage of such a food surplus allowing for all kind of social and administrative developments was too great to compete with. The culture that spawned from that area quickly overwhelmed the world. In the few areas where resistance appeared, technological advances, immunity to disease that they would still spread and the general historical knowledge gained from the written word made the dominance of said culture a certainty.

For a sociologist, a historian or a palaeontologist, this book should be a must read. It explains a lot, using a lot of arguments on very well documented facts. The style is sometimes too formal, eventually repeating some questions and answering them with overwhelming detail, but none of it is superfluous. As such, it was an interesting read, but a very difficult one. Something that would have ended up eating a lot of time and yielding little lasting knowledge.

So, having faith that I got the gist of it and hoping that maybe I will watch the PBS documentary based on the book to get to the end of it, I will end by recommending it to anyone in the field, but not so much for a casual reader.

and has 0 comments
I wanted to read this book as I knew the author experimented with LSD and sensory deprivation tanks. He was the inspiration for the brilliant film Altered States, which I enjoyed immensely. The third book of John C. Lilly, The Center of the Cyclone starts as an intense book, an exploration of the deep mind using arcane and sometimes forbidden techniques. A magnificent beginning... and a horrid ending.

Let me start from the beginning. Lilly is a psychoanalyst and a neuroscientist at the same time, perfect skills to explore and understand the limits of the human mind. He first starts his experiments with dolphins, trying to understand them and communicate with them. He starts an entire institute in order to research this field, but the book is not about that, but about the period starting with LSD experiments. At the time he begins taking the drug, it was legal. Parties were held where people would share the experience and entire schools of therapy were using LSD to facilitate access to the mind.

Having previously tried experiments of sensory deprivation, a sort of shutting down of all outside stimuli in order to explore inward, he attempts to mix the two techniques: LSD and sensory deprivation tanks. Something opens up and he gains access to repressed memories, deep understanding of self and incredibly fast and precise advances in pinpointing psychological hurdles, trauma points. Till this point, I have gobbled up the book, resonating profoundly with the scientific method of exploration aided by chemical substances that eliminate the barrier between consciousness and subconscious. But then it all changes.

If you intend to read the book and make up your own mind, I suggest you stop reading the review now and start with the book. I am going to express my own opinions on what I read there.

What I think happened is that Lilly had the spiritual openness that allowed him to connect empathically with himself and others, something I believe resides in the right hemisphere of the brain. This openness is facilitated by the catholic upbringing that he is subjected to as a child. He himself, under the influence of LSD, retrieves a repressed memory inside a church where he starts seeing angels flying around. He confesses this to a nun and she, bitchy as she was, gets terribly upset and tells him that only saints can have visions, not a seven years old boy. This makes him forcefully lock the door that he had opened in himself. But now, after he has dedicated himself to science and logic, he stumbles upon this drug which unlocks the memory and so the initial skill.

This should have been a momentous occasion, something to combine perfectly the scientific mind with a strong spiritual/emotional side. Unfortunately, he was truly unprepared for it all. From a scientific book, it quickly devolves into yogi and Eastern spiritual practices, combines knowledge gained from experiment with hearsay from ancient texts, mixes hallucination with perception. He acknowledges that he started writing the book, then, after experiencing all of this spiritual avalanche, he decided only the first three chapters were worth keeping. Unfortunately, those are the first three chapters that I loved and that made sense.

It is not just my own subjective disgust for his abandonment of reason that makes me think the book follows up with personal involution, but also the way the book is structured, the writing style, the use of information at the end which had not been introduced previously... it all gets worse.

Now, he is the second scientist I've read that reports some sort of mental or at least emotional connection at a distance, the first one being Kary Mullis, who also seemed rather wacky and experimented with drugs. I really wanted to believe that, as well as many of the extraordinary things reported in the book, and wanted to explore them for myself. But now... I am not so sure. Be it the LSD or some sort of giving up to the emotional side, I see this book as a diary of going bananas and not realising it.

That doesn't mean that the book doesn't contain valuable knowledge. The fact that, single or under guidance, the man could access hidden memories and background "programs" after the first LSD experience makes the entire business of psychotherapy laughable with their lengthy discussions and careful probing. Various methods to access the trance necessary to explore your inner spaces that don't even involve chemical aid (like the looping of a word and listening to it until entering the desired trance state) I bet are perfectly functional. Also, there was one collaborator of Lilly's, Ida Rolf, that used a technique combining deep tissue massage and trance to unlock the repressed memories that affected body stance.

Many more interesting and very useful facts are hidden in the book. Alas, it is difficult if not outright impossible to separate wishful thinking from actual fact, garbage from science. Or maybe, who knows, I am so biased that I can't understand some essential truths in the book. I guess it is up to you to read the book and decide for yourself. I loved the beginning and loathed the ending.

and has 0 comments
I really wanted for Forge of Darkness to be great, something that would wash away the disappointment of the tenth and final book in the Malazan Book of the Fallen. And, in a way, it is. However, with increases in the inner philosophical monologues and a downplay of magic, with a plethora of characters that, for anyone not reading (or remembering, like me) the entire Malazan series, don't yet make sense, it felt raw, pretentious, more in line with Steven Erikson's admission that after 20 years of writing, the voices have stopped nagging him (for a while at least, as evidenced by this book). If this was supposed to be a book to be read, understood and loved, then I cannot see it as a success. If it was only a way to unload the chaos of characters demanding voice in the author's head, then it is quite a realization.

I won't describe the plot in detail. Enough to say that it is all happening in the Tiste realm and it is the story of the beginning of the high magic used in the Malazan cycle. The Azathanai, magic creatures of unknown potential, start interacting with the world on a more personal level. Draconus marries a queen, while K'rull starts bleeding magic as a gift for anyone to use. Eleinth break open into the world and gates for the major flavours of magic are opening as a result of Draconus' love gift. Through all of that, the division of the Tiste and the break of civil war are preparing to shatter the realm of Kurald Galain.

I imagine the second book will be a lot more active, with magic breaking out wild in a world unprepared for it, however the first was more about presenting characters (a zillion of them) and setting the stage. My impression was that, even if Tiste people live for hundreds of years, not every soldier and common man can have pages of internal monologues about the philosophical aspects of living. That is the biggest failure of a book that is otherwise brilliant. I will continue reading the Kharkanas cycle (I doubt it will end as a trilogy), of course, but I am starting to ask myself when the next book of Ian Cameron Esslemont will come out.

and has 0 comments
For a long time now, Flash was the de facto "cross browser video" technology. That is why many of the posts in this blog containing videos had embedded Flash videos in them. That until Apple came along and did not support the technology. As a result, more than half of my posts with embedded video were not available on an iPad, for example.

Today I've made sure the embedded videos were not deleted or otherwise unavailable and also replaced them with versions that also work on the iPad. If you browse the "video" tag in the blog and you see something that doesn't play on your device and it doesn't mention anything in the text about that, please let me know so I can update the post accordingly.

So, stop despairing, iPad people, now you can listen to the music and watch the movies Siderite style. ;)

and has 0 comments
It has been a while since I've posted music here. The performer is Lindsey Stirling and today is the first time I've heard of her, but I like her stuff. She is a pop violinist akin to Emilie Autumn, but not as dark. Here is the clip for Phantom of the Opera, 7 minutes long and very nice.