and has 0 comments

Cibola Burn is the book that worried me the most. James S.A. Corey had created a world in which the Solar System has been colonized and Abaddon's Gate, the third book in the Expanse series, had ended with humanity gaining access to one thousand new star systems. I liked the Solar System background and I really thought the fourth book was gonna suck. Well, while being some of the same old thing as the other books and maybe even better written - so a better book - it also sucked because I could easily imagine Picard and The Enterprise going on a mining colony to settle a territorial dispute and, beside being PG-13, having almost nothing changed.

The plot of the book is about Holden and the Rocinante being sent to mediate a situation between the representatives of an Earth corporation and the people who had landed on the planet before the corporation had even filed a claim. You have your familiar characters like the crew of the Rocinante and Miller and even Havelock (Miller's former partner, now a security employee of the Earth corporation), you have your psychotic leader types that mess everything up while the good guys hesitate to just shoot them, you have the very human characters with children that need to be saved, you have the overwhelming but dumb alien presence and the snowballing crisis that drives it all. I thought the story was a bit of a rehashing of the same ideas and therefore I enjoyed it less than I would have if I had read it standalone. I know that successful series are based on successful books and must present kind of the same so to not alienate its readers, but as the intergalactic situation changes dramatically, damn if I don' feel the plot should vary a little, too.

Given that science and technology have always played a big part in the Expanse, you get to see more attention to the details than from other authors, but so far Cibola Burn felt to me like the least scientifically accurate so far. And yet I liked it, because it is well written and it drives the reader through the story and makes most characters likable and one wonders what the hell would they do if they were in the character's shoes.

Cibola is the Spanish transliteration of a native name for a pueblo (Hawikuh Ruins) conquered by Francisco Vásquez de Coronado, also one of the seven mythical gold cities that the conquistadors searched for in vain.

and has 1 comment

I've been monitoring more closely the access to my blog and I noticed that a lot of people are interested in the post about the Sicilian Wing Gambit, defined as pushing b4 in reply to the standard Sicilian Defense e4 c5. So I will be trying in this to use new knowledge and computer engines to revisit this funky opening gambit. As such I will be using LiveBook, a system created by the people at ChessBase that tries to catalog and discover chess based on active chess games and analysis, as well as computer engines, in this case Komodo 9 with a 256MB table memory. I've continued each variation until there was only 1 game left in the database, then I stopped.

Main line from LiveBook


Let's start with LiveBook. Here is a PGN with the main variations in order of use. You will notice that the main line is to accept the gambit (GM Jan Gustafsson even wrote "take the pawn and be happy!" at that particular junction), then refuse the second pawn and immediately challenge the center - which would have been the Sicilian idea all along - by pushing d5. It loks a bit like a Scandinavian Defense, but without White being able to push the Black queen back with Nc3. The main line shows Black gaining advantage, but then losing it by move 12, where equality sets in. However, the computer does not recognize some of the moves in the main line as best.

In the line that I was interested in, the one where Black takes the pawn on the a-file, White gains the classical center and technically it is ahead in deployment of minor pieces, if one considers a knight on the a-file and a semi blocked in bishop developed pieces. However, not all is lost, as the computer has some ideas of its own. Also keep in mind that the Sicilian Wing Gambit is not well known and few people actively employ it.

So here is the PGN of the LiveBook database, based on what people played: 1. e4 c5 2. b4 {This is the Sicilian Wing Gambit. From here on, the percentages in the comments are wins for White and the points are from computer engines.} cxb4 (2... b6 3. bxc5 bxc5 4. Nc3 Nc6 5. Rb1 g6 6. g3 Bg7 7. Bg2 Ba6 8. Nge2 {50% / 0.00}) 3. a3 d5 (3... bxa3 4. Nxa3 d6 5. d4 Nf6 6. Bd3 Nc6 7. c3 e5 8. Ne2 {50% / -0.33}) (3... e6 4. axb4 Bxb4 5. Bb2 (5. c3 Be7 6. d4 d6 7. Bd3 Nf6 8. Ne2 Nc6 9. O-O O-O) 5... Nf6 6. e5 Nd5 7. c4 Ne7 8. Na3 (8. Qg4 Ng6 9. h4 h5 10. Qg3 Nc6 11. Bd3 {50% / -0.75}) 8... Nbc6 9. Nc2 Ba5 {50% / -0.25}) 4. exd5 Qxd5 5. Nf3 (5. Bb2 e5 6. Nf3 Nc6 7. c4 Qe6 8. Bd3 Nf6 9. O-O
Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 {75% / 0.00}) 5... e5 6. Bb2 (6. axb4 Bxb4 7. c3 Be7 8. Na3 Nc6 9. Nb5 Qd8 10. d4 exd4 11. Bf4 Kf8 12. Nbxd4 Nxd4 13. Nxd4 {50% / 0.00}) (6. c4 Qe6 7. Bd3 Nc6 8. Bb2 Nf6 9. O-O Bd6 10. Re1 O-O 11. axb4 Nxb4 12. Bf1 {75%}) 6... Nc6 7. c4 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 {50% / 0.00} *


Computer analysis: main line


Now let's put Komodo on the job, let us know what is going on here. Many people analysed the position resulting after pushing b4 and with depths of 36 and 40, computer engines overwhelmingly suggest taking the pawn. However we might want to explore what happens if we take another option. It is interesting to note that Komodo 9 pushes the main move as the third most important at depth 24. Perhaps later on this would get reversed again, but this soon into the game it just tells us that the other options are equally good. The two moves I am talking about is d5 and e5. Interestingly enough, the second most common human move (b6) is not even on the radar for the computer, while the computer move appears to have been played only 4 times by humans. So let's take a look at computer moves:1. e4 c5 2. b4 d5 3. exd5 cxb4 4. a3 Qxd5 5. Nf3 e5 6. axb4 Bxb4 7. c3 e4 8. cxb4 exf3 9. Qxf3 Qxf3 10. gxf3 * At the end of all this, White has four pawn islands and doubled pawns, but can quickly use the semi open files to attack with rooks. Maybe this discourages you, but remember two things: these are computers making these moves and while the position looks weird, you get attacking chances with no loss of material. That is the purpose of a gambit after all.

Computer analysis: accepting both pawns


Let's see what computers say about the line that we want to happen. The gambit is accepted, the a-pawn is captured as well. What then? I was surprised to see that, depending on depth and engine, the next move is quite different. Stockfish 6, at depth 39 goes with d4, taking control of the center and ignoring the Black a-pawn. The variations from this position are quite complex and have less to do with this gambit. I would gamble (pardon the pun) that the purpose of the wing gambit was reached at this point. Computers give a clear equality between players, but remember that even after we capture the a-pawn, we have still would be a pawn down. Black is forced to passive moves like e6, d6, having to spend resources to regain center control, while most White pieces have clear attack lines.

An example: 1. e4 c5 2. b4 cxb4 3. a3 bxa3 4. d4 e6 5. Nf3 d5 6. e5 Bd7 7. Bd3 Nc6 8. Nxa3 Bb4+ 9. Bd2 Bxd2+ 10. Qxd2 a6 *

Computer analysis: accepting just the first pawn


But what happens in between these two options? What if Black accepts the gambit, but doesn't take the second pawn? Will the computer see the same result as in the "human main line" we first discussed? Not quite. The computer moves are really different from the human ones. 1. e4 c5 2. b4 cxb4 3. a3 e5 4. Nf3 Nc6 5. Bb2 Nf6 6. Nxe5 Qe7 7. Nf3 Nxe4 8. Be2 d5 9. O-O Qd8 10. Bb5 bxa3 11. Nxa3 Bc5 * The result is another equal position, where White lost the center, but has a strong, yet weird development.

Also check out 3... d5: 1. e4 c5 2. b4 cxb4 3. a3 d5 4. exd5 Qxd5 5. Nf3 e5 6. axb4 Bxb4 7. c3 e4 8. cxb4 exf3 9. Qxf3 Qxf3 10. gxf3 Ne7 * An interesting tactic is not to take the d5 pawn and instead advance the e-pawn to e5: 1. e4 c5 2. b4 cxb4 3. a3 d5 4. e5 Nc6 5. Bb2 Qb6 6. Nf3 Bg4 7. axb4 Qxb4 8. Bc3 Qe4+ 9. Be2 Bxf3 10. gxf3 Qf4 11. d4 * You can watch an example game in this variation from Kingscrusher.
My opinion on this is that White forces a strong center, but, as seen from the computer variation, the sides get seriously compromised. The truth is that I always wondered if there is a solid play with the king in the center. This might be it, although keep in mind that in that position White is a pawn down.

What if we start with b4 and then try to move towards the center?


Well, that's easy to answer: it's another opening :) called the Polish or Sokolsky opening and I have written another blog post about it, although it is pretty old. Maybe I will also revisit that one. The point with that opening is that it already shows Black what we plan and it has some other principles of work, more closely related to the English opening to which it sometimes transposes. The Wing Gambit, though, is a response to the Sicilian, trying to pull the opponent from their comfort zone and into ours.

