lunes, 28 de julio de 2008

Mock... yeah!

Ayer me surgió una de esas dudas pelotudas que necesitás saber la respuesta como sea, para después decir, "Ah, mirá vos." y nada más.

Ya me había pasado hace poco, después de darme cuenta que la introducción del tema Relax, Take it easy de Mika me sonaba mucho a algún tema de los 80's. No me acuerdo si lo bajé para un amigo o se bajó por error dentro de una porno, pero no importa. Lo importante es que tenía que sacarme esa duda y por dos días estuve revisando discos y buscando en google palabras que me sonaban de la canción +80's, +lyrics, etc sin resultados. Hasta que mi hermano de pedo cayó en el video que era, (I Just) Died in your Arms tonight de Cutting Crew.
Después me di cuenta que nada más entrando en el artículo de la Wikipedia del primer tema, lo decía en el primer párrafo, confirmando que en internet está toda la información que uno necesita pero hay que saber buscarla. Por lo menos hasta que la web semántica y los buscadores capaces de responder preguntas hagan que buscar las respuestas a estas preguntas sea algo rápido y no-divertido.

En este caso la query era simplemente cual era el tema que cantaban Tonto y Retonto cuando el tipo que levantan en la ruta está a punto de matarlos, y conseguir la versión original. Por suerte existe youtube

Resulta que la canción se llama "Mockingbird", de Inez y Charles Foxx, que fue interpretada también por nada menos que Carly Simon y James Taylor y su rock pop suave de contenido:


Este es un video de la canción en vivo:





Esta la escena de la película:




Que pelotudo, nunca le había prestado atención a que con los mexicanos cantan Mock... si, ing... si, bird... si, si... si. Jajaja...

Nótese que este post lo tenía archivado y lo largo ahora junto con otro donde me hago el interesante escribiendo cosas de programación que no sirven para nada, como para compensar la estupidez del contenido.

Mátenme.

martes, 15 de julio de 2008

Videos recomendados por la gerencia artística

Peter Capusotto y una traducción increíble de "Another Brick in the Wall". Los auspcios, insuperables.



Marx Attack. Toda la marxomanía en un grupo pop que es furor. De Todo x 2$. Me hace acordar a unos cuantos de mi facu :P (Está buenísima esa versión de "La hierba de los caminos"!!)



Weird Al Yancovic entrevistando a Madonna. Video traido a Cerveza con Lupines por medio del "Antimufa Service", del viejo y querido Lannon.



A Rambo no le gusta la guerra. Lo mejor que exportó la Argentina en mucho tiempo.



Where the Hell is Matt? (2008) Video nuevo de este tipo que se dedica a dar la vuelta al mundo, visitando lugares espectaculares mientra hace una versión menos epiléptica del pasito flogger.



Wear sunscreen (usa protector solar) Un video típico de mina que reenvía cadenas con presentaciones de Power Point. Pero está bueno. Es ideal para verlo "si estás desorientado y no sabés que bondi/trole hay que tomar para seguir" :-|



Aaaahh!! Siempre me olvido de algo después de postear. Big Buck Bunny. Un corto hecho totalmente con software libre por la gente de Blender. Bajable desde internet en varios formatos incluyendo todo el repositorio de arte, licenciado bajo la Creative Commons Attribution License

jueves, 10 de julio de 2008

Kernel de crema americana

A veces me pongo a pensar en lo pelotudos que son algunos rótulos del mundo informático, en particular del software libre.

Cuando escuché por primera vez la palabra Debianita para un usuario de Debian, agradecí ser un Gentoosero (¿?) porque ese calificativo parece que le quita todo el valor al esfuerzo de ser un usuario de Debian. Merecen algo más del tipo Debianero y no algo que suena a nenita, o que parece el diminutivo de algo.

Ahora escuché a un amigo decir que se compila su propio kernel. Que se baja un "kernel vainilla" y le aplica los parches que quiere. El término vanilla ya lo había leído en varios lugares para referirse a un producto sin modificaciones, tal como lo publica el desarrollador. Pero esta fue la primera vez que lo escuchaba castellanizado.

