Thursday, 19 November 2015

The Farseer Trilogy, by Robin Hobb

All three book covers The first thing to notice about Robin Hobb's writing is that it's good. Characters are well written and well embedded in the scenes, scenes are well described, albeit sometimes too well, the world is well defined and the story feels both original and familiar, so it wasn't difficult to enjoy reading the three books in the Farseer series. Sure, there were issues with the story that I felt frustrated about, and I am afraid to say that it comes from the female perspective of the writer, more than not, but overall it was really difficult to put down once I started reading it.

The main character of the story is the bastard of a royal prince, next in line to the throne, that is being brought by the maternal father to the prince's doorstep. It's yours, you take care of him, that sort of thing. The poor mother had nothing to say in the matter, although why that stayed like this for the rest of the story is unclear. Immediately the existence of this child leads to major changes: his father doesn't come to see it or recognizes him in any way, but abdicates from his royal position and retires to the country, where he is subsequently murdered. The child is raised by the prince's most loyal man, a stableman that is tasked to the boy's care by the prince himself before his death. The old king takes a fancy to the boy and keeps him at the castle if he agrees to become a King's loyal man and become the apprentice of the royal assassin. Several other things happen that see him trained in fine writing, royal intrigue, sword fighting and so on.

Another important aspect of the story is the magic. The Farseer royal line, meaning the king and his sons, are strong in the Skill, something that gives them mostly power over other people or the ability to see or communicate at great distance. There is another type of magic that comes from the mountain folk called the Wit, which is the ability to communicate and even bond to animals. The latter is seen as disgusting and sometimes criminal and many a person was put on trial and killed for having a talent in this type of magic. Guess what? The bastard has both talents.

So it starts like the normal fantasy young adult plot, where the main character is a hapless child that discovers he has superpowers, but Hobb makes this as an unpleasant experience as possible for him: lost friends, jealous uncles that see him as next in line for the throne if ever recognized by royalty, a tragic attraction for a childhood friend, the moral dilemmas associated with being an assassin, deceit, torture, and so on. I will not spoil the book for you, so I will stop here.

The thing that annoyed me the most about the book was the inconsistency in some matters. One moment he is a berserker brawler attacking with a big ax and killing dozens, the next he is traveling everywhere carrying swords or staffs and having fear of two or three people. At one moment he is a trained assassin, the next he can't figure out how to kill people. At one time he blows a powder in someone's face and they immediately die, the next he doesn't know how to kill people that he routinely gets close to, one moment the love of his life is the most important thing, the next he ignores her for a few months while he does stuff for the king. Also, he is loyal to a fault, while everybody else, including his wife and his so called teachers, treat him as a child and keep essential information and training from him. This gets worse and worse as you get closer to the end of the story. The first book was wonderful, the second gets more inconsistent and the decisions of the characters are really weird and the third is filled with WTF moments. The most annoying thing of all is the ending, which features some spectacular sacrifices that are completely invalidated a few pages later on.

Bottom line: the kid is much more effective, smart and logical when he is a child. As he goes through puberty he gets worse and worse until his only skill seems to be listening to what others say and obeying for no good reason. If you don't like the books too much, be happy that the story ends satisfactorily with the three books, if you do like the writing and the world Hobb describes, there are many other books set in the Elderlings world, including a sequel trilogy to the Farseer one called Fitz and the Fool.

Wednesday, 4 November 2015

Blog redesign

As much as I enjoyed the old format, I needed to change the design of the blog. This is the result. Any feedback would be greatly appreciated!

My personal preference is toward darker themes, and I've added a dark/light tool switch in the Tools menu. I also tweaked the template in order to work on mobile devices better. I hate the default Blogger mobile style. Please let me know if there are any issues.

Thanks.

Abandoning Adobe Reader

Today I wanted to read a PDF. Nothing more than that, just read a damn file. Instead, I got the first use of the Adobe Reader DC, which I may have inadvertently updated to when asked for an update (rather than a complete redesign). But I was OK with it, you know. Adobe Reader was always a lightweight reader of files and the updates have mostly been about security. So now they want to redesign it, what could possibly go wrong? Just rearrange some menus or something, right? Wrong.