What if we delay the b4 push?


One can wait for the wing gambit until knights have left their castle. That's called the Portsmouth Gambit (1. e4 c5 2. Nf3 Nc6 3. b4) and some consider it stronger than the gambit presented here. It might be interesting to analyse. Haven't found a lot of resources on it, just this 2014 book from David Robert Lonsdale.

Another option is to play 3. a3, preparing a support of b4 on the next move. It does produce similar results as the base gambit, but I didn't have time to analyse it and it feels a bit slow, to be honest.

When Black defends with b6


Defending c5 with b6 leads to a Sicilian without the b-pawns. That means that an attack on the queen side is out and the White light square bishop can linger around on the queen side as long as it wants, targeting that juicy Black king side from afar. Combine that with the dark square bishop having a nice diagonal as well. 1. e4 c5 2. b4 b6 3. bxc5 bxc5 4. Nf3 Nc6 5. Bb5 Nd4 6. Nxd4 cxd4 *
For an example of that variation, check out Kingscrusher's video.

Traps in the Sicilian Wing Gambit


I couldn't find a lot of traps in the Sicilian Wing Gambit. One good video on this comes from GJ_Chess (ignore his Indian accent, he is actually quite good and, what I like a lot, he focuses on traps and dirty tricks in his videos):

[youtube:5KNVTce4tmE]

Other ideas and nomenclatures


The ECO category for this opening is B20, same as for the Sicilian Defense, which doesn't help a lot.

After Black captures the b-pawn, c4 is called the Santasiere variation of the Wing Gambit, and Black's only option seems to try for control of d4 with either e5 or Nc6. Taking en-passant is giving White a lot of compensation in development.

The goading of the Black pawn with a3 that we've covered above is called the Marshall variation. If Black pushes the pawn to d5 and White captures, we enter the Marienbad variation, while if Black captures the a-pawn, it is called Carlsbad variation. For the record, bad is the German name for bath not an indication that the variation is bad :).

Pushing a3 before b4 is called the Mengarini gambit. Check out a game from 2013 between Dobrov and Blom.

Other resources on the gambit


A nice review of this gambit, with names of the variations and some human analysis, can be found on chess.com. (The same author has a post on The Portsmouth Gambit as well)

