Archive for the ‘programming’ Category

Goodbye WordPress, welcome Jekyll

26 January 2014 1 comment

Blog moved to:

I started this blog a couple of years ago to share my thoughts, ideas and projects. At that time is was using Mercurial on Google code for some software projects but I was not really using version control systems for my day to day work.

When I switched to Git (Github & Bitbucket) about two years ago, I got more and more used to text based document formatting, trying to avoid bloated GUIs when possible.

Currently, I am using LaTeX to write presentations, reports and articles. I like the text based approach because this allows you to focus on the content and not on the layout.

The last GUI that I was using for my personal content was WordPress. In my search for a decent replacement I found Jekyll, a simple, blog-aware, static site generator written in Ruby.

How it works:

  1. You write a website skeleton and define some settings. This is similar to the LaTeX approach where you select some packages and define some settings up front.
  2. You write your content locally using Markdown formatting and commit it to a git repository. When adding content later on this is the only thing that you have to do.
  3. The server runs some ruby code to generate a static website based on your content (you can also run the same generator locally)
  4. The website is hosted for free on the Github servers

All my future posts will be located at my new Jekyll-based website and this blog will stay here in “archive mode”.


LaTeX Handouts Builder (Python version)

22 August 2013 1 comment

This tool can be used to build “course handout books” using multiple LaTeX beamer slides sets.

I have been using a Bash script with almost the same functionality for a long time. Some background information on this old script can be found in this blog post.

Book structure:

  • Title page, introduction, table of contents
  • One chapter per slide set (three printer-friendly versions: no slides transitions &  less colors)

Example .zip output

How it works:

  • Just run one program: “python”
  • The program starts building all the LaTeX beamer slides.
  • The output is converted to the printer-friendly formats.
  • All documents are merged in the master handouts book.
  • Create a ZIP archive with all the documents

Code and examples available at GitHub.

Playing with generative algorithms

I recently found a small software project while cleaning up some old folders on my PC. The program uses the concept of evolution from biology to solve simple “problems”.

I wrote this code while reading the book The Selfish Gene by Richard Dawkins. Somewhere in that book, the author ask the reader to write their own simulator and I was crazy enough to actually do that…

It was after programming this application and reading several of his books that I decided to start my studies in environmental sciences at the open university in the Netherlands.

Program flow:

  • Enter a ‘secret key’
  • Generate a random string (parent)
  • Generate 1000 strings based on the parent (with minor mutations)
  • Select the child that is closest to the ‘secret key’ (lowest ‘Deltasum’ or the ‘fittest’)
  • This child becomes the parent for the next generation
  • Go back to step 3 until the secret key is found

Code available on GitHub.