Friday, 7 February 2014

Installing HTK on MacOS

Had to install XQuartz (in Mavericks)

./configure -build=i686-apple-macos LDFLAGS=-L/opt/X11/lib CFLAGS='-I/opt/X11/include -I/usr/include/malloc -DARCH='\\\"darwin\\\"''

Friday, 4 January 2013

Installing Theano in a custom directory

/disk/scratch/benigno/python/lib/pip install --install-option="--prefix=/disk/scratch/benigno/python" --install-option="--install-lib=/disk/scratch/benigno/python/lib" --install-option="--install-scripts=/disk/scratch/benigno/python/bin" theano

Monday, 15 October 2012

Numpy, Scipy and Theano on Eddie


library_dirs = /local/scratch/ls418/intel/composerxe-2011.0.084/mkl/lib/intel64
include_dirs = /local/scratch/ls418/intel/composerxe-2011.0.084/mkl/include/
mkl_libs = mkl_def, mkl_intel_lp64, mkl_intel_thread, mkl_core, mkl_mc
lapack_libs = mkl_lapack95_lp64
cc_exe = 'icc -fPIC -O3 -openmp' 
python config --compiler=intel build_clib --compiler=intel build_ext --compiler=intel install --home=$INSTALL_DIR


pic_flags = ['-kPIC']
numpy/distutils/fcompiler/ (line 432 or so)

return '12.0'
Use the same site.cfg as for numpy and install
python config --compiler=intel --fcompiler=intel build_clib --compiler=intel --fcompiler=intel build_ext --compiler=intel --fcompiler=intel install --home=$INSTALL_DIR 


pip install Theano

Wednesday, 23 May 2012

Configuring HTK on Ubuntu 11.10 AMD64

sudo apt-get install build-essential libc6-i386 libc6-dev-i386 xorg-dev libx11-xcb-dev ia32-libs

./configure --disable-hslab CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"

make all

sudo make install

Friday, 26 February 2010

How to become an early riser, the easy way.

Do you struggle to get out of bed every morning? Does your body tell you "I'm not ready yet" every day? It does to me, it has done for the last 20 year. Finally I found a solution. I hope it is useful to somebody else out there.


  • Go to bed at any time (when you feel tired).

  • Set your alarm clock for 40 minutes before the time you would like to get up.

  • When it goes off take a 200mg caffeine pill and a glass of water.

  • Set the alarm clock again for the desired wake up time.

  • Keep on sleeping.

  • After 40 minutes you will be fully awake and energized. Usually, I don't even need the alarm clock to sound for the second time.

Side effects? Probably. However I am living two more hours every day. I don't think they offset that.

Friday, 25 December 2009

A Different Kind of Keyboard

The problem

I dislike keyboard layouts (maybe not all of them), but I definitely hate all laptop keyboard layouts and don't get me started on netbooks. Unfortunately, nowadays I am forced to use a laptop most of the time. It is not that I am a dvorak fan. I am fine with the qwerty. What really annoys me is the fact that I am forced to use keys I can only press with my pinkies (alt, super, control, tab, backspace...) while my most skillful fingers the indexes and thumbs just sit there. Or even worse, they force me to move my hands apart from from the home row and back (movement keys, delete, esc...).

Having done my fair deal of LISP coding I know emacs can make your hands hurt.

Technically, there is no need to move our fingers at all. Ten fingers and two possible positions for each of them would provide us with 1024 combinations, far more than keys we use now. That kind of keyboards already exist, they are called chorded keyboards, but require a lot of training and are not exactly what I have in mind.

My method

What I wanted was a method to edit text without having to move my hands or think about where the delete key is in this manufacturer's layout. So why not use letter keys combinations? It would work like pressing ctrl or alt, but instead you would press f (for example) which is much more comfortable.

I also wanted it to run on Linux and for all programs. I couldn't find anything like that, so I had to program it myself.

Good news, it actually works. I use it all the time. You can get the code from the link at the bottom of the post.

F key for movement and selection

When the f key is pressed but not released, the following transformations occur: j turns into left, l into right, k into down... take a look at the picture below:

'But wait a moment' you will say, when I press the key f, I want an "f" to appear on my screen. Well, you can't have it all, from now on you will have to use another letter, "v" sounds quite similar to me... No, really,, using my system you will not get an "f" when you press it, but when you release it, unless you press one of the transformed keys before, in that case the "f" will never appear. That's the only compromise that my system requires. More about how to achieve that later.

D key for deleting

The d key is another of my magic keys. In this case I use it to delete and insert new lines:

  • j -> backspace

  • l -> delete

  • k -> insert new line below (end + enter)

  • i -> insert new line above (home + enter + up)

  • o -> delete from cursor to end of line (shift down + end + shift up + delete)

  • u -> delete line (home + shift down + end + shift up + delete)
So, in a way I am also implementing some little macros.

J for clipboard management

The j key combined with s, d and f is used for cutting, copyingand pasting. Yes, I'm too lazy for Ctrl+x and all that mess.

That covers 90% of my needs when I am programming. I even have a "new line below" key which comes quite handy.

G and H for window management

I use G and H to simulate the meta key (the key between left ctrl and alt). I have setup a lot of hotkeys to manage windows and virtual desktops.

The code

A kernel patch to the input subsystem. I know, I know, that is not the right way to do it. I should have probably used the X event callback functions. However this is a proof of concept, and to be completely honest I tried with the X API and couldn't make it in work 10 minutes, so I went for the fun option: kernel hacking.

Surprise, it actually works! I use it everyday and I love it. There is only a compromise: I have to type properly, that means releasing the keys in the same order I press them, which sounds quite sensible to me anyway.

Here is the link to the github repository (bukbd). It works perfectly with Ubuntu 9.10 kernel for me, but try at your own risk.


  1. Get it out of the kernel.

  2. Ability to configure the keys.

X input expert anybody?