and has 0 comments

I read about Dark Universe online, in a "best" sci-fi book list from somewhere. Richard Dawkins recommended it as a very good book and one of his favourites. I can see why the book would appeal to Dawkins, perhaps he even read it when he was a child. The idea is that the book is classical pulp fiction; the characters are simple and undeveloped, the logic strained and the science only consistent with the times in which it was written. At first, when I started reading, I was captivated by the world of people living underground after a nuclear apocalypse, but then I started getting more and more annoyed with the leaps of logic and superficial characterisation. I thought it was a book written by a teenager, like Eragon maybe, but instead it was written by a grown man in the 50s. When I learned about this I understood more of why the book existed at all and why people seemed so... stupid and onetracked. The ending, something that almost offended me, not by its quality - which wasn't good to begin with, but by its implications, is classic 1950 "scientific" thinking. The hope of humanity as small minded arrogant assholes.

Bottom line, it is a simple and easy to read book, in a bad way. The science for it is lacking, the characters are simplistic and the plot classic pulp (prince and princess kind of crap). Too bad that a good initial concept was wasted by a mediocre writer in a mediocre time.

and has 0 comments
I have not read any of China Miéville's works, but I have received a positive recommendation from a friend and decided to read The City and The City, thinking that I would read a science-fiction story. Instead, it is a fiction filled police procedural - a detective story - placed in a city that is, at the same time, part of two different countries. There is a detective, set on finding the murderers of a young girl, who during his investigations takes the reader through the internal workings of this weird place and leaves us with the concept that we all, as city dwellers, are silently and cooperatively complicit in the evil perpetrated around us. Interesting, indeed, but quite a shallow concept to be transformed into a book, even one written by such an obvious talent as Miéville. There is also a sad reason why he wrote the book such, as a present to his terminally ill mother who enjoyed detective stories.

But back to the book. It is fascinating to observe a place where an establishment, a person or even an object are part of one city or another based on physical characteristics such as certain colours, a certain gait or a certain way to make a common gesture. This idea is the soul of the book and the rest just a pretext to explore it. Anyone breaking the boundaries between the two cities is immediately and absolutely punished by a shadow entity called Breach, which appears next to anyone even focusing too long on a place from the other city and maintains the "skin" between the two different nations. Miéville does not explain, really, what caused such a split, why Breach was formed and even how it does what it does (and indeed, how it did the same thing for thousands of years). The point of the book is not to root into reality the concept of this shattered place, only to explore its possibility. And it does this skilfully. The issue I had with the book is that, except for this brilliant and original idea, you are reading a police procedural, plain and simple. I was in the mood for something else, perhaps.

My conclusion is that it is a very well written book, one that is worth reading, but not something that could be considered brilliant except for the seed idea. Outside that idea, which has been pretty much detailed in this post, the plot is a standard detective story.

and has 0 comments
I was first directed to Esther Friesner by the excellent audio reading of The Shunned Trailer, a short story which humorously and skilfully combines Ivy League competitiveness with Lovecraftian mythos. You can (and should) listen to it on the also excellent podcast site EscapePod, which together with its sister sites Pseudopod and Podcastle provide free weekly audio stories from the genres of sci-fi, horror and fantasy, respectively. The story itself was so amusing to me that I actually laughed out loud, which - for those so blissfully unaware of it - is not the same thing as LOLing. I made a short foiree into some Lovecraft stories, then proceeded on reading something of Friesner's.

Druid's Blood is an alternate universe Sherlock Holmes story. The "alternate" in the universe is an England where the druids repelled the Romans by using magic and then went on protecting the British isles with a magical shield that prohibits the entry of - for lack of a better word - contraband. This includes, for example, steel. It is an interesting modern bronze age world in which the druids are the highest religious order, everything is run by magic, technology is pretty much forbidden, but the Brits still have their high ideals, the monarchy and Sherlock Holmes. The irony is thick when the work comes from an American author.

Anyway, I don't want to spoil the story; you have to read it for yourself, but I recommend it highly. The first chapter is not so good, so I suggest you go through it even if you are not terribly enthusiastic about it. The rest, though, made me not let the book out of my hands - to my wife's chagrin. Not as funny as The Shunned Trailer (after all, it was not intended as a parody) it combines several famous ideas and characters with this twisted history of a magical Britain. The book is not meant as an exploration of history, though, as the characters and references are not really meant to have been contemporary or explainable by small tweaks in the time stream. I liked the book, although I don't know if I want to read more of the author right now. She is certainly smart and funny, but even if I enjoyed the book tremendously, it couldn't reach the level of good fun and concentrated smarts that The Shunned Trailer seemed to be. As such, I recommend reading the book first, then listen to the podcast of The Shunned Trailer. Perhaps in this order, the pleasure level will be higher.

