Sunday, February 5, 2012

Makefile older than solution (ubuntu)

There could be two sources for the problem. Try both (if needed).

1) Make sure you clean all temporary files while building. Make sure you clean all temporary files.

2) If that does not solve the problem, then check if the system clock is synched. Typically this happens because the presented dependencies are newer than your system time. Be sure to check the current (actual time) and your system time.  Commands to correct the system time:
apt-get install netdate
netdate tcp

Create /var/spool/cron/tabs/root:

# update time with ntp server
0 3,9,15,21 * * * /usr/sbin/netdate

Then run:
chmod 600 /var/spool/cron/tabs/root
/etc/init.d/cron restart

How a hilbert curve can be used to represent linear space in 2D

Consider a set of numbers from say 0 to 16 and you want to represent that using a square. Then we could represent those numbers using a 2nd order hilbert curve as follows:

0---1   14--15
    |   |
3---2   13--12
|            |
4   7---8   11
|   |   |    |
5---6   9---10

Merge list error while running apt-get update or apt-cache search

This is a nasty error that can occur while you are using the Ubuntu package manager.  It looks something like this:
E:Encountered a section with no Package: header,
E:Problem with MergeList /var/lib/apt/lists /us.archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages,
E:The package lists or status file could not be parsed or opened.
This results because the package manager is unable to merge the newly determined lists with existing temporary ones in /var/lib/apt/lists.

Solution: This can be fixed by deleting the temporary lists:
sudo rm /var/lib/apt/lists/* -vf
and re-building the database:
sudo apt-get update

Solution gd.h not found error while installing

Ran into this error while trying out a nice graphics utility. Found out that this  is the missing graphics development (GD) library. So installed the corresponding package:
sudo apt-get install libgd-xpm-dev
This solved the problem.

On redhat/fedora systems try:
yum install gd-devel