and has 0 comments
As I was saying in the last posts about the Revelation Space books by Alastair Reynolds, the guy has a problem with his own personality bleeding into the one of his characters. However, as the second book was better than the first, so the third one, Redemption Ark, seemed to be better than the second. It may be because now the main focus is on the Conjoiners, the fabled human faction that gave the star drives, facing the threat of the Inhibitors. Also, a very promising explanation of where they got the idea from in the first place.

We are seeing a lot of old characters from the previous books in this third installment, which bothered me a little because they weren't really needed, but it's not too annoying. Also, some of the awesome technological feats in the book are only partially explained and sometimes even completely ignored and left to a vague description, like "distant lights" when referring to a Hell weapons vs Inhibitors battle. But the focus, as always, was more on the human interaction than on the technical part, although there was blessingly more tech than in the first two books.

Since I've finished the book while away from home, I started reading another book, not the fourth in the series, so you will probably have to wait a while longer before I review that, but rest assured, I fully intend to read the entire saga.

The problem: you create an abstract class that inherits from something that can be designed in Visual Studio, like Form. Then you inherit another class from this abstract one. And when you get into the Visual Studio designer you see a nice colorful error message: The designer must create an instance of type 'bla bla bla' but it cannot because the type is declared as abstract.

The solution is detailed in a post of Brian Pepin: use the TypeDescriptionProviderAttribute decoration on the abstract class in order to tell .Net (thus to Visual Studio) what concrete type to declare and instantiate should the need arise.

Update: Brian's article is no longer available. I will update the link as soon as possible. Meanwhile, try this article from Microsoft.

Update: I have found the original article somewhere else and relinked it. Also, check out the fourth comment on this entry, where TrevDev links to a Microsoft Connect bug on the TypeDescriptorAttribute which suggests the attribute is not used correctly. That probably explains why people on VS2008 have problems, while the solution works on VS2005.

Now, all you have to do is read the post in question, with one reserve. The blog entry (and some other pages I have found on the net) say that this only works for Whidbey (VS2005), but I am using VS2008 and it worked just as well. However, for a second opinion try this CodeProject article that uses a little conditional compiling trick to switch from abstract classes with abstract methods and properties to normal classes with not implemented classes and methods based on debug/release modes. I kind of dislike the approach, mostly because it needs more effort to implement it, but it could help people that have this problem and maybe use some other IDE other than VS2005 or VS2008.

and has 2 comments
Avatar is one of those animation series that you read about and think they're crap. I mean, first of all they are not Japanese :), they are actually US. And then they are shown on Nickelodeon and then they are about and for kids. I must be honest when I tell you that I accidentally heard about the series and I had no great hopes for it. However, as it turned out, it is a great show, one to be watched and enjoyed.

The show is mostly inspired from Chinese mythology, with Western and Indian bits thrown in when required. The world is separated into four nations. The people of each nation can control in various degrees a specific element magic: air, water, earth or fire. Unlike say, Naruto, there are no people that can control or mix more than one magic type, except a special and unique person, the Avatar. The Avatar has the job of protecting the world and, if killed, reincarnates into another person. The last Avatar, though, dissapeared a century before the show starts and no one has heard of him or any of its reincarnations. Meanwhile, the evil Fire Lord has started a war to conquer the world and he is about to succeed.

Well, you can see where this is going, right? The Avatar comes back, he is a goofy kid, and in the end he saves the world together with his friends. However, the animation, the stories and the teachings in this show are all high value and, for once, something a kid can see, enjoy, understand and USE in the real world. Well, all except the magic part :)

What is also great about the series is that it is not a work in progress. It did not end because the ratings went down or the economic crisis hit or whatever and it has very few filler episodes. It was a long consistent script that span three seasons of 20 episodes each and then ended with no significant loose ends.

In other words, this is one of those rare American shows that can rival the best Japanese anime series. Even my wife enjoyed watching it (well, most of the time).

and has 0 comments
Chasm City is the second book from the Revelation Space series written by Alastair Reynolds. It is set in the same universe, give a few hundred years, and it felt to me as a better, more mature book than Revelation Space. However, truth be told, the ending had the same flaw: the personality of the author bled through all the characters, transforming them into a do-good Scooby Doo gang, eager to solve mysteries and help people. Sorry, Mr. Reynolds, you're just too nice of a person! :)