There has been a lot of discussion on the changing of the names of Sherlock Holmes and doctor Watson. Whether it was a form of respect to the original characters to change their names if you change their entire world or whether it was a copyrighting issue or some other motive, I see no reason to dwell on the matter. After all, the epilogue is a tip of the hat to doctor Sir Arthur Conan Doyle, who invented a character of such incredible skill and intelligence, only to relegate his own role to the faithful sidekick. Enjoy the book.

and has 0 comments
It is difficult for me to not admire Lovecraft and at the same time just as difficult to fully enjoy his stories. He was admirable because he was a true horror writer, haunted by his dark visions so completely that a lot of his stories are set in the same world, undoubtedly filling his mind at all times. And it is difficult to enjoy his stories because the horror feeling in his books comes from a very subjective and I dare say outdated place in the human mind. Most of his characters attribute adjectives like "abhorrent" or "grotesque" to mere shapes or smells and they actively attempt to filter out anything that might challenge their peace of mind and established world order. That's a silly and disgusting thing to do, I think, and perhaps this is what repels me most from writings of "the master".

But let me tell you of At the Mountains of Madness. The first thing that came into mind when I started reading it was "The Thing". It is placed in Antarctica where an expedition finds some frozen aliens who then defrost. There is even mention of shapeless things that can assume any form or function. Of course, this is as much as the similarities go. First and foremost the story is told by a scientist, in the pompous and highly descriptive manner in which most Lovecraftian work is written. This geologist, one of the few survivors, decides to write a more detailed account of what happened in view of a new expedition organized to go in the same region. His motive, and here is where I scoff the most, is to dissuade people to ever go there again, as some things are too horrible and evil to be explored by man. Say what? How is that guy a scientist? Anyway, he writes this as to fill in the gaps that he consciously and deliberately left out when he returned from the expedition, all of its members sworn to secrecy on some aspects of the trip. He sounds more like the leader of a cult than a member of a scientific group, doesn't he?

The end is more satisfying, though, where even Lovecraft's roundabout and subjective exposition has to give when describing the things they actually discover, explore then run away from. Even if I cannot abide the motivations of his characters or enjoy the way things are made more or less horrible or grotesque by their close minded whims, I have to declare some affection to the universe Lovecraft describes and perhaps some lingering interest on what one could make of it.

And indeed, people have been trying to resurrect Lovecraft's work in various ways: board games, graphic novels, sequels and prequels, movies. I seem to remember a 2005 movie that I liked, made after The Call of Cthulhu, but even that was made as a silent black and white film using the exact text from the story. And even if it achieved its goals of bringing Lovecraft's work to the screen, it did nothing to make it less dated or more accessible to a modern audience. Guillermo del Toro wanted to make a movie after At the Mountains of Madness, but he was deflected by film studios and his other work, mainly Prometheus. Del Toro even said that he would not make the ATMOM adaptation because it would have the same premise and twist as Prometheus. I am not so sure they should have been similar, but hey, that's how he saw it. What I am trying to say here is that modernizing Lovecraft for the present audience takes most of the love out of the craft :) Even this novella, which was a little bit longer than a short story, had so much roundabout storytelling and filler descriptions that if you took them away you would remain with a skeleton idea that could mould over anything.

So, my conclusion is that At the Mountains of Madness is one of the most accessible Lovecraft writings. It seems less dated than others and actually brings some clear descriptions of what is going on, not just randomly used adjectives testifying to the bizarre mental state of the characters. I can see no way to modernize or take the story and bring it to a modern audience without breaking the plot and turning it into something else, so if you want to experience it, you need to read the novella. It's relatively short so it shouldn't take much, unless you find it hard to go past the most descriptive parts without falling asleep, as I have.

and has 1 comment
Ripper Street appeared at the same approximate moment with another similar series, Copper, also a historical series about policemen made by the BBC. The Ripper Street inspector is a man of justice, but also one that believes in the process of finding proof and sending the guilty to trial, which is relatively the same with the guy in Copper, who was a little more violent, but basically good stock. He employs (not unlike Copper) a doctor that is using scientific methods to determine the cause of death and other details that help in the investigation. His love life is in shambles as he mourns the death of his daughter, just like in Copper. A lot of the script also revolves around a female brothel owner, beset by financial troubles, but that ultimately proves ruthless. And also both series have ended abruptly, just before the second season's finale. This similarity can't be coincidental and it bothers me to no end that they used the same scheme for two different markets, just to see how it will work, with TV viewers as lab rats for their experiment.

