and has 0 comments
Yes, at last another one of the World Sucks series. Here I am tackling globalisation, yet not the concept, but the buzz. People that somehow are against globalisation are the ones that have actually already accepted defeat. They see the franchise epidemic and high level political and economic games as the cause, not the symptom. They are nothing but fork and torch villagers trying to kill the beast without really understanding the cause of everything. They are especially wrong since they try to kill a beast much stronger than they will ever be.

And the cause is... not dr. Frankenstein, but statistical discrimination. It is the thing that makes shops disappear if they don't give to most of the people most of what they want, that puts people that don't behave like the majority into ignorable categories, the thing that doesn't come from high up to affect us, little people, but comes from very little people to affect the higher ups.

I am talking about statistics. Once you have enough objective data you can draw conclusions based on hard mathematics, conclusions that you know are not biased and that have true meaning. It tells shop chains which are the most financially effective customers and what exactly choose to buy, it tells media conglomerates which are the people which will be most inclined to see their shows, exactly what they would want to watch and how much they are going to be influenced by commercials in order to buy products, it tells politicians which is the biggest part of the electorate and what they could be told in order to elect them.

The effect of this is statistical discrimination, or the oppression of the minority groups that don't "fit" into the whole data schema. That's why you will not get the products you really want, you will not see the shows you want to see or the movies you crave or the books you need. That's why you will see young people asking you about every day things like some vegetables you used to find when you were a child and now nobody knows what they are. They do know about some exotic fruit you've never heard about, too, and they are willing to pay ten times the price of normal fruit for the privilege to eat it.

It starts with small business, it extends to media, then to art, then to politics. Before you know it, you can either do what everyone else does or be ignored. Does it sound like 1984? That was a naive view of the world, where the actual oppressors were a very small minority, where democracy was a dream. No, the actual oppression comes from the majority of people, the idiots watching today's TV shows, eating popcorn at European Gigolo and Scooby Doo the Movie. And it all starts from you, the little people.

Every form of discrimination in this world, either good or bad (yes, there is good discrimination), is statistical in nature, but most bad ones are determined by bad entry data, like all Gypsies are dirty or all black people are thieves. This time there is a growing mother-of-all discrimination, one that starts with perfect data, ends up with the perfect solution and leaves just about everyone that matters out of it.

The only option IS globalisation, the only possible solution for the people that want to do something different is to get together, through the Internet, through the disappearance of borders, nationalities and local law, through the dismissal of all things that separate people of the same type, because the oldest and most effective method of ruling other people is divide-and-conquer. Because no one is special for being American or Romanian, these are just stupid inventions, based on geography or past connections. Each person is special for their own reasons.

Globalisation is not the cause, it is the symptom. It is the opposite of localisation, or keeping something for yourself in a single place. Globalisation is the crucible of sense: you now get to decide what is important and what not in the whole world! And the problem is not high up, it's down with you, it's your decision.

Fight stupidity; elect common sense; choose diversity; create AND consume what others create just don't limit yourself to consumption alone; say the things you mean, not the things others want to hear; fight for your right to party, but think of the people who want to sleep; do what you like, but consider the others.

and has 0 comments
Yes, Manga again. I feel the whole manga/anime intensity fading away again, since I've read the Berserk and InuYasha manga and watched the Samurai Deeper Kyo anime series. Oh... that and my wife hates me for ignoring her :)
But before this manga fading to black, I will blog one more manga series. I think that it is nicely drawn, but hard to actually follow. I am talking about hardcore sci-fi manga Blame! by Nihei Tsutomu. Placed in a distant future, humans and silicon creatures (and some crossbreeds) inhabit a huge structure and fight each other for obscure reasons. The manga is a cross between Giger and Aeon Flux and, if you remember the MTV show, just as hard to follow due to very little explaining and scarce dialogue. It is basically a world description, even if it has a central character and a plot line.
The same artist created two other manga series in the same universe: Biomega and Net Sphere Engineer. You can download most of the Nihei Tsutomu works at the Controlling Authority site.