On chesstempo there is a nice list of games with this variation that you can search. Play around with the Advanced Search parameters. As a reference, there are 11 games from people over 2500 using the Wing Gambit and White has most wins. If restricting to games after 2000, you only get one, which ended in a draw, although White was better at the end. You can see the game here: Timur Gareev vs Gata Kamsky, US Championship (2015).

Interesting Wing Gambit/Fried Liver attack combo that you can see here: John P. Pratt vs Elden Watson, 29 Sep 1976, Hill Air Force Base, Utah. You gotta love that. Not the best rated players in the world, but still. Here is a lichess computer analysis of the same game.

A 2013 call to reevaluate the Wing Gambit with some examples of famous old games where the opening had a strong effect.

Conclusions


Unlike the Sokolsky opening, the purpose of the Sicilian Wing Gambit is not to push the b-pawn to block Black's development, but to deflect the c-pawn from protecting the center. The goal is reached when White has a strong center. In no way does it mean it is a winning gambit. There are no brutal traps, no quick wins, the only purpose of this opening is to pull an aggressive Sicilian player from their comfort zone and into a slower, more positional one. That means that the White player needs to attack like crazy until Black is a mere smear on the board, otherwise the center control and speed advantage that may be obtained from the opening can be easily lost.

From my analysis I gather that Black should accept the gambit, but not continue to take pawns like the a-pawn, instead focusing on their own piece development and control of the center. With perfect computer play, equality is reached and maintained. White often fianchettoes the dark square bishop to b2 from where they put pressure on the Black king side. Black's game often centers on exchanging pieces, so that the opening advantage gets lost. The best chance Black has to decline the gambit seems to be pushing d5, going into murky territory.

White on the other hand should push for the center, even propping the d-pawn with c3 and blunting the dark square bishop diagonal. Then focusing on attack is the most important feature, as in most gambits.

Careful with the variation in which Black attacks the e4 pawn with d5, then capturing with the queen after the exchange. If not careful the queen can fork the king and the rook. That is why Nf6 is played by White as the next move or even Bb2, although that's not as good, as the bishop can be deflected.

Usually the a-pawn is recaptured with the knight, not the bishop. This may seem surprising, but what it prepares is moving the knight on b5, attacking c7 and a7 and being very hard to dislodge, as the a-pawn is pinned to the rook. Some variations sacrifice the Black rook in the corner for a quick counter-attack. In case it is captured with the bishop, the idea is to exchange dark square bishops and prevent the Black king from castling.

In several games I have seen, moving towards the center forces Black to use e6 followed by d5, to which White can respond with e5 themselves and get into French defense territory. Personally I dislike playing against the French, but in this case, without b-pawns, the theory is quite different as well. For an example, check out this video from Kingscrusher.

Even if caustic GM Roman Dzindzichashvili categorized this as the worst opening for White, don't forget that it was used by Fischer in 1992 to beat Spassky. Well, a transposition thereof. If you are confident in your chess skills, this is just as good an opening as any other and at least you need to know it a little in order to defend against it.

I would love some comments from some real chess players, as all of this is based on game databases and computer analysis. Please leave comments with what you think.

Video examples


Here is Simon Williams using the gambit against a young Polish player:


[youtube:NkD12gJcbO4]

ChessTrainer shows a nice game where he uses the gambit to get a quick center and take his opponent out of Sicilian main lines:

[youtube:KITg5dYVsYk]

MatoJelic is showing us some classical games:
Thomas A vs Schmid, Hastings 1952

[youtube:8UTSqKIPQ-8]


Wood L vs Mease A ,USA, 1949

[youtube:XkymLpg781c]

Coma is my favorite Romanian bands and I've known them almost since they were formed. They have been singing for 16 years now and it was nice to see the concert room filled with people of all ages, including a 16 year old boy who had his birthday on the same day. For me this concert was a double whammy, as the lead singer of one of the opening bands is a former colleague of mine. Yeah, small world.

The opening bands where Till Lungs Collapse and Pinholes. TLC were nice, with my boy Pava almost collapsing his lungs. Pinholes were a bit strange: from five people on the stage, only the drummer didn't sport a guitar. Their writing process must be weird. Then Coma came on stage, at about 0:00 and played for an hour an a half. They were great! I've been to many of their concerts and this is one of the best yet. The band's "curse" struck again, on Dan Costea's acoustic guitar, but they were able to continue without it with no problems. They sang all time favorites, some newer songs, they also did Morphine, which is one of my personal favorite songs of theirs. I wish they would have managed to squeeze Daddy in there, or at least 3 Minute.

