Web client #5

Merged
adam merged 10 commits from feat/mvp-web-client into feat/mvp 2023-05-20 06:45:32 +00:00
121 changed files with 11119 additions and 87 deletions

14
.gitignore vendored
View File

@ -1,4 +1,6 @@
.kubeconfig .kubeconfig
.env
.env.*
.vscode .vscode
./src/.idea ./src/.idea
@ -12,3 +14,15 @@
*.swagger.json *.swagger.json
src/**/internal/data/postgres/*.go src/**/internal/data/postgres/*.go
# frontend
node_modules
./src/web-client/build
./src/web-client/.svelte-kit
./src/web-client/package
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.DS_Store

View File

@ -6,3 +6,4 @@ kubectl 1.26.3
buf 1.17.0 buf 1.17.0
k9s 0.26.3 k9s 0.26.3
golang 1.19 golang 1.19
nodejs lts

30
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,30 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Delve into Runner",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 2345,
"host": "127.0.0.1",
"trace": "verbose",
// "remotePath": "/go",
"cwd": "${workspaceFolder}",
},
{
"name": "Delve into Catalog",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 2346,
"host": "127.0.0.1",
"trace": "verbose",
"cwd": "${workspaceFolder}",
// "remotePath": "/go"
}
]
}

View File

@ -16,6 +16,9 @@ helm_repo('grafana', 'https://grafana.github.io/helm-charts', labels=["9-repos"]
helm_resource( helm_resource(
'ingress', 'ingress',
'traefik/traefik', 'traefik/traefik',
flags=[
'--set', 'logs.access.enabled=true'
],
resource_deps=['traefik'], resource_deps=['traefik'],
port_forwards=[ port_forwards=[
port_forward(8000, 8000, name='Barretthousen'), port_forward(8000, 8000, name='Barretthousen'),
@ -40,10 +43,10 @@ helm_resource(
def bh_service(service="", port_forwards=[], migrateDB=False, devMode=True, labels=['2-services'], deps=['postgres']): def bh_backend_service(service="", port_forwards=[], migrateDB=False, devMode=True, labels=['2-services'], deps=['postgres']):
local_resource( local_resource(
'{}-go-compile'.format(service), '{}-go-compile'.format(service),
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags=\'-N -l\' -o .bin/{}-debug ./src/{}'.format(service, service), 'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o .bin/{}-debug ./src/{}'.format(service, service),
deps=['./src/{}'.format(service), './src/lib'], deps=['./src/{}'.format(service), './src/lib'],
resource_deps=deps resource_deps=deps
) )
@ -66,17 +69,26 @@ def bh_service(service="", port_forwards=[], migrateDB=False, devMode=True, labe
docker_build_with_restart( docker_build_with_restart(
ref="barretthousen/service-{}".format(service), ref="barretthousen/service-{}".format(service),
dockerfile="./src/Dockerfile.dev", dockerfile="./src/Dockerfile.dev-backend",
context=".", context=".",
entrypoint=entry_cmd, entrypoint=entry_cmd,
build_args={ build_args={
"service": service "service": service
}, },
only = [ trigger = [
'./.bin/{}-debug'.format(service) './.bin/{}-debug'.format(service)
], ],
only = [
'./.bin/{}-debug'.format(service),
'./src/runner',
'./src/catalog',
'./src/proxy-admin',
'./src/proxy-client',
'./src/lib'
],
live_update=[ live_update=[
sync('./.bin', '/opt') sync('./.bin', '/opt'),
sync('./src', '/go/src')
] ]
) )
@ -89,18 +101,38 @@ def bh_service(service="", port_forwards=[], migrateDB=False, devMode=True, labe
bh_service(service="catalog", migrateDB=True, port_forwards=["5002:5001", "2346:2345"]) bh_backend_service(service="catalog", migrateDB=True, port_forwards=["5002:5001", "2346:2345"])
bh_service(service="runner", migrateDB=True, port_forwards=[5001, 2345]) bh_backend_service(service="runner", migrateDB=True, port_forwards=[5001, 2345])
# bh_service(service="proxy-web", port_forwards=["8081:80"], deps=['ingress', 'local-catalog']) # bh_service(service="proxy-web", port_forwards=["8081:80"], deps=['ingress', 'local-catalog'])
bh_service(service="proxy-admin", port_forwards=[ bh_backend_service(service="proxy-admin", port_forwards=[
port_forward(8082, 80, name="HTTP API @ localhost:8082") port_forward(8082, 80, name="HTTP API @ localhost:8082")
], deps=['ingress']) ], deps=['ingress'])
bh_service(service="proxy-client", port_forwards=[ bh_backend_service(service="proxy-client", port_forwards=[
port_forward(8081, 80, name="HTTP API @ localhost:8081") port_forward(8081, 80, name="HTTP API @ localhost:8081")
], deps=['ingress']) ], deps=['ingress'])
local_resource(
'web-client',
dir='./src/web-client',
cmd='npm i',
serve_dir='./src/web-client',
serve_cmd='npm run dev',
ignore=['./src/web-client/src'],
deps=[
'./src/web-client/package.json',
'./src/web-client/svelte.config.js',
'./src/web-client/vite.config.ts'
],
readiness_probe=probe(10, 2, 10, 1, 3, http_get=http_get_action(5173, 'localhost', 'http')),
links=[
link(url='http://localhost:5173', name='Web Client')
],
labels=['2-services']
)
k8s_yaml( k8s_yaml(
kustomize("./env/local") kustomize("./env/local")
) )
@ -109,7 +141,7 @@ k8s_resource(
workload='ingress', workload='ingress',
labels='1-ingress', labels='1-ingress',
links=[ links=[
link(url='http://admin.bh.localhost:8000', name='Admin Panel'), link(url='http://admin.localhost:8000', name='Admin Panel'),
] ]
) )

View File

@ -0,0 +1,30 @@
# Auction site sources
| Name | API Available | Implemented |
|------------------|---------------|-------------|
| [Live Auctioneers](https://www.liveauctioneers.com/) | | JSON | :check: |
| [Catawiki](https://www.catawiki.com/en/) | | JSON | |
| [ProxiBid](https://www.proxibid.com/) | | None | |
| [The Saleroom](https://www.the-saleroom.com) | | None | |
- Catawiki
```
curl 'https://www.catawiki.com/buyer/api/v1/auctions?locale=en&per_page=25' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0' \
-H 'Accept: application/json' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Referer: https://www.catawiki.com/en/' \
-H 'DNT: 1' \
-H 'Connection: keep-alive' \
-H 'Cookie: ab_first_visit=1; absmartly_id=a808d691-6a64-4797-bf77-97516c2917a9; cw_sid=2e67590dbaee388af8b5f1a59b4dd12f5d01759bc6a4603c6a8ae1add4637bdd; cw_ab=eaVcsgJ5TBW7bkaaWxN/6QAB; enable_marketing_cookies=true; enable_analytical_cookies=true; cookie_preferences_used_cta=accept_all; has_pending_cookie_consent_sync=true; rmb_disabled_at=1684553408868; _catawiki_session=KQn7aiPKK6FUaO8zr8yfwrAVUtfKv6wXQ9ntoW00Qux19aliGIcXXNUs6vmomxsOSruGU%2Bn%2BsNp8%2FzessvIc4ZZ7wkWJkhiHKHhV13dBUYm4Tu3SvP2nOPKXFzBJngnwgJRh%2BUIdoTv86KDmB%2B8%3D--aRi3oNveTClu9Grs--CFMYiz%2BOtTknj34sB2fblQ%3D%3D' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
-H 'TE: trailers'
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,912 @@
%!PS-Adobe-3.0 EPSF-3.0
%APL_DSC_Encoding: UTF8
%APLProducer: (Version 10.14.6 (Build 18G95) Quartz PS Context)
%%Title: (Unknown)
%%Creator: (Unknown)
%%CreationDate: (Unknown)
%%For: (Unknown)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 0 0 1102 516
%%EndComments
%%BeginProlog
%%BeginFile: cg-pdf.ps
%%Copyright: Copyright 2000-2004 Apple Computer Incorporated.
%%Copyright: All Rights Reserved.
currentpacking true setpacking
/cg_md 141 dict def
cg_md begin
/L3? languagelevel 3 ge def
/bd{bind def}bind def
/ld{load def}bd
/xs{exch store}bd
/xd{exch def}bd
/cmmtx matrix def
mark
/sc/setcolor
/scs/setcolorspace
/dr/defineresource
/fr/findresource
/T/true
/F/false
/d/setdash
/w/setlinewidth
/J/setlinecap
/j/setlinejoin
/M/setmiterlimit
/i/setflat
/rc/rectclip
/rf/rectfill
/rs/rectstroke
/f/fill
/f*/eofill
/sf/selectfont
/s/show
%/as/ashow
/xS/xshow
/yS/yshow
/xyS/xyshow
/S/stroke
/m/moveto
/l/lineto
/c/curveto
/h/closepath
/n/newpath
/q/gsave
/Q/grestore
counttomark 2 idiv
%dup (number of ld's = )print == flush % *** how many
{ld}repeat pop
/SC{ % CSname
/ColorSpace fr scs
}bd
/sopr /setoverprint where{pop/setoverprint}{/pop}ifelse ld
/soprm /setoverprintmode where{pop/setoverprintmode}{/pop}ifelse ld
/cgmtx matrix def
/sdmtx{cgmtx currentmatrix pop}bd
/CM {cgmtx setmatrix}bd % pop the ctm: our gstate ctm on host is now identity
/cm {cmmtx astore CM concat}bd % reset the matrix and then concat
/W{clip newpath}bd
/W*{eoclip newpath}bd
statusdict begin product end dup (HP) anchorsearch{
pop pop pop % pop off the search results
true
}{
pop % previous search result
(hp) anchorsearch{
pop pop true
}{
pop false
}ifelse
}ifelse
{ % HP is the product: we use this method of stroking because of a bug in their clone printers with certain T3 fonts
{
{ % charCode Wx Wy
pop pop % charCode
(0)dup 0 4 -1 roll put
F charpath
}cshow
}
}{
{F charpath}
}ifelse
/cply exch bd
/cps {cply stroke}bd
/pgsave 0 def
/bp{/pgsave save store}bd
/ep{pgsave restore showpage}def % dont' bind
/re{4 2 roll m 1 index 0 rlineto 0 exch rlineto neg 0 rlineto h}bd
/scrdict 10 dict def
/scrmtx matrix def
/patarray 0 def
/createpat{patarray 3 1 roll put}bd
/makepat{
scrmtx astore pop
gsave
initgraphics
CM
patarray exch get
scrmtx
makepattern
grestore
setpattern
}bd
/cg_BeginEPSF{
userdict save/cg_b4_Inc_state exch put
userdict/cg_endepsf/cg_EndEPSF load put
count userdict/cg_op_count 3 -1 roll put
countdictstack dup array dictstack userdict/cg_dict_array 3 -1 roll put
3 sub{end}repeat
/showpage {} def
0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
10 setmiterlimit [] 0 setdash newpath
false setstrokeadjust false setoverprint % don't use F
}bd
/cg_EndEPSF{
countdictstack 3 sub { end } repeat
cg_dict_array 3 1 index length 3 sub getinterval
{begin}forall
count userdict/cg_op_count get sub{pop}repeat
userdict/cg_b4_Inc_state get restore
F setpacking
}bd
/cg_biproc{currentfile/RunLengthDecode filter}bd
/cg_aiproc{currentfile/ASCII85Decode filter/RunLengthDecode filter}bd
/ImageDataSource 0 def
L3?{
/cg_mibiproc{pop pop/ImageDataSource{cg_biproc}def}bd
/cg_miaiproc{pop pop/ImageDataSource{cg_aiproc}def}bd
}{
/ImageBandMask 0 def
/ImageBandData 0 def
/cg_mibiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/RunLengthDecode filter dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
/cg_miaiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/ASCII85Decode filter/RunLengthDecode filter
dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
}ifelse
/imsave 0 def
/BI{save/imsave xd mark}bd
/EI{imsave restore}bd
/ID{
counttomark 2 idiv
dup 2 add % leave room for imagetype and imagematrix
dict begin
{def} repeat
pop % remove mark
/ImageType 1 def
/ImageMatrix[Width 0 0 Height neg 0 Height]def
currentdict dup/ImageMask known{ImageMask}{F}ifelse exch
% currentdict on stack
L3?{
dup/MaskedImage known
{
pop
<<
/ImageType 3
/InterleaveType 2
/DataDict currentdict
/MaskDict
<< /ImageType 1
/Width Width
/Height Height
/ImageMatrix ImageMatrix
/BitsPerComponent 1
/Decode [0 1]
currentdict/Interpolate known
{/Interpolate Interpolate}if
>>
>>
}if
}if
exch
{imagemask}{image}ifelse
end % pop imagedict from dict stack
}bd
/cguidfix{statusdict begin mark version end
{cvr}stopped{cleartomark 0}{exch pop}ifelse
2012 lt{dup findfont dup length dict begin
{1 index/FID ne 2 index/UniqueID ne and
{def} {pop pop} ifelse}forall
currentdict end definefont pop
}{pop}ifelse
}bd
/t_array 0 def
/t_i 0 def
/t_c 1 string def
/x_proc{ % x y
exch t_array t_i get add exch moveto
/t_i t_i 1 add store
}bd
/y_proc{ % x y
t_array t_i get add moveto
/t_i t_i 1 add store
}bd
/xy_proc{
% x y
t_array t_i 2 copy 1 add get 3 1 roll get
4 -1 roll add 3 1 roll add moveto
/t_i t_i 2 add store
}bd
/sop 0 def % don't bind sop
/cp_proc/x_proc ld % default moveto proc is for xwidths only
/base_charpath % string array
{
/t_array xs
/t_i 0 def
{ % char
t_c 0 3 -1 roll put
currentpoint
t_c cply sop
cp_proc
}forall
/t_array 0 def
}bd
/sop/stroke ld % default sop is stroke. Done here so we don't bind in /base_charpath
% default sop is stroke
/nop{}def
/xsp/base_charpath ld
/ysp{/cp_proc/y_proc ld base_charpath/cp_proc/x_proc ld}bd
/xysp{/cp_proc/xy_proc ld base_charpath/cp_proc/x_proc ld}bd
/xmp{/sop/nop ld /cp_proc/x_proc ld base_charpath/sop/stroke ld}bd
/ymp{/sop/nop ld /cp_proc/y_proc ld base_charpath/sop/stroke ld}bd
/xymp{/sop/nop ld /cp_proc/xy_proc ld base_charpath/sop/stroke ld}bd
/refnt{ % newname encoding fontname
findfont dup length dict copy dup
/Encoding 4 -1 roll put
definefont pop
}bd
/renmfont{ % newname fontname
findfont dup length dict copy definefont pop
}bd
L3? dup dup{save exch}if
% languagelevel2 ONLY code goes here
/Range 0 def
/DataSource 0 def
/val 0 def
/nRange 0 def
/mulRange 0 def
/d0 0 def
/r0 0 def
/di 0 def
/ri 0 def
/a0 0 def
/a1 0 def
/r1 0 def
/r2 0 def
/dx 0 def
/Nsteps 0 def
/sh3tp 0 def
/ymax 0 def
/ymin 0 def
/xmax 0 def
/xmin 0 def
/setupFunEval % funDict -- % this calculates and sets up a function dict for evaulation.
{
begin
/nRange Range length 2 idiv store
/mulRange % precompute the range data needed to map a sample value from the table to a range value
% this data looks like [ range0mul range0min range1mul range1min ... rangeN-1mul rangeN-1min ]
[
0 1 nRange 1 sub
{ % index
2 mul/nDim2 xd % 2*dimension# we are dealing with
Range nDim2 get % ymin
Range nDim2 1 add get % ymin ymax
1 index sub % ymin (ymax-ymin)
% xmin = 0, xmax = 255 (2^bitspersample - 1)
255 div % ymin (ymax-ymin)/(xmax - xmin)
exch % (ymax-ymin)/(xmax - xmin) ymin
}for
]store
end
}bd
/FunEval % val1 fundict -> comp1 comp2 ... compN
{
begin
% the value passed in is the base index into the table
nRange mul /val xd % compute the actual index to the table
% since there are nRange entries per base index
0 1 nRange 1 sub
{
dup 2 mul/nDim2 xd % dim
val % base value to use to do our lookup
add DataSource exch get % lookedupval
mulRange nDim2 get mul % lookedupval*(ymax-ymin)/(xmax-xmin)
mulRange nDim2 1 add get % lookedupval*(ymax-ymin)/(xmax-xmin) ymin
add % interpolated result
}for % comp1 comp2 ... compN
end
}bd
/max % a b -> max(a, b)
{
2 copy lt
{exch pop}{pop}ifelse
}bd
/sh2
{ % emulation of shading type 2. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 x1 y1
3 index 3 index translate % origin is now at beginning point of shading
% x0 y0 x1 y1
3 -1 roll sub % x0 x1 y1-y0
3 1 roll exch % y1-y0 x1 x0
sub % y1-y0 x1-x0
2 copy
dup mul exch dup mul add sqrt % length of segment between two points
dup
scale
atan % atan (dy/dx)
%dup (rotation angle = )print ==
rotate % now line between 0,0 and 1,0 is the line perpendicular to which the axial lines are drawn
/Function load setupFunEval % may need to setup function dictionary by calling setupFunEval
% this is now specific to axial shadings. Compute the maximum bounds to fill
clippath {pathbbox}stopped {0 0 0 0}if newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
currentdict/Extend known
{
/Extend load 0 get
{
0/Function load FunEval sc % evaluate the function to get a color and set it
xmin ymin xmin abs ymax ymin sub rectfill
}if
}if
% paint the rects. The sampling frequency is that of our table
/Nsteps/Function load/Size get 0 get 1 sub store
/dx 1 Nsteps div store
gsave
/di ymax ymin sub store
/Function load
% loop Nsteps + 1 times, incrementing the index by 1 each time
0 1 Nsteps
{
1 index FunEval sc
0 ymin dx di rectfill
dx 0 translate
}for
pop % pop our function
grestore % origin is back to start point
currentdict/Extend known
{
/Extend load 1 get
{
Nsteps/Function load FunEval sc % last element
1 ymin xmax 1 sub abs ymax ymin sub rectfill
}if
}if
}bd
/shp % this paints our shape for shading type 3
{ % x1 r1 x0 r0 -
4 copy
% fill interior arc
dup 0 gt{
0 exch a1 a0 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a0 a1 arcn
}{
pop 0 lineto
}ifelse
fill
% fill exterior arc
dup 0 gt{
0 exch a0 a1 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a1 a0 arcn
}{
pop 0 lineto
}ifelse
fill
}bd
/calcmaxs
{ % calculate maximum distance vector from origin to corner points
% of bbox
xmin dup mul ymin dup mul add sqrt % (xmin2 + ymin2)
xmax dup mul ymin dup mul add sqrt % (xmax2 + ymin2)
xmin dup mul ymax dup mul add sqrt % (xmin2 + ymax2)
xmax dup mul ymax dup mul add sqrt % (xmax2 + ymax2)
max max max % maximum value
}bd
/sh3
{ % emulation of shading type 3. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 r1 x1 y1 r2
5 index 5 index translate % origin is now at first circle origin
3 -1 roll 6 -1 roll sub % y0 r1 y1 r2 dx
3 -1 roll 5 -1 roll sub % r1 r2 dx dy
2 copy dup mul exch dup mul add sqrt
/dx xs % r1 r2 dx dy
2 copy 0 ne exch 0 ne or
{
% r1 r2 dx dy
exch atan rotate % we are now rotated so dy is zero and positive values of dx move us as expected
}{
pop pop
}ifelse
% r1 r2
/r2 xs
/r1 xs
/Function load
dup/Size get 0 get 1 sub % this is the size of our table minus 1
/Nsteps xs % at some point we should optimize this better so NSteps is based on needed steps for the device
setupFunEval % may need to setup function dictionary by calling setupFunEval
% determine the case:
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: r1 = r2
% case 3: r1 != r2
dx r2 add r1 lt{
% circle 2 inside of circle 1
0
}{
dx r1 add r2 le
{ % circle 1 inside of circle 2
1
}{ % circles don't contain each other
r1 r2 eq
{ % equal
2
}{ % r1 != r2
3
}ifelse
}ifelse
}ifelse
/sh3tp xs % sh3tp has the number of our different cases
clippath {pathbbox}stopped {0 0 0 0}if
newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
% Arc angle atan( sqrt((dx*dx + dy*dy) - dr*dr), dr)
dx dup mul r2 r1 sub dup mul sub dup 0 gt
{
sqrt r2 r1 sub atan
/a0 exch 180 exch sub store
/a1 a0 neg store
}{
pop
/a0 0 store
/a1 360 store
}ifelse
currentdict/Extend known
{
/Extend load 0 get r1 0 gt and % no need to extend if the radius of the first end is 0
{
0/Function load FunEval sc % evaluate the function to get a color and set it
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{ % case 0
dx 0 r1 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % case 1
r1 0 gt{0 0 r1 0 360 arc fill}if
}
{ % case 2
% r1 == r2, extend 0
% r3 = r, x3 = -(abs(minx) + r), x1 = 0
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 xmin abs r1 add neg r1 shp
}
{ % case 3
% no containment, r1 != r2
r2 r1 gt{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
0 r1
r1 neg r2 r1 sub div dx mul % this is point of beginning circle
0 % point of ending circle
shp % takes x(i+1) r(i+1) x(i) r(i)
}{ % the first circle is the bigger of the two
% we find a circle on our line which is outside the bbox in the
% negative direction
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 calcmaxs % 0 r1 maxs
dup
% calculating xs: (-(maxs+r2)*x2)/(x2-(r1-r2))
r2 add dx mul dx r1 r2 sub sub div
neg % maxs xs'
exch 1 index % xs' maxs xs'
abs exch sub
shp
}ifelse
}
}sh3tp get exec % execute the extend at beginning proc for our shading type
}if
}if
% now do the shading
/d0 0 store
/r0 r1 store
/di dx Nsteps div store
/ri r2 r1 sub Nsteps div store
/Function load
0 1 Nsteps
{ % function t(i)
1 index FunEval sc
d0 di add r0 ri add d0 r0 shp
{
% fill interior arc
d0 0 r0 a1 a0 arc
d0 di add 0 r0 ri add a0 a1 arcn
fill
% fill exterior arc
d0 0 r0 a0 a1 arc
d0 di add 0 r0 ri add a1 a0 arcn
fill
}pop
% advance to next
/d0 d0 di add store
/r0 r0 ri add store
}for
pop % pop our function dict
% handle Extend
currentdict/Extend known
{
/Extend load 1 get r2 0 gt and % no need to extend if the radius of the last end is 0
{
Nsteps/Function load FunEval sc % last element
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{
dx 0 r2 0 360 arc fill
}
{
dx 0 r2 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % r1 == r2, extend 1
% r3 = r, x3 = (abs(xmax) + r), x1 = dx
% x(i+1) r(i+1) x(i) r(i) shp
xmax abs r1 add r1 dx r1 shp
}
{ % no containment, r1 != r2
r2 r1 gt{
% we find a circle on our line which is outside the bbox in the
% positive direction
% x(i+1) r(i+1) x(i) r(i) shp
calcmaxs dup % maxs maxs
% calculating xs: ((maxs+r1)*x2)/(x2-(r2-r1))
r1 add dx mul dx r2 r1 sub sub div % maxs xs
exch 1 index % xs maxs xs
exch sub
dx r2
shp
}{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
r1 neg r2 r1 sub div dx mul % this is point of ending circle
0 % radius of ending circle
dx % point of starting circle
r2 % radius of starting circle
shp
}ifelse
}
}
sh3tp get exec % execute the extend at end proc for our shading type
}if
}if
}bd
/sh % emulation of shfill operator for type 2 and type 3 shadings based on type 0 functions
{ % shadingDict --
begin
/ShadingType load dup dup 2 eq exch 3 eq or
{ % shadingtype
gsave
newpath
/ColorSpace load scs
currentdict/BBox known
{
/BBox load aload pop % llx lly urx ury
2 index sub % llx lly urx ury-lly
3 index % llx lly urx ury-lly llx
3 -1 roll exch sub
exch rectclip
}if
2 eq
{sh2}{sh3}ifelse
grestore
}{
% shadingtype
pop
(DEBUG: shading type unimplemented\n)print flush
}ifelse
end
}bd
% end of language level 2 ONLY code
{restore}if not dup{save exch}if
% languagelevel3 ONLY code goes here
L3?{ % we do these loads conditionally or else they will fail on a level 2 printer
/sh/shfill ld
/csq/clipsave ld
/csQ/cliprestore ld
}if
{restore}if
%currentdict dup maxlength exch length sub (number of extra slots in md = )print == flush % *** how many entries are free
end
setpacking
% count 0 ne { pstack(***extras on stack during prolog execution***\n)print flush}if % *** BARK if anything is left on stack
%%EndFile
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
%%PageBoundingBox: 0 0 1102 516
%%BeginPageSetup
cg_md begin
bp
sdmtx
[ /CIEBasedABC 4 dict dup begin
/WhitePoint [ 0.9505 1.0000 1.0891 ] def
/DecodeABC [
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
] def
/MatrixABC [ 0.4124 0.2126 0.0193 0.3576 0.7151 0.1192 0.1805 0.0722 0.9508 ] def
/RangeLMN [ 0.0 0.9505 0.0 1.0000 0.0 1.0891 ] def
end ] /Cs1 exch/ColorSpace dr pop
%%EndPageSetup
0.60000002 i
/Cs1 SC
0.13333334 0.13333334 0.13333334 sc
q
0 516 m
518 516 l
518 0 l
0 0 l
0 516 l
h
W*
0 0 1102 516 rc
-10 526 m
528 526 l
528 -10 l
-10 -10 l
h
f
Q
0.76078433 0.65098041 0.38039216 sc
q
518 516 m
1102 516 l
1102 0 l
518 0 l
518 516 l
h
W*
0 0 1102 516 rc
508 526 m
1112 526 l
1112 -10 l
508 -10 l
h
f
Q
0.13333334 0.13333334 0.13333334 sc
q
921.56757 468 m
982 468 l
982 48 l
921.56757 48 l
921.56757 261.5 l
698.43243 261.5 l
698.43243 48 l
638 48 l
638 468 l
698.43243 468 l
698.43243 276.08334 l
921.56757 276.08334 l
921.56757 468 l
h
W
0 0 1102 516 rc
628 478 m
992 478 l
992 38 l
628 38 l
h
f
Q
0.76078433 0.65098041 0.38039216 sc
q
180.15546 262.08334 m
180.15546 65.5 l
233.30252 65.5 l
266.00839 65.5 290.53781 70.166664 306.89075 86.5 c
323.24368 103.41666 331.42017 128.5 331.42017 162.33333 c
331.42017 196.75 322.07562 221.83333 303.97058 238.16667 c
285.28152 254.5 253.15967 262.66666 206.43698 262.66666 c
198.84454 262.66666 187.16386 262.08334 180.15546 262.08334 c
h
180.15546 452.25 m
180.15546 276.66666 l
195.92436 276.66666 l
240.31093 276.66666 270.09665 283.66666 286.44958 297.66666 c
302.80252 311.66666 310.39496 333.83334 310.39496 365.33334 c
310.39496 386.91666 307.47479 403.83334 301.05042 415.5 c
294.62604 427.75 284.69748 436.5 272.43277 442.91666 c
259.58405 449.91666 238.55882 452.83334 207.60504 452.83334 c
199.42857 452.83334 187.16386 452.83334 180.15546 452.25 c
h
120 48 m
120 468 l
204.68488 468 l
318.57144 468 375.80673 435.33334 375.80673 369.41666 c
375.80673 342.58334 365.87814 320.41666 346.021 304.08334 c
326.74789 287.75 296.96219 276.66666 257.83194 270.83334 c
305.13864 267.33334 340.18066 255.66667 363.54202 235.83333 c
386.31934 215.41667 398 190.33333 398 160.58333 c
398 134.33333 389.82352 111.58334 374.63864 92.333336 c
358.86975 73.666664 339.0126 62 314.48318 56.166668 c
289.9538 50.333332 257.83194 48 216.94958 48 c
120 48 l
h
W
0 0 1102 516 rc
110 478 m
408 478 l
408 38 l
110 38 l
h
f
ep
end
%%Trailer
%%EOF

