Archive for the ‘Yaco’ Category

Viaje a Islandia

Saturday, May 26th, 2012

Esta semana he estado en Islandia por motivos de trabajo. Han sido 6 días fuera de casa en los que no he parado de ver a amigos y también de conocer a gente nueva, de revisitar ciudades como Londres y de conocer otras nuevas como Reyjkavic. Lo más negativo, como siempre, es viajar con vuelos super baratos que te obligan a ir o llegar a los aeropuertos a horas intempestivas, lo cuál se traduce en una falta de sueño que se va acumulando en todo el viaje.

El viernes pasado llegue a Londres sobre las 11:30 de la noche y tuve que coger primero un autobus y luego un taxi para llegar a casa de Pablo y Rosa, que amablemente me invitaron a pasar la noche en su casa. Me alegra mucho saber que les va tan bien a los dos. Pablo trabaja para Potato, y hacen muchos proyectos para Google, la mayoría sobre Google App Engine. Rosa trabaja en una empresa empresa de marketing, en el departamento de desarrollo, y está aprendiendo un montón sobre tecnologías de frontend como CSS3 y Javascript. Los dos están muy contentos viviendo en Londres y es que han escogido un barrio estupendo: Putney Bridge.

Pablo y Rosa en Borough's Market

El sábado estuvimos todo el día paseando y me llevaron al mercado Borough, totalmente nuevo para mí. Es un sitio estupendo con muchísimos puestos de delicatessen y comidas caseras. Comimos empanadillas de verduras y pollo, zumos tropicales y postres de chocolate que parecían haber sido cocinados por el mismísimo Willy Wonka. Luego me llevaron a la librería Foyles y no pude resistir la tentación de comprar el libro Adrenaline Junkies and Template Zombies, de Tom DeMarco y otros. Trata sobre malas prácticas en proyectos y cómo evitarlas.

Finalmente fuimos a un pub Inglés y cenamos en un restaurante oriental. Un día genial con muy buena compañia.

Esa misma noche sólo dormí unas pocas horas porque a las 6 tenía que estar en Luton para coger mi vuelo a Islandia. Como el Chelsea había ganado ese día en las calles había bastante gente celebrándolo, en la medida que el acohol que habían bebido se lo permitía. Lo más alucinante fue que ví un zorro en un callejón de Londres! Tras varias combinaciones de autobuses conseguí llegar a Luton a tiempo y allí poder coger el avión.

Lago en el centro de Reykjavik

Nada más llegar a Keflavik, donde está el aeropuerto internacional de Islandia, me dí cuenta de que hacía un tiempo excepcional sin una sola nube y con un sol espléndido. He tenido una suerte increible porque en todos estos días se ha mantenido este tiempo. Otra cosa fenómena fue la Wifi gratuita del autobus que nos llevó a Reyjkavic. Hay dos empresas de autobuses que operan entre el aeropuerto y la capital pero sólo una de ellas tiene Wifi en sus autobuses así que acerté al elegir FlyBus. Otro acierto fue el alojamiento. Era un pequeño apartamento con cocina baño y dormitorio al que no le faltaba detalle. Incluso te dan un móvil local para que te lo lleves y puedas hacer llamadas locales a muy bajo coste. El sitio se llama Reykjavik4you y lo recomiendo 100%. Pero basta de publicidad gratuita.

Catedral de frente

Catedral de lado

Reykjavik es una ciudad pequeña completamente abarrotada de estátuas. Hay un pequeño lago en el centro con casitas muy bonitas a su alrededor junto con la galería de arte nacional, una iglesia importante y el ayuntamiento. El edificio que más llama la atención es la catedral, que está situada en lo alto de una colina y tiene un estilo arquitectónico muy original. La verdad es que no había visto una igual nunca.

El lunes conseguimos encontrar un hueco para alquilar un coche e irnos a la aventura con la ayuda del GPS de mi móvil y los mapas que me había precargado desde la conexión Wifi del hotel. Nos cogimos un folleto turístico de una empresa de excursiones y hicimos la misma ruta por nuestra cuenta. Primero vimos unas fallas enormes en Þingvellir, que prueban que Islandia se encuentra justo en la unión de placas tectócnicas enormes. Esto tiene dos consecuencias fundamentales en la orografía de la isla: hay muchos volcanes en las zonas donde las placas se unen y enormes fallas en las zonas donde se separan.

