9 de agosto de 2011

Installing cairo and pycairo in Mac OS X with python 2.6



Mac OS X includes an old version of Cairo(usually 1.8.6) which is too old for new software to link against. For the installation of py2cairo to succeed, we need 1.8.10.

Let's check which version we have:

$ pkg-config --atleast-version=1.8.10 cairo
$ echo $?
1

That means there's no a version 1.8.10 or above of the 'cairo' lib.

Let's install it using Brew:

$ brew install cairo

Let's now check again:


$ pkg-config --atleast-version=1.8.10 cairo
$ echo $?
1

No luck again! Why? We need to tell the system where the recently installed version of cairo lives:

$  export PKG_CONFIG_PATH=
Note: In my case, the path is: /usr/local/Cellar/cairo/1.10.2/lib/pkgconfig/


Let's check again:

$  pkg-config --atleast-version=1.8.10 cairo
$ echo $?
0

Awesome!

Let's now install py2cairo, the Python binding for cairo:

1. Download this.
2. Uncompress, go inside the directory.
3. Run the following command, expecting an output like the depicted below:

$ ./waf configure
  ./set_options
  ./init
  ./configure
Checking for program gcc or cc           : /usr/bin/gcc
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for gcc                         : ok 
Checking for program python              : /Users/matias/Dev/CPI/Env/bin/python
Checking for Python version >= 2.6.0     : ok 2.6.1
Checking for library python2.6           : yes
Checking for program python2.6-config    : /usr/local/bin/python2.6-config
Checking for header Python.h             : yes
Checking for cairo >= 1.8.10             : yes
'configure' finished successfully (0.416s)
  ./shutdown

4. Now build:

$ ./waf build

5. Install:

$ ./waf install
6. Update your PYTHONPATH(you may want to add this line at the bottom of your ~/.profile):

export PYTHONPATH=/usr/local/lib/python2.6/site-packages/:$PYTHONPATH 

7. Check everything worked:

$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>> cairo.version
'1.8.10'
 Happiness!

 

FYI: The output of the configure, build and install commands in my case was the following(I include it for reference, in case it might be of any help):

(Env)matias@[13:51:34]:pycairo-1.8.10 $ ./waf configure  ./set_options
  ./init
  ./configure
Checking for program gcc or cc           : /usr/bin/gcc
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for gcc                         : ok 
Checking for program python              : /Users/matias/Dev/CPI/Env/bin/python
Checking for Python version >= 2.6.0     : ok 2.6.1
Checking for library python2.6           : yes
Checking for program python2.6-config    : /usr/local/bin/python2.6-config
Checking for header Python.h             : yes
Checking for cairo >= 1.8.10             : yes
'configure' finished successfully (0.416s)
  ./shutdown
(Env)matias@[13:52:07]:pycairo-1.8.10 $ ./waf build
  ./set_options
  ./init
Waf: Entering directory `/Users/matias/Dev/CPI/Stuff/pycairo-build'
  ./build
  src/build
[1/9] cc: src/cairomodule.c -> ../pycairo-build/default/src/cairomodule_2.o
[2/9] cc: src/context.c -> ../pycairo-build/default/src/context_2.o
[3/9] cc: src/font.c -> ../pycairo-build/default/src/font_2.o
[4/9] cc: src/path.c -> ../pycairo-build/default/src/path_2.o
[5/9] cc: src/pattern.c -> ../pycairo-build/default/src/pattern_2.o
[6/9] cc: src/matrix.c -> ../pycairo-build/default/src/matrix_2.o
[7/9] cc: src/surface.c -> ../pycairo-build/default/src/surface_2.o
[8/9] copy: pycairo.pc.in -> ../pycairo-build/default/pycairo.pc
In file included from /usr/X11/include/X11/Xlib.h:64,
                 from /usr/local/Cellar/cairo/1.10.2/include/cairo/cairo-xlib.h:44,
                 from ../pycairo-1.8.10/src/surface.c:1360:
/usr/X11/include/X11/Xosdefs.h:145:1: warning: "_DARWIN_C_SOURCE" redefined
In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:8,
                 from ../pycairo-1.8.10/src/surface.c:32:
/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h:1075:1: warning: this is the location of the previous definition
[9/9] cc_link: ../pycairo-build/default/src/cairomodule_2.o ../pycairo-build/default/src/context_2.o ../pycairo-build/default/src/font_2.o ../pycairo-build/default/src/path_2.o ../pycairo-build/default/src/pattern_2.o ../pycairo-build/default/src/matrix_2.o ../pycairo-build/default/src/surface_2.o -> ../pycairo-build/default/src/_cairo.so
Waf: Leaving directory `/Users/matias/Dev/CPI/Stuff/pycairo-build'
'build' finished successfully (0.764s)
  ./shutdown
