Technical blog
Lire en françaisThese articles are mostly reminders about tips and tricks that once were useful to me (and may be useful again).
Change and retrieve shell environment in Python
Python is a very versatile language and it is generally speaking easing to interface it with other languages and also to interact with shell and the system. When you interact with your system, problem is a subshell is launched, meaning that all the environment modifications you may do will be lost and you cannot launch independent shell commands that are linked (through the environment). This problem was why I ask this Stackoverflow question, that I answered myself in the end.
Files generation in Python
It is fairly easy to generate text (therefore ASCII files, therefore source code) in Python using templates. I often see misuse of print to do so, whereas it seems much more elegant to use templates.
Class factory in Python
Class factories in Python are an elegant way to use design pattern in Python, or more simply said to define generic (or abstract) classes. The main advantage is to be able to decorrelate the objects you play with and their interface, being more flexible than simple inheritage.
On top of that, an elegant way to manipulate class factories is to use decorator. It is therefore an interesting way to apply some pythonic concepts not so easy to get.
awk reminder
To quickly and easily analyse files or outputs in bash, one can use the powerful awk.
Files and string manipulation reminder
One of the strength of Unix-like systems are files and strings manipulation that are pretty straightforward with no other softwares required. It is not always easy to remember all the useful commands, hence this reminder.
File system reminder
As I am not manipulating file system everyday, I tend to forget the useful commands, hence this reminder.
ImageMagick reminder
ImageMagick allows you to realise many tasks to modify or convert images. It is not always easy to remember all the fitting commands to use this Swiss army knife of image manipulation; hence this reminder.
Type and precision in Fortran
A reccurent problem that is unfortunately ignored by Fortran developers is floating point typing mechanism in Fortran. A lazy programer, or one who relies to much on her compiler, would probably declare and define her variable this way:
Deploy Nikola through FTP
Nikola is shiped with a simple deployment mechanism and the possibility to easily deploy with GitHub. However, I am currently hosting my personal pages on Free server; the service is free and great but with no possibility to use either SSH (and rsync) or Git. Therefore, the question of FTP deployment was raised for me.
Getting started with Nikola
My personal pages went through handcrafted HTML, handcrafted PHP, a good-but-too-heavy CMS; I was looking for something lighter to manage these pages. I almost started to use Django (by the way, Django girls are awesome to start with), but I finally opted for Nikola. It is nonetheless in Python but particularly light-weighted and increadibly easy to start with.