Tuesday, 26 September 2006

MSN messenger random picture issue

For as long as I can remember, the MSN messenger changed my picture in a random fashion. I was setting it, then at the next restart, another was there. The last version I am using is 7.5.
Today, I finally found out what caused it: Tools → Options → Security → "This is a shared computer, so don't store my address book, display picture or background on it".
It is nice to know that if I want to keep the same picture on the messenger I have to also store my address book on the computer. Microsoft seems to think they are of similar importance :-/

Monday, 25 September 2006

Sunday, 24 September 2006

Osama bin Laden, a modern Hannibal?

Spurred by two TV shows about two famous people, I came to the conclusion that Osama bin Laden's history has a lot in common with the one of Hannibal Barca, the Carthaginian general, just as the history and technological development of the US has a lot in common with the Roman Empire.
Think about it!
Hannibal was born in Carthage, but he left it when he was nine years old. He hated the Romans with all his being and when he attacked their empire (which then span the Italian peninsula) he did it by hitting targets deep within their teritory. Using innovative strategy, he defeated the strong Roman army by using its flaws: size, but no coordination; force, but not precision. With a small mercenary army that also used elephants, he surrounded the huge Roman army and destroyed it. He then demanded support from Carthage, in order to siege and capture Rome, but the politicians of that state decided that it would be safer to not antagonize the Roman Empire and didn't sent support. Powerless to set siege to Rome, Hannibal could do nothing but watch how the Romans build another army which will then defeat him. In order to avoid capture, after years of exile, he commited suicide.
Osama didn't leave Saudi Arabia from childhood, but he was exposed to the teachings of returned exiled teachers, who brought different ideas. He came to hate the Americans and when he attacked them, he struck deep within their teritory. Using innovative strategy he defeated the US antiterrorism machine by using their flaws: size, but no coordination; force, but bureaucracy. With the smallest of terrorist groups that also used air elephants (heh, I stretched it out a bit, but it holds), he struck a major blow to the confidence of the US. He then demanded support from the Arabic nations, which decided to not antagonize the American Empire. We all know what happened to the ones that did. Powerless to continue his campaign, Osama watched as the US machine learned from its mistakes, rebuilt it's antiterror army and then defeated him. After years of exile, he dies, avoiding capture through death.
Now, what it even more interesting is that Hannibal's actions led to the expansion of the Roman Empire into Iberia and Carthage and the refining of their army and war strategy. This eventually led to the Roman Empire conquering so much and becomnig the most famous and technologically advanced civilisation of its time. Carthage was completely raised from the surface of earth, destroyed by Romans and plowed clean. If we were to continue these parallels, the American Empire should now have a more powerful and precise war machine, it should conquer or at least neutralize any threat from the Arab nations, then proceed on conquering the world. Some poor country should take the blame, as Carthage did for Hannibal, and be completely ravaged by war. Does it sound familiar? Brrrr...

Other related links from people that had similar ideas:

There are even more links, in total Google showed 573 links that contained Osama bin Laden, Hannibal and not L*ecter. But since people spell Osama differently, others make it clear that it's not the guy from the movie, thus causing false positives and there are a lot of sites that just enumerate famous people, the count cound be completely different.
Happy thinking!

Tuesday, 19 September 2006

God is a brand

It was one of those moments when you think of nothing and suddenly something distillates into conscience. It sounded too good and too important not to find it on the net so I googled for "God is a brand" and I found 17 entries out of 98.200 (yes, Google is getting weirder and weirder).
Now, when it hit me, it seemed like something really smart, but now I understand it is just obvious; I was the dumb one for not getting it sooner. People don't have holly wars on Linux vs Microsoft, they are having brand wars on Jesus vs Mohamed.