But there are also differences. While the Five Points violent stage for Copper was more appropriate for the genre than East London after Jack the Ripper's case, the lead was never terribly charismatic. He seemed like a nice good looking Irish boy who was way over his head as a policeman. Instead, in Ripper Street Matthew Macfadyen uses his deep baritone voice and intimidating presence to portray perfectly the driven inspector Edmund Reid. Also, while the support cast for Copper did their job rather well, none seem to reach the height of theatrical performance that Jerome Flynn brings to Ripper Street while playing the violent but good willing police sergeant. And the final nail in the coffin for Copper is that most of the issues of the lead character are personal in nature, while the inspector in Ripper Street is tortured by his personal life failings, but is loyal to his job as a policeman.

Perhaps Ripper Street started with a promise of bringing light on the good of people in a hellish corner of the world, but in the end managed to do the opposite. In truth, the last scene of the series (and you might want to skip this slight spoiler if you plan to watch the series) is with the woman who loved the inspector turning in disgust when she sees him order his sergeant to kill a man in order to bring justice outside the system. In fact the last scene shows him betray all at once everything he stood for during the entire series. It's a slip up, of course, driven by desperation and something that would have probably been thoroughly explored in the third season. Alas, there is no third season to be had, for reasons of decreasing audience. It is difficult to pretend to be the best television producer in the world and then only care about audiences, like the assholes across the ocean, BBC!

The inconsistency in the show's quality can be blamed for the cancellation of the show, as well, but overall Ripper Street was entertaining and thought provoking. It could have been better, but not by much, I think. Good cast, good atmosphere of the old East End, some pretty compelling scripts. I believe it a shame to stop the show now. It was clearly better than Copper and that show had two seasons as well. Ripper Street deserved better, as well as all the viewers hooked on it.

I've just finished the eighth episode of the fifth season of Misfits, the last in the series, as the show finally reached its end. I am convinced that most of the people reading this post don't really know what Misfits is and I mean to rectify that. Be warned, this is not the epitome of television and the last seasons were rather disappointing compared with the first few, but those few were pretty refreshing for a TV show.

Misfits is a British TV show about superheroes. Unlike American heroes, who are all beautiful and good and perfect, the first batch of Misfits superheroes is a bunch of losers on community service that get caught in a freak storm that gives them "powers". They use those powers in the most outrageous ways, completely out of control and with a tendency to think only of themselves and accidentally kill probation workers. Unfortunately it is the most consistent trend through the series, as actors change from season to season and the mood and quality of the show oscillates wildly.

My point, though, is that the show has a very nice premise and its worst problem was that instead of focusing on character development, they tried to ramp it up, adding more people with powers and gradually increasing the danger and weirdness of the situations in which they were involved until it just became ridiculous.

I don't know (or care) about ratings, but for me a nice show would have pitted these few guys against the real world, not a weird (and ultimately meaningless) version of itself where a lot of people have superpowers, but nobody notices. I repeat myself, but the idea of normal blokes and girls having superpowers and acting like normal people while they have them was a great one and the show creators should have followed it through. Too bad they didn't.

To wrap this out, I highly recommend to sci-fi fans watching the first two seasons of Misfits. Its... britishness... brings a refreshing perspective to an already overloaded and tired genre of the superhero and not getting exposed, even a little, to Misfits makes you miss out on a nice and unfortunately shortlived slice of the mythos.

I really wanted to give you a compilation of the best moment in Misfits, but apparently YouTube is infested by "Best funny moments of Nathan" which is the rude Irish pretty boy from the first season. Instead I leave you with the trailer for the series:

and has 0 comments
You have to appreciate The Witcher for at least two major reasons: one is that it is based on a series of books by a Polish author and second is that it is made almost exclusively by Polish programmers and software managers. It is basically Polish software, and for that the quality is really great. Not that I disconsider software coming from the country, but I imagine they have a lot less resources than major American game studios, for example.

The story is that of a witcher, a monster slayer. He has tremendous physical strength and can use magic thanks to magical and genetic changes that have transformed him into a sterile mutant. He is basically the Caucazian version of Blade, if you want. I have not read the stories, but from what I've heard they are rather morally ambiguous, featuring the witcher drinking and whoring like a madman in between monster slaying bouts. The game attempts to do the same thing, of course with the sex and foul language removed, as it would have been too gruesome among all the blood, gore and violence. (I was sarcastic there, in case you didn't see it, people in charge with the moral development of our society!)

In fact the concept of the game is marvelous: have a character that can make choices that affect the overall story in a fantasy game of feudal monsters and courtly intrigue. However, in order to do so, you must go on endless quests gathering this and that, running around like a marathoner on steroids (which I guess you are, with all the genetic alterations and potions). The poor guy runs so much that one gets tired just watching him move. That was the major issue I had with the game, over 70% of it is running around (and 10% animations).

The fighting style was intriguing, but ultimately annoying. You had to click on the monster you wanted to kill, then wait for a specific moment when the cursor changed in order to click again and perform a combo. Up to six clicks can build a combo, which gives the player a lot of opportunity to click on somebody else, click next to the monster or move the camera in a way in which it is temporarily impossible to fight. Also Gerald does not have automatic fighting, so unless you tell him to attack, he just sits there and takes it. The damn clicks make you feel you are doing something, though, which I guess is a plus.