and has 0 comments
This has to be the coolest site ever! It is specially created for the cut hair of Britney Spears. You can now buy it for a measley 1,000,000.00$ (that's a million). I hope some charitable person buys the hair, divides it into one million tiny pieces and donates each one to a voodoo priest.

and has 0 comments
Update: their official site is not valid anymore and there hasn't been activity on their myspace page hasn't been changed from mid 2006.

A while ago I got this song from a friend of mine, it was called gruv.mp3. No id tag, nothing about the origin of the song. I thought it was nice, but it bothered me that I didn't know who the hell sang it and, of course, where I should get more. Finally, after searching for the lyrics on Google every one month or so, I finally found out who the band was.

They are called duteVino and they are from Romania, mind you. They are singing in English, though, and there is almost no accent whatsoever. The genre of their songs is something like Alternative/Funk/Jazz. Visit their myspace site to get a feel for their music.

and has 2 comments
How about some pop-rock music for a change? Of course I am depressed all the time if I only listen to sad music. Here is a nice, pop, rock, sexy, jiggly song from a Finnish band called LAB (their official site at labplanet.net is down, the band is disbanded): Beat the Boys



If you liked this, you might want to check two other LAB videos: Machine Girl and When Heaven Gets Dirty
Update:
I've gotten all their songs and they rock! This band is like a better Garbage! Original and strong. I just love their songs.

Update:
It's so difficult to find the band members without knowing more than Ana's first name and Pekka "Splendid" Laine having quite a common name. It doesn't help that they are Finnish, either. The story, as far as I can ascertain is that the members split up and went their separate way. Ana and Splendid worked on an album together that was supposedly finished in 2009, but was never released. Their new band is not called LAB anymore, but "Rain Hill", another commonly found name on the Internet, although not as bad as Lab, I guess. Their band page shows activity in early 2013 and even two songs that I cannot find anywhere for free, but their previews are pretty cool. It smells like another failed project. That is so bad.

Anyway, the links to the new band's Facebook page is this and the link to their official (and horrible) web site is this, where you can also listen to two 30 second previews.

Update: If you've experienced random PageRequestManagerParserErrorException errors that seem to vanish at a simple page refresh, read this post instead: An intermittent PageRequestManagerParserErrorException

I've built a TranslationFilter object that tries to.. well... translate ASP.Net pages. Everything ran smoothly until I had to use ASP.Net Ajax. I got the infamous error "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.".

Starting analysing the problem, I soon understood that the Ajax requests go through the same Response mechanism as a normal page request, but the output is different. In case of normal page requests you get the HTML of the page, while in Ajax requests you get something formated like this:
contentLength|controlType|controlID|content|


If one uses Response.Write, the text is inserted both in the page HTML and the Ajax request format, resulting in something like "blablabla10|updatePanel|UpdatePanel1|0123456789" which cannot be parsed correctly and results in an error. The ScriptManager.IsInAsyncPostBack property shows us if the request is Ajax or not, so we can condition the Response.Write on this.

Also, if changing the content with a HttpResponse.Filter, the length of the content is no longer equal with the declared value. So what must be done is first detect if the content is Ajax. Unfortunately we cannot check the state of the ScriptManager from inside the HttpResponse.Filter, but we can check the format of the string to modify, then modify the content AND the contentLength, else it will all result in error.

Update: the content might not be changed by you! As one of the people asking me for help on the chat discovered, the web server provider might want to put in some ads, regardless if the request is an Ajax one, thus breaking the format. You need to patch the javascript ajax engine in order to work, that means changing the content the javascript function will get in order to not cause errors. You may find the solution here.

As an example, here is my Translate method:
        private string RecursiveTranslateAjax(string content)
        {
            Regex reg = new Regex(@"^(\d+)\|[^\|]*\|[^\|]*\|",
                         RegexOptions.Singleline);
            Match m = reg.Match(content);
            if (m.Success)
            {
                int length = To.Int(m.Groups[1]);
                reg = new Regex(
                         @"^(\d+)(\|[^\|]*\|[^\|]*\|)(.{" + length + @"})\|"
                         , RegexOptions.Singleline);
                m = reg.Match(content);
                if (m.Success)
                {
                    string trans = Translate(m.Groups[3].Value);
                    return trans.Length + m.Groups[2].Value 
                       + trans + "|"
                       + RecursiveTranslateAjax(content.Substring(m.Length));
                }
            }
            return Translate(content);
        }


Update:
I met this problem also when in the page there were Unicode characters. Everything works perfectly, then you can't postback anything, because some user text contains Unicode chars. The solution I used for this was to get the offending text (whether in Page.Render or in some other places based on specific situations) and take every character and check if it is ASCII. Web Pages should be UTF8 so any character bigger than 127 should be translated into a web page Unicode char &#[char code];

The code:

string s=[my string]
StringBuilder sb=new StringBuilder();
for (int c=0; c<s.Length; c++)
{
if (s[c]>127) sb.Append("&#"+((int)s[c])+";");
else sb.Append(s[c]);
}
s=sb.ToString();


Here is the full code
    private string RecursiveTranslateAjax(string content)
    {
        // look for the basic Ajax response syntax
        Regex reg = new Regex(@"^(\d+)\|[^\|]*\|[^\|]*\|", 
              RegexOptions.Singleline);
        Match m = reg.Match(content);
        // if found, search deeper, by taking 
        // into account the length of the html text
        if (m.Success)
        {
            // custom method to get an integer value
            int length = To.Int(m.Groups[1]); 
            reg = new Regex(@"^(\d+)(\|[^\|]*\|[^\|]*\|)(.{" + length + @"})\|",
                  RegexOptions.Singleline);
            m = reg.Match(content);
            if (m.Success)
            {
                string trans = Translate(m.Groups[3].Value);
                return
                    trans.Length + m.Groups[2].Value + 
                    trans + "|" + 
                    RecursiveTranslateAjax(content.Substring(m.Length));
            }
        }
        // if not Ajax, just translate everything,
        // it must be a normal PostBack or a string of some sort.
        return Translate(content);
    }
 
    // this method only fixes the weird characters
    // but you can put here any string change you would like
    // like search and replace some words.
    private string Translate(string content)
    {
        // Html code all chars that are not ASCII, thus getting rid of strange or Unicode characters
        StringBuilder sb = new StringBuilder();
        for (int c = 0; c < content.Length; c++)
        {
            if (content[c] > 127) sb.Append("&#" + ((int) content[c]) + ";");
            else sb.Append(content[c]);
        }
        return sb.ToString();
    }
 
    protected override void Render(HtmlTextWriter writer)
    {
        //base.Render(writer);
        // render to my own text writer
        HtmlTextWriter tw=new HtmlTextWriter(new StringWriter());
        base.Render(tw);
        // get the Rendered content of the page
        string content = tw.InnerWriter.ToString();
        content = RecursiveTranslateAjax(content);
        writer.Write(content);
    }


To.Int method
public static int Int(object o)
{
    if (o == null) return 0;
    if (IsNumericVariable(o)) return (int) CastDouble(o);
    string s = o.ToString();
    if (s == "") return 0;
    Match m = Regex.Match(s, "(-\\d+|\\d+)");
    if (m.Success)
        try
        {
            return Int32.Parse(m.Groups[0].Value);
        }
        catch
        {
        }
    return 0;
}
private static double CastDouble(object o)
{
    if (o is byte) return (byte) o;
    if (o is int) return (int) o;
    if (o is long) return (long) o;
    if (o is float) return (float) o;
    if (o is double) return (double) o;
    if (o is decimal) return (double) (decimal) o;
    throw new ArgumentException("Type is not convertable to double: " + o.GetType().FullName);
}

Ok, a few days ago I wrote this post that basically said Inuyasha was a great anime and that the manga goes on further and the story is still going. Here I am telling the same thing about Berserk. The story is a cross between Flesh+Blood and Hellraiser. The anime ends suddenly at chapter 11, but the manga has reached chapter 32 and goes on. You can find the manga online here and here and here.

If you can read Japanese, here is the official site for Berserk.

and has 1 comment
Anyone who knows me knows what my stance is on this. School is something, religion is something else. There are a bunch of (traditional) ways to teach religiousness to a child, in the home as well as in church, special camps :), etc. I see no need for a religious education forcefully imposed on children inside the school, especially in a country that is not that religious. Where is the separation between state an church here?!

