Best of Jokes Current Jokes RHF Home Search Sponsor RHF?
Fun Stuff & Jokes
Previous | RHF Joke Archives | Next

Re: Change bulb in sed?

steven@prl.philips.nl (Steven Van Lerberghe 42468)
none
(computer, smirk)

In article <S274.749d@looking.on.ca> gest_ss@uhura.cc.rochester.edu (Gavin Stark) writes:
>
>How many lines of sed code does it take to change a lightbulb?
>
>I don't know... but its only 74 in Postscript.
>--
>Edited by Brad Templeton.  MAIL your jokes (jokes ONLY) to funny@looking.ON.CA

%!
/bulb                         % draw a light-bulb with text `ID' in it
{gsave                        % called as:
translate rotate              % <orientation> <x-place> <y-place> bulb
0.5 0.5 scale                 %
/alfa 41.40962211 def         % some angle that puts the centers of
/sina alfa sin -2 mul def     % the necessary arcs at coordinates
                              % (0,0) (-1.5, -2*sine of alfa) (or:
newpath                       % -1.5, sina) and (1.5, sina) 
0.4 sina 0.1 270 360 arc      % rounded left-bottom corner
1.5 sina 1 180 180 alfa sub arcn % outline of buld
0 0 1 alfa neg 180 alfa add arc  % in three consecutive
-1.5 sina 1 alfa 0 arcn       % ...outline of bulb in three consec. arc
-0.4 sina 0.1 180 270 arc     % rounded right-bottom corner
closepath 0.925 setgray  fill % draw it in `almost-white'
                              %
newpath                       %
-0.4 sina 0.1 sub moveto      % and this draws the `fitting'
0 -0.45 rlineto
-0.35 sina 0.55 sub 0.05 180 270 arc
0.7 0 rlineto
0.35 sina 0.55 sub 0.05 270 360 arc
0 0.45 rlineto
closepath  0.5 setgray  fill  % ...partly in half-gray
                              %
newpath                       %
-0.3 sina 0.6 sub moveto      %
0.1 -0.1 rlineto 0.4 0 rlineto
0.3 sina 0.6 sub lineto       %
closepath  0 setgray  fill    % ...and partly in black
                              %
newpath  0.9775 setgray       % ...plus some `light rays'
0.025 setlinewidth
-45 rotate 1 1 7 {1.1 0 moveto
1.6 0 lineto 45 rotate pop} for
90 rotate stroke

newpath                       % this is the text `ID'
/Helvetica-Bold findfont      %
1 scalefont setfont           % ...set in the center
0 0 moveto  (ID) dup          % 
stringwidth pop 2 div neg -0.5 rmoveto
0.5 1 1 sethsbcolor show grestore } def % ...also in black

300 425 translate 150 150 scale
0 0 0 bulb                    % an example of a call

showpage

(From the "Rest" of RHF)


Previous | RHF Joke Archives | Next

Best of Jokes | Current Jokes | RHF Home | Search