Friday 31 December 2021

Most likes in instagram

Almost one year posting a photo each day. Quite surprisingly for me, these are the twelve ones which got the most likes (from top left to bottom right).





Sunday 19 December 2021

Calendar puzzle (ii)

In the end I went for the brute force approach, ie the not so elegant approach. It took me a while to write and debug the code but eventually I got there and found thousands and thousands of solutions (in fact I assume I found them all). Once I somewhat tidy the code up I will post it in github. Today I spent some time figuring out how to plot the calendar, learning about colour maps, grids, etc. As usual, python has you covered! People who have created and contributed to libraries such as numpy and matplotlib definitely deserve a lot of credit.

Since it makes no sense to publish here a daily puzzle I have created a twitter account for the Calendar, so that I can create a bot which tweets a solution every day (or if I feel even more adventurous and I have time, maybe posting a hint and then a few hours later the solution?). I read this great post from Miguel García and so far so good as I already managed to post something from a script after fumbling my way through Twitter´s Development Portal.

Not quite sure yet where to run the bot. One option would be to set up a raspberry pi, another one would be to explore pythonanywhere which I already used to host the tute app. We´ll see.

PS1: It will be in pythonanywhere, whose free tier allows to run one scheduled task per day (!), which is enough for this. It should run each day at 8am. Let´s see.

PS2: It works! :-) Code in a semi tidy state available in GitHub 





Solutions for today, who would have thought that there are so many ways to solve this puzzle?







Monday 13 December 2021

Calendar puzzle

This year I am participating again on Advent of Code. So far, so good, let´s see how many stars I manage to get in the end. However this post is not about AoC, but about another puzzle I came across.

It´s a calendar with eight pieces that can hide months and days on table below, so the remaining cells show the date. Apparently you can find a combination for each day of the year (rotating and flipping pieces is allowed). However brute forcing won´t work. I calculated the amount of different positions and it´s a lot of combinations. Looking at the pieces below, there are 96 different ways in which you can place piece A, 98 for B, 82 for C, 154 for D, 151 for E, 80 for F, 196 for G and 154 for H (pieces with simmetries have less possible locations).

So brute forcing this problem would require to loop through each of the 98 positions possible for A, for each one then loop over whatever positions are still possible from the original 82 for B, etc, etc. 

I will give it a try but I wonder if there is a more elegant approach. Hints are welcome.








Saturday 13 November 2021

Recursos Aulas de Lengua y Cultura Españolas

Como dice Molinos, lo bueno de tener un blog es que puedes escribir lo que quieras, por ejemplo una lista de recursos relacionados con las Aulas de Lengua y Cultura Españolas

Pruebas de nivel (models para practicar)

Orden que regula las ALCE

Aula Internacional

ALCES Alemania

Mapa de ALCES en Alemania


Monday 8 November 2021

Timelines

A couple of weeks ago I uploaded to my github account a script I have been using lately to create timelines. It´s not super polished but it is good enough. I also noticed over the Fall holidays that I miss coding. I cannot wait until December starts, ie Advent of Code is around the corner...





Saturday 6 November 2021

One photo every day

I have been posting one photo every day on my Instagram account since Jan 22nd. Some had been posted here, some not.



Sunday 26 September 2021

How it started

Nine years ago I received the message below, which would spark a spiral of learning in the coming years and eventually change my career, although I didn't know that at the time.



6.00x Course Team noreply@edx.org via mail50.us1.rsgsv.net 

Sep 26, 2012, 7:47 PM

to me

 

Dear Juan Carlos Cabrejas,

Welcome to 6.00x: Introduction to Computer Science and Programming! When the course begins on Monday (10/1), you will be joining tens of thousands of other students from around the world in MIT's newest online course. In addition to learning the basics of computer programming in Python, and the fundamentals of computation, you will get hands-on experience implementing a variety of Python programs and using powerful Python libraries.

The course website is available starting today! We invite you to visit

https://www.edx.org/courses/MITx/6.00x/2012_Fall/about

Click on the "View Courseware" link to gain access to the course syllabus, calendar and other materials. Starting on October 1, there will be new lecture videos and homework assignments posted every Monday at 10:00 AM EST. There will be two midterm exams and one final exam; you can find more information about these by visiting the course website.

Our primary communication channel will be the website’s interactive forum, where students and staff will get to contribute to an ongoing discussion of the material. The forum will go live next Monday at 10:00 AM EST. Meanwhile, you can familiarize yourself with the guidelines for the discussion forum by visiting the course webpage.