You get to meet a lot of damsels in distress which you have the option of helping. Once you do that they are remarkably willing to discard their clothes for you. In that situation you get to see... a nicely drawn card of a partially naked woman representing the sexual act. Then you return to where you were... at the same hour... dressed... which makes one think of a problem with the witcher's endurance, so to speak.

The changes in storyline are interesting, and some of them don't seem to happen until they have had time to propagate. This means you cannot just save, make a choice, see what happens and load, as there is a long time between choice and effect. This also means you will have to play the game a lot just to see only one story line. You will probably have to Google for all the outcomes. I, as always, was a perfect gentleman. No matter how ugly that Adda chick was, I still slept next to her... twice... and of course we remained best friends. No, really, there is something seriously wrong with me.

Overall it is a pretty entertaining and captivating game. The end chapter (the fifth, if you are wondering) is fraught with animations and it seems you have nothing else to do but move a bit, see a movie, move a little bit, kill some guy, another movie and so on. The fight with Javed was the most difficult, I think, with the rest a complete breeze once I had upgraded the Igni spell to the maximum power.

I have, however, the certainty that with a simple hack to allow a person to click on the map and get there at warp speed (maybe stop if there is a monster on the road or something) this game would have been three times shorter and a lot more fun. I started with a lot of expectations about it, though, and maybe that is why I felt a little disappointed, especially with the "boss" fights which seemed to involve a lot of talking and hiding behind minions until I got to them and very easily kicked their ass.

Time to play The Witcher II, I guess! I leave you with a video review of the game.



Also, for more information about the Witcher, like the choices you can make and the consequences or the quests you never got around to finishing, go to the Witcher Wiki

and has 0 comments
I tried to find a title with more impact than the title of the original article to express my combination of amusement and disdain; I couldn't. It says almost everything. Apparently, the reason why the nuke codes were reset was that US Strategic Command generals almost immediately had the PAL codes all reset to 00000000 to ensure that the missiles were ready for use regardless of whether the president was available to give authorization.. How insane is that? On the other hand, there is a positive side to all this: it goes to show that you are just as intelligent as an US general when you leave your phone PIN to the default 0000.

and has 0 comments

  Oh, what a wonderful book this was. A cross between a William Gibson and a Peter F. Hamilton book, Accelerando was like a cyberpunk's wet dream. Not only it describes the deep transformations of our culture caused by the increasing power and speed of computation, but it goes further, years, decades, centuries and millennia more. You know the feeling you get when you get close to the end of a book and you sigh "Oh, I wish it would continue to tell the story"? It happens at the end of every chapter. It's like Stross could have ended the book at any point, but he chose to continue the story until its satisfyingly circular end. What is it with writers and the return to origins, anyway? There is an explanation for the structure of the book, as the author originally published each chapter as a separate story.

  What is even nicer is that the story doesn't skim the details, showing only superficial bits that further the story, but it goes into everything: cybernetics, economy, ethics, law, the nature of consciousness. It gets frightening at some points when you realize that in the situations depicted in the book reality would be even more carnivorous and that your own individuality (held coherent in the book for the benefit of the reader) is just an illusion we cling to, ready to dispel when we muster the courage (or the insanity) to let it go.

  I also liked how, while it was human-centric, the book did not limit itself to one species, nor did it go the way of accelerating (pardon the pun) until the whole story becomes meaningless in some encounter with a God like alien or by complete transcendence. I have to say I appreciate Stross immensely for not doing so, which is the normal and easiest way for a geek to end such a story: by generalizing the hell out of the situation until no particulars make sense. In that, the writer showed real restraint and mature wisdom. It makes me want to read all of his books.

  If you want to know what the plot is, you will have to read the book, as I can't really do it justice here. I can tell you that it made me believe in an explosive evolution of the human race in my lifetime more than any Kurzweil discourse and it did it easily, by simple measuring MIPS/gram on the scale of the entire Solar System. If we will run Moore's Law for a few more decades, it will make enormous sense that "dumb matter" is done for. It is a fantastic vision of computation as a devourer of mass, a frightening equation akin to Einstein's matter to energy conversion. Did I mention that it also - convincingly - explains Fermi's paradox, much more so than "we get to build androids for sex", which was the most believable for me so far?

  Needless to say it, but I will anyway: go read it, read it now! It is an amazing book. It is a little too pretentious in some parts, when it bombards your brain with technobabble just so it gets you "future-shocked" enough to understand the characters, but what cyberpunk fan doesn't eat that up, anyway? Also the familial connections in the book are a bit too overdone, but then again, they provide the generational point of view necessary to describe centuries of human evolution. There is a page - surprisingly Web 0.9 for such a plot :) - for the book, with an extract from the first chapter, but I don't think it is representative for the entire work.

