[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Symbolics and Birthdays



         Our Symbolics was to the only machine to wish me a Happy Birthday
    today when I logged in.  Our Vax is too stupid to figure something like
    that out and my Sun has enough trouble keeping track of the current time.

What makes, a 3600 "smart" and a Vax or a Sun "stupid" has nothing to do with
whether it wishes you Happy Birthday or not. To determine whether a 3600 is
"smarter" than a Vax or Sun, I refer you instead to all of the past flamage
on Lisp performance benchmarks and programmer productivity (and enjoyment)
to help address that issue more appropriately.

Funny isn't it. My 3600 never wishes me Happy Birthday. XX, a DECsystem-20 at
MIT has a program called Birthday-Wizard which has wished people happy birthday
for years. (I'm not sure of the history of that program but I think that it is
related somehow to puffd "Puff The Magic Dragon", a birthday greeting program
that has operated forever under ITS). Calendar, a program which UNIX has had
for years as well can trivially be made to wish people happy birthday. As Suns
and Vaxen run UNIX I guess it is not that your VAX and Sun is too stupid to
wish you Happy Birthday but rather that its owner is either to stupid to
run the right program on it or too stupid to want a birthday greeting from
a computer. (I was actually quite insulted one year when no PERSON remembered
my birthday but XX and MC (two computers at MIT) sent me electronic mail birthday
cards.) Anyway, here is a general calander program which I wrote for my 3600 which
provides similar functionality to the UNIX calendar program which I use to remind
me of OTHER PEOPLES birthdays so that I can wish THEM happy birthday in PERSON
so that THEY won't have the same experience that I had one year.

;;; -*- Mode: LISP; Package: USER; Base: 10; Syntax: Common-lisp -*-

(defun calendar-demon ()
 (with-open-file (calendar
                  (make-pathname :name "CALENDAR"
                                 :type "TEXT"
                                 :defaults (user-homedir-pathname))
                  :direction :in)
   (loop with today = (time:parse-universal-time "today")
         with the-day-after-tomorrow = (time:parse-universal-time
                                        "the day after tomorrow")
         for line = (read-line calendar nil nil)
         while (not (null line))
         for end = (loop for position from 0 below (string-length line)
                         when (char= (aref line position) #\!)
                           do (return (1- position))
                         finally (return (1- (string-length line))))
         for time = (time:parse-universal-time line 0 end)
         when (<= today time the-day-after-tomorrow)
           do (tv:notify nil "Calendar: ~A" line))))

(defun start-calendar-demon ()
 (calendar-demon)
 (si:add-timer-queue-entry
  (time:parse-universal-time "tomorrow")
  (list :forever (* 60 60 24))
  "Calendar demon"
  #'calendar-demon))

Just put a call to (start-calendar-demon) into your lispm-init file.

Then create a file calendar.text in your home directory which has
line of the form:
date ! message
These lines will be sent as notices when the current date matches the
date on the line. Just to start you off, here is an example file:

29 November  ! Jeffrey Mark Siskind's birthday
25 December  ! Merry Christmas

You can treat the above program as a belated birthday gift. You can
return the favor to me by using the program to remember and help brighten
up someone elses birthday.

        Happy Birthday,
        Jeffrey Mark Siskind
-------