Alpha Channel Problems When Creating .ico Files Using ImageMagick

I’ve tried to use ImageMagick to create .ico files for Open Yahtzee, out of PNGs of various sizes. The command as it should have been:

convert openyahtzee16.png openyahtzee32.png openyahtzee64.png openyahtzee.ico

resulted in the alpha channel being reversed. I’ve used ImageMagick 6.4.0, and I didn’t remember this misbehavior happening in the previous versions.

While this annoyed, and was due to no apparent reason, it could be easily solved using the ImageMagick switches to reverse the alpha channel:

-channel Alpha -negate

So the command that produces a correct .ico file was:

convert openyahtzee16.png openyahtzee32.png openyahtzee64.png -channel Alpha -negate openyahtzee.ico

NVRM: not using NVAGP, kernel was compiled with GART_IOMMU support

For the past several weeks I had a strange problem. Sometimes when I booted my computer, it would refuse to start the X server and would give the following error in dmesg:

NVRM: not using NVAGP, kernel was compiled with GART_IOMMU support!!
NVRM: failed to allocate stack!

The weird thing about it is that normally if I rebooted the computer it would magically work again. So this error only showed up once-in a while and seemed to disappear at will. Today, it happened again, so I decided to fix it.
Continue reading NVRM: not using NVAGP, kernel was compiled with GART_IOMMU support

usb 1-4: device descriptor read/64, error -71

When I try to connect my Sansa Clip MP3 player to the linux box I see the following error in dmesg:

usb 1-4: device descriptor read/64, error -71

and the device recognition fails. The player’s battery gets reloaded but I can’t mount it and transfer songs.
Continue reading usb 1-4: device descriptor read/64, error -71

Notes About Using amsmath split Environment In Hebrew Documents

Recently I’ve worked on a Hebrew document in LaTeX and wanted to use the split environment to typeset some multiline formula. The document which compiled just fine till that point, failed to compile with the following error:

Package amsmath Error: \begin{split} won't work here.

Continue reading Notes About Using amsmath split Environment In Hebrew Documents

Resolution Problems in clock()

While playing recently with clock() in order to time the performance of different kinds of code and algorithms, I found an annoying bug. clock() just can’t register work that has taken less than 0.01 seconds. This is pretty unexpected as clock() should return the processor time used by the program. The man page for clock() states:

The clock() function returns an approximation of processor time used by the program.

Continue reading Resolution Problems in clock()