You can actually read the book online for free, from the author's site: Accelerando

This is something I have been hitting my head on from the beginning of my programming career: just find the best match in a table for each row in another table through a single query.

There are solutions, but they are all very inefficient. To demonstrate the issue I will start with a simple structure: tables A and B, having the same columns id, x and y. I want to get, for each point in table A defined by the (x,y) coordinates, the closest point in table B. I only need one and it doesn't need to be exclusive (other points in A might be closest to the same point). It doesn't even have to be one row in B for each row in A, in case there are two points at the exact same distance to a point in A. The creation of the structure is done here:
CREATE TABLE A(id INT PRIMARY KEY IDENTITY(1,1), x FLOAT, y FLOAT)
INSERT INTO A (x,y) VALUES(10,20),(20,30),(20,10),(30,20),(30,20),(10,30)

CREATE TABLE B(id INT PRIMARY KEY IDENTITY(1,1), x FLOAT, y FLOAT)
INSERT INTO B (x,y) VALUES(11,20),(20,31),(21,10),(31,21),(30,20),(11,30)

To find the distance from A to the closest point in B is trivial:
SELECT a.id, 
a.x,
a.y,
Min(( a.x - b.x ) * ( a.x - b.x ) + ( a.y - b.y ) * ( a.y - b.y )) AS
dist
FROM a
CROSS JOIN b
GROUP BY a.id,
a.x,
a.y
To get the id of the closest B point, not so easy.

The first naive solution would be to just find the row in B that corresponds to each row in A using nested selects, like this:
SELECT * 
FROM a
JOIN b
ON b.id = (SELECT TOP 1 b.id
FROM b
ORDER BY ( a.x - b.x ) * ( a.x - b.x ) + ( a.y - b.y ) * ( a.y - b.y ) ASC)

Looking at the execution plan we see what is going on: 86% of the query is spent on "Top N Sort".
Let's get some other solutions so we can compare them in the end in the same execution plan.

Another solution is to just use the result of the query that computes the distance and just join again on the distance. That means we would compare each row in A with each row in B twice, once for the computation of the MIN function and the other for the join:
SELECT j.*, 
b2.*
FROM (SELECT
a.id,
a.x,
a.y,
Min(( a.x - b.x ) * ( a.x - b.x ) + ( a.y - b.y ) * ( a.y - b.y )) AS m
FROM a
CROSS JOIN b
GROUP BY a.id,
a.x,
a.y) j
INNER JOIN b b2
ON j.m = ( j.x - b2.x ) * ( j.x - b2.x ) + ( j.y - b2.y ) * ( j.y - b2.y )

Something that does the same thing, essentially, but looks a little better is joining the table A with B and then again with B on having the point from B2 be closer to the one in B1, but then adding a condition that there is no B2 (in other words, B1 is closest):
SELECT a.*, 
b1.*
FROM a
CROSS JOIN b b1
LEFT JOIN b b2
ON ( a.x - b1.x ) * ( a.x - b1.x ) + ( a.y - b1.y ) *
( a.y - b1.y ) >
( a.x - b2.x ) * ( a.x - b2.x ) + ( a.y - b2.y ) *
( a.y - b2.y )
WHERE b2.id IS NULL

None of these solutions scan B only once for each row in A. Their relative complexity is this: 75%, 11% and 14%, respectively. In other words, finding the minimum distance and then joining with the B table again on the points that are in exactly that distance is the best solution. However, given some assumptions and a weird structure, we can get to something that runs in half that time:
SELECT id      AS Aid, 
x,
y,
m % 100 AS bId
FROM (SELECT a.id,
a.x,
a.y,
Min(Cast( ( ( a.x - b.x ) * ( a.x - b.x ) + ( a.y - b.y ) * ( a.y - b.y ) ) AS BIGINT) * 100 + b.id) AS m
FROM a
CROSS JOIN b
GROUP BY a.id,
a.x,
a.y) j

These are the assumptions that must be true in order for this to work:
  • The function value can be converted to a BIGINT without problems. (if the distance between points would have been subunitary, this would have lost precision)
  • The maximum ID in table B is under a certain value (in this case 100)
  • The converted function multiplied by this maximum number doesn't cause an overflow
Basically I am mathematically creating a container for the value of the function and the id of the point in B, computing the minimum, then extracting the id back from the value. Neat.

Another solution, one that makes most apparent sense, is using a feature that was introduced in SQL Server 2005: RANK. We rank the points in B to each point in A, based on our function, then we only get the first by selecting on the rank being 1. Unfortunately, this doesn't work as expected. First of all, you cannot use RANK in the WHERE clause, so you must select the rank first, then select from that selection to add the condition. This might mean horrid temporary data tables if tables A and B are huge. Also, after running the query, it appears it is slower than the one that joins on the minimum distance. Here it is:
SELECT aid, 
bid
FROM (SELECT a.id AS aId,
a.x,
a.y,
b.id AS bId,
Rank()
OVER(
partition BY a.id
ORDER BY (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) ASC) AS rnk
FROM a
CROSS JOIN b) x
WHERE rnk = 1