We look forward to a great semester with you!

Eric, John, Chris and the 6.00x Course Team


Is this email not displaying correctly? View it in your browser.

Unsubscribe | Privacy Policy

Copyright © 2012 edX. Some rights reserved.

edX, 11 Cambridge Center, Suite 101, Cambridge, MA 02142


Sunday 12 September 2021

20 años en Berlín

Tal día como hoy hace 20 años llegué a Berlín en un vuelo desde Birmingham. Por razones obvias, es muy fácil acordarse de la fecha y creo que en el aeropuerto nos miraron hasta las muelas debido al shock del ataque el día anterior, así que posiblemente fue el vuelo más seguro que he hecho en mi vida. Además muchísima gente canceló el billete con lo que el vuelo iba casi vacío. 

No tengo ninguna foto de ese día, pero sí que guardo el billete, que curiosamente era de ida y vuelta porque era más barato que solo ida. Lo que iban a ser un par de años al final se fue alargando, lo cual es siempre buena señal, y así hasta hoy. A ver que pasa en los siguientes 20 años.

Wednesday 18 August 2021

Reminiscing about Moscow

Hoy hace 25 años (que se dice pronto) de mi vuelta a España después de pasar seis semanas en Moscú haciendo unas prácticas de verano en el Moscow Aviation Institute a través de IAESTE. Aunque el rendimiento académico de esas semanas fue más bien escueto, guardo muy buen recuerdo por todo lo demás, en particular el grupo de gente de varios países que nos juntamos. Muchos años más tarde una chica griega de ese grupito vino a Berlín a casa de visita y todavía hoy seguimos en contacto, y yo estuve en las bodas de otras dos, una chica rusa en Madrid y otra suiza en St Gallen

Aunque hice unas cuantas fotos, ni por asomo todas las que habría hecho hoy. Y de la calidad de la cámara y de las fotos, mejor hablamos otro día. Que pena no haber tenido un smartphone entonces para también hacer un par de videos, como cuando los payasos nos sacaron a un chico egipcio y a mí a la pista para ser el blanco de sus bromas. Pero por entonces no tenía ni siquiera teléfono :-)

Por cierto, en inglés hay una palabra que significa disfrutar de un recuerdo agradable de eventos pasados (reminiscing, indulge in enjoyable recollection of past events).





Sunday 8 August 2021

Rotspanier

Aprovechando esta semana de vacaciones en casa, hemos visitado Rotspanier, un exposición itinerante sobre los refugiados españoles que acabaron en campos de concentración, que se puede visitar de forma gratuita en Berlín hasta finales de octubre. Fuimos entre semana y por la mañana y tuvimos la suerte de tener la exposición entera para nosotros solos, un lujo en estos tiempos que corren. Altamente recomendable.



Sunday 23 May 2021

Academia Hacker


El Instituto Nacional de Ciberseguridad ha organizado la Academia Hacker, una iniciativa para fomentar el aprendizaje en ciberseguridad. Es una actividad en la que durante ocho semanas los equipos se enfrentan a cinco retos cada semana en diferentes temas, tales como criptografía, ingeniería inversa, esteganografía, programación, etc.

Después de tres semanas, la verdad es que el balance es muy positivo, porque nos ha forzado a mirar temas y herramientas que de otra manera no habríamos tocado. Aunque solo sea arañar la superficie, es divertido sentirte hacker por un rato (by the way, white hat). Algunas herramientas que hemos usado por ahora son VirtualBoxKali LinuxCyberchefWiresharkJohn the Ripperradare2gdbIDA y una verdadera gema, el Z3 Theorem solver. Algunas ya las conocía, pero otras no.

Por ahora hemos conseguido resolver casi todos los retos, aunque supongo que cuando empiecen a subir de dificultad la cosa cambiará. Lo bueno es que al final de cada semana publican un vídeo con la forma de resolverlo. Más oportunidades para aprender (!)

----

Al final quedamos en el puesto ~75. Había 1000 equipos inscritos, y aunque luego no todos participaron, no está nada mal para un par de novatillos pasando el rato ;-)

Saturday 8 May 2021

Mapa de españoles en Alemania (2020)

 


If you have some time, it is relatively straight forward to combine data sources and create the map above, which combines geometry and population information at the county level (Kreise) from open sources. Total population iaw Destatis is just above 180k.