(Env)matias@[14:05:51]:pycairo-1.8.10 $ ./waf install
  ./set_options
  ./init
Waf: Entering directory `/Users/matias/Dev/CPI/Stuff/pycairo-build'
  ./build
  src/build
* installing src/pycairo.h as /usr/local/include/pycairo/pycairo.h
* installing /Users/matias/Dev/CPI/Stuff/pycairo-build/default/src/_cairo.so as /usr/local/lib/python2.6/site-packages/cairo/_cairo.so
* installing /Users/matias/Dev/CPI/Stuff/pycairo-build/default/pycairo.pc as /usr/local/lib/pkgconfig/pycairo.pc
Waf: Leaving directory `/Users/matias/Dev/CPI/Stuff/pycairo-build'
* installing src/__init__.py as /usr/local/lib/python2.6/site-packages/cairo/__init__.py
* byte compiling '/usr/local/lib/python2.6/site-packages/cairo/__init__.py'
'install' finished successfully (0.832s)
  ./shutdown


Más inventos!

Fuente: http://www.educar.org/inventos/lineadeltiempo/default.asp

Ordenamos en este sitio cronológicamente los descubrimientos e invenciones que ha realizado el hombre desde los principios de la humanidad.

Los sucedidos en los milenios anteriores a la era cristiana son cálculos aproximados. Asimismo en muchos de los inventos hay variaciones en las fechas de su aparición en los diversos documentos consultados, por lo que pueden resultar ser aproximadas.

Desde
el 20.000 a. de C. al 1 d. de C.
Fechas Inventos
y datos relacionados
Eventos
20.000
aC

18.000 aC

18.000 aC
Agujas
de hueso

Pinceles

Cabañas de hueso de mamut 
Se
realizan las primeras herramientas de piedra
13.000
aC


12.000 aC

10.500 aC
Arpones

Cestería en mimbre

Vasijas de arcilla 
Se
comienzan a domesticar perros (11.000)
10.000
aC

8.000 aC

7.500 aC

6.500 aC

6.000 aC


5.500 aC

5.000 aC
Redes
de pesca

Peine 

Canoas

Fundición de cobre


Ladrillo

Rueda

Balanza
Extinción
de mamuts de pelo(10.000)

Primeras cosechas en Medio Oriente (8.000)
3.500
a 4.000 aC

3.500 aC

3.300 aC

3.000 aC

1.747 aC


1.500 aC

600 aC

Siglo III aC










150 aC
Embarcaciones
de vela



Arado


Escritura Cuneiforme

Ábaco


Calendario

Fundición del Hierro

Monedas

La palanca

El tornillo sin fin

El tornillo elevador de agua


La rueda dentada

La balanza hidrostática

Los espejos ustorios

Sismoscopio
Alrededor
del 3.500 comienza la Edad de Bronce.


Arquímedes
(287-212 a.C.), notable matemático e inventor griego, nacido en
Siracusa, Sicilia, y educado en Alejandría, Egipto, se
anticipó a su época con investigaciones e inventos.