Comparing all the solutions so far, without the first naive one, with the nested selects, we get these values:
  1. Mathematical container of function value and id: 14%
  2. Selection of the minimum distance to each point and then joining with table B for the second time to look for the point that is at that distance: 21%
  3. Joining twice on the same table with the condition that one is better than the other and that the better one doesn't actually exist: 29%
  4. Using RANK: 36%, most surprisingly the worst solution

The final solution, adding some more computation in order to get rid of constants and some assumptions thus becomes:
DECLARE @MaxId BIGINT 

SELECT @MaxId = Isnull(Max(id) + 1, 1)
FROM B;

WITH q AS (SELECT A.id,
A.x,
A.y,
Min(Cast(Power(A.x-B.x, 2) + Power(A.y-B.y, 2) AS BIGINT) * @MaxId + B.id) AS m
FROM A
CROSS JOIN B
GROUP BY A.id,
A.x,
A.y)
SELECT id AS aId,
x,
y,
m % @MaxId AS bId
FROM q;


I am still looking and there is now a question on StackOverflow that attempts to get the answer from the community, so far with limited results.

and has 7 comments
I work in this silly place where everything must be done according to some plan or procedure. They aren't even very good at it, but they are very proud of this bureaucracy. For example I don't have Outlook installed on my work machine, but on a virtual one which is in a different network and can be accessed only by remote desktop protocol. Some admin with a God complex thought it was a good idea to make the computer lock itself after a few minutes of idleness and even close the entire virtual machine when no one accesses it for a while. This might have some sick sense in the admin's head, but I need to know when an email arrives and so I would like to have this virtual machine open on the second monitor without having to enter the password every 5 minutes. To add hurt to offence, I cannot install any software on the virtual machine or using Powershell to prevent the computer going idle or anything useful like that. Good, a challenge! I need to find a way to keep the remote desktop session alive.

Enter Windows Script Hosting. I've created a small Javascript file that gets executed by the machine and occasionally moves the mouse and simulates pressing Shift. No more idleness and no need to access Group Policy or install anything. Just create a text file and paste the following code and then save it with a .js extension, then run it. It will keep the computer from going idle.
var WshShell = WScript.CreateObject("WScript.Shell");
for (var i=0; i<60; i++) // 60 minutes
{
WshShell.SendKeys('+');
WScript.Sleep (60000);
}

