← Byte Programmers Cookbook 1994

Byte Programmers Cookbook 1994

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

Osborne BYTE PROGRAMMER'S COOKBOOK Secret Recipes for the Serious Code Chef MAC Rob Terrell INCLUDES 3.5" DISK 1010001 01010111 010 11010011 0

A book cover with a yellow and red background, a wrench and pencil over a red-lipped mouth collage, binary digits, a banana peel, large letters spelling MAC, and a black curved banner with the subtitle.

Reading notes: Author name 'Rob Terrell' is partly cut off at the left edge, so the first letter is partially visible and was read as 'Rob' with uncertainty. Small text on the wrench and the small 'Osborne' logo mark beside it are not fully legible. Binary digit lines are partly faded and the reading of the final characters is approximate. The 'MAC' letters are displayed as large stylized forms; the transcript records them as MAC from the visual arrangement.

Printed product names
BYTE · Mac
Languages
English
PDF page 1

BYTE PROGRAMMER'S COOKBOOK

Osborne BYTE PROGRAMMER'S COOKBOOK Secret Recipes for the Serious Code Chef MAC Rob Terrell INCLUDES 3.5" DISK

A red and yellow book cover with a large white BYTE logo, a stylized red mouth with teeth, a wrench, a pencil, a banana peel, binary digits, and large letters M, A, C spelling MAC across the bottom.

Reading notes: The author name 'Rob Terrell' is partially cut off at the left edge, shown as 'ob' and 'errell'; the full name is inferred from the partial text and should be checked. The 'Mac' letters at the bottom are large graphic letterforms, so 'MAC' is read from the shapes rather than set as small text. The Osborne/McGraw-Hill style logo at top right has tiny fine print that is not legible.

Printed product names
BYTE Programmer's Cookbook · Mac
Languages
English
PDF page 2

BYTE'S Mac Programmer's Cookbook

BYTE'S Mac Programmer's Cookbook Rob-Terrell Osborne McGraw-Hill Berkeley· New York· St. Louis • San Francisco ·Auckland Bogota • Hamburg • London • Madrid • Mexico City • Milan Montreal • New Delhi • Panama City· Paris • Sao Paulo Singapore • Sydney ·Tokyo • Toronto

Reading notes: Transcript is intentionally empty because the exact extracted text is preserved separately. The supplied copy appears to be a book title page rather than an advertisement, so no advertised products or prices are listed. The author line reads 'Rob-Terrell' with a hyphen, which may be a line-break artifact of 'Rob Terrell'. Layout, colors, and artwork were not verified from the image and are inferred only from the supplied copy.

Languages
English
PDF page 3

BYTE's Mac Programmer's Cookbook

Osborne McGraw-Hill 2600 Tenth Street Berkeley, California 94710 U.S.A. For information on software, translations, or book distributors outside of the U.S.A., please write to Osborne McGraw-Hill at the above address. BYTE's Mac Programmer's Cookbook Copyright © 1994 by McGraw-Hill, Inc. All rights reserved. Printed in the United States of America. Except as permitted under the Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher, with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced for publication. 234567890 DOC 9987654 ISBN 0-07-882062-6 Publisher Lawrence Levitsky Acquisitions Editor Scott Rogers Project Editor Cindy Brown Computer Designer Peter F. Hancik Illustrator Marla Shelasky Series Design Ruffin Prevost Cover Designer Jamie Davison Design, Inc. Information has been obtained by Osborne McGraw-Hill from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Osborne McGraw-Hill, or others, Osborne McGraw-Hill does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information.

Printed dates
1994 · 1976
Languages
English
PDF page 4

The image is a entirely blank white page with no visible artwork, layout, or text.

Reading notes: No visible text or graphics appear anywhere on the page, so all printed fields are empty.

PDF page 5

Contents At a Glance

Contents At a Glance Part I: The Easy Stuff 1: Tricks of the Trade: Secrets of the Shadow Warriors • • • • . • . . • • • . 3 2: Getting the Goods • • • • • • • . . . . • • • • • . . . . • . • . • • • . • • • • . . . . . • • • 13 3: Trouble in Hacksville: When Good Macs Go Bad • • • . • • • • • • • • • • . . 27 4: Altering Reality: Utilities for a Better Life • • • . • . . . . • • • • • . • • • • • • 43 Part II: The Hard Stuff 5: External Commands: Help for the Working Stiff . . . . . . . . . . . . • . . . 79 6: Ciphers and Secret Messages: Programming Languages • • • • • • • • • 111 7: Object Libraries, Class Libraries, and You • • • • • • • • . • . • . • • • • • • • • 125 8: The Zen of Good Code: Debuggers • • • • • • . . . • • • • • . • • • • . . . . • • • • 149 Part Ill: The Extra Stuff A: How to Make a Million Bucks in Shareware • • • . . . . • • • • • • . . • • • • 167 B: Try 'em Out for Size: Exploring the Disk • • • • • • • • • • . • • • • • • • • • • • • 175 C: It Came From the Internet, Kinda • • • • • • • • . • • • • • • . • • • • • • • • • .. • 183 D: Local Heroes . • . • • • • • • • • • • • • • • • • . . • • • • • • • • • • . • • • • • • • • • • • • 221 Index . • • . . • • . • • • • • . . . . • • • • • • • • • . . • . • • • • . . . . • • . . . • . • • • . • 235