Año
1 al 1499 d. de C.
Fechas Inventos Eventos
50

105

124

200 a 300


350

400 a 500
Herradura

Papel


Cúpula


Carro con ruedas

Estribos

Astrolabio 
0-33
Vida y Pasión de Jesucristo.

300 - El Cristianismo se ha difundido en el Imperio Romano

Fines del Siglo V: Caída del Imperio Romano de Occidente (476).
Comienzo de la Edad Media.
650

800 a 900

800 a 900

868

950


999



800 a 1.100
Molino
de Viento

Papel Moneda

Pólvora


Impresión de libros 

Arado de ruedas

Cristales coloreados en ventanas de Inglaterra

Partituras 
Pleno
desarrollo precolombino de las civilizaciones aborígenes
americanas, especialmente Mayas, Aztecas, Chibchas e Incas.

En el S. X aparece la herradura para caballos y un arnés
1.000


1.000

1.100

1.105


1.118

1.121

1.200

1.232

1.257

1.268


1.272

1.280

1.298

1.400

1.420

1.450


Siglo XV


Lentes

Cámara oscura

Brújula
magnética 


Primer molino de viento en Francia


Cañón (Usado por los moros)


Clavecín

Timón de popa

Globos de aire caliente (China)

Espejos cóncavos 


Anteojos

Máquina de bobinas de seda en Bolonia

Reloj
mecánico 


Rueda de hilar

Pinturas al óleo

Velocípedo


Imprenta de
tipos móviles


Laúd
Hacia
1140-
"Mio Cid" - Dos juglares de Medinacelli componen el
primer texto en lengua romance castellano.

1271. Parte de Venecia Marco Polo rumbo a China.


En el S. XIV se perfecciona la fabricación del vidrio y se inventa
el telar a pedal.

1492 - Descubrimiento de América.
Año 1500
a 1699
Fechas Inventos Eventos
1.500

1.500
Reloj
(1.500)


Puntilla (1.500)
1522
- Sebastián Elcano completa el viaje alrededor del mundo.

1530- Comienza el comercio de esclavos
1.565

1.581

1.569

1.589

1.589

1.590


1.593
Lápiz

Péndulo

Mapa en proyección

Telar

Inodoro


Microscopio
compuesto


Termómetro
de agua
1589:
Sir John Harrington (GB) inventa el inodoro con depósito, pero
pasó mucho tiempo antes de imponerse, y se siguieron usando
bacines y retretes con agujeros hacia pozo o foso.
1.609


1.620

1.620

1.640

1.642
Telescopio
refractor

Diligencia


Submarino

Bayoneta

Calculadora de Pascal 
1605
/ 1615: Cervantes publica "El Ingenioso Hidalgo Don Quijote
de La Mancha"

1620: Arriba el "Maryflower" a América del Norte.
1.657

1.665

1.668

1.672

1.687
Reloj
de péndulo

Microscopio
mejorado


Telescopio reflector

Bomba neumática

Higrómetro
Halley
descubre el cometa denominado con su nombre (1682)
Año
1700 a 1899
Fechas Inventos Eventos
1.709

1.710

1.712


1.714

1.731

1.733

1.740

1.740

1.742


1.745
Piano 



Termómetro
de alcohol


Máquina de vapor Newcomen

Termómetro de mercurio


Octante

Lanzadera automática

Estufa Franklin

Imprenta
en colores


Escala centígrada

Condensador eléctrico
Fundación
en 1.724, de la Academia de Ciencias de Rusia
1.752

1.757

1.761

1.763


1.769

1.776

1.782

1.783

1.784




1.785


1.790

1.795

1.796

1.796
Pararrayos


Sextante

Cronómetro

Reflectores
Parabólicos

Automóvil de vapor

Volante

Máquina de vapor Watt


Globo de aire caliente

Lámpara de aceite, con mecha hueca

Electróforo

Hélice

Sistema métrico