What started me is looking for furniture for my new rented apartment (expect a huge blog in a few days) and I found the same models in two different places, but with two different prices. My wife said that it was because the more expensive ones were better made, but they really weren't.
Then I realised that most commerce is run on brands, it's nothing new, it goes on from the beginning of trade. You buy from where you know it's good, or from where stuff makes you look or feel good. People are attached to the spirit of the thing, not the thing itself (well, most people). The Stradivarius violin can be made better and cheaper using modern computer modelling and automated manufacturing, but people care about the original Stradivarius, made by a human, a human that represents something. The enormous price of Stradivarius violins is not due to their utility, but the faith of the people in the original builder, the artist. Ring a bell? Original artist? The Creator? Yes! God!
The epiphany came when I explored the idea in my mind. People doing idiotic things because of their faith, the experiment where people were given to wear a t-shirt for 10$ and refused to do it when they heard it belonged to a serial killer or the one with the children that were given a "perfect replica" of an object that they loved and they prefered the original or the simple superstitions like avoiding number 13. Movies, as well, usually portray clones as imprefect, evil, empty of true purpose or life. People remain married for decades, respecting and even loving the other person, when all rational motives to stay together have withered in time. Of course, this is also linked to the way human instincts work, but nevertheless, there are people who do it and people who don't.
Somehow, the intricate mechanism of the brain puts values on associations rather that on the objects. I think this is important. It is obvious that people have inner representations of different things and people, but I've always assumed that the inner value is put on the thing not on the associations. I now believe to have been wrong. It makes sense: there is no absolute value, only when you put something into context it reveals its value.

Therefore, returning to the God is a brand issue, it seems to me that the branding is made on oneself. You don't buy the product, you become the product. You brand yourself with a god, then act in accordance with its meaning. Then losing one's faith would be like becoming an clone of yourself, empty of meaning. It could explain the feeling of loss of a person, when "there are other fish in the sea". It makes old people be grumpy, since no one truly understand the different deep meanings that they've attached to objects and people and behaviours.

I can't even ask myself "Do brands suck?". It would attack a defining feature of humans AND animals alike. This warrants a look into the idea of religious feeling in animals. It is not possible for everything to suck. Religion sucks, though.

Monday, 18 September 2006

ASP.NET 2.0 Parser Error Message: Access to the path '[something.cs]' is denied

I was stunned today to see that a site that I was working on was not starting because of this idiotic error:
ASP.NET 2.0 Parser Error Message: Access to the path '[something.cs]' is denied.
And further down:
No relevant source lines

The only thing I remembered doing was close the project in Visual Studio and work on another. I tried starting the site with the URL, without loading it into Visual Studio and the error occured. If you search on the net this error, you will see that there are a lot of articles that talk about the ind*exing ser*vice, but I stopped it a long time ago. So what was going on?

  • The file was accessible

  • The file was not opened by another application

  • I could freely delete/remove/modify the file



In desperation I compared the Security settings for this file with other files in the directory. To my surprise, there was a major difference. The files that were accessible had a lot of users with access rights to them, the file that gave the error had around three.

I have no idea what caused this. I just copied the same rights from the other files to the problematic one and it worked. I am using Visual Studio 2005, Resharper and SourceSafe. Do you also hear the Twilight Zone soundtrack?

Friday, 15 September 2006

Programatically trigger event in Javascript

It's is done in two different ways: the IE way and the DOM way.
IE way) really simple, use element.fireEvent(eventName,[eventObject]), where element is a HTML element and eventName is something like "onclick";
DOM way) really complicated. A short example:

function simulateClick() {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
var cb = document.getElementById("checkbox");
var canceled = !cb.dispatchEvent(evt);
if(canceled) {
// A handler called preventDefault
alert("canceled");
} else {
// None of the handlers called preventDefault
alert("not canceled");
}
}

As you can see, you need to create the event, then initialize it, then dispatch it.

    Things you need to take care with:
  • in the DOM model the event name is not prefixed with "on". In the IE way, the event is prefixed with "on". ex: DOM:click IE:onclick.

  • in the DOM model the event triggering does everything the event would have done, like setting a value, in IE it does not. ex: triggering onclick in the above example would check or uncheck the box. In IE you need to change the value yourself.



This is code I did to programatically click a checkbox and also trigger the onclick event:

if (box.onclick)
{
if (box.dispatchEvent) {
var clickevent=document.createEvent("MouseEvents")
clickevent.initEvent("click", true, true)
box.dispatchEvent(clickevent)
} else
if (box.fireEvent) {
box.checked=!box.checked;
box.fireEvent('onclick');
} else
box.onclick();
} else box.checked=!box.checked;

Wednesday, 13 September 2006