View File

@ -0,0 +1,912 @@
%!PS-Adobe-3.0 EPSF-3.0
%APL_DSC_Encoding: UTF8
%APLProducer: (Version 10.14.6 (Build 18G95) Quartz PS Context)
%%Title: (Unknown)
%%Creator: (Unknown)
%%CreationDate: (Unknown)
%%For: (Unknown)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 0 0 1102 516
%%EndComments
%%BeginProlog
%%BeginFile: cg-pdf.ps
%%Copyright: Copyright 2000-2004 Apple Computer Incorporated.
%%Copyright: All Rights Reserved.
currentpacking true setpacking
/cg_md 141 dict def
cg_md begin
/L3? languagelevel 3 ge def
/bd{bind def}bind def
/ld{load def}bd
/xs{exch store}bd
/xd{exch def}bd
/cmmtx matrix def
mark
/sc/setcolor
/scs/setcolorspace
/dr/defineresource
/fr/findresource
/T/true
/F/false
/d/setdash
/w/setlinewidth
/J/setlinecap
/j/setlinejoin
/M/setmiterlimit
/i/setflat
/rc/rectclip
/rf/rectfill
/rs/rectstroke
/f/fill
/f*/eofill
/sf/selectfont
/s/show
%/as/ashow
/xS/xshow
/yS/yshow
/xyS/xyshow
/S/stroke
/m/moveto
/l/lineto
/c/curveto
/h/closepath
/n/newpath
/q/gsave
/Q/grestore
counttomark 2 idiv
%dup (number of ld's = )print == flush % *** how many
{ld}repeat pop
/SC{ % CSname
/ColorSpace fr scs
}bd
/sopr /setoverprint where{pop/setoverprint}{/pop}ifelse ld
/soprm /setoverprintmode where{pop/setoverprintmode}{/pop}ifelse ld
/cgmtx matrix def
/sdmtx{cgmtx currentmatrix pop}bd
/CM {cgmtx setmatrix}bd % pop the ctm: our gstate ctm on host is now identity
/cm {cmmtx astore CM concat}bd % reset the matrix and then concat
/W{clip newpath}bd
/W*{eoclip newpath}bd
statusdict begin product end dup (HP) anchorsearch{
pop pop pop % pop off the search results
true
}{
pop % previous search result
(hp) anchorsearch{
pop pop true
}{
pop false
}ifelse
}ifelse
{ % HP is the product: we use this method of stroking because of a bug in their clone printers with certain T3 fonts
{
{ % charCode Wx Wy
pop pop % charCode
(0)dup 0 4 -1 roll put
F charpath
}cshow
}
}{
{F charpath}
}ifelse
/cply exch bd
/cps {cply stroke}bd
/pgsave 0 def
/bp{/pgsave save store}bd
/ep{pgsave restore showpage}def % dont' bind
/re{4 2 roll m 1 index 0 rlineto 0 exch rlineto neg 0 rlineto h}bd
/scrdict 10 dict def
/scrmtx matrix def
/patarray 0 def
/createpat{patarray 3 1 roll put}bd
/makepat{
scrmtx astore pop
gsave
initgraphics
CM
patarray exch get
scrmtx
makepattern
grestore
setpattern
}bd
/cg_BeginEPSF{
userdict save/cg_b4_Inc_state exch put
userdict/cg_endepsf/cg_EndEPSF load put
count userdict/cg_op_count 3 -1 roll put
countdictstack dup array dictstack userdict/cg_dict_array 3 -1 roll put
3 sub{end}repeat
/showpage {} def
0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
10 setmiterlimit [] 0 setdash newpath
false setstrokeadjust false setoverprint % don't use F
}bd
/cg_EndEPSF{
countdictstack 3 sub { end } repeat
cg_dict_array 3 1 index length 3 sub getinterval
{begin}forall
count userdict/cg_op_count get sub{pop}repeat
userdict/cg_b4_Inc_state get restore
F setpacking
}bd
/cg_biproc{currentfile/RunLengthDecode filter}bd
/cg_aiproc{currentfile/ASCII85Decode filter/RunLengthDecode filter}bd
/ImageDataSource 0 def
L3?{
/cg_mibiproc{pop pop/ImageDataSource{cg_biproc}def}bd
/cg_miaiproc{pop pop/ImageDataSource{cg_aiproc}def}bd
}{
/ImageBandMask 0 def
/ImageBandData 0 def
/cg_mibiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/RunLengthDecode filter dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
/cg_miaiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/ASCII85Decode filter/RunLengthDecode filter
dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
}ifelse
/imsave 0 def
/BI{save/imsave xd mark}bd
/EI{imsave restore}bd
/ID{
counttomark 2 idiv
dup 2 add % leave room for imagetype and imagematrix
dict begin
{def} repeat
pop % remove mark
/ImageType 1 def
/ImageMatrix[Width 0 0 Height neg 0 Height]def
currentdict dup/ImageMask known{ImageMask}{F}ifelse exch
% currentdict on stack
L3?{
dup/MaskedImage known
{
pop
<<
/ImageType 3
/InterleaveType 2
/DataDict currentdict
/MaskDict
<< /ImageType 1
/Width Width
/Height Height
/ImageMatrix ImageMatrix
/BitsPerComponent 1
/Decode [0 1]
currentdict/Interpolate known
{/Interpolate Interpolate}if
>>
>>
}if
}if
exch
{imagemask}{image}ifelse
end % pop imagedict from dict stack
}bd
/cguidfix{statusdict begin mark version end
{cvr}stopped{cleartomark 0}{exch pop}ifelse
2012 lt{dup findfont dup length dict begin
{1 index/FID ne 2 index/UniqueID ne and
{def} {pop pop} ifelse}forall
currentdict end definefont pop
}{pop}ifelse
}bd
/t_array 0 def
/t_i 0 def
/t_c 1 string def
/x_proc{ % x y
exch t_array t_i get add exch moveto
/t_i t_i 1 add store
}bd
/y_proc{ % x y
t_array t_i get add moveto
/t_i t_i 1 add store
}bd
/xy_proc{
% x y
t_array t_i 2 copy 1 add get 3 1 roll get
4 -1 roll add 3 1 roll add moveto
/t_i t_i 2 add store
}bd
/sop 0 def % don't bind sop
/cp_proc/x_proc ld % default moveto proc is for xwidths only
/base_charpath % string array
{
/t_array xs
/t_i 0 def
{ % char
t_c 0 3 -1 roll put
currentpoint
t_c cply sop
cp_proc
}forall
/t_array 0 def
}bd
/sop/stroke ld % default sop is stroke. Done here so we don't bind in /base_charpath
% default sop is stroke
/nop{}def
/xsp/base_charpath ld
/ysp{/cp_proc/y_proc ld base_charpath/cp_proc/x_proc ld}bd
/xysp{/cp_proc/xy_proc ld base_charpath/cp_proc/x_proc ld}bd
/xmp{/sop/nop ld /cp_proc/x_proc ld base_charpath/sop/stroke ld}bd
/ymp{/sop/nop ld /cp_proc/y_proc ld base_charpath/sop/stroke ld}bd
/xymp{/sop/nop ld /cp_proc/xy_proc ld base_charpath/sop/stroke ld}bd
/refnt{ % newname encoding fontname
findfont dup length dict copy dup
/Encoding 4 -1 roll put
definefont pop
}bd
/renmfont{ % newname fontname
findfont dup length dict copy definefont pop
}bd
L3? dup dup{save exch}if
% languagelevel2 ONLY code goes here
/Range 0 def
/DataSource 0 def
/val 0 def
/nRange 0 def
/mulRange 0 def
/d0 0 def
/r0 0 def
/di 0 def
/ri 0 def
/a0 0 def
/a1 0 def
/r1 0 def
/r2 0 def
/dx 0 def
/Nsteps 0 def
/sh3tp 0 def
/ymax 0 def
/ymin 0 def
/xmax 0 def
/xmin 0 def
/setupFunEval % funDict -- % this calculates and sets up a function dict for evaulation.
{
begin
/nRange Range length 2 idiv store
/mulRange % precompute the range data needed to map a sample value from the table to a range value
% this data looks like [ range0mul range0min range1mul range1min ... rangeN-1mul rangeN-1min ]
[
0 1 nRange 1 sub
{ % index
2 mul/nDim2 xd % 2*dimension# we are dealing with
Range nDim2 get % ymin
Range nDim2 1 add get % ymin ymax
1 index sub % ymin (ymax-ymin)
% xmin = 0, xmax = 255 (2^bitspersample - 1)
255 div % ymin (ymax-ymin)/(xmax - xmin)
exch % (ymax-ymin)/(xmax - xmin) ymin
}for
]store
end
}bd
/FunEval % val1 fundict -> comp1 comp2 ... compN
{
begin
% the value passed in is the base index into the table
nRange mul /val xd % compute the actual index to the table
% since there are nRange entries per base index
0 1 nRange 1 sub
{
dup 2 mul/nDim2 xd % dim
val % base value to use to do our lookup
add DataSource exch get % lookedupval
mulRange nDim2 get mul % lookedupval*(ymax-ymin)/(xmax-xmin)
mulRange nDim2 1 add get % lookedupval*(ymax-ymin)/(xmax-xmin) ymin
add % interpolated result
}for % comp1 comp2 ... compN
end
}bd
/max % a b -> max(a, b)
{
2 copy lt
{exch pop}{pop}ifelse
}bd
/sh2
{ % emulation of shading type 2. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 x1 y1
3 index 3 index translate % origin is now at beginning point of shading
% x0 y0 x1 y1
3 -1 roll sub % x0 x1 y1-y0
3 1 roll exch % y1-y0 x1 x0
sub % y1-y0 x1-x0
2 copy
dup mul exch dup mul add sqrt % length of segment between two points
dup
scale
atan % atan (dy/dx)
%dup (rotation angle = )print ==
rotate % now line between 0,0 and 1,0 is the line perpendicular to which the axial lines are drawn
/Function load setupFunEval % may need to setup function dictionary by calling setupFunEval
% this is now specific to axial shadings. Compute the maximum bounds to fill
clippath {pathbbox}stopped {0 0 0 0}if newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
currentdict/Extend known
{
/Extend load 0 get
{
0/Function load FunEval sc % evaluate the function to get a color and set it
xmin ymin xmin abs ymax ymin sub rectfill
}if
}if
% paint the rects. The sampling frequency is that of our table
/Nsteps/Function load/Size get 0 get 1 sub store
/dx 1 Nsteps div store
gsave
/di ymax ymin sub store
/Function load
% loop Nsteps + 1 times, incrementing the index by 1 each time
0 1 Nsteps
{
1 index FunEval sc
0 ymin dx di rectfill
dx 0 translate
}for
pop % pop our function
grestore % origin is back to start point
currentdict/Extend known
{
/Extend load 1 get
{
Nsteps/Function load FunEval sc % last element
1 ymin xmax 1 sub abs ymax ymin sub rectfill
}if
}if
}bd
/shp % this paints our shape for shading type 3
{ % x1 r1 x0 r0 -
4 copy
% fill interior arc
dup 0 gt{
0 exch a1 a0 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a0 a1 arcn
}{
pop 0 lineto
}ifelse
fill
% fill exterior arc
dup 0 gt{
0 exch a0 a1 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a1 a0 arcn
}{
pop 0 lineto
}ifelse
fill
}bd
/calcmaxs
{ % calculate maximum distance vector from origin to corner points
% of bbox
xmin dup mul ymin dup mul add sqrt % (xmin2 + ymin2)
xmax dup mul ymin dup mul add sqrt % (xmax2 + ymin2)
xmin dup mul ymax dup mul add sqrt % (xmin2 + ymax2)
xmax dup mul ymax dup mul add sqrt % (xmax2 + ymax2)
max max max % maximum value
}bd
/sh3
{ % emulation of shading type 3. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 r1 x1 y1 r2
5 index 5 index translate % origin is now at first circle origin
3 -1 roll 6 -1 roll sub % y0 r1 y1 r2 dx
3 -1 roll 5 -1 roll sub % r1 r2 dx dy
2 copy dup mul exch dup mul add sqrt
/dx xs % r1 r2 dx dy
2 copy 0 ne exch 0 ne or
{
% r1 r2 dx dy
exch atan rotate % we are now rotated so dy is zero and positive values of dx move us as expected
}{
pop pop
}ifelse
% r1 r2
/r2 xs
/r1 xs
/Function load
dup/Size get 0 get 1 sub % this is the size of our table minus 1
/Nsteps xs % at some point we should optimize this better so NSteps is based on needed steps for the device
setupFunEval % may need to setup function dictionary by calling setupFunEval
% determine the case:
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: r1 = r2
% case 3: r1 != r2
dx r2 add r1 lt{
% circle 2 inside of circle 1
0
}{
dx r1 add r2 le
{ % circle 1 inside of circle 2
1
}{ % circles don't contain each other
r1 r2 eq
{ % equal
2
}{ % r1 != r2
3
}ifelse
}ifelse
}ifelse
/sh3tp xs % sh3tp has the number of our different cases
clippath {pathbbox}stopped {0 0 0 0}if
newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
% Arc angle atan( sqrt((dx*dx + dy*dy) - dr*dr), dr)
dx dup mul r2 r1 sub dup mul sub dup 0 gt
{
sqrt r2 r1 sub atan
/a0 exch 180 exch sub store
/a1 a0 neg store
}{
pop
/a0 0 store
/a1 360 store
}ifelse
currentdict/Extend known
{
/Extend load 0 get r1 0 gt and % no need to extend if the radius of the first end is 0
{
0/Function load FunEval sc % evaluate the function to get a color and set it
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{ % case 0
dx 0 r1 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % case 1
r1 0 gt{0 0 r1 0 360 arc fill}if
}
{ % case 2
% r1 == r2, extend 0
% r3 = r, x3 = -(abs(minx) + r), x1 = 0
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 xmin abs r1 add neg r1 shp
}
{ % case 3
% no containment, r1 != r2
r2 r1 gt{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
0 r1
r1 neg r2 r1 sub div dx mul % this is point of beginning circle
0 % point of ending circle
shp % takes x(i+1) r(i+1) x(i) r(i)
}{ % the first circle is the bigger of the two
% we find a circle on our line which is outside the bbox in the
% negative direction
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 calcmaxs % 0 r1 maxs
dup
% calculating xs: (-(maxs+r2)*x2)/(x2-(r1-r2))
r2 add dx mul dx r1 r2 sub sub div
neg % maxs xs'
exch 1 index % xs' maxs xs'
abs exch sub
shp
}ifelse
}
}sh3tp get exec % execute the extend at beginning proc for our shading type
}if
}if
% now do the shading
/d0 0 store
/r0 r1 store
/di dx Nsteps div store
/ri r2 r1 sub Nsteps div store
/Function load
0 1 Nsteps
{ % function t(i)
1 index FunEval sc
d0 di add r0 ri add d0 r0 shp
{
% fill interior arc
d0 0 r0 a1 a0 arc
d0 di add 0 r0 ri add a0 a1 arcn
fill
% fill exterior arc
d0 0 r0 a0 a1 arc
d0 di add 0 r0 ri add a1 a0 arcn
fill
}pop
% advance to next
/d0 d0 di add store
/r0 r0 ri add store
}for
pop % pop our function dict
% handle Extend
currentdict/Extend known
{
/Extend load 1 get r2 0 gt and % no need to extend if the radius of the last end is 0
{
Nsteps/Function load FunEval sc % last element
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{
dx 0 r2 0 360 arc fill
}
{
dx 0 r2 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % r1 == r2, extend 1
% r3 = r, x3 = (abs(xmax) + r), x1 = dx
% x(i+1) r(i+1) x(i) r(i) shp
xmax abs r1 add r1 dx r1 shp
}
{ % no containment, r1 != r2
r2 r1 gt{
% we find a circle on our line which is outside the bbox in the
% positive direction
% x(i+1) r(i+1) x(i) r(i) shp
calcmaxs dup % maxs maxs
% calculating xs: ((maxs+r1)*x2)/(x2-(r2-r1))
r1 add dx mul dx r2 r1 sub sub div % maxs xs
exch 1 index % xs maxs xs
exch sub
dx r2
shp
}{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
r1 neg r2 r1 sub div dx mul % this is point of ending circle
0 % radius of ending circle
dx % point of starting circle
r2 % radius of starting circle
shp
}ifelse
}
}
sh3tp get exec % execute the extend at end proc for our shading type
}if
}if
}bd
/sh % emulation of shfill operator for type 2 and type 3 shadings based on type 0 functions
{ % shadingDict --
begin
/ShadingType load dup dup 2 eq exch 3 eq or
{ % shadingtype
gsave
newpath
/ColorSpace load scs
currentdict/BBox known
{
/BBox load aload pop % llx lly urx ury
2 index sub % llx lly urx ury-lly
3 index % llx lly urx ury-lly llx
3 -1 roll exch sub
exch rectclip
}if
2 eq
{sh2}{sh3}ifelse
grestore
}{
% shadingtype
pop
(DEBUG: shading type unimplemented\n)print flush
}ifelse
end
}bd
% end of language level 2 ONLY code
{restore}if not dup{save exch}if
% languagelevel3 ONLY code goes here
L3?{ % we do these loads conditionally or else they will fail on a level 2 printer
/sh/shfill ld
/csq/clipsave ld
/csQ/cliprestore ld
}if
{restore}if
%currentdict dup maxlength exch length sub (number of extra slots in md = )print == flush % *** how many entries are free
end
setpacking
% count 0 ne { pstack(***extras on stack during prolog execution***\n)print flush}if % *** BARK if anything is left on stack
%%EndFile
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
%%PageBoundingBox: 0 0 1102 516
%%BeginPageSetup
cg_md begin
bp
sdmtx
[ /CIEBasedABC 4 dict dup begin
/WhitePoint [ 0.9505 1.0000 1.0891 ] def
/DecodeABC [
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
] def
/MatrixABC [ 0.4124 0.2126 0.0193 0.3576 0.7151 0.1192 0.1805 0.0722 0.9508 ] def
/RangeLMN [ 0.0 0.9505 0.0 1.0000 0.0 1.0891 ] def
end ] /Cs1 exch/ColorSpace dr pop
%%EndPageSetup
0.60000002 i
/Cs1 SC
0.13333334 0.13333334 0.13333334 sc
q
0 516 m
518 516 l
518 0 l
0 0 l
0 516 l
h
W*
0 0 1102 516 rc
-10 526 m
528 526 l
528 -10 l
-10 -10 l
h
f
Q
1 1 1 sc
q
518 516 m
1102 516 l
1102 0 l
518 0 l
518 516 l
h
W*
0 0 1102 516 rc
508 526 m
1112 526 l
1112 -10 l
508 -10 l
h
f
Q
0.13333334 0.13333334 0.13333334 sc
q
921.56757 468 m
982 468 l
982 48 l
921.56757 48 l
921.56757 261.5 l
698.43243 261.5 l
698.43243 48 l
638 48 l
638 468 l
698.43243 468 l
698.43243 276.08334 l
921.56757 276.08334 l
921.56757 468 l
h
W
0 0 1102 516 rc
628 478 m
992 478 l
992 38 l
628 38 l
h
f
Q
1 1 1 sc
q
180.15546 262.08334 m
180.15546 65.5 l
233.30252 65.5 l
266.00839 65.5 290.53781 70.166664 306.89075 86.5 c
323.24368 103.41666 331.42017 128.5 331.42017 162.33333 c
331.42017 196.75 322.07562 221.83333 303.97058 238.16667 c
285.28152 254.5 253.15967 262.66666 206.43698 262.66666 c
198.84454 262.66666 187.16386 262.08334 180.15546 262.08334 c
h
180.15546 452.25 m
180.15546 276.66666 l
195.92436 276.66666 l
240.31093 276.66666 270.09665 283.66666 286.44958 297.66666 c
302.80252 311.66666 310.39496 333.83334 310.39496 365.33334 c
310.39496 386.91666 307.47479 403.83334 301.05042 415.5 c
294.62604 427.75 284.69748 436.5 272.43277 442.91666 c
259.58405 449.91666 238.55882 452.83334 207.60504 452.83334 c
199.42857 452.83334 187.16386 452.83334 180.15546 452.25 c
h
120 48 m
120 468 l
204.68488 468 l
318.57144 468 375.80673 435.33334 375.80673 369.41666 c
375.80673 342.58334 365.87814 320.41666 346.021 304.08334 c
326.74789 287.75 296.96219 276.66666 257.83194 270.83334 c
305.13864 267.33334 340.18066 255.66667 363.54202 235.83333 c
386.31934 215.41667 398 190.33333 398 160.58333 c
398 134.33333 389.82352 111.58334 374.63864 92.333336 c
358.86975 73.666664 339.0126 62 314.48318 56.166668 c
289.9538 50.333332 257.83194 48 216.94958 48 c
120 48 l
h
W
0 0 1102 516 rc
110 478 m
408 478 l
408 38 l
110 38 l
h
f
ep
end
%%Trailer
%%EOF