Vacuna



Litografías
1.789:
Revolución Francesa


Termina la Edad Moderna y comienza la Edad
Contemporánea.

1.800

1.801

1.801

1.801

1.802

1.803


1.805

1.816



1.821

1.827

1.830


1.831

1.834

1.837

1.837

1.838

1.839


1.840

1.840

1.842

1.846

1.846

1.846


1.848
Martillo
Pilón


Pila eléctrica

Electróforo

Endiómetro


Locomotora de Vapor


Acumulador eléctrico

Telar Jacquard

Lámpara de seguridad para mineros

Termoelectricidad

Fósforos

Cortadora de césped


Dínamo
eléctrica


Cosechadora

Telégrafo eléctrico

Alfabeto
Morse

Estereoscopio

Bicicleta


Estampilla de Correos

Buques con casco de hierro

Reloj eléctrico

Anestésicos

Saxofón

Prensa rotativa


Cerradura
de seguridad
Napoleón
es derrotado en Waterloo (1.815)
1.851

1.860

1.860


1.870

1.876

1.876

1.877

1.877

1.880


1.884

1.885

1.885

1.888

1.889

1.890


1.890

1.894

1.894

1.897

1.897

1.899
Cámara
de placas

Linóleo

Esquiladora


Máquina de escribir


Teléfono


Frigorífico

Fonógrafo

Motor de cuatro tiempos


Bombita eléctrica


Generador de turbina de vapor


Automóvil

Bicicleta de pedales

Gramófono

Ascensor
eléctrico

Rayos X

El tubo  de Crookes



Radio

Primer
periscopio


Motor Diesel

Motor eléctrico compacto
El
motor de cuatro tiempos inventado por Otto (Al. 1877) permitió
la invención del automóvil


Luis
Pasteur, en 1881 comenzó sus experimentos contra la rabia.



Año
1900 a la actualidad
Fechas Inventos Eventos
1.900

1.900

1.901


1.902

1.903

1.903

1.903

1.903

1.903


1.906

1.907

El
dirigible rígido Zeppelin

Tractor

Mecano


Frenos de disco

Cuchilla de seguridad

Máquina
de hacer botellas


Electrocardiograma

Cinturón de Seguridad

Osito de peluche


Lámpara Termoiónica

Lavarropas
En
1901, Marconi emite un mensaje de radio a través del Océano
Atlántico.


Se abre el
Canal de Panamá en 1904


1.910



1.911

1.913

1.913

1.913


1.914

1.914

1.916

Se funda la Sociedad de
Inventores Argentinos.

Modelo
nuclear del átomo


Acero inoxidable

Cadena de montaje

Heladera Eléctrica

Cremallera

Semáforos luminosos

Limpiaparabrisas



Comienza
la Primera Guerra Mundial (1.914).

Albert Einstein desarrolla y enuncia su teoría de la
Relatividad (1.915).
1.920


1.921

1.922



1.925

1.926

1.927


1.927

1.928

1.929
Secador
de Pelo

Autopistas



Se funda el Círculo Argentino de Inventores.


Contador Geiger

Televisor

Tostadora

Caucho sintético

Antibióticos


Ciclotrón
Se
engrandece la figura del Mahatma Gandhi, en su posición contra
el gobierno británico en la India.
1.930

1.931

1.932


1.933

1.933

1.934

1.935

1.938

1.938


1.938
Motor
a Reacción

Microscopio Electrónico

Guitarra Eléctrica

Grabaciones Estéreo

Polietileno


Nylon

Radar

Café Instantáneo

Fotocopiadora

Bolígrafo
1936:
Guerra Civil Española



1939: Comienza
la Segunda Guerra Mundial

1.941

1.942

1.942


1.943



1.946

1.946

1.946

1.947


1.948



1.949
Aerosoles

Reactor Nuclear

Equipo de Inmersión


Turbina de reacción para
aviones

Horno de Microondas

