Alpha Channel Problems When Creating .ico Files Using ImageMagick

I’ve tried using 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 used ImageMagick 6.4.0, and I didn’t remember this misbehavior happening in previous versions.

While this was annoying and 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

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 a multiline formula. The document, which compiled just fine until 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 recently playing 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()