La falla con nieve dentro

A continuación fuimos a ver los famosos geyseres de Haukadalur. Es curiosísimo ver cómo hierve el agua a ras del suelo y algunos de ellos incluso escupen un chorro de agua caliente a varios metros del suelo. Cuando va a salir el chorro lo ves venir porque empiezan a formarse pompas enormes. Y todo está rodeado de un asqueroso olor a azufre que lo impregna todo.

Finalmente fuimos a Gullfoss y nos quedamos maravillados al ver esta enorme cascada. Es impresionante el caudal que lleva y cómo el agua cae y no llegas a ver el fondo de la cascada debido a que el rio circula por el interior de una falla. Es uno de esos sitios en los que te puedes quedar mirando un buen rato y el tiempo parece detenerse y uno se siente absolutamente diminuto.

La cascada de Gullfoss

El resto de mi viaje no es especialmente interesante porque estuve todo el tiempo en la conferencia a la que fui. Me quedé con ganas de visitar las aguas termales, el museo vikingo o incluso ver la catedral por dentro pero bueno, algo tenía que dejar para mi próxima visita, ¿no? Me ha encantado Islandia y espero poder volver algún día.

First impressions with Liferay

Sunday, October 9th, 2011

A couple of weekends ago I had my first experience customizing a Liferay site. I wrote a very simple theme to change the standard look & feel and I also wrote some portlets in several differente languages. The goal was to analyze which portlet technology was the best to suit our needs.

Writing the theme was not difficult at all. Liferay has an excellent SDK for writing plugins, which include themes. I didn’t start from scratch but used the great HTML5Goodness responsive theme. The main navigation menu was easy to do since there is a method to iterate over first level pages. However, when I tried to do the same with the footer menu I couldn’t find an easy and clean way to do it. I wanted to put standard links in the footer menu as the Terms of Use, the Privacy Policy and so on in the footer menu but I didn’t know how to organize this stuff in Liferay CMS so I could retrieve them back easily. I thought about using a portlet for the footer but I think that’s not the way to do it since that would affect the portlets layout for all the pages. So I added some variables in the XML that describes the theme and hardcoded the links there. At least I don’t have to change the theme code if we change any of those links.

About the portlets, we needed to write a portlet that pulls the content from an external service via REST calls and render it nicely using some kind of templates. These were the attempts I made and my conclusións:

  • Portlet written in Java: this was the obvious choice. The advantages was full access to Liferay API and easyness to integrate the portlet with the SDK stanrdard procedures. The disadvantages were, well, it has to be written in Java. We are far less productive in Java that with other languages. Just for making an HTTP request is quite involved. Hopefully Liferay has APIs for making this easier.
  • Portlet written in Javascript: This looked promising and was easy to setup, the problem was the importPackage and importClass functions were not available from the Rhino environment. This made Javascript just a toy language in Liferay since the language itself has no useful standard library and it needs to leverage the net or filesystem or any other calls to the runtime it runs on. This make javascript a very integrable language but also a very dependent language. If we can’t call Liferay API from Javascript and there are no network functions in the language itself we can’t use it for our purposes.
  • Portlet written in Python: Our last try was writting the portlet in Python. First we had to update the Jython jar that was included in Liferay since it was a little bit old. Then we added the jyson jar to the jython jar itself to have support for json parsing. We also used Liferay Network APIs since we couldn’t import urllib2 from Python. Finally we even managed to use the Python debugger (PDB) by running Tomcat in the foreground. (bin/catalina.sh run)

One important thing when writing portlets with a scripting language like Python or Javascript is that Liferay will concatenate all your modules into a single big file before running it in the scripting engine (jython or rhino, in our case). This is important to know when reading errors information where the line numbers is not always what we expect. In Python, we can avoid this behavior by changing the PYTHONPATH dinamically at runtime (at the beginning of our script) and then, importing our regular modules will work again.

PyCON 2011 (Part 3)

Thursday, March 17th, 2011

