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

Archive for April, 2006

20060408 Música Tracker: blog acerca de módulos

Acabo de encontrar el blog Música Tracker; por el nombre podéis deducir de qué va el tema del blog. No conozco al autor pero el blog es muy prometedor, a pesar de tener muy poco tiempo de vida. Diría que es un recurso muy interesante para todo aquel que quiera ponerse al corriente de qué es un tracker, cómo reproducir los archivos, y batallitas varias y canciones míticas. ¡Entretenido cuanto menos!

neon v2 public release

Neon v2 main interface

So I am the last one in writing this, after all the announcements in different places such as vjforums, dmstk, xplsv.com, xplsv.tv, pouet.net, escena.org, trace's blog and only-God-knows-where-else, encouraged by all the people which has arrived to my blog looking for "neon v2 download", "neon xplsv" and so on. No need to worries, people, you can now download it for free and use it in your own VJ sessions.

All the information in neon v2 official website. I'm looking forward to see what people can do with it!

A rare atmosphere

There are days in which I notice a weird ambient, and it's got nothing to do with the weather, but with the feelings the environment generates in myself. It's a bit hard to explain anyway, but those days everything is normal but strange at the same time.

For example, yesterday. I went to Victoria Station in the morning and, as usual, it was closed due to overcrowding, so I thought I had to wait while their No Entry display was flashing and beeping like if it was a war emergency siren. Ok, normal, I thought. But no, as soon as I stopped walking, the alarm stopped sounding and they opened the doors.

Then I expected to find lots of people on the platform and suffer the typical sardine syndrom of the Victoria line, with retarded passengers packing in front of the doors while having lots of space between the seats. But then it appeared a completely empty train which allowed to take all the people which was on the platform (and it was three rows of waiting people). I always wonder where do the empty trains appear, specially when it is supposed to come from Vauxhall and Brixton (which is not closed yet), so it's not an station which is the beginning/end of the line. Quite weird, and ghostly somehow.

I even got a seat, which is something one can't usually get until we arrive to Green Park or even Oxford Circus, although I have to say that the retarded passengers made their usual act and positioned themselves just near the doors even if the rest of the carriage was empty. That was the punch of normality in all of that…

20060405 El chiste de los 100 euros

Amiguitos, disculpadme una vez más que critique a España desde aquí arriba, pero es que la noticia que acabo de leer, sobre la posibilidad de extender la paga de 100 euros a madres que no trabajan, me da risa.

Por si alguien no está al corriente, hace unos años se comenzó a dar una paga de 100 euros mensuales a las madres trabajadoras de hijos menores de 3 años, si mal no recuerdo. Y bueno, si bien todo ladrillo hace pared, desde luego con 100 euros hoy en día poco hace, por mucho que ahora mediten si sería buena idea dar la paga también a madres amas de casa.

Tengo dos humildes opiniones respecto a esto:

  1. Aunque 100 euros sea una miseria, no creo que dar más sea una solución. No me gusta que la gente se aferre al pezón de Mamá Estado como si fuera la la única salida a todos los problemas.
  2. Creo que mientras no se resuelvan otros problemas previos (¿vivienda? ¿sueldos de mierda?), la gente no va a tener más niños, por mucha paga de 100 euros que se les dé. Honestamente, el patio en España no parece estar como para llenarlo de críos 8-|

La obvia consecuencia de todo esto es algo que se puede apreciar de una forma muy sencilla: darse un paseo por cualquier ciudad española y contar el número de gente mayor. Posteriormente realizar la misma prueba en cualquier otra ciudad europea. ¿Me podríais decir el porcentaje que os sale, así a ojo de buen cubero?

En fin…

Assigning behaviour to page elements based on their class name

There's little things that bore me more than having to write inline javascript for little tasks like closing a window. So I thought of a way of having javascript do it for me!

Basicly this is the idea: I assign a certain class (CloseWindow) to the items that I want to act as Window Closers, and when the page is loaded, a little script finds out the document tags with that class and assigns them a function for their onclick event.

As I wasn't feeling like writing a function for traversing the whole DOM tree for searching elements class names, I also used a function, getElementsByClass by Dustin Diaz, to discover the elements with a certain class name. So yes, the rest was pretty easy :P

Now to some code:

function getElementsByClass(searchClass,node,tag) {
// Taken from http://www.dustindiaz.com/top-ten-javascript/
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}

The code for intercepting the onload event of the window:

window.onload = function() {
// Replace all elements with 'CloseWindow' class onclick handler with
a call to the windowclose function
var closeWindowElements = getElementsByClass("CloseWindow");
var i;
for(i=0; i < closeWindowElements.length; i++ ) {
closeWindowElements[i].onclick = function() {
window.close();
}
}
}

Finally, the code for a Window Closer element:

< button type="button" class="CloseWindow">Close< / button>

Of course all of this can be improved, you can use a custom events handler instead of just overwriting the current events of those elements, or even the current onload event of the window object, but for the purposes of demonstrating this possibility this serves completely well.

And also this is not the perfect way of having close buttons (as in the case of a site which needed to be open to the public and being completely accessible, no close buttons should be assumed as we can't assume that the users' devices are windows capable), but for sure it's going to be better than having embedded javascript in the middle of your code.

Oh, and the getElementsByClass function could be improved for allowing to discover elements with more than one class (see below), like for example class="post veryimportant". Currently the script just can detect literal values, and if you search for elements with class="veryimportant" or class="post" it will find nothing.

*Because you know that you can assign more than one class to an element, don't you? Well, now you know!