View File

@ -0,0 +1,912 @@
%!PS-Adobe-3.0 EPSF-3.0
%APL_DSC_Encoding: UTF8
%APLProducer: (Version 10.14.6 (Build 18G95) Quartz PS Context)
%%Title: (Unknown)
%%Creator: (Unknown)
%%CreationDate: (Unknown)
%%For: (Unknown)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 0 0 1102 1102
%%EndComments
%%BeginProlog
%%BeginFile: cg-pdf.ps
%%Copyright: Copyright 2000-2004 Apple Computer Incorporated.
%%Copyright: All Rights Reserved.
currentpacking true setpacking
/cg_md 141 dict def
cg_md begin
/L3? languagelevel 3 ge def
/bd{bind def}bind def
/ld{load def}bd
/xs{exch store}bd
/xd{exch def}bd
/cmmtx matrix def
mark
/sc/setcolor
/scs/setcolorspace
/dr/defineresource
/fr/findresource
/T/true
/F/false
/d/setdash
/w/setlinewidth
/J/setlinecap
/j/setlinejoin
/M/setmiterlimit
/i/setflat
/rc/rectclip
/rf/rectfill
/rs/rectstroke
/f/fill
/f*/eofill
/sf/selectfont
/s/show
%/as/ashow
/xS/xshow
/yS/yshow
/xyS/xyshow
/S/stroke
/m/moveto
/l/lineto
/c/curveto
/h/closepath
/n/newpath
/q/gsave
/Q/grestore
counttomark 2 idiv
%dup (number of ld's = )print == flush % *** how many
{ld}repeat pop
/SC{ % CSname
/ColorSpace fr scs
}bd
/sopr /setoverprint where{pop/setoverprint}{/pop}ifelse ld
/soprm /setoverprintmode where{pop/setoverprintmode}{/pop}ifelse ld
/cgmtx matrix def
/sdmtx{cgmtx currentmatrix pop}bd
/CM {cgmtx setmatrix}bd % pop the ctm: our gstate ctm on host is now identity
/cm {cmmtx astore CM concat}bd % reset the matrix and then concat
/W{clip newpath}bd
/W*{eoclip newpath}bd
statusdict begin product end dup (HP) anchorsearch{
pop pop pop % pop off the search results
true
}{
pop % previous search result
(hp) anchorsearch{
pop pop true
}{
pop false
}ifelse
}ifelse
{ % HP is the product: we use this method of stroking because of a bug in their clone printers with certain T3 fonts
{
{ % charCode Wx Wy
pop pop % charCode
(0)dup 0 4 -1 roll put
F charpath
}cshow
}
}{
{F charpath}
}ifelse
/cply exch bd
/cps {cply stroke}bd
/pgsave 0 def
/bp{/pgsave save store}bd
/ep{pgsave restore showpage}def % dont' bind
/re{4 2 roll m 1 index 0 rlineto 0 exch rlineto neg 0 rlineto h}bd
/scrdict 10 dict def
/scrmtx matrix def
/patarray 0 def
/createpat{patarray 3 1 roll put}bd
/makepat{
scrmtx astore pop
gsave
initgraphics
CM
patarray exch get
scrmtx
makepattern
grestore
setpattern
}bd
/cg_BeginEPSF{
userdict save/cg_b4_Inc_state exch put
userdict/cg_endepsf/cg_EndEPSF load put
count userdict/cg_op_count 3 -1 roll put
countdictstack dup array dictstack userdict/cg_dict_array 3 -1 roll put
3 sub{end}repeat
/showpage {} def
0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
10 setmiterlimit [] 0 setdash newpath
false setstrokeadjust false setoverprint % don't use F
}bd
/cg_EndEPSF{
countdictstack 3 sub { end } repeat
cg_dict_array 3 1 index length 3 sub getinterval
{begin}forall
count userdict/cg_op_count get sub{pop}repeat
userdict/cg_b4_Inc_state get restore
F setpacking
}bd
/cg_biproc{currentfile/RunLengthDecode filter}bd
/cg_aiproc{currentfile/ASCII85Decode filter/RunLengthDecode filter}bd
/ImageDataSource 0 def
L3?{
/cg_mibiproc{pop pop/ImageDataSource{cg_biproc}def}bd
/cg_miaiproc{pop pop/ImageDataSource{cg_aiproc}def}bd
}{
/ImageBandMask 0 def
/ImageBandData 0 def
/cg_mibiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/RunLengthDecode filter dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
/cg_miaiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/ASCII85Decode filter/RunLengthDecode filter
dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
}ifelse
/imsave 0 def
/BI{save/imsave xd mark}bd
/EI{imsave restore}bd
/ID{
counttomark 2 idiv
dup 2 add % leave room for imagetype and imagematrix
dict begin
{def} repeat
pop % remove mark
/ImageType 1 def
/ImageMatrix[Width 0 0 Height neg 0 Height]def
currentdict dup/ImageMask known{ImageMask}{F}ifelse exch
% currentdict on stack
L3?{
dup/MaskedImage known
{
pop
<<
/ImageType 3
/InterleaveType 2
/DataDict currentdict
/MaskDict
<< /ImageType 1
/Width Width
/Height Height
/ImageMatrix ImageMatrix
/BitsPerComponent 1
/Decode [0 1]
currentdict/Interpolate known
{/Interpolate Interpolate}if
>>
>>
}if
}if
exch
{imagemask}{image}ifelse
end % pop imagedict from dict stack
}bd
/cguidfix{statusdict begin mark version end
{cvr}stopped{cleartomark 0}{exch pop}ifelse
2012 lt{dup findfont dup length dict begin
{1 index/FID ne 2 index/UniqueID ne and
{def} {pop pop} ifelse}forall
currentdict end definefont pop
}{pop}ifelse
}bd
/t_array 0 def
/t_i 0 def
/t_c 1 string def
/x_proc{ % x y
exch t_array t_i get add exch moveto
/t_i t_i 1 add store
}bd
/y_proc{ % x y
t_array t_i get add moveto
/t_i t_i 1 add store
}bd
/xy_proc{
% x y
t_array t_i 2 copy 1 add get 3 1 roll get
4 -1 roll add 3 1 roll add moveto
/t_i t_i 2 add store
}bd
/sop 0 def % don't bind sop
/cp_proc/x_proc ld % default moveto proc is for xwidths only
/base_charpath % string array
{
/t_array xs
/t_i 0 def
{ % char
t_c 0 3 -1 roll put
currentpoint
t_c cply sop
cp_proc
}forall
/t_array 0 def
}bd
/sop/stroke ld % default sop is stroke. Done here so we don't bind in /base_charpath
% default sop is stroke
/nop{}def
/xsp/base_charpath ld
/ysp{/cp_proc/y_proc ld base_charpath/cp_proc/x_proc ld}bd
/xysp{/cp_proc/xy_proc ld base_charpath/cp_proc/x_proc ld}bd
/xmp{/sop/nop ld /cp_proc/x_proc ld base_charpath/sop/stroke ld}bd
/ymp{/sop/nop ld /cp_proc/y_proc ld base_charpath/sop/stroke ld}bd
/xymp{/sop/nop ld /cp_proc/xy_proc ld base_charpath/sop/stroke ld}bd
/refnt{ % newname encoding fontname
findfont dup length dict copy dup
/Encoding 4 -1 roll put
definefont pop
}bd
/renmfont{ % newname fontname
findfont dup length dict copy definefont pop
}bd
L3? dup dup{save exch}if
% languagelevel2 ONLY code goes here
/Range 0 def
/DataSource 0 def
/val 0 def
/nRange 0 def
/mulRange 0 def
/d0 0 def
/r0 0 def
/di 0 def
/ri 0 def
/a0 0 def
/a1 0 def
/r1 0 def
/r2 0 def
/dx 0 def
/Nsteps 0 def
/sh3tp 0 def
/ymax 0 def
/ymin 0 def
/xmax 0 def
/xmin 0 def
/setupFunEval % funDict -- % this calculates and sets up a function dict for evaulation.
{
begin
/nRange Range length 2 idiv store
/mulRange % precompute the range data needed to map a sample value from the table to a range value
% this data looks like [ range0mul range0min range1mul range1min ... rangeN-1mul rangeN-1min ]
[
0 1 nRange 1 sub
{ % index
2 mul/nDim2 xd % 2*dimension# we are dealing with
Range nDim2 get % ymin
Range nDim2 1 add get % ymin ymax
1 index sub % ymin (ymax-ymin)
% xmin = 0, xmax = 255 (2^bitspersample - 1)
255 div % ymin (ymax-ymin)/(xmax - xmin)
exch % (ymax-ymin)/(xmax - xmin) ymin
}for
]store
end
}bd
/FunEval % val1 fundict -> comp1 comp2 ... compN
{
begin
% the value passed in is the base index into the table
nRange mul /val xd % compute the actual index to the table
% since there are nRange entries per base index
0 1 nRange 1 sub
{
dup 2 mul/nDim2 xd % dim
val % base value to use to do our lookup
add DataSource exch get % lookedupval
mulRange nDim2 get mul % lookedupval*(ymax-ymin)/(xmax-xmin)
mulRange nDim2 1 add get % lookedupval*(ymax-ymin)/(xmax-xmin) ymin
add % interpolated result
}for % comp1 comp2 ... compN
end
}bd
/max % a b -> max(a, b)
{
2 copy lt
{exch pop}{pop}ifelse
}bd
/sh2
{ % emulation of shading type 2. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 x1 y1
3 index 3 index translate % origin is now at beginning point of shading
% x0 y0 x1 y1
3 -1 roll sub % x0 x1 y1-y0
3 1 roll exch % y1-y0 x1 x0
sub % y1-y0 x1-x0
2 copy
dup mul exch dup mul add sqrt % length of segment between two points
dup
scale
atan % atan (dy/dx)
%dup (rotation angle = )print ==
rotate % now line between 0,0 and 1,0 is the line perpendicular to which the axial lines are drawn
/Function load setupFunEval % may need to setup function dictionary by calling setupFunEval
% this is now specific to axial shadings. Compute the maximum bounds to fill
clippath {pathbbox}stopped {0 0 0 0}if newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
currentdict/Extend known
{
/Extend load 0 get
{
0/Function load FunEval sc % evaluate the function to get a color and set it
xmin ymin xmin abs ymax ymin sub rectfill
}if
}if
% paint the rects. The sampling frequency is that of our table
/Nsteps/Function load/Size get 0 get 1 sub store
/dx 1 Nsteps div store
gsave
/di ymax ymin sub store
/Function load
% loop Nsteps + 1 times, incrementing the index by 1 each time
0 1 Nsteps
{
1 index FunEval sc
0 ymin dx di rectfill
dx 0 translate
}for
pop % pop our function
grestore % origin is back to start point
currentdict/Extend known
{
/Extend load 1 get
{
Nsteps/Function load FunEval sc % last element
1 ymin xmax 1 sub abs ymax ymin sub rectfill
}if
}if
}bd
/shp % this paints our shape for shading type 3
{ % x1 r1 x0 r0 -
4 copy
% fill interior arc
dup 0 gt{
0 exch a1 a0 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a0 a1 arcn
}{
pop 0 lineto
}ifelse
fill
% fill exterior arc
dup 0 gt{
0 exch a0 a1 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a1 a0 arcn
}{
pop 0 lineto
}ifelse
fill
}bd
/calcmaxs
{ % calculate maximum distance vector from origin to corner points
% of bbox
xmin dup mul ymin dup mul add sqrt % (xmin2 + ymin2)
xmax dup mul ymin dup mul add sqrt % (xmax2 + ymin2)
xmin dup mul ymax dup mul add sqrt % (xmin2 + ymax2)
xmax dup mul ymax dup mul add sqrt % (xmax2 + ymax2)
max max max % maximum value
}bd
/sh3
{ % emulation of shading type 3. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 r1 x1 y1 r2
5 index 5 index translate % origin is now at first circle origin
3 -1 roll 6 -1 roll sub % y0 r1 y1 r2 dx
3 -1 roll 5 -1 roll sub % r1 r2 dx dy
2 copy dup mul exch dup mul add sqrt
/dx xs % r1 r2 dx dy
2 copy 0 ne exch 0 ne or
{
% r1 r2 dx dy
exch atan rotate % we are now rotated so dy is zero and positive values of dx move us as expected
}{
pop pop
}ifelse
% r1 r2
/r2 xs
/r1 xs
/Function load
dup/Size get 0 get 1 sub % this is the size of our table minus 1
/Nsteps xs % at some point we should optimize this better so NSteps is based on needed steps for the device
setupFunEval % may need to setup function dictionary by calling setupFunEval
% determine the case:
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: r1 = r2
% case 3: r1 != r2
dx r2 add r1 lt{
% circle 2 inside of circle 1
0
}{
dx r1 add r2 le
{ % circle 1 inside of circle 2
1
}{ % circles don't contain each other
r1 r2 eq
{ % equal
2
}{ % r1 != r2
3
}ifelse
}ifelse
}ifelse
/sh3tp xs % sh3tp has the number of our different cases
clippath {pathbbox}stopped {0 0 0 0}if
newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
% Arc angle atan( sqrt((dx*dx + dy*dy) - dr*dr), dr)
dx dup mul r2 r1 sub dup mul sub dup 0 gt
{
sqrt r2 r1 sub atan
/a0 exch 180 exch sub store
/a1 a0 neg store
}{
pop
/a0 0 store
/a1 360 store
}ifelse
currentdict/Extend known
{
/Extend load 0 get r1 0 gt and % no need to extend if the radius of the first end is 0
{
0/Function load FunEval sc % evaluate the function to get a color and set it
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{ % case 0
dx 0 r1 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % case 1
r1 0 gt{0 0 r1 0 360 arc fill}if
}
{ % case 2
% r1 == r2, extend 0
% r3 = r, x3 = -(abs(minx) + r), x1 = 0
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 xmin abs r1 add neg r1 shp
}
{ % case 3
% no containment, r1 != r2
r2 r1 gt{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
0 r1
r1 neg r2 r1 sub div dx mul % this is point of beginning circle
0 % point of ending circle
shp % takes x(i+1) r(i+1) x(i) r(i)
}{ % the first circle is the bigger of the two
% we find a circle on our line which is outside the bbox in the
% negative direction
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 calcmaxs % 0 r1 maxs
dup
% calculating xs: (-(maxs+r2)*x2)/(x2-(r1-r2))
r2 add dx mul dx r1 r2 sub sub div
neg % maxs xs'
exch 1 index % xs' maxs xs'
abs exch sub
shp
}ifelse
}
}sh3tp get exec % execute the extend at beginning proc for our shading type
}if
}if
% now do the shading
/d0 0 store
/r0 r1 store
/di dx Nsteps div store
/ri r2 r1 sub Nsteps div store
/Function load
0 1 Nsteps
{ % function t(i)
1 index FunEval sc
d0 di add r0 ri add d0 r0 shp
{
% fill interior arc
d0 0 r0 a1 a0 arc
d0 di add 0 r0 ri add a0 a1 arcn
fill
% fill exterior arc
d0 0 r0 a0 a1 arc
d0 di add 0 r0 ri add a1 a0 arcn
fill
}pop
% advance to next
/d0 d0 di add store
/r0 r0 ri add store
}for
pop % pop our function dict
% handle Extend
currentdict/Extend known
{
/Extend load 1 get r2 0 gt and % no need to extend if the radius of the last end is 0
{
Nsteps/Function load FunEval sc % last element
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{
dx 0 r2 0 360 arc fill
}
{
dx 0 r2 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % r1 == r2, extend 1
% r3 = r, x3 = (abs(xmax) + r), x1 = dx
% x(i+1) r(i+1) x(i) r(i) shp
xmax abs r1 add r1 dx r1 shp
}
{ % no containment, r1 != r2
r2 r1 gt{
% we find a circle on our line which is outside the bbox in the
% positive direction
% x(i+1) r(i+1) x(i) r(i) shp
calcmaxs dup % maxs maxs
% calculating xs: ((maxs+r1)*x2)/(x2-(r2-r1))
r1 add dx mul dx r2 r1 sub sub div % maxs xs
exch 1 index % xs maxs xs
exch sub
dx r2
shp
}{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
r1 neg r2 r1 sub div dx mul % this is point of ending circle
0 % radius of ending circle
dx % point of starting circle
r2 % radius of starting circle
shp
}ifelse
}
}
sh3tp get exec % execute the extend at end proc for our shading type
}if
}if
}bd
/sh % emulation of shfill operator for type 2 and type 3 shadings based on type 0 functions
{ % shadingDict --
begin
/ShadingType load dup dup 2 eq exch 3 eq or
{ % shadingtype
gsave
newpath
/ColorSpace load scs
currentdict/BBox known
{
/BBox load aload pop % llx lly urx ury
2 index sub % llx lly urx ury-lly
3 index % llx lly urx ury-lly llx
3 -1 roll exch sub
exch rectclip
}if
2 eq
{sh2}{sh3}ifelse
grestore
}{
% shadingtype
pop
(DEBUG: shading type unimplemented\n)print flush
}ifelse
end
}bd
% end of language level 2 ONLY code
{restore}if not dup{save exch}if
% languagelevel3 ONLY code goes here
L3?{ % we do these loads conditionally or else they will fail on a level 2 printer
/sh/shfill ld
/csq/clipsave ld
/csQ/cliprestore ld
}if
{restore}if
%currentdict dup maxlength exch length sub (number of extra slots in md = )print == flush % *** how many entries are free
end
setpacking
% count 0 ne { pstack(***extras on stack during prolog execution***\n)print flush}if % *** BARK if anything is left on stack
%%EndFile
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
%%PageBoundingBox: 0 0 1102 1102
%%BeginPageSetup
cg_md begin
bp
sdmtx
[ /CIEBasedABC 4 dict dup begin
/WhitePoint [ 0.9505 1.0000 1.0891 ] def
/DecodeABC [
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
] def
/MatrixABC [ 0.4124 0.2126 0.0193 0.3576 0.7151 0.1192 0.1805 0.0722 0.9508 ] def
/RangeLMN [ 0.0 0.9505 0.0 1.0000 0.0 1.0891 ] def
end ] /Cs1 exch/ColorSpace dr pop
%%EndPageSetup
0.60000002 i
/Cs1 SC
0.13333334 0.13333334 0.13333334 sc
q
0 1102 m
518 1102 l
518 0 l
0 0 l
0 1102 l
h
W*
0 0 1102 1102 rc
-10 1112 m
528 1112 l
528 -10 l
-10 -10 l
h
f
Q
0.76078433 0.65098041 0.38039216 sc
q
518 1102 m
1102 1102 l
1102 0 l
518 0 l
518 1102 l
h
W*
0 0 1102 1102 rc
508 1112 m
1112 1112 l
1112 -10 l
508 -10 l
h
f
Q
0.13333334 0.13333334 0.13333334 sc
q
921.56757 760 m
982 760 l
982 340 l
921.56757 340 l
921.56757 553.5 l
698.43243 553.5 l
698.43243 340 l
638 340 l
638 760 l
698.43243 760 l
698.43243 568.08331 l
921.56757 568.08331 l
921.56757 760 l
h
W
0 0 1102 1102 rc
628 770 m
992 770 l
992 330 l
628 330 l
h
f
Q
0.76078433 0.65098041 0.38039216 sc
q
180.15546 554.08331 m
180.15546 357.5 l
233.30252 357.5 l
266.00839 357.5 290.53781 362.16666 306.89075 378.5 c
323.24368 395.41666 331.42017 420.5 331.42017 454.33334 c
331.42017 488.75 322.07562 513.83331 303.97058 530.16669 c
285.28152 546.5 253.15967 554.66669 206.43698 554.66669 c
198.84454 554.66669 187.16386 554.08331 180.15546 554.08331 c
h
180.15546 744.25 m
180.15546 568.66669 l
195.92436 568.66669 l
240.31093 568.66669 270.09665 575.66669 286.44958 589.66669 c
302.80252 603.66669 310.39496 625.83331 310.39496 657.33331 c
310.39496 678.91669 307.47479 695.83331 301.05042 707.5 c
294.62604 719.75 284.69748 728.5 272.43277 734.91669 c
259.58405 741.91669 238.55882 744.83331 207.60504 744.83331 c
199.42857 744.83331 187.16386 744.83331 180.15546 744.25 c
h
120 340 m
120 760 l
204.68488 760 l
318.57144 760 375.80673 727.33331 375.80673 661.41669 c
375.80673 634.58331 365.87814 612.41669 346.021 596.08331 c
326.74789 579.75 296.96219 568.66669 257.83194 562.83331 c
305.13864 559.33331 340.18066 547.66669 363.54202 527.83331 c
386.31934 507.41666 398 482.33334 398 452.58334 c
398 426.33334 389.82352 403.58334 374.63864 384.33334 c
358.86975 365.66666 339.0126 354 314.48318 348.16666 c
289.9538 342.33334 257.83194 340 216.94958 340 c
120 340 l
h
W
0 0 1102 1102 rc
110 770 m
408 770 l
408 330 l
110 330 l
h
f
ep
end
%%Trailer
%%EOF

