Saturday, 21 December 2013

Spellcheck in Emacs

Recently I am using Emacs for writing a few essays. While writing, I started missing spellcheck feature of Microsoft Word. The fact that feature is also provided my many browser based tools, like in GMail has made me used to it. So, I did a quick lookup to find the shortcut for triggering spellcheck in the current Emacs buffer. The answer was to simply use M-x ispell. Trying that I got the following error in the Messages buffer below the main buffer.

No word lists can be found for the language "en_US"

The shortcut mentioned above uses aspell which I knew is installed on my system. So, looking for aspell errors, I figured I needed to install the package aspell-en to get it fixed. On Arch linux, it can be done using the following.

pacman -S aspell-en

Sunday, 15 December 2013

Gem installation fails due to packaged gems

Rake 0.9.6 comes bundled with ruby 2. However, I needed to build ruby-debug-ide 0.4.17.beta16 against rake 0.8.7. I tried uninstalling rake 0.9.6 but there is no way to do it. Using the following command does not list 0.9.6 as an option.

gem uninstall rake

So, now I had to find a way to tell the gem utility to use rake 0.8.7 instead of 0.9.6. A little reading showed that setting the RAKE environment variable could do this.

RAKE=/usr/lib/ruby/gems/2.0.0/gems/rake-0.8.7/bin/rake gem install ruby-debug-ide -v 0.4.17.beta16 --pre

The above  did not work for some reason. After that I tried the following and it worked.

RAKE=`bundle exec rake` gem install ruby-debug-ide -v 0.4.17.beta16 --pre

Saturday, 14 December 2013

Checking memory usage for a set of processes

Recently, I had to monitor memory usage of a set of processes. I used pmap to help me out. The following script gave memory usage of each PID I was interested in.

for foo in `ps aux | grep <my_process_identifier> | awk -F ' ' '{print $2}'`
echo $foo
pmap $foo | tail -n 1

Monday, 9 December 2013

Coherence break in user experience

Why give the option for special characters when they are not accepted?

Wednesday, 4 December 2013

Set MySql output charset

The character set of the results returned by MySql is controlled by character_set_results variable. When a client connects to a MySql server, this variable is set to the character set of the environment of the client. So, if you connect from a ISO-8859-1 (latin 1) console, the variable is set to latin 1 encoding. The current value can be checked by the following query.

show variables;

To set the variable, the client can be initialized from a console which has its encoding set appropriately or one can run the following query.

set character_set_results = <character_set>;