Monthly Archives: January 2013

Reversing linked list

Posted in C++, Interview | Tagged , | Leave a comment

Sorting Algorithms

Work in progress. Almost all are from Wikipidia: Quicksort is often faster in practice than other algorithms. The steps are: Pick an element, called a pivot, from the list. Reorder the list so that all elements with values less than … Continue reading

Posted in Uncategorized | Leave a comment

Interview questions on UNIX

List all links in current directory: ls -lrt | grep “^l” Create read only file touch file chmod 400 file Find which operating system your system is running on in UNIX uname -a How to run a process in background? … Continue reading

Posted in Interview, Programming, UNIX/Linux | Tagged , | Leave a comment

Reversing linked list

The code below is from here:

Posted in Uncategorized | Tagged , , | Leave a comment

Useful idioms for C/C++ programming

To double integer n: To divide by 2 as integer: To check if n is even integer: Idioms below are due to Adam Peterson. Instead of better: sizeof *telegram is computed at compile time! Size of array by division: NUM_OF_HANDLES … Continue reading

Posted in C++, Productivity, Programming | Tagged , , , , | Leave a comment

Meaning of entropy, Kullback–Leibler distance and mutual information

Recently I came across a nice read about entropy by Cover and Thomas. I want to summarize what entropy ‘physically’ means from information coding perspective. The definition of entropy for a discretely valued random variable is: Entropy does not depend … Continue reading

Posted in Machine Learning, Math, Probability Theory | Tagged , , , , | Leave a comment

How to add a scheduled job on Linux(Ubuntu)

There is a special program called ‘crontab’. Type This will open vim to edit the file with a list of commands that crontab will be executing.

Posted in Productivity, Programming, UNIX/Linux | Tagged , , | Leave a comment