Install MySQLdb for Python 2.x

If you want to install MySQLdb for Python 2.x, without using the package manager of your Linux distro (Ubuntu in our case), you can do it through pip like this: First you must to have installed libmysqlclient-dev (and, of course pip) [source language=”bash”] sudo apt-get install libmysqlclient-dev [/source] After that execute this two commands: [source… Continue reading Install MySQLdb for Python 2.x

Load bundle without composer.json in Symfony2.3

This is how I loaded a legacy budle without composer.json in a custom location for my Symfony2.3 project with composer. In one of my Symfony2.3 projects I needed to use an old external bundle. This legacy bundle (from Symfony2.0) hasn’t a composer.json file and in my case I can not add one. Anyway, I wanted… Continue reading Load bundle without composer.json in Symfony2.3

Tip: List vs. Set in Python

In Python, if you have a “list” with a lot of members and you need to do many membership checks, it will be better to use a “set” instead, because the checks are linear for lists and constant for sets.