and has 0 comments

A while ago I was recommending the anime called Inuyasha and then reading on the manga. Well, after 558 episodes - each having around 19 manga (comics) slides - Inuyasha has reached the end. A bit anticlimactic, considering the things that attracted me to the story in the first place, but an end nevertheless.

You can read the entire story here at MangaStream

I wanted to write this great post about how to make Web User Controls that would have templates, just like Repeaters or GridViews or whatever, face any problems, then solve them. Unfortunately, MSDN already has a post like this: How to: Create Templated ASP.NET User Controls. So all I can do is tell you where to use this and what problems you might encounter.

I think the usage is pretty clear and useful: whenever you have as?x code that repeats itself, but has different content, you can use a templated Web User Control. The best example I can think of is a collapsable panel. You have a Panel, with some javascript attached to it, a hidden field to hold the collapse state, some buttons and images and texts to act as a header, but every time the content is different.

Now with the issues one might encounter. In Visual Studio 2005 you get an error, while in VS 2008 you get a warning telling you the inner template, whatever name you gave it, is not supported. This is addressed by the
[ PersistenceMode(PersistenceMode.InnerProperty) ]
decoration of the ITemplate property of the control.
Then there is the issue of the design mode, where you get an ugly error in all Visual Studio versions: Type 'System.Web.UI.UserControl' does not have a public property called '[yourTemplatePropertyName]'. As far as I know there is no way of getting rid of this. It is an issue within Visual Studio. However, the thing compiles and the source as?x code is warning free. I think one could easily sacrifice some design time comfort to reusability.

and has 0 comments
I am not usually one to talk politics, especially since I don't really think there are essential differences between people participating in this game. Yes, I do see it as a game, with rules that you need to follow to get the prize. But this year's mayor election proved that some of the rules are more subtle than just spending the biggest amount of money in promotional ads and having the biggest party support you. Well, pretending to be "one of the people" seems to always help, though. :)

What happened? Internal struggles within the main opposition party led to them choosing their candidate for the city hall not the man with the most popular votes (as resulting from opinion poles), but the man with the most connections in the party. Therefore the other guy decided to candidate independently. He spent almost nothing on campaign ads, while the leading party candidate spent about 600000 euros just for the first part of the elections and God knows how much for the final part.

Conclusion? Sorin Oprescu, the independent candidate, has won the elections. The leading party candidate lost, with all his ad money, while no one even noticed the candidate from the oposition party. Apparently, a great victory for the people in Bucharest. I have no idea if the guy will be any good as a mayor, and I think that is the major flaw in Romanian elections, but the arrogant belief that party support and lots of money can just land you in a popular position has failed once more in Bucharest today.

But my theory is that Oprescu didn't win just by charisma or by the total lack of charisma of his opponent, Blaga, but from the ugly and cheap attacks against him and other candidates from the main party. With slogans like "Let's get rid of the garbage in sector 5, dump Vanghelie" and images of a bulldog and a snake with glasses (Blaga looks like a big ugly dog, while Oprescu wears glasses) they pushed people away. I guess that the fact that the snake is a symbol of wisdom in many cultures past them by completely.

Anyway, my conclusion is that arrogance is the worst thing a Romanian politician can do right now. They can be stupid, corrupt, pathetic, but NOT arrogant. It is traditional in Romania to dream to become powerful, rich, above all others, and it is even more traditional, since most people never do get rich or famous, to totally despise and hate the people that do or behave like they do. Today was a lesson in humility for the political class.

Update: this fix is now on Github: Github. Get the latest version from there.

The scenario is pretty straightforward: a ListBox or DropDownList or any control that renders as a Select html element with a few thousand entries or more causes an asynchronous UpdatePanel update to become incredibly slow on Internet Explorer and reasonably slow on FireFox, keeping the CPU to 100% during this time. Why is that?

Delving into the UpdatePanel inner workings one can see that the actual update is done through an _updatePanel Javascript function. It contains three major parts: it runs all dispose scripts for the update panel, then it executes _destroyTree(element) and then sets element.innerHTML to whatever content it contains. Amazingly enough, the slow part comes from the _destroyTree function. It recursively takes all html elements in an UpdatePanel div and tries to dispose them, their associated controls and their associated behaviours. I don't know why it takes so long with select elements, all I can tell you is that childNodes contains all the options of a select and thus the script tries to dispose every one of them, but it is mostly an IE DOM issue.