Step by step instructions for non technical people:
  1. Press the Windows key and E to start the Windows Explorer
  2. In the Explorer, navigate to Desktop
  3. Remove the setting for "Hide extensions for known file types" - this is done differently from Windows version to Windows version, so google it
  4. Create a new text file on the desktop by right clicking in it and choosing "New Text Document"
  5. Paste the code above in it
  6. Save the file (if you successfully removed the setting at point 3, you should not only see the name, but also the .txt extension for the file)
  7. Rename the file to busybee.js (or any name, as long as it ends with .js
  8. Double click it

The script will run 60 times at every minute (so for an hour) and keep the machine on which it runs on from going idle. Enjoy!

and has 1 comment
The preferred method to display anything in Transact-SQL is PRINT. You can print a string, a variable, an expression. However, as anyone soon finds out, the message get all cached in a buffer and displayed after the entire query ends. So if you have several long running queries in a single batch and you want to get real time messages from them, PRINT doesn't work. A quick search directs you to another MS SQL directive: RAISERROR (note the creative spelling that makes one think more of hearing Katy Perry RROR rather than a proper error raising directive). Also note that Microsoft recommends using a new construct called THROW, introduced in SQL2012. However, it only looks like a lamer version of RAISERROR. They both send a message to the client instantly, but the problem they have is that they do not, as PRINT does, accept an expression. So if you want to print something like 'The computed key from the query is: '+@Key you are out of luck as you need to declare a new nvarchar variable, fill it with the message value then use it in RAISERROR.

But there is a better solution. RAISERROR not only throws something at the client, it also flushes the message cache. So something like this works: PRINT 'The computed key from the query is: '+@Key; RAISERROR('',0,1) WITH NOWAIT;.

Of course, being the dev that I am, I wanted to encapsulate this into something that would be reusable and also get rid of the need do use plus signs and conversion to NVARCHAR, so I created this procedure that almost works like PRINT should have:
CREATE PROCEDURE Write (@P1  NVARCHAR(max)=NULL, 
@P2 NVARCHAR(max)=NULL,
@P3 NVARCHAR(max)=NULL,
@P4 NVARCHAR(max)=NULL,
@P5 NVARCHAR(max)=NULL,
@P6 NVARCHAR(max)=NULL,
@P7 NVARCHAR(max)=NULL,
@P8 NVARCHAR(max)=NULL,
@P9 NVARCHAR(max)=NULL,
@P10 NVARCHAR(max)=NULL)
AS
PRINT Isnull(@P1, '') + Isnull(@P2, '')
+ Isnull(@P3, '') + Isnull(@P4, '')
+ Isnull(@P5, '') + Isnull(@P6, '')
+ Isnull(@P7, '') + Isnull(@P8, '')
+ Isnull(@P9, '') + Isnull(@P10, '')

RAISERROR('',0,1)

And you use it as DECLARE @now DATETIME = GetDate()
Write 'The date today is ',@now
. Nice, huh? Of course what you would have liked to do is Write 'The date today is ',GetDate(), but apparently stored procedures do not accept functions as parameters, and functions do not accept PRINT inside them.

and has 0 comments
I remember when I was a kid in highschool and wanted so much to experience that amazing feeling books and movies described, the magical bond between man and woman, the thing that makes everything worthwhile and even death irrelevant. So I had the feeling. It was amazing, it was magical, it was everything I expected it to be and more. And yet it all turned out to be an illusion, a manufactured fantasy of my own making that just tumbled down like a castle made of cards. And I always thought that was sort of weird and uncommon, but now I am thinking that maybe all romance is like that.

Could it be that love is something we are programmed to need to feel and we are just doing all is necessary in order to have the feeling into a familiar and comforting setting? All other sensations and feelings and needs are accounted for: you are happy because something good happened, you are hungry because you haven't eaten, you are disgusted because someone did something, you want to belong because we are a social species, but love is something that doesn't make a lot of sense, it's just there. It also feels too personal to assign it under "a species thing", even if its ultimate purpose is just that. So, in order to justify it, you need an origin story, just like any good comic book hero.

Thus the myth is born, perpetuated, kept alive as long as you have the feeling. And when you break a relationship up, again there are these justifications, stuff that just appears out of thin air and one or both of the people involved are always shocked, because they weren't there five minutes ago, when people were in love. "You killed my parents!" "You threw me in acid!" and so on. I don't want to stretch the superhero thing too much, though. Alternatively, think back and try to imagine all of your relationships as movies in the Kick Ass franchise. :)

