abm@alan.AUx.apple.COM (Alan Mimms) (10/16/90)
I'm wondering where I can get a copy of the holy HAKMEM document which is alleged to contain millions (well, hundreds) of really-useful little hacks and algorithms and other such wonders. An example, for those of you who don't know about HAKMEM, is an algorithm to count the number of set bits in a longword without loops: unsigned long m; m = (bits >> 1) & 033333333333; m = bits - m - ((m >> 1) & 033333333333); nbits = ((m + (m >> 3)) & 030707070707) % 077; This type of stuff, if there is a lot of it, would bear keeping around and perhaps recirculating for all of the newcomers to benefit. Does anyone have a copy of HAKMEM or know where it can be found? Someone used HAKMEM item #169 in server/dix/colormap.c to count the number of bit- planes the colormap allocation algorithm had succeeded with... Thanks. Alan Mimms (alan@apple.com, ...!apple!alan) | My opinions are generally A/UX X group | pretty worthless, but Apple Computer | they *are* my own... "Laugha whila you can, monkey boy..." -- John Whorfin in Buckaroo Bonzai "Never rub another man's rhubarb" -- The Joker in Batman
jimf@SABER.COM (10/17/90)
|I'm wondering where I can get a copy of the holy HAKMEM document which |is alleged to contain millions (well, hundreds) of really-useful little |hacks and algorithms and other such wonders. I have a copy of this document. There are indeed some interesting things in it. It appears that it can be freely duplicated, in which case I would duplicate it for the requestor for the cost of duplication and postage (which is the deal I got it under). If someone knows for sure, can they let me know? jim frost saber software jimf@saber.com