What is the solution? Enter the ScriptManager.RegisterDispose method. It registers dispose Javascript scripts for any control during UpdatePanel refresh or delete. Remember the first part of _updatePanel? So if you add a script that clears all the useless options of the select on dispose, you get instantaneous update!

First attempt: I used select.options.length=0;. I realized that on Internet Explorer it took just as much to clear the options as it took to dispose them in the _destroyTree function. The only way I could make it work instantly is with select.parentNode.removeChild(select). Of course, that means that the actual selection would be lost, so something more complicated was needed if I wanted to preserve the selection in the ListBox.

Second attempt: I would dynamically create another select, with the same id and name as the target select element, but then I would populate it only with the selected options from the target, then use replaceChild to make the switch. This worked fine, but I wanted something a little better, because I would have the same issue trying to dynamically create a select with a few thousand items.

Third attempt: I would dynamically create a hidden input with the same id and name as the target select, then I would set its value to the comma separated list of the values of the selected options in the target select element. That should have solved all problems, but somehow it didn't. When selecting 10000 items and updating the UpdatePanel, it took about 5 seconds to replace the select with the hidden field, but then it took minutes again to recreate the updatePanel!

Here is the piece of code that fixes most of the issues so far:

/// <summary>
/// Use it in Page_Load.
/// lbTest is a ListBox with 10000 items
/// updMain is the UpdatePanel in which it resides
/// </summary>
private void RegisterScript()
{
string script =
string.Format(@"
var select=document.getElementById('{0}');
if (select) {{
// first attempt
//select.parentNode.removeChild(select);


// second attempt
// var stub=document.createElement('select');
// stub.id=select.id;
// for (var i=0; i<select.options.length; i++)
// if (select.options[i].selected) {{
// var op=new Option(select.options[i].text,select.options[i].value);
// op.selected=true;
// stub.options[stub.options.length]=op;
// }}
// select.parentNode.replaceChild(stub,select);


// third attempt
var stub=document.createElement('input');
stub.type='hidden';
stub.id=select.id;
stub.name=select.name;
stub._behaviors=select._behaviors;
var val=new Array();
for (var i=0; i<select.options.length; i++)
if (select.options[i].selected) {{
val[val.length]=select.options[i].value;
}}
stub.value=val.join(',');
select.parentNode.replaceChild(stub,select);

}};"
,
lbTest.ClientID);
ScriptManager sm = ScriptManager.GetCurrent(this);
if (sm != null) sm.RegisterDispose(lbTest, script);
}



What made the whole thing be still slow was the initialization of the page after the UpdatePanel updated. It goes all the way to the WebForms.js file embedded in the System.Web.dll (NOT System.Web.Extensions.dll), so part of the .NET framework. What it does it take all the elements of the html form (for selects it takes all selected options) and adds them to the list of postbacked controls within the WebForm_InitCallback javascript function.

The code looks like this:

if (tagName == "select") {
var selectCount = element.options.length;
for (var j = 0; j < selectCount; j++) {
var selectChild = element.options[j];
if (selectChild.selected == true) {
WebForm_InitCallbackAddField(element.name, element.value);
}
}
}
function WebForm_InitCallbackAddField(name, value) {
var nameValue = new Object();
nameValue.name = name;
nameValue.value = value;
__theFormPostCollection[__theFormPostCollection.length] = nameValue;
__theFormPostData += name + "=" + WebForm_EncodeCallback(value) + "&";
}

That is funny enough, because __theFormPostCollection is only used to simulate a postback by adding a hidden input for each of the collection's items to a xmlRequestFrame (just like my code above) in the function WebForm_DoCallback which in turn is called only in the GetCallbackEventReference(string target, string argument, string clientCallback, string context, string clientErrorCallback, bool useAsync) method of the ClientScriptManager which in turn is only used in rarely used scenarios with the own mechanism of javascript callbacks of GridViews, DetailViews and TreeViews. And that is it!! The incredible delay in this javascript code comes from a useless piece of code! The whole WebForm_InitCallback function is useless most of the time! So I added this little bit of code to the RegisterScript method and it all went marvelously fast: 10 seconds for 10000 selected items.

