v14i068: Mp v2.4.5 - the mail/news pretty printer (Part 2 of 2).

Rich Burridge rburridge at Sun.COM
Thu Aug 30 08:46:45 AEST 1990


Posting-number: Volume 14, Issue 68
Submitted-by: rburridge at Sun.COM (Rich Burridge)
Archive-name: mp-2.4.5/part02

------CUT HERE------mp.shar.part2------CUT HERE------
#! /bin/sh
# this is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh to create the files:
#	Makefile.dist
#	mailp
#	mp.1
#	mp.el
#	Data (directory)
#	mp.pro.ps
#	mp.pro.alt.ps
#	mp.pro.filofax.ps
#	mp.pro.timeman.ps
# This archive created: Wed Aug 29 12:25:57 EST 1990
#
#
export PATH; PATH=/bin:$PATH
#
if [ -f Makefile.dist ]
then
echo shar: will not over-write existing file Makefile.dist
else
echo shar: extracting 'Makefile.dist',     2759 characters
cat > Makefile.dist <<'Funky_Stuff'
#
#  Makefile for mp, the PostScript pretty printer.
#
#  @(#)Makefile.dist 1.1 90/08/29
#
#  Copyright (c) Steve Holden and Rich Burridge.
#                All rights reserved.
#
#  Permission is given to distribute these sources, as long as the
#  copyright messages are not removed, and no monies are exchanged.
#
#  No responsibility is taken for any errors inherent either
#  to the comments or the code of this program, but if reported
#  to me then an attempt will be made to fix them.
#
#=====================================================================
#
#  It is possible to change the location of the mp prologue file
#  with the -p command line option. It can also be defined at compile
#  time, by uncommenting the macro definition below and setting
#  appropriately. If it's not present, then a sensible default value
#  is used.
#
#PROLOGUE = -DPROLOGUE=\"$(LIBDIR)\"
#---------------------------------------------------------------------
#  Not all machines have the index() string library function. If you
#  don't have this function then you should uncomment the NOINDEX
#  definition below.
#
#NOINDEX         = -DNOINDEX
#=====================================================================
#
#  Default locations where mp files will be installed.
#  You might wish to alter these values.
#
BINDIR   = /usr/local/bin
LIBDIR   = /usr/local/lib
MANDIR   = /usr/man/man$(MANSECT)
MANSECT  = l
#
#  Compilation flags and standard macro definitions.
#
CFLAGS   = -g $(NOINDEX) $(PROLOGUE)
LDFLAGS  =
#=================================================================

.KEEPSTATE:

BINARIES = mp

SRCS     = header.c io.c main.c misc.c print.c
OBJS     = header.o io.o main.o misc.o print.o

HDRS     = extern.h mp.h patchlevel.h
OTHERS   = README Makefile.dist mailp mp.1 \
	   MANIFEST FILES CHANGES TODO \
	   mp.el mp.pro.ps mp.pro.alt.ps mp.pro.filofax.ps \
	   mp.pro.timeman.ps Data

SFILES1  = $(SRCS) $(HDRS) README MANIFEST FILES CHANGES TODO
SFILES2  = Makefile.dist mailp mp.1 mp.el Data \
	   mp.pro.ps mp.pro.alt.ps mp.pro.filofax.ps mp.pro.timeman.ps

all:       $(BINARIES)

mp:        $(OBJS)
	   cc $(LDFLAGS) -o mp $(OBJS)

install:   $(BINARIES)
	   install -s -m 751 mp $(BINDIR)
	   install -c -m 644 mp.1 $(MANDIR)/mp.$(MANSECT)
	   install -c -m 644 mp.pro.ps $(LIBDIR)
	   install -c -m 644 mp.pro.filofax.ps $(LIBDIR)
	   install -c -m 644 mp.pro.timeman.ps $(LIBDIR)

clean:;    rm -rf mp *.o core

create:    SCCS
	   -sccs create $(SRCS) $(OTHERS)

lint:;     lint $(SRCS)

shar:;     shar.script $(SFILES1) > Part1
	   shar.script $(SFILES2) > Part2

SCCS:
	   mkdir SCCS
	   chmod 755 SCCS

header.o:	mp.h extern.h
io.o:		mp.h extern.h
main.o:		mp.h
misc.o:		mp.h extern.h patchlevel.h
print.o:	mp.h extern.h
Funky_Stuff
len=`wc -c < Makefile.dist`
if [ $len !=     2759 ] ; then
echo error: Makefile.dist was $len bytes long, should have been     2759
fi
fi # end of overwriting check
if [ -f mailp ]
then
echo shar: will not over-write existing file mailp
else
echo shar: extracting 'mailp',      655 characters
cat > mailp <<'Funky_Stuff'
#! /bin/sh
#
#  @(#)mailp 1.5 89/06/28
#
#  mailp, newsp, filep, digestp, filofaxp and timemanp
#  shell script de lancement de mp
#  (mail/news/file/digest/filofax/time-manager pretty printer)
#
#  Original: Bruno Pillard - October 1988.
#  Modified: Rich Burridge - June 1989.

BIN=/usr/local/bin

case $0 in
	*mailp)    PROG=mp       ;; 
	*newsp)	   PROG=mp       ;;
	*digestp)  PROG="mp -d"	 ;;
	*filep)	   PROG="mp -o"  ;;
	*filofaxp) PROG="mp -f 	 ;;
	*timemanp) PROG="mp -t 	 ;;
	*)	echo Unknown pretty printer: $0
		exit;;
esac

