home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-199.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  33.6 KB  |  909 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Wed, 28 Oct 92       Volume 1 : Issue 199
  2.  
  3. Today's Topics:
  4.  
  5.     How to tell if NAN?
  6.     ARA programatic interface
  7.     Looking for fast sorting code for pascal
  8.     Does anyone recognize _Jackson?
  9.     Synchronizing AppleEvents
  10.  
  11.  
  12.  
  13. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  14.  
  15. The digest is a collection of article threads from the internet newsgroup
  16. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  17. regularly and want an archive of the discussions.  If you don't know what a
  18. newsgroup is, you probably don't have access to it.  Ask your systems
  19. administrator(s) for details.  (This means you can't post questions to the
  20. digest.)
  21.  
  22. Each issue of the digest contains one or more sets of articles (called
  23. threads), with each set corresponding to a 'discussion' of a particular
  24. subject.  The articles are not edited; all articles included in this digest
  25. are in their original posted form (as received by our news server at
  26. cs.uoregon.edu).  Article threads are not added to the digest until the last
  27. article added to the thread is at least one month old (this is to ensure that
  28. the thread is dead before adding it to the digest).  Article threads that
  29. consist of only one message are generally not included in the digest.
  30.  
  31. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  32. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  33. file /pub/mac/csmp-digest/README before downloading any files.  The most
  34. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  35. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  36. archive has a mail server; send a message with the text '$MACarch help' (no
  37. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  38.  
  39. The digest is also available via email.  Just send a note saying that you
  40. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  41. automatically receive each new issue as it is created.  Sorry, back issues
  42. are not available through the mailing list.
  43.  
  44. Send administrative mail to mkelly@cs.uoregon.edu.
  45.  
  46.  
  47. -------------------------------------------------------
  48.  
  49. From: bowman@reed.edu (Eric Bowman (bobo))
  50. Subject: How to tell if NAN?
  51. Date: 19 Sep 92 23:06:10 GMT
  52. Organization: Reed College, Portland, OR
  53.  
  54. My apologies if you see this twice...I posted it once, but it never showed up
  55. here, so I'm posting again.
  56.  
  57. I'm wondering the most general way to tell if a number is NAN.  I don't care
  58. what kind of NAN it is; I only want to know that it is.  This occurs in a
  59. replacement for printf, so actually catching the exception is not what I want
  60. to do; I just want to print "NAN" or somesuch rather than have my code loop
  61. endlessly wondering what the hell it's been passed.  (I'm sure this is in
  62. the SANE manual, but some asshole appears to have stolen it.)
  63.  
  64. Thanks,
  65. bobo
  66. bowman@reed.edu
  67.  
  68. +++++++++++++++++++++++++++
  69.  
  70. From: johnsond@halcyon.com (David E. Johnson)
  71. Date: 20 Sep 92 01:51:24 GMT
  72. Organization: Northwest Nexus Inc. (206) 455-3505
  73.  
  74.  
  75. > ... 
  76.  
  77. try
  78.     FUNCTION ClassExtended(x: Extended): NumClass;
  79.         (as in ClassExtended(theNum)<>NormalNum)
  80.     or FUNCTION NAN(i: INTEGER): Extended;
  81.  
  82.     NAN's with extendeds & doubles are a pain in the neck
  83.     Another hack is to convert it to a string and compare it to
  84.     NAN.  
  85.  
  86. David E Johnson
  87. ..sig not available. default enabled: johnsond@halcyon.com
  88.  
  89. +++++++++++++++++++++++++++
  90.  
  91. From: carlton@cs.berkeley.edu (Mike Carlton)
  92. Date: 22 Sep 92 03:13:25 GMT
  93. Organization: University of California, Berkeley
  94.  
  95. In article <1992Sep19.230610.18666@reed.edu> bowman@reed.edu (Eric Bowman  
  96. (bobo)) writes:
  97. - - My apologies if you see this twice...I posted it once, but it never showed up
  98. - - here, so I'm posting again.
  99. - - 
  100. - - I'm wondering the most general way to tell if a number is NAN.  I don't care
  101. - - what kind of NAN it is; I only want to know that it is.  This occurs in a
  102. - - replacement for printf, so actually catching the exception is not what I want
  103. - - to do; I just want to print "NAN" or somesuch rather than have my code loop
  104. - - endlessly wondering what the hell it's been passed.  (I'm sure this is in
  105. - - the SANE manual, but some asshole appears to have stolen it.)
  106. - - 
  107. - - Thanks,
  108. - - bobo
  109. - - bowman@reed.edu
  110.  
  111. That's easy, by definition of a NaN:
  112.     if (x != x)
  113.         printf("x is a NaN\n");
  114.  
  115. For more info, see 'man 3m math' on a decent unix box (i.e. any box which
  116. uses IEEE 754).
  117.  
  118. cheers,
  119. - --mike (carlton@cs.berkeley.edu)
  120.  
  121. ---------------------------
  122.  
  123. From: wdh@well.sf.ca.us (Bill Hofmann)
  124. Subject: ARA programatic interface
  125. Date: 21 Sep 92 16:08:47 GMT
  126. Organization: Whole Earth 'Lectronic Link
  127.  
  128. I seem to recall hearing of a programatic interface (aka API) to AppleTalk
  129. Remote Access.  Was I halucinating?  If not, where can I get docs?
  130.  
  131. - -Bill Hofmann
  132.  
  133. +++++++++++++++++++++++++++
  134.  
  135. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  136. Date: 22 Sep 92 05:55:10 GMT
  137. Organization: University of Waikato, Hamilton, New Zealand
  138.  
  139. In article <wdh.717091727@well.sf.ca.us>, wdh@well.sf.ca.us (Bill Hofmann) writes:
  140. > I seem to recall hearing of a programatic interface (aka API) to AppleTalk
  141. > Remote Access.  Was I halucinating?  If not, where can I get docs?
  142.  
  143. There are two products that might be what you're looking for. Both are
  144. available from APDA:
  145.  
  146. * The AppleTalk Remote Access Developer's Toolkit v.1.0, code R0128LL/A, US$30.
  147.  
  148. This details the neat features of the ARA protocol, including SmartBuffering
  149. compression and the "SecurityZone" feature for controlling inbound calls to
  150. machines on your network. It also describes the services you can call
  151. on, new AppleTalk Transition Queue events, how to coexist with the Serial Port
  152. Arbitrator, and so on.
  153.  
  154. * The AppleTalk Remote Access Modem Toolkit v.1.0, code R0129LL/B, US$25.
  155.  
  156. This gives you instructions on how to create connection scripts to work with
  157. particular modems or PBXs.
  158.  
  159. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  160. Computer Services Dept                     fax: +64-7-838-4066
  161. University of Waikato            electric mail: ldo@waikato.ac.nz
  162. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  163. If only people would complete their sentences.
  164.  
  165. ---------------------------
  166.  
  167. From: mxmora@unix.sri.com (Matthew Xavier Mora)
  168. Subject: Looking for fast sorting code for pascal
  169. Date: 10 Sep 92 00:13:03 GMT
  170. Organization: SRI International
  171.  
  172. Does anybody have code for sorting in pascal? I have a dismal version
  173. of an exchange sort working that I ported from a basic program. I tried
  174. porting
  175. hayden's fastqsort.c code but it doesn't seem to work. ( I haven't tried
  176. to find out what's wrong with it because it trashes my heap every time and
  177. I have to reboot.)
  178.  
  179. I know this is text book stuff but maybe someone has already done
  180. the work and even included some inline asm for the memswap code.
  181.  
  182. Thanks
  183.  
  184. Matt
  185.  
  186.  
  187. +++++++++++++++++++++++++++
  188.  
  189. From: aep@world.std.com (Andrew E Page)
  190. Date: 17 Sep 92 12:00:17 GMT
  191. Organization: The World Public Access UNIX, Brookline, MA
  192.  
  193.  
  194.    As far as the heap collisions are concerned....  The QSort algorithms
  195. that I've seen in the past depend on recursion.  This leads to the
  196. posibility that your stack is somehow slamming into your heap,
  197. leading to a Sys Err ID=28.  This can be due to a couple of things...
  198. If the condition that would terminate the recursion is never evaluated
  199. then the function will keep iterating until the stack zooms into the
  200. heap.  Another possibility is that your local variables in the 
  201. recursion function are taking up too much room.  See if you can trim
  202. them down, avoid Str255s like the plauge in recursion functions.
  203.  
  204.  
  205. - -- 
  206. Andrew E. Page CTO(Warrior Poet)|   Decision and Effort The Archer and Arrow
  207. DSP Ironworks                   |     The difference between what we are
  208. Macintosh and DSP Technology    |           and what we want to be.
  209.  
  210. +++++++++++++++++++++++++++
  211.  
  212. From: Bruce.Hoult@bbs.actrix.gen.nz
  213. Date: Fri, 18 Sep 1992 00:49:16 GMT
  214. Organization: Actrix Information Exchange
  215.  
  216. In article <Buq1CI.Mnz@world.std.com> aep@world.std.com (Andrew E Page) writes:
  217. >    As far as the heap collisions are concerned....  The QSort algorithms
  218. > that I've seen in the past depend on recursion.  This leads to the
  219. > posibility that your stack is somehow slamming into your heap,
  220. > leading to a Sys Err ID=28.
  221.  
  222. Recursion is, of course, necessary in QuickSort, but you can easily
  223. guarentee that it will go no deeper than log2(n) -- i.e. only 20
  224. levels when sorting a million elements.
  225.  
  226. Here's my tried and tested Pascal sorting routine (written on the Mac
  227. in 1987).  I've found it reliable and fast.  It tries to be reasonably
  228. clever about avoiding bad partitioning, using the minimum of recursion
  229. and using the best algorithm for the amount of data to be sorted.
  230.  
  231. - -- Bruce
  232.  
  233. - -------------
  234. procedure sort(
  235.    left, right:longint;
  236.    function less_than(a,b:longint):boolean;
  237.    procedure swap(a,b:longint)
  238. );
  239. var
  240.    i, j, mid, median, small_pos: longint;
  241. begin
  242.    while (right-left) >= 15 do begin
  243.       mid := (left+right) div 2;
  244.       
  245.       {find the Median of left, mid, right}
  246.       if less_than(left,mid) then begin
  247.          if less_than(mid,right) then median := mid
  248.          else if less_than(left,right) then median := right
  249.          else median := left
  250.       end else begin
  251.          if less_than(left,right) then median := left
  252.          else if less_than(mid,right) then median := right
  253.          else median := mid;
  254.       end; {finding the median}
  255.       
  256.       {
  257.          partition the region into three:
  258.          
  259.          left <= x <= j:  those smaller than median
  260.          j < x < i:       those equal to median
  261.          i <= x <= right: those greater than median
  262.       }
  263.       i := left;
  264.       j := right;
  265.       while i <= j do begin
  266.          while (i<right) & less_than(i,median) do i := i + 1;
  267.          while (j>left) & less_than(median,j) do j := j - 1;
  268.          if i <= j then begin
  269.             if i < j then begin
  270.                {watch for median getting moved under us!}
  271.                if median = i      then median := j
  272.                else if median = j then median := i;
  273.                swap(i,j);
  274.             end;
  275.             {no need to look at these two again}
  276.             i := i + 1;
  277.             j := j - 1;
  278.          end;
  279.       end;
  280.       {skip over any items equal to the guess of the median}
  281.       while (i<right) & not less_than(median,i) do i := i + 1;
  282.       while (j>left)  & not less_than(j,median) do j := j - 1;
  283.       
  284.       {now sort the two halves}
  285.       if (j-left) < (right-i) then begin
  286.          {the left half is smaller -- sort it recursively first}
  287.          sort(left,j,less_than,swap);
  288.          left := i; {prepare for next iteration}
  289.       end else begin
  290.          {the right half is smaller -- sort it recursively first}
  291.          sort(i,right,less_than,swap);
  292.          right := j; {prepare for next iteration}
  293.       end;
  294.    end; {while more than xxx elements to sort}
  295.    
  296.    {now selection sort any remaining elements}
  297.    for i := left to right-1 do begin
  298.       small_pos := i;
  299.       for j := i+1 to right do
  300.          if less_than(j,small_pos) then small_pos := j;
  301.       if small_pos <> i then swap(i,small_pos);
  302.    end;
  303.    
  304. end; {sort}
  305. - -- 
  306. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  307. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  308. "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
  309. hard disk that fits in your pocket!"   "Great!  Is it PC compatible?"
  310.  
  311. +++++++++++++++++++++++++++
  312.  
  313. From: lewis@sophists.com (Lewis G. Pringle)
  314. Date: 20 Sep 92 00:56:56 GMT
  315. Organization: Sophist Solutions
  316.  
  317. In article <1992Sep18.004916.10633@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
  318. >In article <Buq1CI.Mnz@world.std.com> aep@world.std.com (Andrew E Page) writes:
  319. >> 
  320. >>    As far as the heap collisions are concerned....  The QSort algorithms
  321. >> that I've seen in the past depend on recursion.  This leads to the
  322. >> posibility that your stack is somehow slamming into your heap,
  323. >> leading to a Sys Err ID=28.
  324. >
  325. >Recursion is, of course, necessary in QuickSort, but you can easily
  326. >guarentee that it will go no deeper than log2(n) -- i.e. only 20
  327. >levels when sorting a million elements.
  328.  
  329. Actually recursion is NOT ever necessary in implementing any program. The
  330. recursive algorithm can always be rewriten to keep an array (simulating
  331. what the program stack would have done) of values that would have been
  332. passed as parameters.
  333.  
  334. I would, OF COURSE, agree that QuickSort is most simply, and naturally
  335. written recusively. But if you have some limit on how much stack space
  336. you can use, its not hard to rewrite QuickSort non-recursively.
  337.  
  338.  
  339.                 Lewis.
  340.  
  341. +++++++++++++++++++++++++++
  342.  
  343. From: Bruce.Hoult@bbs.actrix.gen.nz
  344. Date: 20 Sep 92 15:05:11 GMT
  345. Organization: Actrix Information Exchange
  346.  
  347. In article <1992Sep20.005656.15742@sophists.com> lewis@sophists.com (Lewis G. Pringle) writes:
  348. > >Recursion is, of course, necessary in QuickSort, but you can easily
  349. > >guarentee that it will go no deeper than log2(n) -- i.e. only 20
  350. > >levels when sorting a million elements.
  351. > Actually recursion is NOT ever necessary in implementing any program. The
  352. > recursive algorithm can always be rewriten to keep an array (simulating
  353. > what the program stack would have done) of values that would have been
  354. > passed as parameters.
  355.  
  356. You're making a distinction without a difference.  QuickSort is a
  357. recursive algorithm.  The computers we use are only Finite State
  358. Machines, not Push Down Automata, so you have a choice:  either write
  359. your program using recursive notation and have your compiler convert
  360. it to an iterative form using (usually) the hardware supplied stack,
  361. or else convert it to iterative form yourself and manage your own stack.
  362.  
  363.  
  364.  
  365. > But if you have some limit on how much stack space
  366. > you can use, its not hard to rewrite QuickSort non-recursively.
  367.  
  368. How would that help?  Perhaps you would save a few less values on your
  369. own stack than my procedure saves on its, but I could trivially
  370. rewrite mine to use less stack space, if necessary, by changing some
  371. of my automatic variables to static, global, or automatic variables in
  372. an enclosing interface procedure, leaving only perhaps the parameters
  373. left&right and the local variables i and j on the stack on each
  374. recursive invocation, plus of course the program counter (and saved
  375. frame pointer using most Mac compilers).
  376.  
  377. In any case, even in its present form, the posted routine will use
  378. less than a thousand bytes of stack, even when sorting many millions
  379. of elements.  It's hard to imagine an application in which you can
  380. find space for millions of data elements, but can't find a K for a stack.
  381.  
  382. In the same situation, your "iterative" routine would still require a
  383. half K for your explicitely managed stack, and I could come very close
  384. to that with a slight rewrite (but still in recursive form) if I
  385. thought there was a need.
  386.  
  387. - -- Bruce
  388.  
  389. - -- 
  390. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  391. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  392. "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
  393. hard disk that fits in your pocket!"   "Great!  Is it PC compatible?"
  394.  
  395. +++++++++++++++++++++++++++
  396.  
  397. From: Bruce.Hoult@bbs.actrix.gen.nz
  398. Date: 21 Sep 92 14:34:02 GMT
  399. Organization: Actrix Information Exchange
  400.  
  401. In article <D88-JWA.92Sep21145200@dront.nada.kth.se> d88-jwa@dront.nada.kth.se (Jon Wdtte) writes:
  402. > With QuickSort, you have a worst-case scenario where you use
  403. > stack linearly with the number of items... However, usually
  404. > you can code a little cleverness into it so that won't happen.
  405. > Or have you never seen System Error 28 ? :-)
  406.  
  407. Only with a very naive my-first-quicksort implementation.  If you hit
  408. the "[" key a couple of times in your trn you'll find that my posted
  409. QuickSort code can't recurse more than log2(n) times because it
  410. recurses on the *smaller* of the two partitions, and then iterates on
  411. the larger one.  The worst case for sorting performance is the best
  412. case for stack usage!
  413. - -- 
  414. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  415. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  416. "Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
  417. hard disk that fits in your pocket!"   "Great!  Is it PC compatible?"
  418.  
  419. ---------------------------
  420.  
  421. From: Roger.W.Brown@dartmouth.edu (Roger W. Brown)
  422. Subject: Does anyone recognize _Jackson?
  423. Date: 4 Sep 92 13:38:44 GMT
  424. Organization: Dartmouth College, Hanover, NH
  425.  
  426. I frequently see this symbol in MacsBug when my Quadra crashes:
  427. _Jackson. I haven't looked through the Tech Notes yet. I wondered if
  428. anyone knows what it is. It does something with color icons. I just
  429. want to know that it isn't a virus, and maybe that it is from an
  430. extension that may be causing trouble.
  431.  
  432. - --------------------------------------------------------------------
  433. Roger Brown                                roger.brown@dartmouth.edu
  434. Software Development
  435. Kiewit Computation Center, Dartmouth College, Hanover, NH
  436.  
  437. +++++++++++++++++++++++++++
  438.  
  439. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  440. Date: 4 Sep 92 16:14:18 GMT
  441. Organization: Kalamazoo College
  442.  
  443. Roger.W.Brown@dartmouth.edu (Roger W. Brown) writes:
  444. >I frequently see this symbol in MacsBug when my Quadra crashes:
  445. >_Jackson. I haven't looked through the Tech Notes yet.
  446.  
  447. You won't find it there.  :-)
  448.  
  449. >I wondered if
  450. >anyone knows what it is. It does something with color icons.
  451.  
  452. It's an internal trap that QuickDraw uses for doing stuff with memory.
  453. Those branches to _DisposCIcon+xxxx don't necessarily have anything to
  454. do with color icons.  And if you ever hit the _Debugger trap in there,
  455. something went wrong _before_ the trap was called.  Giving the app more
  456. memory may or may not fix it;  it's worth a try.
  457.  
  458. And it gets its name from Jackson Pollock, the modern painter whose name
  459. was given to early versions of Color QuickDraw.  (Or is it 32-bit
  460. QuickDraw?  I've never been good at trivia...)
  461.  
  462. >I just
  463. >want to know that it isn't a virus, and maybe that it is from an
  464. >extension that may be causing trouble.
  465.  
  466. Nope, it's in your machine's ROM.  (It's hard to put a virus there.)
  467.  
  468. Note the followup;  hopefully csmp won't start up another flood of
  469. _Jackson trivia...?
  470. - -- 
  471.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  472.  The essence of OOP:  "After some hacking, I finally got the program to
  473.  work, but I'm still not sure why." - David Marcovitz (marcovitz@uiuc.edu)
  474.  
  475. +++++++++++++++++++++++++++
  476.  
  477. From: marshall@sdd.hp.com (Marshall Clow)
  478. Date: 4 Sep 1992 16:22:21 GMT
  479. Organization: Hewlett Packard San Diego Printer Division
  480.  
  481. In article <1992Sep4.133844.20178@dartvax.dartmouth.edu>,
  482. Roger.W.Brown@dartmouth.edu (Roger W. Brown) wrote:
  483. > I frequently see this symbol in MacsBug when my Quadra crashes:
  484. > _Jackson. I haven't looked through the Tech Notes yet. I wondered if
  485. > anyone knows what it is. It does something with color icons. I just
  486. > want to know that it isn't a virus, and maybe that it is from an
  487. > extension that may be causing trouble.
  488. > --------------------------------------------------------------------
  489. > Roger Brown                                roger.brown@dartmouth.edu
  490. > Software Development
  491. > Kiewit Computation Center, Dartmouth College, Hanover, NH
  492.  
  493. It isn't a virus. Look closely, and you will notice that the address that
  494. you are looking at is in ROM.
  495.  
  496. On my Quadra 900:
  497. $4083143A: JACKSONPOLLOCK          _Debugger
  498. $4083143C: RNEWHANDLE              _NewHandle, SYS, CLEAR
  499. $4083143E: RNEWHANDLE + $0002      BNE.S $40831432
  500. and so on.....
  501.  
  502. It's where QuickDraw jumps to if it gets an error that it can't recover
  503. from (mostly when it runs out of memory). Never, never, do region
  504. operations
  505. where you could possibly not have enough memory!
  506.  
  507. Marshall Clow
  508. San Diego Printer Division      Hewlett Packard
  509. Internet: marshall@sdd.hp.com   AppleLink: HP.Marshall    AOL: MClow
  510.  
  511. P.S.    "Jackson Pollock" was the code name for 32-bit QuickDraw.
  512.  
  513. +++++++++++++++++++++++++++
  514.  
  515. From: wieser@acs.ucalgary.ca (Bernie Wieser)
  516. Date: Fri, 04 Sep 92 20:34:57 GMT
  517. Organization: The University of Calgary, Alberta
  518.  
  519. As the illustrious Tom from Apple says, this is most frequently
  520. indicative of a segment loader problem.
  521.  
  522. Jackson, error 25, etc.
  523.  
  524. I most often get this with 32 bit segloader patch.
  525. - -- 
  526. Bernie Wieser
  527. wieser@acs.ucalgary.ca
  528. HYPROTECH.BW@applelink.apple.com
  529.  
  530. +++++++++++++++++++++++++++
  531.  
  532. From: chuq@gallant.apple.com (Chuq Von Rospach)
  533. Date: 4 Sep 92 19:31:38 GMT
  534. Organization: I is a writur
  535.  
  536. Roger.W.Brown@dartmouth.edu (Roger W. Brown) writes:
  537.  
  538. >I frequently see this symbol in MacsBug when my Quadra crashes:
  539. >_Jackson.
  540.  
  541. Yes, usually when an after dark module crashes.
  542.  
  543.  
  544. - -- 
  545. Chuq "IMHO" Von Rospach, ESD Support & Training (DAL/AUX) =+= Member, SFWA
  546.   chuq@apple.com | GEnie: MAC.BIGOT | ALink:CHUQ =+= Editor, OtherRealms
  547.  
  548.     I believe there should be a constitutional amendment outlawing the
  549.  
  550. +++++++++++++++++++++++++++
  551.  
  552. From: stevem@cs.utexas.edu (Steve Anthony Mariotti)
  553. Date: 14 Sep 1992 19:11:26 -0500
  554. Organization: U Texas Dept of Computer Sciences, Austin TX
  555.  
  556. In article <1992Sep4.133844.20178@dartvax.dartmouth.edu> Roger.W.Brown@dartmouth.edu (Roger W. Brown) writes:
  557. >I frequently see this symbol in MacsBug when my Quadra crashes:
  558. >_Jackson. I haven't looked through the Tech Notes yet. I wondered if
  559. >anyone knows what it is. It does something with color icons. I just
  560. >want to know that it isn't a virus, and maybe that it is from an
  561. >extension that may be causing trouble.
  562.  
  563. I'm guessing that this is the same trap that TMON Pro referred to as
  564. _JacksonPollock.  I know that it's related to Color QuickDraw, but I 
  565. didn't bother reading through the code.
  566.  
  567. A similar question to yours:  what the hell is _Bass?  I was getting some
  568. crashes when a program I was fixing thrashed thePort, and my stack crawl
  569. led me through some code low in memory (very low, like $00001000 or so) that
  570. called _Bass.
  571.  
  572. Does anyone know what _Bass is?  Can I expect to find _Trout, _Snapper, 
  573. _Haddock, _Cod, and more?
  574.  
  575. Steve Mariotti
  576. stevem@cs.utexas.edu
  577.  
  578. +++++++++++++++++++++++++++
  579.  
  580. From: d88-jwa@black.nada.kth.se (Jon W{tte)
  581. Date: 15 Sep 92 11:46:39 GMT
  582. Organization: Royal Institute of Technology, Stockholm, Sweden
  583.  
  584. > stevem@cs.utexas.edu (Steve Anthony Mariotti) writes:
  585.  
  586.    Does anyone know what _Bass is?  Can I expect to find _Trout, _Snapper, 
  587.    _Haddock, _Cod, and more?
  588.  
  589. Or maybe _Drums, _Guitar and _Cutup too ? :-)
  590.  
  591. - -- 
  592. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  593.  
  594. Help eradicate FIDO-Net <-> Usenet gateways in our time!
  595.  
  596. +++++++++++++++++++++++++++
  597.  
  598. From: dwb@apple.com (David W. Berry)
  599. Date: 15 Sep 92 22:24:07 GMT
  600. Organization: Greenwing Enterprises
  601.  
  602. In article <lbaaheINNmja@coltexo.cs.utexas.edu> Steve Anthony Mariotti,
  603. stevem@cs.utexas.edu writes:
  604. >I'm guessing that this is the same trap that TMON Pro referred to as
  605. >_JacksonPollock.  I know that it's related to Color QuickDraw, but I 
  606. >didn't bother reading through the code.
  607. _JacksonPollock is a vectored trap that was added for 32-bit QuickDraw.
  608.  
  609. >
  610. >A similar question to yours:  what the hell is _Bass?  I was getting some
  611. >crashes when a program I was fixing thrashed thePort, and my stack crawl
  612. >led me through some code low in memory (very low, like $00001000 or so)
  613. that
  614. >called _Bass.
  615. Since Bass was the code name for the spline font project, I assume that
  616. _Bass is an internal trap implementing the spline fonts.
  617.  
  618. +++++++++++++++++++++++++++
  619.  
  620. From: stevem@cs.utexas.edu (Steve Anthony Mariotti)
  621. Date: 15 Sep 1992 20:21:10 -0500
  622. Organization: U Texas Dept of Computer Sciences, Austin TX
  623.  
  624. In article <30569@goofy.Apple.COM> dwb@apple.com (David W. Berry) writes:
  625. >In article <lbaaheINNmja@coltexo.cs.utexas.edu> Steve Anthony Mariotti,
  626. >stevem@cs.utexas.edu writes:
  627. >>A similar question to yours:  what the hell is _Bass?  I was getting some
  628. >>crashes when a program I was fixing thrashed thePort, and my stack crawl
  629. >>led me through some code low in memory (very low, like $00001000 or so)
  630. >that
  631. >>called _Bass.
  632.  
  633. >Since Bass was the code name for the spline font project, I assume that
  634. >_Bass is an internal trap implementing the spline fonts.
  635.  
  636. Ok, so now the question is: Is it pronounced like the fish or the four-stringed
  637. electric instrument?  BASE or BASS, I gotta know.
  638.  
  639. Steve Mariotti
  640. stevem@cs.utexas.edu
  641.  
  642.  
  643.  
  644. +++++++++++++++++++++++++++
  645.  
  646. From: smargari@nmsu.edu (Susan Margarit)
  647. Organization: NMSU Computer Science
  648. Date: Wed, 16 Sep 1992 03:01:45 GMT
  649.  
  650. My first impression of the meaning of _Jackson in conjunction with
  651. crashes was that Jackson is slang for a certain portion of the male
  652. anatomy. I kind of thought that when you get Jackson'ed, you've been
  653. f***ed.
  654.  
  655. Jim Margarit
  656.  
  657. +++++++++++++++++++++++++++
  658.  
  659. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  660. Organization: Kalamazoo College
  661. Date: Wed, 16 Sep 1992 17:51:17 GMT
  662.  
  663. stevem@cs.utexas.edu (Steve Anthony Mariotti) writes:
  664. >...what the hell is _Bass?
  665. >
  666. >Ok, so now the question is: Is it pronounced like the fish or the four-stringed
  667. >electric instrument?  BASE or BASS, I gotta know.
  668.  
  669. Like the fish.  Someone on the programming team enjoying fishing, I think.
  670. - -- 
  671.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  672.  "I don't think we should have to have them wandering the streets
  673.   frightening women and people."                            - Pat Buchanan
  674.  
  675. +++++++++++++++++++++++++++
  676.  
  677. From: owen@lloyd.Camex.COM (Owen Hartnett)
  678. Date: 16 Sep 92 16:22:42 GMT
  679. Organization: Camex Inc., Boston MA
  680.  
  681. The symbol JACKSON POLLOCK (note the OCK, not ACK) also appears in the
  682. MPW ROM symbol maps, which is probably where the debuggers find it.
  683.  
  684. Note that the painter, Jackson Pollock, was famous for painting these
  685. dripping types of modern art, which is reminiscent of certain Mac crashes,
  686. which points out the poignancy of the label's proximity to the _Debugger
  687. trap.
  688.  
  689. - -Owen
  690.  
  691. P.S. Thanks to my associates here, Kent Borg & Norm Speciner, who
  692. were able to identify Mr. Pollock, who entered our conversation recently
  693. from out of nowhere.
  694.  
  695. +++++++++++++++++++++++++++
  696.  
  697. From: boyd@apple.com (Scott Boyd)
  698. Date: 17 Sep 92 07:24:59 GMT
  699. Organization: Apple Computer Inc.
  700.  
  701. In article <lbd306INN29o@tokio.cs.utexas.edu>, stevem@cs.utexas.edu (Steve
  702. Anthony Mariotti) wrote:
  703. > In article <30569@goofy.Apple.COM> dwb@apple.com (David W. Berry) writes:
  704. > >In article <lbaaheINNmja@coltexo.cs.utexas.edu> Steve Anthony Mariotti,
  705. > >stevem@cs.utexas.edu writes:
  706. > >>A similar question to yours:  what the hell is _Bass?  I was getting some
  707. > >>crashes when a program I was fixing thrashed thePort, and my stack crawl
  708. > >>led me through some code low in memory (very low, like $00001000 or so)
  709. > >that
  710. > >>called _Bass.
  711. > >Since Bass was the code name for the spline font project, I assume that
  712. > >_Bass is an internal trap implementing the spline fonts.
  713. > Ok, so now the question is: Is it pronounced like the fish or the four-stringed
  714. > electric instrument?  BASE or BASS, I gotta know.
  715.  
  716. _Bass is pronounced like the fish, and would rhyme with class.
  717. Rather than looking for other fish names, you might think of
  718. the name of other ales.  Not that you'll find any, but it might
  719. give you a clue as to a possible origin of the name.
  720.  
  721. _Jackson is the place where QuickDraw goes when it simply cannot recover
  722. from a serious error condition.
  723.  
  724. Hope you find this useful.
  725.  
  726. macintosh system software
  727. boyd@apple.com
  728.  
  729. +++++++++++++++++++++++++++
  730.  
  731. From: paul@taniwha.UUCP (Paul Campbell)
  732. Date: 19 Sep 92 17:39:37 GMT
  733. Organization: Taniwha Systems Design
  734.  
  735. In article <1992Sep16.122242.28529@lloyd.Camex.COM> owen@lloyd.Camex.COM (Owen Hartnett) writes:
  736. >The symbol JACKSON POLLOCK (note the OCK, not ACK) also appears in the
  737. >MPW ROM symbol maps, which is probably where the debuggers find it.
  738.  
  739. Let's put this one to death .... 'Jackson Pollock' was the code name for
  740. 32-bit Quickdraw, _Jackson is the entry point for the new 32-bit QD traps,
  741. you get faults on it when you run code that uses it in systems that don't
  742. have it. "Bass" was a code name for true-type, _Bass is the t-t trap for
  743. the new t-t calls etc etc
  744.  
  745. A great way to snoop out new Apple code names is do dump out MacsBug's
  746. trap symbol table and see what's in there that you don't recognize
  747. (for example '_Egret') ....
  748.  
  749.     Paul
  750.  
  751. - -- 
  752. Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P
  753.     
  754.            So far the Republican's economic policy is best described
  755.              as "C'est la vie Capitalism"
  756.  
  757. ---------------------------
  758.  
  759. From: flournoy@Xenon.Stanford.EDU (Raymond Suke Flournoy)
  760. Subject: Synchronizing AppleEvents
  761. Organization: Computer Science Department, Stanford University.
  762. Date: Thu, 17 Sep 1992 22:17:22 GMT
  763.  
  764.  
  765.   I am trying to use AppleEvents to facilitate communication between a
  766. client and a background server application and I think that my lack of
  767. success can be traced to a failure in sychronization between the two
  768. processes.  Anyone out there who thinks they might be of some help?
  769.  
  770.   Right now, if the client simply launches, then kills the server, the
  771. program works perfectly fine.  The only odd behavior is that periodic
  772. checking of Ticks shows that the launch and kill messages are both
  773. sent out before the server even begins.
  774.  
  775.   When a single message is added between the launch and kill, the
  776. program no longer works as expected.  With the (Think C) debugger on,
  777. the message will be sent and reply received as expected, but without
  778. the debugger a system error and/or bus error occurs.  
  779.  
  780.   One thought that I had was that the server needs to begin running
  781. before the send is sent out, and that somehow the debugger slows down
  782. the client enough that the server has time to begin, and thus
  783. synchronization is taken care of.  But (if this is in fact the
  784. problem) how can I force synchronization without the debugger?  
  785.  
  786.   I tried inserting a WaitNextEvent statement after the launch, but
  787. even with a sleep value of 6000 the Ticks show that only about 2-20
  788. ticks pass during the execution of the wait.
  789.  
  790.   Does anyone have a clue what my problem could be, and/or how I need
  791. to go about fixing it?
  792.  
  793.   Thanks for the help!
  794.  
  795.  
  796. - --Raymond Flournoy        
  797. ======================================================================
  798. flournoy@cs.stanford.edu         "For reasons I cannot explain
  799. Computer Science Dept.            There's some part of me wants to see 
  800. Stanford University, CA           Graceland"               -- P. Simon
  801.  
  802. +++++++++++++++++++++++++++
  803.  
  804. From: bpb9204@tamsun.tamu.edu (Brent)
  805. Date: 18 Sep 92 05:36:21 GMT
  806. Organization: Texas A&M Univ., Inc.
  807.  
  808. flournoy@Xenon.Stanford.EDU (Raymond Suke Flournoy) writes:
  809. |
  810. |The only odd behavior is that periodic
  811. |checking of Ticks shows that the launch and kill messages are both
  812. |sent out before the server even begins.
  813. |
  814. |  I tried inserting a WaitNextEvent statement after the launch, but
  815. |even with a sleep value of 6000 the Ticks show that only about 2-20
  816. |ticks pass during the execution of the wait.
  817. |
  818. |  Does anyone have a clue what my problem could be, and/or how I need
  819. |to go about fixing it?
  820.  
  821. For background, I've done client-server programs using message queues
  822. on UNIX systems (one server, n clients).  On this little server I wrote,
  823. I started it, then started about 40 clients.  It hummed away, doing what
  824. was asked.  Under UNIX, it's easy because processes will be blocked,
  825. i.e., set into a non-running mode, by the operating system if no messages
  826. are available for the program.
  827.  
  828. In the mac world, the program keeps ticking away, though.
  829. One idea I had after I read your note would be fairly easy to do.  What
  830. I was thinking was that you could have the client start up, and then
  831. launch the server (was that what it was doing?).  Once the client does
  832. that, have it wait for a "high sign."  Once the server gets going, have
  833. it zap out an apple event to the client along the lines of a "Server
  834. Startup" message.  This would clue the client that there is a server
  835. out there, waiting for requests.  Then, the client may continue, sending
  836. events to the server.
  837.  
  838. One note about the WaitNextEvent() call -- the sleep parameter, when used,
  839. does not guarantee that the program will be idle for that number of 
  840. ticks.  It just means that the program *could* be idle that long, if other
  841. applications needed the time.  I was caught by this, too.
  842.  
  843. Well, try my suggestion, if you want to, of course.  And whatever you 
  844. find that works, please let us know.  I, for one, am interested in
  845. client-server operations.
  846.  
  847. - -Brent
  848.  
  849. +++++++++++++++++++++++++++
  850.  
  851. From: minow@Apple.COM (Martin Minow)
  852. Date: 21 Sep 92 16:58:10 GMT
  853. Organization: Apple Computer Inc., Cupertino, CA
  854.  
  855.  
  856. Here's a simple recipe for doing server applications on the Mac. It
  857. requires System 7.0 or later:
  858.  
  859. - -- the main application event loop calls WaitNextEvent with a very long
  860.    sleep time. This will block it until something happens.
  861. - -- the application posts asychronous read requests (PPCRead or ATPRead)
  862.    with a completion routine.
  863. - -- the read request should use a control block that has been extended to
  864.    include all buffers and other variables that are needed for the request.
  865.    The control block should also include the application A5 variable if you
  866.    use AppleTalk.
  867. - -- the completion routine refreshes A5 and enqueues the control block to an
  868.    application-global "work queue." It then calls WakeUpProcess to pull the
  869.    application out of WaitNextEvent. WakeUpProcess is only available under
  870.    System 7.0 and later.
  871. - -- as part of the application event loop process, the application checks
  872.    for a non-empty work queue. If there is something, it dequeues it,
  873.    processes it, and -- when complete -- re-posts the control block for
  874.    another asychronouse read.
  875.  
  876. Actually, the sequence is probably:
  877.  
  878. - -- post asychronous read.
  879. - -- when the read completes, process request.
  880. - -- post asychronous write (reply).
  881. - -- when the write completes, post asychronous read.
  882.  
  883. The above is a quick sketch. Any real server application will be more
  884. complex. For example, if you're using PPCToolbox, your primary cycle
  885. goes between PPCInform, PPCRead, PPCWrite, PPCEnd, and back to PPCInform.
  886.  
  887. One advantage of doing most of the work in the main event loop (rather
  888. than in completion routines) is that you can debug most of your application
  889. using a "real" debugger (Think Debugger).
  890.  
  891. Hope this helps.
  892.  
  893. Martin Minow
  894. minow@apple.com
  895.  
  896. ---------------------------
  897.  
  898. End of C.S.M.P. Digest
  899. **********************
  900.