View File

@ -0,0 +1,912 @@
%!PS-Adobe-3.0 EPSF-3.0
%APL_DSC_Encoding: UTF8
%APLProducer: (Version 10.14.6 (Build 18G95) Quartz PS Context)
%%Title: (Unknown)
%%Creator: (Unknown)
%%CreationDate: (Unknown)
%%For: (Unknown)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%Pages: 1
%%BoundingBox: 0 0 1102 1102
%%EndComments
%%BeginProlog
%%BeginFile: cg-pdf.ps
%%Copyright: Copyright 2000-2004 Apple Computer Incorporated.
%%Copyright: All Rights Reserved.
currentpacking true setpacking
/cg_md 141 dict def
cg_md begin
/L3? languagelevel 3 ge def
/bd{bind def}bind def
/ld{load def}bd
/xs{exch store}bd
/xd{exch def}bd
/cmmtx matrix def
mark
/sc/setcolor
/scs/setcolorspace
/dr/defineresource
/fr/findresource
/T/true
/F/false
/d/setdash
/w/setlinewidth
/J/setlinecap
/j/setlinejoin
/M/setmiterlimit
/i/setflat
/rc/rectclip
/rf/rectfill
/rs/rectstroke
/f/fill
/f*/eofill
/sf/selectfont
/s/show
%/as/ashow
/xS/xshow
/yS/yshow
/xyS/xyshow
/S/stroke
/m/moveto
/l/lineto
/c/curveto
/h/closepath
/n/newpath
/q/gsave
/Q/grestore
counttomark 2 idiv
%dup (number of ld's = )print == flush % *** how many
{ld}repeat pop
/SC{ % CSname
/ColorSpace fr scs
}bd
/sopr /setoverprint where{pop/setoverprint}{/pop}ifelse ld
/soprm /setoverprintmode where{pop/setoverprintmode}{/pop}ifelse ld
/cgmtx matrix def
/sdmtx{cgmtx currentmatrix pop}bd
/CM {cgmtx setmatrix}bd % pop the ctm: our gstate ctm on host is now identity
/cm {cmmtx astore CM concat}bd % reset the matrix and then concat
/W{clip newpath}bd
/W*{eoclip newpath}bd
statusdict begin product end dup (HP) anchorsearch{
pop pop pop % pop off the search results
true
}{
pop % previous search result
(hp) anchorsearch{
pop pop true
}{
pop false
}ifelse
}ifelse
{ % HP is the product: we use this method of stroking because of a bug in their clone printers with certain T3 fonts
{
{ % charCode Wx Wy
pop pop % charCode
(0)dup 0 4 -1 roll put
F charpath
}cshow
}
}{
{F charpath}
}ifelse
/cply exch bd
/cps {cply stroke}bd
/pgsave 0 def
/bp{/pgsave save store}bd
/ep{pgsave restore showpage}def % dont' bind
/re{4 2 roll m 1 index 0 rlineto 0 exch rlineto neg 0 rlineto h}bd
/scrdict 10 dict def
/scrmtx matrix def
/patarray 0 def
/createpat{patarray 3 1 roll put}bd
/makepat{
scrmtx astore pop
gsave
initgraphics
CM
patarray exch get
scrmtx
makepattern
grestore
setpattern
}bd
/cg_BeginEPSF{
userdict save/cg_b4_Inc_state exch put
userdict/cg_endepsf/cg_EndEPSF load put
count userdict/cg_op_count 3 -1 roll put
countdictstack dup array dictstack userdict/cg_dict_array 3 -1 roll put
3 sub{end}repeat
/showpage {} def
0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin
10 setmiterlimit [] 0 setdash newpath
false setstrokeadjust false setoverprint % don't use F
}bd
/cg_EndEPSF{
countdictstack 3 sub { end } repeat
cg_dict_array 3 1 index length 3 sub getinterval
{begin}forall
count userdict/cg_op_count get sub{pop}repeat
userdict/cg_b4_Inc_state get restore
F setpacking
}bd
/cg_biproc{currentfile/RunLengthDecode filter}bd
/cg_aiproc{currentfile/ASCII85Decode filter/RunLengthDecode filter}bd
/ImageDataSource 0 def
L3?{
/cg_mibiproc{pop pop/ImageDataSource{cg_biproc}def}bd
/cg_miaiproc{pop pop/ImageDataSource{cg_aiproc}def}bd
}{
/ImageBandMask 0 def
/ImageBandData 0 def
/cg_mibiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/RunLengthDecode filter dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
/cg_miaiproc{
string/ImageBandMask xs
string/ImageBandData xs
/ImageDataSource{[currentfile/ASCII85Decode filter/RunLengthDecode filter
dup ImageBandMask/readstring cvx
/pop cvx dup ImageBandData/readstring cvx/pop cvx]cvx bind}bd
}bd
}ifelse
/imsave 0 def
/BI{save/imsave xd mark}bd
/EI{imsave restore}bd
/ID{
counttomark 2 idiv
dup 2 add % leave room for imagetype and imagematrix
dict begin
{def} repeat
pop % remove mark
/ImageType 1 def
/ImageMatrix[Width 0 0 Height neg 0 Height]def
currentdict dup/ImageMask known{ImageMask}{F}ifelse exch
% currentdict on stack
L3?{
dup/MaskedImage known
{
pop
<<
/ImageType 3
/InterleaveType 2
/DataDict currentdict
/MaskDict
<< /ImageType 1
/Width Width
/Height Height
/ImageMatrix ImageMatrix
/BitsPerComponent 1
/Decode [0 1]
currentdict/Interpolate known
{/Interpolate Interpolate}if
>>
>>
}if
}if
exch
{imagemask}{image}ifelse
end % pop imagedict from dict stack
}bd
/cguidfix{statusdict begin mark version end
{cvr}stopped{cleartomark 0}{exch pop}ifelse
2012 lt{dup findfont dup length dict begin
{1 index/FID ne 2 index/UniqueID ne and
{def} {pop pop} ifelse}forall
currentdict end definefont pop
}{pop}ifelse
}bd
/t_array 0 def
/t_i 0 def
/t_c 1 string def
/x_proc{ % x y
exch t_array t_i get add exch moveto
/t_i t_i 1 add store
}bd
/y_proc{ % x y
t_array t_i get add moveto
/t_i t_i 1 add store
}bd
/xy_proc{
% x y
t_array t_i 2 copy 1 add get 3 1 roll get
4 -1 roll add 3 1 roll add moveto
/t_i t_i 2 add store
}bd
/sop 0 def % don't bind sop
/cp_proc/x_proc ld % default moveto proc is for xwidths only
/base_charpath % string array
{
/t_array xs
/t_i 0 def
{ % char
t_c 0 3 -1 roll put
currentpoint
t_c cply sop
cp_proc
}forall
/t_array 0 def
}bd
/sop/stroke ld % default sop is stroke. Done here so we don't bind in /base_charpath
% default sop is stroke
/nop{}def
/xsp/base_charpath ld
/ysp{/cp_proc/y_proc ld base_charpath/cp_proc/x_proc ld}bd
/xysp{/cp_proc/xy_proc ld base_charpath/cp_proc/x_proc ld}bd
/xmp{/sop/nop ld /cp_proc/x_proc ld base_charpath/sop/stroke ld}bd
/ymp{/sop/nop ld /cp_proc/y_proc ld base_charpath/sop/stroke ld}bd
/xymp{/sop/nop ld /cp_proc/xy_proc ld base_charpath/sop/stroke ld}bd
/refnt{ % newname encoding fontname
findfont dup length dict copy dup
/Encoding 4 -1 roll put
definefont pop
}bd
/renmfont{ % newname fontname
findfont dup length dict copy definefont pop
}bd
L3? dup dup{save exch}if
% languagelevel2 ONLY code goes here
/Range 0 def
/DataSource 0 def
/val 0 def
/nRange 0 def
/mulRange 0 def
/d0 0 def
/r0 0 def
/di 0 def
/ri 0 def
/a0 0 def
/a1 0 def
/r1 0 def
/r2 0 def
/dx 0 def
/Nsteps 0 def
/sh3tp 0 def
/ymax 0 def
/ymin 0 def
/xmax 0 def
/xmin 0 def
/setupFunEval % funDict -- % this calculates and sets up a function dict for evaulation.
{
begin
/nRange Range length 2 idiv store
/mulRange % precompute the range data needed to map a sample value from the table to a range value
% this data looks like [ range0mul range0min range1mul range1min ... rangeN-1mul rangeN-1min ]
[
0 1 nRange 1 sub
{ % index
2 mul/nDim2 xd % 2*dimension# we are dealing with
Range nDim2 get % ymin
Range nDim2 1 add get % ymin ymax
1 index sub % ymin (ymax-ymin)
% xmin = 0, xmax = 255 (2^bitspersample - 1)
255 div % ymin (ymax-ymin)/(xmax - xmin)
exch % (ymax-ymin)/(xmax - xmin) ymin
}for
]store
end
}bd
/FunEval % val1 fundict -> comp1 comp2 ... compN
{
begin
% the value passed in is the base index into the table
nRange mul /val xd % compute the actual index to the table
% since there are nRange entries per base index
0 1 nRange 1 sub
{
dup 2 mul/nDim2 xd % dim
val % base value to use to do our lookup
add DataSource exch get % lookedupval
mulRange nDim2 get mul % lookedupval*(ymax-ymin)/(xmax-xmin)
mulRange nDim2 1 add get % lookedupval*(ymax-ymin)/(xmax-xmin) ymin
add % interpolated result
}for % comp1 comp2 ... compN
end
}bd
/max % a b -> max(a, b)
{
2 copy lt
{exch pop}{pop}ifelse
}bd
/sh2
{ % emulation of shading type 2. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 x1 y1
3 index 3 index translate % origin is now at beginning point of shading
% x0 y0 x1 y1
3 -1 roll sub % x0 x1 y1-y0
3 1 roll exch % y1-y0 x1 x0
sub % y1-y0 x1-x0
2 copy
dup mul exch dup mul add sqrt % length of segment between two points
dup
scale
atan % atan (dy/dx)
%dup (rotation angle = )print ==
rotate % now line between 0,0 and 1,0 is the line perpendicular to which the axial lines are drawn
/Function load setupFunEval % may need to setup function dictionary by calling setupFunEval
% this is now specific to axial shadings. Compute the maximum bounds to fill
clippath {pathbbox}stopped {0 0 0 0}if newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
currentdict/Extend known
{
/Extend load 0 get
{
0/Function load FunEval sc % evaluate the function to get a color and set it
xmin ymin xmin abs ymax ymin sub rectfill
}if
}if
% paint the rects. The sampling frequency is that of our table
/Nsteps/Function load/Size get 0 get 1 sub store
/dx 1 Nsteps div store
gsave
/di ymax ymin sub store
/Function load
% loop Nsteps + 1 times, incrementing the index by 1 each time
0 1 Nsteps
{
1 index FunEval sc
0 ymin dx di rectfill
dx 0 translate
}for
pop % pop our function
grestore % origin is back to start point
currentdict/Extend known
{
/Extend load 1 get
{
Nsteps/Function load FunEval sc % last element
1 ymin xmax 1 sub abs ymax ymin sub rectfill
}if
}if
}bd
/shp % this paints our shape for shading type 3
{ % x1 r1 x0 r0 -
4 copy
% fill interior arc
dup 0 gt{
0 exch a1 a0 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a0 a1 arcn
}{
pop 0 lineto
}ifelse
fill
% fill exterior arc
dup 0 gt{
0 exch a0 a1 arc
}{
pop 0 moveto
}ifelse
dup 0 gt{
0 exch a1 a0 arcn
}{
pop 0 lineto
}ifelse
fill
}bd
/calcmaxs
{ % calculate maximum distance vector from origin to corner points
% of bbox
xmin dup mul ymin dup mul add sqrt % (xmin2 + ymin2)
xmax dup mul ymin dup mul add sqrt % (xmax2 + ymin2)
xmin dup mul ymax dup mul add sqrt % (xmin2 + ymax2)
xmax dup mul ymax dup mul add sqrt % (xmax2 + ymax2)
max max max % maximum value
}bd
/sh3
{ % emulation of shading type 3. Assumes shading dictionary is top dictionary on the dict stack
/Coords load aload pop % x0 y0 r1 x1 y1 r2
5 index 5 index translate % origin is now at first circle origin
3 -1 roll 6 -1 roll sub % y0 r1 y1 r2 dx
3 -1 roll 5 -1 roll sub % r1 r2 dx dy
2 copy dup mul exch dup mul add sqrt
/dx xs % r1 r2 dx dy
2 copy 0 ne exch 0 ne or
{
% r1 r2 dx dy
exch atan rotate % we are now rotated so dy is zero and positive values of dx move us as expected
}{
pop pop
}ifelse
% r1 r2
/r2 xs
/r1 xs
/Function load
dup/Size get 0 get 1 sub % this is the size of our table minus 1
/Nsteps xs % at some point we should optimize this better so NSteps is based on needed steps for the device
setupFunEval % may need to setup function dictionary by calling setupFunEval
% determine the case:
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: r1 = r2
% case 3: r1 != r2
dx r2 add r1 lt{
% circle 2 inside of circle 1
0
}{
dx r1 add r2 le
{ % circle 1 inside of circle 2
1
}{ % circles don't contain each other
r1 r2 eq
{ % equal
2
}{ % r1 != r2
3
}ifelse
}ifelse
}ifelse
/sh3tp xs % sh3tp has the number of our different cases
clippath {pathbbox}stopped {0 0 0 0}if
newpath % x0 y0 x1 y1
/ymax xs
/xmax xs
/ymin xs
/xmin xs
% Arc angle atan( sqrt((dx*dx + dy*dy) - dr*dr), dr)
dx dup mul r2 r1 sub dup mul sub dup 0 gt
{
sqrt r2 r1 sub atan
/a0 exch 180 exch sub store
/a1 a0 neg store
}{
pop
/a0 0 store
/a1 360 store
}ifelse
currentdict/Extend known
{
/Extend load 0 get r1 0 gt and % no need to extend if the radius of the first end is 0
{
0/Function load FunEval sc % evaluate the function to get a color and set it
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{ % case 0
dx 0 r1 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % case 1
r1 0 gt{0 0 r1 0 360 arc fill}if
}
{ % case 2
% r1 == r2, extend 0
% r3 = r, x3 = -(abs(minx) + r), x1 = 0
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 xmin abs r1 add neg r1 shp
}
{ % case 3
% no containment, r1 != r2
r2 r1 gt{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
0 r1
r1 neg r2 r1 sub div dx mul % this is point of beginning circle
0 % point of ending circle
shp % takes x(i+1) r(i+1) x(i) r(i)
}{ % the first circle is the bigger of the two
% we find a circle on our line which is outside the bbox in the
% negative direction
% x(i+1) r(i+1) x(i) r(i) shp
0 r1 calcmaxs % 0 r1 maxs
dup
% calculating xs: (-(maxs+r2)*x2)/(x2-(r1-r2))
r2 add dx mul dx r1 r2 sub sub div
neg % maxs xs'
exch 1 index % xs' maxs xs'
abs exch sub
shp
}ifelse
}
}sh3tp get exec % execute the extend at beginning proc for our shading type
}if
}if
% now do the shading
/d0 0 store
/r0 r1 store
/di dx Nsteps div store
/ri r2 r1 sub Nsteps div store
/Function load
0 1 Nsteps
{ % function t(i)
1 index FunEval sc
d0 di add r0 ri add d0 r0 shp
{
% fill interior arc
d0 0 r0 a1 a0 arc
d0 di add 0 r0 ri add a0 a1 arcn
fill
% fill exterior arc
d0 0 r0 a0 a1 arc
d0 di add 0 r0 ri add a1 a0 arcn
fill
}pop
% advance to next
/d0 d0 di add store
/r0 r0 ri add store
}for
pop % pop our function dict
% handle Extend
currentdict/Extend known
{
/Extend load 1 get r2 0 gt and % no need to extend if the radius of the last end is 0
{
Nsteps/Function load FunEval sc % last element
% case 0: circle1 inside circle2
% case 1: circle 2 inside circle 1
% case 2: circles don't contain each other and r1 == r2
% case 3: circles don't contain each other and r1 != r2
{
{
dx 0 r2 0 360 arc fill
}
{
dx 0 r2 360 0 arcn
xmin ymin moveto
xmax ymin lineto
xmax ymax lineto
xmin ymax lineto
xmin ymin lineto
eofill % for the bigger radius we fill everything except our circle
}
{ % r1 == r2, extend 1
% r3 = r, x3 = (abs(xmax) + r), x1 = dx
% x(i+1) r(i+1) x(i) r(i) shp
xmax abs r1 add r1 dx r1 shp
}
{ % no containment, r1 != r2
r2 r1 gt{
% we find a circle on our line which is outside the bbox in the
% positive direction
% x(i+1) r(i+1) x(i) r(i) shp
calcmaxs dup % maxs maxs
% calculating xs: ((maxs+r1)*x2)/(x2-(r2-r1))
r1 add dx mul dx r2 r1 sub sub div % maxs xs
exch 1 index % xs maxs xs
exch sub
dx r2
shp
}{ % the endpoint we are drawing is that with a circle of zero radius
% x(i+1) r(i+1) x(i) r(i) shp
r1 neg r2 r1 sub div dx mul % this is point of ending circle
0 % radius of ending circle
dx % point of starting circle
r2 % radius of starting circle
shp
}ifelse
}
}
sh3tp get exec % execute the extend at end proc for our shading type
}if
}if
}bd
/sh % emulation of shfill operator for type 2 and type 3 shadings based on type 0 functions
{ % shadingDict --
begin
/ShadingType load dup dup 2 eq exch 3 eq or
{ % shadingtype
gsave
newpath
/ColorSpace load scs
currentdict/BBox known
{
/BBox load aload pop % llx lly urx ury
2 index sub % llx lly urx ury-lly
3 index % llx lly urx ury-lly llx
3 -1 roll exch sub
exch rectclip
}if
2 eq
{sh2}{sh3}ifelse
grestore
}{
% shadingtype
pop
(DEBUG: shading type unimplemented\n)print flush
}ifelse
end
}bd
% end of language level 2 ONLY code
{restore}if not dup{save exch}if
% languagelevel3 ONLY code goes here
L3?{ % we do these loads conditionally or else they will fail on a level 2 printer
/sh/shfill ld
/csq/clipsave ld
/csQ/cliprestore ld
}if
{restore}if
%currentdict dup maxlength exch length sub (number of extra slots in md = )print == flush % *** how many entries are free
end
setpacking
% count 0 ne { pstack(***extras on stack during prolog execution***\n)print flush}if % *** BARK if anything is left on stack
%%EndFile
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
%%PageBoundingBox: 0 0 1102 1102
%%BeginPageSetup
cg_md begin
bp
sdmtx
[ /CIEBasedABC 4 dict dup begin
/WhitePoint [ 0.9505 1.0000 1.0891 ] def
/DecodeABC [
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
{ 1.0 0.0 3 -1 roll 1 index 1 index le { exch pop} { pop } ifelse
1 index 1 index ge { exch pop } { pop } ifelse <
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000001010101010101010101010101
0101010101010101010101010101010101010101010101020202020202020202
0202020202020202020202020202020202030303030303030303030303030303
0303030303030304040404040404040404040404040404040404050505050505
0505050505050505050506060606060606060606060606060607070707070707
0707070707070708080808080808080808080808090909090909090909090909
0a0a0a0a0a0a0a0a0a0a0a0b0b0b0b0b0b0b0b0b0b0b0c0c0c0c0c0c0c0c0c0c
0d0d0d0d0d0d0d0d0d0d0e0e0e0e0e0e0e0e0e0f0f0f0f0f0f0f0f0f10101010
1010101010111111111111111112121212121212121313131313131313141414
1414141414151515151515151616161616161616171717171717171818181818
18181919191919191a1a1a1a1a1a1a1b1b1b1b1b1b1c1c1c1c1c1c1c1d1d1d1d
1d1d1e1e1e1e1e1e1f1f1f1f1f1f202020202020212121212121222222222223
2323232323242424242425252525252526262626262727272727282828282829
292929292a2a2a2a2a2b2b2b2b2b2c2c2c2c2c2d2d2d2d2d2e2e2e2e2e2f2f2f
2f2f303030303131313131323232323333333333343434343535353535363636
36373737373838383839393939393a3a3a3a3b3b3b3b3c3c3c3c3d3d3d3d3e3e
3e3e3f3f3f3f4040404041414141424242424343434444444445454545464646
4647474748484848494949494a4a4a4b4b4b4b4c4c4c4d4d4d4d4e4e4e4f4f4f
4f50505051515151525252535353535454545555555656565657575758585859
59595a5a5a5a5b5b5b5c5c5c5d5d5d5e5e5e5f5f5f6060606061616162626263
63636464646565656666666767676868686969696a6a6a6b6b6b6c6c6d6d6d6e
6e6e6f6f6f707070717171727273737374747475757576767677777878787979
797a7a7b7b7b7c7c7c7d7d7e7e7e7f7f7f808081818182828283838484848585
86868687878888888989898a8a8b8b8b8c8c8d8d8d8e8e8f8f90909091919292
9293939494949595969697979798989999999a9a9b9b9c9c9c9d9d9e9e9f9f9f
a0a0a1a1a2a2a3a3a3a4a4a5a5a6a6a6a7a7a8a8a9a9aaaaabababacacadadae
aeafafb0b0b0b1b1b2b2b3b3b4b4b5b5b6b6b6b7b7b8b8b9b9bababbbbbcbcbd
bdbebebebfbfc0c0c1c1c2c2c3c3c4c4c5c5c6c6c7c7c8c8c9c9cacacbcbcccc
cdcdcececfcfd0d0d1d1d2d2d3d3d4d4d5d5d6d6d7d7d8d8d9d9dadadbdcdcdd
dddededfdfe0e0e1e1e2e2e3e3e4e4e5e6e6e7e7e8e8e9e9eaeaebebecededee
eeefeff0f0f1f1f2f3f3f4f4f5f5f6f6f7f8f8f9f9fafafbfcfcfdfdfefeffff
> dup length 1 sub 3 -1 roll mul dup dup floor cvi exch ceiling
cvi 3 index exch get 4 -1 roll 3 -1 roll get
dup 3 1 roll sub 3 -1 roll dup floor cvi sub mul add 255 div } bind
] def
/MatrixABC [ 0.4124 0.2126 0.0193 0.3576 0.7151 0.1192 0.1805 0.0722 0.9508 ] def
/RangeLMN [ 0.0 0.9505 0.0 1.0000 0.0 1.0891 ] def
end ] /Cs1 exch/ColorSpace dr pop
%%EndPageSetup
0.60000002 i
/Cs1 SC
0.13333334 0.13333334 0.13333334 sc
q
0 1102 m
518 1102 l
518 0 l
0 0 l
0 1102 l
h
W*
0 0 1102 1102 rc
-10 1112 m
528 1112 l
528 -10 l
-10 -10 l
h
f
Q
1 1 1 sc
q
518 1102 m
1102 1102 l
1102 0 l
518 0 l
518 1102 l
h
W*
0 0 1102 1102 rc
508 1112 m
1112 1112 l
1112 -10 l
508 -10 l
h
f
Q
0.13333334 0.13333334 0.13333334 sc
q
921.56757 760 m
982 760 l
982 340 l
921.56757 340 l
921.56757 553.5 l
698.43243 553.5 l
698.43243 340 l
638 340 l
638 760 l
698.43243 760 l
698.43243 568.08331 l
921.56757 568.08331 l
921.56757 760 l
h
W
0 0 1102 1102 rc
628 770 m
992 770 l
992 330 l
628 330 l
h
f
Q
1 1 1 sc
q
180.15546 554.08331 m
180.15546 357.5 l
233.30252 357.5 l
266.00839 357.5 290.53781 362.16666 306.89075 378.5 c
323.24368 395.41666 331.42017 420.5 331.42017 454.33334 c
331.42017 488.75 322.07562 513.83331 303.97058 530.16669 c
285.28152 546.5 253.15967 554.66669 206.43698 554.66669 c
198.84454 554.66669 187.16386 554.08331 180.15546 554.08331 c
h
180.15546 744.25 m
180.15546 568.66669 l
195.92436 568.66669 l
240.31093 568.66669 270.09665 575.66669 286.44958 589.66669 c
302.80252 603.66669 310.39496 625.83331 310.39496 657.33331 c
310.39496 678.91669 307.47479 695.83331 301.05042 707.5 c
294.62604 719.75 284.69748 728.5 272.43277 734.91669 c
259.58405 741.91669 238.55882 744.83331 207.60504 744.83331 c
199.42857 744.83331 187.16386 744.83331 180.15546 744.25 c
h
120 340 m
120 760 l
204.68488 760 l
318.57144 760 375.80673 727.33331 375.80673 661.41669 c
375.80673 634.58331 365.87814 612.41669 346.021 596.08331 c
326.74789 579.75 296.96219 568.66669 257.83194 562.83331 c
305.13864 559.33331 340.18066 547.66669 363.54202 527.83331 c
386.31934 507.41666 398 482.33334 398 452.58334 c
398 426.33334 389.82352 403.58334 374.63864 384.33334 c
358.86975 365.66666 339.0126 354 314.48318 348.16666 c
289.9538 342.33334 257.83194 340 216.94958 340 c
120 340 l
h
W
0 0 1102 1102 rc
110 770 m
408 770 l
408 330 l
110 330 l
h
f
ep
end
%%Trailer
%%EOF

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="551px" height="258px" viewBox="0 0 551 258" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
<title>Initials (Gold and Black)</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Concept-#6-(Final-Kearning)" transform="translate(-120.000000, -995.000000)">
<g id="Initials-(Gold-and-Black)" transform="translate(120.000000, 995.000000)">
<rect id="Rectangle" fill="#222222" x="0" y="0" width="259" height="258"></rect>
<rect id="Rectangle" fill="#C2A661" x="259" y="0" width="292" height="258"></rect>
<polygon id="Housen" fill="#222222" fill-rule="nonzero" points="460.783784 24 491 24 491 234 460.783784 234 460.783784 127.25 349.216216 127.25 349.216216 234 319 234 319 24 349.216216 24 349.216216 119.958333 460.783784 119.958333"></polygon>
<path d="M90.0777311,126.958333 L90.0777311,225.25 L116.651261,225.25 C133.004202,225.25 145.268908,222.916667 153.445378,214.75 C161.621849,206.291667 165.710084,193.75 165.710084,176.833333 C165.710084,159.625 161.037815,147.083333 151.985294,138.916667 C142.640756,130.75 126.579832,126.666667 103.218487,126.666667 C99.4222689,126.666667 93.5819328,126.958333 90.0777311,126.958333 Z M90.0777311,31.875 L90.0777311,119.666667 L97.9621849,119.666667 C120.155462,119.666667 135.048319,116.166667 143.22479,109.166667 C151.401261,102.166667 155.197479,91.0833333 155.197479,75.3333333 C155.197479,64.5416667 153.737395,56.0833333 150.52521,50.25 C147.313025,44.125 142.348739,39.75 136.216387,36.5416667 C129.792017,33.0416667 119.279412,31.5833333 103.802521,31.5833333 C99.7142857,31.5833333 93.5819328,31.5833333 90.0777311,31.875 Z M60,234 L60,24 L102.342437,24 C159.285714,24 187.903361,40.3333333 187.903361,73.2916667 C187.903361,86.7083333 182.939076,97.7916667 173.010504,105.958333 C163.37395,114.125 148.481092,119.666667 128.915966,122.583333 C152.569328,124.333333 170.090336,130.166667 181.771008,140.083333 C193.159664,150.291667 199,162.833333 199,177.708333 C199,190.833333 194.911765,202.208333 187.319328,211.833333 C179.434874,221.166667 169.506303,227 157.241597,229.916667 C144.976891,232.833333 128.915966,234 108.47479,234 L60,234 Z" id="Barrett" fill="#C2A661" fill-rule="nonzero"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="551px" height="258px" viewBox="0 0 551 258" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
<title>Initials (White and Black)</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Concept-#6-(Final-Kearning)" transform="translate(-120.000000, -120.000000)">
<g id="Initials-(White-and-Black)" transform="translate(120.000000, 120.000000)">
<rect id="Rectangle" fill="#222222" x="0" y="0" width="259" height="258"></rect>
<rect id="Rectangle" fill="#FFFFFF" x="259" y="0" width="292" height="258"></rect>
<polygon id="Housen" fill="#222222" fill-rule="nonzero" points="460.783784 24 491 24 491 234 460.783784 234 460.783784 127.25 349.216216 127.25 349.216216 234 319 234 319 24 349.216216 24 349.216216 119.958333 460.783784 119.958333"></polygon>
<path d="M90.0777311,126.958333 L90.0777311,225.25 L116.651261,225.25 C133.004202,225.25 145.268908,222.916667 153.445378,214.75 C161.621849,206.291667 165.710084,193.75 165.710084,176.833333 C165.710084,159.625 161.037815,147.083333 151.985294,138.916667 C142.640756,130.75 126.579832,126.666667 103.218487,126.666667 C99.4222689,126.666667 93.5819328,126.958333 90.0777311,126.958333 Z M90.0777311,31.875 L90.0777311,119.666667 L97.9621849,119.666667 C120.155462,119.666667 135.048319,116.166667 143.22479,109.166667 C151.401261,102.166667 155.197479,91.0833333 155.197479,75.3333333 C155.197479,64.5416667 153.737395,56.0833333 150.52521,50.25 C147.313025,44.125 142.348739,39.75 136.216387,36.5416667 C129.792017,33.0416667 119.279412,31.5833333 103.802521,31.5833333 C99.7142857,31.5833333 93.5819328,31.5833333 90.0777311,31.875 Z M60,234 L60,24 L102.342437,24 C159.285714,24 187.903361,40.3333333 187.903361,73.2916667 C187.903361,86.7083333 182.939076,97.7916667 173.010504,105.958333 C163.37395,114.125 148.481092,119.666667 128.915966,122.583333 C152.569328,124.333333 170.090336,130.166667 181.771008,140.083333 C193.159664,150.291667 199,162.833333 199,177.708333 C199,190.833333 194.911765,202.208333 187.319328,211.833333 C179.434874,221.166667 169.506303,227 157.241597,229.916667 C144.976891,232.833333 128.915966,234 108.47479,234 L60,234 Z" id="Barrett" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="551px" height="551px" viewBox="0 0 551 551" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
<title>Square (Gold and Black)</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Concept-#6-(Final-Kearning)" transform="translate(-2154.000000, -1019.000000)">
<g id="Square-(Gold-and-Black)" transform="translate(2154.000000, 1019.000000)">
<rect id="Rectangle" fill="#222222" x="0" y="0" width="259" height="551"></rect>
<rect id="Rectangle" fill="#C2A661" x="259" y="0" width="292" height="551"></rect>
<polygon id="Housen" fill="#222222" fill-rule="nonzero" points="460.783784 171 491 171 491 381 460.783784 381 460.783784 274.25 349.216216 274.25 349.216216 381 319 381 319 171 349.216216 171 349.216216 266.958333 460.783784 266.958333"></polygon>
<path d="M90.0777311,273.958333 L90.0777311,372.25 L116.651261,372.25 C133.004202,372.25 145.268908,369.916667 153.445378,361.75 C161.621849,353.291667 165.710084,340.75 165.710084,323.833333 C165.710084,306.625 161.037815,294.083333 151.985294,285.916667 C142.640756,277.75 126.579832,273.666667 103.218487,273.666667 C99.4222689,273.666667 93.5819328,273.958333 90.0777311,273.958333 Z M90.0777311,178.875 L90.0777311,266.666667 L97.9621849,266.666667 C120.155462,266.666667 135.048319,263.166667 143.22479,256.166667 C151.401261,249.166667 155.197479,238.083333 155.197479,222.333333 C155.197479,211.541667 153.737395,203.083333 150.52521,197.25 C147.313025,191.125 142.348739,186.75 136.216387,183.541667 C129.792017,180.041667 119.279412,178.583333 103.802521,178.583333 C99.7142857,178.583333 93.5819328,178.583333 90.0777311,178.875 Z M60,381 L60,171 L102.342437,171 C159.285714,171 187.903361,187.333333 187.903361,220.291667 C187.903361,233.708333 182.939076,244.791667 173.010504,252.958333 C163.37395,261.125 148.481092,266.666667 128.915966,269.583333 C152.569328,271.333333 170.090336,277.166667 181.771008,287.083333 C193.159664,297.291667 199,309.833333 199,324.708333 C199,337.833333 194.911765,349.208333 187.319328,358.833333 C179.434874,368.166667 169.506303,374 157.241597,376.916667 C144.976891,379.833333 128.915966,381 108.47479,381 L60,381 Z" id="Barrett" fill="#C2A661" fill-rule="nonzero"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="551px" height="551px" viewBox="0 0 551 551" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
<title>Square (White and Black)</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Concept-#6-(Final-Kearning)" transform="translate(-2154.000000, -144.000000)">
<g id="Square-(White-and-Black)" transform="translate(2154.000000, 144.000000)">
<rect id="Rectangle" fill="#222222" x="0" y="0" width="259" height="551"></rect>
<rect id="Rectangle" fill="#FFFFFF" x="259" y="0" width="292" height="551"></rect>
<polygon id="Housen" fill="#222222" fill-rule="nonzero" points="460.783784 171 491 171 491 381 460.783784 381 460.783784 274.25 349.216216 274.25 349.216216 381 319 381 319 171 349.216216 171 349.216216 266.958333 460.783784 266.958333"></polygon>
<path d="M90.0777311,273.958333 L90.0777311,372.25 L116.651261,372.25 C133.004202,372.25 145.268908,369.916667 153.445378,361.75 C161.621849,353.291667 165.710084,340.75 165.710084,323.833333 C165.710084,306.625 161.037815,294.083333 151.985294,285.916667 C142.640756,277.75 126.579832,273.666667 103.218487,273.666667 C99.4222689,273.666667 93.5819328,273.958333 90.0777311,273.958333 Z M90.0777311,178.875 L90.0777311,266.666667 L97.9621849,266.666667 C120.155462,266.666667 135.048319,263.166667 143.22479,256.166667 C151.401261,249.166667 155.197479,238.083333 155.197479,222.333333 C155.197479,211.541667 153.737395,203.083333 150.52521,197.25 C147.313025,191.125 142.348739,186.75 136.216387,183.541667 C129.792017,180.041667 119.279412,178.583333 103.802521,178.583333 C99.7142857,178.583333 93.5819328,178.583333 90.0777311,178.875 Z M60,381 L60,171 L102.342437,171 C159.285714,171 187.903361,187.333333 187.903361,220.291667 C187.903361,233.708333 182.939076,244.791667 173.010504,252.958333 C163.37395,261.125 148.481092,266.666667 128.915966,269.583333 C152.569328,271.333333 170.090336,277.166667 181.771008,287.083333 C193.159664,297.291667 199,309.833333 199,324.708333 C199,337.833333 194.911765,349.208333 187.319328,358.833333 C179.434874,368.166667 169.506303,374 157.241597,376.916667 C144.976891,379.833333 128.915966,381 108.47479,381 L60,381 Z" id="Barrett" fill="#FFFFFF" fill-rule="nonzero"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -54,7 +54,7 @@ spec:
http: http:
paths: paths:
- pathType: Prefix - pathType: Prefix
path: "/api/" path: "/api"
backend: backend:
service: service:
name: proxy-admin name: proxy-admin

