Wednesday, 28 January 2009

Dogs

At first, I thought it was a coincidence, but it turns out it was all deliberate. This dog would come out from the park and then shit on the sidewalk. And not any kind of poop, but that smelly, sticky, yellow crap that only dogs seem able to manufacture. Then the dog would go back into the park, just far enough so that its presence would not be obvious, and it would watch. People would eventually step in the shit, all reacting to it in different ways. The ears of the dog would jump straight up, its eyes focused on the target, absorbing everything that happened.
He did that for three days in a row, so it couldn't have been a coincidence. However, when faced with the facts, they didn't seem so strange to me. Actually it makes perfect sense for predators to ambush their prey and learn from its behavior as much as possible. I admit, for a dog it was a pretty sick and smart thing to do, but it was all within reason. After all, I was doing the same thing, staking the man up, watching his every move, learning his habits.

I can remember the days when this filled me with excitement, the thrill of the hunt reverberating from some place deep inside my skull, but now I could only feel calm. Not boredom, though; boredom is dangerous, makes people sloppy, gets them hurt. I was missing a certain element, something that, in the past, made all this fun, but I couldn't quite find it now. That's why this was the last one. And only because it was necessary.

The guy showed up at exactly the time I was expecting him to do. Small time thug, acting cool while pretending to be larger than he was capable of ever being. I let him go up to his apartment, slightly amused at the concentrated look-around that he pretended to throw before entering the building. If he wouldn't have been pretending, he would have been able to notice me, watching him from a car for three days in a row. A different car, I admit, but who would be dumb enough to do it differently? Maybe the cops... and the guy was looking out for police presence, I guess. Unfortunately for him, I was no policeman.

I gave him 5 minutes to change his mind. Maybe he would feel the wrongness of the situation, maybe luck would be with him and make him leave for some reason. Maybe he would just grab a beer and drop in his big armchair, watching mind numbing TV shows, as I knew he would. Yet, I always like to allow for the unknown, for the unexplainable, makes it seem more real. Although, when doing this thing for a long time, one sees all kinds of shit and knows almost every way people react when stepping in it. I got out of my car.


I smashed the door lock with my foot and entered the room. Dirty, sloppy, typical bachelor room with a twinge of gangsta. What a dump! My guy froze for a second on his armchair, then, to my surprise, moved really fast and produced a revolver from underneath the small table next to him. He pointed it at me and shouted something along the lines of inquiring on my identity. Of course, a lot of "fuck" and "mudafucka" was involved, although that sounded a bit off coming from an oversized white guy.

I froze for a moment, too. A gun, who would have thought? I closed the door behind me, then turned to him and started telling him what had to be said. I did have three days to think it over in my head, after all.

"There is a saying", I calmly conversed, completely ignoring the vulgar threats coming from my target, " that every boy kills his father to become a man. Of course, it's a metaphor most of the time".

I waited for a reaction, watching how the feeling of control provided by the gun was slightly fading away. He decided to enforce it by standing up and aiming the gun at me from somewhere above his head, throwing profanities at me while doing so. Doesn't he know he can hurt his wrist by firing that way? Not to mention having almost no accuracy whatsoever.

"In other words, no man is complete without killing his father first, metaphorically speaking of course". It was almost hilarious; for a second, the guy thought I was talking about him and me. I could see on his face how he considered being my father or vice-versa. Well, at least not all of this will have been devoid of fun.

"Shut da fuck up, mudafucka! Who da fuck are you anyway? You escaped from some loony ... mental... "

I ignored him "However, it was you that actually killed my father. I therefore seem to be entitled to feel... incomplete.".
I could see the reaction right away. Killing one's father was a serious thing even for a brain dead thug. He knew he was in danger now, maybe he even felt guilty, even if he had no idea who my father was. He did take a step back and aimed the gun with both hands at me. Now, that was better. I could tell he was considering squeezing the trigger right then, but people are always too curious for their own good. He had to know how it plays out.

"I have decided to pursue my quest for completeness by killing you.", I then added, gently pushing him over the edge with a hard look. He fired.


There is something slightly poetic in having your own gun explode in your hands, killing you instantly with a stray piece of metal through the eye and brain. Of course, the cement in the barrel and the well planned weakening of the metal of the revolver cock would be obvious during the police investigation, but it would also be clear that the gun was unregistered and that the victim pulled the trigger voluntarily.

I didn't quite feel complete, though. He hadn't kill my father, either, so I guess it was to be expected, but I was sure he did kill someone's parent at some point in time, so I also expected a bit more gratification.

After all, it was a good call to stop doing this. No fun at all. Well, maybe not a complete stop, more like a sabbatical, to clear one's thoughts. I may never do it again.

Saturday, 24 January 2009

Monday, 19 January 2009

Seirei no Moribito - Guardian of the Sacred Spirit

the main characters in the story
Another pearl in the anime pond. One just has to dive and grab this fairy tale and watch it. Seirei no Moribito is the story of a female bodyguard, bound by honor and personal history to defend a child prince from the assassins sent by his father, the emperor. The anime is not really a fighting anime, though, no one battles for the sake of battle. More than that, the "ona yojimbo" has vowed to save lives, not take them, so she never kills anyone. All characters in the story are clearly drawn up, with their own particularities and personal motivations to do things and in the end, there is even a eco green moral. :)

My advice it to watch it, as it is both a beautiful story, as well as a complex one, fit for both adults and young children. Only 26 episodes, but it is worth it. I would really like to see animes for the rest of the books in the series. You can also read the first two chapters of the manga at Mangafox.

