%! a2ps 3.0 /$a2psdict 100 dict def $a2psdict begin % Initialize page description variables. /inch {72 mul} bind def /landscape true def /twinpage false def /sheetheight 11 inch def /sheetwidth 8.5 inch def /margin 1.2 inch def /noborder false def /noheader true def /headersize 0.0 def /bodyfontsize 12 def /lines 42 def /columns 97 def /date (May 9 1993 11:58:10) def %! PostScript Source Code % % File: imag:/users/local/a2ps/header.ps % Created: Tue Nov 29 12:14:02 1988 by miguel@imag (Miguel Santana) % Version: 2.0 % Description: PostScript prolog for a2ps ascii to PostScript program. % % Edit History: % - Original version by evan@csli (Evan Kirshenbaum). % - Modified by miguel@imag to: % 1) Correct an overflow bug when printing page number 10 (operator % cvs). % 2) Define two other variables (sheetwidth, sheetheight) describing % the physical page (by default A4 format). % 3) Minor changes (reorganization, comments, etc). % - Modified by tullemans@apolloway.prl.philips.nl % 1) Correct stack overflows with regard to operators cvs and copy. % The resulting substrings where in some cases not popped off % the stack, what can result in a stack overflow. % 2) Replaced copypage and erasepage by showpage. Page througput % degrades severely (see red book page 140) on our ps-printer % after printing sheet 16 (i.e. page 8) of a file which was % actually bigger. For this purpose the definitions of startdoc % and startpage are changed. % - Modified by Tim Clark to: % 1) Print one page per sheet (portrait) as an option. % 2) Reduce size of file name heading, if it's too big. % 3) Save and restore PostScript state at begining/end. It now uses % conventional %%Page %%Trailer markers. % 4) Print one wide page per sheet in landscape mode as an option. % - Modified by miguel@imag.fr to % 1) Add new option to print n copies of a file. % 2) Add new option to suppress heading printing. % 3) Add new option to suppress page surrounding border printing. % 4) Add new option to change font size. Number of lines and columns % are now automatically adjusted, depending on font size and % printing mode used. % 5) Minor changes (best layout, usage message, etc). % % Copyright (c) 1988, Miguel Santana, miguel@imag.imag.fr % % Permission is granted to copy and distribute this file in modified % or unmodified form, for noncommercial use, provided (a) this copyright % notice is preserved, (b) no attempt is made to restrict redistribution % of this file, and (c) this file is not distributed as part of any % collection whose redistribution is restricted by a compilation copyright. % % General macros. /xdef {exch def} bind def /getfont {exch findfont exch scalefont} bind def % Page description variables and inch function are defined by a2ps program. % Character size for differents fonts. landscape { /filenamefontsize 12 def } { /filenamefontsize 16 def } ifelse /datefontsize filenamefontsize 0.8 mul def /headermargin filenamefontsize 0.25 mul def /bodymargin bodyfontsize 0.7 mul def % Font assignment to differents kinds of "objects" /filenamefontname /Helvetica-Bold def /stdfilenamefont filenamefontname filenamefontsize getfont def /datefont /Helvetica datefontsize getfont def /bodyfont /Helvetica-Bold bodyfontsize getfont def % Logical page attributs (a half of a real page or sheet). /pagewidth bodyfont setfont (0) stringwidth pop columns mul bodymargin dup add add def /pageheight bodyfontsize lines mul bodymargin dup add add headersize add def % Coordinates for upper corner of a logical page and for sheet number. % Coordinates depend on format mode used. % In twinpage mode, coordinate x of upper corner is not the same for left % and right pages: upperx is an array of two elements, indexed by sheetside. /rightmargin margin 3 div def /leftmargin margin 2 mul 3 div def /topmargin margin twinpage {3} {2} ifelse div def landscape { % Landscape format /uppery rightmargin pageheight add bodymargin add def /sheetnumbery sheetwidth leftmargin pageheight add datefontsize add sub def twinpage { % Two logical pages /upperx [ topmargin % upperx for left page dup 2 mul pagewidth add % upperx for right page ] def /sheetnumberx sheetheight topmargin sub def } { /upperx [ topmargin dup ] def /sheetnumberx sheetheight topmargin sub datefontsize sub def } ifelse } { % Portrait format /uppery topmargin pageheight add def /upperx [ leftmargin dup ] def /sheetnumberx sheetwidth rightmargin sub datefontsize sub def /sheetnumbery sheetheight topmargin pageheight add datefontsize add headermargin add sub def } ifelse % Strings used to make easy printing numbers /pnum 12 string def /empty 12 string def % Other initializations. /datewidth date stringwidth pop def /filenameroom pagewidth filenamefontsize 4 mul datewidth add (Page 999) stringwidth pop add sub def % Function startdoc: initializes printer and global variables. /startdoc { /sheetside 0 def % sheet side that contains current page /sheet 1 def % sheet number } bind def % Function newfile: init file name and reset page number for each new file. /newfile { cleanup /filename xdef /filenamewidth filename stringwidth pop def /filenamefont filenamewidth filenameroom gt { filenamefontname filenamefontsize filenameroom mul filenamewidth div getfont } { stdfilenamefont } ifelse def /pagenum 1 def } bind def % Function printpage: Print a physical page. /printpage { /sheetside 0 def twinpage { noborder not { sheetnumber } if } { noheader noborder not and { sheetnumber } if } ifelse showpage % pagesave restore /sheet sheet 1 add def } bind def % Function cleanup: terminates printing, flushing last page if necessary. /cleanup { twinpage sheetside 1 eq and { printpage } if } bind def % % Function startpage: prints page header and page border and initializes % printing of the file lines. /startpage { sheetside 0 eq { % /pagesave save def landscape { sheetwidth 0 inch translate % new coordinates system origin 90 rotate % landscape format } if } if noborder not { printborder } if noheader not { printheader } if upperx sheetside get bodymargin add uppery bodymargin bodyfontsize add noheader {0} {headersize} ifelse add sub moveto bodyfont setfont } bind def % Function printheader: prints page header. /printheader { upperx sheetside get uppery headersize sub 1 add moveto datefont setfont gsave datefontsize headermargin rmoveto date show % date/hour grestore gsave pagenum pnum cvs pop pagewidth (Page 999) stringwidth pop sub headermargin rmoveto (Page ) show pnum show % page number grestore empty pnum copy pop gsave filenamefont setfont filenameroom filename stringwidth pop sub 2 div datewidth add bodymargin 2 mul add headermargin rmoveto filename show % file name grestore } bind def % Function printborder: prints border page. /printborder { upperx sheetside get uppery moveto gsave % print the four sides pagewidth 0 rlineto % of the square 0 pageheight neg rlineto pagewidth neg 0 rlineto closepath stroke grestore noheader not { 0 headersize neg rmoveto pagewidth 0 rlineto stroke } if } bind def % % Function endpage: adds a sheet number to the page (footnote) and prints % the formatted page (physical impression). Activated at the end of each % source page (lines reached or FF character). /endpage { /pagenum pagenum 1 add def twinpage sheetside 0 eq and { /sheetside 1 def } { printpage } ifelse } bind def % Function sheetnumber: prints the sheet number. /sheetnumber { sheetnumberx sheetnumbery moveto datefont setfont sheet pnum cvs dup stringwidth pop (0) stringwidth pop sub neg 0 rmoveto show empty pnum copy pop } bind def % Function s: print a source line /s { gsave show grestore 0 bodyfontsize neg rmoveto } bind def %%EndProlog /docsave save def startdoc (THEOREMS) newfile /sheet 1 def %%Page: 1 1 startpage ( THE PERILS OF PROMISCUOUS PARALLEL PROGRAMMING :) s ( ) s ( THEOREMS FROM CLUSTERING HELL) s ( ) s ( ) s ( ) s ( ) s ( 1. " One has no business working their buns off on something) s ( if they don't know what they are supposed to be doing. ") s ( ) s ( ) s ( 2. " Clustering certainly will uncover novel new ways to double-cross NFS, schedulers and TCP/IP) s ( and thus bring even the most robust system to its knees. ") s ( ) s ( ) s ( 3. " There never was, nor will there ever be 'Magic' to rescue us on this project ") s ( ) s ( ) s ( 4. " When it is clear that the mess you face is due to an application bug,) s ( it will turn out to to be a failure in the compiler or O.S...and vice versa ") s ( ) s ( ) s ( 5. " The 'patch' you are working on now will solve a problem) s ( completely unrelated to the one you started with. ") s ( ) s ( ) s ( 6. " If 'the boss' is actually mucking around in the code the project is in deep trouble. ") s ( ) s ( ) s ( 7. " "The 'patch' you install today will return to haunt you in some other gawdawful way. ") s ( ) s ( ) s ( 8. " Everyone seems to want a prediction or explanation from me,) s ( and even my most thoughtful E-mail is misunderstood. ") s ( ) s ( ) s ( 9. " The show is not over until the fat lady sings AND) s ( you have personally introduced yourself to every single line of code in the program. ") s endpage %%Trailer cleanup docsave restore end .