string script = @"WebForm_InitCallback=function() {};";
ScriptManager.RegisterStartupScript(this, GetType(), "removeWebForm_InitCallback", script, true);



And that is it! Problem solved.

This is mostly a noob post, but I had to write it because I've had to work with a project written by a colleague of mine and her method of maintaining value across postbacks was to use HiddenFields. I will explore that option and the ViewState option.

First of all, what are the advantages of using a hidden field? I can see only two:
1. it would work even if ViewState is disabled
2. its value is accesible through javascript
The disadvantages are:
1. it creates additional HTML markup
2. it can only store stuff in string format
3. its value is accesible through javascript

I would not use the hidden field option mainly because it gives people the ability to see and change the value through simple javascript manipulation. It's a security risk, even if most of the times you don't really care about the security of some value maintained through postback. I would use it only when _I_ need to change that value through javascript.

For some code, I assume I want to store an integer value called MyValue. There will be a field called _myValue that will store the value during a cycle, but it is used mainly for caching (reading Request and ViewState is slow) and it is declared like this:

private int? _myValue;


Now, about the structure of such a code. The simplest method is to actually create a (or many) hidden field(s) in your page. You can then use the values directly. It is simple, but hardly maintainable:

Markup:

<asp:HiddenField id=hfMyValue runat=server>

C# code:

public int MyValue
{
get
{
if (_myValue == null)
{
if (String.IsNullOrEmpty(hfMyValue.Value)) MyValue = 10;
else _myValue = Int32.Parse(hfMyValue.Value);
}
return _myValue.Value;
}
set
{
hfMyValue.Value = value.ToString();
_myValue = value;
}
}


I've wrapped the functionality of the hidden field in a property so I can easily use it through my code.

Another method of doing this is to use the RegisterHiddenField method of the ScriptManager like this:

C# code only:

public int MyValue
{
get
{
if (_myValue==null)
{
if (Request["MyValue"] == null) MyValue = 10;
else _myValue = Int32.Parse(Request["MyValue"]);
}
return _myValue.Value;
}
set
{
PreRender -= MyValue_Registration;
PreRender += MyValue_Registration;
_myValue = value;
}
}

void MyValue_Registration(object sender, EventArgs e)
{
if (_myValue.HasValue)
ScriptManager.RegisterHiddenField(this, "MyValue", _myValue.Value.ToString());
}


As you can see, there is no need of my changing the markup. There is the ugly part of having to attach to the prerender event to register the hidden field because the ScriptManager doesn't have any way of accessing the registered hidden field after you did it or at least a way to un-register it. Registering it again doesn't change its value, either.

In both these cases the value is accessible through javascript:

<script>var myValue=parseInt(document.getElementById('<%=hfMyValue.ClientID%>').value);</script>
<script>var myValue=parseInt(document.getElementById('MyValue').value);</script>


But there is an easier way of storing the values through postback, and that is by using ViewState. In order to do that, your object needs only to be Serializable. It can be anything from a string to a complex DataSet. There is no way to access it through javascript, though. Here is the C# code for it:

public int MyValue
{
get
{
if (_myValue == null)
{
if (ViewState["MyValue"] == null) MyValue = 10;
else _myValue = (int)ViewState["MyValue"];
}
return _myValue.Value;
}
set
{
ViewState["MyValue"] = value;
_myValue = value;
}
}


Doesn't that look a lot simpler? And the beauty of it is, the ViewState can be sent inside the markup, as in the default behaviour, but it can just as easily be stored on the server, either by using a SessionStatePersister or by other ways.

Update: Also, a more complicated, but a lot more flexibile way of doing things is described on the DimeBrain blog: Frictionless data persistence in ASP.NET WebForms.

and has 0 comments
Exultant, the second book in the Destiny's Children series felt a lot better than Coalescent. Not without its own flaws, it made the entire experience better, but maybe that's just me.