Friday, 16 January 2009

Including external javascript on async postbacks

Update: it has come to my attention that these kind of errors appear only when debug="true" in the web config. In production sites it might work regardless.

You want to programatically load a js in a user control. The user control becomes visible in the page only during async postbacks and it is hidden at page load. So you want to use some method of loading the external javascript file during that asynchronous UpdatePanel magic.

Use ScriptManager.RegisterClientScriptInclude. There is a catch, though. For each script that you want to include asynchronously, you must end it with
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
else the Ajax.Net script loader will throw an error like: Microsoft JScript runtime error: Sys.ScriptLoadFailedException:
The script '...' failed to load. Check for:
Inaccessible path. Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
.

For the aspx version, use the ScriptManagerProxy control:
    <asp:ScriptManagerProxy runat="server">
<Scripts>
<asp:ScriptReference Path="~/js/myScript.js" NotifyScriptLoaded="true" />
</Scripts>
</asp:ScriptManagerProxy>

Thursday, 15 January 2009

Dennou Coil - a pretty fun anime.


Dennou Coil is a cross between Ghost in the Shell and Tonari no Totoro. How can it be possible? Simple! First remove all that usual Japanese obsession with boys in high schools (you know, everything happends to some high school children, usually boys, all in the same class, maybe some opinionated women, they fight, they grow in "level", etc). Instead use girls in elementary school. Then move it in some future world where people merged the real world with the virtual, and add cute creatures like from Tonari no Totoro (and the girls) in the virtual world! Yatta! :)

Anyway, getting more serious now, the anime is really nice. The Augmented Reality concept is pretty cool and (even if towards the end it gets a little spiritual and unnecessarily action like) stays pretty consistent. Imagine wearing clear glasses that add to your usual display of reality information like virtual pets, virtual laptops, keyboards and displays, maps of your current location and so on.

The children are all drawn towards a strange phenomenon that adults seem to regard as fantasy, called Dennou Coil, where the consciousness of people gets transferred to a virtual nether world via the quantum circuits in the glasses.

Towards the end, adults try to confiscate the glasses from the children and, after a hearty discourse about how real things can be touched, I thought the whole cool idea of the series would be perverted towards some social goal of keeping children "real", but it was not so. You will have to watch the series to know what I mean :)

Bottom line: pretty interesting and captivating. A little too childish, but without resorting to silly behaviour or self referential comedy that I see so much lately in animes. The anime has only 26 episodes, with little chance of more. The manga itself is complete as well. Couldn't find the manga free online. If you know where to find it, leave me a comment.

Recommendation: watch it!

Wednesday, 14 January 2009

Session state is not available in the current context

So you did some work in an ASP.Net web site and then you decided to or to add the Ajax extensions to it or switch to ASP.Net 3.5 or whatever and suddenly you get Ajax errors like "Sys is undefined" or you don't see images and the css files are not loaded. And after googling like crazy and finding a zillion possible solutions you decide to enter in the browser address bar the url of the offending image, css file or even ScriptResource.axd files containing the ajax javascript and you see a beautiful ASP.Net error page displaying "Session state is not available in this context.". Huh?

There are some reasons why this might happen, but let's examine the one that actually prompted me to write the article. Someone made a change in global.asax, trying to work with Session there, more precisely in the Application_AcquireRequestState event. The error was returned by the Session property of the HttpApplication object, the one that the global.asax file represents! In fact, this error can only be thrown from there in the current ASP.Net implementations.

First mistake: there was a Session property available in the HttpApplication object and it was immediately assumed that it is the same as Page.Session or HttpContext.Current.Session. It is about the same, except it throws an error if the underlying Session object is null.

Ok, but why is Session null? You are a smart .Net developer and you know that the Session should be available in that event. Any documentation says so! Yes, but it applies to your page, not to all the IHttpHandler implementations, like ScriptResource.axd! Also, the css and image problems occured for me only when opening the site in Cassini, not in IIS, so maybe it opens separate threads to load those resources and ignores the session or something similar, at least at that level.

Well, how does one fix it? Adding in global.asax a condition on Session not being null throws the same error, so you have to add it on HttpContext.Current.Session. In other words:
if (HttpContext.Current.Session!=null) //do stuff with sessions

Maybe this problem occurs in other places as well, but only the Session property of the HttpApplication will throw the "Session state is not available in this context." error.

The end of the world is (finally) coming!

The previous post was the 500th post in this blog! And I haven't even noticed. Let's celebrate late with news about the end of the world!

How bored can I be? I've read this article about the asteroid Apophis striking the Earth in 2029 or 2036 and my first thought was "oh man! Why so late?". I was already calculating how unfair it is that I would have to live to be 59 years old before the world ends. So I have to cope with it until then, then, close to my retirement, the pleasant moment when I get money from the state and do nothing while my mind slowly rots away, it all goes away. Then it hit me: I am a complete idiot! What was I thinking? Sheesh!

Anyway, here is a cute animation made by a guy on youtube. I personally prefer the first one, the one that is only graphics and no realism. Again, who wants real? But it wouldn't be in the spirit of the blog :) So watch the second one, the one made to satisfy the critics.

Update: the guy REMOVED (who does that?!) the videos from YouTube. I am putting another ridiculously grand video of a possible asteroid (although this seems more like a dwarf planet :) ) destruction of the Earth to satisfy the ones hungry for obliteration.



Wow, think how many blog posts I would have written until 2036!