home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1976 / README < prev   
Encoding:
Text File  |  1990-12-28  |  3.8 KB  |  84 lines

  1.  
  2. The third release of "cookie"   20-Oct-1990
  3. -------------------------------------------
  4.  
  5. Cookie is a program to randomly retrieve cookies from a fortune cookie file.
  6. Each cookie can contain an arbitrary number of lines of text.  By generating
  7. a small "hash" file containing the addresses of each cookie in the cookie
  8. file, cookie has a high-performance way to look up cookies, plus it is "fair,"
  9. which is to say that short cookies are equally as likely to be selected as 
  10. long ones.  (The technique of simply randomly seeking into the cookie file
  11. and looking backwards and forwards from there to find the beginning and
  12. end of the cookie text would bias the cookie program toward large cookies.)
  13.  
  14. This is the same code as in my second release, but it's been almost two years
  15. since that release and I've gotten numerous requests for the program, plus
  16. I'm about to pump out a batch of new cookies, plus there wern't alt.sources
  17. archives (that I'm aware of) then, plus there's a manpage now, blah blah
  18. blah.  Flames via email or alt.sources.d if you must...
  19.  
  20. The code is again released into the public domain without restriction.
  21. I ask that you retain my name in the source code if you redistribute this stuff,
  22. and that you redistribute source along with binaries.
  23.  
  24. No warranties are expressed or implied -- this is free code.  We do not have
  25. a contract.
  26.  
  27. The code is written for System V but the only area of incompatibility should be
  28. the rand() function.  Only minor hacking should be necessary to port to BSD,
  29. for example.  (If someone gets the urge, please make a version that works
  30. with #ifdefs for both, test the BSD version and forward it back to me, OK?)
  31.  
  32. It should be possible to make cookie work pretty painlessly on MS-DOS, Minix,
  33. etc.  Tested updates for popular and not-overwhelmingly-twisted systems, with
  34. #ifdefs, are solicited.  I seem to recall that cookie works as-is on the Amiga.
  35.  
  36. To use, unshar this archive and do a 'make' to compile 'cookie' and 'cookhash'.
  37.  
  38. Then collect a bunch of cookies.  Eric Townsend just posted quite a few to
  39. alt.sources.  I will be posting a couple of new batches.  I hope to post
  40. information soon to alt.sources.d as to where an archive site for all my
  41. cookies (pushing 500 KB) can be found.
  42.  
  43. Cookies are separated by lines containing two percent-signs and nothing
  44. else, for example:
  45.  
  46. "I just thought of something funny, your mother."
  47. -- Cheech Marin
  48. %%
  49. "He can shout, don't hear you."
  50. -- The Firesign Theatre
  51. %%
  52.  
  53. ...and so forth.
  54.  
  55. The include file "cookie.h" defines the location of the cookie file as being
  56. "/usr/local/lib/sayings".  If you want to put it elsewhere, change cookie.h
  57. and rebuild 'cookie'.  
  58.  
  59. Cookie needs a hash file for the cookie file, by default called
  60. "/usr/local/lib/sayhash".  This is created by the 'cookhash' program.
  61. Cookhash is simply a filter that reads a cookie file in as stdin and writes
  62. a cookie hash file to stdout.  Thus, if you've moved the cookie file to
  63. /usr/local/lib, 'cd' there and do a "cookhash <sayings >sayhash" to create the 
  64. hash file.
  65.  
  66. After that, 'cookie' should produce a cookie.  Cookie can also be executed
  67. with two arguments, the name of a cookie file followed by the name of
  68. its hash file, useful for creating aliases for alternate cookie files so
  69. you can get just Zippy the Pinhead quotes, for example.
  70.  
  71. If you find quotes in the file that are unattributed and you know the
  72. attributions, please mail them to karl@sugar.hackercorp.com or
  73. uunet!sugar!karl
  74.  
  75. I also collect cookies.  If you see good ones, please forward them.  (If you
  76. got them from me, please don't!)
  77.  
  78. A lot of people think it's fun to get a cookie every time they log in, so 
  79. they put "cookie" in their .profile or .login file.
  80.  
  81. Regards,
  82. Karl (karl@sugar.hackercorp.com) @ The Hacker's Haven, Missouri City, Texas 
  83. (The name will be changing because hacker has lost its old meaning -- sigh)
  84.