./ 755 0 0 0 10666112066 75235ustar00stevesteve./foils-example.ms 644 0 0 3510 10666112064 12626ustar00stevesteve.au "RBK \- style.00" FIRST .sp 5 .c C Programming Style .sp 3 .ce 999 Rob Kolstad, Ph.D. Sun Microsystems, Inc. .T kolstad@sun.com .ce 0 .c A tip of the hat to Bill Shannon & Warren Tietelman .c Copyright \(co 19\n(yr, Kolstad .bp .au "RBK \- style.01" .c Why Discuss Style? .2 Software is not read-only .2 Consistent style can reduce maintenance .2 Some styles can encourage bug-reducing disciplines .2 Consistent style can enhance everyone's ability to read, understand, and repair others' code .bp .au "RBK \- style.02" .c A ``Perfect'' Style .2 Style is often religious \- religion is not the focus of this talk .2 No one style is ``the correct answer'' .2 The key to style at your site is consistency .3 Which style you choose is not the important issue .3 Choosing one for your site is the important matter .bp .au "RBK \- style.03" .c Style Goals .2 A good style: .sp 0.5 .3 Is readable \- not obscure .sp 0.5 .3 Is maintainable \- you can pick code up a year later and still understand it .sp 0.5 .3 Is reasonably concise .sp 0.5 .3 Promotes bug-free code .sp 0.5 .3 Is appealing .2 We'll assume that everyone is already sold on ``structured programming'' .bp .au "RBK \- style.04" .c Aspects of Style .2 Syntax (visual impact of code) .3 Statements .3 Blocks .3 Functions .3 Files .3 Mechanical assistance is often available .2 Semantic \- see ``The Elements of Programming Style'' by Kernighan and Plauger, McGraw Hill, 2nd Ed., 1978 .2 Idioms \- standard, popular programming snippets that are in widespread use .bp .au "RBK \- style.05" .c Outline .2 White Space & Indentation .2 Statements .2 Control Statements .2 Comments .2 Declarations .2 Naming .2 Initialization & Multiple Assignments .2 File organization .2 Portability .2 .T lint and .T make .2 Idioms .2 Mechanical Indengers .2 Source control systems .2 Miscellany .bp ./foils-howto.txt 644 0 0 5323 10666112066 12541ustar00stevesteve How to use the -mf slide macros by Rob Kolstad The RBK slide-making macros (aka foil-making macros) are so easy to use it's almost unbelievable. There are only a very small number of macros. We'll cover each of them here. Overview The macros have fixed sizes, fonts, and formats for the slides. I believe that a fixed format allows the audience to concentrate on the information rather than the boilerplate of the slide itself. Each slide has a pleasant border with rounded corners and the current date in the lower left corner. Optionally, you can put a small phrase centered in the bottom line of the border (e.g., your initials and/or a slide number). Page numbers appear below the border on the right side of the slide. You'll have to figure out how to do landscape style output for site. I'll call the program `troff' and assume that -L does landscape mode. Print slides using the following command (or its equivalent): % troff -L foilmacros file.with.slides Don't forget the -L on the troff commands as the slides are printed rotated (i.e., in landscape mode). Using the macros Include .au "author information" \" or anything else if you wish to have some information printed in the middle of the lower line. I personally do this: .au "RBK \- FileName" at the front of EACH file I use for slides. I generally separate slides into many many files for easy editing and reprinting. You may choose a different technique. It's easy to print text on slides. Lines can be centered (.c), left justified (.1), left justified with a solid round bullet (.2), left justified with a hollow round bullet (.3), or left justified with a hollow square bullet (.4). I never use the .1 (unbulleted) headings. I like bullets. To specify a line, choose one of two formats: .c "Line to be centered" or .c Bunch of text to be centered \" one line only for .c I find the second way much easier to type and a bit easier to read/debug. Both schemes create the same results. The .c macro takes only a single line to be centered if invoked without the text. The other macros work just find with multiple lines of text. I like to start my slides with a .c line -- but always put a blank line before it so it looks nice on the page. You must enter your own page breaks: .bp between each slide. Here's a typical example of a slide: <--- blank line .c This is an example slide <--- title of this slide <--- blank line .2 This is the important first bullet .3 This is a semi-important sub-bullet .3 This is a semi-important sub-bullet <--- blank line .2 This is the important second bullet .3 This is a semi-important sub-bullet .3 This is a semi-important sub-bullet .bp <--- to next page Good luck! Rob ./tmac.foils 644 0 0 7573 10666112067 11522ustar00stevesteve'\" macro package for making foils 'if \n(mo-0 .ds mo Jan 'if \n(mo-1 .ds mo Feb 'if \n(mo-2 .ds mo Mar 'if \n(mo-3 .ds mo Apr 'if \n(mo-4 .ds mo May 'if \n(mo-5 .ds mo Jun 'if \n(mo-6 .ds mo Jul 'if \n(mo-7 .ds mo Aug 'if \n(mo-8 .ds mo Sept 'if \n(mo-9 .ds mo Oct 'if \n(mo-10 .ds mo Nov 'if \n(mo-11 .ds mo Dec 'ds DA \\*(mo \n(dy, 19\n(yr 'na 'ft PB 'ps 23 'ds FT (PB 'vs 23 '\" Parameters: 'nr PW 11i \" PW=paper width 'nr PH 8.5i \" PH=paper height 'nr MB 1i \" MB=margin border 'nr MT 0.5i \" MT=margin text 'nr BW \n(PWu-\n(MBu-\n(MBu \" BW=border width 'nr TW \n(BWu-\n(MTu-\n(MTu \" TW=text width .nr C 0.5i \" C =corner radius 'nr PT \n(MBu+\n(MTu \" PT=page offset for text 'nr BB \n(PHu-\n(MBu \" BB=bottom of box '\" 0.7i is the amount the logo sticks up over line 'nr CH 0.6i \" CH=height of logo (above base)/2 'nr BT \n(BBu-\n(CHu-1v \" BT=bottom of text 'if \nL=1 \{\ ' tm Setting bottom line for no logo ' nr BT \n(BBu-1v \" BT=bottom of text (no logo) '\} 'nr CW 2.3i \" CW=width of logo ' \" MW=width of middle title ' \" DW=width of date 'pl \n(PHu 'll \n(TWu 'lt \n(Twu 'ev 1 'll \n(TWu 'lt \n(TWu 'ev 'po \n(PTu 'wh \n(BTu fa .de au .if ^\\$2^FIRST^ .M4 'ds ff "'' \fR\&\\$1 ' \\*(DA\fP '" 'ds RF \&\\$1 .if ^\\$2^FIRST^ .nn .. .de hd \" header 'sp \\n(MBu .\"'sp \\n(MTu .. 'wh 0 hd 'ds ff "''' \*(DA '" 'de Ft \" footer 'ds ff \&\\$1 .. .de fa .ch fa .ev 1 .vs 0 .sp |\\n(MBu .po \\n(MBu .nr W \\n(BWu-\\nCu-\\nCu \" actual width for box drawing .nr H \\n(PHu-\\n(MBu-\\n(MBu-\\nCu-\\nCu \" actual height for box 'ie !^\\*(RF^^ 'nr MW \w'\s9 \\*(RF \s0'u 'el 'nr MW 0 'nr DW \w'\s9 \\*(DA \s0'u \" DW=width of date .nr a1 ((\\n(BWu-\\n(MWu)/2u)-\\nCu \" width of half of bottom straight line .nr a2 \\n(a1u-\\n(CWu .nr a3 \\n(a1u-\\n(DWu .ps 36 .ds Z \h'\\n(CWu' .if \\nL .ds Z \D'l \\n(CWu 0' .if \\n(NB=0 \{\ .\" Maybe your troff allows you to make thicker lines: \D't 12u' \v'\\nCu'\D'l 0 \\nHu'\D'a \\nCu 0 0 \\nCu'\\*Z\D'l \\n(a2u 0'\h'\\n(MWu'\D'l \\n(a3u 0'\h'\\n(DWu'\D'a 0 -\\nCu \\nCu 0'\D'l 0 -\\nHu'\D'a -\\nCu 0 0 -\\nCu'\D'l -\\nWu 0'\D'a 0 \\nCu -\\nCu 0' .br .\} .ps .po .sp |\\n(BBu 'ps 9 .sp 3p \" to center on the line instead of have baseline on line .if \\n(NB=0 'tl \\*(ff 'ps .if !\\nL \{\ .tm you sly dog -- you set L to 0! No logo for you. .\} .vs .if \\nP \{\ . sp |\\n(BBu . sp 0.5i . po 0.4i . nr QQ \\n(PW-0.4i-0.4i . lt \\n(QQu . tl '''\f(CW\s14Page %\s0\fP' . lt . po .\} 'bp .ev .wh \\n(BTu fa .. .de c .in 0 .ce .if !^^\\$1^ \&\\$1 .. .de 1 .in \w' 'u .ti -\w' 'u .if !^^\\$1^ \&\\$1 .. .de 2 .in 0.5i .ti -\w'\(bu\h^0.15i^'u \(bu\h^0.15i^\c .if !^^\\$1^ \&\\$1 .. .de 3 .in 1.0i .ti -\w^\(ci\h'0.15i'^u \(ci\h'0.15i'\c .ft PB .if !^^\\$1^ \&\\$1 .. .de 4 .in 1.5i .ti -\w'\s(26\fB\(sq\fP\s0\h^0.15i^'u \s(26\fB\v'0.02i'\(sq\v'-0.02i'\fP\s0\h'0.15i'\c .if !^^\\$1^ \&\\$1 .. .de n .in \\$1 .ti -\w^\\$2^ \&\\$2 .sp -1 .if !^^\\$3^ \&\\$3 .. .ds FF (CB .de b .ft CB .ps 23 .nr X 8*\w' 'u .ta +\\nXu +\\nXu +\\nXu +\\nXu +\\nXu +\\nXu +\\nXu +\\nXu .nf .. .de e .ft PB .ps 23 .vs 23 .fi .. .de TA .ds ZZ \\f(CB\\s(23 \\*(ZZ\c .. .de ET 'ft PB 'ps 23 'vs 23 'fi .. .de T .ds ZZ \\f(CB\\s(23 \&\\*(ZZ\\$1\fP\s0\\$2\& \\$3 \\$4 \\$5 \\$6 .. .hy 0 .de sz .ps \\$1 .vs \\$1 .. .de PS \" $1 is height, $2 is width, both in inches .sp .3 .in (\\n(.lu-\\$2)/2u .ne \\$1 .. .de PE .in .sp .6 .. .de nn .tm Slide \\*(RF starts on page \\n% .. .de M4 .br .nr NB 1 'ds ff "''' \*(DA '" 'ds RF\" .nr QQ \\n%-(\\n%/4*4) .if !'1'\\n(QQ' .bp .nr QQ \\n%-(\\n%/4*4) .if !'1'\\n(QQ' .bp .nr QQ \\n%-(\\n%/4*4) .if !'1'\\n(QQ' .bp .nr QQ \\n%-(\\n%/4*4) .if !'1'\\n(QQ' .ab M4 left me on page \\n%???????? .nr NB 0 .. .de HH .di NT .ps 60 .vs 60 \\$1 .br .ps .vs .di .nr Uw \\n(dlu+0.5i .nr Uh \\n(dnu+0.2i .sp |3.35i .nr QQ (\\n(.lu-\\n(Uwu)/2u \h'\\n(QQu'\D'l \\n(Uwu 0'\D'l 0 \\n(Uhu'\D'l -\\n(Uwu 0'\D'l 0 -\\n(Uhu' .sp 0.45i .ce .NT .. .br .nr P 1 .nr L 1