The book describes a universe twenty thousand years into the future, when human kind has infested the galaxy, destroying all sentient races they encountered with their immense war machine. They are currently at war with a technologically superior enemy called the Xeelee, which are trapped at the core of the galaxy, pushed back by the sheer size of human forces. The war has waged for 3000 years and continues with no advancement of any kind, with the entire human philosophy focused on spewing more and more cannon fodder for a war that is neither to be won or lost, just endured.

A rather bleak vision of the future, but fear not, there comes hope! Somehow, an excentric aristocrat comes with all the ideas and resources to create the ultimate weapon that will destroy the Xeelee! And in the pages of the book it is described how they go at it. This is where the book actually fails, because at a such immense space and time scale, a solution of this simplicity is just not believable. You don't feel it in your GUT! But the book is well written, the style bringing memories of Asimov, and the ideas in it pretty interesting.

Stephen Baxter is again applying Universal Darwinism to his universe, bringing more and more species and types of lifeforms out of his magician hat. The ending of the book is terribly naive, but without a bit of naivite, you cannot finish great space sagas in a single book.

Bottom line: if you like space fights, military stratagems, character development, time travel, large scale galactic intrigues and a lot of techno babble (and I know I do! :) ) you will love this book. I do think that some of the great ideas in the book would have mixed nicely with late David Feintuch's writing. Anyway, on with the next book in the series: Transcendent

and has 0 comments
A year ago I wrote about being a bicycle rider in Bucharest. I complained then that there are no bike lanes and no one gives a damn about bicycle riders or the very law that should protect them. Things have changed, apparently, and now beautiful bike lanes are criss-crossing Bucharest's sidewalks. But it is all for show and appearance.

First of all, they serve no purpose on the sidewalk. Given the peculiar psychology of the majority of the population when they have to choose between walking on a nicely marked yellow/green stripe and the normal gray sidewalk, they will walk where the nice colors are. Even if they would somehow decide to think a little and ponder on the significance of the big bike signs painted on those lanes, there are children that have no idea what they are doing and could always jump in front of you. Normally, the population of the bike lanes in bucharest is comprised of mothers with babies, lovers holding hands, old ladies and people that just wouldn't give a damn. Very often I see young stylishly dressed women walking right towards my bike, ignoring me completely, expecting me to move aside. Do they even consider the damage that I would do if I'd just decided on a whim NOT to move aside? Not to mention places where there is space only for the bike lane and it would be stupid to expect people not to walk on it. And of course, the cars that park right on the lanes and about nobody does anything.

Second of all, the lanes were built close to autumn last year, a season not favourable to biking. Then, of course, winter came, and the plastic like stripes that mark the lanes were pretty much destroyed. So they had to put them again. However, during the spring they started working on fixing the streets. That meant scraping the asphalt (bike lanes on the street included) and puting it back on. But they did draw the lanes back on. Then they started changing the street border stones, usually placing them idiotically high right on the bike lane. And if it wasn't enough, they started placing all above ground wires under ground. That meant digging narrow, yet deep trenches in the sidewalk, interrupting the lanes from side to side, so that there is no way to go around, and they never filled them up! Basically every one in two bike lanes is now broken by this. And, as this was not enough, more often than not the lane is of worse quality than the rest of the sidewalk.

Therefore I will ignore these lanes completely, except the days when I am really tired and don't trust myself around cars, and risk my life and the paint on the cars around me rather than the lives of the people on the sidewalk. What a sham this all is. The Bucharest European mask is there only for outsiders, NOT for the people living in it.

and has 0 comments
In 1973, Frank Herbert wrote a book called Hellstrom's Hive in which it described a sect of people that lived underground, in a system much alike insects, with individuals specialised for different tasks and all living for the big hive organism. The book did not explain how it all got there, it just quickly described the situation and then delved into the action.

Jump to Stephen Baxter's Coalescent, the first book of the Destiny's Children series, which pretty much details how a group of humans would reach a plausible hive like society. Unfortunately, the book is more descriptive than anything else, failing to deliver in the action part. A lot of characters are developed and a lot of history (both personal and general) is detailed, but in the end the characters vanish as if they never mattered. It is, after all, the whole point of the novel, that ignorant individuals following certain rules lead to the emergence of patterns, but it did not fit well within a book.