Yes, I know that the statistics say 85% of the population of Romania is orthodox, but that's only in name. True, active, church going religious people belong to distinct demographics like old people, some women, or people in the country side. This new surge of religion in Romania is nothing but a scam! Yes, nothing more than a marketing move.

And yet, here it is, a law that (again) makes religion one of the compulsory classes in Romanian schools. If you don't want religion, the parent must write a letter to the school requesting for it to be replaced with "moral-religious education", whatever that is.

So, what if I don't want any religion for my kid? I consider religion, especially organised religion, nothing more than a ploy to prey on human stupidity and fear. I want to raise my child away from superstitious crap. Let him watch Jesus on TV, the same as Ghost Busters!

Let me analyze what I should do in order to insure that my hypothetical offspring is not getting in school an education that contradicts that at home. First step: write the letter that places him in a special class of "moral-religious education". What that essentially does is place the child in a different group, a ready prey for ridicule or any kind of discrimination. Then he sees that in his group there are only the people that consider religion ridiculous, while in the other (larger group) there are the religious kids along with the ones that don't care about it one way or the other. So he will immediately feel the pressure of being in an apparent minority. This is a clear case of discrimination any way you put it, yet they intend to make this a law. What kind of crappy legislators do we have?! AND, after all this, I only managed to get my kid into a less religious class, probably with a priest or highly religious man as a teacher.