I skipped EULAs and bloating features for a while until I got to (surprise!) an online login screen. I didn't want to log in anywhere, I just wanted to read the PDF, so I closed the login popup window. It reopened. I started looking for buttons or links for skipping, cancelling, ignoring, doing it later, but none were there. Quite literally I was locked until I chose to log in. You know what I did? I forcefully closed the process and installed Sumatra PDF reader. 10 seconds later I was reading my damn PDF.

And you know what? I have used Sumatra PDF on other computers in the past. What I found is that, besides some features for PDF that I will never use, like forms and such, Sumatra was better than Adobe Reader. Way faster, that's obvious, but then it read correctly some PDFs that could not be even opened by the default reading application from the company that invented the damn document standard. Once, I remember, we had a weird PDF that we had to wait for about a minute in Adobe Reader in order to render a single page. Sumatra opened it instantly. Not only it is smaller, leaner, faster, better, but Sumatra also reads a lot of other formats: ePub, MOBI, CHM, XPS, DjVu, CBZ, CBR.

Bottom line: I have abandoned the last Adobe tool that I was regularly using on my computer. Will they ever learn?

Tuesday, 3 November 2015

New Star Trek series!! An official one, this time.

Yesterday, a CBS original announcement was published stating that a new Star Trek series will be produced to be released in 2017! Yes! Finally! However, I am not all enthused about this. The news item is doing nothing more than promote a generic product. It's like saying "We are going to release the newest detergent brand in 2017" without saying what makes it special or what it is supposed to clean. The entire announcement is about the old Star Trek, the 50 year anniversary (or the 47th of it's cancellation, I guess... morons!) and how the people who wrote the worst Star Trek films yet are on board for it. At least J.J.Abrams is not in. They basically are advertising "Generic Star Trek series. Get you space ship high at the lowest cost in our store".

Yes, I do have a problem with the Kurtzman/Orci team. Take a look of the filthy trash made for the lowest common denominator that they have worked on: Hercules and Xena, Alias, Fringe, Sleepy Hollow, Scorpion; all shows that look interesting, but have no story, no substance, no end. You just watch them for watching's sake, on fast forward, hoping you will see a fun monster or to see how an episode ends. They also worked on the new Star Treks, which personally I disliked with a vengeance.

I mean, look at the announcement. A generic Star Fleet symbol in a shiny, misty light and a text saying nothing. You know what says something? The "Shop" section in the right, where you can already buy T-shirts and Spock ears.

Mr. Kurtzman, Mr. Orci, if you are reading this, please, pretty please, prove me wrong. Show me some light in the pit of cynicism that I fell into. Demonstrate to the world that you are still in it for the stories, for the emotion, for the fun, not just for the money. Make this great concept and then you can say "Ha, Siderite! You're just another moaning critic on the faceless web and you don't know what you are talking about!"

Rumors about a new Star Trek series have appeared and died many times, but the most recent and believable ones stem from March this year, where two pitches seem to be favored: a Michael Straczynski and Bryce Zabel complete reboot, which is highly unlikely, and a further in the future Federation story, where the entire quadrant is at peace and complacent and has to jolt back to action after a surprise new enemy attack. This one seems likely to me for many reasons: Picard is way too old to play any significant role, so is Kirk, while all other attempts at heroic leaders have misfired. CBS doesn't have the guts to make the captain or even the entire vessel alien, so the captain will be a human, like always, and they already went through the phases of black captain, female captain, young captain. Therefore they need a completely new human captain, one that is again a rebel white male and navigates the ship through the moral labyrinth created by alien concepts, which are veiled concepts from other non Western countries. Also, the complacent peaceful empire attacked from outside seems connected to the political reality of the present, which is a constant in the successful Star Trek series.

