Wednesday, June 05, 2013

C++11 auto and decltype Explained

Very well explained by Thomas Becker.

http://thbecker.net/articles/auto_and_decltype/section_01.html

Wednesday, December 12, 2012

Ubuntu 12.10: Disable touchpad of Lenovo Thinkpad

Thinkpads come with a red-dot mouse option, as well as, the standard trackpad. I love the red-dot because I do not need to move my fingers all around to trackpad to move the mouse. I feel more comfortable using the red-dot as the mouse. But problem is that when you use the red-dot, quite-often than not, your palm touches the trackpad which will cause sudden movements in the mouse. I wanted a way to disable the trackpad completely and only use the red-dot as the mouse.

Fortunately, I found this tutorial on the web. Following it was a breeze, and I was able to quickly disable the trackpad.

sudo takes a long time on ubuntu 12.10 after installing kerberos client

I recently installed Ubuntu Desktop 12.10 on my new office laptop. I also installed kerberos client since we use it for authentication for some common services. But since then, sudo started taking long time when I work from home.

After digging for information, I found in /var/log/auth.log that pam_krb5() authentication is failing because it is unable to contact the KDC server!

Fixed it by editing /etc/pam.d/common-auth and commenting the following line

auth [success=2 default=ignore]    pam_krb5.so minimum_uid=1000

Monday, December 10, 2012

Are unaligned reads really expensive?

Are unaligned reads really expensive?

  Since college days, I had come to understand that processor is very good at reading data which is aligned at word boundaries. Any unaligned memory read is considered to be slower. But when I recently saw such a read operation in a piece of code, I was trying to optimize, I was surprised to see no change in the performance after removing the unaligned read operation. After Googling on the same, found the following article

  It turns out that modern Intel processors handle unaligned reads, as efficiently as, aligned memory reads.

Note: This is applicable to Intel processors only.