What would these religious people think if we were to add a compulsory "God does not exist and religion is stupid" class? They would shout much and high about discrimination and the right to choose and the local decision of allowing religious symbols or education in schools. Yet they have no problem with refusing the right to choose of atheists. Religious hypocrites? what a shock!

Here is a link to a discussion from 2004 about the legality and ethics of compulsory religious classes and their content.

Update 11 Oct 2009: A new anime started, continuing the InuYasha story, although some people seem to not agree with the interpretation of the manga. It is called Inuyasha Kanketsu-hen (or Inuyasha Final Act) and it starts where the first anime ended. Having just seen the first episode, I must say that I can barely understand what is going on anymore. There are so many characters and I don't really remember how they cam to be as they are now. So my recommendation is to read the chapters of the manga from about chapter 360. Here is another link where you can read InuYasha chapters online: Inuyasha on OneManga.

A while ago I've seen the Inuyasha anime series and fell in love with it. But at that time I didn't have a blog and I also thought that most Japanese anime is that good. As written in my review back then, I was soon crying for more episodes when it ended. I got a bit upset, too, because the series didn't end anywhere. It just stopped!
But, even if it is something obvious, I never thought about searching for the Inuyasha manga! Yes, the anime is based on a manga series that is, as I write this blog, ongoing and (almost) close to its finish. And you can read it! Free! online! :)

Ok, here is the link: Read on!

Internet Explorer has a lot of "features" that are completely useless. One of them is the infamous "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.". So what?! Just return a false value! Why do you have to throw an error?
Anyway, I've stumbled upon a bug accidentally while reviewing a html control on DynamicDrive. This is the basic setup:
<style>
.div {
display:none;
}
</style>
<script>
function loadGoogle() {
document.getElementById('div').style.display='';
document.getElementById('iframe').src='http://www.google.com';
return false;
}
</script>
<div class=div id=div style="">
<iframe id=iframe src="" ></iframe>
</div>
<a href="#" onclick="loadGoogle()">Click me!</a>


And it returns an error. Why? Because the javascript on Google tries to focus something:
document.f.q.focus();
But the display is cleared before changing the src. For all purposes, the div has the display set to an empty string (and you can check it with an alert right after it is set). The funny thing is, and that might come as a surprise, that if you move the display:none to the style attribute of the div, the script above doesn't return any error!

So, bottom line: attribute set in style tag or css cannot be changed dynamically without an error, while a control attribute can. What's up with that?! (Bug found on IE7.0). If you encounter this weird error, try moving the display attribute (I couldn't replicate the bug with the visibility attribute) in the control style attribute.

and has 0 comments
Heh, I knew this link for a while now, but I accidentally stumbled upon it. It is a male (and lesbian? :) ) only, female breasts oriented site . I've warned you!

Have fun!

The basic animation is taken from the jumping breasts JJ1 site - it seems the site is down.

Also, here are some happy breasts from some other site: Cheer up page

First of all, to turn a normal ASP.NET application to Ajax takes only a few minutes with the Microsoft Ajax.Net platform. It's as easy as moving some of the content in UpdatePanels and adding a ScriptManager. Of course, you need the Ajax.Net package installed.

What I am going to talk about is a simple way to enable/disable Ajax, and keeping the entire basic functionality intact. Why would I do that? Because sometimes you need to see the project working on a computer that doesn't have the Ajax framework installed. You might even want to work on the project itself. So this is what you do:

First of all, the ScriptManager control must appear on every Ajax page in the project, so why not move it to the MasterPage? Yes. Only one ScriptManager in the MasterPage suffices. Second of all, the UpdatePanel and the UpdateProgress controls are nothing more than normal Panels with the cool Ajax functionality added to them. So enabling or disabling Ajax surmounts to nothing more than replacing these controls with normal panels.