I don't know how I feel about this. I felt that Star Trek was best when there was no arch enemy in the mix. Next Generation was without question the best Star Trek series ever made and it wasn't based on the war of the Federation with anyone. There were new crises and skirmishes all the time and aliens with long term aggressive intent like the Borg, but the show was never about the war. Deep Space 9 was also like that, until they entered the Dominion War phase, and nobody cared about it much. Enterprise failed terribly with its ridiculous time war, while Voyager started well, then collapsed under the stupid idea that the show needed to be about a strong female character, and therefore they created strong male enemies for her to defeat. Ha, in a way, Voyager's end - the defeat of the Borg Queen - showed not only how stupid it is to try to put females in charge just for the sake of political correctness and no other plot related reasons, but it showed it twice, and then both died at the end, saving the Universe from the great PC threat :) The original series of Star Trek was also not about a specific war and people remember it fondly because of that, regardless of the silly budget and production values. However, that doesn't mean this Star Trek: Federation thing couldn't work. Because it would be anchored in the present, they would always have some ideas on how to go on without having to pull concepts out of their ass while stoned. People would empathize with one side or the other, which I believe to be crucial: paper villains always make bad shows.

There is, of course, the possibility that the new show would be a completely different idea. Perhaps the Star Trek: Star Fleet Academy series that I am expecting for so long, just because it is the last stage of a franchise: adolescent audience, adolescent actors. But the ideas could be fresh as well: think Star Trek meets Harry Potter via Ender's Game (or even better: Fisherman's Hope).

So here is my pitch: a well aged alien teacher is training a class of young cadets, too young to do anything, mind you, except learn. While on a training mission with a shitty training ship, they encounter an unexpected situation, one that requires study, for the survival of the Federation. Notice that I didn't define this as "an enemy", but just something that needs to not fall into adversary hands, perhaps, something that would help the Federation, but would threaten it in the hands of anyone else. Unable to communicate or return, the old teacher must become a captain to his students and solve the situation through ingenuity and hard work. Instead of Spock, Data, 7 of 9 as a counterpoint to the human captain, the captain is now utterly non human, the alien voice of reason, while the entire crew of kids would be a young virile emotional counterpoint to the cold calculation of their captain. It would be controversial because it would also put children in situations where children should not be put, making every experience in every episode a coming of age thing, changing all the characters as the show progresses. They would be the rebels, the bringers of new ideas, the brave bodies and minds that would employ unexpected tactics to achieve their task, but also the stupid kids that die needlessly, that put others in danger, that get physically and psychologically abused.

It would be also anchored in the reality of the moment, because it would touch subjects like teaching methods, the way adults often dismiss or discredit the young, the stupidity and beauty of said youth, the traps they fall for and the people who want to take advantage of their untrained minds and souls. It would also bring god damned sexuality in a show that always looked like made for people that are 50 years old. It would have a political side as well, since the reasons why a discovery cannot be shared because it is too powerful, but should not be destroyed because it is knowledge, will always be controversial.

Oh, dear, I knew that writing a Star Trek post would just never end. Perhaps I should start ST fiction and be done with it. I hope my Star Trek reader fans have enjoyed this and that the rest were not utterly bored. Can't wait for 2017! Perhaps if I would run really fast towards the sun...

The Cycle of Arawn, by Edward W. Robertson

Young orphan, thief, mugger, magician, leader of men The Cycle of Arawn is a three book story arch written by Edward W. Robertson. I have no memory on where I got the idea of reading this series, but now, after researching a bit, I realize is one of those self published books that caught on sooner or later. Robertson is a 30 something guy who wrote a surprising number of books besides Arawn, but he is still young and that may explain the quality of the writing. I mean, he has a blog on Blogspot, for crying out loud! Who does that?

The story is about this young orphan who lives his life by the day, stealing, mugging, surviving. One day, though, he sees a wondrous thing: a man resurrecting a dog from death. He then decides, just like that, to find out what that is about and so he learns about the nether, the opposite of ether, which is the normal stuff of wizardry. The writing is not bad, but not good either. The characters are very thinly fleshed out and they change their behaviour as dictated by the plot, rather than be their own people. One thing that immediately jarred me is that the language of the writing is quite modern, while it presents a medieval magical world. The disconnect grows when all the people in the land, including men, women, different nations, different species, seem to have the same sense of humour. But what really annoyed me about The Cycle of Arawn is the inconsistency of the characters and even the story. In a three book series about nether users, ether is merely mentioned in a few places, although it was supposed to be most of the magic used in the land, for example.