Catalin Chelemen was on fire, Dan was doing his usual PR thing and he was great as well and it seemed like they all had a good chemistry with the new guitar player, Matei Tibacu. Well, new for me. Unfortunately the sound in Fabrica was pretty bad. While inside you could kind of focus on the right notes, especially if you knew what the songs were supposed to play like, if you try to gauge the quality of the concert from the videos that are online now, you want to mute it almost instantly. People were respectful enough not to smoke during the concert (I can't wait for the smoking ban to come in effect!), but my clothes still smelled of tobacco when I got home, from people smoking in the next room.

As far as I know you can hear them next at the Electric Castle Festival, July 14-17, with so many other great bands. I am tempted to go there, but I am not one for festivals. Great job, Coma, and good luck!

Click here to see some nice photos from the concert.

and has 0 comments
The authors known as James S.A. Corey have planned the series of books The Expanse to have three volumes. As such, Abaddon's Gate feels like a wraparound of the stories so far, while also remaining a good standalone feature. However, because of the overwhelmingly positive response for the series, it was continued for another three volumes, and now three more are announced. There are also various novellas in between books. That is a problem, since this book ends up undoing what the first two started. But let's not get ahead of ourselves here, just be warned that this review may contain spoilers, without which I couldn't possibly comment on the plot of the book.

If you are only interested in my general opinion of the book, I believe it is consistent with the quality of the second. There are more characters, but also less compelling ones. There is a great mystery, but a rather bland one. There is a danger, well... several of them in succession, but they feel a bit artificial, just to keep the tension going. I am not complaining, but I am also not thrilled. As in Caliban's War, there are several characters that seem put there just to annoy me. There is this lesbian preacher that always needs to save the souls of everybody around, for example; she kind of felt like someone nagged the writers to put more progressive characters in, like writing about giant alien artifacts in space is not progressive! Fortunately, she is also important to the plot, so she is not just added there like condiment on food, yet the parts of her philosophizing about the meaning of God bored me to tears. Then there is a psychotic captain that doesn't seem to be a person at all. He just randomly appears and does stuff, and I am not the only one noticing this. And there are more, but I don't feel the need to complain that much. Here be spoilers!

The story revolves around a ring like structure that the alien "protomolecule" has constructed outside the orbit of Uranus. A random ship goes through revealing it is in fact a wormhole. An entire fleet of ships gets in, for various reasons, and again Holden and his crew are in the middle of it all. Yet their roles are quite limited up until very close to the end of the book, the main character here being the sister of Juliette Mao who seems to be seriously unhinged, moving from dangerous psycho killer to kind person who wants to fix things. Quite a lot of psychos in this book. The end opens up a wormhole hub, thus allowing access to the stars. And that is what I take offense with.

You see, the beauty of the series, as made clear by the TV show actually and less by the books, is that it presents a plausible solar human occupation, something close by, that we could achieve in about a century or so, given the magical fusion Epstein drive. It goes into the social, the economic, the political, less in the technical, but still quite a lot. It brings hope. Then there is this alien thing that we don't understand which throws a wrench in our understanding of our place in the Universe. So much to explore there (unintended pun, I assure you). Yet, the end of the third book in The Expanse opens up the stars, even more magically than the Epstein drive, ending the promise of a realistic hard science fiction universe and going towards the implausible and yet so overused "humanity among the stars" trope. I really hope they don't fuck this up for me!

Bottom line: I feel like this book had flaws in its characters, while the story was kept ablaze just by random dangers and conflicts that did not engage me as a reader. Yes, I wanted to see how it all unfurls, but I couldn't care less about the people involved. While it certainly has kept me entertained and it is a good book, I couldn't help begrudging this as well as the ending, which for me ended the promise of exploration and colonization of the Solar system, while going into that all too trodded interstellar medium (hearing me about it it seems like it is seething with stuff, but I mean the literary medium).

P.S. Abaddon was a gate associated to the realm of the dead from the Hebrew Bible.

and has 0 comments
The second book of The Expanse is much better written than the first, however the story is a little weaker. There are more of the details one would already be familiar with from the TV show, the character of Chrisjen Avasarala is introduced and chapters are written from the perspective of many more characters than just Miller and Holden. That means there are many more chances to completely dislike a chapter if you hate the character. For me, that character was Prax, someone who would endanger everybody and himself with random emotional outbursts. Perhaps he was put there just to offset the slightly similar behavior of Holden, who now looks like the paragon of professionalism in comparison.

The plot revolves around yet another alien infestation, this time on Ganymede, only it is not clear who or what is actually responsible. The already angered Mars and Earth navies use this as a pretext to attack each other, while the Rocinante crew find themselves agents of the OPA, sent to find out what happened. As opposed to Leviathan Wakes, the book adds two major female characters, Avasarala and Bobbie, a Martian marine, and a lot of the story is about their interaction. In truth, what the Rocinante does on Ganymede is almost inconsequential until they make contact with the two women, which felt like the main characters of the book, if I had to choose. This is also a sign of a better built world, in which one has to struggle to identify the lead characters.

While the book was clearly better (some even suggest it is the best in the series), I didn't find myself attracted so much by the story. Instead of a mystery, like in the first, we pretty much discover from the beginning what is going on and only halfheartedly root for the characters to get in the same position the reader has been all along. I like Avasarala's character, but in order to show how badass she is, we have to go through all the political machinations in the UN which I couldn't care less about. Bobbie was slightly more interesting, but she starts off with such low confidence that until she gets to embrace her role there is so much filler. And Prax... don't get me started on that asshole! He is central to the Rocinante crew quickly finding out what has happened, but for the rest of the book he just drags along. He would have been a perfect character to be killed off, adding to the darkness of the tale.

And I think this is where the books and the TV series diverge the most. While the show is perfectly content to show a dark, hopeless world, the books fight to maintain some sort of feeling of normalcy, of hope, leading to reasonably happy endings. The show recognizes that in a Solar System built on exploitation, armed spaceships and politics there is no hope for the little man, there is no silver lining, there are just people trying to survive while colossal forces push them around like leaves in the wind: another reason to watch the series, at least the first season, before starting reading the book.

Bottom line: Caliban's War, by James S.A. Corey, contains no reference to a character called Caliban, which is a Shakespeare character. In the play The Tempest, Caliban is a part-human monster and slave who rebels against his masters. Even starting from the title, the authors spill the beans on what the story is all about. While I enjoyed the book and now I am reading the third one in the series, I can't help wishing they would have maintained the tension and mystery of Leviathan Wakes.

and has 0 comments
I absolutely love the TV series The Expanse and so, after ten torturous weeks in which I would alternatively get filled with joy at the release of another episode, then fall into despair when it ended, I've decided to cut out the middleman and read the damn book. And now that I've read it, I have to say that I am really glad to have seen the show first. It's not that it is a bad book - it is not, it's very good - but the show is better and having the characters in the series blend with the ones on the page is turning them into something more fleshed out, more complex. And I am not the only one thinking that.

For example, in the book the viewpoint alternates, chapter by chapter, between Miller and Holden. The chapters don't even have other titles other than these two names. In the book Naomi is a slight romantic interest, but nothing more than that. Amos is just there, doing stuff. Alex is barely fleshed out. It is Holden who is the undisputed captain of the Rocinante and that's it. Similarly, Miller's partners or even Anderson Dawes are just shadows of the complex characters they appear in the TV show. One of the things that I really loved about the show was that it was reasonably accurate scientifically and I kind of thought the book would be even more detailed about it. In the contrary, it was not. The authors even said in an interview that they never intended to make a hard sci-fi thing, but just to tell the stories of people in the less used fictional period between stuck-on-Earth and interstellar humanity. The weird language melange that is shown in the TV series is only vaguely mentioned in the books. Also the Earth lady in the show is not in this book at all.

But enough about the show. Leviathan Wakes is the first in The Expanse series of more than five books, written by James S.A. Corey, which is actually a pen name for Daniel Abraham and Ty Franck, both collaborators of George R.R. Martin (Franck was his personal assistant, for example). More than five books because there are also some interstitial short stories and I am sure they are going to write some more stuff. The plot of the book is about people living and working in space. You have densely populated Earth, a colonized Mars that is undergoing terraforming and the Belt, people living on the large asteroid belt between Mars and Jupiter. And of course, people being people, they hate each other. Enter an unknown entity that lights the powder keg for reasons unknown that are slowly revealed as the book goes on.

Miller is the typical noir detective, cynical, not trusting, obsessive to the extreme and trying to prove to the world and himself that he's still "got it". Holden is the typical good guy, wanting to save everybody and hoping that all will be well if people just know the truth. Their dynamic is interesting, but for me the story was more captivating when they hadn't met each other. The first season of the show ends when the book is about half way through, but from then there is a period of inactivity, one of those parts when everybody knows what is going on and still they have to go through the movements. In real life this is where the role of the characters would be over, but since it is a book, the same characters continue the story, although it feels a bit disconnected. The ending of the book is epic, in its grand scale, but almost boring from a literary standpoint.

Bottom line: I will continue reading the next books of The Expanse, however I have to say that I am shocked at the difference in quality between the show and the book. Probably it is much easier to do that when you have good actors carrying the load and a lot more book material to work with before you start envisioning your world, but still awe is the feeling I am getting from the TV show.

and has 0 comments
If there is anything that I am forced to say about Adrian Despot, the frontman of Vita de Vie, is that he is a true artist. The concert tonight was spot on, even if I am not a fan of the band. The guest bands were pretty good, too, but I have to admit that for most of them I was waiting for them to stop playing so I can listen to the great playlist from DJ Hefe. The audience was really mixed, ranging from little kids to old people. It felt great to see all these people singing along and reliving some of the greatest hits of the band.

I started watching the concert online. It was kind of extreme to go there at 16:00 and stay until 23:00, especially since I was worried about the food/drink/toilet situation and there was an afterparty as well. I have to say that all my worries were for naught. Really decent access to the food and drink stands and there was no queue at the toilets outside. Of course, the drinks and food were shitty and overpriced, but that was to be expected. It also was a really wonderful thing to stand in the middle of a crowd of people and not feel like I was smoking a cigar. The law against smoking in public places has finally reached Romania so it felt really wonderful.

By the time we got to the concert hall - umm, heated tent, but it was better than it sounds - the last band before Vita de Vie was playing, the rather good Relative, from Cluj. Energetic, professional, kind of bad public speakers, but they have time to improve. They were pretty emotional about their first venue in Bucharest and performing before so many people, so they were sweet. Then the main show started, with light shows, projections and a volume that felt like twice as loud as the bands before. My ears are still ringing.

Unfortunately something happened that ruined my evening, so I went home after the concert, rather than go to the after-party at Fabrica. I wish I was in the mood for that, but well, shit happens. So yeah, the show was great, the music pretty good - although I felt like the band would have done a better job with another lead singer :) The point is that Vita de Vie, like any other band - let's be honest, is a project. Individual people don't count unless they push the project further, make it better somehow. Adi Despot made that obvious when he called the previous members of the band to play some songs, as well as some collaborators in sideprojects started by current members of the band. Like him or not, he did bring showmanship to the project and he deserves to be the frontman.

