The Deep Thoughts Cookie Cruncher
another "fine" product of UMPC
(or Useless Midnight Programmers' Corpse)
Why??
A while ago, I found a Deep Thoughts cookie cruncher for DOS... This was a
neat little trinket, but it just didn't cut it when it came to usefulness. I
wanted to be able to have a "Deep Thought of the Day" automatically sent to
me, but using a DOS machine, one cannot perform a task unless one was logged
in... (How I hate DOS)...
The net result is...
I gleaned all the text out of the Deep Thoughts program I had, and created a
NEW cookie cruncher to work with a file so I can run it on one of my UNIX
accounts and thus run it from a cron task...
It took me about 8 hours (so far) to get it the way I wanted it, and here
it is... So far I have only tried it on these setups...
- A Sun workstation running System V Release 4
- A DEC Alpha AXP running OSF/1 v1.3
- A 486DX2/66 running Linux 1.1.89
All other machines SHOULD be able to use the
program as the code is ANSI C (I think). I compiled with GCC on all machines,
and also
with DEC's CC on the Alpha
Usage
Any user who wants to use deep_thoughts should
- ensure the executable is on their path
- create a file in their home directory called .dtrc that contains:
the full path name of the Deep Thoughts Data File
the full path name of the log file
- let 'er rip.
The Deep Thoughts Data file MUST have the following format for the program to
work properly:
- the first line should contain the number of Deep Thoughts in the
file.
- each subsequent line should contain one Deep Thought apiece. NOTE:
each Deep Though MUST be on one line (e.g. NO linefeeds/carriage
returns in them) or the program will belch loudly (or otherwise
fail)
Have fun. Of course, this code can be used for other cookie crunching at will,
simply by changing the header[] initialization, and by changing the contents of
the Data file.
I will not be held responsible for any annoyance caused to the creator of the
Deep Thoughts. I simply did this to enjoy his work.... Any copyright
complaints should be directed to /dev/null.
Revision Listing
1.0 012595 Original version
1.1 012795 Added -h option - creates an HTML version of the Deep Thought
1.2 012795 Added word wrapping (-w size), Makefile
1.3 012995 Added -H option - outputs to both stdout and to a named HTML
file
1.4 013195 Added help screen (-h), removed previous -h & -H, added new
-H which outputs HTML version to a file ONLY, added -t which
outputs text version to stdout, added log file (-l)
1.5 021495 Added -H - as outputting HTML on stdout
Return to my Home Page
Send me some feedback
$Id: Deep_Thoughts.html,v 1.8 2004/06/23 15:55:19 gjhurlbu Exp $