Sunday, 7 May 2017

Serenity with a twist

It´s been a while since I last went for a photowalk. Yesterday a couple of colleagues and I spent two hours walking from Treptower Park to the East Side Gallery. When we were about to go home I saw this guy reading and asked him if I could take a photo, which he agreed to.

After I took the photo he asked me if I was going to post it somewhere so I came closer to give the address of this blog, and then I noticed that he had his mobile on top of the open book!

Saturday, 15 April 2017

Serenity in CoderDojo

Last photo was about starting a book and this one shows one almost finished. I guess serenity and serendipity are not that far away.

Sunday, 9 April 2017

Españoles en Alemania: Berlín, barrio a barrio - Datos de 2016

Esta entrada es una actualización de esta otra con los datos de diciembre de 2016

El servicio estadístico de Berlin-Brandenburg tiene datos muy detallados de los residentes, por ejemplo los españoles residentes en cada barrio e, incluso, casi calle a calle (los datos están divididos en unas 450 zonas, incluso más detallado que por el código postal. Creo que estos datos no incluyen a los que tienen la doble nacionalidad, que posiblemente aparecen como alemanes.

Datos de diciembre de 2014 Datos de diciembre de 2016 Diferencia
Charlottenburg-Wilmersdorf 1690 1664 -26
Friedrichshain-Kreuzberg 2869 2732 -137
Lichtenberg 356 457 101
Marzahn-Hellersdorf 101 153 52
Mitte 2694 2929 235
Neukölln 1658 1523 -135
Pankow 1866 1865 -1
Reinickendorf 304 365 61
Spandau 254 304 50
Steglitz-Zehlendorf 713 676 -37
Tempelhof-Schöneberg 1018 1158 140
Treptow-Köpenick 244 320 76
Grand Total 13767 14146 379

He creado un mapa interactivo, así que pinchando en cada círculo aparecen los cuatro niveles organizativos en los que están disponibles los datos y el número de españoles inscritos en diciembre de 2014 y diciembre de 2016 (este número no es el número de inscritos en el consulado, sino en el registro alemán).

Sunday, 19 March 2017

Geeky Father's Day

Today is Father´s Day in Spain, so I gave myself a mini present, a new free app. The twist is that I have programmed the app myself using MIT App Inventor. Ok, not really programmed anything, but I put together a few blocks and made sure the logic holds.I started with this tutorial and it delivers what it says.
The main screen has a few buttons and when one of them is pressed a time stamp is created in a database. The set up page makes it possible to give names to each button (names not shown above) and a user name, so you can keep track of several preset items without always having to change the name of the button first. The nice thing is that data persistence is possible for multiple users as timestamp data is not stored locally in the phone but in the cloud, more specifically in a fusion table. This means each user can log whatever is relevant for them, things like times arriving to and leaving from work, starting and finishing homework, time jogging, etc. Names are locally stored for each user in his/her phone.
Surely there are thousands of apps which do this better, but the fun is learning how to do it yourself and exploring what else could be done. There is no point telling our children to think of the phone as a handheld computer if we don´t apply the same principle to ourselves.
The next step would be to use the same layout and the bluetooth connectivity module to link this to a raspberry pi driving a couple of motors. More TK...

Friday, 17 March 2017


Lo que me llamó la atención de esta decrépita puerta en la calle de la Trinidad en Alcalá fue que tuviera iniciales (supongo que de los dueños). Además, hizo que me acordara de esta otra puerta que fotografié hace ya varios años.

Friday, 24 February 2017

Hash Code 2017

I participated yesterday in a team coding competition, Hash Code 2017. Teams were 2 to 4 people and, rather conveniently, it was possible to participate online (although it would have probably been a bit more fun to attend a nearby hub). I asked a few guys at work, but they all were busy for different reasons. In the end, I teamed up with an ex-colleague who does not even live in Berlin and decided that remote collaboration with Google Drive and Skype would have to be ok. However, a couple of minutes into the challenge, he got a work related call and had to drop the challenge. I don´t think he even finished reading it!

I decided to press on alone and spent the next four hours trying not to end with a blank score. The challenge was about optimizing cache servers for YouTube. Cache servers are constrained by size but offer smaller latency times than far away data servers. The question is which videos to store in each cache server based on expected usage.
I started working on the code to read the data in and after that, I went to the chapter on optimization of my dearest Python book. I noticed today that I should have searched online for this (as rather predictable it was available in MITOCW), but I simply copied the code from the book and modified it to fit my input. In my case, for each cache server there is a loop going through all the requests and endpoints. With the knapsack problem model in mind, the value is the number of times a video is called times the latency saving, the weight is the size of the video and the constraint is the server size. Unfortunately I did not do any early submissions to check which option would give me a better score (value, weight or density). I went for density but I just checked now and I should have gone for value (that alone would have given me an extra hundred positions in the scoreboard, i.e. out of the very deep bottom up into the deep bottom). Whatever, by the time I was there I was at least happy to have something to submit. My computer slowly cranked up through the next problem set, but I had not had time to do any data exploration, so I pretty much blindly fed it into the algorithm. With a bigger team, I think we could have explored other options. Maybe next time. The computer somehow managed to finish the second problem set (out of four) at 22:29 but I could not make it to the submission as the deadline was at 22:30!. Final rush but unlike in the films, I missed it by a couple of seconds.

The chart below shows endpoints to the left and cache servers and data center to the right. As it can be seen, the algorithm I used did not really capture well many of the videos requested and three cache servers did not even get populated (they actually did but the list of videos was duplicated with other servers linked to the same endpoints, as this kind of finesse was not considered in my code). All in all, with a bit more time, there are a couple of tweaks which I could have done for a better solution, but the challenge was never meant for a single person!

So, summary line, really good fun and a lot left to learn!

Friday, 3 February 2017

Aulas de Lengua y Cultura Españolas 2017

Las Aulas de Lengua y Cultura Españolas ofrecen clases complementarias de lengua materna a aquellos alumnos cuya nacionalidad o la de sus padres es o haya sido la española. Para el curso 2017-2018 el plazo de matrícula es del 6 de febrero al 24 de marzo de 2017 (la fecha límite se ha adelantado comparada con la del año pasado).

Toda la información se puede obtener aquí. Al igual que en años pasados (2015 y 2016) he hecho un mapa interactivo con la lista de escuelas. De nuevo, varias escuelas han cambiado de ubicación y algunas han desaparecido. Sin embargo hay aulas nuevas en ciudades donde antes no había, como la de Leipzig.

Es importante difundir lo más posible los plazos de matrícula, y recordad que puede abrirse una nueva aula a partir de 14 inscripciones. Los detalles están en el Artículo 18 del BOE-A-2010-18555

La distribución de las aulas, lógicamente, está relacionada con la presencia de españoles en Alemania.

Saturday, 28 January 2017

Against all odds

I spent more time than I would have liked to in several airports last week. Paper books are quickly becoming a rarity. And people reading on electronic devices don´t seem to show the same level of concentration. Right after I took this photo, another lady took the empty seat next to me. She was reading something on her iPad and, at short intervals, having a whatsapp conversation. Not quite the same.