After the big conference days the sprints days started. I was surprised by how many people actually stayed for the sprints. There were literally docens of people hacking together grouped by projects. It’s amazing how passionate are some people about programming and how they enjoy sharing this with each other. That includes me, of course.

I’ve been at the PySAML2 sprint with Roland Hedberg and a couple of guys from Zeomega: Baiju M and Chris Austin. It has been a real pleasure to work with this gang. During the nights I hanged out with them and also Brad Allen and other guys from the Texas Python group.

Roland teaching SAML to the Zeomega guys

We managed to clean a lot of stuff at PySAML2, to release a new version, to improve the djangosaml2 package and to start making a Zope2 product for it.

Baiju and me are sprinting, don't you see?

One of these nights we went to a place where there were some good jazz music live. Ireally enjoyed the food, the music and the company of Chris and Baiju.

Today I did some tourism with Baiju and we went to the Atlanta Aquarium and the museum about Coca Cola. I did knew Baiju before since I translated his great book about the Zope Component Architecture but I never meet him in real life. He is a very good developer but also a really nice person. I’m glad I got to spend some time with him.

I’ve also meet other people here at PyCON. Here is just a brief list, sorry if I miss somebody:

  • Jeff Rush, a consultant and Zope lover. Very nice guy.
  • Laurens Van Houtven, my roommate and a cool guy that hacks on the Twisted project and has different slepping habbits than me :-)
  • Sylvia Candelaria, a very smart lady who knows about free software, linguistics, Spain, India and a whole lotta more things. I just talked to her during a lunch but she just blowed my mind with her wisdom.
  • Ralph Bean, a guy who was working on an open goverment website during the sprints. He was interested on my work on SAML stuff
  • Luke Macken, a Fedora hacker
  • Jordan Sissel, a guy who works for logglya nice service about logging with very cool stickers.

Other people I met but I can’t recall their names include people from bitbucket, from eldarion, from linode, and many more!

Well, I guess that’s all I have to say about PyCON 2011 but I’m probably forgetting lots of things since it has been a very exciting week for me. I hope I can make it next year at Santa Clara!

PyCON 2011 (Part 2)

Thursday, March 17th, 2011

It was 8am and I was ready for more talks!

The second day of the PyCON conference started with a talk by the Dropbox guys. The first half of it was not really interesting but things go better on the second half when they started to explain the technical bits. Then Guido was interviewed and answered some questions that the community had elaborated for him. One of the things he said is that Python 3 is closer than you think. I can tell he is right since many sprints at PyCON were about porting existing libraries to Python 3 and there is a general momentum going in that direction. Then they gave him a big cake representing the 20th birthday of the language.

PyCON moment where Guido is given a big cake representing the 20th python birthday

Then I learned about the new Selenium 2 and that it doesn’t need the ugly selenium-remote-control if you just run it on your own machine so that becomes much easier to use. The speaker was showing how to write tests using the python client library and it looked very very good.

After that talk I went to the zc.buildout talk where Jim Fulton explained how they deploy python projects based on buildout on Redhat based systems. Something very similar to what we do at Yaco. On the reasons they do this is because Zope Corporation hosts their own applications so their sysadmin department and their development department need to play well with each other. He explained how the have two different buidouts for each application: one for the application itself and a different one for its configuration. You can read more about his great talk at http://www.riversnake.com/pycon2011/full/ or, if you are in a hurry, just check out his slides

Jim Fulton speaking about zc.buildout

Then I went to the talk Alex Martelli gave: API design anti-patterns. and these are some of the things I learned:

  • You better have a API for your software because you are going to need it sooner or later. Otherwise programmers are going to start using your applications in very nasty ways you can’t even predict.
  • APIs don’t just grow up magically, you have to deeply thing about them. It’s harder to change an API than to change the user interface of your software because the consumers of the former (programms) are so much less flexible than the consumers of the later (humans)
  • A good way to design an API is to use it by yourself in your own software. This forces you to think what’s the main thing that my program does and what the absolute minimum amount of features that should go into the core. I believe we are doing the right thing here in Merengue :-)

After that, I went to the talk about http libraries in Python. It was given by a Mercurial guy who did a very good analysis of how bad all Python http libraries are except for pycurl, which is very difficult to use. That’s why he wrote his own library for this job and I think it is very good if you need some advanced http features and a very fast library.

