soledad penadés
repeat 4[fd 100 rt 90]

Archive for July, 2007

20070710 This is what is wrong about licenses

When so many steps and details need to be considered before including a couple of games in a repository, how can you expect people to use free software without certain fear, uncertainty and doubts? ;-)

20070709 Why is it important to have open standards

First of all, let me confess something: each time I find a headline which begins with why and has either open or standards in it, my first idea is to skip that article and read the next one. So I'll understand if you feel the same urge.

That said, I would like to explain my own tacky headline and why I do believe it really matters.

Normally, when discussing these topics, the conversation usually ends in a dead end where everybody gets bombarded with either very philosophical matters, which do not touch the inside of most of us, selfish beings, or usual and boring unintelligible cliches such as licensing, operating system A vs operating system B and all that malarkey, which force everybody else in the discussion to leave and let the speakers alone.

That's not good, because the issue is really important. But due to the inability to communicate of the defenders of the good cause (open standards), most of us are completely unaware of the seriousness of this.

What we are doing by allowing our personal stuff to be recorded and preserved in closed formats is like buying a leasehold instead of a freehold. You get the illusion that you are the owner but in fact you're just owning part, not the whole, of your files. Once the lease expires, you'd better start thinking about a way of renewing it or may have to move to a different place. And on the move, something may get lost and you can't complain because that wasn't covered by the lease contract. But if you manage to renew the lease, it may probably come with a new list of terms and conditions, which you might have to accept or risk losing your valuable belongings.

Now think of this in software terms. Each time you save your data in proprietary, non standard formats, you're exposing yourself to the future will of your software vendor. If they decide to stop supporting that software, you can begin waving bye bye to your data. Admittedly, you could keep using the same version of the software. But what do you do if you want to move to a different platform? Or if your current version crashes with a new version of your operating system?

Yes, there are emulators. There are visors and readers and converters. They might come from the software vendors (rarely) or might be a product of reverse engineering. And all of them are like a home-move: something may be lost in the process, with you getting to know when it's too late.

I'm scared!! What can I do??! AAAAAH!!

So I managed to scare you! Good! I think we all should try, for our own sake, to start looking for open alternatives when faced with the decision of choosing a file format.

For example, as a developer, a good idea is to try and use common formats instead of creating your own one when you need to store data. Not only it will help you in developing time (since there might be tools which manage that file format already there) but it will help people to use their data wherever they want, with the program they want, instead of forcing them to use only your program for manipulating their data.

As a user, try to use open formats, so that you do not force anybody into your closed living style when sharing data with them. For example, if you want to send somebody a song, do not send a WMA file which in addition may need some exotic plug-in for playing; just use OGG, which is free and doesn't force people to install something (a player) which forces them to accept an extraordinary lengthly EULA when the only thing they want is to listen to a song.

I have lots more of examples. Movie files which can't be played by your friend and he doesn't want to download player X and crack it so he can't see that funny clip you found. Your university texts written in some sort of old text processor which who knows which format used, lost in computer's limbo. Four years' e-mails. The whole accounts data for a company. Your drm'ized songs collection, religiously paid at an online music store…

At the end, using open formats will ultimately benefit the owners of the data - that means you! And if you're not worried about having to ask first in order to access your data, you're in risk of losing it.

jQuery and Rails (and getting rid of prototype)

My first ajax-y attempts were done with prototype. It all seemed so natural and seamless: prototype came with rails and there were those nice javascript helpers like link_to_remote which generated the javascript code for calling prototype functions. Until you looked at the code! (and the weight of it). I'm not talking about the ruby code but the output HTML, which is heavy and plagued with very obtrusive javascript.

Since I'm a concerned person, I decided to ditch Prototype and its Scriptaculousy effects and use jQuery instead. And I thought: since jQuery is so cool, I'm pretty sure that somebody will have done a replacement for the default javascript helpers (based in Prototype). But I was wrong. Not completely wrong, but quite a bit.

There's some work done in this area; a guy whose page is titled Katz got your tongue? is working hard in getting a jQuery On Rails plug-in up and running. Incidentally it seems he's also a jQuery developer so that's very good too. But since the plug-in is not finished yet, I kept looking for less obstrusive alternatives. I remembered about the unobtrusive plug-in that Luke Redpath & Dan Webb talked about in a LRUG meeting, UJS, and although it looked really cool, I realized am not sure if that's what I want.

Right now, it looks easier to simply write the HTML and add some JS (not in the html itself) which behaviourizes the elements, using jQuery for this, rather than using UJS's apply_behaviour. Specially because at the end, UJS is still using Prototype, and it is very slow compared with jQuery.

In my tests, which are so unscientific that I don't have any result indicator more than my own subjective speed perception, effects made with Prototype+Scriptaculous ended with what I call the 1fps syndrome: the screen gets updated only 1 time per second, so you forget about concepts like smoothness, transitions, easing and all that quite quickly. Way more quickly than it takes the effect to execute, actually; when it finishes you have almost forgotten what you wanted to do. Meanwhile, jQuery kept always a decent framerate and didn't feel like overloading the processor. And this happens in all types of machines.

So I think I'm going for jQuery, doing things in the style of this guy over here, and will keep an eye in jQuery for Rails development.

20070703 VerifyError: Error #1025: An invalid register 1 was accessed

If you need to parse some XML with namespaces in ActionScript 3 you may find this error quite soon: VerifyError: Error #1025: An invalid register 1 was accessed

It all comes because of this line:

default xml namespace = myXML.namespace();

It is needed in order to access the values in the namespaced value so removing it is not an option. The problem appears when you call any other function in your object… and you get that weird error.

I haven't managed to find out why. It kind of seems that changing the namespace (as the very example from Flash's reference on how to read an RSS feed suggests) also alters the namespace of later function calls, and so the interpreter can't find the functions.

I found the simplest solution was to reset the namespace back to nothing when I was done with accessing the XML:

default xml namespace = new Namespace(");

There should be an explanation for this but I haven't yet found it. Meanwhile this can save your life :-)