Not that the book itself is not fascinating and well written, because it is, but the pace is very slow at the beginning, accelerating to a snail pace in the end, while the different parts of the book seem fractured, too little related to one another. I intend to read the rest of the books in the series, but I might just give up, too.

Bottom line, I think it would be a nice read to start with Coalescent and then read Hellstrom's Hive, although I do think the second book to be much better.

and has 2 comments
No, it's not one of the The World Sucks rants, it's actually very serious. I was terribly annoyed that after installing Windows XP SP3 my Internet Explorer 7 browser would (sometimes) freeze when closing tabs. I could replicate the bug easily enough by folowwing these steps:
  1. Open Internet Explorer
  2. Go to https://siderite.dev
  3. Scrollwheel click on Sign in, thus opening it in another tab
  4. Wait until the title of the second tab changes to Redirecting (because I have the cookie from a previous login)
  5. Press F5 (Refresh) in the first tab
  6. Click on the second tab and close it while the first tab is refreshing


At this time Internet Explorer would freeze with no error message. Waiting for a few seconds I could access the context menu on the taskbar button and choose Close or click on the X Close button, but everything inside the Internet Explorer window would be inactive. If I would switch tasks back and forth, the IE window would appear completely blank inside.

Now, whenever you look for the solution for this you get three answers:
  • Check the Warn me when closing multiple tabs option in the Internet Explorer tabs settings.
  • Run IExplore.exe with the -extoff command line parameter which will disable all add-ons and this will tell you if the addons are causing this
  • Check for spyware/malware


I did all this and nothing changed! I've reinstalled all addons. I've reinstalled IE7. I've switched to IE8 beta! Nothing worked. Then I proceeded in uninstalling all addons, see what happends. Finally, it wouldn't cause any issues. It was just after I've uninstalled Google Toolbar! I suspect the cause for the bug is coming from the popup blocker which interprets tabs as popups and tries to close them. Then there is the setting in GT that is trying to preserve any software from modifying its settings. Maybe that is why -extoff doesn't affect it!

Just to be sure I installed it again and tested the bug and I could replicate it. Something in Windows XP Service Pack 3 messes Google Toolbar up!

Bottom line: uninstall Google Toolbar until I can find out which part of it actually causes the bug.

As I was writing in the previous post, because of that law suit they are in, Google is starting to take measures to protect the copyright of videos on YouTube. The result is that all the blogs and sites that embedded video content that is supposed to be copyrighted now have beautiful flash players with a play button in them, but then the nasty surprise of seeing "video not available" when pressing play. At least display the damn message from the beginning instead of forcing me to play every video on my blog to see if there are still available!

But I did that anyway, for music videos for now, and switched to (currently) unaffected French video content site DailyMotion. Of course, lots of YouTube clones are on the net and even YouTube leecher sites. I mean sites showing a wonderful error when trying to play videos that now are removed from YouTube.

So, please folks, if you find some post with missing videos or pictures or anything wrong, really, please comment on it and I will fix it. Thank you and damn all lawyers to hell!

I really like Korn, they are heavy, melodic and the lead singer is pretty unique. I haven't posted anything by them yet because I was a teenager when I was listening to them. I remembered loving the video for Falling Away from Me and wanted to share it with my bloggies :).

This annoying error appeared out of nowhere in a project that used to work. I thought that the fault was of the new AjaxControlToolKit and the way it tries to register a CSS file. I was about to make really complex and , apparently, useless changes to my code until I've stumbled upon Rick Strahl's blog. It is not in the entry, but further down in the comments, but it's there.

Here is a distilled version: the error is not a page error, but a naming container control error. That means that if you do this in a PlaceHolder, let's say, it will only throw an error if the PlaceHolder has code blocks. The same applies to the header! The problem was not AjaxControlToolKit, but my own modifications to the MasterPage, where I had added script blocks with a dynamic URL.

So I added the script tags from the codebehind using this:

private void AddHeaderScript(string src)
{
HtmlGenericControl hgc=new HtmlGenericControl("script");
hgc.Attributes.Add("type", "text/javascript");
hgc.Attributes.Add("language", "JavaScript");
hgc.Attributes.Add("src", src);
Page.Header.Controls.Add(hgc);

}
. I don't know how this would work during an Ajax postback, but I wasn't interested in this, being a MasterPage thing. And it worked.

So, next time you get this error, be sure you know what control generated it. It can be solved by putting an extra PlaceHolder or, as is this case, replacing just some specific few code blocks.

and has 3 comments
Update: the title of the post should have been "Text searching in general, not as I expected". I did a quick test in javascript. Do 1000 indexOf and then 1000 search(RegExp object) in a long text and measure time. Here are the results:
Internet Explorer 7: search 90% of indexOf time!
FireFox: search 355% of indexOf time!?!
Chrome: search and indexOf same speed.


Update February 2016: I've tried it again, with Firefox 44.0.2, Chrome 48.0.2564.109 m and Internet Explorer 11.0.9600.18163 and indexOf is marginally faster than regex for all of them. For the case insensitive search, Firefox and Chrome take 50% than indexOf, while Internet Explorer is not only the fastest, but also only adds 4% when searching case insensitive.

It makes sense to have the same implementation of indexOf and regular expressions as in .Net for the Microsoft browser, so I am not that surprised, but what happened with FireFox? My hypothesis is that they used Boyer-Moore in indexOf (as any decent programmer should have!) yet used a simpler implementation for their regular expression engine.

A few days ago I was preaching that IndexOf with StringComparison.Ordinal is the fastest thing for text searching. I was even implying that it uses the Boyer-Moore algorithm from a Windows system library written in c++. I was dead wrong!

Thanks to Meaflux who told me that the Internet said things differently, I delved even further into the code, past the .NET code and into the library code of mscorwks.dll where the IndexOfString method that ordinal IndexOf uses, written in c++, appears to be a pathetic linear algorithm!!

Even worse, the Boyer-Moore algorithm is used in the .NET framework in the Regex class! The Regex class is written entirely in managed code, even if it uses all sorts of cool hacks. I've also tried a Boyer-Moore implementation from Codeproject that also included the Apostolico-Giancarlo, BCL, Horspool and Turbo Boyer Moore algorithms. IndexOf was slower!

Anyway, the code is simple: take a one megabyte Harry Potter text book and search a 100 byte text from somewhere near the middle of the text. Use IndexOf with StringComparison.Ordinal, then Regex with both variants, compiled and ad-hoc creation, then the class from CodeProject.

    Results for 100 tries:
  • Ordinal IndexOf - 390 milliseconds
  • Normal IndexOf - 2380 milliseconds (6 times slower!!)
  • AdHoc Regex - 190 milliseconds (take into acount the creation of the regex 100 times plus the use of Regex.Escape 100 times on the search pattern)
  • Compiled Regex - 160 milliseconds
  • Codeproject Boyer-Moore - 230 milliseconds


Would you have believed this?

Maybe the algorithm was better because the search string was 100 bytes, so I made it 12 bytes and redid the test:

    Results for 100 tries:
  • IndexOf - 440 milliseconds(more than with 100 bytes!)
  • Normal IndexOf - 2410 milliseconds!!
  • AdHoc Regex - 235 milliseconds
  • Compiled Regex - 230 milliseconds
  • Codeproject Boyer-Moore - 368 milliseconds (a lot more, similar to IndexOf, yet still less)


Ok, maybe the problem was that the string in which I searched was big. Let's make it 5000 bytes!

    Results for 100000 (1000 times more operations):
  • Ordinal IndexOf - 1109 milliseconds
  • Normal IndexOf - 1109 milliseconds
  • AdHoc Regex - 2500 milliseconds
  • Compiled Regex - 375 milliseconds!!!
  • Codeproject Boyer-Moore - 1312 milliseconds (finally something slower than IndexOf)


So Regex appears to be best for string searching in most cases!