Reading notes: Chapter and page numbers are partially garbled by spacing and bullet characters.

Languages
English
PDF page 6

Contents Acknowledgments • • • • • • • • • • • • • • • • • • xiii Part I: The Easy Stuff 1: Tricks of the Trade: Secrets of the Shadow Warriors . . . . . . . . . . . . . . . . . 3 The Mac Hacker Culture . . . . . • . • • • • • • • • • • . • • . . • . • • • • • • • • • • • . • • 4 Never Underestimate the Power of Hacks • • • . • • • • • • • • • • • • • • • • • . • • 5 What the Heck Is a Hack? • • . • • • • • • • • • • • • • • • . • • • • • • . . • • • • • • . • • 6 The Good, the Bad, and the Ugly • • • • • • • . . • . . . . • • . • • • • . • • 6 Whither Hack? . • • • . • • • • • • • • • • • • • • • • . • • • • • • • • • • • • • • • • 8 I've Never Paid for It in My Life • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 10 The Cookbook Manifesto • • • . • . • • • • • • • • • • • • • • • • • • • • . . . . . • • • • • • 11 Coming Up Next . . • • • • • • • • • • • • • • • • • • • • • • • • • • • • • . • • • . . . • • • • • • 12 2: Getting the Goods . . . . . . . . . . . . . . . . . 13 Once Upon a lime in the Net . • • • • • • • • • . • • • • • • • • • • . • • . . . • • • • • • • 13 Online Services and the Single Hacker • • . • • • • • • • • • • • • • . . • • • • • • • • 15 Cyberspace on Less Than $25 a Month • • . • • • • • • • • • • • • • . • . • • • • • • • 18 How to Make Smartfriends and Influence People • • • • • • . . • • . . . . • • • 19 The Quest for Shareware • • • • • • • . • • • • . . . • • • • • • • • • • . • • • . • • • • • • • 21 Netsurfing USA . . • • • • • . . . . • • • • • . • . • . . • • • • • • • • • • • • • • • • • • • . • • • 22 WAIS Servers • • • . . • . . . • • • • • • . • . . • • . . . . • • • • • • • • • • • • • • 23 The Shareware Tool Chest . . . . • • • • • . . • . • • • • • • • • • • • • • • • . . . . . . • • 24 Coming Up Next: Crash, Bam, Thank you, Man • • • . • . . • . • • • • • • • • • • • 25

Reading notes: Contents page is a table of contents with dot leaders; headline is not a primary heading.

Printed prices
$25
Languages
English
PDF page 7

Trouble in Hacksville: When Good Macs Go Bad

3: Trouble in Hacksville: When Good Macs Go Bad ••••.•••.••..•••••• ~ • 27 Dodging the Bullet • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 28 Extensions from Hell land How to Deal with Theml • • • • • • • • • • 28 Mo' Me11a..,. • . • . . . . • • . • . • • • • . . . . . • . • . . . . • . . • • • • • • • • • 30 Crawl ta the Mirage • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 32 Patching Traps and Other Scary Stuff • • • • • . . . . . . • . . . . . . • • • • • • • • • • 34 The Moral of Ille Stoll' • • • • • . . . . . • • . . . . . • . . . . . . . • . . • . . . • • • • • . . . 3!i Passing the test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Macsbug, the Wonder Drug • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 36 In the hnches with Macsbug, Part I • • • • • • • • • • • • • • • • • • • • • 37 In the hnches with Macsbug, Part II • • • • • • • • • • • • • • • • • • • • 39 Prevention Is the Cure • • • • • • • • • • • • • • • • • • • • • • • • . • • • • • • • • • • • • • • • 48 Crash and Burn • • • • . • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 41 Coming Up Next Shareware-at-Large • • • • • • • • • • • . • • • • • • • • • • • • • • • 42 4: Altering Reality: Utilities for a Better Life ••.••••••••••••••••••••••••• 43 Utilities far a Better Life • • • • • • • • • • • • • . • • • • • . . . • • • • • • • . • • • • • ". • • 43 The &loves Co11e Off . • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 41 BaseToBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 7 AppDisk ...................... · ............ 47 BBEdit Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 BNDL Banger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 ConvertProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 CodeSucker . . . . . . . . . . . . . . . . . . • . . . . . . . . . . . . . 53 CopyRGB ................................. 54 Ctools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 DarkSide of the Mac . . . . . . . . . . . . . . . . . . . . . . . . . 56 FileBuddy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 7 Global Variables Viewer . . . . . . . . . . . . . . . . . . . . . . 58 Referential Expansion . . . . . . . . . . . . . . . . . . . . . . . . 59 PRAM ..................................... 60 RIPEM Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 ROMmie ................................... 65 ScriptGen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Task-It .................................... 69