So here is the quick method of enabling, disabling Ajax.Net whenever you want:
Start off from the Ajax enabled application and save the web.config as web.config.ajax. Remove everything from it that resembles System.Web.Extensions and all other weird things that Ajax.Net adds to the web.config except this:
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>

this you only replace with this:
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="MockAspNetAjax"/>
</controls>

Save it to Web.config.noajax

You might see where I am going already. Now create a new Visual Studio project, a class library, one that you will use for all these conversions, and call it MockAspNetAjax. Go to the project Properties and change the default namespace to System.Web.UI. Add three classes that do nothing but inherit from Panel: ScriptManager, UpdatePanel, UpdateProgress. The UpdateProgress will have some additional code:
 public UpdateProgress()
{
Init += new EventHandler(UpdateProgress_Init);
}

void UpdateProgress_Init(object sender, EventArgs e)
{
Visible = false;
}

because you don't want to see the Ajax Update Progress message continuously on your page.

In order to convert an ASP.NET Ajax application to a normal postback application you follow two simple steps:
1. overwrite the web.config with web.config.noajax
2. add MockAspNetAjax as a reference or include in the project if previously excluded.

back to Ajax:

1. overwrite the web.config with web.config.ajax
2. remove MockAspNetAjax as a reference or exclude the dll from the project, while keeping the dll there.

That's it!

Of course, Ajax has a lot more stuff to it, like for example the [ScriptService] web services that are directly accessed from Javascript. Or Ajax enabled controls or other controls which don't even work without the framework. These are more complex situations which cannot be solved with such a general solution, but the same basic principles apply: use web config to avoid Register tags in each page, replace controls with mockup controls, remove HttpHandlers and HttpModules, replace javascript code that uses Ajax with something that does nothing or emulates the same behaviour (preferably) through postbacks or hidden iframes, etc.

In ASP.NET a Control has a fully qualified id that can be deduced from the control hierarchy and can be accessed with the properties ClientID or UniqueID. It then becomes the unique id or name of rendered html controls. It makes sense that these properties should be used right after the control hierarchy is completely defined, that means before the rendering, therefore in the PreRender.

What is not so well known is that accessing those two properties sets the _cachedUniqueID member, which sets irrevocably the ID to a control. That's why using these properties in ItemCreated events, for example, makes the html id of controls to remain the default defined one.

Example: In a DataList, you have an item template that contains a control, let's call it Control1. The rendered id in html will look like this: ctl00_ContentPlaceHolder1_UcUserControl_DataList1_ctl00_Control1 , but if you use ClientID inside the DataList_ItemCreated event, the rendered html id will be just Control1, thus making any javascript manipulation futile.

Of course, one could create a method to return the UniqueID without setting the cached value, since there are moments when the partial hierarchy is enough to define a proper id. Unfortunately, for controls without a specific and declared id, ASP.NET creates and automatic ID like ctl[number] or _ctl[number] and, of course, those methods and fields are all private or internal. One could use Reflection to get to them, but what would be the point?
UniqueID and ClientID are overridable, though, so one can change their behaviour in user defined controls.

Related links:
Accessing ClientID or UniqueID too early can cause issues

Long story short, here's the link:
Inserting at the cursor using JavaScript

and has 0 comments
Today Orange Romania had organised a concert in their brand new "Concept Store". A Concept Store is exactly what it says it is, a place where they sell you an idea, the idea of buying and using Orange phones and subscriptions. Therefore everything that takes place in that store is directly linked to image and marketing.
Well. today they blew it, royal style. 15 minutes before the start of the concert (Coma was going to perform, they are this extremely cool Deftones meets Linkin Park via Tool band) they announced that the concert was not going to take place due to complaints from the neighbours. What actually happened is that some greedy idiots thought they could get some money from Orange because they lived right above the Orange Concept Store. Well it didn't work, but the funny thing is they announced the cancellation of the concert after keeping tens of fans out in the cold while watching them through the glass doors of the place. And these were only the ones that got there earlier. I got there about 30 minutes before the announced hour for the concert so I was amazed to see a couple of suits staring at us from the other side of the glass and doing absolutely nothing about it. Then the cancellation news came.
The band members were devastated, the fans disappointed, Orange made complete fools of themselves. But will this ever reach the news? NO! There is no rape or murder involved, no political scandal. Just a few ordinary teens were completely stepped upon in the name of Orange Corporation Choppers!