Supongo que una versión más argentina sería un "kernel pelado", o algo así. Pero me puse a buscar de dónde salía el termino vanilla para este tipo de cosas, y por lo que leí viene de que el sabor más popular para los "ice creams" es la vainilla, entones la opción vainilla sería como la estándard.

Acá no pasa eso, el gusto más neutral es el de crema americana, que viene por default en los pinitos, los pinguinitos, y ciertos postres helados... así que para cerrar este pequeño divague, propongo el siguiente logo para identificar al kernel recién salido de fábrica:


Este post claramente está hablando del fasoooo.

lunes, 19 de mayo de 2008

Zambayonny - Las cosas que dejé (Acordes para guitarra)

Había escuchado muy poco de este tipo y si bien me había resultado bastante gracioso no me pareció tan genial. Pero este tema la rompe, y la canción final de tres renglones con la que cierran el programa es algo que se puede definir solo con una palabra: jakkajskjaskjdkaskjakjsdakjkjaskjaskjadskjdak.





La cuestión es que quería los acordes de guitarra para la canción, pero en La cuerda no estaban, así que lo transcribí y lo subí a esa página.
Como tardan cerca de 2 semanas en actualizar, dejo el link a mi página y después actualizo:
Acordes

Si encuentran algún error, avisen. Estuve en duda si el Mi era menor o mayor, porque la secuencia sería como la del recontra usado Canon de Pachelbel si fuese menor, pero parece que es mayor. Y también tengo dudas en
Dm C G C G
podría ser
Dm Am G C G
en el video no se ve bien...



De yapa, me parece que así es la cancioncita del final:

C
No, no me hables de amor
Dm
mientras me chupas la pija
F G C
porque no se te entiende nada

F C


Es el fragmento de la canción "Una semana de mierda"

Update 04/06/2008:
Ya está la transcripcion en La Cuerda

Update 28/07/2008:
Buuh... que turbio... Reemplazaron mi tab por otro donde le cambiaron de cifrado americano a do re mi fa y mi tab desapareció por completo :' (

sábado, 3 de mayo de 2008

4 segundos



No soy un lector de comics. Creo que es una de las pocas cosas del mundo nerdista que me rodea que no se me pegó. El único comic que leí casi completo y que compré casi todos los números fue Cazador.
Ahora (obvio, con 8 años de retraso) descubrí este otro comic argentino, 4 segundos. No es más que la historia de 4 pibes comunes, nada de super héroes ni naves espaciales. Y por eso me gustó. En una noche al pedo leí las 7 historietas y me entretuvo mucho. Lástima que no la hayan seguido.
Está mucho más cerca de los sitcoms que estoy viendo últimamente que de las historietas del gordo de los Simpsons, así que se la recomiendo a todos los que por haber tomado Drink Z con alto contenido de pentaxanol, o algún otro misterio de la vida lleguen a este blog.

Acá les dejo algunos links que les pueden interesar:

http://4segundos.4t.com/
http://www.historieteca.com.ar/4segundos/4segundos.htm
http://www.taringa.net/posts/125795
http://www.taringa.net/posts/arte/818558/4-Segundos---Coleccion-Completa-(Editado).html

Disfrútenlos, tienen más glamour que Chabreleaux.

sábado, 26 de abril de 2008

BadRequest error running the import steps of a selected profile from a product with several profiles

I had to add an action to a content type named "Attachment" for a Plone 3 product. That is just adding the action in the profiles/default/types/Attachment.xml generated by ArchGenXML 2.0. But there is a problem. That file has no special sections for custom code, so it will be overwritten every time we regenerate the product from our model.

My first attempt was to create another profile, called attachment, where I will put the modifications, and running the step from the Install.py. That is:

  • create a profiles/attachment/types/Attachment.xml and include there the action I need to add in a proper xml structure.

  • register the profile in the main configure.zcml (archgenxml will create a profiles.zcml for this purpose)
<!-- ##code-section profiles.zcml-top #fill in your manual code here -->
<genericsetup:registerProfile
name="attachment"
title="MyProduct-customized-profile"
directory="profiles/attachment"
description="Customized extension profile for MyProduct."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<!-- ##/code-section profiles.zcml-top -->

  • put this code in Extensions/Install.py
from Products.CMFCore.utils import getToolByName