Bottom line, I was impressed by the way the concert was organized (I am used to those really bad things where people just stand brushing against each other, suffocating in smoky improperly ventilated places, trying their best not to slip into the beer and piss left by people who couldn't get fast enough to the few malfunctioning toilets provided). I was also impressed with the guest bands, doing a really professional job, even if they have a lot to learn still.

You might be interested in the Facebook link of the event.

In the previous post I was discussing Firebase, used in Javascript, and that covered initialization, basic security, read all and insert. In this post I want to discuss about complex queries: filtering, ordering, limiting, indexing, etc. For that I will get inspiration (read: copy with impunity) from the Firebase documentation on the subject Retrieving Data, but make it quick and dirty... you know, like sex! Thank you, ma'am!

OK, the fluid interface for getting the data looks a lot like C# LInQ and I plan to work on a Linq2Firebase thing, but not yet. Since LInQ itself got its inspiration from SQL, I was planning to structure the post in a similar manner: how to do order by, top/limit, select conditions, indexing and so on, so we can really use Firebase like a database. An interesting concept to explore is joining, since this is an object database, but we still need it, because we want to filter by the results of the join before we return the result, like getting all the transaction of users that have the name 'Adam'. Aggregating is another thing that I feel Firebase needs to support. I don't want a billion records in order to compute the sum of a property.

However, the Firebase API is rather limited at the moment. You get .orderByChild, then stuff like .equalTo, .startAt and .endAt and then .limitToFirst and .limitToLast. No aggregation, no complex filters, no optimized indexing, no joining. As far as I can see, this is by design, so that the server is as dumb as possible, but think about that 1GB for the free plan. It is a lot.

So, let's try a complex query, see were it gets us.
ref.child('user')
.once('value',function(snapshot) {
var users=[];
snapshot.forEach(function(childSnapshot) {
var item=childSnapshot.val();
if (/adam/i.test(item.name)) {
users.push(item.userId);
}
});
getInvoiceTotalForUsers(users,DoSomethingWithSum);
});


function getInvoiceTotalForUsers(users,callback)
{
var sum=0;
var count=0;
for (var i=0; i<users.length; i++) {
var id=users[i];
ref.child('invoice')
.equalTo(id,'userId')
.orderByChild('price')
.startAt(10)
.endAt(100)
.once('value',function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var item = childSnapshot.val();
sum+=item.price;
count++;
if (count==users.length) callback(sum);
});
});
}
}

