Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!snorkelwacker!bloom-beacon!alan.AUx.apple.COM!abm From: abm@alan.AUx.apple.COM (Alan Mimms) Newsgroups: comp.windows.x Subject: Wanted: HAKMEM or leads thereto Message-ID: <9010161648.AA00484@alan.aux.apple.com> Date: 16 Oct 90 16:48:15 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 27 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