Anyway, this time the plot revolves around issues of personal goals and identity, the very definition of a persona and of quality of life. While the story is intricate enough to make it a great book, I thought many of the concepts in it were very interesting, but insufficiently explored. Then again, explore any concept long enough and you never get to the other end, so at least having a complete coherent story that spans the entire plot is a big plus.

I just started Redemption Ark, the third book, which (finally! :) ) deals with the Conjoiners and a technologically advanced alien race. Or at least it starts that way. Happy reading!

I have this very precise requirement I am working on: a collapsable panel that has rounded corners of fixed size and a background image or a gradient, both needed to stretch with the panel, which would be vertically resizable by javascript. Also, the HTML 4.01 Transitional DocType will be used on pages. The only respite given is that the solution should work only on Internet Explorer.

I have first tried some jQuery alternatives, but I am not happy with them. Even if the rounded corners would have been what I was looking for (and they were not), the background stretching is a difficult feat to master in HTML. Even so I have cropped up something that takes the entire content of the panel and relatively positions it over an absolutely positioned image that is then stretched by javascript to its needed dimensions. However, all this relative and absolute positioning requires a lot of event driven javascript (when the events themselves are not really there, so I must also create new browser events!) and it has been shown to break either layout or functionality like the one for collapse.

Enter VML, an obscure web technology from Microsoft that has a RoundRect object that can have a fill of an image OR a gradient, stretched to the full size of the element. Can you see it? I was already planning the blog entry, detailing the masterful ASP.Net control that would change the world of web development forever.

Back to real life now. First of all, the RoundRect element does have an arcSize property that determines the percentual size of the rounded rectangle. By percentual, I mean that resizing the element would lead to larger corners. I don't need that. Another nice surprize was that I can't either read or write the arcSize property from Javascript, it throws an error. People have complained about it before and their solution was to disconnect the element from the DOM, change the arcSize, then add it back into the DOM. It didn't work for me.

After wasting about half a day with this, I concluded that the RoundRect was a lost cause. Enter Shape! A Shape is a VML element that can take any shape determined by a path. The path has interesting primitives like qx and qy which mean "draw an arc to this position". It appears that a Shape can easily take the place of the RoundRect. What was even nicer, the path attribute could be changed at will by javascript.
<v:shape strokecolor="blue" strokeweight="1" coordorigin="0 0" coordsize="203 103" style="width:200px;height:100px"
path="m 2,0 l 198,0 qx 200,2 l 200,98 qy 198,100 l 2,100 qx 0,98 l 0,2 qy 2,0 e"></v:shape>
The code above is a 2 pixel rounded corner rectangle of size 200 by 100. To add a stretched background image or gradient, a v:fill element must be added as a child of the shape and you are done!

I was extatic, finally having solved the problem that had haunted me for days, until I noticed that, unless I specify the width in pixels, the shape would behave really strange. I was commited not only to a panel that needed to be defined as percentual or expanding with the content, but also to HTML 4.01 Transitional DOCTYPE. In this particular situation, placing two shapes in a table, let's say, even if the table size was specified or, indeed, the sizes of the TD elements, in percentages or pixels, the shape would just expand to its maximum possible width.

I got stuck here. The control worked perfectly when the width was specified in pixels. Anything else just throws a big wrench into the works and makes it wanna go boom. In a fit of anger, I just replaced the obsolete doctype with the modern XHTML 1.1 one. And it worked, but only on Internet Explorer 8, not any of the previous versions of the browser.

Therefore my only option now is to either abandon the technology completely or to convince people to change the DocType for all their legacy pages. How fun is that?!

And before you write the usual crappy "Microsoft sucks! Internet Explorer sucks!", try giving me a solution for my request that would at least work in another browser. Was it so difficult to recognize the need for a stretched background image and custom shaped containers ?!

and has 1 comment
I've had the priviledge recently to be able to watch two batches of horror movies from start to end without interruption, what I lovingly like to call FrightFest@Home. All my movie comments can be found here as well as another list, ordered by my vote here. The permanent links are in the top right of the blog as well.

However, after this, I felt compelled to also write a blog entry about them, since, as the horror genre goes (and, why not, the entire movie class), most of the films I have seen were rubbish.

So, these are the movies I have watched. I will cross out all the movies that are not worth seeing and bold out the ones that I felt need to be seen. I reiterate: all the movies in the list are horror (or at least marked as such on imDb). I would like to add a special thanks to M'hael from The Horror Club blog who recommended many of the films in the list. Here is goes:

Have fun!

I was trying to do this update, but I wanted done in a specific order. I have found two solutions. One is to use a Common Table Expression, which would look like this:
WITH q AS (
SELECT x,y,z FROM SomeTable
ORDER BY z
) UPDATE q
SET x=y+z
Strangely enough this updates the SomeTable table in the order of z.

However, I had to do it in SQL 2000, so Common Table Expressions were not available. The only other solution I could think of was a temporary table with an identity column:
CREATE #temp (
realid INT IDENTITY(1,1),
x INT,
y INT,
z INT
)
INSERT INTO #temp (x,y,z)
SELECT x,y,z FROM SomeTable
ORDER BY z
UPDATE #temp SET x=y+z


The most difficult part of the task was to not think procedurally. SQL is a functional language and one must think differently. Weird is I knew that I had to think in a functional way and I said it out loud when I started the task. It took a few hours of trying to create recursive functions or emulate loops in SQL before I could change my thinking. Using SQL in a procedural way, even if possible, means using something in the wrong way.

and has 2 comments
So I had this legacy project that I was supposed to work on and so I installed Visual Studio 2003. That is, over VS2005 and VS2008. From then on, every time I had a javascript error in Internet Explorer 8 and that "Do you want to debug" window appeared, if I clicked yes, the system would freeze. And I mean total freeze, not even the mouse would move.

After a few angry reboots I noticed that unchecking "Use the built-in debugger in Internet Explorer" checkbox would not freeze the system. Setting it back on would bring the problem back. So this is what I did:
  1. went to a page with a js error on it
  2. unchecked the setting so that the system would not freeze
  3. chose a debugger from the presented list (but not the default one)
  4. set it as default
From then on, my problems were gone.

In conclusion, I have no idea what caused the error, but this is how it was fixed. I hope it helps people in the same predicament as myself.

and has 0 comments
I am not working with barcodes or anything, but I think this new technology is kind of cool. Something that acts like a barcode, encodes more information and it is several times smaller. More than that, it can be read from multiple angles and from a distance of up to 20 meters!

I can imagine multiple applications, but what I specifically think could be great is augmented reality. It would start with markers that would tag objects from computer detection, but then it would probably transform into a communication system, if the codes are dynamic. And I am not talking about replacing IR or bluetooth here, but couldn't one imagine a programmable bokode that would change the tag of an object? Think picture frames. Or TV images. Something that would tag a dynamic object like a video screen.

I was having real trouble with an html menu. Every time I would move the mouse over an item, a large gray area would appear over the screen. This only happened on Internet Explorer 7, not Internet Explorer 8 or any other browser. When I changed the Doctype from XHTML to HTML I reproduced the error on IE8 as well.

Strangely enough, when I first found the source of the problem, a border of 899px , I thought it was a browser javascript incompatibility. How could it be differently? The CSS was mine and the JS was not. Obviously it was their fault. However, after reproducing the problem in IE8, I could use the more advanced developer tools available and I realised that the strange border width was not part of the element style, but the CSS class style itself. It was there, the interpreted style for my menu control class: border: 899px;.

I rechecked the CSS and I found the actual problem: no hash in front of the colors! So the browser found something like D8C89A instead of #D8C89A, did a weird parse on it, got 899, then considered it a size in pixels!

Hopefully, someone will read this and save themselves a lot of grief and time.

and has 0 comments
I usually don't like Mecha anime, with silly robots fighting battles that make no sense. I also dislike the Ecchi style, where young almost preteen boys and girls fall in love or are dressed in a sexual manner, with no sense either. At first, this is what Guren Lagan seemed to be. However it evolved into something else, and there is a pun in this phrase.

The series revolves around the "spiral power" (enough with the puns already!), the power of evolution, which allows people to get to new heights every time they meet an obstacle. Even if the animation was pretty basic and the story about always shouting robotic pilots that power their machines with the strength of their souls (geez! :) ), I just have to give it points for rapidly changing form and evolving in style.

We follow a bunch of "villagers" escaping from their underground almost stoneage dwelling and getting to the surface, where, in the course of 7 years, reach another universe and destroy the very beings intent on annihilating humanity with a robotic starship. Now that's fast :)