Let's start and stop with the main character: Dante. He starts off as a poor street thug, but he can read, learn new languages, go to places to get books and find references on how to translate an ancient tome, all while being chased around by the owners of the book. He is 16 at the time. I would find that difficult to believe even if he were a modern 16 year old, but one living on the streets in medieval times? All the learning that is done after this point, though, is completely different: pompous old people give him hints and let him work it out in the most convoluted unprofessional educational system that ever existed. At every point, when people with vast difference in hierarchical position interact, they joke and make fun of each other like drinking buddies. This ignoring of the way structured societies work makes Dante become the leader of the nethermancer city, the first human member of a clan of non-human tribe, the starter of a war, the ender of the war, the ender of another war, all by the time he reaches 26 and while going around the world doing dangerous stuff. Which is all nice and neat, but completely absurd. At the end, it seems like the reading of the book that started it all wasn't even necessary or even the best way to learn to become a wizard. One begs the question, what exactly did the order of the nethermancers with the magic before encountering an uneducated kid from another country?

One might think that, being a young adult thing, this book has a lot of action, adventure, romance. It is not true. Dante is essentially a geek, a book buff that got superpowers. The most interesting portions of the cycle is when he reads something new or finds new ways of using the magic. He doesn't have any romantic relationship of note from start to finish and the only girl he kind of likes becomes the girlfriend of another and then he accidentally kills her and then he just moves on. The action sequences are poor, uncoordinated, uninspiring and worst of all: not using things the character has learned how to do in previous sections of the story. One thing that permeates the cycle: nobody gives a damn about anything, really. They proclaim some things, then they just brush them away like nothing happened and move on to make the plot work.

Bottom line: it was a classical "boy find special powers" kind of myth, but went all over the place. It was easy to read, even if some descriptions of non essential stuff took pages! (in my mind I renamed it to The Cycle of Yawn), and the series had a finality, sort of, with the third book, so I don't have to read 14 books to get to the end of the story (*cough*Wheel of Time*cough*). I wouldn't recommend it to anyone, really, even if it wasn't completely bad. It was bad, though.

Sunday, 25 October 2015

A Concise Chinese-English Dictionary for Lovers, by Xiaolu Guo

Book cover - the sexy version :) What starts as a slightly humorous book about the differences in perspective between the Chinese and the Western world turns into a deep insight into the raw psyche of women. That's not a nice place, BTW.

The thing that pops up immediately is the style of the English language in which the book is written. Xiaolu Guo creates this character who is a female Chinese coming to England on a year long visa to learn the language so she can get a better job in her native country. A Concise Chinese-English Dictionary for Lovers is written as her diary and, true to character, her English is really bad, but getting better, so that at the end of the book it is rather decent. Some things that Zhuan, the protagonist, is thinking are sometimes really funny, but sometimes feel really artificial, so much so that I scoured the Goodreads reviews of Chinese people to see if there were many exaggerations and it seems that the verdict is NO! In that respect, the book shocks a European by how weird the mindset of a Chinese country woman can be, so I consider it a win to have read it.

Also, the book is rather short, so unless you really dislike something about it there is no reason to not finish it up once started. However, the starting premise of the book is immediately changed when she meets this older Englishman, who lives life by the day, dabbling into art that he doesn't really care about and making ends meet by driving a transport van, which he hates. However he is well educated and, besides boning the young Chinese girl, also doubles as her English tutor. So it turns into a love story. But wait, it's not all roses, as her perspective over life (the woman that takes care of the household and makes babies and the man who provides for the family) is completely at odds with his views on intimacy, privacy and personal goals.

In the end, I have to say that if you want to start hating the relationship you're in, you should read this book. Like the Chinese concept of Yin and Yang, the two characters in the book are complementary, but separate, archetypes of the male and the female and the great attraction between them cannot nullify the classical disparities on their value systems. I don't know about women, but as a man I started to hate the pitiful neediness that Zhuang was exhibiting and I totally understood how the distance between the two people grew. I despaired when I read her thoughts on her own actions, when she knew what she was doing was hurting him and their relationship, but she found herself unable to stop.