First, I selected the users that have 'adam' in the name. I used .once instead of .on because I don't want to wait for new data to arrive, I want the data so far. I used .forEach to enumerate the data from the value event. With the array of userIds I call getInvoiceTotalForUsers, which gets all the invoices for each user, with a price bigger or equal to 10 and less or equal to 100, which finally calls a callback with the resulting sum of invoice prices.

For me this feels very cumbersome. I can think of several methods to simplify this, but the vanilla code would probably look like this.

I have been looking for a long time for this kind of service, mainly because I wanted to monitor and persist stuff for my blog. Firebase is all of that and more and, with a free plan of 1GB, it's pretty awesome. However, as it is a no SQL database and as it can be accessed via Javascript, it may be a bit difficult to get it at first. In this post I will be talking about how to use Firebase as a traditional database using their Javascript library.

So, first off go to the main website and signup with Google. Once you do, you get a page with a 5 minute tutorial, quickstarts, examples, API docs... but you want the ultra-quick start! Copy pasted working code! So click on the Manage App button.

Take note of the URL where you are redirected. It is the one used for all data usage as well. Ok, quick test code:
var testRef = new Firebase('https://*******.firebaseio.com/test');
testRef.push({
val1: "any object you like",
val2: 1,
val3: "as long as it is not undefined or some complex type like a Date object",
val4: "think of it as JSON"
});
What this does is take that object there and save it in your database, in the "test" container. Let's say it's like a table. You can also save objects directly in the root, but I don't recommend it, as the path of the object is the only one telling you what type of object it is.

Now, in order to read inserted objects, you use events. It's a sort of reactive way of doing things that might be a little unfamiliar. For example, when you run the following piece of code, you will get after you connect all the objects you ever inserted into "test".
var testRef = new Firebase('https://*******.firebaseio.com/test');
testRef.on('child_added', function(snapshot) {
var obj = snapshot.val();
handle(obj); //do what you want with the object
});

Note that you can use either child_added or value, as the retrieve event. While 'child_added' is fired on each retrieved object, 'value' returns one snapshot containing all data items, then proceeds to fire on each added item with full snapshots. Beware!, that means if you have a million items and you do a value query, you get all of them (or at least attempt to, I think there are limits), then on the next added item you get a million and one. If you use .limitToLast(50), for example, you will get the last 50 items, then when a new one is added, you get another 50 item snapshot. In my mind, 'value' is to be used with .once(), while 'child_added' with .on(). More details in my Queries post

Just by using that, you have created a way to insert and read values from the database. Of course, you don't want to leave your database unprotected. Anyone could read or change your data this way. You need some sort of authentication. For that go to the left and click on Login & Auth, then you go to Email & Password and you configure what are the users to log in to your application. Notice that every user has a UID defined. Here is the code to use to authenticate:
var testRef = new Firebase('https://*******.firebaseio.com/test');
testRef.authWithPassword({
email : "some@email.com",
password : "password"
}, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload:", authData);
}
});
There is an extra step you want to take, secure your database so that it can only be accessed by logged users and for that you have to go to Security & Rules. A very simple structure to use is this:
{
"rules": {
"test": {
".read": false,
".write": false,
"$uid": {
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
// grants read access to any user who is logged in with an email and password
".read": "auth !== null && auth.provider === 'password'"
}
}
}
}
This means that:
  1. It is forbidden to write to test directly, or to read from it
  2. It is allowed to write to test/uid (remember the user UID when you created the email/password pair) only by the user with the same uid
  3. It is allowed to read from test/uid, as long as you are authenticated in any way

Gotcha! This rule list allows you to read and write whatever you want on the root itself. Anyone could just waltz on your URL and fill your database with crap, just not in the "test" path. More than that, they can just listen to the root and get EVERYTHING that you write in. So the correct rule set is this:
{
"rules": {
".read": false,
".write": false,
"test": {
".read": false,
".write": false,
"$uid": {
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
// grants read access to any user who is logged in with an email and password
".read": "auth !== null && auth.provider === 'password'"
}
}
}
}

In this particular case, in order to get to the path /test/$uid you can use the .child() function, like this: testRef.child(authData.uid).push(...), where authData is the object you retrieve from the authentication method and that contains your logged user's UID.

The rule system is easy to understand: use ".read"/".write" and a Javascript expression to allow or deny that operation, then add children paths and do the same. There are a lot more things you could learn about the way to authenticate: one can authenticate with Google, Twitter, Facebook, or even with custom tokens. Read more at Email & Password Authentication, User Authentication and User Based Security.