Calculadora electrónica

Computadora

Transistor


Long Play - Disco de Larga Duración

Neumáticos Radiales
La
Bomba atómica destruye Hiroshima y Nagashaki, Japón, en 1.945
1.950

1.954


1.954

1.955

1.956

1.956

1.957

1.958


1.959

1.959
Tarjeta
de Crédito

Central Nuclear

Radio a transistores

Plancha de vapor


Velcro

Video Cámara

Satélite Espacial

Aerodeslizador

Chip de Silicio

Lycra
Mediante
arduas investigaciones, se descubre la estructura del ADN
(1.953).

Realizan el ascenso al Everest, en 1.953, Hillary y Tenzing
1.960

1.962

1.962


1.963

1.964

1.969
Teflón

Robot Industrial

Satélite de Comunicaciones


Video Casettera

Procesador de Textos

Avión Jumbo
El
hombre posa su pie en la luna.

En 1.969 los astronautas estadounidenses llegan a la Luna.
1.971

1.972

1.972

1.973



1.974


1.978

1.979

1.979
Reloj
Digital

Escáners Rayos X

Video juegos domésticos


Protocolo de Internet
(IP) y  Protocolo de Control de Transmisión (TCP)


Códigos de Barras

Computadora Personal

Walkman

Catalizadores para automotores
Nace
el primer bebe de probeta, en 1978.
1.980

1.981

1.981

1.982


1.982

1.982
Cubo
de Rubik

Transbordador Espacial

Papeles autoadhesivos

Tarjeta inteligente


Corazón Artificial

Discos Compactos
Explosión
del reactor nuclear de Chernobyl en 1986.

Cae el Muro de Berlín en 1989
1.990


1.990

1.990

1.990





1.991

1.993








1.994



















1.995






1
.999










2.000
Realidad
Virtual

Fusión Nuclear


Identificador de voz


Se funda la Asociación Argentina de Inventores
y
la Escuela
Argentina de Inventores.


Videófono

Se realiza en
Buenos Aires el Primer Congreso Iberoamericano de


Inventores

Se celebra en
Argentina el 50° Aniversario
de la invención del

bolígrafo
. El Correo Argentino emite
estampillas conmemorativas, en honor

de Biro, y otros inventores argentinos destacados: Pescara,
Cristiani y

Finochietto.



Internet: se populariza el uso de redes con protocolos TCP/IP

Se crea
en Argentina la Fundación Biro, en el centenario
del nacimiento de Ladislao

José Biro.

Se organiza en Buenos Aires el Simposio Internacional de
Inventores

(WIPO-IFIA Symposium), por primera vez en el hemisferio Sur


 
Invasión
a Kuwuait por parte de Irak en 1990.

Se agilizan las comunicaciones instantáneas y se afianza el
concepto de globalización

Algunos inventos argentinos



Buscando algunos inventos por año en que se inventaron, dí con este sitio, que me resultó más que interesante. Siguiendo mi recorrido por el sitio, encontré una sección dedicada a recopilar algunos de los inventos que se hicieron en Argentina y/o por argentinos/as.


Acá van algunos:






Fecha


Inventor

Invento


1810


Miguel Colombise


N
uevo
control de navegación para

aeróstatos.


1813


Andrés Tejeda


M
áquina
hiladora.


1813


Fray Luis Beltrán


H
erramientas


metalúrgicas, arneses y batanes




para el Ejército de los Andes.


1876


Elías O´Donell


Nuevo

tipo de aeróstato.


1891


Juan Vucetich



Sistema Dactiloscópico para la
identificación

de las personas.


1914


Luis Agote


I
nstrumentos
para la transfusión sanguínea
.


Realiza

por primera vez en el mundo una transfusión con
sangre almacenada.

 


1916


Raúl Pateras de Pescara


P
rimer
helicóptero



eficaz

en la

historia de la aviación
.



1917


Quirino Cristiani


T
ecnología
para