if    [ $# -eq 0 ]
then
	set - " - "
fi
while [ $# -gt 0 ]
do
	/bin/cat $1 | ${BIN}/${PROG} | lpr -h -Plw
	shift
done
Funky_Stuff
len=`wc -c < mailp`
if [ $len !=      655 ] ; then
echo error: mailp was $len bytes long, should have been      655
fi
fi # end of overwriting check
if [ -f mp.1 ]
then
echo shar: will not over-write existing file mp.1
else
echo shar: extracting 'mp.1',     4805 characters
cat > mp.1 <<'Funky_Stuff'
.\" @(#)mp.1 1.13 90/04/12
.TH MP 1L "12 April 1990"
.SH NAME
mp \- Postscript pretty printer
.SH SYNOPSIS
.B mp
[
.B \-a
]
[
.B \-d
]
[
.B \-f
]
[
.B \-l
]
[
.B \-m
]
[
.B \-o
]
[
.B \-p
.I prologue
]
[
.B \-s
.I subject
]
[
.B \-t
]
[
.B \-v
]
[
.B \-?
]
[
.IR filename .\|.\|.
]
.SH DESCRIPTION
.B mp
will read each
.I filename
in sequence and generate a Postscript file on standard output,
which is a pretty print of the original. If no filename argument is given
.B mp
reads from the standard input. If the standard input is a terminal, input
is terminated by an
.SM EOF
signal, usually
.SM CTRL-D\s0.
.LP
The input files to
.B mp
can be mail items, news articles or ordinary ASCII files. It is also
possible to print out complete mail folders and digests.
.PP
The format adopted has textured areas containing banner information
at the top and bottom of every page.
.PP
.B mp
was originally designed to be used in conjunction with the print
button in the
.B "mailtool (1)"
program, or the
.B pipe
command from within mail. Add (or alter) the following two line in your
.B .mailrc
file:
.in +1.0i
.nf
\fCset printmail='mp | lpr'
set cmd="mp | lpr &"\fP
.fi
.in -1.0i
.PP
Source the
.B .mailrc
file again, and you are ready.
.PP
A useful alias to use used in conjunction with your
.I .cshrc
file for printing out ordinary text files is:
.in +1.0i
.nf
\fCalias print 'mp -o -s "\\!*" <\\!* | lpr'\fP
.fi
.in -1.0i
.SH OPTIONS
.TP
.B \-a
The file on standard input is a news article, and should be printed with
"Article from
.I newsgroup
" in the top banner, where
.I newsgroup
is the first news group found on the Newsgroups: line.
.TP
.B \-d
The file on standard input is a digest so print accordingly.
.TP
.B \-f
The file on standard input is printed specifically was use with Filofax,
a personal organiser.
.TP
.B \-l
Prints output in landscape mode. Two pages of text will be printed per
sheet of paper.
.TP
.B \-m
The file on standard input is a mail folder, so print out multiple messages.
.TP
.B \-o
The file on standard input is an ASCII file so print accordingly.
.TP
.BI \-p " prologue filename"
Employ
.I "prologue filename"
as the Postscript prologue file. This overrides any previously defined
prologue values.
The
.I mp
prologue file is determined by first looking for the environment variable
.IR MP_PROLOGUE .
This will be the directory where the mp prologue files are to be found.
Three different prologue files are used. Normally the prologue file is
.I mp.pro.ps
but if the
.I \-f
option is used, then the prologue file is called
.I mp.pro.filofax.ps
and if the
.I \-t
option is used, then the prologue file is
.I mp.pro.timeman.ps
If
.I MP_PROLOGUE
isn't found, then the default location is used. The default location is
.IR /usr/local/lib/mp.pro.ps .
.TP
.BI \-s " subject"
Use
.I " subject"
as the new subject for the printout. If you are printing ordinary text
files which have been specified on the command line, the the subject will
default to the name of each of these files.
.TP
.B \-t
The file on standard input is printed specifically for use with Time Manager,
a personal organiser.
.TP
.B \-v
Print the version number of this release of the
.B mp
program.
.TP
.B \-?
Print the usage line for this program. Note that the
.B ?
character should be escaped if running from
.BR csh (1).
.SH FILES
.TP
.B /usr/local/bin/mp
executable
.TP
.B /usr/local/lib/mp.pro.ps
PostScript prologue to define required vocabulary for mail printing.
Editing this file will allow you to introduce some stylistic variation
in the printing of mail.
.TP
.B /usr/local/lib/mp.pro.filofax.ps
Postscript prologue used to print out files in Filofax format.
.TP
.B /usr/local/lib/mp.pro.timeman.ps
PostScript prologue used to print out files in Time Manager format.
.SH "SEE ALSO"
mail(1)
.SH AUTHORS
Original version by Steve Holden.
.PP
Converted to C, modified and maintained by Rich Burridge, Sun Microsystems Australia,
.PP
Original modified to handle net news articles and MH mail by Bruno Pillard, Chorus Systemes, France,
.PP
Handling of mail digests added by Dave Glowacki of Public Works Computer Services, St Paul, MN.
.PP
Manual page for the initial version revised by Rick Rodgers, UCSF School of Pharmacy, San Francicso.
.PP
Support for Personal Organiser printing style added by Douglas Buchanan,
Sun Microsystems Europe.
.PP
Substantial modifications to header parsing by Jeremy Webber,
Computer Science Department, University of Adelaide, Australia.
.PP
Support for printing multiple files and subject line filename print for
ordinary files added by Sam Manoharan, Edinburgh University.
.PP
Support for landscape mode written by Michael Tuciarone.
.PP
Rich Burridge,             Domain: richb at Aus.Sun.COM
.nf
PHONE: +61 2 413 2666   Path: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
.fi
Funky_Stuff
len=`wc -c < mp.1`
if [ $len !=     4805 ] ; then
echo error: mp.1 was $len bytes long, should have been     4805
fi
fi # end of overwriting check
if [ -f mp.el ]
then
echo shar: will not over-write existing file mp.el
else
echo shar: extracting 'mp.el',     2297 characters
cat > mp.el <<'Funky_Stuff'
;;  @(#)mp.el 1.1 90/08/14
;;
;;  From Roger Riggs <riggs at suneast.East.Sun.COM>
;;
;;  I and other people here have created functions to print with mp.
;;  This is particularly good with mail and newsgroup articles
;;  and the PostScript page decorations can be tailored if you know a
;;  little PostScript. Both are variations of the original lpr and print
;;  buffer/region code.
;;
;;  Interface to mp.

(defun mp-buffer ()
  "Print buffer contents as with Unix command `mp | lpr -h'.
`lpr-switches' is a list of extra switches (strings) to pass to lpr."
  (interactive)
  (mp-region-1 (point-min) (point-max)))

(defun mp-region (start end)
  "Print region contents as with Unix command `mp | lpr -h'.
`lpr-switches' is a list of extra switches (strings) to pass to lpr."
  (interactive "r")
  (mp-region-1 start end))

(defun mp-region-1 (start end)
  "Print region using mp to lpr"
  (interactive)
  (let ((mp-switches) (msg "Formatting...") (oldbuf (current-buffer)))
    (cond ((string-equal major-mode 'gnus-Article-mode)
	   (if (and (= (point-min) start) (= (point-max) end))
	       (setq mp-switches (list "-a"))
	     (setq mp-switches (list "-o" "-s" (mail-fetch-field "Subject")))))
	  ((string-equal major-mode 'rmail-mode)
	   (if (and (= (point-min) start) (= (point-max) end))
	       (setq mp-switches nil)
	     (setq mp-switches (list "-o" "-s" (mail-fetch-field "Subject")))))
	  (t 
	   (setq mp-switches
		 (list "-o" "-s" (concat "\"" (buffer-name) " Emacs buffer" "\"")))))
    (save-excursion
      (message "%s" msg)
      (set-buffer (get-buffer-create "*spool temp*"))
      (widen) (erase-buffer)
      (insert-buffer-substring oldbuf start end)
      (if (/= tab-width 8)
	  (progn
	    (setq msg (concat msg " tabs..."))
	    (message "%s" msg)
	    (setq tab-width tab-width)
	    (untabify (point-min) (point-max))))
      
      (setq msg (concat msg " mp..."))
      (message "%s" msg)
      (apply 'call-process-region
	     (nconc (list (point-min) (point-max) "mp" t t nil )
		    mp-switches))
      
      (setq msg (concat msg " lpr..."))
      (message "%s" msg)
      (apply 'call-process-region
	     (nconc (list (point-min) (point-max) "lpr" t nil nil "-h" )
		    lpr-switches))
      (setq msg (concat msg " done."))
      (message "%s" msg))))
Funky_Stuff
len=`wc -c < mp.el`
if [ $len !=     2297 ] ; then
echo error: mp.el was $len bytes long, should have been     2297
fi
fi # end of overwriting check
if [ -f Data ]
then
echo shar: can not write a directory over file Data
else
if [ ! -d Data ]
then
echo shar: creating directory Data
mkdir Data
fi
echo shar: entering directory Data
cd Data
if [ -f Mail ]
then
echo shar: will not over-write existing file Mail
else
echo shar: extracting 'Mail',     1296 characters
cat > Mail <<'Funky_Stuff'
Return-Path: rb-archive-server at Aus.Sun.COM
Received: by hawk from Sun.COM ([192.9.9.1])
        for pmaresch (from rb-archive-server at Aus.Sun.COM)
        id <AA23438 at hawk>; Thu, 5 Jul 90 09:44:34 edt
Received: from Aus.Sun.COM ([129.158.10.50]) by Sun.COM (4.1/SMI-4.1)
	id AA04815; Thu, 5 Jul 90 06:48:22 PDT
Received: from stard.Aus.Sun.COM by Aus.Sun.COM (4.1/SMI-4.1)
	id AA28245; Thu, 5 Jul 90 23:51:17 EST
Received: by stard.Aus.Sun.COM (4.1/SMI-4.1)
	id AA19213; Thu, 5 Jul 90 23:46:07 EST
Date: Thu, 5 Jul 90 23:46:07 EST
Message-Id: <9007051346.AA19213 at stard.Aus.Sun.COM>
From: Rich Burridge Archive Service <rb-archive-server at Aus.Sun.COM>
To: pmaresch at hawk.ulowell.edu (pierre mareschal)
Subject: ack receipt of your archive retrieval request
In-Reply-To: Request from pmaresch at hawk.ulowell.edu (pierre mareschal) dated Thu Jul 5 23:46:02 EST 1990

The Rich Burridge Archive Server has received your request.
All of the files that you asked for are in the database.
Your request is 66314 bytes. It has been placed in the mailer's work
queue. The work queue is periodically processed by the archive mailer, which
always sends the shortest queued request first. The length of time that it
takes to receive your request will depend on how many smaller requests are in
front of it in line.
Funky_Stuff
len=`wc -c < Mail`
if [ $len !=     1296 ] ; then
echo error: Mail was $len bytes long, should have been     1296
fi
fi # end of overwriting check
if [ -f MailFolder ]
then
echo shar: will not over-write existing file MailFolder
else
echo shar: extracting 'MailFolder',      318 characters
cat > MailFolder <<'Funky_Stuff'
>From pmaresch Thu Jul  5 13:35:28 1990
Date: Thu, 5 Jul 90 13:35:22 EDT
From: pmaresch (Pierre Mareschal)
To: pmaresch
Subject: Subject 2
Status: R

Text Two

>From pmaresch Thu Jul  5 13:35:28 1990
Date: Thu, 5 Jul 90 13:35:03 EDT
From: pmaresch (Pierre Mareschal)
To: pmaresch
Subject: Subject 1
Status: R

Text One

Funky_Stuff
len=`wc -c < MailFolder`
if [ $len !=      318 ] ; then
echo error: MailFolder was $len bytes long, should have been      318
fi
fi # end of overwriting check
if [ -f NewsArticle1 ]
then
echo shar: will not over-write existing file NewsArticle1
else
echo shar: extracting 'NewsArticle1',     2882 characters
cat > NewsArticle1 <<'Funky_Stuff'
Article: 3019 of +Comp.object
Path: swan!bbn.com!mit-eddie!rutgers!uwm.edu!rpi!image.soe.clarkson.edu!news
From: cline at cheetah.ece.clarkson.edu (Marshall Cline)
Newsgroups: comp.lang.c++,comp.object
Subject: ``Object Oriented Design'' by Grady Booch -- A First Look
Message-ID: <CLINE.90Jun2004848 at cheetah.ece.clarkson.edu>
Date: 2 Jun 90 04:51:44 GMT
Sender: news at sun.soe.clarkson.edu
Reply-To: cline at sun.soe.clarkson.edu (Marshall Cline)
Distribution: comp
Organization: (I don't speak for the) ECE Dept, Clarkson Univ, Potsdam, NY
Lines: 44
Xref: swan comp.lang.c++:3019

Benjamin/Cummings just sent me a fresh copy of Grady Booch's new book:
``Object Oriented Design''.  I had heard good things about it 4th hand, and
I must say that I haven't been let down.  I like the numerous good examples,
the Software Engineering approach, and the emphasis on design.  I've skimmed
it, and will give a more complete report in a few weeks.  But my first
impressions were very positive.  It's about time we had a good OOD book!

	Author:		Grady Booch
	Title:		Object Oriented Design with Applications
	Publisher:	Benjamin/Cummings
	ISBN:		0-8053-0091-0
	Copyright:	1991

A couple of initial thoughts: the book is not based on any one OOPL, but
rather gives roughly equal time to C++, Smalltalk, CLOS, Object Pascal, and
Ada.  He doesn't seem to `put down' any one of these, but rather discusses
their relative strengths and weaknesses in a sensible manner.

The book is distinctly *not* a book from which you could learn all the
nuiances of any of these languages; rather it centers on the concepts of how
you do *design* in the OO paradigm.

Booch seems very concerned with unconstrained software complexity.  OOP
isn't just a fun theoretical ideal to him, but it's something which may
alleviate the software crisis we are presently battling.  He's wants
`industrial strength software'.  Healthy dose of reality.

The Section on Applications looks good.  It's quite a healthy chunk of the
book (250 pgs out of around 500 total).  There's a rather large example in
each of the major programming languages.  The key (as I understand Booch's
goals) is not `this language or that', but rather how can these problems be
*designed* using OO technology.  His method is: design a little, implement a
little, think it through and redesign, etc.  Most of us are embarassed to
admit that we do it that way too rather than getting it right the first time.

Marshall Cline
--
==============================================================================
Marshall Cline / Asst.Prof / ECE Dept / Clarkson Univ / Potsdam, NY 13676
cline at sun.soe.clarkson.edu / Bitnet:BH0W at CLUTX / uunet!clutx.clarkson.edu!bh0w
Voice: 315-268-3868 / FAX: 315-268-7600
Career search in progress; ECE faculty; research oriented; will send vita.
==============================================================================
Funky_Stuff
len=`wc -c < NewsArticle1`
if [ $len !=     2882 ] ; then
echo error: NewsArticle1 was $len bytes long, should have been     2882
fi
fi # end of overwriting check
if [ -f NewsArticle2 ]
then
echo shar: will not over-write existing file NewsArticle2
else
echo shar: extracting 'NewsArticle2',     1239 characters
cat > NewsArticle2 <<'Funky_Stuff'
Article: 3375 of +Comp.lang.c++
Path: swan!bbn.com!mit-eddie!rutgers!cs.utexas.edu!usc!samsung!uakari.primate.wisc.edu!uflorida!unf7!shite
From: shite at unf7.UUCP (Stephen Hite)
Newsgroups: comp.lang.c++
Subject: Grady Booch's OOD book is excellent!
Keywords: design
Message-ID: <272 at unf7.UUCP>
Date: 28 Jun 90 05:52:17 GMT
Organization: Univ. of N. Florida, Jacksonville
Lines: 19


  Put "Object Oriented Design With Applications" by Grady Booch on your
"A+ shelf" right next to the others that are already there :-) ("C++ Primer" 
by Stanley Lippman, "C++ Answer Book" by Tony Hansen, the new annotated
C++ reference by Bjarne and "Object-oriented Software Construction by
Bertrand Meyer).

  It reads very well for me...almost reminiscent in its ease of explanation
as Andy Tanenbaum's Operating System book (Minix).  Booch has a great
command of references that blend well with his explanations.  The bibliography
is also truly amazing...I know, I'm probably sounding naieve...but it's
fun learning from someone who knows what they're talking about!  

...Now, if only Andy Koenig would write a "C++ Traps and Pitfalls" book...
I would achieve total nirvana!  :-)

-----------------------------
Steve Hite
...gatech!uflorida!unf7!shite
Funky_Stuff
len=`wc -c < NewsArticle2`
if [ $len !=     1239 ] ; then
echo error: NewsArticle2 was $len bytes long, should have been     1239
fi
fi # end of overwriting check
if [ -f NewsDigest ]
then
echo shar: will not over-write existing file NewsDigest
else
echo shar: extracting 'NewsDigest',    10627 characters
cat > NewsDigest <<'Funky_Stuff'
>From swan!bbn.com!nic!bunny!husc6!rutgers!tut.cis.ohio-state.edu!ucbvax!CSL.SRI.COM!risks Thu Jul  5 10:07:45 EDT 1990
Article 85 of comp.risks:
Path: swan!bbn.com!nic!bunny!husc6!rutgers!tut.cis.ohio-state.edu!ucbvax!CSL.SRI.COM!risks
From: risks at CSL.SRI.COM (RISKS Forum)
Newsgroups: comp.risks
Subject: RISKS DIGEST 10.14
Message-ID: <CMM.0.88.646701765.risks at hercules.csl.sri.com>
Date: 29 Jun 90 23:22:45 GMT
Sender: daemon at ucbvax.BERKELEY.EDU
Reply-To: risks at csl.sri.com
Organization: The Internet
Lines: 208
Approved: risks at csl.sri.com

RISKS-LIST: RISKS-FORUM Digest  Friday 29 June 1990   Volume 10 : Issue 14

        FORUM ON RISKS TO THE PUBLIC IN COMPUTERS AND RELATED SYSTEMS 
   ACM Committee on Computers and Public Policy, Peter G. Neumann, moderator

Contents:
  RISKS WILL BE ON VACATION (RISKS Forum)
  Hubble (Dimitri Mihalas via Mark Bartelt)
  Re: "Unbreakable Math Code Finally Broken" (Richard A. Schumacher)
  More on the Risks of searching the Lexis fulltext database (Peter D. Junger)
  Re: info on carpal tunnel syndrome (Terry Kane)

The RISKS Forum is moderated.  Contributions should be relevant, sound, in good
taste, objective, coherent, concise, and nonrepetitious.  Diversity is welcome.
CONTRIBUTIONS to RISKS at CSL.SRI.COM, with relevant, substantive "Subject:" line
(otherwise they may be ignored).  REQUESTS to RISKS-Request at CSL.SRI.COM.
TO FTP VOL i ISSUE j:  ftp CRVAX.sri.com<CR>login anonymous<CR>AnyNonNullPW<CR>
cd sys$user2:[risks]<CR>GET RISKS-i.j <CR>; j is TWO digits.  Vol summaries in 
risks-i.00 (j=0); "dir risks-*.*<CR>" gives directory listing of back issues.
ALL CONTRIBUTIONS ARE CONSIDERED AS PERSONAL COMMENTS; USUAL DISCLAIMERS APPLY.

----------------------------------------------------------------------

Date: Fri, 29 Jun 1990 13:34:45 PDT
From: RISKS Forum <risks at csl.sri.com>
Subject: RISKS WILL BE ON VACATION

for the next three weeks.  There might be an issue or two, but don't bet on it.
Keep sending in the good stuff in any case.  Thanks.  The Management

------------------------------

Date: Fri, 29 Jun 90 13:20:14 EDT
From: Mark Bartelt <sysmark at orca.cita.utoronto.ca>
Subject: Hubble

[This is a message from Dimitri Mihalas (dmihalas at altair.astro.uiuc.edu).
Mark Bartelt, Canadian Institute of Theoretical Astrophysics]

in case you have not heard: from a reliable inside source i found out that the
problem with ST is that the SOFTWARE driving the polisher was defective. the
corrections for spherical aberration were put in with the wrong sign.
consequently the mirror is not corrected for sph. abb., but has an added dose
of it.
 
the error was not detected during testing because no test with collimated
light was ever done. (editorial remark: unthinkable!) apparently this was
a $30M economy measure in the face of the Challenger accident. likewise
none of the optics were ever tested in vacuum. the primary was and is
"perfect" relative to the specified curve; but alas the specification
was wrong. sigh.
 
from my amateur astronomer days (does that include 1990?) i recall that
spherical aberration is EASY to detect with the foucault test, which is
done with a pinhole, not collimated light. it is hard to believe that
ANYONE could have made such a blunder..
 
the only reason that people know this much is that the same software
was used for AXAF. the errors there were so huge as to be immediately
noticeable, and when the software was corrected, the mirror was "perfect".
i don't know whether the information from axaf was available prior to
the launch of ST, but it seems that it had to be. in which case one
wonders why PE didn't issue a "hold everything!".
 
the future: no chance of bringing the whole telescope down for a refit.
best plan is to design compensating optics into the lightpath for future 
instruments: relatively easy to do. but that will still take 3-5 years.
 
i suppose it's "win a few, lose a few..." but i personally think that
nasa, the government, and the people should stick it into PE and TURN
it hard until they agree to refund the cost of the mistake and of the repairs.
i'm sick of seeing defense and defense-related contractors get away
with bloody murder and just get fatter and fatter on the profits.
 
back to theory
dimitri

------------------------------

Date: 28 Jun 90 18:02:18 GMT
From: schumach at convex.UUCP (Richard A. Schumacher)
Subject: Re: "Unbreakable Math Code Finally Broken"
References: <CMM.0.88.646532535.risks at hercules.csl.sri.com>

Y. Radai <RADAI1 at HBUNOS.BITNET> writes:
>  So the statements that an impenetrable code has been broken and that
>organizations need to change their cryptographic systems because of this
>achievement seem a wee bit exaggerated.

On the other hand, the NPR report mentioned that the Bank of England
was planning to use a 150 digit number as a key in a new transaction
processing system, but changed it to something "much larger" when
they learned of the 9th Fermat prime factoring.

------------------------------

Date: 29 Jun 90 16:25:00 EST
From: junger at cwru.cwru.edu
Subject: More on the Risks of searching the Lexis fulltext database

        A while back I sent to RISKS an (itself rather buggy) description of a
bug that turned up in the Lexis/Nexis database when I was doing date delimited
searches in the library containing the fulltext opinions of the United States
Supreme Court.  A representative of Mead Data Central--the owner of the
Nexis/Lexis service--has since contacted me to explain the nature of the bug
and to assure me that it will be corrected on June 30.

        In the first place, it appears that the bug is _not_ in the
basic software that searches through the database for cases decided on,
after, or before a specified date.  Secondly, it is clear that the bug
did _not_ cause me to miss any cases that I should have located, it just
turned up some additonal cases that were not decided within the period
that I was searching.  That is the good news.

        The bad news is that the problem relates to the way that the
Lexis/Nexis system parses dates in the database and that the proposed
fix will work only until the year 2000, at which time a new variant of
the bug should cause real havoc.

        Here is a corrected version of the type of search that exposed
the bug:

        Entitlement and date(aft 12/31/39 and bef 1/1/50)

That search, when conducted in the Supreme Court file, should find all
opinions, and only those opinions, decided by the United States Supreme
Court during the decade of the 1940's that contained the word
`entitlement'.  (Lexis warned me that it assumed that I meant after
12/31/1939 and before 1/1/1950.)  As it happens, there are no cases that meet
those criteria.  But Lexis reported that it had found a dozen or so
cases--cases that did contain the word `entitlement' but that were
decided in the 1960's, 70's, and 80's.

        It seems that a couple of months ago Mead Data Central decided
to include the argued-date as well as the decided-date within the date
field, and it is this enhancement that caused the bug.  The fix that
will be implimented this Saturday is to once again exclude the
argued-date from the date field.

        Since cases are not always decided in the same year that they
are argued, including the argued-date in the date field will, of course,
cause some cases to be reported as occurring in two different decades,
which would be a nuisance.  But that is only a miniscule part of the
bug.  The real problem occurs because some cases are argued on more than
one date, so that the argued-date field would appear in the database as,
say:  "argued June 22-23, 1980" and the decided date field as: "July 3,
1980)."  At first glance that would not seem to cause any problem.  And
it wouldn't, except for the fact that the Lexis system parses the date
fields in the same way that it parses user input, and thus concludes
that "June 22-23" means "June 22-1923".  Thus our hypothetical case
would have a date of July 3, 1980 (which is after December 31, 1939) and
would also have a date of June 22, 1923 (which is before January 1,
1950).  If that case--decided, you will recall, in 1980--contains the
word `entitlement' it will turn up in my search for cases in the decade
of the 1940's, and in my searches in the 1950's, and in the 1960's, etc.

        I can understand why the system parses user input so as to
interpret 1/1/50 as 1/1/1950--but I never dreamed that a system would
parse its own data.  According to the people at Mead Data Central,
however, their system parses the data fields in exactly the same way
that it parses user input.  It seems that the Lexis/Nexis database
contains texts--especially news reports--with dates in the form
"nn/nn/nn". Today those dates are parsed as "nn/nn/19nn", but what is
going to happen in the year 2000?

        It would seem that ambiguous data in the data base will be much
harder to find and fix than a software bug.

Peter D. Junger, CWRU Law School

------------------------------

Date: 29 Jun 90 19:36:47 GMT
From: tok at stiatl.UUCP (Terry Kane)
Subject: Re: info on carpal tunnel syndrome (CTS)

I am a long time sufferer of CTS.  The first symptoms I recall were during
high school, nearly twenty years ago, but it was not properly diagnosed
until I was in excruciating pain, dropping things, not sleeping because
my hand was burning at night and more, all about four years ago.

Tests said that I had "a very mild case"!?  That reassuring info did not
make my hand better.  I used splints, Motrin, ice until I finally insisted
on the carpal tunnel relief operation.  That was two years ago, this month,
but I still have recurrences - especially when I meet the same RISK which
pushed my CTS over the edge: using a MOUSE.

The typical mouse promotes all the bad habits that can result in CTS symptoms.
One typically rests the heel of the palm on the mouse, and press the chord
keys - frequently with constant pressure (on Apple's mice, the required
pressure is substantial for me, and their new mouse reqlly aggravates the
problem with its stylized, aerodynamic "look").  I cannot use a mouse to this
day without suffering a "mouse hangover".

Track balls are better for me, but I still would rather avoid them.

I am really looking forward to _getting_my_hands_on_ ;-) a touch screen.
I've seen some very nice ones with quite satisfactory resolution!

And please - If you think that you might have CTS - don't waste time.
			See Your M.D.

Terry Kane, Sales Technologies, Inc, Atlanta, GA  (404) 841-4000

------------------------------

End of RISKS-FORUM Digest 10.14
************************


Funky_Stuff
len=`wc -c < NewsDigest`
if [ $len !=    10627 ] ; then
echo error: NewsDigest was $len bytes long, should have been    10627
fi
fi # end of overwriting check
cd ..
echo shar: done with directory Data
fi
if [ -f mp.pro.ps ]
then
echo shar: will not over-write existing file mp.pro.ps
else
echo shar: extracting 'mp.pro.ps',     3592 characters
cat > mp.pro.ps <<'Funky_Stuff'
%!PS-Adobe-1.0
%%Creator: Steve Holden
%%Modified: Rich Burridge
%%Title: @(#)mp.pro.ps 1.7 90/08/29
%%CreationDate: see above
%%PageLength 60
%%LineLength 80
%%DocumentFonts: Times-Bold Times-Roman Courier
%%Pages: (atend)
%%EndComments

/inch { 72 mul } def
/leftedge 0 def
/rightedge 8.5 inch def
/bottomedge 0 def
/topedge 11 inch def
/LandscapeMode false def

%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).

/backspacefont {
    /Courier findfont dup length dict begin
        { %forall
            1 index /FID eq { pop pop } { def } ifelse
        } forall
        currentdict /UniqueID known { %if
              /UniqueID UniqueID 16#800000 xor def
        } if
        CharStrings length 1 add dict begin
            CharStrings { def } forall
          /backspace { -600 0 setcharwidth } bind def
            currentdict
      end
        /CharStrings exch def
        /Encoding Encoding 256 array copy def
        Encoding 8 /backspace put
        currentdict
    end
    definefont
} bind def

/CourierBack backspacefont

/FontSize 9 def
/font1d /Times-Bold            findfont def
/font2d /Times-Roman           findfont def
/font3d /CourierBack           findfont def
/fontHd /Helvetica-BoldOblique findfont 14 scalefont def
/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
/fontNd /Times-Bold            findfont 12 scalefont def

/BoldFont      { font1d FontSize scalefont setfont } def
/pf            { font2d FontSize scalefont setfont } def
/sf            { font3d FontSize scalefont setfont } def
/fontH         { fontHd setfont } def
/fontD         { fontH2 setfont } def
/fontN         { fontNd setfont } def

/graybox	% x1 y1 x2 y2 graybox --
{
    newpath
      4 -1 roll 2 copy			% y2 x1
      10 sub exch moveto
      4 -1 roll 2 copy			% x1 y1
      10 180 270 arc
      4 -1 roll 1 copy 3 -1 roll	% x2 y1
      10 270 0 arc
      3 -1 roll 1 copy 3 1 roll		% x1 y2 x2 y2
      10 0 90 arc
      10 90 180 arc
    closepath
    0.75 setgray fill
} def

/endpage	% page_number endpage --
{
  gsave
    fontH
    leftedge 50 add topedge 56 sub	% bottom lt corner
    rightedge 50 sub topedge 36 sub	% top rt corner
    graybox
    newpath
      rightedge leftedge sub 2 div topedge 46 sub 15 0 360 arc
      gsave
        1 setgray fill
      grestore
    closepath
    0 setgray stroke
    leftedge 50 add topedge 52 sub moveto
    MailFor show
    User show
    fontD
    rightedge 50 sub TimeNow stringwidth pop sub
    topedge 52 sub moveto TimeNow show
    % center the page number
    fontN
    dup stringwidth
       topedge 52 sub exch sub				% y-centered
       exch 2 div rightedge leftedge sub 2 div exch sub	% x-centered
       exch moveto show
    fontH
    leftedge 50 add bottomedge 50 add	% bottom lt corner
    rightedge 50 sub bottomedge 70 add	% top rt corner
    graybox
    0 setgray
    leftedge 50 add bottomedge 54 add moveto Subject show
  grestore
  showpage              % display it
  newpage               % reset parameters for next
} def

/newpage
{
  LandscapeMode {setlandscape} if
  /lct 0 def
  /ypos topedge 92 sub def
  /xpos leftedge 50 add def
  xpos ypos moveto
  sf
} def

/setlandscape
{
  612 0 translate
  90 rotate
  /FontSize 7 def
} def

/Landscape
{
  /LandscapeMode true def
  /rightedge 11 inch def
  /topedge 8.5 inch def
  newpage
} def

/endcol
{
  /lct 0 def
  /ypos topedge 92 sub def
  /xpos rightedge leftedge sub 2 div def
  xpos ypos moveto
} def

/showline
{
  show
  /ypos ypos FontSize sub def
  xpos ypos moveto
} def

newpage	                % establish first page parameters
Funky_Stuff
len=`wc -c < mp.pro.ps`
if [ $len !=     3592 ] ; then
echo error: mp.pro.ps was $len bytes long, should have been     3592
fi
fi # end of overwriting check
if [ -f mp.pro.alt.ps ]
then
echo shar: will not over-write existing file mp.pro.alt.ps
else
echo shar: extracting 'mp.pro.alt.ps',     3444 characters
cat > mp.pro.alt.ps <<'Funky_Stuff'
%!PS-Adobe-1.0
%%Creator: Steve Holden
%%Modified: Rich Burridge
%%Title: @(#)mp.pro.alt.ps 1.3 90/08/29
%%CreationDate: see above
%%PageLength 60
%%LineLength 80
%%DocumentFonts: Times-Bold Times-Roman Courier
%%Pages: (atend)
%%EndComments

/inch { 72 mul } def
/leftedge 0 def
/rightedge 8.5 inch def
/bottomedge 0 def
/topedge 11 inch def
/LandscapeMode false def

%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).

/backspacefont {
    /Courier findfont dup length dict begin
        { %forall
            1 index /FID eq { pop pop } { def } ifelse
        } forall
        currentdict /UniqueID known { %if
              /UniqueID UniqueID 16#800000 xor def
        } if
        CharStrings length 1 add dict begin
            CharStrings { def } forall
          /backspace { -600 0 setcharwidth } bind def
            currentdict
      end
        /CharStrings exch def
        /Encoding Encoding 256 array copy def
        Encoding 8 /backspace put
        currentdict
    end
    definefont
} bind def

/CourierBack backspacefont

/FontSize 9 def
/font1d /Times-Bold            findfont def
/font2d /Times-Roman           findfont def
/font3d /CourierBack           findfont def
/fontHd /Helvetica-BoldOblique findfont 14 scalefont def
/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
/fontNd /Times-Bold            findfont 12 scalefont def

/BoldFont      { font1d FontSize scalefont setfont } def
/pf            { font2d FontSize scalefont setfont } def
/sf            { font3d FontSize scalefont setfont } def
/fontH         { fontHd setfont } def
/fontD         { fontH2 setfont } def
/fontN         { fontNd setfont } def

/graybox	% x1 y1 x2 y2 graybox --
{
    newpath
      4 -1 roll 2 copy			% y2 x1
      10 sub exch moveto
      4 -1 roll 2 copy			% x1 y1
      10 180 270 arc
      4 -1 roll 1 copy 3 -1 roll	% x2 y1
      10 270 0 arc
      3 -1 roll 1 copy 3 1 roll		% x1 y2 x2 y2
      10 0 90 arc
      10 90 180 arc
    closepath
    0.75 setgray fill
} def

/endpage	% page_number endpage --
{
  gsave
    fontH
    leftedge 50 add topedge 56 sub	% bottom lt corner
    rightedge 50 sub topedge 36 sub	% top rt corner
    graybox
    0 setgray stroke
    leftedge 50 add topedge 52 sub moveto
    MailFor show
    User show
    fontD
    rightedge 50 sub TimeNow stringwidth pop sub
    topedge 52 sub moveto TimeNow show
    fontH
    leftedge 50 add bottomedge 50 add	% bottom lt corner
    rightedge 50 sub bottomedge 70 add	% top rt corner
    graybox
    0 setgray
    leftedge 50 add bottomedge 54 add moveto Subject show
    % page number of the left corner
    dup stringwidth
       bottomedge 54 add exch sub		% y-centered
       exch 2 div rightedge 54 sub exch sub	% x-centered
       exch moveto show
  grestore
  showpage              % display it
  newpage               % reset parameters for next
} def

/newpage
{
  LandscapeMode {setlandscape} if
  /lct 0 def
  /ypos topedge 92 sub def
  /xpos leftedge 50 add def
  xpos ypos moveto
  sf
} def

/setlandscape
{
  612 0 translate
  90 rotate
  /FontSize 7 def
} def

/Landscape
{
  /LandscapeMode true def
  /rightedge 11 inch def
  /topedge 8.5 inch def
  newpage
} def

/endcol
{
  /lct 0 def
  /ypos topedge 92 sub def
  /xpos rightedge leftedge sub 2 div def
  xpos ypos moveto
} def

/showline
{
  show
  /ypos ypos FontSize sub def
  xpos ypos moveto
} def

newpage	                % establish first page parameters
Funky_Stuff
len=`wc -c < mp.pro.alt.ps`
if [ $len !=     3444 ] ; then
echo error: mp.pro.alt.ps was $len bytes long, should have been     3444
fi
fi # end of overwriting check
if [ -f mp.pro.filofax.ps ]
then
echo shar: will not over-write existing file mp.pro.filofax.ps
else
echo shar: extracting 'mp.pro.filofax.ps',     4808 characters
cat > mp.pro.filofax.ps <<'Funky_Stuff'
%!PS-Adobe-1.0
%%Creator: Steve Holden
%%Modifed: Rich Burridge
%%Title: @(#)mp.pro.filofax.ps 1.4 90/08/29
%%CreationDate: see above
%%PageLength 60
%%LineLength 80
%%DocumentFonts: Times-Bold Times-Roman Courier
%%Pages: (atend)
%%EndComments

%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).

/backspacefont {
    /Courier findfont dup length dict begin
        { %forall
            1 index /FID eq { pop pop } { def } ifelse
        } forall
        currentdict /UniqueID known { %if
              /UniqueID UniqueID 16#800000 xor def
        } if
        CharStrings length 1 add dict begin
            CharStrings { def } forall
          /backspace { -600 0 setcharwidth } bind def
            currentdict
      end
        /CharStrings exch def
        /Encoding Encoding 256 array copy def
        Encoding 8 /backspace put
        currentdict
    end
    definefont
} bind def
 
/CourierBack backspacefont
 
/FontSize 11 def
/font1d /Times-Bold            findfont def
/font2d /Times-Roman           findfont def
/font3d /CourierBack           findfont def
/fontHd /Helvetica-BoldOblique findfont 15 scalefont def
/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
/fontNd /Times-Bold            findfont 12 scalefont def

/BoldFont      { font1d FontSize scalefont setfont } def
/pf            { font2d FontSize scalefont setfont } def
/sf            { font3d 10       scalefont setfont } def
/fontH         { fontHd setfont } def
/fontD         { fontH2 setfont } def
/fontN         { fontNd setfont } def


sf
%% stick in all the fudge factors here. May need changing for page sizes,
%% laserwriter setups etc?
%%
/binderspace 100 def
/filowidth 484 def
/filoheight 972 def
/margin 12 def
/xleft binderspace 6 add def
/yco filoheight 50 sub def			% space at the top
/xright filowidth binderspace add 30 sub def	% space at right

/endpage
{
  gsave
    fontH
    % draw the top for owner
    newpath
      xleft 10 sub yco moveto
      xleft yco 20 sub 10 180 270 arc
      xright yco 20 sub 10 270 0 arc
      xright yco 10 0 90 arc
      xleft yco 10 90 180 arc
    closepath
    0.90 setgray fill
    0 setgray stroke
    xleft yco 16 sub moveto
    MailFor show
    User show
    fontD
    TimeNow stringwidth pop neg xright add yco 16 sub moveto TimeNow show
    fontN
    % dup stringwidth pop 2 div neg 318 add 858 moveto show
    fontH
    % lower box for subject etc
    newpath
      xleft 10 sub 60 moveto
      xleft 40 10 180 270 arc
      xright 40 10 270 0 arc
      xright 60 10 0 90 arc
      xleft 60 10 90 180 arc
    closepath
    0.90 setgray fill
    % stick the page number just a few points in from the right hand edge
    newpath
      xright 10 sub 50 15 0 360 arc
      gsave
        1 setgray fill
      grestore
    closepath
    0 setgray stroke
    xleft 44 moveto Subject show
    fontN
    % position and print the page number
    dup stringwidth pop 2 div neg xright 10 sub add 46 moveto show
    fontH
  grestore
  modu 2 eq eof 0 ne or { showpage } if	% do a 'form feed'
					% if ready for it
  eof 0 eq { newpage } if	% reset parameters for next if not end of file
} def

/endfile
{
     /eof 1 def
     endpage
} def

/xo 36 def
/yo 0 def
/pageno 0 def
/modu pageno 3 mod def	% get mod to work out page pos
/eof 0 def

/weearc			% draws a little arc to show where the holes go
{ newpath
  xo yo 4 0 360 arc
  closepath
  fill
} def

/filopage
{ gsave
%  24 -118 translate
  /xstart filowidth modu mul def
  /xstart xstart binderspace add def
  /xfin xstart filowidth add def
  modu 0 eq {		% first break
	/yo 130 def	% show where the holes should be punched
	weearc		% except that they will normally be off the edge of
	/yo 238 def	% the page
	weearc
	/yo 346 def
	weearc
	/yo 639 def
	weearc
	/yo 742 def
	weearc
	/yo 850 def
	weearc
  } if
  [1 4] 0 setdash	% use dashed lines for marker
  newpath
  xstart 0 moveto
  xfin 0 lineto
  xfin filoheight lineto
  stroke
  grestore
} def

/newpage
{ 
  pageno 0 eq {			% set initial values for landscape drawing
        0.5 0.5 scale
        90 rotate
        -50 0 translate
        gsave			% save state for easy restore
	/eof 0 def
  } {
        grestore gsave		% return to preferred original state
  } ifelse			% initial setup

  /modu pageno 3 mod def	% get mod to work out page pos
  0 0 filoheight sub translate	% initial position (-filoheight)
  filopage			% draw neccessary page breaks
  /times filowidth modu mul def % shift origin as far right as needed
  /times times margin add def	% move right by fudge factor 12
  times 0 translate
  /lct 0 def
  /ypos filoheight 110 sub def
  xleft ypos moveto
  /pageno pageno 1 add def	% add one for the next time
} def

/showline
{
  show
  /ypos ypos 12 sub def
  xleft ypos moveto
} def

newpage			% establish first page parameters
Funky_Stuff
len=`wc -c < mp.pro.filofax.ps`
if [ $len !=     4808 ] ; then
echo error: mp.pro.filofax.ps was $len bytes long, should have been     4808
fi
fi # end of overwriting check
if [ -f mp.pro.timeman.ps ]
then
echo shar: will not over-write existing file mp.pro.timeman.ps
else
echo shar: extracting 'mp.pro.timeman.ps',     4808 characters
cat > mp.pro.timeman.ps <<'Funky_Stuff'
%!PS-Adobe-1.0
%%Creator: Steve Holden
%%Modifed: Rich Burridge
%%Title: @(#)mp.pro.timeman.ps 1.4 90/08/29
%%CreationDate: see above
%%PageLength 60
%%LineLength 80
%%DocumentFonts: Times-Bold Times-Roman Courier
%%Pages: (atend)
%%EndComments

%Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).

/backspacefont {
    /Courier findfont dup length dict begin
        { %forall
            1 index /FID eq { pop pop } { def } ifelse
        } forall
        currentdict /UniqueID known { %if
              /UniqueID UniqueID 16#800000 xor def
        } if
        CharStrings length 1 add dict begin
            CharStrings { def } forall
          /backspace { -600 0 setcharwidth } bind def
            currentdict
      end
        /CharStrings exch def
        /Encoding Encoding 256 array copy def
        Encoding 8 /backspace put
        currentdict
    end
    definefont
} bind def
 
/CourierBack backspacefont
 
/FontSize 12 def
/font1d /Times-Bold            findfont def
/font2d /Times-Roman           findfont def
/font3d /CourierBack           findfont def
/fontHd /Helvetica-BoldOblique findfont 15 scalefont def
/fontH2 /Helvetica-BoldOblique findfont 10 scalefont def
/fontNd /Times-Bold            findfont 12 scalefont def

/BoldFont      { font1d FontSize scalefont setfont } def
/pf            { font2d FontSize scalefont setfont } def
/sf            { font3d 11       scalefont setfont } def
/fontH         { fontHd setfont } def
/fontD         { fontH2 setfont } def
/fontN         { fontNd setfont } def

sf
%% stick in all the fudge factors here. May need changing for page sizes,
%% laserwriter setups etc?
%%
/binderspace 100 def
/filowidth 520 def
/filoheight 1024 def
/margin 12 def
/xleft binderspace 6 add def
/yco filoheight 50 sub def			% space at the top
/xright filowidth binderspace add 30 sub def	% space at right

/endpage
{
  gsave
    fontH
    % draw the top for owner
    newpath
      xleft 10 sub yco moveto
      xleft yco 20 sub 10 180 270 arc
      xright yco 20 sub 10 270 0 arc
      xright yco 10 0 90 arc
      xleft yco 10 90 180 arc
    closepath
    0.90 setgray fill
    0 setgray stroke
    xleft yco 16 sub moveto
    MailFor show
    User show
    fontD
    TimeNow stringwidth pop neg xright add yco 16 sub moveto TimeNow show
    fontN
    % dup stringwidth pop 2 div neg 318 add 858 moveto show
    fontH
    % lower box for subject etc
    newpath
      xleft 10 sub 60 moveto
      xleft 40 10 180 270 arc
      xright 40 10 270 0 arc
      xright 60 10 0 90 arc
      xleft 60 10 90 180 arc
    closepath
    0.90 setgray fill
    % stick the page number just a few points in from the right hand edge
    newpath
      xright 10 sub 50 15 0 360 arc
      gsave
        1 setgray fill
      grestore
    closepath
    0 setgray stroke
    xleft 44 moveto Subject show
    fontN
    % position and print the page number
    dup stringwidth pop 2 div neg xright 10 sub add 46 moveto show
    fontH
  grestore
  modu 2 eq eof 0 ne or { showpage } if	% do a 'form feed'
					% if ready for it
  eof 0 eq { newpage } if	% reset parameters for next if not end of file
} def

/endfile
{
     /eof 1 def
     endpage
} def

/xo 36 def
/yo 0 def
/pageno 0 def
/modu pageno 3 mod def	% get mod to work out page pos
/eof 0 def

/weearc			% draws a little arc to show where the holes go
{ newpath
  xo yo 4 0 360 arc
  closepath
  fill
} def

/filopage
{ gsave
%  24 -118 translate
  /xstart filowidth modu mul def
  /xstart xstart binderspace add def
  /xfin xstart filowidth add def
  modu 0 eq {		% first break
	/yo 130 def	% show where the holes should be punched
	weearc		% except that they will normally be off the edge of
	/yo 238 def	% the page
	weearc
	/yo 346 def
	weearc
	/yo 639 def
	weearc
	/yo 742 def
	weearc
	/yo 850 def
	weearc
  } if
  [1 4] 0 setdash	% use dashed lines for marker
  newpath
  xstart 0 moveto
  xfin 0 lineto
  xfin filoheight lineto
  stroke
  grestore
} def

/newpage
{ 
  pageno 0 eq {			% set initial values for landscape drawing
        0.5 0.5 scale
        90 rotate
        -50 0 translate
        gsave			% save state for easy restore
	/eof 0 def
  } {
        grestore gsave		% return to preferred original state
  } ifelse			% initial setup

  /modu pageno 3 mod def	% get mod to work out page pos
  0 0 filoheight sub translate	% initial position (-filoheight)
  filopage			% draw neccessary page breaks
  /times filowidth modu mul def % shift origin as far right as needed
  /times times margin add def	% move right by fudge factor 12
  times 0 translate
  /lct 0 def
  /ypos filoheight 110 sub def
  xleft ypos moveto
  /pageno pageno 1 add def	% add one for the next time
} def

/showline
{
  show
  /ypos ypos 12 sub def
  xleft ypos moveto
} def

newpage			% establish first page parameters
Funky_Stuff
len=`wc -c < mp.pro.timeman.ps`
if [ $len !=     4808 ] ; then
echo error: mp.pro.timeman.ps was $len bytes long, should have been     4808
fi
fi # end of overwriting check



More information about the Comp.sources.misc mailing list