Update: after optimizing the Boyer-Moore class and adding my own goodness to it, I made more tests. The Boyer-Moore algorithm can be improved by adding more preprocessing, therefore it is more and more efficient as the pattern size increases and the number of pattern searches decreases. In those cases (pattern length of a few thousand characters) Regex is not so good, especially if one has to Escape the entire sequence and instantiate the class on each search. Anything over 500 characters in search pattern length made Regex perform less than the most preprocessing BM I've used.

Update 24 Aug 2013: SyFy rejected the Blake's 7 idea. That may be a good thing, though, as it apparently was taken by Microsoft, to be made as an XBox series.

Update: The previous attempts to revive Blake's 7 have failed, but a new venture to do so was announced on July 23 2012: Martin Campbell And Georgeville TV Shop Reboot Of Cult U.K. Sci-Fi Series ‘Blake’s 7′. I just hope they don't screw it up.

When I was a very young boy, during the Romanian communist era, the only entertainment available was the Bulgarian television (also a communist country, but with a more relaxed regime) who's signal would reach Bucharest to the delight of many. I have always remembered vaguely a British series called Blake's 7, a sci-fi show that I've enjoyed tremendously at the time. Recently I was reminded of it and I was lucky enough to find the torrent for all four seasons. Having watched it now, I have mixed feelings and a new understanding of my child mind.


A short description of the show first. Imagine a team of space wanderers a little in the style of Farscape's crew (civilians, each one with their own ideas and motivations), stuck in a universe that resembles the Star Wars universe (an oppressive Federation ruling the galaxy with an iron fist) and has similar effects and inspiration as Star Trek TOS. All this with a budget that was probably several levels of magnitude smaller than that of ST TOS and also with effects and script a whole lot cheesier (and by that I mean that if I work out the percentages, more than half of the show was just cheese). The actors themselves were British and Welsh TV theater actors and they behaved as such the whole series. Not that it wasn't a refreshing perspective, even now. It was actually original enough and if it weren't for the production values, it might have been a world class classic.

Of course, I didn't watch it now because of the cinematographic value, but because it meant so much to me when I was a child. And I was stunned to see that the things that I remembered fascinated me were quite different in the show. Some weren't even there. For example I remembered that the show was called Blake's 7 but that one of them died in the second episode, which I attributed to British humour. But no, that happened at the beginning of season two. The introduction and music I remembered to be dark, impressive and scary. They were really funny now. There were scenes I remembered in a completely different way, with more emotion and action and the things that happened in the show had another sense altogether.

The structure of the series is funny to follow. The crew of seven was always only of six people. The computer counted as the 7th man. In the second season Gant dies so they are temporarily left with only 6. In the third season Blake leaves the show as well as others of the crew, only to be replaced by other actors and another computer. So they are 5 people and 2 computers and no Blake in Blake's 7. The only constant things are the ship, which is destroyed at the end of the third season, Avon and Vila. Oh, and sexy Servalan, the evil female villain. With a ship that can go anywhere in the galaxy, they always stumble in the same people! The ending was hilarious also, but you have to click here to see what I mean, I would hate to spoil it for you:
Click here for ending spoiler


Here is a sample of the show:



And here is a video from an interview with the actors interpreting Blake and Servalan, old now and talking fondly of the series:



But there are also good news, Blake's 7 could be revived! I found an April 2008 link that says Sky One has commissioned two hour-long pilots for a new Blake's 7 series! Here is also a BBC News entry.

Update: Blake's 7 will be back! I doubt it will pack the same punch, unless done right. BBC should have remade it, but it seems that it will be a SyFy show, which may not be a good idea. The news confirming the comeback can be found here: Blake's 7: Classic BBC sci-fi to return on Syfy channel

Well, I don't know who still uses it, but I had this old application that we reused and it had a Login control in the login page (obviously!). And I got tired of always entering the name and password every time I tested the site, so I went to the username and password TextBoxes and added a Text="something" bit. And it didn't work.

Why? First of all the TextBox control with TextMode="Password" ignores the Text property completely. Then the Login control only acknowledges the values of the two TextBoxes on change.

The solution: add a value="something" instead of Text="something" and it will be added like an oldfashioned HTML attribute. And it will also fire Changed since the value the .Net control is string.Empty.

That's all, folks, remember to remove this in the production site :)