realizar

dibujos animados
.


F
ilma
el primer largometraje de dibujos animados
.


1925


Vicente Almandos Almonacid


S
istema
de navegación nocturno


de


 aviones




 y guías para bombarderos.


1928


Ángel Di Césare y Alejandro
Castelvi

Colectivo


1929


Francisco Avolio


A
mortiguador
hidroneumático


1930


 Enrique Finochietto


I
nstrumental
quirúrgico,


por ejemplo

el separador intercostal a

cremallera


1953


 José Fandi


S
ecador
de pisos de una sola

pieza
,


instrumento doméstico


1968


Jorge Weber


T
apa
de rosca degollable


1970


Eduardo Taurozzi


M
otor
pendular de combustión

interna


1970


Juan Bertagni


P
lano
sonoro


1979


 Francisco De Pedro


S
oporte
fijo para


marcapasos


1983



Mario Dávila

 


S
emáforo
para ciegos



1989


Carlos Arcusín


J
eringa
autodescartable
.



C
apuchón
de seguridad para agujas hipodérmicas


1994


 Claudio Blotta


C
amilla
automática para emergencias


Fuente: http://www.educar.org/inventos/inventosargentinos.asp

19 de julio de 2011

Rename a GIT branch

One of the(bunch of) features of GIT that make it a delight to use while developing is the branching capabilities.

Using a good branching model even facilitates the collaboration when working with a team and helps going towards better results.

But, well, let's get to the point: sometimes it happens that you create a branch and later on you realize that the name you gave to it was not the best. Nevermind: you can painlessly rename it this way:

git branch -m old_branch_name new_branch_name

Yes! GIT rules! :)

7 de julio de 2011

How to amend a commit message in GIT


If the commit you want to fix isn’t the most recent one:
  1. git rebase --interactive $parent_of_flawed_commit
    If you want to fix several flawed commits, pass the parent of the oldest one of them.
  2. An editor will come up, with a list of all commits since the one you gave.
    1. Change pick to reword (or on old versions of Git, to edit) in front of any commits you want to fix.
    2. Once you save, git will replay the listed commits.
  3. Git will drop back you into your editor for every commit you said you want to reword, and into the shell for every commit you wanted to edit. If you’re in the shell:
    1. Change the commit in any way you like.
    2. git commit --amend
    3. git rebase --continue
Most of this sequence will be explained to you by the output of the various commands as you go. It’s very easy, you don’t need to memorise it – just remember that git rebase --interactive lets you correct commits no matter how long ago they were.

Source: link.

UPDATE:

Another way to go:

git commit --amend
Used to amend the tip of the current branch. Prepare the tree object you would want to replace the latest commit as usual (this includes the usual -i/-o and explicit paths), and the commit log editor is seeded with the commit message from the tip of the current branch. The commit you create replaces the current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded.
It is a rough equivalent for:
$ git reset --soft HEAD^
$ ... do something else to come up with the right tree ...
$ git commit -c ORIG_HEAD
but can be used to amend a merge commit.

Source: link.

5 de julio de 2011

How to install MySQL Server and Python connector in Mac OS X Snow Leopard


================================================================
-> MySQL Server and Python connector(Mac OS X Snow Leopard):
================================================================

Here goes some tricky stuff. You may want to consider getting yourself a cup of
linden infusion :-P

--> If you have a previous MySQL version:

If you have a previous MySQL version, perhaps a 32 bit one, you may encounter several
problems to perform the upgrade to a newer, 64-bit version. But don't worry, the
following steps should get you going in no time.

Hands on!
To uninstall the previous version, do this *in order*:

- First you need to go to: /Library/Receipts and look for a file named
  'InstallHistory.plist' (It's just a regular property list)
- Open it and look for the entries regarding MySQL, and delete them.

    MacBookPro:~ matias$ cd /Library/Receipts/
    MacBookPro:Receipts matias$ sudo nano InstallHistory.plist
    ctrl+shift+w, look for the entries regarding MySQL and delete them.
    ctrl+o (save) ctrl+x (exit)

- As the installer receipts are actually located in a different place on Snow Leopard:

    MacBookPro:Receipts matias$ cd /private/var/db/receipts/
    MacBookPro:receipts matias$ ls *mysql*
    com.mysql.mysql.bom          com.mysql.mysqlstartup.bom
    com.mysql.mysql.plist        com.mysql.mysqlstartup.plist
    MacBookPro:receipts matias$ sudo rm  *mysql*


- Now we are ready to do the uninstall work per se, by doing these *in order*:

    * Use mysqldump or MySQL Admin to backup your databases to text files!
    * Stop the database server
    * sudo rm /usr/local/mysql
    * sudo rm -rf /usr/local/mysql*
    * sudo rm -rf /Library/StartupItems/MySQLCOM
    * sudo rm -rf /Library/PreferencePanes/My*
    * edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
    * rm -rf ~/Library/PreferencePanes/My*
    * sudo rm -rf /Library/Receipts/mysql*
    * sudo rm -rf /Library/Receipts/MySQL*
    * sudo rm /etc/my.cnf


--> Install MySQL (server, startup item, pref pane):

- Install mysql's x86_64  version from the .dmg file. Download the .dmg from
  here: http://dev.mysql.com/downloads/mysql/5.1.html#downloads
  (I also put the installers under '3rdparty/MacOSX_Installers' folder).

--> Install MySQLdb in the virtualenv

- Turn the virtualenv on. This command does the trick:

    MacBookPro:~ matias$ laexpo_start
    (Env)MacBookPro:~ matias$

- Fetch MySQL-python-1.2.3 from here: http://sourceforge.net/projects/mysql-python/.
  I'll assume you downloaded the .tar.gz file to the Desktop.

- Unpack the tarball, enter the folder:

    (Env)MacBookPro:~ matias$ tar xzf MySQL-python-1.2.3.tar.gz
    (Env)MacBookPro:~ matias$ cd MySQL-python-1.2.3

- Open the 'site.cfg' file and edit the 'mysql_config' to poin to the path where
  you mysql_config resides. For me it is '/usr/local/mysql-5.1.50-osx10.6-x86_64/bin/mysql_config'

- Open the 'setup_posix.py' file and set the 'mysql_config.path' to the same path
  you did in the previous step(line 26). Should end up looking like this:

  mysql_config.path = "/usr/local/mysql-5.1.50-osx10.6-x86_64/bin/mysql_config"

- Compile the thing:

    (Env)MacBookPro:~ matias$ cd ~/Desktop/MySQL-python-1.2.3
    (Env)MacBookPro:MySQL-python-1.2.3 matias$ python setup.py clean
    (Env)MacBookPro:~ matias$ ARCHFLAGS='-arch x86_64' /usr/bin/python setup.py build
    (Env)MacBookPro:~ matias$ ARCHFLAGS='-arch x86_64' python setup.py install

* NOTE 1: It is critical to have the virtualenv activated before running the above
          listed command. If it is not, the installation of MySQLdb will be done in
          the system and no in the virtualenv and therefore MySQLdb will not be
          available when you turn the virtualenv on.

* NOTE 2: It is also critical to set the compilation flags correctly. If not set
          correctly, the compilation will default to 32-bit architecture and will
          not work afterwards with MySQL.

* NOTE 3: DON'T USE 'sudo' FOR THE COMPILLATION/INSTALL COMMANDS. If you do so, you'll
          be installing MySQLdb to the system and not to the virtualenv.


- Confirm the process worked ok:

    (Env)MacBookPro:MySQL-python-1.2.3 matias$ python
    Python 2.6.1 (r261:67515, Dec 17 2009, 00:59:15)
    [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    >>> MySQLdb.version_info
    (1, 2, 3, 'final', 0)