To finish the day I went to Tarek’s talk bout distutils 2 and I listened exceited about the state of this project and how it is going to make our lifes so much easier. Distutils 2 is going to be part of Python 3.2 and you will be able to use it as a separated module starting with Python 2.4! There are only two problems to be solved: it is not finished yet (this is easy, just help him!) and it won’t support all the things that setuptools does, like entry_points among other things. We will need some other library for this since there a bunch of us that uses these features. By they way, I’m the one that ask Tarek about entry_points at the end of his talk. I agree with him that they should not be part of distutils2 but that does not solves the problem. We need a full replacement!

Tarek is the man behind distutils2

That afternoon I went to an open space to talk about the future of the Zope community. After that I got to go for dinner with the Zope guys to a nice mediterranean restaurant. I was invited by Zeomega company and I enjoyed the dinner a lot. I’ve been reading and following some of these guys for a long time and it was very cool to talk to them face to face. By the way, I talked with Jim Fulton about Spain since he has been there recently and he liked it a lot.

happiness = getMultiAdapter(zope, dinner)

Next day there were some more nice talks. One guy from Threadless gave a very funny talk. Unfortunately my english is still not that good and I didn’t get all the jokes. After that the people from Disqus gave a very interesting talk about their product and how they did it using python tools: celery (for asynchronous tasks), graphite (for monitoring), senty (for exception monitoring), coverage.py, pep8, pyflakes and may more. The only thing they didn’t like about Python is the current state of packaging, which I have to agree with.

After that I went to see the co-routines talk but I didn’t quite understand them yet. I’ll need some more reading because it looks like they are getting pretty big nowadays.

To end the conference days there was the poster session. I have to admit I didn’t have big expectations on this but I also have to admin that I was nicely surprised. There were lots of good posters and I discovered a bunch of really interesting projects:

  • askbot.org , a stackoverflow clone written in Python
  • Allura , the code behind Sourceforge
  • Fudge, which is very cool for mock testing. For example if you need to test a software that makes http connections but you don’t really want to make them for testing. It’s monkey patching done right.
  • Open States , and open goverment initiative
  • There was a guy with a wheel chair doing some astonishing job with a kinect device. Sorry I don’t remember the name of his project :-(

You would not believe what this guy just did with a kinect and a lot of courage

By the way, PyCON does a marvelous job by recording all the talks and puting them online. So, in case you couldn’t come, just watch the  talks They are worthy!

PyCON 2011 (Part 1)

Thursday, March 17th, 2011

This has been my first PyCON and I have to say it has been loads of fun. I’ve also learned a lot and meet some very nice guys. In a way or another now I feel like I’am part of a community I was an outsider before.

I arrived to Atlanta last Wednesday and I was impressed of how big the Hyatt hotel was. Almost like a small city on its own.

This short video shows how huge this hotel is. It’s filmed from the 12th floor

I’m not used to this kind of hotels so I really enjoyed details like the elevators or the huge lobby :-) As I arrived quite late due to some issues about getting out of the gigantic airport the only thing I did that night was having dinner in the Hard Rock Cafe a couuple of blocks next to the hotel.

That's a bunch of floors!

But, anyway, next day I attended to a couple of tutorials, one about Django deployment which was really good and another one about python 3 differences with respect to python 2 which was pretty interesting too.

The Django tutorial is about to start

Then next day (friday) the conference started. Very early in the morning my mind was blown away when I saw how many people there were in the keynote.

Look of the huge room where the PyCon 2011 keynote will take place

This video was shot 10 minutes before the keynote started. During the keynote there was not a single free seat.

The room was pretty big and it was full! Luckily Hilary Mason (bit.ly scientist) did a fantastic job and her talk was really interesting and inspiring. I liked how passionated did she talk about programming and that she believes that programming changes your internal brain structure so you think differently from other non programmers when approaching life’s problems. For good or for bad I think she’s right.

