Blog

Loupe.js

· listen

1 minute read

Christian Effenberger developed Loupe.js, which allows you to add a magnifier to an object on your page. To use it, all you have to do is to download a Javascript file and a small PNG image, and insert the following line of code in the place you want to have the magnifier:

<div><img id="..." onLoad="initLoupe(this.id);" ...></div>

The result is something like this (click here to see it working):

A Greener Apple

· listen

1 minute read

After greenpeace call for action for the reduction of the usage of hazardous substances in Apple equipment (previous post here), Steve Jobs responded with this paper, entitled "A Greener Apple".

Thank you Steve.

20 questions

· listen

1 minute read

Think in something (almost anything!). With a maximum of 20 questions, 20Q will guess what you are thinking.

It's a very good example of what is a neural network, and it learns with every play, so, come on, take a 2 minute break and have a go.

lastChild in Mozilla browsers

· listen

1 minute read

For a while now I've been receiving some complaints about the comments in this blog: people using Mozilla based browsers weren't able to see the BlindDown effect when posting comments, and since they did not receive any other message about the comment being correctly posted, they posted it several times.

The error message received was this:

$(element).style has no properties[Break on this error] $(element).style.height = '0px';effects.js (line 369)

After some heavy Javascript debugging, I found out the bug: Mozilla browsers add nodes for white space (in my case, in between LI elements), so it was calling the wrong node for the BlindDown effect (it was calling a white space). Here goes the original code:

function commentAdded(request) {  new Effect.BlindDown($('commentList').lastChild);  $('commentform').elements[3].value = '';  $('commentform').elements[3].focus();}

The solution was to add a new javascript line before the Effect.BlindDown call, cleaning all white spaces. Here is the corrected code:

function commentAdded(request) {  Element.cleanWhitespace('commentList');  new Effect.BlindDown($('commentList').lastChild);  $('commentform').elements[3].value = '';  $('commentform').elements[3].focus();}

So, the lesson is: every time you use a lastChild call, be aware of the white spaces for the Mozilla browsers. Hope it helps, thanks to all who pointed the bug.

Update: after a lunch conversation, I've decided to post the bug in the Mozilla foundation bugzilla. If you want to, you can check the status by accessing bug #378593.

The filter

· listen

1 minute read

I've spent the morning listening to music from my iTunes, but selected via The Filter. It's a great tool (free download here), which mixes the taste of thousands (like last.fm) but with a huge difference: it does it with my own music.

At the heart of The Filter is a music recommendation engine that is continually learning the listening tastes and choices of tens of thousands of music lovers. This huge collection of information is combined with your own likes and dislikes to create a personal understanding of what songs from your collection you will like to listen to and when.

It can be also used to create fresh playlists for your iPod, and to get a lot information about the music you are listening. It's great, for free, and with versions for Windows, Mac and Nokia phones.