So this is how I am seeing this: you meet this other person, you develop feelings of affection (or maybe just carnal lust, I don't care) and your brain starts churning up this script in the background. Once the script is ready, the focus group enjoyed it, the producers secured the financing, you already have the cast and bang! you have a blockbuster movie you call love. Until then it was just... less, "simple" affection or enjoyment, but with the origin story it becomes the superfeeling, capable of incredible feats, worthy of songs and tales.

As an argument for this vision I bring the terrible reluctance of people to dispel the magical script of their love affair. When the mystery of their feelings is laid bare they feel they have lost something. When outsiders are trying to look at it logically or to deconstruct the story they meet with fanatical resistance. After all, if you are an artist, making your own movie and starring in it, you really hate critics.

And when you are in a long relationship, one that spans more than the fabled three years, you continue to have the feelings, now intertwined with practical issues like who gets the car, who walks the dog, but they don't look so great because the love movie, as cool as it was, is old. You remember those times, maybe share them with your friends, just like remembering a good movie (made even better in your head by the bad parts you chose to conveniently forget) and your friends' reactions are just like for a movie, either sharing their own or criticizing yours or agreeing it was cool, maybe even getting the old "they don't make them like they used to" speech.

Of course, in order to definitively prove such a thesis, one must delve into the idea of what is real and what is not. That's a can of worms I am not opening. And believing every love story is a fantasy that covers up more mundane things and in which everyone involved participates willingly doesn't diminish its power. You can enjoy a movie even when you know it's not real, especially because you know it's not real. I also have to say something about the nature of control in a love situation. It's not clear to me, yet, but the gist of it is that this is why people do enjoy playing romantic games of seduction and betrayal, but ultimately dismiss the practice as not serious. It's the same kind of behaviour one sees in parents that scoff at their children's games, but watch TV all day. The thing is in a story you don't have control. It becomes more and more powerful the more the characters can say it all happened to them, rather than being something they planned. Somehow having control in a romantic relationship is frowned upon and having a good story on why losing control was a good thing is a form of art.

I'll end with a fragment of a movie I really liked, one that you probably don't associate with romance: The Name of the Rose. There was this scene where a girl, dirty and inarticulate, scavenging in the castle's garbage, meets our young protagonist interpreted by Christian Slater and just humps him like there is no tomorrow, groaning and moaning like a wild animal for the whole five minutes; then she leaves. Later on, when people are trying to burn her as a witch, the boy saves her. At the time I found that very romantic, even if they didn't even share a word. Maybe it's the fact that he gets to save her in the end, but most likely it's Slater's performance of looking at the girl with a longing and very confused gaze, the "what the hell is happening to me?" look that betrays the background script writing in the back of his skull.

and has 2 comments
There is nothing more fantastic than the advertising world. Whether it is a brilliant spot, winning prize after prize at ad competitions, or a formulaic and horribly boring video of a housewife getting aroused by the newest household products, marketing and advertising items have one thing in common: they can't possibly be true. Maniacal teens getting their faces stretched by hideously wide grins cannot possibly love a soft drink or a gum so much. The housewife I previously mentioned probably has a job and children to take care of on the side, chances are there is little that actually makes her happy and absolutely nothing that can make her ecstatic about cleaning products. The newest app is never as good as the banner annoyingly appearing over your web site indicates, nor is the latest enterprise software doing the job it's supposed to do beyond a superficial number of typical scenarios. No teen finds happiness by buying the latest smartphone or opting in the latest two year cell subscription.

The governments everywhere are not doing their job, not keeping the promises they made during electoral campaigns, companies try to hide their problems under the rug while bragging to anyone that listens of the quality of their staff and products, human resources hire people under false pretenses while employees advertise skills that they never had. Boys proffer their love to girls and they in turn promise to have actual sex after the relationship steadies. Security companies, national or commercial, are only interested in their own security rather than yours. People that sarcastically make fun of other people's commercials are never as cool as they attempt to look.

I don't know about you, but in the rare cases when software doesn't manage to remove ads completely from my browser or smart phone, the fact that the ads appear in front of me has no effect other than mild (or strong) annoyance. My mind filters out the flashing images, the over the top colors and embellished fonts, anyway. Even the user content and comments that have been touted as the soul of Web 2.0 (or is it 3.0 now?) which would allow me to feel connected and get the information I need, they either reek of aggressive stupidity or bring little useful information to the table. I don't care what the top N items are in any list, nor am I interested in what other people Liked or not on Facebook. I never give money to beggars and don't buy stuff from loud people.

As far I can see, there is nothing that can be called advertising that is actually true or at least beneficial. So I have to wonder, in view of this impression of mine, could it be possible that the promise of advertising as a whole is just a lie as well, that the advertising of the marketing science and art is just as much bullshit as anything else the comes out of their world? Could it be that advertising's greatest feat is to make us think it actually works?

and has 3 comments
We is a classic book, written by Russian author Yevgeny Zamyatin, who envisioned how the future in the hands of the Bolsheviks will work against the individual. He imagined a world in which all people shave their head, wear the same uniform and have numbers instead of names and live in completely transparent buildings, with no privacy. As the preface of the book there are three commentaries on Zamiatin's genius, history as a writer in Russia, then his voluntary exile and the interdiction of his works in Russia.

So did I like the book? No. To say that is dated is an understatement, but it's not only that. The style is that of a diary, but one in which dialogues between people are described verbatim. The way they speak is emotional, hysterical, they interrupt each other and words are incoherent, so contradictory to the premise of the book. Even the inner thoughts of the main character are chaotic, childish, delirious, with wild mood swings. It was so horrible that, after deciding that 200 PDF pages were not going to be a lot of reading, I stopped at 50 and started skipping ahead. The entire book is like that.

Maybe Zamiatin was a great writer, but I don't see it. Just because he was Russian is no excuse for his incoherence. It felt like he wrote the book while intoxicated; with too much coffee. Even if he starts his book with Dear readers, you must think, at least a little. It helps, I believe that it was his duty as a writer to communicate his ideas in a digestible form. Maybe thinking is different from person to person, Zamiatin. If I think about it, the story within is similar to the movie Equilibrium, only that was more action based, as any American movie is prone to be, and watchable. The same champion of the system being seduced (through a woman, how else?) by the emotions that he was sworn to fight against.

About the subject of the book, I can say that stories about rebels fighting Utopian regimes are making me feel conflicted. I care about the personal desires of the individual, but I also care about the overall system. One must understand that a centralized and overall controlled system is as disturbing to a person that experienced individual freedom as is a decentralized system based on individuals is for someone that lived in a different environment. To assume that one or the other knows better is just arrogant and stupid. The worse thing that can happen, in my view, is to only have one acceptable system that, even if we could leave one country for another, would be the same all over the world.

On the other hand, once you, as an individual, decide that something is right and something is wrong, you have a responsibility to act. I just remember that quote Slaves dream not of freedom, but of becoming masters. It would be a lot easier for me to accept people rebelling against systems if they would stop attempting to change the world for everybody, not just themselves.

Well, I will leave you with a quote from the book, one that seemed eerily contemporary: If human liberty is equal to zero, man does not commit any crime.