Geometry: This dataset from Bundesamt für Kartographie und Geodäsie with Data licence Germany – attribution – Version 2.0

Population; Destatis - Statistisches Bundesamt with Data licence Germany – attribution – Version 2.0

Code adapted from this example with postal code areas from Dr. Juan Camilo Orduz.



As reference, same map in 2001 (note the huge difference in scale!) with total population just below 130k.





Wednesday 7 April 2021

Online "tute"





Did it ever happen to you that you bought a book with the best of intentions and then you never find time to read it? Well, that was me with this book, which you can also read for free in Miguel Grinberg´s famous flask mega tutorial. At some point I went through several chapters but never really put together my own app, or deployed it somewhere.

For me the problem with tutorials is how to get really engaged. In terms of learning experience, there is a big difference between just following steps and actually trying to create something else by yourself (even if still mostly based on the tutorial steps). Because once it is your own persoanl project, you are automatically engaged. My CoderDojo is still paused because of COVID, but something I used to recommend to children (and parents) was to find something that really interests you and then work your way through the problems. A lot of the learning happens when trying to solve a problem.

A few weeks ago, someone at work mentioned pythonanywhere, which gives you the opportunity to deploy an app easily. I just needed an idea. And I had it over Easter. My father and my son often play tute when we are in Spain. However last time we were there was Christmas of previous year, so I had the idea to make an app to play tute. Oh, I hear you say, but there are plenty of web pages which already allow you to play and are way better than anything you can hack in a few days. Yes, but you don´t learn a lot playing with other people´s apps!

So after my very own (and short) Easter of Code, version 0.1 is up and running. We already played a game with my father this morning and it was a good laugh. Hope we do it now from time to time.

Things I have learned:

  • I didn´t really know all the rules of tute. Thanks to wikipedians!
  • I set up VS Code to debug flask apps.
  • SQLite is not great a choice when model changes, as dropping columns seems a bit of a pain when the model changes. I ended up restarting the database a couple of times.
  • Page reloads are good enough for us. Ajax or websockets would be better though, even more learning opportunities.
  • Know when to take a break. Impossible problems one day are magically solved in five minutes in the morning with a fresh head.
  • Styling matters. Thanks to my brother for advice.
Updated April 17th: Code available in GitHub

Friday 2 April 2021

Photos galore

So far, so good. I managed to post one photo each day in Instagram for the last 2 months.

Saturday 13 March 2021

Genealogy

A long time ago I started putting together a genealogy tree and, to be honest, I didn´t get very far. My wife compiled hers going back several more generations down to the late 18th century, including several photos of people who were born in the 19th century. My side is still work in progress and wihtout going that far back, it has already been a great excuse to talk about old photos and family lore. Of course one of the questions is where to stop such a tree. Should people who have a common great-granparent be listed? Or a great-great-grandparent? Why not? The chart below has close to 350 people and if all the people who share an ancestor would be added, I could imagine a couple more hundred would make it to the tree.

If you have tried this yourself, you are probably aware that a single spreadsheet will not cut it. Things begin to get out of hand rather quickly as the number of people and information grows. So pretty much from the get-go the question was which tool should I be using. I didn´t feel like using a commercial cloud-based service, and I quickly found Gramps, an open source gem (yet another one). On top if it, it is done with python which for me is always a plus, as I can peek in the inside. Feeling adventurous, I decided not to install the Windows version and instead install the linux version on the Ubuntu partition of WSL2 and I have to say, it works like a charm (thanks also to Moba Xterm!)

There are many ways to visualize the tree and, poking a bit, I found one which clearly delineates the families while putting my children in the center of the graph. I saved the relations graph as a gv file and then use that file to generate a png using the neato layout



 

Sunday 31 January 2021

Instagram

 


As the saying goes, practice makes you better, so I will be posting a photo each day in my Instagram account. Some are old photos borrowed from this blog, some are old photos developed with DarkTable and some are simply new photos.
Let´s see if I can do this for the next two months while still posting photos of reasonable quality.

Wednesday 27 January 2021

Learner story - featured in edx

I have been thinking for a while now about writing an article in LinkedIn about changing careers, and this could probably be the final trigger to do it. Really honoured to be featured in the front page of the edx blog page. And happy to help as well, which was the reason why I submitted the story in the first place. Just imagine someone is inspired by this to start learning something. How cool is that? 

You can read the mini article here and browse courses here, here, here or here to name just a few platforms.