├── .gitignore ├── AUTHOR.rst ├── LICENSE.rst ├── README.rst ├── img ├── cover.png ├── creative-commons.eps ├── creative-commons.png └── nodejs-light.eps ├── index.rst ├── nodejs_hello.rst ├── nodejs_intro.rst ├── nodejs_javascript.rst └── src ├── example.js ├── nodejs_install.rst └── nodejs_npm.rst /.gitignore: -------------------------------------------------------------------------------- 1 | cook 2 | -------------------------------------------------------------------------------- /AUTHOR.rst: -------------------------------------------------------------------------------- 1 | .. raw:: latex 2 | 3 | \setcounter{secnumdepth}{-1} 4 | 5 | ************ 6 | 社群協作成員 7 | ************ 8 | 9 | 依照名字筆劃次序排列。 10 | 11 | * Clonn 12 | * Hsu Ping Feng 13 | * lyhcode (Yan-hong Lin, lyhcode at gmail.com) 14 | 15 | 歡迎有志共同書寫的作者, 16 | 請自行將名字(或暱稱、代號)加入本處(AUTHOR.rst)。 17 | 18 | .. raw:: latex 19 | 20 | \setcounter{secnumdepth}{1} 21 | 22 | -------------------------------------------------------------------------------- /LICENSE.rst: -------------------------------------------------------------------------------- 1 | .. raw:: latex 2 | 3 | \setcounter{secnumdepth}{-1} 4 | 5 | ******* 6 | 版權聲明 7 | ******* 8 | 9 | 《NodeJS 中文開發指南》是開放原始碼電子書, 10 | 歡迎任何單位或個人, 11 | 下載及列印本書內容。 12 | 13 | 請注意, 14 | 若您未取得 NodeJS Taiwan 社群經營團隊書面同意, 15 | 請勿任意將本書作商業行為。 16 | 17 | 本書由社群同時提供免費及販售版本, 18 | 其版稅收入將用於 NodeJS Taiwan 推廣及研習活動。 19 | 20 | 請依 **「創用CC授權條款」** 複製、散布或修改著作。 21 | 22 | .. image:: img/creative-commons.eps 23 | :scale: 75% 24 | :align: center 25 | 26 | **姓名標示 ─ 非商業性 ─ 相同方式分享** 27 | 28 | *本授權條款允許使用者重製、散布、傳輸以及修改著作,但不得為商業目的之使用。 29 | 若使用者修改該著作時,僅得依本授權條款或與本授權條款類似者來散布該衍生作品。 30 | 使用時必須按照著作人指定的方式表彰其姓名。* 31 | 32 | .. raw:: latex 33 | 34 | \setcounter{secnumdepth}{1} -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. raw:: latex 2 | 3 | \setcounter{secnumdepth}{-1} 4 | 5 | ************** 6 | 如何取得本書? 7 | ************** 8 | 9 | 《NodeJS 中文開發指南》 10 | 是「開放原始碼電子書」, 11 | 內容由 NodeJS Taiwan 社群多位作者共同撰寫。 12 | 13 | 本書採用線上持續出版方式發行, 14 | 您可以在以下網址獲取本書的最新版本: 15 | 16 | http://contpub.org/read/NodeJSFromScratch 17 | 18 | 參與電子書計畫 19 | ============== 20 | 21 | 請加入 NodeJS Taiwan 的 Facebook 專頁, 22 | 並留言與社群成員取得聯繫。 23 | 24 | 本書採用 Git 版本控制系統維護原始碼, 25 | 目前使用 GitHub 提供的服務管理開源專案, 26 | 其 Git Repository 網址是: 27 | 28 | * https://github.com/nodejs-tw/nodejs-from-scratch 29 | 30 | 使用 Git 工具, 31 | 任何人都可以 Clone 或 Fork 本書的原始碼, 32 | 並利用 Git 的 Pull Request 功能, 33 | 將您增加或修改的內容加入。 34 | 但為了維護最終發行版本的品質, 35 | 社群維護人員保留決定是否採用(接受 Pull Request)的權力。 36 | 37 | 當作者把內容提交給 NodeJS Taiwan 社群彙整後, 38 | 即無條件同意其內容為社群共有, 39 | 並由社群負責發行、出版事宜。 40 | 41 | 取得本書原始碼 42 | ============== 43 | 44 | 您可以使用 git 指令,取得完整電子書原始碼。 :: 45 | 46 | git clone git://github.com/nodejs-tw/nodejs-from-scratch.git 47 | 48 | 您也可以下載 ZIP 壓縮檔。 49 | 50 | * https://github.com/nodejs-tw/nodejs-from-scratch/zipball/master 51 | 52 | 編輯慣例 53 | ======== 54 | 55 | 專有名詞英文大小寫,盡可能與官方用法相同: 56 | 57 | * NodeJS 58 | * JavaScript 59 | 60 | 中文段落中,標點符號使用全形。 61 | 62 | * ()「」 63 | * ,、;。 64 | 65 | 段落中英文與中文文字之間,使用一個空白字元隔開(遇標點符號則不必)。 66 | 67 | * 中文遇到 English 以空白隔開 68 | * 中文標點符號遇到(English)不必以空白隔開 69 | 70 | 撰寫電子書原始碼 71 | ================ 72 | 73 | 本書採用 reStructuredText 文字格式撰寫。 74 | 75 | http://sphinx.pocoo.org/rest.html 76 | 77 | 您只需要認識幾個基本標記語法, 78 | 就可以開始參與協作。 79 | 80 | 本書的架構以「章」為單位切割檔案, 81 | 副檔名一律採用 .rst 結尾。 82 | 例如 nodejs_intro.rst 、 nodejs_hello.rst 分別是兩個不同 Chapter, 83 | 在 index.rst 主文件中, 84 | 會依次序連結到這些檔案(但定義時不含副檔名)。 85 | 86 | 每一章的 .rst 檔案會有以下的文件結構: :: 87 | 88 | *************** 89 | 這是大標題(章) 90 | *************** 91 | 92 | 這是小標題(節) 93 | =============== 94 | 95 | 這是更小標題(子節) 96 | ------------------- 97 | 98 | 內文的部份,為了方便編輯,可以在在合適的文字長度之後換行, 99 | 連續換行兩次則會建立新的段落。 :: 100 | 101 | 這是第一段落, 102 | 第二行還是同一個段落; 103 | 第三行也是。 104 | 105 | 隔一個空行, 106 | 就會產生一個新的段落, 107 | 到這裡還是第二個段落。 108 | 109 | 如果要顯示一行或多行指令,例如 Shell 命令,則使用兩個冒號, 110 | 隔一行之後再以 Tab 起始。 :: 111 | 112 | 執行一個 NodeJS 程式檔。 :: 113 | 114 | node example.js 115 | 116 | 請注意兩個冒號前面若有其它文字,必須插入「空白」隔開。 117 | 118 | 項目符號,使用 * 星字符號起始,編號採用數字加半型小數點。 :: 119 | 120 | 這是項目符號: 121 | 122 | * 第一項 123 | * 第二項 124 | * 第三項 125 | 126 | 這是編號: 127 | 128 | 1. 第一項 129 | 2. 第二項 130 | 3. 第三項 131 | 132 | 使用項目符號及編號,請與上下段落保持一個空行。 133 | 134 | 如果要顯示程式碼,有兩種寫法。 135 | 136 | 第一種,直接寫在文件裡面(適合片段、部分節錄): :: 137 | 138 | .. code-block:: javascript 139 | 140 | function say_hello(who) { 141 | return 'Hello, ' + who + '!'; 142 | } 143 | 144 | 第二種,寫在外部程式碼檔案(適合大型、可執行程式): :: 145 | 146 | .. literalinclude:: src/example.py 147 | :language: javascript 148 | 149 | 為了方便測試程式碼, 150 | 如果是可被執行的完整程式, 151 | 請放在 src 資料夾下, 152 | 再使用第二種方法嵌入文件中。 153 | 154 | .. raw:: latex 155 | 156 | \setcounter{secnumdepth}{1} 157 | 158 | -------------------------------------------------------------------------------- /img/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodejs-tw/nodejs-community-book/518bf95c393fa29170cba194516eda75ddc967e4/img/cover.png -------------------------------------------------------------------------------- /img/creative-commons.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 %%Creator: Adobe Illustrator(R) 8.0 %%AI8_CreatorVersion: 13.0.1 %%For: (Alex Roberts) () %%Title: (cc.logo.eps) %%CreationDate: 3/25/08 3:21 PM %%BoundingBox: 226 288 530 361 %%HiResBoundingBox: 226.9077 288.1719 529.9521 360.5469 %%DocumentProcessColors: Black %%DocumentSuppliedResources: procset Adobe_level2_AI5 1.2 0 %%+ procset Adobe_ColorImage_AI6 1.3 0 %%+ procset Adobe_Illustrator_AI5 1.3 0 %%+ procset Adobe_cshow 2.0 8 %%+ procset Adobe_shading_AI8 1.0 0 %AI5_FileFormat 4.0 %AI3_ColorUsage: Color %AI3_IncludePlacedImages %AI7_ImageSettings: 1 %%CMYKProcessColor: 1 1 1 1 ([Registration]) %%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set) %%+ Options: 1 16 0 1 1 1 0 0 0 0 1 1 1 18 0 0 0 0 0 0 0 0 -1 -1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 2 3 4 %%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 -1 -1 () %AI3_TemplateBox: 396 306 396 306 %AI3_TileBox: 11.5 18.5 779.5 594.5 %AI3_DocumentPreview: Macintosh_ColorPic %AI5_ArtSize: 792 612 %AI5_RulerUnits: 2 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 300 %AI5_NumLayers: 3 %AI8_OpenToView: 80.5 510.5 1.9534 1010 680 26 0 1 73 75 0 0 %AI5_OpenViewLayers: 777 %%PageOrigin:30 31 %AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments %%BeginProlog %%BeginResource: procset Adobe_level2_AI5 1.2 0 2 | %%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation) 3 | %%Version: 1.2 0 4 | %%CreationDate: (04/10/93) () 5 | %%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) 6 | userdict /Adobe_level2_AI5 26 dict dup begin 7 | put 8 | /packedarray where not 9 | { 10 | userdict begin 11 | /packedarray 12 | { 13 | array astore readonly 14 | } bind def 15 | /setpacking /pop load def 16 | /currentpacking false def 17 | end 18 | 0 19 | } if 20 | pop 21 | userdict /defaultpacking currentpacking put true setpacking 22 | /initialize 23 | { 24 | Adobe_level2_AI5 begin 25 | } bind def 26 | /terminate 27 | { 28 | currentdict Adobe_level2_AI5 eq 29 | { 30 | end 31 | } if 32 | } bind def 33 | mark 34 | /setcustomcolor where not 35 | { 36 | /findcmykcustomcolor 37 | { 38 | (AI8_CMYK_CustomColor) 39 | 6 packedarray 40 | } bind def 41 | /findrgbcustomcolor 42 | { 43 | (AI8_RGB_CustomColor) 44 | 5 packedarray 45 | } bind def 46 | /setcustomcolor 47 | { 48 | exch 49 | aload pop dup 50 | (AI8_CMYK_CustomColor) eq 51 | { 52 | pop pop 53 | 4 54 | { 55 | 4 index mul 56 | 4 1 roll 57 | } repeat 58 | 5 -1 roll pop 59 | setcmykcolor 60 | } 61 | { 62 | dup (AI8_RGB_CustomColor) eq 63 | { 64 | pop pop 65 | 3 66 | { 67 | 1 exch sub 68 | 3 index mul 69 | 1 exch sub 70 | 3 1 roll 71 | } repeat 72 | 4 -1 roll pop 73 | setrgbcolor 74 | } 75 | { 76 | pop 77 | 4 78 | { 79 | 4 index mul 4 1 roll 80 | } repeat 81 | 5 -1 roll pop 82 | setcmykcolor 83 | } ifelse 84 | } ifelse 85 | } 86 | def 87 | } if 88 | /setAIseparationgray 89 | { 90 | false setoverprint 91 | 0 setgray 92 | /setseparationgray where{ 93 | pop setseparationgray 94 | }{ 95 | /setcolorspace where{ 96 | pop 97 | [/Separation (All) /DeviceCMYK {dup dup dup}] setcolorspace 98 | 1 exch sub setcolor 99 | }{ 100 | setgray 101 | }ifelse 102 | }ifelse 103 | } def 104 | 105 | /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def 106 | userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put 107 | userdict /level2? 108 | systemdict /languagelevel known dup 109 | { 110 | pop systemdict /languagelevel get 2 ge 111 | } if 112 | put 113 | /level2ScreenFreq 114 | { 115 | begin 116 | 60 117 | HalftoneType 1 eq 118 | { 119 | pop Frequency 120 | } if 121 | HalftoneType 2 eq 122 | { 123 | pop GrayFrequency 124 | } if 125 | HalftoneType 5 eq 126 | { 127 | pop Default level2ScreenFreq 128 | } if 129 | end 130 | } bind def 131 | userdict /currentScreenFreq 132 | level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put 133 | level2? not 134 | { 135 | /setcmykcolor where not 136 | { 137 | /setcmykcolor 138 | { 139 | exch .11 mul add exch .59 mul add exch .3 mul add 140 | 1 exch sub setgray 141 | } def 142 | } if 143 | /currentcmykcolor where not 144 | { 145 | /currentcmykcolor 146 | { 147 | 0 0 0 1 currentgray sub 148 | } def 149 | } if 150 | /setoverprint where not 151 | { 152 | /setoverprint /pop load def 153 | } if 154 | /selectfont where not 155 | { 156 | /selectfont 157 | { 158 | exch findfont exch 159 | dup type /arraytype eq 160 | { 161 | makefont 162 | } 163 | { 164 | scalefont 165 | } ifelse 166 | setfont 167 | } bind def 168 | } if 169 | /cshow where not 170 | { 171 | /cshow 172 | { 173 | [ 174 | 0 0 5 -1 roll aload pop 175 | ] cvx bind forall 176 | } bind def 177 | } if 178 | } if 179 | cleartomark 180 | /anyColor? 181 | { 182 | add add add 0 ne 183 | } bind def 184 | /testColor 185 | { 186 | gsave 187 | setcmykcolor currentcmykcolor 188 | grestore 189 | } bind def 190 | /testCMYKColorThrough 191 | { 192 | testColor anyColor? 193 | } bind def 194 | userdict /composite? 195 | 1 0 0 0 testCMYKColorThrough 196 | 0 1 0 0 testCMYKColorThrough 197 | 0 0 1 0 testCMYKColorThrough 198 | 0 0 0 1 testCMYKColorThrough 199 | and and and 200 | put 201 | composite? not 202 | { 203 | userdict begin 204 | gsave 205 | /cyan? 1 0 0 0 testCMYKColorThrough def 206 | /magenta? 0 1 0 0 testCMYKColorThrough def 207 | /yellow? 0 0 1 0 testCMYKColorThrough def 208 | /black? 0 0 0 1 testCMYKColorThrough def 209 | grestore 210 | /isCMYKSep? cyan? magenta? yellow? black? or or or def 211 | /customColor? isCMYKSep? not def 212 | end 213 | } if 214 | end defaultpacking setpacking 215 | %%EndResource 216 | %%BeginProcSet: Adobe_ColorImage_AI6 1.3 0 217 | userdict /Adobe_ColorImage_AI6 known not 218 | { 219 | userdict /Adobe_ColorImage_AI6 53 dict put 220 | } if 221 | userdict /Adobe_ColorImage_AI6 get begin 222 | /initialize { 223 | Adobe_ColorImage_AI6 begin 224 | Adobe_ColorImage_AI6 { 225 | dup type /arraytype eq { 226 | dup xcheck { 227 | bind 228 | } if 229 | } if 230 | pop pop 231 | } forall 232 | } def 233 | /terminate { end } def 234 | currentdict /Adobe_ColorImage_AI6_Vars known not { 235 | /Adobe_ColorImage_AI6_Vars 41 dict def 236 | } if 237 | Adobe_ColorImage_AI6_Vars begin 238 | /plateindex -1 def 239 | /_newproc null def 240 | /_proc1 null def 241 | /_proc2 null def 242 | /sourcearray 4 array def 243 | /_ptispace null def 244 | /_ptiname null def 245 | /_pti0 0 def 246 | /_pti1 0 def 247 | /_ptiproc null def 248 | /_ptiscale 0 def 249 | /_pticomps 0 def 250 | /_ptibuf 0 string def 251 | /_gtigray 0 def 252 | /_cticmyk null def 253 | /_rtirgb null def 254 | /XIEnable true def 255 | /XIType 0 def 256 | /XIEncoding 0 def 257 | /XICompression 0 def 258 | /XIChannelCount 0 def 259 | /XIBitsPerPixel 0 def 260 | /XIImageHeight 0 def 261 | /XIImageWidth 0 def 262 | /XIImageMatrix null def 263 | /XIRowBytes 0 def 264 | /XIFile null def 265 | /XIBuffer1 null def 266 | /XIBuffer2 null def 267 | /XIBuffer3 null def 268 | /XIDataProc null def 269 | /XIColorSpace /DeviceGray def 270 | /XIColorValues 0 def 271 | /XIPlateList false def 272 | end 273 | /ci6colorimage /colorimage where {/colorimage get}{null} ifelse def 274 | /ci6image systemdict /image get def 275 | /ci6curtransfer systemdict /currenttransfer get def 276 | /ci6curoverprint /currentoverprint where {/currentoverprint get}{{_of}} ifelse def 277 | /ci6foureq { 278 | 4 index ne { 279 | pop pop pop false 280 | }{ 281 | 4 index ne { 282 | pop pop false 283 | }{ 284 | 4 index ne { 285 | pop false 286 | }{ 287 | 4 index eq 288 | } ifelse 289 | } ifelse 290 | } ifelse 291 | } def 292 | /ci6testplate { 293 | Adobe_ColorImage_AI6_Vars begin 294 | /plateindex -1 def 295 | /setcmykcolor where { 296 | pop 297 | gsave 298 | 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 299 | 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 300 | 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 301 | 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub 302 | grestore 303 | 1 0 0 0 ci6foureq { 304 | /plateindex 0 def 305 | }{ 306 | 0 1 0 0 ci6foureq { 307 | /plateindex 1 def 308 | }{ 309 | 0 0 1 0 ci6foureq { 310 | /plateindex 2 def 311 | }{ 312 | 0 0 0 1 ci6foureq { 313 | /plateindex 3 def 314 | }{ 315 | 0 0 0 0 ci6foureq { 316 | /plateindex 5 def 317 | } if 318 | } ifelse 319 | } ifelse 320 | } ifelse 321 | } ifelse 322 | pop pop pop pop 323 | } if 324 | plateindex 325 | end 326 | } def 327 | /ci6concatprocs { 328 | /packedarray where { 329 | pop dup type /packedarraytype eq 2 index type 330 | /packedarraytype eq or 331 | }{ 332 | false 333 | } ifelse 334 | { 335 | /_proc2 exch cvlit def 336 | /_proc1 exch cvlit def 337 | _proc1 aload pop 338 | _proc2 aload pop 339 | _proc1 length 340 | _proc2 length add 341 | packedarray cvx 342 | }{ 343 | /_proc2 exch cvlit def 344 | /_proc1 exch cvlit def 345 | /_newproc _proc1 length _proc2 length add array def 346 | _newproc 0 _proc1 putinterval 347 | _newproc _proc1 length _proc2 putinterval 348 | _newproc cvx 349 | } ifelse 350 | } def 351 | /ci6istint { 352 | type /arraytype eq 353 | } def 354 | /ci6isspot { 355 | dup type /arraytype eq { 356 | dup length 1 sub get /Separation eq 357 | }{ 358 | pop false 359 | } ifelse 360 | } def 361 | /ci6spotname { 362 | dup ci6isspot {dup length 2 sub get}{pop ()} ifelse 363 | } def 364 | /ci6altspace { 365 | aload pop pop pop ci6colormake 366 | } def 367 | /ci6numcomps { 368 | dup /DeviceGray eq { 369 | pop 1 370 | }{ 371 | dup /DeviceRGB eq { 372 | pop 3 373 | }{ 374 | /DeviceCMYK eq { 375 | 4 376 | }{ 377 | 1 378 | } ifelse 379 | } ifelse 380 | } ifelse 381 | } def 382 | /ci6marksplate { 383 | dup /DeviceGray eq { 384 | pop plateindex 3 eq 385 | }{ 386 | dup /DeviceRGB eq { 387 | pop plateindex 5 ne 388 | }{ 389 | dup /DeviceCMYK eq { 390 | pop plateindex 5 ne 391 | }{ 392 | dup ci6isspot { 393 | /findcmykcustomcolor where { 394 | pop 395 | dup length 2 sub get 396 | 0.1 0.1 0.1 0.1 5 -1 roll 397 | findcmykcustomcolor 1 setcustomcolor 398 | systemdict /currentgray get exec 399 | 1 ne 400 | }{ 401 | pop plateindex 5 ne 402 | } ifelse 403 | }{ 404 | pop plateindex 5 ne 405 | } ifelse 406 | } ifelse 407 | } ifelse 408 | } ifelse 409 | } def 410 | /ci6colormake { 411 | dup ci6numcomps 412 | exch 1 index 2 add 1 roll 413 | dup 1 eq {pop}{array astore} ifelse 414 | exch 415 | } def 416 | /ci6colorexpand { 417 | dup ci6spotname exch 418 | dup ci6istint { 419 | ci6altspace 420 | exch 4 1 roll 421 | }{ 422 | 1 3 1 roll 423 | } ifelse 424 | } def 425 | /ci6colortint { 426 | dup /DeviceGray eq { 427 | 3 1 roll 1 exch sub mul 1 exch sub exch 428 | }{ 429 | dup /DeviceRGB eq { 430 | 3 1 roll {1 exch sub 1 index mul 1 exch sub exch} forall pop 3 array astore exch 431 | }{ 432 | dup /DeviceCMYK eq { 433 | 3 1 roll {1 index mul exch} forall pop 4 array astore exch 434 | }{ 435 | 3 1 roll mul exch 436 | } ifelse 437 | } ifelse 438 | } ifelse 439 | } def 440 | /ci6colortocmyk { 441 | dup /DeviceGray eq { 442 | pop 1 exch sub 0 0 0 4 -1 roll 4 array astore 443 | }{ 444 | dup /DeviceRGB eq { 445 | pop aload pop _rgbtocmyk 4 array astore 446 | }{ 447 | dup /DeviceCMYK eq { 448 | pop 449 | }{ 450 | ci6altspace ci6colortint ci6colortocmyk 451 | } ifelse 452 | } ifelse 453 | } ifelse 454 | } def 455 | /ci6makeimagedict { 456 | 7 dict begin 457 | /ImageType 1 def 458 | /Decode exch def 459 | /DataSource exch def 460 | /ImageMatrix exch def 461 | /BitsPerComponent exch def 462 | /Height exch def 463 | /Width exch def 464 | currentdict end 465 | } def 466 | /ci6stringinvert { 467 | 0 1 2 index length 1 sub { 468 | dup 2 index exch get 255 exch sub 2 index 3 1 roll put 469 | } for 470 | } def 471 | /ci6stringknockout { 472 | 0 1 2 index length 1 sub { 473 | 255 2 index 3 1 roll put 474 | } for 475 | } def 476 | /ci6stringapply { 477 | 0 1 4 index length 1 sub { 478 | dup 479 | 4 index exch get 480 | 3 index 3 1 roll 481 | 3 index exec 482 | } for 483 | pop exch pop 484 | } def 485 | /ci6walkrgbstring { 486 | 0 3 index 487 | dup length 1 sub 0 3 3 -1 roll { 488 | 3 getinterval {} forall 489 | 5 index exec 490 | 3 index 491 | } for 492 | 493 | 5 {pop} repeat 494 | } def 495 | /ci6walkcmykstring 496 | { 497 | 0 3 index 498 | dup length 1 sub 0 4 3 -1 roll { 499 | 4 getinterval {} forall 500 | 501 | 6 index exec 502 | 503 | 3 index 504 | 505 | } for 506 | 507 | 5 { pop } repeat 508 | 509 | } def 510 | /ci6putrgbtograystr 511 | { 512 | .11 mul exch 513 | 514 | .59 mul add exch 515 | 516 | .3 mul add 517 | 518 | cvi 3 copy put 519 | 520 | pop 1 add 521 | } def 522 | /ci6putcmyktograystr 523 | { 524 | exch .11 mul add 525 | 526 | exch .59 mul add 527 | 528 | exch .3 mul add 529 | 530 | dup 255 gt { pop 255 } if 531 | 532 | 255 exch sub cvi 3 copy put 533 | 534 | pop 1 add 535 | } def 536 | /ci6rgbtograyproc { 537 | Adobe_ColorImage_AI6_Vars begin 538 | sourcearray 0 get exec 539 | XIBuffer3 540 | dup 3 1 roll 541 | 542 | /ci6putrgbtograystr load exch 543 | ci6walkrgbstring 544 | end 545 | } def 546 | /ci6cmyktograyproc { 547 | Adobe_ColorImage_AI6_Vars begin 548 | sourcearray 0 get exec 549 | XIBuffer3 550 | dup 3 1 roll 551 | 552 | /ci6putcmyktograystr load exch 553 | ci6walkcmykstring 554 | end 555 | } def 556 | /ci6separatecmykproc { 557 | Adobe_ColorImage_AI6_Vars begin 558 | sourcearray 0 get exec 559 | 560 | XIBuffer3 561 | 562 | 0 2 index 563 | 564 | plateindex 4 2 index length 1 sub { 565 | get 255 exch sub 566 | 567 | 3 copy put pop 1 add 568 | 569 | 2 index 570 | } for 571 | pop pop exch pop 572 | end 573 | } def 574 | 575 | /ci6compositeimage { 576 | dup 1 eq { 577 | pop pop image 578 | }{ 579 | /ci6colorimage load null ne { 580 | ci6colorimage 581 | }{ 582 | 3 1 roll pop 583 | sourcearray 0 3 -1 roll put 584 | 3 eq {/ci6rgbtograyproc}{/ci6cmyktograyproc} ifelse load 585 | image 586 | } ifelse 587 | } ifelse 588 | } def 589 | /ci6knockoutimage { 590 | gsave 591 | 0 ci6curtransfer exec 1 ci6curtransfer exec 592 | eq { 593 | 0 ci6curtransfer exec 0.5 lt 594 | }{ 595 | 0 ci6curtransfer exec 1 ci6curtransfer exec gt 596 | } ifelse 597 | {{pop 0}}{{pop 1}} ifelse 598 | systemdict /settransfer get exec 599 | ci6compositeimage 600 | grestore 601 | } def 602 | /ci6drawimage { 603 | ci6testplate -1 eq { 604 | pop ci6compositeimage 605 | }{ 606 | dup type /arraytype eq { 607 | dup length plateindex gt {plateindex get}{pop false} ifelse 608 | }{ 609 | { 610 | true 611 | }{ 612 | dup 1 eq {plateindex 3 eq}{plateindex 3 le} ifelse 613 | } ifelse 614 | } ifelse 615 | { 616 | dup 1 eq { 617 | pop pop ci6image 618 | }{ 619 | dup 3 eq { 620 | ci6compositeimage 621 | }{ 622 | pop pop 623 | sourcearray 0 3 -1 roll put 624 | /ci6separatecmykproc load 625 | ci6image 626 | } ifelse 627 | } ifelse 628 | }{ 629 | ci6curoverprint { 630 | 7 {pop} repeat 631 | }{ 632 | ci6knockoutimage 633 | } ifelse 634 | } ifelse 635 | } ifelse 636 | } def 637 | /ci6proctintimage { 638 | /_ptispace exch store /_ptiname exch store /_pti1 exch store /_pti0 exch store /_ptiproc exch store 639 | /_pticomps _ptispace ci6numcomps store 640 | /_ptiscale _pti1 _pti0 sub store 641 | level2? { 642 | _ptiname length 0 gt version cvr 2012 ge and { 643 | [/Separation _ptiname _ptispace {_ptiproc}] setcolorspace 644 | [_pti0 _pti1] ci6makeimagedict ci6image 645 | }{ 646 | [/Indexed _ptispace 255 {255 div _ptiscale mul _pti0 add _ptiproc}] setcolorspace 647 | [0 255] ci6makeimagedict ci6image 648 | } ifelse 649 | }{ 650 | _pticomps 1 eq { 651 | { 652 | dup 653 | { 654 | 255 div _ptiscale mul _pti0 add _ptiproc 255 mul cvi put 655 | } ci6stringapply 656 | } ci6concatprocs ci6image 657 | }{ 658 | { 659 | dup length _pticomps mul dup _ptibuf length ne {/_ptibuf exch string store}{pop} ifelse 660 | _ptibuf { 661 | exch _pticomps mul exch 255 div _ptiscale mul _pti0 add _ptiproc 662 | _pticomps 2 add -2 roll 663 | _pticomps 1 sub -1 0 { 664 | 1 index add 2 index exch 665 | 5 -1 roll 666 | 255 mul cvi put 667 | } for 668 | pop pop 669 | } ci6stringapply 670 | } ci6concatprocs false _pticomps 671 | /ci6colorimage load null eq {7 {pop} repeat}{ci6colorimage} ifelse 672 | } ifelse 673 | } ifelse 674 | } def 675 | /ci6graytintimage { 676 | /_gtigray 5 -1 roll store 677 | {1 _gtigray sub mul 1 exch sub} 4 1 roll 678 | /DeviceGray ci6proctintimage 679 | } def 680 | /ci6cmyktintimage { 681 | /_cticmyk 5 -1 roll store 682 | {_cticmyk {1 index mul exch} forall pop} 4 1 roll 683 | /DeviceCMYK ci6proctintimage 684 | } def 685 | /ci6rgbtintimage { 686 | /_rtirgb 5 -1 roll store 687 | {_rtirgb {1 exch sub 1 index mul 1 exch sub exch} forall pop} 4 1 roll 688 | /DeviceRGB ci6proctintimage 689 | } def 690 | /ci6tintimage { 691 | ci6testplate -1 eq { 692 | ci6colorexpand 693 | 3 -1 roll 5 -1 roll {0}{0 exch} ifelse 4 2 roll 694 | dup /DeviceGray eq { 695 | pop ci6graytintimage 696 | }{ 697 | dup /DeviceRGB eq { 698 | pop ci6rgbtintimage 699 | }{ 700 | pop ci6cmyktintimage 701 | } ifelse 702 | } ifelse 703 | }{ 704 | dup ci6marksplate { 705 | plateindex 5 lt { 706 | ci6colortocmyk plateindex get 707 | dup 0 eq ci6curoverprint and { 708 | 7 {pop} repeat 709 | }{ 710 | 1 exch sub 711 | exch {1 0}{0 1} ifelse () ci6graytintimage 712 | } ifelse 713 | }{ 714 | pop exch {0}{0 exch} ifelse 0 3 1 roll () ci6graytintimage 715 | } ifelse 716 | }{ 717 | ci6curoverprint { 718 | 8 {pop} repeat 719 | }{ 720 | pop pop pop 721 | {pop 1} 0 1 () /DeviceGray ci6proctintimage 722 | } ifelse 723 | } ifelse 724 | } ifelse 725 | } def 726 | /XINullImage { 727 | } def 728 | /XIImageMask { 729 | XIImageWidth XIImageHeight false 730 | [XIImageWidth 0 0 XIImageHeight neg 0 0] 731 | /XIDataProc load 732 | imagemask 733 | } def 734 | /XIImageTint { 735 | XIImageWidth XIImageHeight XIBitsPerPixel 736 | [XIImageWidth 0 0 XIImageHeight neg 0 0] 737 | /XIDataProc load 738 | XIType 3 eq XIColorValues XIColorSpace ci6tintimage 739 | } def 740 | /XIImage { 741 | XIImageWidth XIImageHeight XIBitsPerPixel 742 | [XIImageWidth 0 0 XIImageHeight neg 0 0] 743 | /XIDataProc load 744 | false XIChannelCount XIPlateList ci6drawimage 745 | } def 746 | /XG { 747 | pop pop 748 | } def 749 | /XF { 750 | 13 {pop} repeat 751 | } def 752 | /Xh { 753 | Adobe_ColorImage_AI6_Vars begin 754 | gsave 755 | /XIType exch def 756 | /XIImageHeight exch def 757 | /XIImageWidth exch def 758 | /XIImageMatrix exch def 759 | 0 0 moveto 760 | XIImageMatrix concat 761 | XIImageWidth XIImageHeight scale 762 | 763 | /_lp /null ddef 764 | _fc 765 | /_lp /imagemask ddef 766 | end 767 | } def 768 | /XH { 769 | Adobe_ColorImage_AI6_Vars begin 770 | grestore 771 | end 772 | } def 773 | /XIEnable { 774 | Adobe_ColorImage_AI6_Vars /XIEnable 3 -1 roll put 775 | } def 776 | /XC { 777 | Adobe_ColorImage_AI6_Vars begin 778 | ci6colormake 779 | /XIColorSpace exch def 780 | /XIColorValues exch def 781 | end 782 | } def 783 | /XIPlates { 784 | Adobe_ColorImage_AI6_Vars begin 785 | /XIPlateList exch def 786 | end 787 | } def 788 | /XI 789 | { 790 | Adobe_ColorImage_AI6_Vars begin 791 | gsave 792 | /XIType exch def 793 | cvi dup 794 | 256 idiv /XICompression exch store 795 | 256 mod /XIEncoding exch store 796 | pop pop 797 | /XIChannelCount exch def 798 | /XIBitsPerPixel exch def 799 | /XIImageHeight exch def 800 | /XIImageWidth exch def 801 | pop pop pop pop 802 | /XIImageMatrix exch def 803 | XIBitsPerPixel 1 eq { 804 | XIImageWidth 8 div ceiling cvi 805 | }{ 806 | XIImageWidth XIChannelCount mul 807 | } ifelse 808 | /XIRowBytes exch def 809 | XIEnable { 810 | /XIBuffer3 XIImageWidth string def 811 | XICompression 0 eq { 812 | /XIBuffer1 XIRowBytes string def 813 | XIEncoding 0 eq { 814 | {currentfile XIBuffer1 readhexstring pop} 815 | }{ 816 | {currentfile XIBuffer1 readstring pop} 817 | } ifelse 818 | }{ 819 | /XIBuffer1 256 string def 820 | /XIBuffer2 XIRowBytes string def 821 | {currentfile XIBuffer1 readline pop (%) anchorsearch {pop} if} 822 | /ASCII85Decode filter /DCTDecode filter 823 | /XIFile exch def 824 | {XIFile XIBuffer2 readstring pop} 825 | } ifelse 826 | /XIDataProc exch def 827 | 828 | XIType 1 ne { 829 | 0 setgray 830 | } if 831 | XIType 1 eq { 832 | XIImageMask 833 | }{ 834 | XIType 2 eq XIType 3 eq or { 835 | XIImageTint 836 | }{ 837 | XIImage 838 | } ifelse 839 | } ifelse 840 | }{ 841 | XINullImage 842 | } ifelse 843 | /XIPlateList false def 844 | grestore 845 | end 846 | } def 847 | end 848 | %%EndProcSet 849 | %%BeginResource: procset Adobe_Illustrator_AI5 1.3 0 850 | %%Title: (Adobe Illustrator (R) Version 8.0 Full Prolog) 851 | %%Version: 1.3 0 852 | %%CreationDate: (3/7/1994) () 853 | %%Copyright: ((C) 1987-1998 Adobe Systems Incorporated All Rights Reserved) 854 | currentpacking true setpacking 855 | userdict /Adobe_Illustrator_AI5_vars 112 dict dup begin 856 | put 857 | /_?cmyk false def 858 | /_eo false def 859 | /_lp /none def 860 | /_pf 861 | { 862 | } def 863 | /_ps 864 | { 865 | } def 866 | /_psf 867 | { 868 | } def 869 | /_pss 870 | { 871 | } def 872 | /_pjsf 873 | { 874 | } def 875 | /_pjss 876 | { 877 | } def 878 | /_pola 0 def 879 | /_doClip 0 def 880 | /cf currentflat def 881 | /_lineorientation 0 def 882 | /_charorientation 0 def 883 | /_yokoorientation 0 def 884 | /_tm matrix def 885 | /_renderStart 886 | [ 887 | /e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0 888 | ] def 889 | /_renderEnd 890 | [ 891 | null null null null /i1 /i1 /i1 /i1 892 | ] def 893 | /_render -1 def 894 | /_shift [0 0] def 895 | /_ax 0 def 896 | /_ay 0 def 897 | /_cx 0 def 898 | /_cy 0 def 899 | /_leading 900 | [ 901 | 0 0 902 | ] def 903 | /_ctm matrix def 904 | /_mtx matrix def 905 | /_sp 16#020 def 906 | /_hyphen (-) def 907 | /_fontSize 0 def 908 | /_fontAscent 0 def 909 | /_fontDescent 0 def 910 | /_fontHeight 0 def 911 | /_fontRotateAdjust 0 def 912 | /Ss 256 string def 913 | Ss 0 (fonts/) putinterval 914 | /_cnt 0 def 915 | /_scale [1 1] def 916 | /_nativeEncoding 0 def 917 | /_useNativeEncoding 0 def 918 | /_tempEncode 0 def 919 | /_pntr 0 def 920 | /_tDict 2 dict def 921 | /_hfname 100 string def 922 | /_hffound false def 923 | /Tx 924 | { 925 | } def 926 | /Tj 927 | { 928 | } def 929 | /CRender 930 | { 931 | } def 932 | /_AI3_savepage 933 | { 934 | } def 935 | /_gf null def 936 | /_cf 4 array def 937 | /_rgbf 3 array def 938 | /_if null def 939 | /_of false def 940 | /_fc 941 | { 942 | } def 943 | /_gs null def 944 | /_cs 4 array def 945 | /_rgbs 3 array def 946 | /_is null def 947 | /_os false def 948 | /_sc 949 | { 950 | } def 951 | /_pd 1 dict def 952 | /_ed 15 dict def 953 | /_pm matrix def 954 | /_fm null def 955 | /_fd null def 956 | /_fdd null def 957 | /_sm null def 958 | /_sd null def 959 | /_sdd null def 960 | /_i null def 961 | /_lobyte 0 def 962 | /_hibyte 0 def 963 | /_cproc null def 964 | /_cscript 0 def 965 | /_hvax 0 def 966 | /_hvay 0 def 967 | /_hvwb 0 def 968 | /_hvcx 0 def 969 | /_hvcy 0 def 970 | /_bitfont null def 971 | /_bitlobyte 0 def 972 | /_bithibyte 0 def 973 | /_bitkey null def 974 | /_bitdata null def 975 | /_bitindex 0 def 976 | /discardSave null def 977 | /buffer 256 string def 978 | /beginString null def 979 | /endString null def 980 | /endStringLength null def 981 | /layerCnt 1 def 982 | /layerCount 1 def 983 | /perCent (%) 0 get def 984 | /perCentSeen? false def 985 | /newBuff null def 986 | /newBuffButFirst null def 987 | /newBuffLast null def 988 | /clipForward? false def 989 | end 990 | userdict /Adobe_Illustrator_AI5 known not { 991 | userdict /Adobe_Illustrator_AI5 100 dict put 992 | } if 993 | userdict /Adobe_Illustrator_AI5 get begin 994 | /initialize 995 | { 996 | Adobe_Illustrator_AI5 dup begin 997 | Adobe_Illustrator_AI5_vars begin 998 | /_aicmykps where {pop /_?cmyk _aicmykps def}if 999 | discardDict 1000 | { 1001 | bind pop pop 1002 | } forall 1003 | dup /nc get begin 1004 | { 1005 | dup xcheck 1 index type /operatortype ne and 1006 | { 1007 | bind 1008 | } if 1009 | pop pop 1010 | } forall 1011 | end 1012 | newpath 1013 | } def 1014 | /terminate 1015 | { 1016 | end 1017 | end 1018 | } def 1019 | /_ 1020 | null def 1021 | /ddef 1022 | { 1023 | Adobe_Illustrator_AI5_vars 3 1 roll put 1024 | } def 1025 | /xput 1026 | { 1027 | dup load dup length exch maxlength eq 1028 | { 1029 | dup dup load dup 1030 | length 2 mul dict copy def 1031 | } if 1032 | load begin 1033 | def 1034 | end 1035 | } def 1036 | /npop 1037 | { 1038 | { 1039 | pop 1040 | } repeat 1041 | } def 1042 | /hswj 1043 | { 1044 | dup stringwidth 3 2 roll 1045 | { 1046 | _hvwb eq { exch _hvcx add exch _hvcy add } if 1047 | exch _hvax add exch _hvay add 1048 | } cforall 1049 | } def 1050 | /vswj 1051 | { 1052 | 0 0 3 -1 roll 1053 | { 1054 | dup 255 le 1055 | _charorientation 1 eq 1056 | and 1057 | { 1058 | dup cstring stringwidth 5 2 roll 1059 | _hvwb eq { exch _hvcy sub exch _hvcx sub } if 1060 | exch _hvay sub exch _hvax sub 1061 | 4 -1 roll sub exch 1062 | 3 -1 roll sub exch 1063 | } 1064 | { 1065 | _hvwb eq { exch _hvcy sub exch _hvcx sub } if 1066 | exch _hvay sub exch _hvax sub 1067 | _fontHeight sub 1068 | } ifelse 1069 | } cforall 1070 | } def 1071 | /swj 1072 | { 1073 | 6 1 roll 1074 | /_hvay exch ddef 1075 | /_hvax exch ddef 1076 | /_hvwb exch ddef 1077 | /_hvcy exch ddef 1078 | /_hvcx exch ddef 1079 | _lineorientation 0 eq { hswj } { vswj } ifelse 1080 | } def 1081 | /sw 1082 | { 1083 | 0 0 0 6 3 roll swj 1084 | } def 1085 | /vjss 1086 | { 1087 | 4 1 roll 1088 | { 1089 | dup cstring 1090 | dup length 1 eq 1091 | _charorientation 1 eq 1092 | and 1093 | { 1094 | -90 rotate 1095 | currentpoint 1096 | _fontRotateAdjust add 1097 | moveto 1098 | gsave 1099 | false charpath currentpoint 1100 | 5 index setmatrix stroke 1101 | grestore 1102 | _fontRotateAdjust sub 1103 | moveto 1104 | _sp eq 1105 | { 1106 | 5 index 5 index rmoveto 1107 | } if 1108 | 2 copy rmoveto 1109 | 90 rotate 1110 | } 1111 | { 1112 | currentpoint 1113 | _fontHeight sub 1114 | 5 index sub 1115 | 3 index _sp eq 1116 | { 1117 | 9 index sub 1118 | } if 1119 | 1120 | currentpoint 1121 | exch 4 index stringwidth pop 2 div sub 1122 | exch _fontAscent sub 1123 | moveto 1124 | 1125 | gsave 1126 | 2 index false charpath 1127 | 6 index setmatrix stroke 1128 | grestore 1129 | 1130 | moveto pop pop 1131 | } ifelse 1132 | } cforall 1133 | 6 npop 1134 | } def 1135 | /hjss 1136 | { 1137 | 4 1 roll 1138 | { 1139 | dup cstring 1140 | gsave 1141 | false charpath currentpoint 1142 | 5 index setmatrix stroke 1143 | grestore 1144 | moveto 1145 | _sp eq 1146 | { 1147 | 5 index 5 index rmoveto 1148 | } if 1149 | 2 copy rmoveto 1150 | } cforall 1151 | 6 npop 1152 | } def 1153 | /jss 1154 | { 1155 | _lineorientation 0 eq { hjss } { vjss } ifelse 1156 | } def 1157 | /ss 1158 | { 1159 | 0 0 0 7 3 roll jss 1160 | } def 1161 | /vjsp 1162 | { 1163 | 4 1 roll 1164 | { 1165 | dup cstring 1166 | dup length 1 eq 1167 | _charorientation 1 eq 1168 | and 1169 | { 1170 | -90 rotate 1171 | currentpoint 1172 | _fontRotateAdjust add 1173 | moveto 1174 | false charpath 1175 | currentpoint 1176 | _fontRotateAdjust sub 1177 | moveto 1178 | _sp eq 1179 | { 1180 | 5 index 5 index rmoveto 1181 | } if 1182 | 2 copy rmoveto 1183 | 90 rotate 1184 | } 1185 | { 1186 | currentpoint 1187 | _fontHeight sub 1188 | 5 index sub 1189 | 3 index _sp eq 1190 | { 1191 | 9 index sub 1192 | } if 1193 | 1194 | currentpoint 1195 | exch 4 index stringwidth pop 2 div sub 1196 | exch _fontAscent sub 1197 | moveto 1198 | 1199 | 2 index false charpath 1200 | 1201 | moveto pop pop 1202 | } ifelse 1203 | } cforall 1204 | 6 npop 1205 | } def 1206 | /hjsp 1207 | { 1208 | 4 1 roll 1209 | { 1210 | dup cstring 1211 | false charpath 1212 | _sp eq 1213 | { 1214 | 5 index 5 index rmoveto 1215 | } if 1216 | 2 copy rmoveto 1217 | } cforall 1218 | 6 npop 1219 | } def 1220 | /jsp 1221 | { 1222 | matrix currentmatrix 1223 | _lineorientation 0 eq {hjsp} {vjsp} ifelse 1224 | } def 1225 | /sp 1226 | { 1227 | matrix currentmatrix 1228 | 0 0 0 7 3 roll 1229 | _lineorientation 0 eq {hjsp} {vjsp} ifelse 1230 | } def 1231 | /pl 1232 | { 1233 | transform 1234 | 0.25 sub round 0.25 add exch 1235 | 0.25 sub round 0.25 add exch 1236 | itransform 1237 | } def 1238 | /setstrokeadjust where 1239 | { 1240 | pop true setstrokeadjust 1241 | /c 1242 | { 1243 | curveto 1244 | } def 1245 | /C 1246 | /c load def 1247 | /v 1248 | { 1249 | currentpoint 6 2 roll curveto 1250 | } def 1251 | /V 1252 | /v load def 1253 | /y 1254 | { 1255 | 2 copy curveto 1256 | } def 1257 | /Y 1258 | /y load def 1259 | /l 1260 | { 1261 | lineto 1262 | } def 1263 | /L 1264 | /l load def 1265 | /m 1266 | { 1267 | moveto 1268 | } def 1269 | } 1270 | { 1271 | /c 1272 | { 1273 | pl curveto 1274 | } def 1275 | /C 1276 | /c load def 1277 | /v 1278 | { 1279 | currentpoint 6 2 roll pl curveto 1280 | } def 1281 | /V 1282 | /v load def 1283 | /y 1284 | { 1285 | pl 2 copy curveto 1286 | } def 1287 | /Y 1288 | /y load def 1289 | /l 1290 | { 1291 | pl lineto 1292 | } def 1293 | /L 1294 | /l load def 1295 | /m 1296 | { 1297 | pl moveto 1298 | } def 1299 | } ifelse 1300 | /d 1301 | { 1302 | setdash 1303 | } def 1304 | /cf 1305 | { 1306 | } def 1307 | /i 1308 | { 1309 | dup 0 eq 1310 | { 1311 | pop cf 1312 | } if 1313 | setflat 1314 | } def 1315 | /j 1316 | { 1317 | setlinejoin 1318 | } def 1319 | /J 1320 | { 1321 | setlinecap 1322 | } def 1323 | /M 1324 | { 1325 | setmiterlimit 1326 | } def 1327 | /w 1328 | { 1329 | setlinewidth 1330 | } def 1331 | /XR 1332 | { 1333 | 0 ne 1334 | /_eo exch ddef 1335 | } def 1336 | /H 1337 | { 1338 | } def 1339 | /h 1340 | { 1341 | closepath 1342 | } def 1343 | /N 1344 | { 1345 | _pola 0 eq 1346 | { 1347 | _doClip 1 eq 1348 | { 1349 | _eo {eoclip} {clip} ifelse /_doClip 0 ddef 1350 | } if 1351 | newpath 1352 | } 1353 | { 1354 | /CRender 1355 | { 1356 | N 1357 | } ddef 1358 | } ifelse 1359 | } def 1360 | /n 1361 | { 1362 | N 1363 | } def 1364 | /F 1365 | { 1366 | _pola 0 eq 1367 | { 1368 | _doClip 1 eq 1369 | { 1370 | gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc 1371 | /_doClip 0 ddef 1372 | } 1373 | { 1374 | _pf 1375 | } ifelse 1376 | } 1377 | { 1378 | /CRender 1379 | { 1380 | F 1381 | } ddef 1382 | } ifelse 1383 | } def 1384 | /f 1385 | { 1386 | closepath 1387 | F 1388 | } def 1389 | /S 1390 | { 1391 | _pola 0 eq 1392 | { 1393 | _doClip 1 eq 1394 | { 1395 | gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc 1396 | /_doClip 0 ddef 1397 | } 1398 | { 1399 | _ps 1400 | } ifelse 1401 | } 1402 | { 1403 | /CRender 1404 | { 1405 | S 1406 | } ddef 1407 | } ifelse 1408 | } def 1409 | /s 1410 | { 1411 | closepath 1412 | S 1413 | } def 1414 | /B 1415 | { 1416 | _pola 0 eq 1417 | { 1418 | _doClip 1 eq 1419 | gsave F grestore 1420 | { 1421 | gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc 1422 | /_doClip 0 ddef 1423 | } 1424 | { 1425 | S 1426 | } ifelse 1427 | } 1428 | { 1429 | /CRender 1430 | { 1431 | B 1432 | } ddef 1433 | } ifelse 1434 | } def 1435 | /b 1436 | { 1437 | closepath 1438 | B 1439 | } def 1440 | /W 1441 | { 1442 | /_doClip 1 ddef 1443 | } def 1444 | /* 1445 | { 1446 | count 0 ne 1447 | { 1448 | dup type /stringtype eq 1449 | { 1450 | pop 1451 | } if 1452 | } if 1453 | newpath 1454 | } def 1455 | /u 1456 | { 1457 | } def 1458 | /U 1459 | { 1460 | } def 1461 | /q 1462 | { 1463 | _pola 0 eq 1464 | { 1465 | gsave 1466 | } if 1467 | } def 1468 | /Q 1469 | { 1470 | _pola 0 eq 1471 | { 1472 | grestore 1473 | } if 1474 | } def 1475 | /*u 1476 | { 1477 | _pola 1 add /_pola exch ddef 1478 | } def 1479 | /*U 1480 | { 1481 | _pola 1 sub /_pola exch ddef 1482 | _pola 0 eq 1483 | { 1484 | CRender 1485 | } if 1486 | } def 1487 | /D 1488 | { 1489 | pop 1490 | } def 1491 | /*w 1492 | { 1493 | } def 1494 | /*W 1495 | { 1496 | } def 1497 | /` 1498 | { 1499 | /_i save ddef 1500 | clipForward? 1501 | { 1502 | nulldevice 1503 | } if 1504 | 6 1 roll 4 npop 1505 | concat pop 1506 | userdict begin 1507 | /showpage 1508 | { 1509 | } def 1510 | 0 setgray 1511 | 0 setlinecap 1512 | 1 setlinewidth 1513 | 0 setlinejoin 1514 | 10 setmiterlimit 1515 | [] 0 setdash 1516 | /setstrokeadjust where {pop false setstrokeadjust} if 1517 | newpath 1518 | 0 setgray 1519 | false setoverprint 1520 | } def 1521 | /~ 1522 | { 1523 | end 1524 | _i restore 1525 | } def 1526 | /_rgbtocmyk 1527 | { 1528 | 3 1529 | { 1530 | 1 exch sub 3 1 roll 1531 | } repeat 1532 | 3 copy 1 4 1 roll 1533 | 3 1534 | { 1535 | 3 index 2 copy gt 1536 | { 1537 | exch 1538 | } if 1539 | pop 4 1 roll 1540 | } repeat 1541 | pop pop pop 1542 | 4 1 roll 1543 | 3 1544 | { 1545 | 3 index sub 1546 | 3 1 roll 1547 | } repeat 1548 | 4 -1 roll 1549 | } def 1550 | /setrgbfill 1551 | { 1552 | _rgbf astore pop 1553 | /_fc 1554 | { 1555 | _lp /fill ne 1556 | { 1557 | _of setoverprint 1558 | _rgbf aload pop setrgbcolor 1559 | /_lp /fill ddef 1560 | } if 1561 | } ddef 1562 | /_pf 1563 | { 1564 | _fc 1565 | _eo {eofill} {fill} ifelse 1566 | } ddef 1567 | /_psf 1568 | { 1569 | _fc 1570 | hvashow 1571 | } ddef 1572 | /_pjsf 1573 | { 1574 | _fc 1575 | hvawidthshow 1576 | } ddef 1577 | /_lp /none ddef 1578 | } def 1579 | /setrgbstroke 1580 | { 1581 | _rgbs astore pop 1582 | /_sc 1583 | { 1584 | _lp /stroke ne 1585 | { 1586 | _os setoverprint 1587 | _rgbs aload pop setrgbcolor 1588 | /_lp /stroke ddef 1589 | } if 1590 | } ddef 1591 | /_ps 1592 | { 1593 | _sc 1594 | stroke 1595 | } ddef 1596 | /_pss 1597 | { 1598 | _sc 1599 | ss 1600 | } ddef 1601 | /_pjss 1602 | { 1603 | _sc 1604 | jss 1605 | } ddef 1606 | /_lp /none ddef 1607 | } def 1608 | /O 1609 | { 1610 | 0 ne 1611 | /_of exch ddef 1612 | /_lp /none ddef 1613 | } def 1614 | /R 1615 | { 1616 | 0 ne 1617 | /_os exch ddef 1618 | /_lp /none ddef 1619 | } def 1620 | /g 1621 | { 1622 | /_gf exch ddef 1623 | /_fc 1624 | { 1625 | _lp /fill ne 1626 | { 1627 | _of setoverprint 1628 | _gf setgray 1629 | /_lp /fill ddef 1630 | } if 1631 | } ddef 1632 | /_pf 1633 | { 1634 | _fc 1635 | _eo {eofill} {fill} ifelse 1636 | } ddef 1637 | /_psf 1638 | { 1639 | _fc 1640 | hvashow 1641 | } ddef 1642 | /_pjsf 1643 | { 1644 | _fc 1645 | hvawidthshow 1646 | } ddef 1647 | /_lp /none ddef 1648 | } def 1649 | /G 1650 | { 1651 | /_gs exch ddef 1652 | /_sc 1653 | { 1654 | _lp /stroke ne 1655 | { 1656 | _os setoverprint 1657 | _gs setgray 1658 | /_lp /stroke ddef 1659 | } if 1660 | } ddef 1661 | /_ps 1662 | { 1663 | _sc 1664 | stroke 1665 | } ddef 1666 | /_pss 1667 | { 1668 | _sc 1669 | ss 1670 | } ddef 1671 | /_pjss 1672 | { 1673 | _sc 1674 | jss 1675 | } ddef 1676 | /_lp /none ddef 1677 | } def 1678 | /k 1679 | { 1680 | _cf astore pop 1681 | /_fc 1682 | { 1683 | _lp /fill ne 1684 | { 1685 | _of setoverprint 1686 | _cf aload pop setcmykcolor 1687 | /_lp /fill ddef 1688 | } if 1689 | } ddef 1690 | /_pf 1691 | { 1692 | _fc 1693 | _eo {eofill} {fill} ifelse 1694 | } ddef 1695 | /_psf 1696 | { 1697 | _fc 1698 | hvashow 1699 | } ddef 1700 | /_pjsf 1701 | { 1702 | _fc 1703 | hvawidthshow 1704 | } ddef 1705 | /_lp /none ddef 1706 | } def 1707 | /K 1708 | { 1709 | _cs astore pop 1710 | /_sc 1711 | { 1712 | _lp /stroke ne 1713 | { 1714 | _os setoverprint 1715 | _cs aload pop setcmykcolor 1716 | /_lp /stroke ddef 1717 | } if 1718 | } ddef 1719 | /_ps 1720 | { 1721 | _sc 1722 | stroke 1723 | } ddef 1724 | /_pss 1725 | { 1726 | _sc 1727 | ss 1728 | } ddef 1729 | /_pjss 1730 | { 1731 | _sc 1732 | jss 1733 | } ddef 1734 | /_lp /none ddef 1735 | } def 1736 | /Xa 1737 | { 1738 | _?cmyk { 1739 | 3 npop k 1740 | }{ 1741 | setrgbfill 4 npop 1742 | } ifelse 1743 | } def 1744 | /XA 1745 | { 1746 | _?cmyk { 1747 | 3 npop K 1748 | }{ 1749 | setrgbstroke 4 npop 1750 | } ifelse 1751 | } def 1752 | /Xs 1753 | { 1754 | /_gf exch ddef 1755 | 5 npop 1756 | /_fc 1757 | { 1758 | _lp /fill ne 1759 | { 1760 | _of setoverprint 1761 | _gf setAIseparationgray 1762 | /_lp /fill ddef 1763 | } if 1764 | } ddef 1765 | /_pf 1766 | { 1767 | _fc 1768 | _eo {eofill} {fill} ifelse 1769 | } ddef 1770 | /_psf 1771 | { 1772 | _fc 1773 | hvashow 1774 | } ddef 1775 | /_pjsf 1776 | { 1777 | _fc 1778 | hvawidthshow 1779 | } ddef 1780 | /_lp /none ddef 1781 | } def 1782 | /XS 1783 | { 1784 | /_gs exch ddef 1785 | 5 npop 1786 | /_sc 1787 | { 1788 | _lp /stroke ne 1789 | { 1790 | _os setoverprint 1791 | _gs setAIseparationgray 1792 | /_lp /stroke ddef 1793 | } if 1794 | } ddef 1795 | /_ps 1796 | { 1797 | _sc 1798 | stroke 1799 | } ddef 1800 | /_pss 1801 | { 1802 | _sc 1803 | ss 1804 | } ddef 1805 | /_pjss 1806 | { 1807 | _sc 1808 | jss 1809 | } ddef 1810 | /_lp /none ddef 1811 | } def 1812 | /Xx 1813 | { 1814 | exch 1815 | /_gf exch ddef 1816 | 0 eq { 1817 | findcmykcustomcolor 1818 | }{ 1819 | _?cmyk {true}{/findrgbcustomcolor where{pop false}{true}ifelse}ifelse 1820 | { 1821 | 4 1 roll 3 npop 1822 | findcmykcustomcolor 1823 | }{ 1824 | 8 -4 roll 4 npop 1825 | findrgbcustomcolor 1826 | } ifelse 1827 | } ifelse 1828 | /_if exch ddef 1829 | /_fc 1830 | { 1831 | _lp /fill ne 1832 | { 1833 | _of setoverprint 1834 | _if _gf 1 exch sub setcustomcolor 1835 | /_lp /fill ddef 1836 | } if 1837 | } ddef 1838 | /_pf 1839 | { 1840 | _fc 1841 | _eo {eofill} {fill} ifelse 1842 | } ddef 1843 | /_psf 1844 | { 1845 | _fc 1846 | hvashow 1847 | } ddef 1848 | /_pjsf 1849 | { 1850 | _fc 1851 | hvawidthshow 1852 | } ddef 1853 | /_lp /none ddef 1854 | } def 1855 | /XX 1856 | { 1857 | exch 1858 | /_gs exch ddef 1859 | 0 eq { 1860 | findcmykcustomcolor 1861 | }{ 1862 | _?cmyk {true}{/findrgbcustomcolor where{pop false}{true}ifelse}ifelse 1863 | { 1864 | 4 1 roll 3 npop 1865 | findcmykcustomcolor 1866 | }{ 1867 | 8 -4 roll 4 npop 1868 | findrgbcustomcolor 1869 | } ifelse 1870 | } ifelse 1871 | /_is exch ddef 1872 | /_sc 1873 | { 1874 | _lp /stroke ne 1875 | { 1876 | _os setoverprint 1877 | _is _gs 1 exch sub setcustomcolor 1878 | /_lp /stroke ddef 1879 | } if 1880 | } ddef 1881 | /_ps 1882 | { 1883 | _sc 1884 | stroke 1885 | } ddef 1886 | /_pss 1887 | { 1888 | _sc 1889 | ss 1890 | } ddef 1891 | /_pjss 1892 | { 1893 | _sc 1894 | jss 1895 | } ddef 1896 | /_lp /none ddef 1897 | } def 1898 | /x 1899 | { 1900 | /_gf exch ddef 1901 | findcmykcustomcolor 1902 | /_if exch ddef 1903 | /_fc 1904 | { 1905 | _lp /fill ne 1906 | { 1907 | _of setoverprint 1908 | _if _gf 1 exch sub setcustomcolor 1909 | /_lp /fill ddef 1910 | } if 1911 | } ddef 1912 | /_pf 1913 | { 1914 | _fc 1915 | _eo {eofill} {fill} ifelse 1916 | } ddef 1917 | /_psf 1918 | { 1919 | _fc 1920 | hvashow 1921 | } ddef 1922 | /_pjsf 1923 | { 1924 | _fc 1925 | hvawidthshow 1926 | } ddef 1927 | /_lp /none ddef 1928 | } def 1929 | /X 1930 | { 1931 | /_gs exch ddef 1932 | findcmykcustomcolor 1933 | /_is exch ddef 1934 | /_sc 1935 | { 1936 | _lp /stroke ne 1937 | { 1938 | _os setoverprint 1939 | _is _gs 1 exch sub setcustomcolor 1940 | /_lp /stroke ddef 1941 | } if 1942 | } ddef 1943 | /_ps 1944 | { 1945 | _sc 1946 | stroke 1947 | } ddef 1948 | /_pss 1949 | { 1950 | _sc 1951 | ss 1952 | } ddef 1953 | /_pjss 1954 | { 1955 | _sc 1956 | jss 1957 | } ddef 1958 | /_lp /none ddef 1959 | } def 1960 | /XK 1961 | { 1962 | 3 -1 roll pop 1963 | 0 eq 1964 | { 1965 | 1 exch sub 1966 | 3 {dup 3 1 roll mul 5 1 roll} repeat 1967 | mul 4 1 roll 1968 | K 1969 | } 1970 | { 1971 | 1 exch sub 4 1 roll 1972 | 3 {1 exch sub 3 index mul 1 exch sub 3 1 roll} repeat 1973 | 4 -1 roll pop 1974 | XA 1975 | } ifelse 1976 | } def 1977 | /Xk 1978 | { 1979 | 3 -1 roll pop 1980 | 0 eq 1981 | { 1982 | 1 exch sub 1983 | 3 {dup 3 1 roll mul 5 1 roll} repeat 1984 | mul 4 1 roll 1985 | k 1986 | } 1987 | { 1988 | 1 exch sub 4 1 roll 1989 | 3 {1 exch sub 3 index mul 1 exch sub 3 1 roll} repeat 1990 | 4 -1 roll pop 1991 | Xa 1992 | } ifelse 1993 | } def 1994 | /A 1995 | { 1996 | pop 1997 | } def 1998 | /annotatepage 1999 | { 2000 | userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse 2001 | } def 2002 | /XT { 2003 | pop pop 2004 | } def 2005 | /Xt { 2006 | pop 2007 | } def 2008 | /discard 2009 | { 2010 | save /discardSave exch store 2011 | discardDict begin 2012 | /endString exch store 2013 | gt38? 2014 | { 2015 | 2 add 2016 | } if 2017 | load 2018 | stopped 2019 | pop 2020 | end 2021 | discardSave restore 2022 | } bind def 2023 | userdict /discardDict 7 dict dup begin 2024 | put 2025 | /pre38Initialize 2026 | { 2027 | /endStringLength endString length store 2028 | /newBuff buffer 0 endStringLength getinterval store 2029 | /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store 2030 | /newBuffLast newBuff endStringLength 1 sub 1 getinterval store 2031 | } def 2032 | /shiftBuffer 2033 | { 2034 | newBuff 0 newBuffButFirst putinterval 2035 | newBuffLast 0 2036 | currentfile read not 2037 | { 2038 | stop 2039 | } if 2040 | put 2041 | } def 2042 | 0 2043 | { 2044 | pre38Initialize 2045 | mark 2046 | currentfile newBuff readstring exch pop 2047 | { 2048 | { 2049 | newBuff endString eq 2050 | { 2051 | cleartomark stop 2052 | } if 2053 | shiftBuffer 2054 | } loop 2055 | } 2056 | { 2057 | stop 2058 | } ifelse 2059 | } def 2060 | 1 2061 | { 2062 | pre38Initialize 2063 | /beginString exch store 2064 | mark 2065 | currentfile newBuff readstring exch pop 2066 | { 2067 | { 2068 | newBuff beginString eq 2069 | { 2070 | /layerCount dup load 1 add store 2071 | } 2072 | { 2073 | newBuff endString eq 2074 | { 2075 | /layerCount dup load 1 sub store 2076 | layerCount 0 eq 2077 | { 2078 | cleartomark stop 2079 | } if 2080 | } if 2081 | } ifelse 2082 | shiftBuffer 2083 | } loop 2084 | } if 2085 | } def 2086 | 2 2087 | { 2088 | mark 2089 | { 2090 | currentfile buffer {readline} stopped { 2091 | % assume error was due to overfilling the buffer 2092 | }{ 2093 | not 2094 | { 2095 | stop 2096 | } if 2097 | endString eq { 2098 | cleartomark stop 2099 | } if 2100 | }ifelse 2101 | } loop 2102 | } def 2103 | 3 2104 | { 2105 | /beginString exch store 2106 | /layerCnt 1 store 2107 | mark 2108 | { 2109 | currentfile buffer {readline} stopped { 2110 | % assume error was due to overfilling the buffer 2111 | }{ 2112 | not 2113 | { 2114 | stop 2115 | } if 2116 | dup beginString eq 2117 | { 2118 | pop /layerCnt dup load 1 add store 2119 | } 2120 | { 2121 | endString eq 2122 | { 2123 | layerCnt 1 eq 2124 | { 2125 | cleartomark stop 2126 | } 2127 | { 2128 | /layerCnt dup load 1 sub store 2129 | } ifelse 2130 | } if 2131 | } ifelse 2132 | }ifelse 2133 | } loop 2134 | } def 2135 | end 2136 | userdict /clipRenderOff 15 dict dup begin 2137 | put 2138 | { 2139 | /n /N /s /S /f /F /b /B 2140 | } 2141 | { 2142 | { 2143 | _doClip 1 eq 2144 | { 2145 | /_doClip 0 ddef _eo {eoclip} {clip} ifelse 2146 | } if 2147 | newpath 2148 | } def 2149 | } forall 2150 | /Tr /pop load def 2151 | /Bb {} def 2152 | /BB /pop load def 2153 | /Bg {12 npop} def 2154 | /Bm {6 npop} def 2155 | /Bc /Bm load def 2156 | /Bh {4 npop} def 2157 | end 2158 | /Lb 2159 | { 2160 | 6 npop 2161 | 7 2 roll 2162 | 5 npop 2163 | 0 eq 2164 | { 2165 | 0 eq 2166 | { 2167 | (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard 2168 | } 2169 | { 2170 | 2171 | /clipForward? true def 2172 | 2173 | /Tx /pop load def 2174 | /Tj /pop load def 2175 | 2176 | currentdict end clipRenderOff begin begin 2177 | } ifelse 2178 | } 2179 | { 2180 | 0 eq 2181 | { 2182 | save /discardSave exch store 2183 | } if 2184 | } ifelse 2185 | } bind def 2186 | /LB 2187 | { 2188 | discardSave dup null ne 2189 | { 2190 | restore 2191 | } 2192 | { 2193 | pop 2194 | clipForward? 2195 | { 2196 | currentdict 2197 | end 2198 | end 2199 | begin 2200 | 2201 | /clipForward? false ddef 2202 | } if 2203 | } ifelse 2204 | } bind def 2205 | /Pb 2206 | { 2207 | pop pop 2208 | 0 (%AI5_EndPalette) discard 2209 | } bind def 2210 | /Np 2211 | { 2212 | 0 (%AI5_End_NonPrinting--) discard 2213 | } bind def 2214 | /Ln /pop load def 2215 | /Ap 2216 | /pop load def 2217 | /Ar 2218 | { 2219 | 72 exch div 2220 | 0 dtransform dup mul exch dup mul add sqrt 2221 | dup 1 lt 2222 | { 2223 | pop 1 2224 | } if 2225 | setflat 2226 | } def 2227 | /Mb 2228 | { 2229 | q 2230 | } def 2231 | /Md 2232 | { 2233 | } def 2234 | /MB 2235 | { 2236 | Q 2237 | } def 2238 | /nc 4 dict def 2239 | nc begin 2240 | /setgray 2241 | { 2242 | pop 2243 | } bind def 2244 | /setcmykcolor 2245 | { 2246 | 4 npop 2247 | } bind def 2248 | /setrgbcolor 2249 | { 2250 | 3 npop 2251 | } bind def 2252 | /setcustomcolor 2253 | { 2254 | 2 npop 2255 | } bind def 2256 | currentdict readonly pop 2257 | end 2258 | /XP 2259 | { 2260 | 4 npop 2261 | } bind def 2262 | /XD 2263 | { 2264 | pop 2265 | } bind def 2266 | end 2267 | setpacking 2268 | %%EndResource 2269 | %%BeginResource: procset Adobe_cshow 2.0 8 2270 | %%Title: (Writing System Operators) 2271 | %%Version: 2.0 8 2272 | %%CreationDate: (1/23/89) () 2273 | %%Copyright: ((C) 1992-1996 Adobe Systems Incorporated All Rights Reserved) 2274 | currentpacking true setpacking 2275 | userdict /Adobe_cshow 14 dict dup begin put 2276 | /initialize 2277 | { 2278 | Adobe_cshow begin 2279 | Adobe_cshow 2280 | { 2281 | dup xcheck 2282 | { 2283 | bind 2284 | } if 2285 | pop pop 2286 | } forall 2287 | end 2288 | Adobe_cshow begin 2289 | } def 2290 | /terminate 2291 | { 2292 | currentdict Adobe_cshow eq 2293 | { 2294 | end 2295 | } if 2296 | } def 2297 | /cforall 2298 | { 2299 | /_lobyte 0 ddef 2300 | /_hibyte 0 ddef 2301 | /_cproc exch ddef 2302 | /_cscript currentfont /FontScript known { currentfont /FontScript get } { -1 } ifelse ddef 2303 | { 2304 | /_lobyte exch ddef 2305 | _hibyte 0 eq 2306 | _cscript 1 eq 2307 | _lobyte 129 ge _lobyte 159 le and 2308 | _lobyte 224 ge _lobyte 252 le and or and 2309 | _cscript 2 eq 2310 | _lobyte 161 ge _lobyte 254 le and and 2311 | _cscript 3 eq 2312 | _lobyte 161 ge _lobyte 254 le and and 2313 | _cscript 25 eq 2314 | _lobyte 161 ge _lobyte 254 le and and 2315 | _cscript -1 eq 2316 | or or or or and 2317 | { 2318 | /_hibyte _lobyte ddef 2319 | } 2320 | { 2321 | _hibyte 256 mul _lobyte add 2322 | _cproc 2323 | /_hibyte 0 ddef 2324 | } ifelse 2325 | } forall 2326 | } def 2327 | /cstring 2328 | { 2329 | dup 256 lt 2330 | { 2331 | (s) dup 0 4 3 roll put 2332 | } 2333 | { 2334 | dup 256 idiv exch 256 mod 2335 | (hl) dup dup 0 6 5 roll put 1 4 3 roll put 2336 | } ifelse 2337 | } def 2338 | /clength 2339 | { 2340 | 0 exch 2341 | { 256 lt { 1 } { 2 } ifelse add } cforall 2342 | } def 2343 | /hawidthshow 2344 | { 2345 | { 2346 | dup cstring 2347 | show 2348 | _hvax _hvay rmoveto 2349 | _hvwb eq { _hvcx _hvcy rmoveto } if 2350 | } cforall 2351 | } def 2352 | /vawidthshow 2353 | { 2354 | { 2355 | dup 255 le 2356 | _charorientation 1 eq 2357 | and 2358 | { 2359 | -90 rotate 2360 | 0 _fontRotateAdjust rmoveto 2361 | cstring 2362 | _hvcx _hvcy _hvwb _hvax _hvay 6 -1 roll awidthshow 2363 | 0 _fontRotateAdjust neg rmoveto 2364 | 90 rotate 2365 | } 2366 | { 2367 | currentpoint 2368 | _fontHeight sub 2369 | exch _hvay sub exch _hvax sub 2370 | 2 index _hvwb eq { exch _hvcy sub exch _hvcx sub } if 2371 | 3 2 roll 2372 | cstring 2373 | dup stringwidth pop 2 div neg _fontAscent neg rmoveto 2374 | show 2375 | moveto 2376 | } ifelse 2377 | } cforall 2378 | } def 2379 | /hvawidthshow 2380 | { 2381 | 6 1 roll 2382 | /_hvay exch ddef 2383 | /_hvax exch ddef 2384 | /_hvwb exch ddef 2385 | /_hvcy exch ddef 2386 | /_hvcx exch ddef 2387 | _lineorientation 0 eq { hawidthshow } { vawidthshow } ifelse 2388 | } def 2389 | /hvwidthshow 2390 | { 2391 | 0 0 3 -1 roll hvawidthshow 2392 | } def 2393 | /hvashow 2394 | { 2395 | 0 0 0 6 -3 roll hvawidthshow 2396 | } def 2397 | /hvshow 2398 | { 2399 | 0 0 0 0 0 6 -1 roll hvawidthshow 2400 | } def 2401 | currentdict readonly pop end 2402 | setpacking 2403 | %%EndResource 2404 | %%BeginResource: procset Adobe_shading_AI8 1.0 0 2405 | %%Title: (Adobe Illustrator 8 Shading Procset) 2406 | %%Version: 1.0 0 2407 | %%CreationDate: (12/17/97) () 2408 | %%Copyright: ((C) 1987-1997 Adobe Systems Incorporated All Rights Reserved) 2409 | userdict /defaultpacking currentpacking put true setpacking 2410 | userdict /Adobe_shading_AI8 10 dict dup begin put 2411 | /initialize { 2412 | Adobe_shading_AI8 begin 2413 | Adobe_shading_AI8 bdprocs 2414 | Mesh /initialize get exec 2415 | } def 2416 | /terminate { 2417 | currentdict Adobe_shading_AI8 eq { 2418 | end 2419 | } if 2420 | } def 2421 | /bdprocs { 2422 | { 2423 | dup xcheck 1 index type /arraytype eq and { 2424 | bind 2425 | } if 2426 | pop pop 2427 | } forall 2428 | } def 2429 | /X! {pop} def 2430 | /X# {pop pop} def 2431 | /Mesh 40 dict def 2432 | Mesh begin 2433 | /initialize { 2434 | Mesh bdprocs 2435 | Mesh begin 2436 | /emulate? /AI8MeshEmulation where { 2437 | pop AI8MeshEmulation 2438 | }{ 2439 | systemdict /shfill known not 2440 | } ifelse def 2441 | end 2442 | } def 2443 | /bd { 2444 | shadingdict begin 2445 | } def 2446 | /paint { 2447 | emulate? { 2448 | end 2449 | }{ 2450 | /_lp /none ddef _fc /_lp /none ddef 2451 | 2452 | /AIColorSpace AIColorSpace tocolorspace store 2453 | /ColorSpace AIColorSpace topsspace store 2454 | 2455 | version_ge_3010.106 not systemdict /setsmoothness known and { 2456 | 0.0001 setsmoothness 2457 | } if 2458 | 2459 | composite? { 2460 | /DataSource getdatasrc def 2461 | Matrix concat 2462 | currentdict end 2463 | shfill 2464 | }{ 2465 | AIColorSpace makesmarks AIPlateList markingplate and not isoverprint and { 2466 | end 2467 | }{ 2468 | /ColorSpace /DeviceGray store 2469 | /Decode [0 1 0 1 0 1] store 2470 | /DataSource getplatesrc def 2471 | Matrix concat 2472 | currentdict end 2473 | shfill 2474 | } ifelse 2475 | } ifelse 2476 | } ifelse 2477 | } def 2478 | /shadingdict 12 dict def 2479 | shadingdict begin 2480 | /ShadingType 6 def 2481 | /BitsPerCoordinate 16 def 2482 | /BitsPerComponent 8 def 2483 | /BitsPerFlag 8 def 2484 | end 2485 | /datafile null def 2486 | /databuf 256 string def 2487 | /dataptr 0 def 2488 | /srcspace null def 2489 | /srcchannels 0 def 2490 | /dstchannels 0 def 2491 | /dstplate 0 def 2492 | /srctodstcolor null def 2493 | /getplatesrc { 2494 | /srcspace AIColorSpace store 2495 | /srcchannels AIColorSpace getnchannels store 2496 | /dstchannels 1 store 2497 | /dstplate getplateindex store 2498 | /srctodstcolor srcspace makesmarks { 2499 | dstplate 4 eq { 2500 | {1 exch sub} 2501 | }{ 2502 | {srcspace tocmyk 3 dstplate sub index 1 exch sub 5 1 roll 4 {pop} repeat} 2503 | } ifelse 2504 | }{ 2505 | {srcchannels {pop} repeat 1} 2506 | } ifelse store 2507 | /datafile getdatasrc store 2508 | /rdpatch168 load DataLength () /SubFileDecode filter 2509 | } def 2510 | /getdatasrc { 2511 | /rdcmntline load /ASCII85Decode filter 2512 | } def 2513 | /rdpatch168 { 2514 | /dataptr 0 store 2515 | 49 rdcount 2516 | 4 { 2517 | dup {pop srcchannels getint8} if 2518 | dup {pop srctodstcolor dstchannels putint8 true} if 2519 | } repeat 2520 | {databuf 0 dataptr getinterval}{()} ifelse 2521 | } def 2522 | /rdpatch3216 { 2523 | /dataptr 0 store 2524 | 97 rdcount 2525 | 4 { 2526 | dup {pop srcchannels getint16} if 2527 | dup {pop srctodstcolor dstchannels putint16 true} if 2528 | } repeat 2529 | {databuf 0 dataptr getinterval}{()} ifelse 2530 | } def 2531 | /rdcount { 2532 | dup 0 gt { 2533 | datafile databuf dataptr 4 -1 roll getinterval readstring 2534 | exch length dataptr add /dataptr exch store 2535 | }{ 2536 | true 2537 | } ifelse 2538 | } def 2539 | /getint8 { 2540 | mark true 3 -1 roll 2541 | { 2542 | dup {pop datafile read} if 2543 | dup {pop 255 div true} if 2544 | } repeat 2545 | { 2546 | counttomark 1 add -1 roll pop true 2547 | }{ 2548 | cleartomark false 2549 | } ifelse 2550 | } def 2551 | /putint8 { 2552 | dup dataptr add /dataptr exch store 2553 | dataptr exch 2554 | { 2555 | 1 sub exch 2556 | 255 mul cvi 2557 | databuf 2 index 2558 | 3 -1 roll put 2559 | } repeat 2560 | pop 2561 | } def 2562 | /getint16 { 2563 | mark true 3 -1 roll 2564 | { 2565 | dup {pop datafile read} if 2566 | dup {pop 256 mul datafile read} if 2567 | dup {pop add 65535 div true} if 2568 | } repeat 2569 | { 2570 | counttomark 1 add -1 roll pop true 2571 | }{ 2572 | cleartomark false 2573 | } ifelse 2574 | } def 2575 | /putint16 { 2576 | dup 2 mul dataptr add /dataptr exch store 2577 | dataptr exch 2578 | { 2579 | 2 sub exch 2580 | 65535 mul cvi dup 2581 | 256 idiv databuf 3 index 3 -1 roll put 2582 | 256 mod databuf 2 index 1 add 3 -1 roll put 2583 | } repeat 2584 | pop 2585 | } def 2586 | /srcbuf 256 string def 2587 | /rdcmntline { 2588 | currentfile srcbuf readline pop 2589 | (%) anchorsearch {pop} if 2590 | } def 2591 | /getplateindex { 2592 | 0 [cyan? magenta? yellow? black? customColor?] {{exit} if 1 add} forall 2593 | } def 2594 | /aicsarray 4 array def 2595 | /aicsaltvals 4 array def 2596 | /aicsaltcolr aicsaltvals def 2597 | /tocolorspace { 2598 | dup type /arraytype eq { 2599 | mark exch aload pop 2600 | aicsarray 0 3 -1 roll put 2601 | aicsarray 1 3 -1 roll put 2602 | dup aicsarray 2 3 -1 roll put 2603 | gettintxform aicsarray 3 3 -1 roll put 2604 | counttomark aicsaltvals 0 3 -1 roll getinterval /aicsaltcolr exch store 2605 | aicsaltcolr astore pop pop 2606 | aicsarray 2607 | } if 2608 | } def 2609 | /subtintxform {aicsaltcolr {1 index mul exch} forall pop} def 2610 | /addtintxform {aicsaltcolr {1 sub 1 index mul 1 add exch} forall pop} def 2611 | /gettintxform { 2612 | /DeviceRGB eq {/addtintxform}{/subtintxform} ifelse load 2613 | } def 2614 | /getnchannels { 2615 | dup type /arraytype eq {0 get} if 2616 | colorspacedict exch get begin Channels end 2617 | } def 2618 | /makesmarks { 2619 | composite? { 2620 | pop true 2621 | }{ 2622 | dup dup type /arraytype eq {0 get} if 2623 | colorspacedict exch get begin MarksPlate end 2624 | } ifelse 2625 | } def 2626 | /markingplate { 2627 | composite? { 2628 | pop true 2629 | }{ 2630 | dup type /arraytype eq { 2631 | dup length getplateindex gt {getplateindex get}{pop false} ifelse 2632 | } if 2633 | } ifelse 2634 | } def 2635 | /tocmyk { 2636 | dup dup type /arraytype eq {0 get} if 2637 | colorspacedict exch get begin ToCMYK end 2638 | } def 2639 | /topsspace { 2640 | dup dup type /arraytype eq {0 get} if 2641 | colorspacedict exch get begin ToPSSpace end 2642 | } def 2643 | /colorspacedict 5 dict dup begin 2644 | /DeviceGray 4 dict dup begin 2645 | /Channels 1 def 2646 | /MarksPlate {pop black?} def 2647 | /ToCMYK {pop 1 exch sub 0 0 0 4 -1 roll} def 2648 | /ToPSSpace {} def 2649 | end def 2650 | /DeviceRGB 4 dict dup begin 2651 | /Channels 3 def 2652 | /MarksPlate {pop isCMYKSep?} def 2653 | /ToCMYK {pop _rgbtocmyk} def 2654 | /ToPSSpace {} def 2655 | end def 2656 | /DeviceCMYK 4 dict dup begin 2657 | /Channels 4 def 2658 | /MarksPlate {pop isCMYKSep?} def 2659 | /ToCMYK {pop} def 2660 | /ToPSSpace {} def 2661 | end def 2662 | /Separation 4 dict dup begin 2663 | /Channels 1 def 2664 | /MarksPlate { 2665 | /findcmykcustomcolor where { 2666 | pop dup 1 exch ToCMYK 5 -1 roll 1 get 2667 | findcmykcustomcolor 1 setcustomcolor 2668 | systemdict /currentgray get exec 2669 | 1 ne 2670 | }{ 2671 | pop false 2672 | } ifelse 2673 | } def 2674 | /ToCMYK { 2675 | dup 2 get mark exch 4 2 roll 2676 | 3 get exec 2677 | counttomark -1 roll tocmyk 2678 | 5 -1 roll pop 2679 | } def 2680 | /ToPSSpace {} def 2681 | end def 2682 | /Process 4 dict dup begin 2683 | /Channels 1 def 2684 | /MarksPlate { 2685 | isCMYKSep? { 2686 | 1 exch ToCMYK 4 array astore getplateindex get 0 ne 2687 | }{ 2688 | pop false 2689 | } ifelse 2690 | } def 2691 | /ToCMYK { 2692 | dup 2 get mark exch 4 2 roll 2693 | 3 get exec 2694 | counttomark -1 roll tocmyk 2695 | 5 -1 roll pop 2696 | } def 2697 | /ToPSSpace { 2698 | 4 array copy dup 0 /Separation put 2699 | } def 2700 | end def 2701 | end def 2702 | /isoverprint { 2703 | /currentoverprint where {pop currentoverprint}{_of} ifelse 2704 | } def 2705 | /version_ge_3010.106 { 2706 | version {cvr} stopped { 2707 | pop 2708 | false 2709 | }{ 2710 | 3010.106 ge 2711 | } ifelse 2712 | } def 2713 | end 2714 | end 2715 | defaultpacking setpacking 2716 | %%EndResource 2717 | %%EndProlog %%BeginSetup userdict /_useSmoothShade false put userdict /_aicmykps true put userdict /_forceToCMYK true put Adobe_level2_AI5 /initialize get exec 2718 | Adobe_cshow /initialize get exec 2719 | Adobe_ColorImage_AI6 /initialize get exec 2720 | Adobe_shading_AI8 /initialize get exec 2721 | Adobe_Illustrator_AI5 /initialize get exec 2722 | %AI3_BeginRider currentpacking true setpacking setpacking %AI3_EndRider %AI5_Begin_NonPrinting Np %AI8_PluginGroupInfo (Adobe Path Blends) (Adobe Blends Plugin) (LiveBlends.aip) %AI8_PluginGroupInfo (Adobe Tracing Object) (Tracing) (TracingSuite.aip) %AI8_PluginGroupInfo (Adobe Scatter Brush Tool) (Adobe Scatter Brush Plugin) (ScatterBrushTool.aip) %AI8_PluginGroupInfo (Adobe Scatter Brush Tool) (Adobe Scatter Brush Plugin) (ScatterBrushTool.aip) %AI8_PluginGroupInfo (Adobe PatternOnPath Brush Tool) (Adobe Pattern Brush Plugin) (ArtBrushTool.aip) %AI8_PluginGroupInfo (Adobe PatternOnPath Brush Tool) (Adobe Pattern Brush Plugin) (ArtBrushTool.aip) %AI8_PluginGroupInfo (Adobe ArtOnPath Brush Tool) (Adobe Art Brush Plugin) (ArtBrushTool.aip) %AI8_PluginGroupInfo (Adobe ArtOnPath Brush Tool) (Adobe Art Brush Plugin) (ArtBrushTool.aip) %AI8_PluginGroupInfo (Adobe Calligraphic Brush Tool) (Adobe Calligraphic Brush Plugin) (CalligBrushTool.aip) %AI8_PluginGroupInfo (Adobe Flare Plugin) (Flare) (Flare.aip) %AI8_PluginGroupInfo (Adobe Symbolism) (Adobe Symbolism) (ParticleSystem.aip) %AI8_PluginGroupInfo (Adobe Deform Plugin) (Adobe Envelope Plugin) (Envelope and Warp.aip) %AI8_PluginGroupInfo (Pathfinder Suite) (Adobe Compound Shape) (PathFinderS.aip) %AI8_PluginGroupInfo (Adobe Planar Group) (Adobe Live Paint Plugin) (Live Paint.aip) %AI5_End_NonPrinting-- %AI5_Begin_NonPrinting Np %AI5_End_NonPrinting-- %AI5_BeginPalette 0 0 Pb 1 1 1 1 ([Registration]) 0 Xs ([Registration]) Pc 0 0 0 1 k ([Registration]) Pc PB %AI5_EndPalette %%EndSetup %AI5_BeginLayer 1 1 1 1 0 0 1 0 79 128 255 0 100 Lb (Background) Ln 0 A LB %AI5_EndLayer-- %AI5_BeginLayer 1 1 1 1 0 0 1 0 79 128 255 0 100 Lb (Guides) Ln 0 A LB %AI5_EndLayer-- %AI5_BeginLayer 1 1 1 1 0 0 1 0 79 128 255 0 100 Lb (Foreground) Ln 0 A u 300 Ar 1 O 0 0 0 1 k 0 J 0 j 1 w 3.8637 M []0 d 1 XR 321.1895 311.4307 m 318.4307 316.4609 313.7246 318.4624 308.2617 318.4624 c 300.3105 318.4624 293.9819 312.8369 293.9819 303.3164 c 293.9819 293.6348 299.9316 288.1719 308.5322 288.1719 c 314.0493 288.1719 318.7554 291.2012 321.3516 295.7988 C 315.2935 298.8818 L 313.9409 295.6357 311.8857 294.6621 309.2896 294.6621 c 304.7998 294.6621 302.7446 298.3945 302.7446 303.3164 c 302.7446 308.2393 304.4756 311.9717 309.2896 311.9717 c 310.5874 311.9717 313.1841 311.2686 314.6982 308.0229 C 321.1895 311.4307 L f *u 336.6538 311.9717 m 341.4678 311.9717 343.5234 308.2393 343.5234 303.6416 c 343.5234 298.3945 341.4678 294.6621 336.6538 294.6621 c 331.8398 294.6621 329.7847 298.3945 329.7847 303.3164 c 329.7847 308.2393 331.8398 311.9717 336.6538 311.9717 c f 1 D 336.6538 318.4624 m 327.6748 318.4624 321.3467 312.999 321.3467 303.3164 c 321.3467 293.6348 327.6748 288.1719 336.6538 288.1719 c 345.6328 288.1719 351.9614 293.6348 351.9614 303.3164 c 351.9614 312.999 345.6328 318.4624 336.6538 318.4624 c f *U 0 D 353.6904 288.9297 m 362.1289 288.9297 L 362.1289 306.833 L 362.1289 309.4292 363.2104 311.647 366.6182 311.647 c 369.8638 311.647 370.729 309.7539 370.729 306.9414 C 370.729 288.9297 L 379.167 288.9297 L 379.167 306.6167 L 379.167 309.5376 380.6274 311.647 383.4404 311.647 c 386.6313 311.647 387.7676 309.8081 387.7676 305.751 C 387.7676 288.9297 L 396.2056 288.9297 L 396.2056 310.8896 L 396.2056 317.4888 390.1475 318.4624 387.3345 318.4624 c 383.981 318.4624 380.8438 317.4346 378.0854 314.6221 C 376.1919 317.1641 373.7583 318.4624 370.4585 318.4624 c 367.8623 318.4624 364.2925 317.7051 362.1289 315.1626 C 362.1289 317.7051 L 353.6904 317.7051 L 353.6904 288.9297 L f 398.9043 288.9297 m 407.3418 288.9297 L 407.3418 306.833 L 407.3418 309.4292 408.4238 311.647 411.8311 311.647 c 415.0771 311.647 415.9424 309.7539 415.9424 306.9414 C 415.9424 288.9297 L 424.3809 288.9297 L 424.3809 306.6167 L 424.3809 309.5376 425.8408 311.647 428.6533 311.647 c 431.8447 311.647 432.9814 309.8081 432.9814 305.751 C 432.9814 288.9297 L 441.4189 288.9297 L 441.4189 310.8896 L 441.4189 317.4888 435.3604 318.4624 432.5479 318.4624 c 429.1943 318.4624 426.0576 317.4346 423.2988 314.6221 C 421.4063 317.1641 418.9717 318.4624 415.6719 318.4624 c 413.0762 318.4624 409.5059 317.7051 407.3418 315.1626 C 407.3418 317.7051 L 398.9043 317.7051 L 398.9043 288.9297 L f *u 458.4521 311.9717 m 463.2656 311.9717 465.3213 308.2393 465.3213 303.6416 c 465.3213 298.3945 463.2656 294.6621 458.4521 294.6621 c 453.6377 294.6621 451.582 298.3945 451.582 303.3164 c 451.582 308.2393 453.6377 311.9717 458.4521 311.9717 c f 1 D 458.4521 318.4624 m 449.4727 318.4624 443.1445 312.999 443.1445 303.3164 c 443.1445 293.6348 449.4727 288.1719 458.4521 288.1719 c 467.4307 288.1719 473.7598 293.6348 473.7598 303.3164 c 473.7598 312.999 467.4307 318.4624 458.4521 318.4624 c f *U 0 D 476.0293 288.9297 m 484.4668 288.9297 L 484.4668 306.833 L 484.4668 309.4292 485.5488 311.647 488.957 311.647 c 492.2021 311.647 493.0674 309.7539 493.0674 306.9414 C 493.0674 288.9297 L 501.5059 288.9297 L 501.5059 310.1865 L 501.5059 314.5137 499.6123 318.4624 492.7969 318.4624 c 490.2012 318.4624 486.6309 317.7051 484.4668 315.1626 C 484.4668 317.7051 L 476.0293 317.7051 L 476.0293 288.9297 L f 529.6816 314.2974 m 525.7871 316.8936 521.4063 318.4624 516.9707 318.4624 c 511.1279 318.4624 504.7998 315.6494 504.7998 308.4014 c 504.7998 298.1787 521.8379 301.748 521.8379 297.2588 c 521.8379 294.6621 518.6475 294.3379 517.2402 294.3379 c 513.4004 294.3379 510.75 295.9063 508.1533 298.3945 C 502.9063 293.8516 L 507.126 289.957 510.6953 288.1719 516.9707 288.1719 c 523.2441 288.1719 529.9521 290.877 529.9521 298.4492 c 529.9521 309.2129 512.9141 305.1563 512.9141 310.0786 c 512.9141 311.5386 514.4277 312.2959 516.5371 312.2959 c 519.1885 312.2959 522.8125 311.2144 524.4883 309.2129 C 529.6816 314.2974 L f 321.1895 344.5361 m 318.4307 349.5664 313.7246 351.5679 308.2617 351.5679 c 300.3105 351.5679 293.9819 345.9424 293.9819 336.4229 c 293.9819 326.7407 299.9316 321.2773 308.5322 321.2773 c 314.0493 321.2773 318.7554 324.3066 321.3516 328.9043 C 315.2935 331.9873 L 313.9409 328.7417 311.8857 327.7681 309.2896 327.7681 c 304.7998 327.7681 302.7446 331.5005 302.7446 336.4229 c 302.7446 341.3447 304.4756 345.0771 309.2896 345.0771 c 310.5874 345.0771 313.1841 344.374 314.6982 341.1284 C 321.1895 344.5361 L f 323.248 322.0347 m 331.686 322.0347 L 331.686 338.6943 L 331.686 341.8857 333.6875 342.751 338.7178 343.3462 C 339.6372 343.4546 L 339.583 350.9189 L 336.6079 350.7021 333.5249 349.6206 331.686 347.8896 C 331.686 350.8105 L 323.248 350.8105 L 323.248 322.0347 L f *u 1 D 368.2939 334.6919 m 368.2397 343.5625 364.6699 351.5679 354.1763 351.5679 c 345.4136 351.5679 340.0586 345.7261 340.0586 335.5571 c 340.0586 327.4438 345.2515 321.2773 354.1763 321.2773 c 360.6128 321.2773 365.2104 323.8198 368.1313 329.2285 C 361.8027 332.5283 L 359.3687 329.0664 357.9082 327.4438 354.771 327.4438 c 352.0669 327.4438 348.5508 329.1748 348.4966 334.6919 C 368.2939 334.6919 L f 0 D 348.3887 339.8843 m 348.7671 343.6709 351.688 345.4014 354.1221 345.4014 c 356.5562 345.4014 359.585 344.1035 359.8555 339.8843 C 348.3887 339.8843 L f *U *u 387.6499 334.0425 m 387.6499 329.6616 385.1616 327.4438 381.8623 327.4438 c 379.8066 327.4438 377.9136 328.4175 377.9136 330.689 c 377.9136 333.0151 379.8608 333.8262 381.9702 334.4214 C 387.6499 336.0439 L 387.6499 334.0425 L f 1 D 395.7632 343.2378 m 395.709 349.729 390.7871 351.5679 382.9438 351.5679 c 379.0493 351.5679 371.3687 350.8105 371.0981 342.5347 C 379.2119 342.5347 L 379.6445 345.4014 380.9424 346.375 383.647 346.375 c 385.9189 346.375 387.6499 345.4556 387.6499 343.292 C 387.6499 340.9121 L 384.5664 340.4795 L 375.3711 339.1812 369.7998 336.7471 369.7998 329.8237 c 369.7998 324.3066 373.9111 321.2773 379.4282 321.2773 c 382.457 321.2773 386.6763 322.7378 388.0825 325.0098 C 388.1904 325.0098 L 388.2446 324.0361 388.4072 323.0083 388.7314 322.0347 C 396.5205 322.0347 L 395.8174 323.8198 395.7632 326.0371 395.7632 328.0386 C 395.7632 343.2378 L f *U 0 D 415.6064 350.2695 m 410.5752 350.2695 L 410.5752 358.5996 L 402.1367 358.5996 L 402.1367 350.2695 L 398.0264 350.2695 L 398.0264 345.0771 L 402.1367 345.0771 L 402.1367 329.9316 L 402.1367 325.7671 403.165 321.2773 410.3594 321.2773 c 412.1982 321.2773 414.6865 321.4937 415.7686 321.6021 C 415.7686 328.2549 L 415.335 328.2012 414.1455 328.0928 413.2266 328.0928 c 411.7109 328.0928 410.5752 328.688 410.5752 330.9595 C 410.5752 345.0771 L 415.6064 345.0771 L 415.6064 350.2695 L f *u 1 D 418.7842 350.8105 m 418.7842 322.0347 L 427.2227 322.0347 L 427.2227 350.8105 L 418.7842 350.8105 L f 427.2227 354.0562 m 427.2227 360.5469 L 418.7842 360.5469 L 418.7842 354.0562 L 427.2227 354.0562 L f *U 0 D 438.5781 322.0347 m 447.0693 322.0347 L 456.915 350.8105 L 447.9355 350.8105 L 442.959 330.4727 L 442.8516 330.4727 L 437.874 350.8105 L 428.8418 350.8105 L 438.5781 322.0347 L f *u 1 D 484.1641 334.6919 m 484.1104 343.5625 480.54 351.5679 470.0469 351.5679 c 461.2832 351.5679 455.9297 345.7261 455.9297 335.5571 c 455.9297 327.4438 461.1211 321.2773 470.0469 321.2773 c 476.4834 321.2773 481.0811 323.8198 484.002 329.2285 C 477.6729 332.5283 L 475.2393 329.0664 473.7783 327.4438 470.6416 327.4438 c 467.9375 327.4438 464.4209 329.1748 464.3672 334.6919 C 484.1641 334.6919 L f 0 D 464.2588 339.8843 m 464.6377 343.6709 467.5576 345.4014 469.9922 345.4014 c 472.4268 345.4014 475.4561 344.1035 475.7266 339.8843 C 464.2588 339.8843 L f *U u *u 1 D 258.5098 352.0518 m 249.8276 352.0518 242.1875 348.8389 236.2837 342.8486 c 230.2065 336.6841 226.9077 328.6968 226.9077 320.3618 c 226.9077 311.9404 230.1196 304.127 236.1973 298.0488 c 242.2744 291.9717 250.1748 288.6729 258.5098 288.6729 c 266.8447 288.6729 274.9189 291.9717 281.1699 298.1357 c 287.0737 303.9531 290.1992 311.6797 290.1992 320.3618 c 290.1992 328.957 287.0737 336.771 281.083 342.7617 c 275.0059 348.8389 267.1919 352.0518 258.5098 352.0518 c f 0 D 258.5967 346.3213 m 265.7158 346.3213 272.0537 343.6299 277.0029 338.6812 C 281.8643 333.8188 284.4692 327.3945 284.4692 320.3618 c 284.4692 313.2427 281.9512 306.9917 277.0894 302.2158 C 271.9668 297.1807 265.3687 294.4893 258.5967 294.4893 c 251.7378 294.4893 245.313 297.1807 240.3643 302.1289 C 235.4155 307.0786 232.6372 313.5898 232.6372 320.3618 c 232.6372 327.2207 235.4155 333.7319 240.3643 338.7681 C 245.2261 343.7163 251.4775 346.3213 258.5967 346.3213 c f *U 258.188 325.6274 m 256.3979 328.8916 253.3442 330.1904 249.7988 330.1904 c 244.6387 330.1904 240.5317 326.54 240.5317 320.3618 c 240.5317 314.0786 244.3931 310.5332 249.9746 310.5332 c 253.5552 310.5332 256.6089 312.499 258.2939 315.4824 C 254.3623 317.4834 L 253.4844 315.3774 252.1509 314.7456 250.4658 314.7456 c 247.5522 314.7456 246.2188 317.1675 246.2188 320.3618 c 246.2188 323.5562 247.3418 325.9785 250.4658 325.9785 c 251.3081 325.9785 252.9932 325.522 253.9761 323.416 C 258.188 325.6274 L f 276.4692 325.6274 m 274.6787 328.8916 271.6255 330.1904 268.0801 330.1904 c 262.9199 330.1904 258.8125 326.54 258.8125 320.3618 c 258.8125 314.0786 262.6743 310.5332 268.2554 310.5332 c 271.8359 310.5332 274.8896 312.499 276.5747 315.4824 C 272.6431 317.4834 L 271.7656 315.3774 270.4316 314.7456 268.7466 314.7456 c 265.8335 314.7456 264.499 317.1675 264.499 320.3618 c 264.499 323.5562 265.6226 325.9785 268.7466 325.9785 c 269.5889 325.9785 271.2739 325.522 272.2573 323.416 C 276.4692 325.6274 L f U U LB %AI5_EndLayer-- %%PageTrailer gsave annotatepage grestore showpage %%Trailer Adobe_Illustrator_AI5 /terminate get exec 2723 | Adobe_shading_AI8 /terminate get exec 2724 | Adobe_ColorImage_AI6 /terminate get exec 2725 | Adobe_cshow /terminate get exec 2726 | Adobe_level2_AI5 /terminate get exec 2727 | %%EOF -------------------------------------------------------------------------------- /img/creative-commons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodejs-tw/nodejs-community-book/518bf95c393fa29170cba194516eda75ddc967e4/img/creative-commons.png -------------------------------------------------------------------------------- /img/nodejs-light.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nodejs-tw/nodejs-community-book/518bf95c393fa29170cba194516eda75ddc967e4/img/nodejs-light.eps -------------------------------------------------------------------------------- /index.rst: -------------------------------------------------------------------------------- 1 | .. NodeJS From Scratch 2 | @project: NodeJSFromScratch 3 | @location: https://github.com/nodejs-tw/nodejs-from-scratch 4 | @title: NodeJS 中文開發指南 5 | @copyright: Creative Commons 6 | @authors: nodejs.tw 7 | @category: computer 8 | @keywords: programming, web development 9 | @language: zh_TW 10 | @basename: NodeJSFromScratch 11 | @latex_paper_size: a4 12 | @latex_font_size: 12pt 13 | @latex_logo: img/nodejs-light.eps 14 | @epub_theme: epub_simple 15 | 16 | ################### 17 | NodeJS 中文開發指南 18 | ################### 19 | 20 | .. toctree:: 21 | :maxdepth: 3 22 | 23 | LICENSE 24 | README 25 | nodejs_intro 26 | nodejs_javascript 27 | nodejs_install 28 | nodejs_hello 29 | nodejs_npm 30 | AUTHOR 31 | -------------------------------------------------------------------------------- /nodejs_hello.rst: -------------------------------------------------------------------------------- 1 | 轉角遇到 Node 2 | ============== 3 | 4 | Hello World 5 | ------------ 6 | 7 | An example of a web server written in Node which responds with "Hello World" for every request. 8 | 9 | .. literalinclude:: src/example.js 10 | :language: javascript 11 | -------------------------------------------------------------------------------- /nodejs_intro.rst: -------------------------------------------------------------------------------- 1 | NodeJS 介紹 2 | =========== 3 | 4 | NodeJS 是一個高效能、易擴充的網站應用程式開發框架 (Web Application Framework) 。它誕生的原因,是為了讓開發者能夠更容易開發高延展性的網路服務,不需要經過太多複雜的調校、效能調整及程式修改,就能滿足網路服務在不同發展階段對效能的要求。 5 | 6 | Ryan Dahl 是 NodeJS 的催生者,目前任職於 Joyent (主機託管服務公司) 。他開發 NodeJS 的目的,就是希望能解決 Apache 在連線數量過高時,緩衝區 (buffer) 和系統資源會很快被耗盡的問題,希望能建立一個新的開發框架以解決這個問題。因此嘗試使用效能十分優秀的 V8 JavaScript Engine ,讓網站開發人員熟悉的 JavaScript 程式語言,也能應用於後端服務程式的開發,並且具有出色的執行效能。 7 | 8 | JavaScript 是功能強大的物件導向程式語言,但是在 JavaScript 的官方規格中,主要是定義網頁(以瀏覽器為基礎)應用程式需要的應用程式介面 (API) ,對 JavaScript 程式的應用範圍有所侷限。為使 JavaScript 能夠在更多用途發展, CommonJS 規範一組標準函式庫 (standard library) ,使 JavaScript 的應用範圍能夠和 Ruby 、 Python 及 Java 等語言同樣豐富。撰寫 NodeJS 的 JavaScript 程式碼,符合 CommonJS 規範,可以使用 CommonJS API 為基礎開發程式,並且在不同的 CommonJS 兼容 (compliant) JavaScript 執行環境中,程式碼具有可攜性。 9 | 10 | 瀏覽器的 JavaScript 與實現 CommonJS 規範的 NodeJS 有何不同呢?瀏覽器的 JavaScript 提供 XMLHttpRequest ,讓程式可以和網頁伺服器建立資料傳輸連線,但這通常只能適用於網站開發的需求,因為我們只能用 XMLHttpRequest 與網頁伺服器通訊,卻無法利用它建立其他類型如 Telnet / FTP / NTP 的伺服器通訊。如果我們想開發網路服務程式,例如 SMTP 電子郵件伺服器,就必須使用 Sockets 建立 TCP (某些服務則用 UDP) 監聽及連線,其他程式語言如 PHP 、 Java 、 Python 、 Perl 及 Ruby 等,在標準開發環境中皆有提供 Sockets API ,而瀏覽器的 JavaScript 基於安全及貼近網站設計需求的考量下,並未將 Sockets 列入標準函式庫之中。 CommonJS 的規範填補這種基礎函式庫功能的空缺,遵循 CommonJS 規範的 NodeJS 可以直接使用 Sockets API 建立各種網路服務程式。 11 | 12 | JavaScript 語言本身支援 Lambda 的特性,因此一個匿名函式 (anonymous function) 可以被儲存成一個變數,並當作參數傳遞給另一個函式。 13 | 14 | .. code-block:: javascript 15 | 16 | var proc1 = function(op, x) { 17 | return op(x); 18 | } 19 | 20 | var op1 = function(x) { return x+1; } 21 | var op2 = function(x) { return x*x; } 22 | 23 | proc1(op1, 3); // result is 4 24 | proc1(op2, 5); // result is 25 25 | 26 | 另一個 JavaScript 開發者必須掌握的語言特性稱為 Closure 。 27 | 28 | Callback這部份需要在查文件確認 29 | NodeJS 符合 CommonJS 的規範,使得 Callback 方式易於實現,也能夠讓更多同好基於 JavaScript 開發符合 NodeJS 的外掛模組 (Module)。 30 | 31 | 32 | 回想以前要寫一個能夠同時容納上百人的上線的網路服務,需要花費多大的苦工,可能10人多就需要經過一次程式調整,而NodeJS就是為了解決這個困境, NodeJS 因此誕生,它是一種利用 V8 Javascript 編譯器,所開發的產品,利用V8 編譯器的高效能,與Javascript 的程式開發特性所產生的網路程式。 33 | 34 | 開發人員所編寫出來的Javascript 腳本程式,怎麼可能會比其他語言寫出來的網路程式還要快上許多呢?以前的網路程式原理是將使用者每次的連線(connection)都開啟一個執行緒(thread),當連線爆增的時候將會快速耗盡系統效能,並且容易產生阻塞(block)的發生。 35 | 36 | NodeJS對於資源的調校有所不同,當程式接收到一筆連線(connection),會通知作業系統透過epoll, kqueue, /dev/poll,或select將連線保留,並且放入heap中配置,先讓連線進入休眠(Sleep)狀態,當系統通知時才會觸發連線的callback。這種處理連線方式只會佔用掉記憶體,並不會使用到CPU資源。另外因為採用Javascript 語言的特性,每個request都會有一個callback,如此可以避免發生Block的狀況發生。 37 | 38 | 基於Callback特性,目前NodeJS大多應用於Comet(long pulling) Request Server,或者是高連線數量的網路服務上,目前也有許多公司將NodeJS設為內部核心網路服務之一。在NodeJS也提供了外掛管理(Node package management),讓愛好NodeJS輕易開發更多有趣的服務、外掛,並且提供到npm讓全世界使用者快速安裝使用。 39 | 40 | 41 | 相關連結: 42 | NodeJS 官方網站 43 | NodeJS 官方部落格 44 | NodeJS github 45 | NodeJS 中文社群 46 | -------------------------------------------------------------------------------- /nodejs_javascript.rst: -------------------------------------------------------------------------------- 1 | 2 | ******************** 3 | JavaScript 與 NodeJS 4 | ******************** 5 | 6 | 其實使用 JavaScript 在網頁端與伺服器端的差距並不大, 7 | 但是為了使 NodeJS 可以發揮他最強大的能力, 8 | 有一些知識還是必要的, 9 | 所以還是針對這些主題介紹一下。 10 | 其中 Event Loop、Scope 以及 Callback 其實是比較需要了解的基本知識, 11 | cps、currying、flow control是更進階的技巧與應用。 12 | 13 | Event Loop 14 | ========== 15 | 16 | 可能很多人在寫Javascript時,並不知道他是怎麼被執行的。這個時候可以參考一下jQuery作者John Resig一篇好文章,介紹事件及timer怎麼在瀏覽器中執行:How JavaScript Timers Work。通常在網頁中,所有的Javascript執行完畢後(這部份全部都在global scope跑,除非執行函數),接下來就是如John Resig解釋的這樣,所有的事件處理函數,以及timer執行的函數,會排在一個queue結構中,利用一個無窮迴圈,不斷從queue中取出函數來執行。這個就是event loop。 17 | 18 | (除了John Resig的那篇文章,Nicholas C. Zakas的 "Professional Javascript for Web Developer 2nd edition" 有一個試閱本:http://yuiblog.com/assets/pdf/zakas-projs-2ed-ch18.pdf,598頁剛好也有簡短的說明) 19 | 20 | 所以在Javascript中,雖然有非同步,但是他並不是使用執行緒。所有的事件或是非同步執行的函數,都是在同一個執行緒中,利用event loop的方式在執行。至於一些比較慢的動作例如I/O、網頁render, reflow等,實際動作會在其他執行緒跑,等到有結果時才利用事件來觸發處理函數來處理。這樣的模型有幾個好處: 21 | 沒有執行緒的額外成本,所以反應速度很快 22 | 不會有任何程式同時用到同一個變數,不必考慮lock,也不會產生dead lock 23 | 所以程式撰寫很簡單 24 | 但是也有一些潛在問題: 25 | 任一個函數執行時間較長,都會讓其他函數更慢執行(因為一個跑完才會跑另一個) 26 | 在多核心硬體普遍的現在,無法用單一的應用程式instance發揮所有的硬體能力 27 | 用NodeJS撰寫伺服器程式,碰到的也是一樣的狀況。要讓系統發揮event loop的效能,就要盡量利用事件的方式來組織程式架構。另外,對於一些有可能較為耗時的操作,可以考慮使用 process.nextTick 函數來讓他以非同步的方式執行,避免在同一個函數中執行太久,擋住所有函數的執行。 28 | 29 | 如果想要測試event loop怎樣在「瀏覽器」中運行,可以在函數中呼叫alert(),這樣會讓所有Javascript的執行停下來,尤其會干擾所有使用timer的函數執行。有一個簡單的例子,這是一個會依照設定的時間間隔嚴格執行動作的動畫,如果時間過了就會跳過要執行的動作。點按圖片以後,人物會快速旋轉,但是在旋轉執行完畢前按下「delay」按鈕,讓alert訊息等久一點,接下來的動畫就完全不會出現了。 30 | 31 | Scope 與 Closure 32 | ================ 33 | 34 | 要快速理解 JavaScript 的 Scope(變數作用範圍)原理,只要記住他是Lexical Scope就差不多了。簡單地說,變數作用範圍是依照程式定義時(或者叫做程式文本?)的上下文決定,而不是執行時的上下文決定。 35 | 36 | 為了維護程式執行時所依賴的變數,即使執行時程式運行在原本的scope之外,他的變數作用範圍仍然維持不變。這時程式依賴的自由變數(定義時不是local的,而是在上一層scope定義的變數)一樣可以使用,就好像被關閉起來,所以叫做Closure。用程式看比較好懂: 37 | 38 | .. code-block:: js 39 | 40 | function outter(arg1) { 41 | //arg1及free_variable1對inner函數來說,都是自由變數 42 | var free_variable1 = 3; 43 | return function inner(arg2) { 44 | var local_variable1 =2;//arg2及local_variable1對inner函數來說,都是本地變數 45 | return arg1 + arg2 + free_variable + local_variable1; 46 | }; 47 | } 48 | 49 | var a = outter(1);//變數a 就是outter函數執行後返回的inner函數 50 | var b = a(4);//執行inner函數,執行時上下文已經在outter函數之外,但是仍然能正常執行,而且可以使用定義在outter函數裡面的arg1及free_variable1變數 51 | console.log(b);//結果10 52 | 53 | 在Javascript中,scope最主要的單位是函數(另外有global及eval),所以有可能製造出closure的狀況,通常在形式上都是有巢狀的函數定義,而且內側的函數使用到定義在外側函數裡面的變數。 54 | 55 | Closure有可能會造成記憶體洩漏,主要是因為被參考的變數無法被垃圾收集機制處理,造成佔用的資源無法釋放,所以使用上必須考慮清楚,不要造成意外的記憶體洩漏。(在上面的例子中,如果a一直未執行,使用到的記憶體就不會被釋放) 56 | 57 | 跟透過函數的參數把變數傳給函數比較起來,Javascript Engine會比較難對Closure進行最佳化。如果有效能上的考量,這一點也需要注意。 58 | 59 | Callback 60 | ======== 61 | 62 | 要介紹 Callback 之前, 63 | 要先提到 JavaScript 的特色。 64 | 65 | JavaScript 是一種函數式語言(functional language),所有Javascript語言內的函數,都是高階函數(higher order function,這是數學名詞,計算機用語好像是first class function,意指函數使用沒有任何限制,與其他物件一樣)。也就是說,函數可以作為函數的參數傳給函數,也可以當作函數的返回值。這個特性,讓Javascript的函數,使用上非常有彈性,而且功能強大。 66 | 67 | callback在形式上,其實就是把函數傳給函數,然後在適當的時機呼叫傳入的函數。Javascript使用的事件系統,通常就是使用這種形式。NodeJS中,有一個物件叫做EventEmitter,這是NodeJS事件處理的核心物件,所有會使用事件處理的函數,都會「繼承」這個物件。(這裡說的繼承,實作上應該像是mixin)他的使用很簡單: 68 | 可以使用 物件.on(事件名稱, callback函數) 或是 物件.addListener(事件名稱, callback函數) 把你想要處理事件的函數傳入 69 | 在 物件 中,可以使用 物件.emit(事件名稱, 參數...) 呼叫傳入的callback函數 70 | 這是Observer Pattern的簡單實作,而且跟在網頁中使用DOM的addEventListener使用上很類似,也很容易上手。不過NodeJS是大量使用非同步方式執行的應用,所以程式邏輯幾乎都是寫在callback函數中,當邏輯比較複雜時,大量的callback會讓程式看起來很複雜,也比較難單元測試。舉例來說: 71 | 72 | var p_client = new Db('integration_tests_20', new Server("127.0.0.1", 27017, {}), {'pk':CustomPKFactory}); 73 | p_client.open(function(err, p_client) { 74 | p_client.dropDatabase(function(err, done) { 75 | p_client.createCollection('test_custom_key', function(err, collection) { 76 | collection.insert({'a':1}, function(err, docs) { 77 | collection.find({'_id':new ObjectID("aaaaaaaaaaaa")}, function(err, cursor) { 78 | cursor.toArray(function(err, items) { 79 | test.assertEquals(1, items.length); 80 | p_client.close(); 81 | }); 82 | }); 83 | }); 84 | }); 85 | }); 86 | }); 87 | 88 | 這是在網路上看到的一段操作mongodb的程式碼,為了循序操作,所以必須在一個callback裡面呼叫下一個動作要使用的函數,這個函數裡面還是會使用callback,最後就形成一個非常深的巢狀。 89 | 90 | 這樣的程式碼,會比較難進行單元測試。有一個簡單的解決方式,是盡量不要使用匿名函數來當作callback或是event handler。透過這樣的方式,就可以對各個handler做單元測試了。例如: 91 | 92 | var http = require('http'); 93 | var tools = { 94 | cookieParser: function(request, response) { 95 | if(request.headers['Cookie']) { 96 | //do parsing 97 | } 98 | } 99 | }; 100 | var server = http.createServer(function(request, response) { 101 | this.emit('init', request, response); 102 | //... 103 | }); 104 | server.on('init', tools.cookieParser); 105 | server.listen(8080, '127.0.0.1'); 106 | 107 | 更進一步,可以把tools改成外部module,例如叫做tools.js: 108 | 109 | module.exports = { 110 | cookieParser: function(request, response) { 111 | if(request.headers['Cookie']) { 112 | //do parsing 113 | } 114 | } 115 | }; 116 | 117 | 然後把程式改成: 118 | 119 | var http = require('http'); 120 | 121 | var server = http.createServer(function(request, response) { 122 | this.emit('init', request, response); 123 | //... 124 | }); 125 | server.on('init', require('./tools').cookieParser); 126 | server.listen(8080, '127.0.0.1'); 127 | 128 | 這樣就可以單元測試cookieParser了。例如使用nodeunit時,可以這樣寫: 129 | 130 | var testCase = require('nodeunit').testCase; 131 | module.exports = testCase({ 132 | "setUp": function(cb) { 133 | this.request = { 134 | headers: { 135 | Cookie: 'name1:val1; name2:val2' 136 | } 137 | }; 138 | this.response = {}; 139 | this.result = {name1:'val1',name2:'val2'}; 140 | cb(); 141 | }, 142 | "tearDown": function(cb) { 143 | cb(); 144 | }, 145 | "normal_case": function(test) { 146 | test.expect(1); 147 | var obj = require('./tools').cookieParser(this.request, this.response); 148 | test.deepEqual(obj, this.result); 149 | test.done(); 150 | } 151 | }); 152 | 153 | 善於利用模組,可以讓程式更好維護與測試。 154 | 155 | CPS(Continuation-Passing Style) 156 | ================================ 157 | 158 | cps是callback使用上的特例,形式上就是在函數最後呼叫callback,這樣就好像把函數執行後把結果交給callback繼續運行,所以稱作continuation-passing style。利用cps,可以在非同步執行的情況下,透過傳給callback的這個cps callback來獲知callback執行完畢,或是取得執行結果。例如: 159 | 160 | 161 | 162 | 163 | 164 | 165 | 180 | 181 | 進一步的應用,也可以參考2-6 流程控制。 182 | 183 | 184 | 函數返回函數與Currying 185 | ==================== 186 | 187 | 前面的cps範例裡面,使用了函數返回函數,這是為了把cps callback傳遞給onreadystatechange事件處理函數的方法。(因為這個事件處理函數並沒有設計好會傳送/接收這樣的參數)實際會執行的事件處理函數其實是內層返回的那個函數,之外包覆的這個函數,主要是為了利用Closure,把next傳給內層的事件處理函數。這個方法更常使用的地方,是為了解決一些scope問題。例如: 188 | 189 | 202 | 203 | 最後得出的結果會是100,而不是想像中的45,這是因為等到setTimeout指定的函數執行時,變數i已經變成10而離開迴圈了。要解決這個問題,就需要透過Closure來保存變數i: 204 | 205 | 221 | 222 | 函數返回函數的另外一個用途,是可以暫緩函數執行。例如: 223 | 224 | function add(m, n) { 225 | return m+n; 226 | } 227 | var a = add(20, 10); 228 | console.log(a); 229 | 230 | add這個函數,必須同時輸入兩個參數,才有辦法執行。如果我希望這個函數可以先給它一個參數,等一些處理過後再給一個參數,然後得到結果,就必須用函數返回函數的方式做修改: 231 | 232 | function add(m) { 233 | return function(n) { 234 | return m+n; 235 | }; 236 | } 237 | var wait_another_arg = add(20);//先給一個參數 238 | var a = function(arr) { 239 | var ret=0; 240 | for(var i=0;i 350 | function Wait(fns, done) { 351 | var count = 0; 352 | var results = []; 353 | this.getCallback = function(index) { 354 | count++; 355 | return (function(waitback) { 356 | return function() { 357 | var i=0,args=[]; 358 | for(;i 406 | 407 | 執行結果: 408 | 409 | done a 410 | done b 411 | done a 412 | done c 413 | done all. result: 3500 414 | 415 | 上面只是一些小實驗,更成熟的作品是Tim Caswell的step:https://github.com/creationix/step 416 | 417 | 如果希望真正使用同步的方式寫非同步,則需要使用Promise.js這一類的library來轉換非同步函數,不過他結構比較複雜XD(見仁見智,不過有些人認為Promise有點過頭了):http://blogs.msdn.com/b/rbuckton/archive/2011/08/15/promise-js-2-0-promise-framework-for-javascript.aspx 418 | 419 | 如果想不透過其他Library做轉換,又能直接用同步方式執行非同步函數,大概就要使用一些需要額外compile原始程式碼的方法了。例如Bruno Jouhier的streamline.js:https://github.com/Sage/streamlinejs 420 | 421 | 422 | 循序執行 423 | ------- 424 | 425 | 循序執行可以協助把非常深的巢狀callback結構攤平,例如用這樣的簡單模組來做(serial.js): 426 | 427 | module.exports = function(funs) { 428 | var c = 0; 429 | if(!isArrayOfFunctions(funs)) { 430 | throw('Argument type was not matched. Should be array of functions.'); 431 | } 432 | return function() { 433 | var args = Array.prototype.slice.call(arguments, 0); 434 | if(!(c>=funs.length)) { 435 | c++; 436 | return funs[c-1].apply(this, args); 437 | } 438 | }; 439 | } 440 | 441 | function isArrayOfFunctions(f) { 442 | if(typeof f !== 'object') return false; 443 | if(!f.length) return false; 444 | if(!f.concat) return false; 445 | if(!f.splice) return false; 446 | var i = 0; 447 | for(; i> ~/.profile 32 | echo 'export PATH=$PATH:/opt/node/bin' >> ~/.profile 33 | 34 | 重新讀取bash 35 | . ~/.profile 36 | 37 | 接著測試nodeJS 是否正常執行 38 | node --version 39 | 40 | 出現版本訊息,表示安裝成功。 41 | 42 | 其他各家Linux有套件包可使用,請參考官方安裝說明 43 | 44 | 45 | Mac OS X 46 | ========= 47 | 48 | nodeJS 在nodeJS 在v0.6.x版本之後 ,Mac 環境可以直接使用pkg 安裝包,點擊兩下之後,即完成安裝。 49 | 50 | 下載node.pkg (由官方網站) 51 | 52 | Windows(cygwin) 53 | ================ 54 | 55 | 目前NodeJS 0.4.8版本安裝方式需要透過Linux指令才能完成,執行方式如下描述: 56 | 57 | A. 執行Binary NodeJS 58 | 1. 外部善心人士已將Cygwin與NodeJS打包,成免安裝版本,至此網址下載 59 | 2. 下載後解壓縮至硬碟內,至command line即可執行。 60 | 61 | B. 使用 cygwin 編譯 NodeJS 62 | 63 | 1. 下載 cygwin。 64 | 2. 執行Setup.exe,選擇以下幾個package. 65 | Devel 66 | gcc-g++ C++ compiler 67 | gcc-mingw-g++ 68 | gcc4-g++ G++ subpackage 69 | git 70 | make 71 | openssl-devel 72 | pkg-config 73 | zlib-devel 74 | Python - install (全套件) 75 | Web 76 | wget 77 | Devel 78 | gcc-g++ C++ compiler 79 | gcc-mingw-g++ 80 | gcc4-g++ G++ subpackage 81 | git 82 | make 83 | openssl-devel 84 | pkg-config 85 | zlib-devel 86 | Python - install (全套件) 87 | Web 88 | wget 89 | TIP:git 和 wget 可只選一個安裝即可 90 | 91 | 修改此檔案 c:\cygwin\bin\rebaseall,搜尋: 92 | 93 | TmpDir="${TMP:-${TEMP:-/tmp}}" 94 | 95 | 修改如下: 96 | 97 | #TmpDir="${TMP:-${TEMP:-/tmp}}" 98 | TmpDir="/tmp" 99 | 100 | 至command line執行指令如下: 101 | 102 | c:\cygwin\bin\ash.exe rebaseall -v 103 | 104 | 最後一行結果為 105 | 106 | /usr/bin/cygz.dll: new base = 69b90000, new size = 30000 107 | rebaseall 108 | 109 | 110 | 使用 wget (v0.x.x表示版號,以官方網站為主) 111 | 112 | 113 | $ wget http://nodejs.org/dist/node-v0.x.x.tar.gz 114 | $ tar xvf node-v0.x.x.tar.gz 115 | 116 | 使用 git (v0.x.x表示版號,以官方網站為主) 117 | 118 | $ git clone git://github.com/joyent/node.git 119 | $ cd node 120 | $ git fetch --all 121 | $ git tag 122 | $ git checkout v0.x.x 123 | 124 | 編譯 125 | 126 | $ cd node 127 | $ ./configure 128 | $ make 129 | $ make install 130 | 131 | 132 | C. 使用 MinGW+MSYS 編譯 NodeJS 133 | 134 | 1. 下載MinGW 135 | 136 | MinGW的官網在: 137 | http://www.mingw.org/ 138 | 139 | 在Windows環境中使用的話,建議下載他的自動安裝程式: 140 | http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/ 141 | 142 | 從目錄中挑一個適當的版本來安裝就可以了(通常是挑最新的) 143 | 144 | 145 | 2. 安裝MinGW 146 | 147 | 先執行下載來的安裝檔: 148 | 149 | 150 | 大部分選擇預設就可以。不過在Select Components的地方: 151 | 152 | 153 | 要編譯Node,至需要基本的msys系統以及C++編譯器,所以額外選擇: 154 | 155 | 156 | 157 | 點選Install開始安裝: 158 | 159 | 160 | 接下來安裝程式會從網路上抓取要安裝的package,請耐心等待: 161 | 162 | 163 | 安裝完畢後,即可從程式選單執行msys: 164 | 165 | 166 | 執行後,就可以進入bash環境: 167 | 168 | 169 | 接下視需求決定要不要先執行一下postinstall程序(不一定需要,除非要使用之前安裝過的其他MinGW環境): 170 | 171 | 172 | 這樣,MinGW及MSYS環境就大致處理好了。 173 | 174 | 175 | 3. 下載並安裝python 176 | 177 | python的網站在: 178 | http://www.python.org/ 179 | 180 | 在windows環境安裝,只要點選左側選單中的「Windows Installer」就可以下載msi安裝檔。安裝完後,記得打開cmd console,用「path」指令確定一下,python的安裝目錄是否在其中。msys中使用的其實是這個外部的python直譯器。 181 | 182 | 183 | 4. 設定openssl目錄 184 | 185 | node與openssl-1.0.0似乎不搭,所以需要手動下載openssl-0.9.8。請到下列網址下載package: 186 | http://sourceforge.net/projects/mingw/files/MSYS/openssl/openssl-0.9.8k-1/ 187 | 188 | 需要下載的是這兩個: 189 | libopenssl-0.9.8k-1-msys-1.0.11-dev.tar.lzma 190 | libopenssl-0.9.8k-1-msys-1.0.11-dll-098.tar.lzma 191 | 在MSYS中,windows的C碟會掛載在/C目錄,而D碟會掛載在/D目錄,依此類推。假設上述兩個檔案下載後放在D:\Downloads目錄中,在MSYS中可以利用tar來安裝: 192 | 193 | 194 | 安裝過後,程式庫會安裝在/lib,標頭檔會安裝在/include/openssl...但是這樣node的編譯系統還無法辨識。 195 | 196 | 研究了一下wscript,會發現在node目錄上一層建立一個openssl目錄,然後把程式庫複製到這個目錄,把標頭檔複製到其下的include/openssl目錄,就可以順利執行./configure了。像這樣: 197 | 198 | 199 | 這個openssl目錄及檔案結構: 200 | 201 | 202 | 203 | 204 | 5. 下載node 205 | 206 | 可以直接透過nodejs.org上發布的網址下載,或是額外安裝msys-git後直接git clone(方法跟cygwin一樣)。只是解開後要編譯的node目錄,與openssl目錄的相對位置要如上所述。 207 | 208 | 209 | 6. 編譯 210 | 211 | 如果設定正確,那在node目錄中執行./configure之後看起來應該像這樣,接下來就可以執行make了: 212 | 213 | 214 | 編譯過程的畫面看起來像這樣: 215 | 216 | 217 | 編譯完成後,編譯過程中產生的檔案會放在build/default目錄中: 218 | 219 | 220 | node.exe會複製一份到node目錄中: 221 | 222 | 223 | 想要驗證一下node.exe是否可以執行,可以試跑一下make test,不過現階段大部分測試在windows環境中都會fail: 224 | 225 | 226 | 不過這樣的結果已經比前幾版好了。 227 | 228 | 229 | 7. 在windows console中執行 230 | 231 | 從nodejs.org上下載的v0.5.x可執行檔,額外靜態編譯了所有需要的程式庫到執行檔中,可以不依賴任何dll就能執行。但是自己在MinGW下編譯出來的node.exe,還是需要額外的dll檔才能在MSYS環境外執行。以node-v0.5.2為例,需要的dll檔有幾個(不同版本需要的dll可能會有不同,需要的檔案大概都是在/bin或是/mingw/bin目錄中): 232 | msys-1.0.dll 233 | msys-crypto-0.9.8.dll 234 | msys-ssl-0.9.8.dll 235 | 在MSYS中複製過來後,從windows的cmd console進來看看(假設MinGW裝在C:\MinGW,使用者的家目錄會在C:\MinGW\msys\1.0\home\使用者帳號): 236 | 237 | 238 | 接下來,只要執行 239 | 240 | node javascript檔案 241 | 242 | 就可以跑了。不過如果要當作伺服器,開啟port來監聽的話,需要有系統管理員權限。所以要先用「系統管理員權限」來執行「命令提示字元」,然後才能在console中用node.exe執行伺服器程式。 243 | 244 | Windows(native) 245 | ================ 246 | 247 | nodeJS 在v0.6.0版本之後開始正式支援windows native,直接使用node.exe 就可以執行程式,支援性完全與linux 相同,更棒的部份就是不需經過編譯,經過下載之後,簡單設定完成,立即開發node 程式。 248 | 249 | 下載node.msi (由官方網站) 250 | 251 | 點擊兩下開始安裝 252 | 253 | 如此完成windows native node.exe 安裝,接著可以進入command line 執行測試。 254 | 255 | 在command line 輸入"node",會出現如下的畫面,表示安裝完成 256 | -------------------------------------------------------------------------------- /src/nodejs_npm.rst: -------------------------------------------------------------------------------- 1 | ****************************** 2 | 套件管理(Node Package Manager) 3 | ****************************** 4 | 5 | npm 全名為node package manage,此為node module 管理包,藉由安裝npm 之後可以輕鬆使用npm install xxx 的方式安裝任意模組,安裝模式類似於gem, apt-get 方式,如此管理module 就會更加輕鬆,同時也可以查看目前module 是否為最新版本,進行module 更新。 6 | 7 | nodeJS v0.6.3之後版本開始內建npm ,已經安裝v0.6.3版本的使用者,可以不用再執行底下步驟,可以直接使用npm 安裝、移除相關module。當然有興趣自己手動安裝npm 可以查看底下文章說明。 8 | 9 | 安裝方式分別介紹linux, windows 安裝方式 10 | 11 | Linux 安裝 12 | ========== 13 | 14 | 安裝npm 之前必須安裝 curl,同時確認node 已經安裝完成,環境變數也設定完成,node 版本需為 v0.4.x 以上,底下為安裝指令。 :: 15 | 16 | curl http://npmjs.org/install.sh | sh 17 | 18 | 接著輸入指令測試 :: 19 | 20 | npm --v 21 | 22 | Windows 安裝 23 | ============ 24 | 25 | 本篇介紹如何使用node.exe (windows native)安裝npm ,node.exe 版本為v 0.6.1 ,這個版本之後已經變成安裝包,安裝完成後會自動將環境變數(environment path)設定完成,意謂安裝完成node windows 版本之後,就不需要做任何設定,進入command line 之後,立即安裝npm,輸入指令如下。 :: 26 | 27 | git config --system http.sslcainfo /bin/curl-ca-bundle.crt 28 | git clone --recursive git://github.com/isaacs/npm.git 29 | cd npm 30 | node cli.js install npm -gf 31 | 32 | PS. 目前版本只能支援手動設定環境變數,將node.exe 換到"c:\node\"路徑底下,才能順利安裝npm。 33 | 34 | NPM 指令說明 35 | =========== --------------------------------------------------------------------------------