From: pottier@clipper.ens.fr (Francois Pottier) Subject: csmp-digest-v3-023 Date: Wed, 4 May 94 12:25:07 MET DST C.S.M.P. Digest Wed, 04 May 94 Volume 3 : Issue 23 Today's Topics: CCollaborator bug Embedding PICTS in TextEdit? How did YOU learn to program? How do I get machine-user name? How to: Aladdin-aware ResEdit (was Re: ResEdit + dctb = ID=01?) Window -> PICT question The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier (pottier@clipper.ens.fr). The digest is a collection of article threads from the internet newsgroup comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi- regularly and want an archive of the discussions. If you don't know what a newsgroup is, you probably don't have access to it. Ask your systems administrator(s) for details. If you don't have access to news, you may still be able to post messages to the group by using a mail server like anon.penet.fi (mail help@anon.penet.fi for more information). Each issue of the digest contains one or more sets of articles (called threads), with each set corresponding to a 'discussion' of a particular subject. The articles are not edited; all articles included in this digest are in their original posted form (as received by our news server at nef.ens.fr). Article threads are not added to the digest until the last article added to the thread is at least two weeks old (this is to ensure that the thread is dead before adding it to the digest). Article threads that consist of only one message are generally not included in the digest. The digest is officially distributed by two means, by email and ftp. If you want to receive the digest by mail, send email to listserv@ens.fr with no subject and one of the following commands as body: help Sends you a summary of commands subscribe csmp-digest Your Name Adds you to the mailing list signoff csmp-digest Removes you from the list Once you have subscribed, you will automatically receive each new issue as it is created. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest. Questions related to the ftp site should be directed to scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP digest are available there. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src. ------------------------------------------------------- >From jafl@cco.caltech.edu (John Lindal) Subject: CCollaborator bug Date: 18 Apr 1994 20:50:46 GMT Organization: California Institute of Technology, Pasadena I just found a really nasty bug in CCollaborator: CCollaborator::DependUpon first line should be: if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return; This prevents providers from appearing multiple times in the list! John Lindal +++++++++++++++++++++++++++ >From u9119523@sys.uea.ac.uk (Graham Cox) Date: Tue, 19 Apr 1994 11:09:32 GMT Organization: School of Information Systems, UEA, Norwich In article <2ourr6$ane@gap.cco.caltech.edu>, jafl@cco.caltech.edu (John Lindal) wrote: > I just found a really nasty bug in CCollaborator: > > CCollaborator::DependUpon > > first line should be: > > if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return; > > This prevents providers from appearing multiple times in the list! > > John Lindal Ah, that explains it! Thanks- this one was really pissing me off, having to call CancelDependency before DependUpon every time- just in case. - ------------------------------------------------------------------------ Love & BSWK, Graham -Everyone is entitled to their opinion, no matter how wrong they may be... - ------------------------------------------------------------------------ +++++++++++++++++++++++++++ >From u9119523@sys.uea.ac.uk (Graham Cox) Date: Tue, 19 Apr 1994 11:10:37 GMT Organization: School of Information Systems, UEA, Norwich In article <2ourr6$ane@gap.cco.caltech.edu>, jafl@cco.caltech.edu (John Lindal) wrote: > I just found a really nasty bug in CCollaborator: > > CCollaborator::DependUpon > > first line should be: > > if (itsProviders && itsProviders->FindIndex(aProvider) > 0) return; > > This prevents providers from appearing multiple times in the list! > > John Lindal Another thing I found, though this may have been fixed since v1.1, which I am using, is that the 'reason' code gets truncated to a short somewhere between BroadcastChange and ProviderChanged. This doesn't really cause a problem if you use the numbering scheme that THINK specify for reason codes, but I use four character strings as reason codes (I think this is much neater- easier to remember and much easier to keep unique) so it was a problem for me. The offending bug is caused somewhere in the bowels of the CCollaborator code, which defines a temporary struct called (I think) tInfo. Change the type of the reason field from short to long and all is well. On a general note, I wonder just how acceptable it is that this stuff is occasionally a bit sloppy? For example, the CStdPopUpPane object is very poor- I had to rewrite lots of it to get it to work the way I expected it to. Another slap on the wrist for Symantec??? - ------------------------------------------------------------------------ Love & BSWK, Graham -Everyone is entitled to their opinion, no matter how wrong they may be... - ------------------------------------------------------------------------ --------------------------- >From u9119523@sys.uea.ac.uk (Graham Cox) Subject: Embedding PICTS in TextEdit? Date: Tue, 19 Apr 1994 11:20:34 GMT Organization: School of Information Systems, UEA, Norwich I want to embed a PICT in TextEdit automatically. The idea I have is to use an obscure char to indicate that I want a picture, followed maybe by its resource ID. When I call DrawText or TEUpdate I want to trap this special char by putting in a stdText bottleneck, load the picture and draw it, then make sure that the following text goes after the picture. Is this a feasible approach? Has anyone achieved anything like this using TextEdit- if so is there any sample code kicking about anywhere? -Tanx a lot. - ------------------------------------------------------------------------ Love & BSWK, Graham -Everyone is entitled to their opinion, no matter how wrong they may be... - ------------------------------------------------------------------------ +++++++++++++++++++++++++++ >From Philippe.Casgrain@univ-rennes1.fr (Philippe Casgrain) Date: Tue, 19 Apr 1994 17:29:20 +0100 Organization: Universite de Rennes-1, Fac. de medecine dentaire In article , u9119523@sys.uea.ac.uk (Graham Cox) wrote: > I want to embed a PICT in TextEdit automatically. The idea I have is to use > an obscure char to indicate that I want a picture, followed maybe by its > resource ID. When I call DrawText or TEUpdate I want to trap this special > char by putting in a stdText bottleneck, load the picture and draw it, then > make sure that the following text goes after the picture. Is this a > feasible approach? Has anyone achieved anything like this using TextEdit- > if so is there any sample code kicking about anywhere? That's almost exactly the way TeachText does it: when it sees an "option-space" in the text, it takes the first PICT resource it finds in the resource fork of the document and displays it, then resumes printing the text. When the next option-space comes along, TeachText displays the second PICT, and so on... So yes, i't been done before (TeachText uses TextEdit, how about SimpleText?), but I doubt the source to TeachText is available. There might be a snippet on ftp.apple.com, though. Philippe -- Philippe.Casgrain@univ-rennes1.fr, Mac Hacker Lite Sirius Cybernetics Corporation +++++++++++++++++++++++++++ >From thundero@news.delphi.com (THUNDERONE@DELPHI.COM) Date: 20 Apr 1994 04:19:51 -0000 Organization: Delphi Internet Services Corporation u9119523@sys.uea.ac.uk (Graham Cox) writes: >I want to embed a PICT in TextEdit automatically. The idea I have is to use >an obscure char to indicate that I want a picture, followed maybe by its >resource ID. When I call DrawText or TEUpdate I want to trap this special >char by putting in a stdText bottleneck, load the picture and draw it, then >make sure that the following text goes after the picture. Is this a >feasible approach? Has anyone achieved anything like this using TextEdit- >if so is there any sample code kicking about anywhere? Don't use stdText. That's both overkill and unnecessarily complicating things, and would also screw up hit-testing, if you could get it to work. What you want to do is p=TEGetPoint(offsetintotext), create a rectangle based on p, and draw the picture in that rectangle whenever you call TEUpdate(). Chris +++++++++++++++++++++++++++ >From oberst@gov.nt.ca (David Oberst) Date: Thu, 21 Apr 1994 00:00:40 GMT Organization: Government of the NWT, Canada Re: earlier messages about including PICTs in a TextEdit, and "the source to TeachText" not being available. True, but there is a shareware text editor out there called TexEdit (now in version 2.3.1, which now opens up TeachText files, including the pictures. The author offers to send the Pascal source via snail mail for $5 and a SASE. BBEdit is available in the Infomac archives (text directory, I think), and the author gives an email handle of tombb@aol.com David Oberst/GNWT Bureau of Statistics/Yellowknife, NWT, Canada +++++++++++++++++++++++++++ >From markhanrek@aol.com (MarkHanrek) Date: 20 Apr 1994 16:59:02 -0400 Organization: America Online, Inc. (1-800-827-6364) >I want to embed a PICT in TextEdit automatically. The idea I have is to use >an obscure char to indicate that I want a picture, followed maybe by its >resource ID. When I call DrawText or TEUpdate I want to trap this special >char by putting in a stdText bottleneck, load the picture and draw it, then >make sure that the following text goes after the picture. Is this a >feasible approach? Has anyone achieved anything like this using TextEdit- >if so is there any sample code kicking about anywhere? Locate a copy of "ShowHelp 2.0" which implements teachtext style text and graphics in a help window. There you will find the source code that does it, and also learn about a problem that has to do with updating, scrolling, nad the hilite color ( as I recall ). I know "ShowHelp 2.0" is on AOL. Mark Hanrek +++++++++++++++++++++++++++ >From dowdy@apple.com (Tom Dowdy) Date: Mon, 25 Apr 1994 19:31:05 GMT Organization: Apple Computer, Inc. In article , Philippe.Casgrain@univ-rennes1.fr (Philippe Casgrain) wrote: > That's almost exactly the way TeachText does it: when it sees an > "option-space" in the text, it takes the first PICT resource it finds in > the resource fork of the document and displays it, then resumes printing > the text. When the next option-space comes along, TeachText displays the > second PICT, and so on... > > So yes, i't been done before (TeachText uses TextEdit, how about > SimpleText?), but I doubt the source to TeachText is available. There might > be a snippet on ftp.apple.com, though. SimpleText uses a similar mechanism, although it was slightly modified due to one basic problem with this approach -- it's not very international friendly. TeachText/SimpleText use the non-breaking space character, which works well for the roman script system, but not for most double byte (and some other single-byte) script systems. As a result, SimpleText has to have localization strings to allow for the use of other characters in these script systems -- but this means that documents aren't portable across various localized versions of SimpleText. A better way is to key off of some other unused attribute (such as the color of the text) rather than the actual character content. However, this level of change couldn't be done for this version of SimpleText due to the need to be backwards compatible with documents from previous versions of TeachText. I'd recommend that other folks store the PICT information separatly and not rely on the *content* of the strings for positioning information. In that way, you can read in the document on any localized version of your application and convert into the appropriate text-edit trick you wish to use -- but not actual store this hacked-up-data as part of your document format. -- Tom Dowdy Internet: dowdy@apple.COM Apple Computer MS:302-3KS UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy 1 Infinite Loop AppleLink: DOWDY1 Cupertino, CA 95014 "The 'Ooh-Ah' Bird is so called because it lays square eggs." +++++++++++++++++++++++++++ >From walkerj@math.scarolina.edu (Jim Walker) Date: 19 Apr 1994 16:34:27 GMT Organization: University of South Carolina - Columbia - Computer Science The TeachText method is what I used in my Show_help code, available by ftp from bigbird.csd.scarolina.edu, pub/mac. -- -- Jim Walker USC Dept. of Math. walkerj@math.scarolina.edu --------------------------- >From rblaine@tiac.net (Russ Blaine) Subject: How did YOU learn to program? Date: 18 Mar 1994 00:03:19 GMT Organization: The Internet Access Company How did you learn to program? Did you take a class? Teach yourself with a book? Become an apprentice, or what? Just a general question directed to all members of the programming community, out of curiosity. I'm teaching myself (well, trying..) to program C using a book, its not too bad... - ->Russ |----------------------------------------------------------------------| | rblaine@max.tiac.net | |----------------------------------------------------------------------| LAWYER: How did you happen to go to Dr. Cherney? WITNESS: Well, a gal down the road had had several of her children by Dr. Cherney, and said he was really good. +++++++++++++++++++++++++++ >From greer@utdallas.edu (Dale M. Greer) Date: 18 Mar 1994 18:05:09 GMT Organization: The University of Texas at Dallas Russ Blaine (rblaine@tiac.net) wrote: > How did you learn to program? Did you take a class? Teach yourself > with a book? Become an apprentice, or what? > Just a general question directed to all members of the programming > community, out of curiosity. I'm teaching myself (well, trying..) > to program C using a book, its not too bad... I took one class in FORTRAN because it was required for physics majors. This was just an introductory class, and I didn't really learn much about real programming. After that I just taught myself the rest of FORTRAN, then BASIC, Z80 assembler, C, 8086 assembler, FORTH, 68000 assembler, C++, etc. With FORTRAN, I learned from books and other people at the university. After that, learning the rest was fairly easy. Programming is programming. -- Dale Greer, greer@utdallas.edu "You can't just wake up and kiss the mirror and say 'I'm so purdy, I think I'll run for Governor.'" - Texas Gov. Ann Richards +++++++++++++++++++++++++++ >From markhanrek@aol.com (MarkHanrek) Date: 18 Mar 1994 13:14:02 -0500 Organization: America Online, Inc. (1-800-827-6364) It was simple. I downloaded every cotton-pickin' piece of software that included C source code (C in my case) and compiled it. The process of figuring out how that is done, and why these programs fail and learning to fix them, and why you know YOU don't want to write programs THAT way, :) is an excellent way to learn. The important thing here is that you learn by performing an activity that is engaging, and is never overwhelming, and gives you a more frequent sense of gratification, because you will only be trying to make little improvements to a program here and there, and the next thing you know... When one learns to program, one is usually learning TWO languages, the traditional language, like C or Pascal, and also the Mac Toolbox (by far more complex and potentially daunting). Having fun, and maintaining interest, and SPENDING THE TIME IT TAKES, is essential to being able to reach a point of being "capable" -- roughly a man-year after you start ( though you can be instantly productive ). Other than every piece of source code, get every bit of info, and access to as many resources as possible, and make friends with other programmers. Saving time is critical to success. Have fun. Mark Hanrek +++++++++++++++++++++++++++ >From Chuck Simciak Date: Fri, 18 Mar 1994 22:36:31 GMT Organization: Cleveland Clinic Foundation In article <2mar47$78l@sundog.tiac.net> Russ Blaine, rblaine@tiac.net writes: >How did you learn to program? Did you take a class? Teach yourself >with a book? Become an apprentice, or what? > >Just a general question directed to all members of the programming >community, out of curiosity. I'm teaching myself (well, trying..) >to program C using a book, its not too bad... I started out by teaching myself AppleSoft (Basic) on an Apple 2+. I tried to move on to Pascal but lost interest after a while. Then for college I had to learn Pascal, and as I shifted over to a computer science major took classes which introduced me to C and Prolog, and a little bit of object oriented programming and 68000 assembly. So far the most important things that I learned did not come from a book. "What makes up good programming Style?". Such as using a format for naming variables, strategies for breaking down problems into reusable code segments, that sort of thing. later.... Chuck Simciak !"The broken image of Man moves in minute by minute wxs@po.cwru.edu ! and cell by cell.... Poverty, hatred, war, police- simciac@ccsmtp.ccf.org ! criminals, bureaucracy, insanity, all symptoms of WRUW 91.1 FM Cleveland ! The Human Virus." - William S. Burroughs +++++++++++++++++++++++++++ >From kaufman@Xenon.Stanford.EDU (Marc T. Kaufman) Date: 19 Mar 1994 01:20:39 GMT Organization: Computer Science Department, Stanford University. In article <2mar47$78l@sundog.tiac.net>, Russ Blaine wrote: >How did you learn to program? Did you take a class? Teach yourself >with a book? Become an apprentice, or what? I went over to the campus computer center. The director said: "This is the manual, and that is the ON switch. When you turn it off, let the drum cool down for at least 5 minutes before turning it on again. Goodby." That machine was a Royal-McBee LGP-30. That's how it was done in those days. When the center got a new machine, you went out and got a new hardware manual. Eventually you graduated to the Burroughs 220, the IBM 1401, the 709... Marc Kaufman (kaufman@CS.Stanford.edu) +++++++++++++++++++++++++++ >From bsc@oui.com (Bill Stewart-Cole) Date: 18 Mar 1994 20:30:05 -0600 Organization: Odyssey Ultraware Inc St Louis, MO Russ Blaine asks: > How did you learn to program? Did you take a class? Teach yourself > with a book? Become an apprentice, or what? Here's a oddball story... In 8th grade Algebra our text included some BASIC. It wasn't covered in class, and in 1977-78 there was no computer in the school system outside from some IBM big iron at the central office chugging out grade info... But I read it and learned a little. In HS a few friends had Apples and commies, but my exposure was VERY limited. There was some oddball mini at school but as a quasi-jock I chose swimming and water polo over the computer club, and no coach in the USA would consider allowing one day per fortnight off prractice for some geek club... In college I had a part-time job in the library, 82-84. My boss had taken a BASIC course and had written a little database running interpreted for managing the filling out of incomplete serial volumes. On a Honeywell DPS8. I read the BASIC docs at the Computer Center, lied about my abilities, compiled the thing and impressed her with the speed boost. I spent many months teaching myself BASIC and the timesharing OS (I want to say GCOS.... but my memory is chancy and imperfect) while refining the program. I proceeded to carelessly take advantage of sieve-like security so I had room to code and play in, and got bit by a malicious hacker... I was one of many rogues briefly blamed for a serious malicious crack. Lost access, lost any hope of access there. got some time in as well on a TRS-80 running Xenix (no kidding...4 10Mb drives each the size of a AT case) Changed schools, changed majors, took a basic 'Systems and Data Processing' course that had some psuedo-assembly and pascal, plus was on a BITNET-linked machine (WOW!) and was VERY interested. Got a used commie and 300bps modem for it and worked from home(!) I was awed by the Mac. I saw it and my first thought was how silly my coding was compared to the guys who made this beastie run like this. but in 86 I got access to the one Plus at my new college, and bought a cheap copy of Turbo Pascal that I surreptitiously brought in and used. Coded some wierd stuff... Figured out Mac programming from the TP manual and bookstore sessions with IM. Taught myself the Pascal I had a taste of earlier along with the Mac coding paradigm. Hacked an interface to _Launch even though the IM1-4 docs on it were lousy, and TP ignored it. Coded a starchart plotter as an astronomy class project and got an A for the course even though the rest of my work was careless or missing. (lazy I am) After a year computerless after college, and 3 years doing unrelated work, I chucked a job I would never have been fired from mid-recession (91) and started coding and consulting for the Mac freelance. I took a Unix C course because I had to get a few hours of college CS anyway, and I haven't touched Pascal in over 18 months. Maybe CodeWarrior will get me back to it... Basically I taught myself Pascal with a little VERY basic background and some self-taught BASIC. I picked up C very fast because of the Pascal background (C is Pascal abbreviated and without a net.... or at least more like Pascal than either is like the BASIC I learned) You CAN teach yourself to program. On the Mac you really should have Inside Mac. Pascal is easier to teach yourself than C, because it will catch your goofs instead of letting you do stuff that is a little off (like treating a handle as a pointer... ) C++ (or and OOP system) is easy to learn if you know the base language and have an open minhd. It may even be easier to learn from scratch since you won't have to unlearn anything. +++++++++++++++++++++++++++ >From kenlong@netcom.com (Ken Long) Date: Mon, 21 Mar 1994 03:44:00 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) Learning how to program, and learning how to learn how = two separate things. When I got my first computer that was current - a Mac 512 (wasn't even all that current, but worked) - I was interested in learning to program but had no idea how to start, and no one to ask about it. I got no manual with that Mac and learned the entire Mac interface by trial, error and deductive reasoning. I used to get disks of PD/SW from Best Bits and Bytes, in Van Nuys. resEdit 1.2 was my favorite program. I thought "Inside Mac DA" was some sort of DA to tell you stuff about the internal workings of your Mac. I bought Borland's Turbo Pascal for the Mac, but it assumed you knew how to program - just wanted to change to Turbo. I called Borland and said they oughta say so on the box (bought at Egghead) and the "support" person gave me a hard time. I now use that disk for archive storage (not S-7 compatible anyway). I never knew Inside Mac even existed. The next time I got into it was after 2 years of no Mac, and the purchase of an LC. By then I already had some IM volumes. But it didn't take very long to find out there was no established set of books or anything to take a nonprogrammer to the point where he could at least write some simple ones. I don't mean copying code from a book and getting "talked through it" - I mean learn enough to be able to create one on his own, like you can with carpentry or other industrial arts, etc. So, I figured the best way to learn to program was to get programs that ran and see if I could find out what it was about them that made them run. What did they do, how did they do it, and when. So I became a source code junkie. I'd trace a simple program in the debugger and if I didn't understand a line I would look things up in IM from the line. If it wasn't in IM, I'd change something about the line - usually a value - and see what the change did. Then I'd change it back and try something else. Also, I could recognise common aspects of various programs, and se differences in them. Recognizing differences, similarities and identities, and eveluating relative importances is a key set of factors to any learning process. Comparing, examining, observing in operation, commenting out, uncommenting, trying modifications, reading up on parts of example source, and being able to locate a working example of any routine or fragment of a program are all contibutors to the learning process. What better source for the answer to a programming question than the running output of a succesful programmer?. What do I mean by successful programmer? One who wrote a program that runs. Of course, I still have a long way to go to fill in all the gaps in my learning. Here's a tip, which I will not get into a position to implement: Some cracker-jack programmer, or group of programmers could make big bucks by producing programming videos. Sell them for $5.00 and have each one be on one small subject - like one on regions, etc. One on CDEFs, one on pointers, one on setting up a menu bar from both code and resources. Dig? A guy buys all sorts of books on programming but just can't seem to get "pointers." He orders your tape on pointers, watches in on the TV next to his Mac and finally gets them. Why? Because somebody SHOWED him, intead of told him. A potential gold mine, especially since the internet is on it's way into the living room. -Ken- +++++++++++++++++++++++++++ >From rieck@peca.cs.umn.edu (Keith Rieck) Date: Mon, 21 Mar 1994 19:06:22 GMT Organization: Whatsamatta U, Mooselvania In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: |> How did you learn to program? Did you take a class? I was about 14 when Radio Shack came out with the TRS-80. Our local store had a machine on display with the Basic manual sitting next to it. I'd study the manual and play with the machine until the sales clerk threw me out. Then I'd come back later and do it again. A lot of us are self-taught, but it's alarming how many people I know who have tried to start with C and have been blown away. Typically, they buy a top-of-the-line compiler and give up after reading the first 50 pages of their 500 page manual. There are also plenty of otherwise intelligent folks who enroll in introductory language classes, but never get beyond hello-world. I haven't used Basic in years, but I still recommend it to anyone who's trying to learn programming. It's got a very short learning curve and they can start writing functioning programs in one afternoon. -- /* Keith Rieck */int a[200],b=2,c,d=0,e;main(){for(;d<200;b++)for(c=0;;) {e=a[c++];if(c>d||e*e>b){a[d++]=b;printf("%5d\t",b);break;}if(b%e==0)break;}} +++++++++++++++++++++++++++ >From chuck@gte.com (Chuck Hoffman) Date: Tue, 22 Mar 1994 15:00:50 GMT Organization: GTE Laboratories In article <2mar47$78l@sundog.tiac.net> Russ Blaine, rblaine@tiac.net writes: >How did you learn to program? Did you take a class? Teach yourself >with a book? Become an apprentice, or what? > I learned FORTRAN in the Summer of 1965 at the U.S. Naval Academy. Course name was "Weapons 707." -- Chuck Hoffman GTE Laboratories, Waltham, MA, USA 617-466-2131 - ------------------------------------------------ I'm not sure why we're here, but I am sure that while we're here we're supposed to help each other. - ------------------------------------------------ +++++++++++++++++++++++++++ >From jxd8856@hertz.njit.edu (Jennifer Deats) Date: 23 Mar 94 17:03:34 GMT Organization: New Jersey Institute of Technology, Newark, New Jersey Way back in 1984, my parents got a 128K Mac (and it still works well...as long as the programs aren't expecting much in terms of hardware). At that point, they decided to send me to National Computer Camp (NCC) in Connecticut. They taught mostly on Apple IIs and a few TRS-80s. Basic, Pascal, and Assembly were the languages they used. I learned an awful lot about some of the abilities of the Apple II, largely from other campers who did alot of "let's see what happens when I do this". I didn't touch programming too much for the next seven years. Then I went into computer science here and I'm stunned how fast Pascal came back to me. As for other languages, some I learned through class, some I learned on my own, and alot I learned through experienced programmers who also attend school here. Just my 2 cents. -Jennifer -- | Jennifer Deats | This sig is | | | currently under | | CIS Major | constuction | +++++++++++++++++++++++++++ >From fixer@faxcsl.dcrt.nih.gov (Chris Gonna' Find Ray Charles Tate) Date: Wed, 23 Mar 1994 19:54:36 GMT Organization: DCRT, NIH, Bethesda, MD How did I learn to program? In 1981, my father purchased a *kit* for assembling a Sinclair ZX81 - the machine that later appeared under the Timex brand, as the Timex-Sinclair 1000. It originally cost about $100 in kit form. That little, tiny box had one of the best BASIC implementations I've ever used, packed into 8K of ROM. It had a context-sensitive program editing mode (gave you 'GOTO' when you hit the 'G' key, etc.), and would syntax-check your program *as you typed it in*. This was great for learning the syntax of BASIC (for a 12-year-old kid). A bit later on, I started fiddling with assembly language on that same machine - it had a Zilog Z80 processor. Nice machine, actually.... :-) When I got to college, I had had enough experience with BASIC that my father and older brother assured me that I wouldn't have much problem learning FORTRAN, and so I jumped into the second-semester programming course, which was supposed to *finish* teaching its students Pascal and FORTRAN. It was perfect - my first exposure to real data structures, challenging (to learn Pascal fast enough to handle the supposition that I already *knew* the syntax, etc.), and a good choice of projects. The parts of it I remember were doing a single-source shortest-path algorithm (taught breadth-first search, basic graph representations, and queues) in Pascal, and a Choleski symmetric positive-definite matrix decomposition in FORTRAN, using a compacted matrix representation. That one gave us a real feeling for what kinds of programming people who were serious about it did. In retrospect, I think Pascal is a better first language than C or FORTRAN, since you have to deliberately avoid a lot of the 'sloppy' things that other languages let you get away with. That makes for better coding style later on. Penn State (my alma mater) also required a course in machine language, in which we studied machine representation of numbers (well, integers, and a *brief* exposure to some floating-point concepts - I didn't get any real floating-point exposure until I took a Math-department course in numerical methods), the basic operating principles of computers, and various architectures from a programmer's standpoint. Specifically, we learned PDP-11 assembly language (the 'standard' stack-based machine, with auto-increment and auto-decrement), as well as IBM 370 assembly language (the IBM mainframes are not stack-based). No RISC, alas; I understand that not long after I took that course they started teaching MIPS assembly language and concepts rather than PDP-11. The only other real 'learn to program' course wasn't exactly that; it was a class in abstract data types. The text was Aho, Hopcroft, & Ullman; I think it might be taught with Corman, Leiserson, & Rivest these days. That's an important course - you need the knowledge of programming technique that comes with studying the art of data structure design and various programming approaches (dynamic programming, divide-and-conquer, greedy heuristics - all the standards you *should* know). My senior year I took a course in OS design, with implementation in teams of three people. It was a *ton* of work, but I'm glad I took it. By that time I had been programming professionally (summer job at NIST) for several years, but hadn't don't anything of that scope. It was a *fantastic* learning experience for dealing with a very large project, and for learning the ins and outs of a group project (code management, time management, et cetera). I think the basic curriculum I had was quite good. Penn State's CompSci department grew out of its Math department, rather than its Engineering school, and I think it shows (lots of theoretical study, not so much emphasis on digital engineering). The course on formal language theory was ... work. :-) - -------------------------------------------------------------------------- Christopher Tate | "I hate writing, and I hate statistics, but MSD, Inc. | most of all I hate writing about statistics. | I'd rather go to the dentist; at least there fixer@faxcsl.dcrt.nih.gov | you get to spit." -- Ed Sewell +++++++++++++++++++++++++++ >From zhfzc@zh014.ubs.ubs.ch (Christian Franz) Date: Thu, 24 Mar 1994 08:55:44 GMT Organization: Union Bank Switzerland, CH Well, in '78 me and my brother saved anough money to buy us an Apple II. I began with Basic, then Applesoft Basic and then got the hang of 6502 Assembler. I remember having discussions with my brother about which programming language was better since he used the UCSD Pascal while I wrote 6502. I often ridiculed him for his choice. Well, I went on and implemented my own little language (called CFDS, I only know of a single other person who understands this language - hell, I was only 15 by then). Time went on and I finally went to university (ETH - Swiss Federal Institute of Technology, you know where Wirth hangs around). I got myself a Mac then and was immediately overwhelmed by the sheer complexity of the OS and the built-in routines, the guidelines you had to adhere to etc. At ETH, I learned Modula-2 at first and then Oberon. Being an Assembly hacker, I had some difficulties with the concept of procedural, strongly-typed languages. It seemed all so clumsy while I could code the same problem in a very elegant 15-Byte tight loop... After about one year, my view started to shift. Suddenly I recognized the power of languages like Modula or their ancestor, Pascal. Plus, someone sold me her copy THINK Pascal. Now *that* was a development system that deserved its name. After a while, I took a course in compiler design. Suddenly I *knew* why languages such as C or Assembler could never match the elegance and fitness for servicability that strongly-typed procedural languages have. And I have come to flushing when I remember how I laughed into my brother's face when he used the clumsy UCSD when he could have programmed assembler. Nowadays I'm a fierce advocat of Pascal and Modula and have a strong dislike of C or the ultimate insult to cs engineers, C++ (flame bait, do not respond!). Of course I know there are times when you have to resort to extreme measures (if you look at GrafSys, you'll notice that the ultra-fast Triangle routines are done in 68K assembler). But I like to forget that whenever possible. Ok, to sum it up, I have learned to program the wrong way all by myself. The correct way I learned at the university. How to program on the Mac was a matter of Trial And Error at first. Then, after I had mastered most of the problems, I found this book 'Macintosh Programming Primer' which is IMHO one of the best of its kind and would have saved me about a year. Note that it is not intended for the beginner (in programming) but rather the experienced programmer who switches to the Mac. Cheers, Christian -- Christian Franz * Union Bank Of Switzerland cfranz@home.malg.imp.com <- at home -> +1-261 26 96 +++++++++++++++++++++++++++ >From jburke@UMASSD.EDU Date: Fri, 25 Mar 1994 16:27:22 GMT Organization: UMASS DARTMOUTH, NO. DARTMOUTH, MA. In article , rieck@peca.cs.umn.edu (Keith Rieck) writes: >In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: >|> How did you learn to program? Did you take a class? > >I was about 14 when Radio Shack came out with the TRS-80. Our local store >had a machine on display with the Basic manual sitting next to it. I'd >study the manual and play with the machine until the sales clerk threw >me out. Then I'd come back later and do it again. You mean someone else learned BASIC this way? Yow. They got so used to kicking me out that they asked my mom if we were planning to move my bedroom furniture into the store. - ----------------------------------------------------------------------------- |James P. Burke | This is some text that I like to put to the right of my| |Very Small Animal | name because it makes this space look less empty. | |JBURKE@umassd.edu | Never put off 'till tomorrow saves nine. He who laughs | |DRMOMENTUM@aol.com | last is worth two in the bush. "The foot is a game." | - ----------------------------------------------------------------------------- +++++++++++++++++++++++++++ >From peirce@outpost.SF-Bay.org (Michael Peirce) Date: Sat, 26 Mar 94 14:44:42 PST Organization: Peirce Software, Inc. In article <2mar47$78l@sundog.tiac.net>, Russ Blaine wrote: >How did you learn to program? Did you take a class? Teach yourself >with a book? Become an apprentice, or what? I learned FORTRAN out of a book. I wrote a bowling scores program and finagled enough time on a old DEC RSTS system at the University of Toledo to type it in and debug it. About the same time I spent some time at a summer NSF program at Indiana State and got to try my hand at punching cards for a IBM/360. The next year my high school got its first Commodore PET and I learned BASIC (then taught the teachers BASIC). I learned 6502 assembler on the machine too, plus 1802 assembler on an ELF that my physics teacher had bought. During my freshman year at RPI I learned Pascal (by convincing them I knew enough FORTRAN to skip that). It was the first year they tought Pascal instead of PL/I - thank goodness. It was fun programming the big IBM/3033 - I think I was in the last class that really spent much time on the big mainframe. By the time I graduated, the computer geaks (like me) had moved on to Unix workstations and PCs. Ah IBM 370 assembler, a dying skill (at least I hope so). I learned the Mac on a 512K with Megamax C (it was cool to see it use up screen memory when it had exhausted main memory - when the cool patterns filled up the screen, you knew you were hosed). I learned C at the same time and grabbed as much sample code as I could and spent lots of hours reading the paper back version of Inside Mac. -- Michael Peirce -- peirce@outpost.sf-bay.org -- Peirce Software, Inc. -- 719 Hibiscus Place, Suite 301 -- -- San Jose, California USA 95117 -- Makers of: Smoothie & -- voice: +1.408.244.6554 fax: +1.408.244.6882 -- Peirce Print Tools -- AppleLink: peirce & America Online: AFC Peirce +++++++++++++++++++++++++++ >From dspman@aol.com (DSPman) Date: 27 Mar 1994 19:55:01 -0500 Organization: America Online, Inc. (1-800-827-6364) Get Marksman 3.0 by IT Makers. It is a code generation tool. You lay out the user interface and it generates most of the code you need that would take you a long time to write. Learning to program the Mac can be very difficult. This program got me over the hump by generating great skeleton code for a program which I can study and ultimately understand. +++++++++++++++++++++++++++ >From dubois@primate.wisc.edu (Paul DuBois) Date: 27 Mar 1994 21:14:07 -0600 Organization: Castra Parvulorum >How did YOU learn to program? Still haven't. -- Paul DuBois dubois@primate.wisc.edu +++++++++++++++++++++++++++ >From me362@lu.erisoft.se (Mats Ekberg) Date: Wed, 6 Apr 1994 13:49:21 GMT Organization: Erisoft AB, Sweden In article b4o@search01.news.aol.com, dspman@aol.com (DSPman) writes: []Get Marksman 3.0 by IT Makers. It is a code generation tool. You []lay out the user interface and it generates most of the code you []need that would take you a long time to write. []Learning to program the Mac can be very difficult. This program []got me over the hump by generating great skeleton code for a []program which I can study and ultimately understand. [] But that results in "regular" procedural programming. Isn't it better to try to go object-oriented? What is the experience of all You programmers, what are the major differences between procedural and OO programming on the Mac? Tools, code-size, speed, complexity, serviceability and so on... [----------------------------------------------------------------------] | Addr: Mats Ekberg @ Erisoft AB | Voice: +46 920-427 00 | | Box 920 | Email: Mats.Ekberg@lu.erisoft.se | | S-951 28 LULEA | Memo: ERI.ECOM.EPLMEK | [----------------------------------------------------------------------] +++++++++++++++++++++++++++ >From deeny3@aol.com (Deeny3) Date: 9 Apr 1994 23:16:04 -0400 Organization: America Online, Inc. (1-800-827-6364) Nineteen years ago, I was working for my father, a consulting physicist. He had a lot of programming he needed done (stuff that you could do in Excel now, of course), and so he suggested that I take a class. I did -- and it's the only one I ever took. Most of what I learned I learned at home or on the job. I've programmed all my adult life and will continue to do so. _Deirdre In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: >>How did you learn to program? Did you take a class? Teach yourself with a book? Become an apprentice, or what? Just a general question directed to all members of the programming community, out of curiosity. I'm teaching myself (well, trying..) to program C using a book, its not too bad...<< +++++++++++++++++++++++++++ >From bas2631@silver.sdsmt.edu (Brian Stone) Date: 11 Apr 1994 20:25:14 GMT Organization: South Dakota School of Mines and Technology Deeny3 (deeny3@aol.com) wrote: : Nineteen years ago, I was working for my father, a consulting physicist. He had : a lot of programming he needed done (stuff that you could do in Excel now, of : course), and so he suggested that I take a class. I did -- and it's the only : one I ever took. Most of what I learned I learned at home or on the job. I've : programmed all my adult life and will continue to do so. : _Deirdre : In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: : >>How did you learn to program? Did you take a class? Teach yourself : with a book? Become an apprentice, or what? : Just a general question directed to all members of the programming : community, out of curiosity. I'm teaching myself (well, trying..) : to program C using a book, its not too bad...<< Im following up on this just cause Im bored at the moment... I taught my self Basic on the Commodor 64 when I was 12. I wrote a few programs... nothing fancy. Just messed around with sprites and little animations. My father saw that I was interested in this and gave me his 64, while he was given a Lisa computer to do some consulting business. I was somewhat fasinated by this computer although I never did any programing on it. When the Mac Plus came out, my father bought one. I imediatly started playing around with it, I must have been 16 at the time. When he bought Microsoft Q-Basic, that became my buddy for the years to come. I taught my self the inner workings of Q-basic and started writting quite a few small games and other programs. When I was a Junior in highschool I took my first Pascal course. However, I never programed much in Pascal outside the class room. I took two years of Pascal, both in my Junior and Senior years. I began college as a traditional student, just after highschool. In my first year I took a FORTRAN course... probably more usless than Pascal. In the first semester of my second year I took an Ansi C course. After that course, I taught my self C++. Since then, however, I havnt used C much at all. Im mainly a Basic programer... but Im slowly trying to relearn C++. I got a book on programing 3D graphics in C. About six months ago, I translated it into Q-Basic, and it works pretty good. But, Q-basic is slow... too slow, and I need speed. In fact, C is also too slow for what I need, so part of my problem is porting certain functions to Assembly code. At the moment I am taking an Assembly programing class for 386 processors, and I hope to use that knowlege to help me write Assembly programs for the 6800x0 Motorola processors. Eventualy I will use my knowlege of 3D graphics, Assembly, and C++ to write my biggest game yet. Hopfully a 3D Space battle game, not unlike X-Wing for PC's. Ive already used 3D graphics in an Artillary style game that I wrote in Q-Basic... but like I said before... its way too slow. I have not yet compleated the program, and the game dosnt have any sound to it, so I probably will never release this game. But I hope to have my 3D space battle game out by the end of the year... depending on if my sanity holds. From the man on a mission from God... and Mars, Brian "the man with a head of lettuce" Stone bas2631@silver.sdsmt.edu +++++++++++++++++++++++++++ >From dvorak@extro.ucc.su.OZ.AU (Darko Volaric) Date: Sat, 9 Apr 1994 03:53:00 GMT Organization: /etc/organization In article jburke@UMASSD.EDU writes: >In article , rieck@peca.cs.umn.edu (Keith Rieck) writes: >>In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: >>|> How did you learn to program? Did you take a class? >> >>I was about 14 when Radio Shack came out with the TRS-80. Our local store >>had a machine on display with the Basic manual sitting next to it. I'd >>study the manual and play with the machine until the sales clerk threw >>me out. Then I'd come back later and do it again. > >You mean someone else learned BASIC this way? Yow. They got so used to >kicking me out that they asked my mom if we were planning to move my >bedroom furniture into the store. > I did the same thing (but when I was about 10) but they let me stay since I'd tell the customers what I was doing and what the computer could do. I probably was responsible for more sales than the (rather ignorant) salesperson. +++++++++++++++++++++++++++ >From jjensen@kaiwan.com (John Jensen) Date: 20 Apr 1994 05:24:46 -0700 Organization: KAIWAN Internet (310/527-4279,818/756-0180,714/741-2920) Darko Volaric (dvorak@extro.ucc.su.OZ.AU) wrote: : In article jburke@UMASSD.EDU writes: : >In article , rieck@peca.cs.umn.edu (Keith Rieck) writes: : >>In article <2mar47$78l@sundog.tiac.net>, rblaine@tiac.net (Russ Blaine) writes: : >>|> How did you learn to program? Did you take a class? : >> : >>I was about 14 when Radio Shack came out with the TRS-80. Our local store : >>had a machine on display with the Basic manual sitting next to it. I'd : >>study the manual and play with the machine until the sales clerk threw : >>me out. Then I'd come back later and do it again. : > : >You mean someone else learned BASIC this way? Yow. They got so used to : >kicking me out that they asked my mom if we were planning to move my : >bedroom furniture into the store. : > : I did the same thing (but when I was about 10) but they let me stay since I'd : tell the customers what I was doing and what the computer could do. I probably : was responsible for more sales than the (rather ignorant) salesperson. Me too. I had just finished a Fortran course at school (I was studying chemistry). I walked into a Radio Shack and looked at the BASIC manual for the TRS-80. It was a learn-as-you-go thing, so I just started typing. No one ever bothered me, and I walked out a couple hours later knowing BASIC. Thank you Radio Shack. John +++++++++++++++++++++++++++ >From gdl@danube.maths (Greg Landweber) Date: 21 Apr 1994 17:04:58 GMT Organization: (none) In article dvorak@extro.ucc.su.OZ.AU (Darko Volaric) writes: >>I was about 14 when Radio Shack came out with the TRS-80. Our local store >>had a machine on display with the Basic manual sitting next to it. I'd >>study the manual and play with the machine until the sales clerk threw >>me out. Then I'd come back later and do it again. My school got a TRS-80 when I was 10, and I used to stay after school to play on it. I remember at one point it told me to "type mismatch". Then, when I typed "mismatch", it said "syntax error". The following year, my school got an Apple ][+, I learned Logo, and convinced my parents to get me an Apple //e. I learned Pascal the following summer and took a data structures and algorithms class the summer after that. In high school, I wrote a grade book (jointly with Dean Yu) and a class rank program for the teachers and administrators in AppleSoft basic, and I fiddled a lot with Turbo Pascal (writing painfully slow interpreters for Lisp and Logo, and a Star Trek battle simulation based on a board game). I was declared prophet by my A.P.Computers class, which decided to start its own religion. We waited for the second coming of the Timex Sinclair, while taking our frustrations out on an empty husk of a Franklin Ace (which came on a cart with boxing gloves). I got a Mac when I went to college, and the rest is history. BTW, I learned C somewhere over the Atlantic Ocean. I brought K&R with me to read on a flight to England. I read it again on the way back, and I started programming in C when I got home. -- Greg "Buttons" Landweber gdl@maths.ox.ac.uk +++++++++++++++++++++++++++ >From bootstrap1@aol.com (Bootstrap1) Date: 20 Apr 1994 23:45:07 -0400 Organization: America Online, Inc. (1-800-827-6364) I had watched a friend write a few little, ten-line BASIC programs making a dot bounce around on screen on the TRS-80 locked in the back of one of the classrooms. The next year, while studying Trig, I asked my teacher if I could try to program it to draw a circle. With no manual, and only the experience of watching my friend, I wrote the following program. 10 X = 0 20 X * X + Y * Y = 100 30 PLOT X,Y 40 X = X + 1 50 GOTO 20 Needless to say, it wouldn't run. The next week she let me go to the computer lab, where they had manuals, during class. Within a couple of days I had the program running, learned the fundamentals just browsing through the manual, battled the notorious TRS-80 Mod 1 tape drive, then didn't write another line of code for three months. At Christmas my Dad bought an Apple II+ for our family (this was '81) and I spent 60 hours coding the first three days we had it. Six months later I was interning at a startup, writing (not very good) commercial software for the new IBM PC. Nathan Tennies Bootstrap Enterprises Inc --------------------------- >From jscho@soda.berkeley.edu (John S. Cho) Subject: How do I get machine-user name? Date: Sun, 03 Apr 1994 16:23:48 -0800 Organization: University of California, Berkeley I need some help obtaining the machine and user names from the Shared Setup control panel. I've played around with the PBxxxx routines and the PPC toolbox but got no where. Anyhelp would be much appreciated. John ._/ --=o0o=-- . ._/ John Seungwon Cho ( "If not today, nor yet ._/ ._/ University of California, Berkeley `. tomorrow, then some other ._/_/_/ jscho@{soda,uclink,ocf}.berkeley.edu ) day." - Dream Theater +++++++++++++++++++++++++++ >From jumplong@aol.com (Jump Long) Date: 5 Apr 1994 00:04:01 -0400 Organization: America Online, Inc. (1-800-827-6364) In article , jscho@soda.berkeley.edu (John S. Cho) writes: > I need some help obtaining the machine and user names from the Shared Setup > control panel. I've played around with the PBxxxx routines and the PPC > toolbox but got no where. Anyhelp would be much appreciated. You can get those names from system resources -16096 (user name) and -16413 (computer name) using the GetString function. As noted in the Technical Note "AppleTalk, the Rest of the Story": "System software version 7.0 allows the user to enter a personalized name by which her system will be published when connected to an AppleTalk network. The System 'STR ' resource ID -16413 is used to hold this name. The name (listed as Macintosh Name) can be up to 31 characters in length and can be set using the Sharing Setup Control Panel Device (cdev). This resource is different from the Chooser name, System 'STR ' resource ID -16096. When providing network services for a workstation, the Flagship name should be used so that the user can personalize his workstation name while maintaining the use of the Chooser name for server connection identification. It's important to note that the Flagship name resource is available only from system software version 7.0. DTS recommends that applications not change either of these 'STR ' resources." - Jim Luther +++++++++++++++++++++++++++ >From jeff31415@aol.com (Jeff 31415) Date: 19 Apr 1994 18:07:02 -0400 Organization: America Online, Inc. (1-800-827-6364) In article , jscho@soda.berkeley.edu (John S. Cho) writes: > I need some help obtaining the machine and user names from the Shared Setup > control panel. I've played around with the PBxxxx routines and the PPC > toolbox but got no where. Anyhelp would be much appreciated. I don't know if this is a recommended way to do it, but I find that grabbing the appropriate STR# from the active system file works just fine (under System 7). I haven't seen anything documented by Apple on this one. Sorry, I can't find the code write now. Email me if you want me to search for it in a more serious way. -Jeff Abrahamson +++++++++++++++++++++++++++ >From jwbaxter@olympus.net (John W. Baxter) Date: Wed, 20 Apr 1994 08:17:36 -0700 Organization: Internet for the Olympic Peninsula In article <2p1km6$rve@search01.news.aol.com>, jeff31415@aol.com (Jeff 31415) wrote: > In article , > jscho@soda.berkeley.edu (John S. Cho) writes: > > > I need some help obtaining the machine and user names from the Shared Setup > > control panel. I've played around with the PBxxxx routines and the PPC > > toolbox but got no where. Anyhelp would be much appreciated. > > I don't know if this is a recommended way to do it, but I find that grabbing > the > appropriate STR# from the active system file works just fine (under System 7). > I haven't seen anything documented by Apple on this one. Per Inside Mac: More Mac Toolbox, page 1-127-- User name is 'STR ' -16096 Computer name is 'STR ' -16413 I don't remember how far back into pre-history the above is true [by my definition, System 6 is pre-history...others--correctly for their purposes--disagree]. -- John Baxter Port Ludlow, WA, USA [West shore, Puget Sound] jwbaxter@pt.olympus.net --------------------------- >From egurney@vcd.hp.com (Eddy J. Gurney) Subject: How to: Aladdin-aware ResEdit (was Re: ResEdit + dctb = ID=01?) Date: Tue, 19 Apr 1994 20:54:52 GMT Organization: Hewlett-Packard VCD Rich Siegel (siegel@netcom.com) wrote: >In article sobiloff@lap.umd.edu writes: >>This happens when I try to look at StuffIt Expander 3.0.7 or BBEdit >>2.3.2 (I can open a single resource with BBEdit, but then crash if I >>try to open another one). >Out of coincidence, the two applications you tried both contain >compressed resources. (They're compressed by a scheme that ResEdit >doesn't know.) Try other examples, such as your copy of THINK C, or >MPW, or whatever... Or, make ResEdit aware of the Aladdin resource compression scheme. Below are my instructions on installing the Aladdin resource decompressor (found in the FreeWare "BBEdit Lite", which you will need a copy of) into a fresh ResEdit 2.1.1. NOTE: I take absolutely no responsibility for this patch; I was bored one weekend and decided to see if I could get this to work. I feel I was successful; however, I don't feel comfortable that the Aladdin resource decompressor is properly "deinstalled" when you quit ResEdit. I'm not sure what effect this has; everything SEEMS to work fine. The problem with ResEdit 2.1.1 is that it *already* adds a resource decompressor (the Apple one) when you launch ResEdit. I intercept that patch, add the Aladdin version, and then continue on and add the Apple version. FYI, they are patching an undocumented (as far as I know!) trap, _A0FC, to implement resource decompression. It looked like the Apple scheme does a tail patch on that trap, so both decompressors work together. But I don't think the Aladdin de-installer is ever called, since ResEdit probably just calls _ExitToShell somewhere. SO... after you've used your "special" version of ResEdit, you may want to restart. THINK Reference also installs its own resource decompressor (you can see the code patching _A0FC as well). However it is different from the Aladdin or Apple version... Patching ResEdit 2.1.1 to use the Aladdin Resource Decompressor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What you will need: A fresh (ie, non-patched) copy of ResEdit, version 2.1.1 A fresh (ie, non-patched) copy of the freeware BBEdit Lite, version 2.3.2 Experience using ResEdit to patch stuff. :-) 1. Make a copy of ResEdit from the Finder. When we're done, this copy will have the Aladdin resource decompressor automagically installed when you launch this copy. 2. Open the new copy of ResEdit in ResEdit. Whoa, like weird, man. :-) 3. Open BBEdit Lite 2.3.2 in ResEdit 4. (Optional). Double-click on the 'sicn' resource in BBEdit Lite and notice that 'sicn' 911 is "messed up" (because its compressed). Don't open any DLOG's or anything, or ResEdit will CRASH! 5. Click once on the "DCMP" resource in the BBEdit Lite window and choose "Copy". 6. Select the ResEdit window and choose "Paste". 7. Double-click on the CODE resource icon in the BBEdit Lite window. Select CODE resource 1, and choose "Open Using Hex Editor" from the "Resource" menu. 8. Go to offset 0x005638 (very close to the end, should start with 4E71 42A7 6100...) and drag select to the end of the resource (offset 0x0058FB, should end with A198 4ED1). Make sure you are selecting the hex numbers and NOT the ASCII representation on the right. 9. Choose "Copy". 10. Close all the windows associated with BBEdit Lite, we're done with them. 11. Double-click on the CODE resource icon in the ResEdit window. Select CODE resource 66, and choose "Open Using Hex Editor" from the "Resource" menu. 12. Go to the end of the resource (should end with 11C7 0A5E 4E75) and click after the 4E75. 13. Choose "Paste". 14. Move to offset 0x0005EC (this is in the newly pasted section, should start with FE9C 6100 0114) and select the "FE9C" bytes and change them to "FA24". 15. Close the CODE ID=66 hex editor window. 16. Select CODE resource 0 (the jump table) and choose "Open Using Hex Editor" from the "Resource" menu. 17. Move to offset 0x000010 (should start with 000C 3F3C 0042...) and select the "000C" bytes and change them to "05DA". 18. Select "Save" from the File menu. 18. Select "Get Info for " from the File menu and change the modification date (the "Modified:" field) to something *older* than the copy of ResEdit you want to run when you double-click on a ResEdit document. Close the dialog and save the changes. Why do you need to do this? Since you now have two copies of ResEdit on your system, the Finder will launch the latest-modified version (which is your newly patched version). Since you will normally want to run the "non modified" version, just make the patched version older. 19. Quit out of ResEdit. The patch is complete and ready to go. I have not noticed any side effects from making this patch, but that DOESN'T mean there aren't any! At least you can view/edit/change Aladdin-compressed resources now. NOTE: changing a compressed resource and saving the changes will save it in an uncompressed state! The Aladdin decompressor does NOT warn you that the resource you're opening is compressed like the Apple decompressor does. 20. (Optional) Launch your newly modified ResEdit. Open BBEdit Lite again, and verify that 'sicn' 911 is no longer "messed up". Cool. :-) -- Eddy J. Gurney N8FPW Hewlett-Packard Company, Vancouver (USA!) Division egurney@vcd.hp.com #include "Failures are divided into two classes-- those who thought and never did, and those who did and never thought." John Charles Salak +++++++++++++++++++++++++++ >From leonardr@netcom.com (Leonard Rosenthol) Date: Wed, 20 Apr 1994 17:26:32 GMT Organization: Aladdin Systems, Inc. In article , egurney@vcd.hp.com (Eddy J. Gurney) wrote: > Or, make ResEdit aware of the Aladdin resource compression scheme. > > Below are my instructions on installing the Aladdin resource > decompressor > [details removed] > Just a reminder to folks that if you must do this, you can NO LONGER distribute that copy of ResEdit as you have now added "Aladdin Copyrighted" material that is NOT yours to redistribute. As our box says "Our Lawyers are Happy", please keep them that way ;). On a related note, are there REALLY a lot of you who would like to be able to modify our compressed resources? Feel free to EMail me and let me know if there are - maybe we can help... Leonard - ------------------------------------------------------------------------ Leonard Rosenthol Internet: leonardr@netcom.com Director of Advanced Technology AppleLink: MACgician Aladdin Systems, Inc. GEnie: MACgician --------------------------- >From rrose@CSOS.ORST.EDU (-= Godfather Moof =-) Subject: Window -> PICT question Date: 13 Apr 1994 14:29:26 GMT Organization: CS Outreach Services, Oregon State University, Corvallis, OR, USA Any people out in the cloud know how to convert a window to a PicHandle? I've got a 256x256 window that I want to use as a pict... Thanks. Please reply to rrose@csos.orst.edu. +++++++++++++++++++++++++++ >From u9119523@sys.uea.ac.uk (Graham Cox) Date: Thu, 14 Apr 1994 11:23:31 GMT Organization: School of Information Systems, UEA, Norwich In article <2ogvk6$4k4@jadzia.CSOS.ORST.EDU>, rrose@CSOS.ORST.EDU (-= Godfather Moof =-) wrote: > Any people out in the cloud know how to convert a window to a PicHandle? > > I've got a 256x256 window that I want to use as a pict... > > Thanks. Please reply to rrose@csos.orst.edu. Try this: PicHandle MakeWindowPict(WindowPtr theWindow) { Rect r; PicHandle p; GetPort(&originalPort); SetPort(theWindow); r = thePort->portRect; p = OpenPicture(&r); CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL); ClosePicture(); SetPort(originalPort); return(p); } Off the top of my head so check the function calls in case I remembered them wrong. - ------------------------------------------------------------------------ Love & BSWK, Graham -Everyone is entitled to their opinion, no matter how wrong they may be... - ------------------------------------------------------------------------ +++++++++++++++++++++++++++ >From jdm@newton (James D. Meiss) Date: 17 Apr 1994 17:23:22 GMT Organization: University of Colorado, Boulder In article u9119523@sys.uea.ac.uk (Graham Cox) writes: > > >PicHandle MakeWindowPict(WindowPtr theWindow) >{ > > Rect r; > PicHandle p; > > > > GetPort(&originalPort); > SetPort(theWindow); > r = thePort->portRect; > p = OpenPicture(&r); > CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL); > ClosePicture(); > SetPort(originalPort); > return(p); >} > > >Off the top of my head so check the function calls in case I remembered >them wrong. > This code works, but mystifies me. Can someone please explain what copy bits does here? It is reading and writing to the same block of memory? Does it actually DO the memory writing, or is the instruction just recorded... in this case how does the picture know how to execute the instruction? Of course, I guess that the PICT must actually just get the bits in the picture written to it, but how? Sorry for the ignorance, but thanks for you explanations! Jim Meiss jdm@boulder.colorado.edu +++++++++++++++++++++++++++ >From u9119523@sys.uea.ac.uk (Graham Cox) Date: Tue, 19 Apr 1994 10:59:45 GMT Organization: School of Information Systems, UEA, Norwich In article <2orraa$6es@lace.Colorado.EDU>, jdm@newton (James D. Meiss) wrote: > In article u9119523@sys.uea.ac.uk (Graham Cox) writes: > > > > > >PicHandle MakeWindowPict(WindowPtr theWindow) > >{ > > > > Rect r; > > PicHandle p; > > > > > > > > GetPort(&originalPort); > > SetPort(theWindow); > > r = thePort->portRect; > > p = OpenPicture(&r); > > CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL); > > ClosePicture(); > > SetPort(originalPort); > > return(p); > >} > > > > > >Off the top of my head so check the function calls in case I remembered > >them wrong. > > > This code works, but mystifies me. Can someone please explain what > copy bits does here? It is reading and writing to the same block of memory? > Does it actually DO the memory writing, or is the instruction just recorded... > in this case how does the picture know how to execute the instruction? Of > course, I guess that the PICT must actually just get the bits in the picture > written to it, but how? > > Sorry for the ignorance, but thanks for you explanations! > > Jim Meiss > jdm@boulder.colorado.edu As you correctly guessed, the copybits call is made just so that it gets recorded into the picture- I think it does actually write over itself as well but of course that doesn't matter. When you copybits with an open picture, the picture records both the copybits opcode AND all of the actual pixel data (and colour tables too- what a bonus!) When played back DrawPicture knows that the port in question has changed and does the 'right thing'. Stuff like this is why I'll never be a Windows programmer... - ------------------------------------------------------------------------ Love & BSWK, Graham -Everyone is entitled to their opinion, no matter how wrong they may be... - ------------------------------------------------------------------------ +++++++++++++++++++++++++++ >From pottier@corvette.ens.fr (Francois Pottier) Date: 19 Apr 1994 14:52:41 GMT Organization: Ecole Normale Superieure, PARIS, France In article , Graham Cox wrote: >> > p = OpenPicture(&r); >> > CopyBits(&thePort->portBits,&thePort->portBits,&r,&r,srcCopy,NULL); > >As you correctly guessed, the copybits call is made just so that it gets >recorded into the picture- I think it does actually write over itself as >well but of course that doesn't matter. No, it doesn't write over itself, it would be a waste. When you call OpenPicture, all Quickdraw bottlenecks (the standard drawing routines) are replaced with recording routines. So the CopyBits call above is in fact *not* a call to the usual CopyBits routine, but to a recording routine. Afterwards, calling ClosePicture restores the usual bottlenecks. -- Francois Pottier pottier@dmi.ens.fr --------------------------- End of C.S.M.P. Digest **********************