View File

@ -54,7 +54,7 @@ spec:
http: http:
paths: paths:
- pathType: Prefix - pathType: Prefix
path: "/api/" path: "/api"
backend: backend:
service: service:
name: proxy-client name: proxy-client

View File

@ -15,6 +15,8 @@ spec:
containers: containers:
- name: runner - name: runner
image: barretthousen/service-runner image: barretthousen/service-runner
tty: true
stdin: true
ports: ports:
- containerPort: 5001 - containerPort: 5001
name: grpc name: grpc

View File

@ -24,4 +24,4 @@ patches:
patch: |- patch: |-
- op: replace - op: replace
path: /spec/rules/0/host path: /spec/rules/0/host
value: bh.localhost value: localhost

View File

@ -1,13 +1,16 @@
FROM golang:1.19-alpine as builder FROM golang:1.19-alpine as builder
RUN go install github.com/go-delve/delve/cmd/dlv@latest ARG service
RUN go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest
FROM alpine as development FROM alpine as development
ARG service ARG service
COPY --from=builder /go/bin/dlv /go/bin/dlv COPY --from=builder /go/bin/dlv /go/bin/dlv
COPY .bin/${service}-debug /opt/${service}-debug COPY .bin/${service}-debug /opt/
COPY ./src /go/src/
ENV SERVICE=${service} ENV SERVICE=${service}

