Monday, August 9, 2010

[Emacs] Turn off the automatic break of long lines


This feature is called 'hard-wrap'.

In the usual emacs, add
(auto-fill-mode 0)
to your '~/.emacs'.

In the Aquamacs on OS X, add
(remove-hook 'text-mode-hook 'auto-detect-wrap)
to your '~/Library/Preferences/Aquamacs Emacs/Preferences.el'.

Ref) http://lists.aquamacs.org/pipermail/aquamacs-devel/2009-January/001823.html

Thursday, April 15, 2010

[Python] Intall IPython without root previledge

(1) Download ipython-0.10.tar.gz from http://ipython.scipy.org/moin/Download .

(2) Untar it and move to the directory where the numpy is.

(3) Run '>> python setup.py install --home=~/.local '

(4) Add the following lines to your .bashrc . Here I assume that your python version is 2.4.x.
export PYTHONPATH=$HOME/.local/lib/python2.4/site-packages:$PYTHONPATH
PATH=$PATH:$HOME/.local/bin
export PATH

(5) In order to use ipython on emacs, add the following to your .emacs . Refer the details to ipython.el, which is self-contained.
(add-to-list 'load-path "~/.emacs_addons")
(require 'ipython)

Thursday, April 8, 2010

[Python] Install numpy, scipy, PIL without root privilege on Linux

0. install python (in your local path) [1]
(1) download 'Python 2.7.3' from http://www.python.org/download/ .

(2) untar it and move to the directory where the python is.
(3) run the following commands.

>> mkdir /home/gunhee/lib/python-2.7.3/
>> cd Python-2.7.3
>> make clean
>> ./configure --prefix=/home/gunhee/lib/python-2.7.3/
>> make
>> make install
(4) Now you need to change the default python to your local one.
There are two different ways to do it. (1) symbolic links (2) add path to your '.bashrc'.
For (2), add the following line into your '.bashrc'.

# Add PATH for local python
PATH=$HOME/lib/python-2.7.3/bin:$PATH

1. install numpy
(1) download 'numpy-1.7.0.tar.gz' from http://sourceforge.net/projects/numpy/ .
(2) untar it and move to the directory where the numpy is.
(3) run >> python setup.py install --home=~/lib/python-2.7.3/ [2]. (The tilde is my home directory, but it is OK with any path you want). 
(4) Add the following line into your .bashrc [3].
(Assume that your numpy is located in ~/lib/python-2.7.3/lib/python/numpy).
export PYTHONPATH=$HOME/lib/python-2.7.3/lib/python:$PYTHONPATH

(5) Make sure that the numpy is successfully installed.
(check by this example >> python -c "import numpy; print numpy.__file__". There must be no error.

2. install scipy
(1) download 'scipy-0.12.0.zip' from http://sourceforge.net/projects/scipy/files/

(2) Install BLAS and LAPACK. Refer to [4]. (This step is not required any more). 
(3) run >> python setup.py install --home=~/lib/python-2.7.3/.

(4) Make sure that the scipy is successfully installed.
(check by this example >> python -c "import scipy; print scipy.__file__".

3. install PIL
(1) download PIL ('Imaging-1.1.7.tar.gz') from http://www.pythonware.com/products/pil/ .

(2) untar it and move to the directory where the PIL is.

(3) run >> python setup.py install --home=~/lib/python-2.7.3/.
(4) Add the following line into your '.bashrc' [3].
export PYTHONPATH=$HOME/lib/python-2.7.3/lib/python/PIL:$PYTHONPATH


Reference