What's worse is that, being archetypes, none of the characters compromises in any way, so I believe the reader is then faced with their own failings, but also with their compromises, laid bare, made evident and seeding regret. In that regard, it is a brilliant book. It pits West against East, male vs female, real vs ideal. It's not for everyone though. While I do not regret reading it, I don't think I would have read it if I really knew what it was about.

Friday, 23 October 2015

Performance of the NOT operator in Javascript when used to verify existence or if a value is set

I had this Javascript code that I was trying to write as tight as possible and I realized that I don't know if using "!" on an object to check if it is set to a value is slow or fast. I mean, in a strong typed language, I would compare the object with null, not use the NOT operator. So I randomly filled an array with one of five items: null, undefined, empty string, 0 and new Date(), then compared the performance of a loop checking the array items for having a value with the NOT operator versus other methods. I used Chrome 48.0.2564.109 m, Internet Explorer 11.0.9600.18163 and Firefox 44.0.2 for the tests.

Fast tally:
  • NOT operator: 1600/51480/1200ms
  • === 0 (strong type equality): 1360/47510/2180ms
  • === null : 550/45590/510ms
  • == with 0: 38700/63030/131940ms
  • == with null: 1100/48230/900ms
  • === used twice(with 0 and null): 1760/69460/3500ms
  • typeof == 'object' (which besides the Dates also catches null): 1360/382980/1380ms
  • typeof === 'object' (which besides the Dates also catches null): 1370/407000/1400ms
  • instanceof Date: 1060/69200/600ms

Thoughts: the !/NOT operator is reasonably fast. Using normal equality can really mess up your day when it tries to transform 0 into a Date or viceversa (no, using 0 == arr[i] instead of arr[i] == 0 wasn't faster). Fastest, as expected, was the strong type equality to null. Surprising was the null equality, which catches both null and undefined and is second place. typeof was also surprising, since it not only gets the type of the object, but also compares the result with a string. Funny thing: the === comparison in the case of typeof was slower than the normal == comparison for all browsers, so probably it gets treated as a special construct.

It is obvious that both Chrome and Firefox have really optimized the Javascript engine. Internet explorer has a 18 second overhead for the loops alone (so no comparison of any kind), while the other browsers optimize it to 300ms. Sure, behind the scenes they realize that nothing happens in those loops and drop them, but still, it was a drag to wait for the result from Internet Explorer. Compared with the other huge values, the ===null comparison is insignificantly smaller than all the others on Internet Explorer, but still takes first place, while typeof took forever! Take these results with a grain of salt, though. When I was at FOSDEM I watched this presentation from Firefox when they were actually advising against this type of profiling, instead recommending special browser tools that would do that. You can watch it yourselves here.

Final conclusion: if you are checking if an object exists or not, especially if you can insure that the value of a non existent object is the same (like null), === kicks ass. The NOT operator can be used to check a user provided value, since it catches all of null, undefined, empty space or 0 and it's reasonably fast.

Here is the code:
var arr=[];
for (var i=0; i<100000; i++) {
var r=parseInt(Math.random()*5);
switch(r) {
case 0: arr.push(null); break;
case 1: arr.push(undefined); break;
case 2: arr.push(''); break;
case 3: arr.push(0); break;
case 4: arr.push(new Date()); break;
}
}

var n=0;
var start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (!arr[i]) n++;
}
}
var end=performance.now();
console.log('!value '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] === 0) n++;
}
}
end=performance.now();
console.log('value===0 '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] === null) n++;
}
}
end=performance.now();
console.log('value===null '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] == 0) n++;
}
}
end=performance.now();
console.log('value==0 '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] == null) n++;
}
}
end=performance.now();
console.log('value==null '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] === 0 || arr[i] === null) n++;
}
}
end=performance.now();
console.log('value===0 || value===null '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (typeof(arr[i])=='object') n++;
}
}
end=performance.now();
console.log('typeof(value)==\'object\' '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (typeof(arr[i])==='object') n++;
}
}
end=performance.now();
console.log('typeof(value)===\'object\' '+n+': '+(end-start));

n=0;
start=performance.now();
for (var j=0; j<1000; j++) {
for (var i=0; i<100000; i++) {
if (arr[i] instanceof Date) n++;
}
}
end=performance.now();
console.log('value instanceof Date '+n+': '+(end-start));