But because you want to do a dirty little hack and just make it work, here is one way:
{
"rules": {
".read": false,
".write": false,
"test": {
".read": "auth.uid == 'MyReadUser'",
".write": "auth.uid == 'MyWriteUser'"
}
}
}
This tells Firebase that no one is allowed to read/write except in /test and only if their UID is MyReadUser, MyWriteUser, respectively. In order to authenticate for this, we use this piece of code:
testRef.authWithCustomToken(token,success,error);
The handlers for success and error do the rest. In order to create the token, you need to do some cryptography, but nevermind that, there is an online JsFiddle where you can do just that without any thought. First you need a secret, for which you go into your Firebase console and click on Secrets. Click on "Show" and copy paste that secret into the JsFiddle "secret" textbox. Then enter MyReadUser/MyWriteUser in the "uid" textbox and create the token. You can then authenticate into Firebase using that ugly string that it spews out at you.

Done, now you only need to use the code. Here is an example:
var testRef = new Firebase('https://*****.firebaseio.com/test');
testRef.authWithCustomToken(token, function(err,authData) {
if (err) alert(err);
myDataRef.on('child_added', function(snapshot) {
var message = snapshot.val();
handle(message);
});
});
where token is the generated token and handle is a function that will run with each of the objects in the database.

In my case, I needed a way to write messages on the blog for users to read. I left read access on for everyone (true) and used the token idea from above to restrict writing. My html page that I run locally uses the authentication to write the messages.

There you have it. In the next post I will examine how you can query the database for specific objects.

and has 0 comments
I wasn't expecting much from this book, as another from the same page offering free books from their authors was kind of disappointing. However, this is a true book: it is long enough, well written, with developed characters and with an end that delivers closure to all the story arcs. Indeed, it closes all of them so well that is kind of weird to see that it is part of a series, containing the same characters no less. I mean, come on, how many times can the same people save the planet? Shut up, Marvel!

It was surprising to me to find out that Breakthrough was Michael C. Grumley's debut book. It is professionally written. Nothing exceptional, mind you, but nothing you can possibly find wrong with it. And the subject of the book was complex and interesting, involving talking dolphins, undersea aliens, covert military operations (no, it is not a Seaquest ripoff), which reminded me a little of Creatures of the Abyss.

The ending was a bit rushed, I guess, and contained that annoying trope "You are not yet ready, humans!". Fuck you, aliens, if all you've got to show for your evolution are plans to either destroy or patronize us! Plus some crowd pleasing death avoidance which felt wrong. But overall it was a good book, way above what I would call average. Since it is offered for free, you can download it and read it right now. And if you like it, the author offers even more free stuff on his site.

and has 0 comments
I've got this from a website where several self published authors shared free e-books for promotion purposes. I chose Better World because of its description: "The last humans spent centuries searching for a new Earth. Now they face extinction.
For three hundred years, arks have carried the last remnants of humanity through dark space. The ships are old, failing, and every colonist must do their duty to ensure the fleet’s survival." Pretty cool premise, if you ask me.

Now, Better World is not accidentally a free book. It is short, ends with a "to be continued" and has no other purpose than to pull the reader into Autumn Kalquist's Legacy Code series. To me it felt a bit amateurish, which is weird. I would have thought something that would pull your audience into your work should be better edited, if not better written.

The basic plot revolves around this 18 years old girl called Maeve, a low class citizen of the colony ships fleeing Earth to find a better world. The story starts with her trying to kill herself, while a dogooder boy who is obviously hot for her stops her at the last minute. I found it interesting that the heroine of the story starts off as weak, egotistical, scared, with low self esteem and living in a world where she is pretty much powerless. Everything that - if the book were written by a guy - would have prompted people to denounce his misogynistic view of the world. Yet every writing book worth mentioning affirms that the character has to begin as powerless and defective in order to evolve. And indeed, by the end of the book you find that Maeve realizes her own strength and courage when faced with true challenges, not just with teenage angst.

However, the scenes lacked power and, whenever something interesting happened, the author introduced new characters and new ideas instead of focusing on the potential of the current situation. Maeve wants to kill herself, a savior male is introduced. She rebels against authority, a younger more naive girl is introduced in order to suffer the consequences for her. The young girl gets hurt, a love interest - another girl - appears out of nowhere to take away focus from the shame and guilt. An "enforcer", a weak minded man drunk on his policing power, is making her life hell, she reminisces about her dead parents, killed by another enforcer's decision in the past. Every single time the plot was getting close to good, something was introduced that devastated the tension and the potential and gave the reader the impression that the story evolved as Kalquist wrote, with no clear idea of who her characters were or what the final shape of the plot will be.

And then there was the climax, the moment I was waiting for, when our hero gets stuck on an unforgiving planet with her torturer as her only ally... and they just walk a little to another group of people where she shows how good she is at fixing things. So much potential down the drain. Bottom line: the author comes off as a beginner in writing, but at least she is not pretending her work is the greatest and/or puts her friends to post positive reviews. Even with this short story I could see the wheels turning smoother and smoother as I went along, which probably means her writing will improve. Unfortunately, as standalone work, Better World is not more, not less than space pulp fiction, with no real impact behind the characters or the storyline.

and has 4 comments
I really missed reading a good science fiction book and when I was in this vulnerable mental state I stumbled upon this very positive review on Ars Technica recommending Ann Leckie's trilogy Ancillary. Ars Technica is one of the sites that I respect a lot for the quality of the news there, but I have to tell you that after this, my opinion of them plummeted. Let me tell you why.

The only remotely interesting characteristics of the Ancillary series is the premise - that an AI gets trapped in the body of an "ancillary" soldier that was used as only a physical extension among many others - and the original idea of using no gender when talking about people. You see, in the future, the empire language has lost its need of defining people by gender and therefore they are all she, mother, sister, etc. It is important that the genre is translated into our backward English is all female, as to balance the patriarchal bias of our society. Way to go, Ann! The books also won a ton of awards, which made me doubt myself for a full second before deciding that notorious book awards seem to be equally narrow in focus as notorious movie awards.