def afterInstall(self, reinstall, product):
portal_setup = getToolByName(self, 'portal_setup')
portal_setup.runAllImportStepsFromProfile('profile-Products.MyProduct:attachment')


But when I installed the product, I got:

BadRequest: The id "import-all-profile-Products.MyProduct_attachment-20080426230436.log" is invalid - it is already in use.


I was importing the steps of a profile that QuickInstaller had already imported. But my product wasn't completely installed yet...

The problem is that QuickInstaller imported the attachment profile not because it imports every step, but because it imports the first registered profile in alphabetical order. At least, that's what I concluded, because, after moving profiles/attachment to profiles/extra, and renaming attachment for extra in the previous fragments of code, it worked.

The default profile wasn't imported. And looking at the installable products on QuickInstaller Control Panel page, the attachment product was listed, instead of the MyProduct profile that used to be there.

So, should I use only names that follows 'default' in lexicograpic order for additional profiles? I would expect that QuickInstaller only executed the default profile. Maybe I missed something... This was the first time I added a second profile.

jueves, 24 de abril de 2008

How to register a local utility in Plone 3 and not lose its persistent data when the product is reinstalled

What you are about to read is not a great solution. There are probably better ways of doing this, but I wanted to share the problems I found and how I solved, because it took me some time to find out what was going on, and perhaps this can be useful for somebody. So, actually this isn't a HOWTO, it's a HOWIDID.

I was developing a Plone 3 (3.0.6) product, generated with ArchGenXML 2.0, and my objective was to add a local utility to it, which should store a list of items. Those items should be added or removed from a page accessible from the Control Panel, and that list would be the options of a drop down selection field of a content type.

Martin Aspeli's book "Profesional Plone Development" was of great help. How to create the configuration page in the Control Panel was almost copying and paste one of his examples (declaring the configlet in controlpanel.xml, creating a view that extends ControlPanelForm, declaring the icon in actionicons.xml and registering it as a resource, etc)

The problem was that he uses the componentregistry import step to register the utility. And that looks really nice, but if you install your product with quickinstaller, quickinstaller runs this step, and somehow it remembers that the utility belongs to that product, and when you remove the product, you will lose all your persisted data.

I tried some things I found on the web but nothing worked, so I desisted with component registry.

I just used the good old Extensions/Install.py, to which I was familiar from Plone 2.5, and registered the utility there. Neither the file or the directory existed (I guess because with ArchGenXML 2.0 everything that was done there is now done through GenericSetup) so I created them.

The utility must be registered in the afterInstall method. Otherwise QuickInstaller will still remove the data.


Lets say we have this code in utility.py in our product:
class IMyUtility(Interface):

types = schema.List(title=_(u'My list'),
description=_(u'A list of items'),
required=False,
value_type=schema.TextLine(title=u'Item'))

class MyUtility(Persistent):
implements(IMyUtility)



We will write this code en Extensions/Install.py:
def afterInstall(self, reinstall, product):
from Products.MyProduct.utility import IMyUtility, MyUtility
from Products.CMFCore.utils import getToolByName

portal = getToolByName(self,'portal_url').getPortalObject()
sm = portal.getSiteManager()
if not sm.queryUtility(IMyUtility):
sm.registerUtility(MyUtility(),
IMyUtility)


That's it. That works fine if we install our product as an independent product. But there is a problem if we install it as a dependency of a policy product. In that case, Quickinstaller will remember that the utility was created during the installation of the policy product, so the persisted data will survive the reinstallation of the product, but not the reinstallation of the policy product.

In that case, I don't know how to proceed. What I did was to leave the registration code commented in the product Install.py and copy it to the Install.py of the policy product. That sucks, because that registration shouldn't be done by the policy product, but I couldn't imagine another solution.

Do you know one? Leave a comment! :)

UPDATE 16/05/08:
Warning! I don't know exactly why, but after working for a while on my product, I did an update to the whole buildout and I got a:

Error Type: AttributeError
Error Value: type object 'IMyUtility' has no attribute '__iro__'

that broke my Plone Site completely, I can't access anything even from the ZMI. There is not much information about this error on Google, and it is not clear if it is because of this method for registering the utility. Probably yes, so use it at your own risk, and always make backups before updating.