View File

@ -14,7 +14,7 @@ RUN /go/bin/buf mod update /go/src/src \
&& /go/bin/buf generate && /go/bin/buf generate
RUN go mod tidy \ RUN go mod tidy \
&& CGO_ENABLED=0 go build -v -o /opt/${service} /go/src/${service} && CGO_ENABLED=0 go build -v -gcflags="-trimpath=$(go env GOPATH)" -asmflags="-trimpath=$(go env GOPATH)" -o /opt/${service} /go/src/${service}
FROM alpine as production FROM alpine as production

View File

@ -33,7 +33,13 @@ type Auction struct {
End time.Time `json:"end,omitempty"` End time.Time `json:"end,omitempty"`
} }
func (css *CatalogServiceClient) UpdateUpcomingAuction(ctx context.Context, a Auction) (string, error) { type AuctionCreatedEvent struct {
Fingerprint string
ID int
Duplicate bool
}
func (css *CatalogServiceClient) UpdateUpcomingAuction(ctx context.Context, a Auction) (AuctionCreatedEvent, error) {
ac, err := css.ImportAuction(ctx, &capi.ImportAuctionMessage{ ac, err := css.ImportAuction(ctx, &capi.ImportAuctionMessage{
Items: int32(a.ItemCount), Items: int32(a.ItemCount),
Start: timestamppb.New(a.Start), Start: timestamppb.New(a.Start),
@ -47,8 +53,12 @@ func (css *CatalogServiceClient) UpdateUpcomingAuction(ctx context.Context, a Au
Province: a.Province, Province: a.Province,
}) })
if err != nil { if err != nil {
return "", err return AuctionCreatedEvent{}, err
} }
return ac.Auction.GetFingerprint(), nil return AuctionCreatedEvent{
Fingerprint: ac.Auction.Fingerprint,
ID: int(ac.Auction.Id),
Duplicate: ac.Duplicate,
}, nil
} }

View File

@ -20,7 +20,6 @@ service Catalog {
message AuctionSearchCriteria { message AuctionSearchCriteria {
string searchTerm = 1; string searchTerm = 1;
int64 startBeforeTs = 2;
int32 page = 3; int32 page = 3;
int32 limit = 4; int32 limit = 4;
} }
@ -28,7 +27,8 @@ message AuctionSearchCriteria {
message GetUpcomingResult { message GetUpcomingResult {
int32 page = 1; int32 page = 1;
int32 total = 2; int32 total = 2;
repeated Auction results = 3; int32 found = 3;
repeated Auction results = 4;
} }
message Auction { message Auction {

View File

@ -22,10 +22,12 @@ CREATE TABLE IF NOT EXISTS catalog.upcoming_auctions_fts (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
auctionid INTEGER REFERENCES CATALOG.UPCOMING_AUCTIONS, auctionid INTEGER REFERENCES CATALOG.UPCOMING_AUCTIONS,
title VARCHAR(1024) NOT NULL, title VARCHAR(1024) NOT NULL,
sourcesitename VARCHAR(256) NOT NULL,
description TEXT NOT NULL, description TEXT NOT NULL,
ts tsvector GENERATED ALWAYS AS (( ts tsvector GENERATED ALWAYS AS ((
setweight(to_tsvector('english', (sourcesitename)::TEXT), 'A') ||
setweight(to_tsvector('english', (title)::TEXT), 'A') || setweight(to_tsvector('english', (title)::TEXT), 'A') ||
setweight(to_tsvector('english', (description)::TEXT), 'B') setweight(to_tsvector('english', (description)::TEXT), 'C')
)) STORED )) STORED
); );
@ -82,7 +84,8 @@ BEGIN
auctionid, auctionid,
title, title,
description description
) VALUES ( auction_id, p_title, p_description ); sourcesitename
) VALUES ( auction_id, p_title, p_description, p_sourcesitename );
ELSE ELSE
-- 0 means there is a duplicate auction ID -- 0 means there is a duplicate auction ID
auction_id = 0; auction_id = 0;

View File

@ -2,10 +2,15 @@
SELECT ua.* SELECT ua.*
FROM catalog.upcoming_auctions ua FROM catalog.upcoming_auctions ua
LEFT JOIN catalog.upcoming_auctions_fts fts on ua.id = fts.auctionid LEFT JOIN catalog.upcoming_auctions_fts fts on ua.id = fts.auctionid
WHERE fts.ts @@ phraseto_tsquery($1) WHERE
ORDER BY ts_rank(fts.ts, phraseto_tsquery($1)) DESC ua.endts >= DATE(NOW()) AND
LIMIT $2; fts.ts @@ websearch_to_tsquery(sqlc.arg(searchTerm))
ORDER BY ts_rank(fts.ts, websearch_to_tsquery(sqlc.arg(searchTerm))) DESC
OFFSET sqlc.arg(page)::INTEGER * sqlc.arg(pageSize)::INTEGER
LIMIT sqlc.arg(pageSize);
-- name: GetTotal :one
SELECT COUNT(*) FROM catalog.upcoming_auctions;
-- name: ImportAuction :one -- name: ImportAuction :one
SELECT catalog.bh_import_auction( SELECT catalog.bh_import_auction(

View File

@ -8,23 +8,30 @@ import (
"git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/data/postgres" "git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/data/postgres"
"git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/domain" "git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/domain"
"git.vdhsn.com/barretthousen/barretthousen/src/lib/kernel"
) )
type PGCatalogStorage struct { type PGCatalogStorage struct {
Queries *postgres.Queries Queries *postgres.Queries
} }
func (ps *PGCatalogStorage) GetUpcoming(ctx context.Context, q domain.UpcomingQuery) (results []domain.Auction, total int, err error) { func (ps *PGCatalogStorage) GetUpcoming(ctx context.Context, q domain.UpcomingQuery) (results []domain.Auction, total int64, err error) {
var pgResults []postgres.CatalogUpcomingAuction var pgResults []postgres.CatalogUpcomingAuction
if pgResults, err = ps.Queries.GetUpcoming(ctx, postgres.GetUpcomingParams{ if pgResults, err = ps.Queries.GetUpcoming(ctx, postgres.GetUpcomingParams{
PhrasetoTsquery: q.Term, Searchterm: q.Term,
Limit: 64, Page: int32(q.Page),
Pagesize: int32(q.Limit),
}); err != nil { }); err != nil {
err = fmt.Errorf("could not get upcoming auctions from pg: %w", err) err = fmt.Errorf("could not get upcoming auctions from pg: %w", err)
return return
} }
if total, err = ps.Queries.GetTotal(ctx); err != nil {
err = fmt.Errorf("could not get total auction count: %w", err)
return
}
results = make([]domain.Auction, len(pgResults)) results = make([]domain.Auction, len(pgResults))
for idx, row := range pgResults { for idx, row := range pgResults {
results[idx] = domain.Auction{ results[idx] = domain.Auction{
@ -34,7 +41,7 @@ func (ps *PGCatalogStorage) GetUpcoming(ctx context.Context, q domain.UpcomingQu
Description: row.Description, Description: row.Description,
SourceSiteURL: row.Sourcesiteurl, SourceSiteURL: row.Sourcesiteurl,
SourceSiteName: row.Sourcesitename, SourceSiteName: row.Sourcesitename,
SourceURL: row.Sourcesiteurl, SourceURL: row.Sourceurl,
Country: row.Country, Country: row.Country,
Province: row.Province, Province: row.Province,
ItemCount: int(row.Itemcount), ItemCount: int(row.Itemcount),
@ -54,6 +61,7 @@ func (ps *PGCatalogStorage) CreateUpcoming(ctx context.Context, a domain.Auction
var auctionID int32 var auctionID int32
fingerprint = fmt.Sprintf("%x", sha512.Sum512(append([]byte(a.Title), []byte(a.Description)...))) fingerprint = fmt.Sprintf("%x", sha512.Sum512(append([]byte(a.Title), []byte(a.Description)...)))
kernel.TraceLog.Printf("%s: %s + %s", fingerprint, a.Title, a.Description)
if auctionID, err = ps.Queries.ImportAuction(ctx, postgres.ImportAuctionParams{ if auctionID, err = ps.Queries.ImportAuction(ctx, postgres.ImportAuctionParams{
Fingerprint: fingerprint, Fingerprint: fingerprint,
Title: a.Title, Title: a.Title,

View File

@ -17,12 +17,14 @@ type (
} }
Storage interface { Storage interface {
GetUpcoming(context.Context, UpcomingQuery) ([]Auction, int, error) GetUpcoming(context.Context, UpcomingQuery) ([]Auction, int64, error)
CreateUpcoming(context.Context, Auction) (string, error) CreateUpcoming(context.Context, Auction) (string, error)
} }
UpcomingQuery struct { UpcomingQuery struct {
Term string Term string
Page int
Limit int
StartDateFilter time.Time StartDateFilter time.Time
} }
@ -37,7 +39,7 @@ type (
UpcomingResults struct { UpcomingResults struct {
Page int Page int
Total int Total int64
Results []Auction Results []Auction
} }
) )

View File

@ -3,7 +3,7 @@ package internal
import ( import (
"context" "context"
"fmt" "fmt"
"time" "math"
api "git.vdhsn.com/barretthousen/barretthousen/src/catalog/api/grpc" api "git.vdhsn.com/barretthousen/barretthousen/src/catalog/api/grpc"
"git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/domain" "git.vdhsn.com/barretthousen/barretthousen/src/catalog/internal/domain"
@ -28,26 +28,38 @@ type catalogHandler struct {
domain Domain domain Domain
} }
func (rh *catalogHandler) GetUpcoming(ctx context.Context, cmd *api.AuctionSearchCriteria) (r *api.GetUpcomingResult, err error) { func (rh *catalogHandler) GetUpcoming(ctx context.Context, cmd *api.AuctionSearchCriteria) (out *api.GetUpcomingResult, err error) {
kernel.TraceLog.Printf("GetUpcoming[searchTerm: %q - page: %d - pageSize: %d]", cmd.GetSearchTerm(), cmd.GetPage(), cmd.GetLimit()) page := int(math.Max(0, float64(cmd.GetPage())))
var results domain.UpcomingResults pageSize := int(cmd.GetLimit())
if results, err = rh.domain.GetUpcoming(ctx, domain.UpcomingQuery{
if pageSize < 32 {
pageSize = 32
} else if pageSize > 128 {
pageSize = 128
}
kernel.TraceLog.Printf("GetUpcoming[searchTerm: %q - page: %d - pageSize: %d]", cmd.GetSearchTerm(), page, pageSize)
var queryResp domain.UpcomingResults
if queryResp, err = rh.domain.GetUpcoming(ctx, domain.UpcomingQuery{
Term: cmd.SearchTerm, Term: cmd.SearchTerm,
StartDateFilter: time.Unix(cmd.StartBeforeTs, 0), Page: page,
Limit: pageSize,
}); err != nil { }); err != nil {
err = fmt.Errorf("could not get upcoming items from domain: %w", err) err = fmt.Errorf("could not get upcoming items from domain: %w", err)
return return
} }
r = &api.GetUpcomingResult{ out = &api.GetUpcomingResult{
Page: int32(results.Page), Page: int32(page),
Total: int32(results.Total), Total: int32(queryResp.Total),
Results: make([]*api.Auction, len(results.Results)), Found: int32(pageSize),
Results: make([]*api.Auction, len(queryResp.Results)),
} }
for idx, a := range results.Results { for idx, a := range queryResp.Results {
r.Results[idx] = &api.Auction{ out.Results[idx] = &api.Auction{
Id: int32(a.ID), Id: int32(a.ID),
Fingerprint: a.Fingerprint,
Items: int32(a.ItemCount), Items: int32(a.ItemCount),
Start: timestamppb.New(a.Start), Start: timestamppb.New(a.Start),
End: timestamppb.New(a.End), End: timestamppb.New(a.End),

View File

@ -36,7 +36,8 @@ func (app *ProxyClientApp) Start(ctx context.Context) error {
Addr: fmt.Sprintf("0.0.0.0:%d", app.Port), Addr: fmt.Sprintf("0.0.0.0:%d", app.Port),
ReadHeaderTimeout: time.Second, ReadHeaderTimeout: time.Second,
Handler: http.StripPrefix("/api", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { Handler: http.StripPrefix("/api", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
kernel.TraceLog.Printf("{ \"Client\": \"%s\", \"Path\":\"%s\"} ", r.RemoteAddr, r.URL.Path) kernel.TraceLog.Printf("{ \"Client\": \"%s\", \"Path\":\"%s\", \"User-Agent\":\"%s\" } ", r.RemoteAddr, r.URL, r.UserAgent())
w.Header().Set("Access-Control-Allow-Origin", "*")
grpcMux.ServeHTTP(w, r) grpcMux.ServeHTTP(w, r)
})), })),
} }

View File

@ -8,37 +8,40 @@ import "google/api/annotations.proto";
option go_package = "git.vdhsn.com/barretthousen/barretthousen/src/runner/api/grpc"; option go_package = "git.vdhsn.com/barretthousen/barretthousen/src/runner/api/grpc";
service Runner { service Runner {
rpc FindNewUpcoming(FindNewUpcomingCommand) returns (JobResult) { rpc StartSync(SyncParameters) returns (SyncStatus) {
option (google.api.http) = { option (google.api.http) = {
put: "/v1/findnewupcoming" put: "/v1/sync"
body: "*" body: "*"
}; };
} }
rpc GetJobs(GetJobsCommand) returns (JobsResult) { rpc Status(StatusFilter) returns (SyncStatusList) {
option (google.api.http) = { option (google.api.http) = {
post: "/v1/jobs" get: "/v1/sync"
body: "*"
}; };
} }
} }
message FindNewUpcomingCommand { message SyncParameters {
string targetSite = 1; string targetSite = 1;
} }
message JobResult { message SyncStatus {
int32 id = 1; int32 id = 1;
int32 auctionsFound = 2; google.protobuf.Timestamp createdTs = 2;
google.protobuf.Timestamp createdTs = 3; google.protobuf.Timestamp completedTs = 3;
google.protobuf.Timestamp completedTs = 4; int32 auctionsFound = 4;
string targetSiteName = 5; string targetSiteName = 5;
string errors = 6; string errors = 6;
} }
message GetJobsCommand { } message StatusFilter {
int32 page = 1;
message JobsResult { int32 id = 2;
repeated JobResult jobs = 1;
} }
message SyncStatusList {
repeated SyncStatus results = 1;
int32 page = 2;
int32 total = 3;
}

View File

@ -5,7 +5,8 @@ SELECT id,
targetSiteName, targetSiteName,
auctionsFound, auctionsFound,
errors errors
FROM runner.scrapejob; FROM runner.scrapejob
ORDER BY startedTs DESC;
-- name: GetJobByID :one -- name: GetJobByID :one
SELECT id, SELECT id,

View File

@ -79,7 +79,7 @@ func LAGetUpcomingSaleIDs(ctx context.Context, in GetUpcomingSaleIDsInput) (ids
ctx, ctx,
http.MethodGet, http.MethodGet,
fmt.Sprintf( fmt.Sprintf(
"https://search-party-prod.liveauctioneers.com/search/catalogsearch?c=20170802&client=web&client_version=5.0.0&excludedHouses=[]&max_facet_values=0&offset=%d&sort=saleStart&pageSize=%d", "https://search-party-prod.liveauctioneers.com/search/catalogsearch?page=%d&sort=saleStart&pageSize=%d",
in.Page, in.Page,
in.Limit, in.Limit,
), ),
@ -174,11 +174,12 @@ func LAGetSaleInfo(ctx context.Context, catIDs LACatalogIDs) (results []catalog.
var apiResults struct { var apiResults struct {
Data struct { Data struct {
Catalogs []struct { Catalogs []struct {
ID int `json:"catid"` ID int `json:"catalogId"`
Title string `json:"title"` Title string `json:"title"`
Description string `json:"description"` Description string `json:"description"`
ItemCount int `json:"lotsListed"` ItemCount int `json:"lotsListed"`
SaleStartTS int64 `json:"saleStartTs"` SaleStartTS int64 `json:"saleStartTs"`
SellerID int64 `json:"sellerId"`
Address struct { Address struct {
CountryCode string `json:"country"` CountryCode string `json:"country"`
Lat float64 `json:"lat"` Lat float64 `json:"lat"`

View File

@ -45,7 +45,7 @@ type (
} }
CatalogService interface { CatalogService interface {
UpdateUpcomingAuction(context.Context, catalog.Auction) (string, error) UpdateUpcomingAuction(context.Context, catalog.Auction) (catalog.AuctionCreatedEvent, error)
} }
FindNewUpcomingInput struct { FindNewUpcomingInput struct {
@ -57,15 +57,10 @@ type (
} }
) )
func (domain Domain) FindNewUpcoming(ctx context.Context, in FindNewUpcomingInput) (out FindNewUpcomingOutput, err error) { func (domain Domain) StartSync(ctx context.Context, in FindNewUpcomingInput) (out FindNewUpcomingOutput, err error) {
for k := range targetsImpls { kernel.TraceLog.Printf("%+v", in)
kernel.TraceLog.Printf("Find Target: %q", k)
} finder := targetsImpls["liveauctioneers"]
finder, ok := targetsImpls[in.TargetSite]
if !ok {
err = fmt.Errorf("could not find target matching name")
return
}
if out.Job, err = domain.Storage.CreateScrapeJob(ctx, in.TargetSite); err != nil { if out.Job, err = domain.Storage.CreateScrapeJob(ctx, in.TargetSite); err != nil {
err = fmt.Errorf("could not create new scrape job record: %w", err) err = fmt.Errorf("could not create new scrape job record: %w", err)
@ -86,7 +81,7 @@ type (
} }
) )
func (domain Domain) GetJobs(ctx context.Context, in GetJobsInput) (out GetJobsOutput, err error) { func (domain Domain) Status(ctx context.Context, in GetJobsInput) (out GetJobsOutput, err error) {
scrapeJobs, err := domain.Storage.GetJobs(ctx) scrapeJobs, err := domain.Storage.GetJobs(ctx)
if err != nil { if err != nil {
err = fmt.Errorf("could not fetch jobs from storage: %w", err) err = fmt.Errorf("could not fetch jobs from storage: %w", err)
@ -101,7 +96,7 @@ func (domain Domain) GetJobs(ctx context.Context, in GetJobsInput) (out GetJobsO
func (domain *Domain) executeScrapeJob(finder UpcomingAuctionFinder, jobID int) { func (domain *Domain) executeScrapeJob(finder UpcomingAuctionFinder, jobID int) {
ctx, cancel := context.WithDeadline(context.TODO(), time.Now().Add(time.Minute)) ctx, cancel := context.WithDeadline(context.TODO(), time.Now().Add(time.Minute))
defer cancel() defer cancel()
found := make(chan catalog.Auction) found := make(chan catalog.Auction, 2048)
errGroup, innerCtx := errgroup.WithContext(ctx) errGroup, innerCtx := errgroup.WithContext(ctx)
errGroup.Go(func() error { errGroup.Go(func() error {
@ -109,12 +104,23 @@ func (domain *Domain) executeScrapeJob(finder UpcomingAuctionFinder, jobID int)
}) })
count := 0 count := 0
total := 0
errs := &strings.Builder{} errs := &strings.Builder{}
for auction := range found { for auction := range found {
count++ total++
if fingerprint, err := domain.CatalogService.UpdateUpcomingAuction(ctx, auction); err != nil { if !auction.Start.After(time.Now()) {
continue
}
ace, err := domain.CatalogService.UpdateUpcomingAuction(ctx, auction)
if err != nil {
kernel.TraceLog.Printf("could not import upcoming auction: %s", err.Error()) kernel.TraceLog.Printf("could not import upcoming auction: %s", err.Error())
fmt.Fprintf(errs, "{ \"AuctionFingerprint\": \"%s\", \"error\": \"%s\" }\n", fingerprint, err.Error()) fmt.Fprintf(errs, "{ \"AuctionFingerprint\": \"%s\", \"error\": \"%s\" }\n", ace.Fingerprint, err.Error())
continue
}
if !ace.Duplicate {
count++
} }
} }
@ -132,6 +138,6 @@ func (domain *Domain) executeScrapeJob(finder UpcomingAuctionFinder, jobID int)
kernel.ErrorLog.Printf("Could not complete scrape job, failing: %w", err) kernel.ErrorLog.Printf("Could not complete scrape job, failing: %w", err)
} }
kernel.InfoLog.Printf("Scrape Job %d completed in %v.", jobID, completedJob.Completed.Sub(completedJob.Started)) kernel.InfoLog.Printf("Scrape Job %d completed in %v. Successfully imported %d/%d", jobID, completedJob.Completed.Sub(completedJob.Started), count, total)
return return
} }

View File

@ -22,15 +22,15 @@ type runnerHandler struct {
domain *domain.Domain domain *domain.Domain
} }
func (rh *runnerHandler) FindNewUpcoming(ctx context.Context, cmd *api.FindNewUpcomingCommand) (*api.JobResult, error) { func (rh *runnerHandler) StartSync(ctx context.Context, cmd *api.SyncParameters) (*api.SyncStatus, error) {
out, err := rh.domain.FindNewUpcoming(ctx, domain.FindNewUpcomingInput{ out, err := rh.domain.StartSync(ctx, domain.FindNewUpcomingInput{
TargetSite: cmd.TargetSite, TargetSite: cmd.TargetSite,
}) })
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "method FindNewUpcoming failed: %q", err.Error()) return nil, status.Errorf(codes.Internal, "method FindNewUpcoming failed: %q", err.Error())
} }
return &api.JobResult{ return &api.SyncStatus{
Id: int32(out.Job.ID), Id: int32(out.Job.ID),
AuctionsFound: int32(out.Job.AuctionsFound), AuctionsFound: int32(out.Job.AuctionsFound),
CreatedTs: timestamppb.New(out.Job.Started), CreatedTs: timestamppb.New(out.Job.Started),
@ -40,18 +40,18 @@ func (rh *runnerHandler) FindNewUpcoming(ctx context.Context, cmd *api.FindNewUp
}, nil }, nil
} }
func (rh *runnerHandler) GetJobs(ctx context.Context, cmd *api.GetJobsCommand) (*api.JobsResult, error) { func (rh *runnerHandler) Status(ctx context.Context, cmd *api.StatusFilter) (*api.SyncStatusList, error) {
out, err := rh.domain.GetJobs(ctx, domain.GetJobsInput{}) out, err := rh.domain.Status(ctx, domain.GetJobsInput{})
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "method GetJobs failed: %q", err.Error()) return nil, status.Errorf(codes.Internal, "method GetJobs failed: %q", err.Error())
} }
result := &api.JobsResult{ result := &api.SyncStatusList{
Jobs: []*api.JobResult{}, Results: []*api.SyncStatus{},
} }
for _, j := range out.Jobs { for _, j := range out.Jobs {
result.Jobs = append(result.Jobs, &api.JobResult{ result.Results = append(result.Results, &api.SyncStatus{
Id: int32(j.ID), Id: int32(j.ID),
AuctionsFound: int32(j.AuctionsFound), AuctionsFound: int32(j.AuctionsFound),
CreatedTs: timestamppb.New(j.Started), CreatedTs: timestamppb.New(j.Started),

View File

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@ -0,0 +1,30 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};

10
src/web-client/.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@ -0,0 +1,9 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

38
src/web-client/README.md Normal file
View File

@ -0,0 +1,38 @@
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

4260
src/web-client/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More