Unfortunately, after two books that only exposed antiquated ideas of space operas past, boring scenes and personal biases of the author, I decided to stop. I will not read the third book, the one that maybe would give me some closure as the last in the series. That should tell you how bad I think the books were. On a positive note it vaguely reminded me of Feintuch's Seafort Saga. If you want to read a similarly out of date space opera, but really good and captivating, read that one.

You see, it all happens on ships and stations, where the only thing that doesn't feel like taken from feudal stories are... wait... err... no, there is nothing remotely modern about the books. The premise gets lost on someone who focuses exclusively on the emotions of the Artificial Intelligence, rather than on their abilities or actual characteristics. If I were an AI, I would consider that discrimination. The same ideas could be put in some magical kingdom where magical people clone themselves and keep in touch. I don't know who invented this idea that the future will somehow revert to us being pompous boring nobles that care about family name, clothes, tea and saucer sets (this is from the books, I am not making it up), but enough with it! We have the Internet. And cell phones. That future will not happen! And if it would, no one cares! The main character acts like a motherly person for stupid or young people, no doubt reflecting Leckie's mood as a stay-at-home mom at the time of writing the books. You can basically kill people with impunity in this world of hers, if you are high enough on the social ladder, but swearing is frowned upon, for example.

OK, ranted enough about this. I don't care that her vision of the future sucks. I wouldn't have cared if her writing was bad - which it isn't. It's not great either, though. I do care when I get flooded with review titles like "The book series that brought space opera into the 21st century", by Annalee Newitz, or "Ancillary Justice is the mind-blowing space opera you've been needing", by Annalee Newitz, or "Why I’m Voting for Ann Leckie’s Ancillary Justice", by Justin Landon - a friend of Annalee Newitz' from the Speculative Fiction compilations, and "A mind-bending, award-winning science fiction trilogy that expertly investigates the way we live now.", by Tammy Oler, who is writing with Annalee Newitz at Bitch Media. Do you see a pattern here?

I have to admit that I think it is a feminism thing. So enamored were these girls of a story that doesn't define its characters by gender, that they loved the book. Annalee's reviews, though, are describing the wonderful universe that Leckie created, with its focus on social change and social commentary, and how it makes one think of how complex things are. I didn't get that at all. I got the typical all powerful emperor over the space empire thing, with stuck up officers believing they know everything and everything is owed to them and the "man/woman of the people" main character that shows them their wicked ways. The rest is horribly boring, not because of the lack of action, but because of the lack of consequence. I kind of think it's either a friend advertising for another or some shared feminist agenda thing.

Bottom line: regardless of my anger with out of proportion reviews, I still believe these books are not worth reading. The first one is acceptable, while the second one just fizzles. I am sure I can find something better to do with my time than to read the third. The great premise of the series is completely wasted with this author and the main character doesn't seem to be or do anything of consequence, while moving from "captain of the ship" to "social rebel" and "crime investigator" at random.

On the 9th of February I basically held the same talk I did at Impact Hub, only I did better, and this time presented to the ADCES group. Unbeknownst to me, my colleague there Andrei Rînea also held a similar presentation with the same organization, more than two years ago, and it is quite difficult to assume that I was not inspired by it when one notices how similar they really were :) Anyway, that means there is no way people can say they didn't get it, now! Here is his blog entry about that presentation: Bing it on, Reactive Extensions! – story, code and slides

The code, as well as a RevealJS slideshow that I didn't use the first time, can be found at Github. I also added a Javascript implementation of the same concept, using a Wikipedia service instead - since DictService doesn't support JSON.

and has 0 comments
Japanese culture is certainly special. The music, the drawing style, the writing, the cinematography, they are all easily recognizable and usually of high quality. Yet I think it is even cooler when artists are able to blend Japanese feeling with Western cultural artifacts. Check out this Japanese traditional sound... made metal: Akatsuki no Ito (The Thread of Dawn?)

Today I was the third presenter in the ReactiveX in Action event, held at Impact Hub, Bucharest. The presentation did not go as well as planned, but was relatively OK. I have to say that probably, after a while, giving talks to so many people turns from terrifying to exciting and then to addictive. Also, you really learn things better when you are preparing to teach them later, rather than just perusing them.

I will be holding the exact same presentation, hopefully with a better performance, on the 9th of February, at ADCES.

For those interested in what I did, it was a code only demo of a dictionary lookup WPF application written in .NET C#. In the ideal code that you can download from Github, there are three projects that do the exact same thing:
  1. The first project is a "classic" program that follows the requirements.
  2. The second is a Reactive Extensions implementation.
  3. The third is a Reactive Extensions implementation written in the MVVM style.

The application has a text field and a listbox. When changing the text of the field, a web service is called to return a list of all words starting with the typed text and list them in the listbox, on the UI thread. It has to catch exceptions, throttle the input, so that you can write a text and only access the web service when you stop typing, implement a timeout if the call takes too long, make sure that no two subsequent calls are being made with the same text argument, retry three times the network call if it fails for any of the uncaught exceptions. There is a "debug" listbox as well as a button that should also result in a web service query.

Unfortunately, the code that you are downloading is the final version, not the simple one that I am writing live during the presentation. In effect, that means you don't understand the massive size reduction and simplification of the code, because of all the extra debugging code. Join me at the ADCES presentation (and together we can rule the galaxy) for the full demo.

Also, I intend to add something to the demo if I have the time and that is unit testing, showing the power of the scheduler paradigm in Reactive Extensions. Wish me luck!