27 dicembre 2015

Lo zen di Python

Che succede se si prova ad importare in una console Python "this"? Beh, si ottiene una preziosa lezione di vita...
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

19 luglio 2015

Mitici anni 80 con Kung Fury

Non so se l'intento fosse criticare tutti gli stereotipi dei film degli anni 80 oppure rendere un omaggio a tutto tondo, ma trovo questa opera di David Sandberg  una esempio lampante di quanto con un po' di inventiva si possano realizzare delle gemme assolute, ovviamente di gusto discutibile, ma che trovo innegabilmente divertenti.


16 giugno 2015

Metallica

Sono un grande appassionato di basket, anzi di NBA per l'esattezza, e di musica, anzi di rock per l'esattezza, e ritrovarmi i Metallica a suonare l'inno prima di gara 5 delle finali 2015 è stato davvero sorprendente e piacevole al tempo stesso, anche considerando la deriva artistica che ci opprime.


11 febbraio 2015

Pip install lxml error

This is the error, under virtualenv or not, that occurred when I tried to install lxml:

/home/virtual/first/build/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: Fil o directory not found

compilation terminated.

error: command 'gcc' failed with exit status 1

The solution is simple. Before trying to install the package, install:

apt-get install libxml2-dev
apt-get install libxslt1-dev
apt-get install python-devel

Simple, clear and it works very goooooood....

Tondo è bello...

Tondo è bello...