Jan 29 2008

Conciertos

Escuchando la canción “Nuestros nombres” de los Heroes del Silencio me acordé de los conciertos a los que hemos ido:

  • Heroes del Silencio
  • Soda Stereo
  • Depeche Mode
  • Manu Chao
  • Pearl Jam
  • Roger Waters
  • Apocalyptica
  • Dream Theater
  • Stratovarius
  • Miguel Poveda
  • Taraf de Haïdouks
  • Lila Downs
  • G3 (Satriani, Petrucci, Johnson)

:D


Jan 15 2008

Blame Apple. Laptop on sale!

Macbook Air

And my current laptop is just 5 months old! Grrr.

Well, does anyone want to buy a laptop? :)


Jan 3 2008

Seaside menus

Finally, after long hours (days and more exactly months) searching the archives, the Smalltalk/Seaside blogosphere and the web, I had my Aha! moment with Seaside.

I was trying to grasp the Seaside way to do menus. First I was using call:/answer to make the links in the menu work. So in my menu I had something like:


renderContentOn: html
html anchor on: #newContact of: self.
html space.
html anchor on: #contactList of: self.

newContact
| contact |
contact :=  self call: (ContactEditor contact: Contact new)
contact ifNotNil: [ContactDatabase contacts add: contact].

contactList
self call: (ContactList contacts: ContactDatabase contacts)

This would show a pair of links: ‘New Contact’ for adding a new Contact to the database and ‘Contact List’ for listing the current contents of your database.

What is the problem with this code? It worked, sort of. See: you want to add a contact, so you press the ‘New contact’ link and a ContactEditor call: is invoked. A contact form is presented for you to fill it. A pair of buttons (Save, Cancel) are shown too. The Save button submits the form and adds the Contact to the Contacts database. The cancel button, well, just cancels the process. But, as the menu is always visible, you could as well click the ‘New contact’ link instead of pressing the Cancel button in order to get a new blank Contact form.
What it is wrong with this? You are doing a new call: to a new ContactEditor and this call: is stacked in Seaside. The same happens if you click 5 or 4000 times the ‘New Contact’ link.
If, after clicking the ‘New contact’ many times, you fill the form and press the Save button, the last ContactEditor invoked answers back the Contact and it’s saved to the database. But Seaside, noting that a call: was just answered, returns the application to the point where the call: was made. That is, to the 4th or 3999th call: stored in the stack. That is not the way you want the application to behave.
In a classical menu, for example in WordPress when I click the ‘Write a new post’ link many times, it is the same as clicking it only once. You don’t have a stack growing and growing endless.

How to solve it?

› Continue reading