This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//xcr.c | |
//cc -o xcr $(pkg-config --cflags --libs cairo xcb xcb-icccm) xcr.c -lcairo -lxcb -lxcb-icccm | |
#include <stdlib.h> | |
#include <string.h> | |
#include <cairo.h> | |
#include <cairo-xcb.h> | |
#include <xcb/xcb.h> | |
#include <xcb/xcb_image.h> | |
#include <xcb/xcb_aux.h> | |
#include <xcb/xcb_icccm.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/starpath { % n r1 r2 x y | |
matrix currentmatrix 6 1 roll % [] n r1 r2 x y | |
translate % [] n r1 r2 | |
10 dict begin {/r2 /r1 /n} {exch def}forall % [] | |
/da 360 n div def | |
r2 0 moveto | |
n { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# labels.pl reads csv records in the form: | |
# "Name","123 Street","Apt","City, ST ZIP" | |
# from a file named "addr.csv" and | |
# produces a postscript program on stdout | |
# suitable for piping into ps2pdf or | |
# even distiller, maybe | |
# CAVEATS: prototype produces at most | |
# one page. label and sheet sizes are hard-coded | |
# at 3 3-inch-width labels which are 4*17 points |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://www.ams.org/journals/mcom/1954-08-046/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
enum { LOW = -10000, HIGH = 10000 }; | |
char *P = "01"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%1 http://www.ams.org/journals/mcom/1954-08-046/ | |
/init{ | |
P{ %check P for validity | |
W 1 ne {ERROR:W_p!=1} if | |
}forall | |
/Ptab << | |
P { | |
dup | |
} forall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%apply unary proc to array. ie. proc implements a monadic operator | |
/mop{ % A proc | |
1 index type /arraytype eq { | |
[ 3 1 roll % [ A proc | |
exch % [ proc A | |
{ % [ ... proc A_i | |
1 index op % [ ... proc A_i' | |
exch % [ ... A_i' proc | |
}forall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/i{[1 1 4 3 roll {} for ]}def | |
%10 i == %[1 2 3 4 5 6 7 8 9 10] | |
/+{ | |
dup type /arraytype eq { % ? [] | |
1 index type /arraytype eq { % [] [] | |
2 copy length exch length ne { | |
2 copy length exch length exch lt { exch } if % now nA > nB | |
2 copy length exch length exch sub % A B nA-nB | |
[ 3 2 roll % A nA-nB [ B |
NewerOlder