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.