Then I went to a talk about distributed tasks with Celery because I though it was given by Celery author. But it was about how a photographer’s website used Celery to have success. It was nice but not what I expected. Then I moved into “Javascript for people who known Python” by Ian Bicking and it was a good talk, quite fast but good since I knew some of the stuff he was talking about. Even so, I learned a bit. After that talk I went to the “State of pylons/turbogears/repoze” talk and that was just a sneaky title to present the new big thing: Pyramid. I really believe this is going to be a web framework to follow since it has inherited a big community and it has very well written and tested code and documentation. And by the way, the t-shirt is awesome :-)

Later that day I attended to another not so exciting talk like “The development of python and you”. Then I went to couple of talks that I really enjoyed and would say were maybe the best talks of PyCON: “Pluggable Django Patterns” and “Reverse engineering Ian Bicking’s brain”. The first one explained how to write your Django application so others (or even you in another project) can reuse it seamlessly. You should look the talk by yourself because it has tons of little gems. Then the other talk was about understanding how virtualenv and pip (tools maed by Ian Bicking) works and was really really good. One of the things I discovered in this talk is the way pip can install regular distutils projects is by monkey patching their setup.py file or that at the end, pip’s core is just a hack around setuptools :-)

Then I moved into the PyPy talk which was quite boring to me and finally the lighting talks. Some were better than another but I specially liked the one about Qtile, a tiled window manager written in Python. The guy speaking was just hilarious.

I forgot to menion that I meet some old friends this day like Guilherme Salgado (from my days at Async) and John Ehresman, from Wingware. It was really nice to see them again and hear that they are doing pretty well.

The guy on the left is freaking awesome

As this post is already quite long I talk more about my PyCON experiences in a following post.

Conexión a internet desde un móvil Nokia 6234 con Simyo

Sunday, December 14th, 2008

Tras un par de intentos fallidos de conectarme a Internet desde mi móvil con mi nuevo proveedor he conseguido que funcione.

Nokia 6234

Nokia 6234

A continuación escribo las opciones que he tenido que configurar en el móvil para conseguirlo. Espero que la nomenclatura se entienda.

Configuración: Configuración: Ajustes config. personal: Opciones: Añadir nuevo: Internet

  Nombre de cuenta: Internet Simyo
  Página de inicio: http://www.google.com
  Nombre de usuario:
  Contraseña:
  Usar pto. acceso preferido: No
  Conf. de punto de acceso:

    Proxy: Activado
    Dirección de proxy: 217.18.32.181
    Puerto de proxy: 8080
    Portador de datos: Paquetes de datos
    Configuración portador:

      Pto. acceso paquts. datos: gprs-service.com
      Tipo de red: IPv4
      Tipo de autentificación: Normal
      Nombre de usuario:
      Contraseña: 

Internet: Configuración: Ajustes de configuración:

  Configuración: Configuración personal
  Cuenta: Internet Simyo
  Mostrar ventana terminal: No

Para el que esté pensando que eso de internet desde un móvil normalito no tiene mucho sentido pues sí y no. Está claro que cualquier parecido entre navegar con un ordenador y un móvil como el mío es pura coincidencia, pero eso no quiere decir que la posibilidad de ver tu correo en Gmail desde tu móvil no sea útil o también, la posibilidad de sincronizar tus contactos entre el móvil, el ordenador, tu cuenta google, etc. usando servicios como scheduleworld.com

Las tarifas de mi proveedor las podeis consultar en su web y la verdad es que me parecen bastante razonables. Por ahora estoy contento con Simyo no sólo por que me resulta más barato que mi anterior proveedor, si no porque es infinitamente más transparente y claro que los demás y al menos tienes la sensación de que estás pagando por lo que usas, no por lo que ellos quieren.

El siguiente paso ha sido conectar mi Nokia N800 al teléfono vía Bluetooth y usar la conexión a internet del teléfono para navegar desde el otro cacharro. Esto ya se va pareciendo mucho más a navegar a la vieja usanza gracias a la pantalla de 800 pixeles de ancho que tiene el N800.

Nokia N800

Nokia N800

Si mi portátil tuviera Bluetooth, también podría conectarme a internet desde cualquier sitio, pero fui tan listo al comprarlo que desactive esa opción pensando que nunca la usaría. Ahora puedo pedir esa ampliación e instalarla yo mismo o comprar un pequeño dongle usb y hacer lo mismo.