However, this is not it. What began as a simple courageous brawl twisted into a story about friendship, then despair, then rebuilding, going through the unforgiving politics of unintelligent human masses and ending with a galactic... no, universal battle for the survival of the human race, all in 27 episodes. I say not bad! I was expecting to see tens of episodes going nowhere and then ending suddenly when the funding was gone, but no, it was a complete story, evolving from the level of 7 year olds up to almost adult (in a timescale sense :P) level.

So watch it, it might surprise you. Prepare yourselves for really corny dialogs and a rather simple animation, though. Oh, also, you might find a Guren-hen movie that is like a summary of what happened from episodes 1 to 11 in the series. If you have watched the series already, the movie is made of fragments of it, so you don't need to watch it. If you are in a hurry and you have seen neither, watch the movie, then the series from episode 12 upwards.

The Infragistics web controls have a way of saving design time settings into XML files and then loading them. You can do this either by loading the presets in the designer or dynamically from code, using the LoadPreset method. It accepts Stream, TextReader and string parameters and it is pretty easy to use.

The problem is that it doesn't work in inherited controls! The explanation is that a piece of its code is searching for the root element of the XML file by getting the assembly defined TagPrefix and then adding to it colon and the name of the object.

In other words, I had a control that inherited from UltraWebGrid, and in the ASPX it looked like omega:OmegaGrid, when styling it with the designer and then saving the preset, it created an XML that has its root element . Since my assembly had no assembly TagPrefix defined, it was looking for ":OmegaGrid" and failing.

The solution was to add the TagPrefix assembly attribute: [assembly: TagPrefix("Super.Desktop.GUIControls.Web", "omega")] in the AssemblyInfo.cs file.

Yay! Post 600! I will post about a new song that you have certainly heard during movie trailers or if you watched Requiem for a Dream: Lux Aeterna, composed by Clint Mansell. No video for this one, even if the embed is from YouTube.

It's just nice and hints on the rithm of development of both myself and the blog ;) Have fun!

Now, that title doesn't much, but it's the only one I could think of, because I haven't yet determined the source of the problem. Baiscally, what happends is that there is a difference of behaviour between style included directly into the page and actually using javascript to add to the head of the page a dynamically created link element.

I have no idea what exactly is going on, but I will try to explain it based on the evidence. There was this menu control, an Infragistics Web Menu from the NetAdvantage 9.1 suite, that, given the right styling, would look exactly like what I wanted. After setting that style in a css file I decided to load it using a javascript dynamic load just in case the control would be rendered only on asynchronous postbacks. And it worked perfectly. In IE8, Chrome and FireFox. However, when tried on IE7, it exibited the strange behaviour that, on mouse over, the entire table that the menu was rendered as expanded to fill the screen and was completely blank. After extensive attempts to capture the element with Internet Developer toolbar I noticed that the border-bottom-width and border-left-with were abnormally high, like thousands of pixels.

As of now I know not the cause of this. I can tell you, though, that moving the same style from the dynamically loaded CSS into a statically loaded one or by copying that style in a style tag in the page fixed the issue. I really hope it helps someone lose less days of their lives attempting to see what is going on.

Also, if you know the cause of this, or maybe other pages reporting the same behaviour or, I dare hope, a fix, please let me know.

and has 0 comments
I had not read a scifi book in quite a while, but then I heard of Alastair Reynolds, once an employee of ESA, and now turned hard sci fi writer. I just had to read something by him and I started with Revelation Space, the first of the Revelation Space universe books, which spans 5 books and several short stories and novellas.

What can I say? I loved the book. Not in a very intellectual way, though. Certainly the universe in which the action takes place is very ingenious and the story full of twists and hi-tech marvels, however, I felt like the writing style was not completely to my liking. The characters are all very much alike, the leaps in logic are pretty big and only to support previous ideas that the book had put forward. It seemed lazy to me. But I did say I loved the book, once I got over the "revelation" that the PhD in Astrophysics and the ESA work did not compel Mr. Reynolds to be very thorough. Besides, it's only the first volume. Maybe the next ones will be more natural, now that a first book has established the rules of the universe.

Prepare to delve in a place where technology is way more advanced than today, but faster than light travel is not yet possible and the lives of people on spaceships, frozen in stasis and moving at relativistic speeds, feel like weeks have passed between a world and another, while for the people on the planets decades or even centuries have passed. Extinct races, time spans of billions of years and impressive armament (both in the physical and virtual realms), favourably offset the fact that humans are pretty much the same and they all sound like Asimov characters :)