Reading notes: Table of contents with dot leaders; some entries contain OCR-like character errors (e.g., 'Mo' Me11a', 'hnches', 'Stoll') Reading order of the contents list is uncertain, and some page numbers are garbled

Printed product names
BaseToBase · AppDisk · BBEdit Lite · BNDL Banger · ConvertProjects · CodeSucker · CopyRGB · Ctools · DarkSide of the Mac · FileBuddy · Global Variables Viewer · Referential Expansion · PRAM · RIPEM Mac · ROMmie · ScriptGen · Task-It · Macsbug
Languages
English
PDF page 8

Hell's Programmer Font . . . . . . . . . . . . . . . . . . . . . . 71 WindowShade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 ZoneRanger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Coming Up Next-Getting External ••••••• ·• • • • • • • • • • • • • • • • • • • • • • • 75 Part II: The Hard Stuff 5: External Commands: Help for the Working Stiff . • • . • • . • • • • . • • . . . . • • 79 Volksware: HyperCard, 40, and So Forth • • • • • • • • • • • • • • • • • • • • • • • • • 81 Mac-Crazed Univenity + Cheap student labor = Externals with Zing! • • • • • • • • • • • • • • • • • • . • • • • • • • • • • • • 83 Developer Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 TiffWindow XCMD . . . . . . . . . . . . . . . . . . . . . . . . . . 92 MikePack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 X-Archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Bet Ya Can't Pick Just One • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 97 X Marks the Spot • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 1 DO JSrson's XCMDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 X Marks the Spot • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 103 One Caveat • • • • • • • • • • • • • • • • • • • ·• • • • • • • • • • • • • • • • • • • • • • 104 OSAX and the Single Hacker • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 104 GTQ Scripting Library . . . . . . . . . . . . . . . . . . . . . . . 105 &reg Brady- Surfboard + AppleScript = &reg Quinn? You Decide! ••••••••••••••••••••• ~ • • • • • • • • • • • • • .• • • 107 Coming Up Next-Building with Blocks • • • • • • . • • • • • • • • • • • • • • • • • • 109 6: Ciphers and Secret Messages: Programming Languages • . • . . • • . • • 111 &o Forth Young lad • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 112 Neon Fades On • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 113 Yerk ..................................... 114 MOPS .................................... 114 PocketForth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Usp • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 117 PowerLisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

Reading notes: Table of contents text contains OCR-like damage (e.g., 'Univenity', '&o Forth', '&reg Brady') and uncertain characters. Heading and entry reading order is ambiguous in places; some entries are split across lines. 'Univenity' and '&reg' tokens are uncertain and may not reflect the printed spelling.

Printed product names
HyperCard · TiffWindow XCMD · MikePack · X-Archive · GTQ Scripting Library · PocketForth · PowerLisp · WindowShade · ZoneRanger · Hell's Programmer Font · OSAX · MOPS · Yerk · Usp
Languages
English
PDF page 9

Swimming in the Shareware C • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 111 GCC .................................... 120 Harvest C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Coming Up Next: Putting the Pieces Together • • • • • • • • • • • • • • • • • • • • • 124 7: Object Libraries, Class Libraries, and You •••••••.•••••••••••••••• 125 Uving in Object Poverty • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 127 The ROM Mm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 TransSkel (C version) . . . . . . . . . . . . . . . . . . . . . . . 130 TransSkel (Pascal version) . . . . . . . . . . . . . . . . . . . . 130 Mercutio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Seeking the Source • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 133 clut_fade 1.0 • . . . . . . • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Huffman Eumple • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 134 launchfile XCMD Source • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 134 POV 3.0, Rrrace 1.0 . • • . . . . • • • . • • • . . . . . . . . . . . . . . . . . . . . 134 PwrSwill:her . . • . • • • . • . . . • • • • • • . . • • • • . . . . . . • • • • • • • • • 134 tie Example . • • • . . . . • . • • . . . . . . . . . . . . . . . • . . . . . . . . . . . 134 Writeswll Jr • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 135 Use that Usenet • . . . . • • • • • . . . . . • • • . . • . . • . . . . . . . . • • . • • • . . . . . . 135 Toolbar manager . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Vaccinate Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7 Graphllb .......................... .- . . . . . . 139 TE32K ................................... 139 Battle af Ille Sprites • • • . . . . . • . . . . . . . . . . • . . • • • • • • • • . . . • • • • . • . 148 SpriteWorld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 SAT ..................................... 144 Thinking Objectively: TCL Clams • • • • • • • • • • • • • • • • . • • • • • • • • • • • • • 146 Coming Up Next: From Theory to Reality • • • • • • • • • • • • • • • • • • • • • • • • 148 8: The Zen of Good Code: Debuggers • • • • 149 Slinking Inside the Heart of the Machine • • • • • • • • • • • • • • • • • • • • • • • • 150 The Big Picture: Memory • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 150 Swatch ................................... 150 Ramadillo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Debug Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Reading notes: Source is a table of contents with dot leaders and spaced characters; headline not identifiable as a primary heading. Several OCR-like character errors (e.g., 'Uving', 'Mm', 'Eumple', 'Rrrace', 'PwrSwill:her') may be damaged or misread.

Languages
English
PDF page 10

Programmer's Key . . . . . . . . . . . . . . . . . . . . . . . . . . I 54 System Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I 5 5 The low End Theory: Debuggers • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 156 ABZMon .................................. 156 Adding to Macsbug • • • • • • . . . • . • • • • • • • • • • • • • • • • • • • . . . • • • • • . • • 159 The Ari of Debugging • • • • • • . • . • • • • • • • • • • • . • • • • • • • • • • • • . . • • . • • 163 Part Ill: The Extra Stuff A: How to Make a Million Bucks in Shareware . . . . . . . . . . . . . . . . . . . . . 167 Readme the Right Way • • • • • • • • • • • • . • • • • • • • • • • • • • • • . • • • 169 Testlike the Wind • . • • • • • • • . . • • • • • • • • . . • • • • • • • • • • • • • • • 170 Call the Exterminator . • • • • • • • • • • • • . • • • • • • • • • . . • • • • • . • • • 170 If You love Something, Set It Free • • • . • • • • • • • • • • • • • • • • . • • • 171 A Gentle Prodding vs. a Cattle Prod • • • • • • • • • • • • • • • • • • • . . • . 171 Collecting the loot . . • • • • • • • . • . • • • • • • • • • • . . . . • • . • • • . • • . 172 The Final 10 Percent • . • • • • • . • • . • . . . • • • • • . • • • • • . . • • . • • • 173 B: Try 'em Out for Size: Exploring the Disk . . . . . . . . . . . . . . . . . . . . . . . . . . 175 To Install the Programs • • • • • • • • • • • • • • . • • • • • . . • • • • • • • • • • • • • • • 175 To Use the Programs • • • . • • • • • • • • • • • • • • • • • • • • • • . . • • • • • • • • • • • • 176 The Programs • • . • • . • • • . . • • • • • • • • • • • • • • • • • • • • • • . . . • • • . • • . . . 176 C: It Came From the Internet, Kinda . . . . 183 D: Local Heroes . . . . . . . . . . . . . . . . . . . . 221 Index . . . . . . . . . . . . . . . . . . . . . . . . . 235

Reading notes: Table of contents with dot leaders and OCR-like spacing; some entries are garbled (e.g., 'ABZMon', 'The Ari of Debugging', 'I 54', 'I 5 5'). Some page numbers and section titles may be misread due to damaged characters.

Printed product names
Macsbug
Languages
English
PDF page 11

Acknowledgments Thanks to Bob and Nancy Terrell, from whose computer store I stole most of my programming books from while just a wee tot, and whose customers taught me how to program while the other kids were outside getting fresh air and sunshine. Heartfelt thanks to friends who made the grueling work of writing this book almost fun. To Jason Torchinsky, Kat Cook, and Charlie McGrath for the read-throughs, late-night Waffle House sessions, and the seemingly endless supply of caffeine and the occasional beer that helped me get through. at Osborne: Scott Rogers, who hated playing the heavy as much as I hated playing the heavied. You're a much nicer guy than your receptionist had led me to believe. Larry Levitsky, who believed in this project from the outset and is a great guy to boot. Cindy Brown, who made sure my writing didn't betray my apparently near-total ignorance of proper English diction. Thanks to folks who don't even know me: To David Smith, for putting out such a cool magazine-MacTutor-for so , long. To Scott Boyd, whose articles in the early MacTutor taught me more about good programming than any of the classes I ever took. To Andy Hertzfeld, who treated me like a human being when at the age of 14 I asked him stupid questions on the MacWorld show floor. And all the other Mac gurus who never failed to supply wisdom in a moment of need. A special thanks goes out to the members of the Van Gogh-Goghs, the sketch comedy troupe I'm a member of. While we never canceled a show due to this book, I was certainly less funny and more cranky. xiii

Reading notes: Printed page number 'xiii' appears at the end; the age '14' is a printed number, not a date.

Printed product names
MacTutor · MacWorld
Printed dates
14
Languages
English