home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-038 < prev    next >
Text File  |  2010-09-21  |  42KB  |  1,151 lines

  1. Received-Date: Tue, 21 Jun 1994 14:04:25 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-038
  4. To: csmp-digest@ens.fr
  5. Date: Tue, 21 Jun 1994 14:04:20 +0200 (MET DST)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 41
  13.  
  14. C.S.M.P. Digest             Tue, 21 Jun 94       Volume 3 : Issue 38
  15.  
  16. Today's Topics:
  17.  
  18.         CopyBits with PixMap
  19.         Gestalt, SU3.0 & List Manager
  20.         How to tell what kind of drive a volume is?
  21.         Photoshop Plug-in Filters useable with other programs?
  22.         Scheduling Sleep in WaitNextEvent
  23.         What is "Clipping Extension"?
  24.         allocating memory quickly -- how?
  25.         sqrti() [Re: Faster Square Root Algorithm]
  26.  
  27.  
  28.  
  29. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  30. (pottier@clipper.ens.fr).
  31.  
  32. The digest is a collection of article threads from the internet newsgroup
  33. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  34. regularly and want an archive of the discussions.  If you don't know what a
  35. newsgroup is, you probably don't have access to it.  Ask your systems
  36. administrator(s) for details.  If you don't have access to news, you may
  37. still be able to post messages to the group by using a mail server like
  38. anon.penet.fi (mail help@anon.penet.fi for more information).
  39.  
  40. Each issue of the digest contains one or more sets of articles (called
  41. threads), with each set corresponding to a 'discussion' of a particular
  42. subject.  The articles are not edited; all articles included in this digest
  43. are in their original posted form (as received by our news server at
  44. nef.ens.fr).  Article threads are not added to the digest until the last
  45. article added to the thread is at least two weeks old (this is to ensure that
  46. the thread is dead before adding it to the digest).  Article threads that
  47. consist of only one message are generally not included in the digest.
  48.  
  49. The digest is officially distributed by two means, by email and ftp.
  50.  
  51. If you want to receive the digest by mail, send email to listserv@ens.fr
  52. with no subject and one of the following commands as body:
  53.     help                        Sends you a summary of commands
  54.     subscribe csmp-digest Your Name    Adds you to the mailing list
  55.     signoff csmp-digest            Removes you from the list
  56. Once you have subscribed, you will automatically receive each new
  57. issue as it is created.
  58.  
  59. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  60. Questions related to the ftp site should be directed to
  61. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  62. digest are available there.
  63.  
  64. Also, the digests are available to WAIS users.  To search back issues
  65. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  66. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  67.  
  68.  
  69. -------------------------------------------------------
  70.  
  71. >From ragatz@nevada.edu (Steven Ragatz)
  72. Subject: CopyBits with PixMap
  73. Date: 5 Jun 1994 09:52:39 GMT
  74. Organization: University of Nevada System Computing Services
  75.  
  76. I am working through the examples in D. Mark's second Primer book using 
  77. Think C/C++ v. 6.xx.  I am trying to use CopyBits to copy a PixMap to a 
  78. window.  I think that I have typed the code in correctly and I have 
  79. looked at the appropriate header files but things are still wrong.  Here is 
  80. the code in question:
  81.  
  82. #include <Picker.h>
  83. #include <Palette.h>
  84.  
  85.     #define NIL_POINTER    0L
  86.     WindowPtr    gColorWindow;
  87.     Rect        source, dest;
  88. ...
  89. /* Setup rects and stuff */
  90. ...
  91.      CopyBits( &((CGrafPtr)gColorWindow)->portPixMap, 
  92.           &((CGrafPtr)gColorWindow)->portPixMap, 
  93.            &source, &dest, srcCopy, NIL_POINTER );        
  94.     
  95. The error that the compiler gives is:
  96.  
  97. File RColorTutor.c; Line 305
  98. Error:   first argument to function CopyBits does not match prototype
  99.  
  100. so... I look up CopyBits and find it to be:
  101.  
  102. pascal void CopyBits(const BitMap *srcBits,const BitMap *dstBits,const 
  103.     Rect *srcRect, const Rect *dstRect,short mode,RgnHandle maskRgn)
  104.  
  105. I am under the impression that with QD, CopyBits uses PixMaps the same 
  106. way as it used to use BitMaps.
  107.  
  108. I looked up an example that uses a GrafPtr cast instead of a CGrafPtr and 
  109. it works as:
  110.  
  111.     CopyBits (& ((GrafPtr)Port1)->portBits, &((GrafPtr)Port2)->portBits, 
  112.           &Rect1, &Rect2, 0, theregion);
  113.  
  114. so, I am left confused and stumped.  Could anyone tell me where I am 
  115. going wrong with my data structures?
  116.  
  117. -    Steve
  118.  
  119. +++++++++++++++++++++++++++
  120.  
  121. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  122. Date: Sun, 5 Jun 1994 16:19:56 GMT
  123. Organization: Best Before Yesterday
  124.  
  125. In article <2ss797$s80@post-office.nevada.edu>, ragatz@nevada.edu (Steven
  126. Ragatz) wrote:
  127.  
  128. > I am working through the examples in D. Mark's second Primer book using 
  129. > Think C/C++ v. 6.xx.  I am trying to use CopyBits to copy a PixMap to a 
  130. > window.  I think that I have typed the code in correctly and I have 
  131. > looked at the appropriate header files but things are still wrong.  Here is 
  132. > the code in question:
  133. > #include <Picker.h>
  134. > #include <Palette.h>
  135. >     #define NIL_POINTER    0L
  136. >     WindowPtr    gColorWindow;
  137. >     Rect        source, dest;
  138. > ...
  139. > /* Setup rects and stuff */
  140. > ...
  141. >      CopyBits( &((CGrafPtr)gColorWindow)->portPixMap, 
  142. >           &((CGrafPtr)gColorWindow)->portPixMap, 
  143. >            &source, &dest, srcCopy, NIL_POINTER );        
  144. >     
  145. > The error that the compiler gives is:
  146. > File ColorTutor.c; Line 305
  147. > Error:   first argument to function CopyBits does not match prototype
  148.  
  149. Steve,
  150.  
  151.      Code looks OK: just typecast your portPixMap to a (BitMap *) like
  152. this:
  153.  
  154. CopyBits ( (BitMap *) ((CGrafPtr)gColorWindow)->portPixMap, ...
  155.  
  156.      Alex
  157.  
  158. --
  159. Alex Metcalf, Best Before Yesterday
  160. Mac programmer in C, C++, HyperTalk, assembler
  161. Juggler, 3-ball tricks
  162.  
  163. Internet:          alex@metcalf.demon.co.uk
  164. Fax (UK):          (0570) 45636
  165. Fax (US / Canada): 011 44 570 45636
  166.  
  167. +++++++++++++++++++++++++++
  168.  
  169. >From kenlong@netcom.com (Ken Long)
  170. Date: Sun, 5 Jun 1994 16:22:58 GMT
  171. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  172.  
  173. I download a working version of Dave Mark's "ColorTotor" from America 
  174. Online, a couple years ago.  It's currently in my floppy archives.  
  175. someone else could probably answer your question before I log off, get it, 
  176. log on and send you the fragment.
  177.  
  178. But I was also amazed at the similaritios between that program and one 
  179. called "CopyBits" which I got of ftp devtools.symantec.com.  I'd heard 
  180. mention of this source in a few conferences, but no one ever said where 
  181. to find it.  It's much more sophisticated and has greater scope than 
  182. Dave's little ditty.
  183.  
  184. -Ken-
  185.  
  186. +++++++++++++++++++++++++++
  187.  
  188. >From arose@ATHENA.MIT.EDU (Alex Rosen)
  189. Date: 5 Jun 1994 17:30:33 GMT
  190. Organization: Massachusetts Institute of Technology
  191.  
  192. [Confusion about copybits parameters]
  193.  
  194. Here's a message I saved from Tim Dierks from quite a while ago, which
  195. explains it very cleary.
  196. --Alex
  197.  
  198.  
  199. In article <w4s36la@rpi.edu>, raffuj@aix.rpi.edu (Jose Raffucci) wrote:
  200. > I'm really curious about what parameters should actually passed to 
  201. > copybits.  IM V and think ref 1.0 say the first two should be address 
  202. > of a pixmap or bitmap.  The examples all show :
  203. >  CopyBits(&(GrafPtr)->portBits, ...);
  204. > In IM VI however (21-19) it says that you can pass it the following:
  205. >  pixBase =  GetGWorldPixMap(world);   (pixbase is PixMapHandle)
  206. >  CoypBits( *pixBase, ...);                       
  207. > 1 worlds, and 2 doesn't.  I looked and the addresses returned for 1&2
  208. > are not the same.  close, but not quite.  I've played around with just about
  209. > every way toet the address of the pixmap for 2, and nothing works, and yes, 
  210. > I locked my handles.
  211. > Why the apparent inconsistency?  
  212.  
  213. CopyBits is definitely the wackiest call in the ToolBox.  It can accept
  214. three different kinds of parameters for its "sourceBits" and "destBits"
  215. arguments:
  216.  
  217.  - A pointer to a BitMap
  218.  - A pointer to a PixMap
  219.  - A pointer to the spot in a CGrafPort where a BitMap is supposed to be
  220.    if this port were actually a GrafPort
  221.  
  222. It's got a little song and dance it does to figure out what it's getting,
  223. but that's not important.  The weirdest thing is that you can pass in a
  224. pointer to a PixMap, which is the PixMapHandle dereferenced once.  This
  225. PixMapHandle does not have to be locked; even though CopyBits can move
  226. memory, it won't do so until after it's figured out what kind of
  227. arguments it's getting and recovered the original handle, if necessary.
  228.  
  229. I don't know if this will help you solve your problem, but it's certainly
  230. entertained me to tell you this.
  231.  
  232. Tim Dierks                                                   
  233. absurd@apple.com
  234.                   I work for MacDTS, but I speak for myself.
  235.  "If you can't lick 'em, put 'em on with a big piece of tape." -
  236. Negativland
  237.  
  238.  
  239.  
  240.  
  241. ---------------------------
  242.  
  243. >From r4650001@nickel.laurentian.ca
  244. Subject: Gestalt, SU3.0 & List Manager
  245. Date: 4 Jun 94 16:36:53 -0500
  246. Organization: Laurentian University
  247.  
  248. Does anybody know if there is a Gestalt selector code to see if System Update
  249. 3.0 is installed? Specifically, I want to know if the new LDEF used by the
  250. StandardGetFile dialog box is available. (i.e. the one that puts an icon next
  251. to the item name.) Also, I would like to know what format the data should be
  252. in when I pass a handle to LSetCell(sic).
  253.  
  254. E-mail is preferred, but if you post to the group, that's ok.
  255.  
  256. --JA
  257. R4650001@nickel.laurentian.ca
  258.  
  259. +++++++++++++++++++++++++++
  260.  
  261. >From wysocki@netcom.com (Chris Wysocki)
  262. Date: Sat, 4 Jun 1994 23:18:26 GMT
  263. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  264.  
  265. In article <1994Jun4.163653.1@nickel.laurentian.ca> r4650001@nickel.laurentian.ca writes:
  266.  
  267. >Does anybody know if there is a Gestalt selector code to see if System Update
  268. >3.0 is installed? Specifically, I want to know if the new LDEF used by the
  269. >StandardGetFile dialog box is available. (i.e. the one that puts an icon next
  270. >to the item name.)
  271.  
  272. Call Gestalt with the "gestaltStandardFileAttr" ('stdf') selector and
  273. test the "gestaltStandardFileHasColorIcons" bit (2) in the response.
  274.  
  275. >Also, I would like to know what format the data should be
  276. >in when I pass a handle to LSetCell(sic).
  277.  
  278. I don't believe that the format of the data used by the Standard File
  279. LDEF has been documented.  If this is in fact the case, I would
  280. recommend _not_ trying to reverse-engineer the format, as this is
  281. prone to breaking in the future.  Instead, write your own LDEF that
  282. does what you want.  LDEFs aren't very hard to write; I imagine that a
  283. reasonably competent Macintosh programmer could write such an LDEF in
  284. a few hours, if not less.
  285.  
  286. Chris.
  287.  
  288.  
  289. +++++++++++++++++++++++++++
  290.  
  291. >From Alexander M. Rosenberg <alexr@apple.com>
  292. Date: Mon, 6 Jun 1994 02:14:33 GMT
  293. Organization: Hackers Anonymous
  294.  
  295. In article <wysockiCqwBEq.M9B@netcom.com> Chris Wysocki, wysocki@netcom.com
  296. writes:
  297. > I don't believe that the format of the data used by the Standard File
  298. > LDEF has been documented.  If this is in fact the case, I would
  299. > recommend _not_ trying to reverse-engineer the format, as this is
  300. > prone to breaking in the future.  Instead, write your own LDEF that
  301. > does what you want.  LDEFs aren't very hard to write; I imagine that a
  302. > reasonably competent Macintosh programmer could write such an LDEF in
  303. > a few hours, if not less.
  304.  
  305. I agree with Chris.
  306.  
  307. DO NOT REVERSE ENGINEER THE SYSTEM SOFTWARE AND USE THAT INFORMATION IN YOUR
  308. APPLICATIONS! WE WILL HUNT YOU DOWN AND KILL YOU.
  309.  
  310. In this case, I was just speaking with the Software Mercenary responsible for
  311. including the Macintosh Easy Open version of Standard File in System Update
  312. 3.0. We were speaking of a way to increase the limit of items that can be
  313. displayed for a given directory. Doing so would specifically break people who
  314. "know" the format of the cell data.
  315. - -------------------------------------------------------------------------
  316. -  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
  317. -  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
  318. -  Palo Alto, CA 94301     -                                - Systems     -
  319. -  (415) 329-8463          - Nobody is my employer so       - :-)         -
  320. -                          - nobody cares what I say.       -             -
  321.  
  322. ---------------------------
  323.  
  324. >From mpcline@cats.ucsc.edu (Matthew Paul Cline)
  325. Subject: How to tell what kind of drive a volume is?
  326. Date: 2 Jun 1994 23:17:36 GMT
  327. Organization: University of California, Santa Cruz
  328.  
  329.  
  330.     Is there any sort of system call that will tell you the type
  331. of a volume (flopyy driver, hard drive, or other)?  Thanks in advance.
  332. -- 
  333. Poodles have no honor.               Have you hugged your shoggoth today?
  334. GE d? -p+ c++(+++) l++ u++ e+ m+ s/- n+(-) h+ f !g w+ t+ r y+
  335.  
  336. +++++++++++++++++++++++++++
  337.  
  338. >From mclow@coyote.csusm.edu (Marshall Clow)
  339. Date: 2 Jun 1994 16:59:01 -0700
  340. Organization: California State University San Marcos
  341.  
  342. Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  343.  
  344. >    Is there any sort of system call that will tell you the type
  345. >of a volume (flopyy driver, hard drive, or other)?  Thanks in advance.
  346.  
  347. Not in general, but you can infer a lot about a volume from looking
  348. at a few bits of information.
  349.  
  350. 1) What driver talks to it? Is it '.Sony'? Then it's a floppy.
  351. 2) Is the driver in the range for SCSI devices?
  352. 3) Is the volume read-only?
  353. 4) Is the volume ejectable?
  354. 5) Is the volume "remote"?
  355. .. and so on.
  356.  
  357. None of the information is conclusive, but you can figure out what
  358. you need to know >95% of the time.
  359.  
  360. Marshall Clow
  361. Aladdin Systems
  362. mclow@san_marcos.csusm.edu
  363.  
  364.  
  365. +++++++++++++++++++++++++++
  366.  
  367. >From Jerry.Halstead@launchpad.unc.edu (jerry halstead)
  368. Date: 3 Jun 1994 00:45:39 GMT
  369. Organization: University of North Carolina Extended Bulletin Board Service
  370.  
  371. reply to message from mpcline@cats.ucsc.edu:
  372.  
  373. I got some help last week correlating between a vRefNum and the actual
  374. SCSI ID.  I used PBHGetVInfo to get the refnum and the following formula
  375. to convert to a SCSI ID:
  376.  
  377.  HParamBlockRec    volPB;
  378.  volPB.volumeParam.ioVRefNum = 0;
  379.  volPB.volumeParam.ioNamePtr = (StringPtr)name;
  380.  volPB.volumeParam.ioVolIndex = i;   // this is in a loop to get all drivers
  381. if (PBHGetVInfo(&volPB,FALSE) == noErr){        
  382.    RefNum = abs(volPB.volumeParam.ioVDRefNum+1);
  383.    scsiID = RefNum-32;  }
  384.  
  385. I then use the scsiID with the SCSI manager routines to obtain Inquiry data
  386. for the given drive, which includes, among other things, the device type. 
  387. Here's the beginnings of the device type table from the SCSI spec:
  388.  
  389. ____SCSI_Dev_types___
  390. direct access (disk) 0
  391. seq access (tape)    1
  392. printer device       2
  393. processor            3
  394. worm                 4
  395. cd-rom               5
  396.  
  397. Of course this may not be the level of implementation you had in mind. 
  398. Hope it helps.
  399.  
  400.  
  401. Big head Jerry and the demonstrables....
  402. --
  403. - ----------------------------------------------------------------------------
  404.  \ The above does not represent OIT, UNC-CH, laUNChpad, or its other users. /
  405.    ------------------------------------------------------------------------
  406.  
  407. +++++++++++++++++++++++++++
  408.  
  409. >From blob@apple.com (Brian Bechtel)
  410. Date: 4 Jun 1994 07:00:36 -0700
  411. Organization: Apple Computer, Inc., Cupertino, California
  412.  
  413. mclow@coyote.csusm.edu (Marshall Clow) writes:
  414.  
  415. >Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  416.  
  417. >>    Is there any sort of system call that will tell you the type
  418. >>of a volume (flopyy driver, hard drive, or other)?  Thanks in advance.
  419.  
  420. >Not in general, but you can infer a lot about a volume from looking
  421. >at a few bits of information.
  422.  
  423. >1) What driver talks to it? Is it '.Sony'? Then it's a floppy.
  424.  
  425. Or an HD 20.  Or something which is trying to emulate either a floppy or
  426. an HD 20.  (The HD 20 was the first Apple-labeled Macintosh hard drive.
  427. It did not use SCSI.)
  428.  
  429. >2) Is the driver in the range for SCSI devices?
  430.  
  431. With Asynchronous SCSI Manager 4.3, SCSI devices have can drivers
  432. outside the traditional range.
  433.  
  434. >3) Is the volume read-only?
  435. >4) Is the volume ejectable?
  436. >5) Is the volume "remote"?
  437. >.. and so on.
  438.  
  439. >None of the information is conclusive, but you can figure out what
  440. >you need to know >95% of the time.
  441.  
  442. Yup.
  443.  
  444. --Brian Bechtel     blob@apple.com     "My opinion, not Apple's"
  445.  
  446. +++++++++++++++++++++++++++
  447.  
  448. >From dshayer@netcom.com (David Shayer)
  449. Date: Sun, 5 Jun 1994 22:36:37 GMT
  450. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  451.  
  452. Brian Bechtel (blob@apple.com) wrote:
  453. : mclow@coyote.csusm.edu (Marshall Clow) writes:
  454. : >Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  455. : >>    Is there any sort of system call that will tell you the type
  456. : >>of a volume (flopyy driver, hard drive, or other)?  Thanks in advance.
  457. : >1) What driver talks to it? Is it '.Sony'? Then it's a floppy.
  458. : Or an HD 20.  Or something which is trying to emulate either a floppy or
  459. : an HD 20.  (The HD 20 was the first Apple-labeled Macintosh hard drive.
  460. : It did not use SCSI.)
  461.  
  462. You can tell a floppy from an HD20 by driver refnum.  The floppy driver
  463. has refnum -5, while the hd20 driver has refnum -2.
  464.  
  465.  
  466. +------------------------------------------------------------------------+
  467. |David Shayer                                  (415) 595-2523            |
  468. |Sentient Software / Symantec                  shayer@applelink.apple.com|
  469. |"Subvert the Dominant Paradigm."              Applelink: SHAYER         |
  470. +------------------------------------------------------------------------+
  471.  
  472.  
  473. ---------------------------
  474.  
  475. >From idowell@bbn.com (Ian Dowell)
  476. Subject: Photoshop Plug-in Filters useable with other programs?
  477. Date: 7 Jun 94 04:35:24 GMT
  478. Organization: Bolt, Beranek and Newman Inc.
  479.  
  480. Are Photoshop Plug-in Filters useable with other programs? 
  481. Is it possible to write a program which could use the filters
  482. to do transformations?
  483. Is there any documentation or example code available?
  484.  
  485. Thanks in advance!
  486. Ian
  487. -- 
  488. - ----------------------------------------------------------------------
  489. Ian Dowell            Bolt, Beranek & Newman, Cambridge, MA
  490. idowell@bbn.com       (617) 873-2673
  491.  
  492. +++++++++++++++++++++++++++
  493.  
  494. >From tgaul@halcyon.com (Troy Gaul)
  495. Date: Mon, 06 Jun 1994 22:35:41 -0700
  496. Organization: Infinity Systems
  497.  
  498. In article <idowell.770963724@labs-n.bbn.com>, idowell@bbn.com (Ian Dowell)
  499. wrote:
  500.  
  501. > Are Photoshop Plug-in Filters useable with other programs? 
  502. > Is it possible to write a program which could use the filters
  503. > to do transformations?
  504. > Is there any documentation or example code available?
  505.  
  506. Photoshop filters, in general, are usable by other programs.  To write such
  507. a program, simply follow the interface given in the Adobe plug-in
  508. specification files (the same ones you need if you're writing plug-ins). 
  509. You can find this specification in various places online, including from
  510. anonymous FTP at:
  511.  
  512. ftp://export.acs.cmu.edu//pub/PSarch/misc-mac/PS2.5Developers_Kit.cpt.hqx
  513.  
  514. The plug-ins _included_ with Photoshop, however, are not usable by other
  515. programs because of a passwording sceme they use to verify that they are
  516. talking to Photoshop.
  517.  
  518. _troy
  519. //////// //////___Troy Gaul_________________________tgaul@halcyon.com__ //
  520.   //    //       Infinity Systems ; Redmond, Washington                //
  521.  //    //  //  "Insert witty quote here."                             //
  522. //    //////________________________________________________________ //
  523.  
  524. ---------------------------
  525.  
  526. >From Ken Prehoda <kenp@nmrfam.wisc.edu>
  527. Subject: Scheduling Sleep in WaitNextEvent
  528. Date: 4 Jun 1994 02:54:55 GMT
  529. Organization: Univ of Wisc-Madison
  530.  
  531. I have a number of questions concerning calling WaitNextEvent.
  532.  
  533. First, it has been mentioned that WaitNextEvent should
  534. only be called about once a second (possibly when
  535. you aren't doing anything).  What is the best way to accomplish
  536. this?
  537.  
  538. Second, what is the best way to schedule the sleep
  539. parameter?  I can envision four situations that may
  540. require different values for sleep:
  541.  
  542. 1) I'm in the foreground and doing something.
  543.  
  544. 2) I'm in the foreground and doing nothing.
  545.  
  546. 3) I'm in the background doing something.
  547.  
  548. 4) I'm in the background doing nothing.
  549.  
  550. What are the best values in these situations?
  551.  
  552. Thanks,
  553. Ken Prehoda
  554. kenp@nmrfam.wisc.edu
  555.  
  556. +++++++++++++++++++++++++++
  557.  
  558. >From rmah@panix.com (Robert S. Mah)
  559. Date: Fri, 03 Jun 1994 23:38:47 -0500
  560. Organization: One Step Beyond
  561.  
  562. Ken Prehoda <kenp@nmrfam.wisc.edu> wrote:
  563.  
  564. > I have a number of questions concerning calling WaitNextEvent.
  565. > First, it has been mentioned that WaitNextEvent should only be called
  566. > about once a second (possibly when you aren't doing anything).  What 
  567. > is the best way to accomplish this?
  568.  
  569. Not exactly.  When people refered to fixed-time calling of WNE it was in
  570. the context of executing computationally intensive code and still giving
  571. time to other apps.  IOW, being a nice coop multi-tasking app (NCMTA).
  572.  
  573. When you're not doing anything that's computationally intensive, that is,
  574. you don't need idle time, just give the sleep value something really big.
  575.  
  576. What will happen is that any time you're app gets a real event such as
  577. a mouse down or an update, WNE will return immediately after the event is
  578. posted (as long as the other apps are NCMTA's) so you can handle it.
  579.  
  580. If you're app doesn't need to do anything (i.e. there are no events
  581. pending),
  582. then WNE won't bother returning until either 1) the sleepTime has passed or
  583. 2) none of the other apps need to do anything either.
  584.  
  585. To sum up.  The sleep parameter is a _suggestion_ to WNE about how much
  586. time
  587. you need between idle events.  WNE may return before it has elapsed if the
  588. machine is not busy.  It may return after it has elapsed if the machine is
  589. really busy.  The fixed-timing technique for calling WNE is to assure your
  590. app gets a large timeslice when it is executing some critical and intensive
  591. code.
  592.  
  593. Cheers,
  594. Rob
  595. ___________________________________________________________________________
  596. Robert S. Mah  -=-  One Step Beyond  -=-  212-947-6507  -=-  rmah@panix.com
  597.  
  598. +++++++++++++++++++++++++++
  599.  
  600. >From j-norstad@nwu.edu (John Norstad)
  601. Date: Fri, 03 Jun 1994 23:11:44 -0500
  602. Organization: Northwestern University
  603.  
  604. In article <2soqdv$jeu@news.doit.wisc.edu>, Ken Prehoda
  605. <kenp@nmrfam.wisc.edu> wrote:
  606.  
  607. > I have a number of questions concerning calling WaitNextEvent.
  608. > First, it has been mentioned that WaitNextEvent should
  609. > only be called about once a second (possibly when
  610. > you aren't doing anything).  What is the best way to accomplish
  611. > this?
  612. > Second, what is the best way to schedule the sleep
  613. > parameter?  I can envision four situations that may
  614. > require different values for sleep:
  615. > 1) I'm in the foreground and doing something.
  616. > 2) I'm in the foreground and doing nothing.
  617. > 3) I'm in the background doing something.
  618. > 4) I'm in the background doing nothing.
  619. > What are the best values in these situations?
  620.  
  621. These are very good and very difficult questions, and not everyone agrees
  622. on the answers. (I just had a debate about this issue with Leonard
  623. Rosenthol today, in fact.)
  624.  
  625. Here's what I do, in three different circumstances:
  626.  
  627. (1) In my main event loop, when my program is idle, I call WNE with sleep
  628. = GetCaretTime(). This gives other non-idle processes plenty of time, and
  629. in the case where I'm in the foreground and my active window includes a
  630. text editing field, it keeps my caret blinking. I also pass a mouseRgn
  631. parameter to WNE in this call, to get woken up immediately if I'm in the
  632. foreground and the user moves the mouse and I need to adjust the cursor.
  633.  
  634. (2) During CPU-intensive tasks, I call a "GiveTime" function periodically.
  635. This function calls WNE once every five ticks with sleep=0 and
  636. mouseRgn=nil. It handles at least update, activate, suspend, and resume
  637. events. It also checks for user cancel actions (Command-period, Escape,
  638. click on Cancel button in status window, or whatever). It also keep my
  639. animated cursor spinning.
  640.  
  641. It's important to throttle your WNE calls in this case. Your GiveTime
  642. function should only call WNE every 4-6 ticks (Apple-recommended values).
  643. This avoids excessive process switching (thrashing), gives other
  644. CPU-intensive tasks plenty of time, makes the foreground process
  645. responsive to user actions when you are in the background, doesn't slow
  646. you down noticeable on an otherwise idle system, gives excellent response
  647. to user cancel operations, gives a smoothly animated cursor, and provides
  648. uniform behavior independent of CPU speed. It's a good balance.
  649.  
  650. You mentioned only calling WNE once per second (60 ticks). That's way too
  651. long - you are really hogging the CPU. 5 ticks is much more appropriate.
  652.  
  653. (3) When waiting for a network task to complete (e.g., during an
  654. asynchronous MacTCP send or receive call, while I'm polling the result
  655. code in the parameter block), I call WNE continuously with sleep=0 and
  656. mouseRgn=nil. The difference between (2) and (3) is that (3) doesn't
  657. throttle the WNE calls to every 5 ticks. This is because I have nothing to
  658. compute in this case, so I want to yield to other processes immediately to
  659. let them use the available CPU time while I'm waiting. I use the same
  660. GiveTime function as in (2), but I pass a parameter telling it to call WNE
  661. even if the 5 ticks hasn't expired.
  662.  
  663. Notice that I don't do anything special when I'm in the background - the
  664. algorithm is the same. Some people use a non-zero sleep time when they're
  665. in the backgound doing CPU-intensive tasks. This slows you down quite a
  666. bit, even on an otherwise idle system, and I think it's wrong. The correct
  667. way to yield time to other processes when you are in the background is to
  668. make certain you call WNE at least every 5 ticks, not to use a non-zero
  669. sleep time. Indeed, this is always the correct way to yield time to other
  670. processes, and being in background or in the foreground really doesn't
  671. matter.
  672.  
  673. As an example, here's my GiveTime function in NewsWatcher:
  674.  
  675. /*----------------------------------------------------------------------------
  676.    GiveTime
  677.    
  678.    Give time to other processes during long operations and check for 
  679.    user cancels.
  680.    
  681.    Entry:   waiting = true if waiting for MacTCP or something else.
  682.    
  683.    Exit:    function result = error code (userCanceledErr if canceled
  684.                by user, else noErr).
  685. - --------------------------------------------------------------------------*/
  686.  
  687. OSErr GiveTime (Boolean waiting)
  688. {
  689.    EventRecord ev;
  690.    Boolean gotEvt;
  691.    static long nextTime = 0;
  692.       
  693.    if (!gLongOperation) {
  694.       HiliteMenu(0);
  695.       SpinCursor(0);
  696.       ShowCursor();
  697.       gLongOperation = true;
  698.    }
  699.  
  700.    if (TickCount() >= nextTime) {
  701.       SpinCursor(16);
  702.       nextTime = TickCount() + 5;
  703.       waiting = true;
  704.    }
  705.  
  706.    if (waiting) {
  707.       gotEvt = WaitNextEvent(everyEvent, &ev, 0, nil);
  708.       if (gotEvt) HandleEvent(&ev);
  709.    }
  710.    
  711.    return gCancel ? userCanceledErr : noErr;
  712. }
  713.  
  714. The "HandleEvent" function is the same event handling function called by
  715. my main event loop.
  716.  
  717. "gCancel" is a global variable which is set to true by my event handlers
  718. when a user cancel event occurs.
  719.  
  720. "gLongOperation" is a global variable which records whether I'm busy doing
  721. something or idle. Some of the event handlers need to know this
  722. information.
  723.  
  724. I hope this is interesting and helps.
  725.  
  726. -- 
  727. John Norstad
  728. Academic Computing and Network Services
  729. Northwestern University
  730. j-norstad@nwu.edu
  731.  
  732. +++++++++++++++++++++++++++
  733.  
  734. >From jumplong@aol.com (Jump Long)
  735. Date: 4 Jun 1994 23:42:05 -0400
  736. Organization: America Online, Inc. (1-800-827-6364)
  737.  
  738. In article <j-norstad-0306942311440001@aragorn12.acns.nwu.edu>,
  739. j-norstad@nwu.edu (John Norstad) writes:
  740.  
  741. >(3) When waiting for a network task to complete (e.g., during an
  742. >asynchronous MacTCP send or receive call, while I'm polling the
  743. result
  744. >code in the parameter block), I call WNE continuously with sleep=0
  745. and
  746. >mouseRgn=nil...
  747.  
  748. If you're waiting for an asynchronous request to complete with a
  749. completion routine, then you can have the completion routine call
  750. WakeUpProcess using your application's process serial number.  That
  751. way, you can give up more time to other processes and still have your
  752. application awaken when it needs to be awakened.
  753.  
  754. - Jim Luther
  755.  
  756.  
  757. +++++++++++++++++++++++++++
  758.  
  759. >From j-norstad@nwu.edu (John Norstad)
  760. Date: Sun, 05 Jun 1994 08:48:16 -0500
  761. Organization: Northwestern University
  762.  
  763. In article <2srhid$572@search01.news.aol.com>, jumplong@aol.com (Jump
  764. Long) wrote:
  765.  
  766. > If you're waiting for an asynchronous request to complete with a
  767. > completion routine, then you can have the completion routine call
  768. > WakeUpProcess using your application's process serial number.  That
  769. > way, you can give up more time to other processes and still have your
  770. > application awaken when it needs to be awakened.
  771.  
  772. But then you can't poll for user cancel events, which is very important
  773. when waiting for long network requests to complete.
  774.  
  775. -- 
  776. John Norstad
  777. Academic Computing and Network Services
  778. Northwestern University
  779. j-norstad@nwu.edu
  780.  
  781. ---------------------------
  782.  
  783. >From Paul Goyette <goyettep@ccnet.com>
  784. Subject: What is "Clipping Extension"?
  785. Date: 5 Jun 1994 15:17:58 GMT
  786. Organization: (none)
  787.  
  788. The title says it all - I've installed the Drag&Drop stuff, and when I
  789. reboot the Mac,
  790. I get a message that the Clipping Extension cannot be used because it is
  791. "too new".
  792.  
  793. So, what is this Cliping Extension, and what version of what program do I
  794. need to
  795. be able to use it?
  796.  
  797. - ---------------------------------------------------------
  798. Paul Goyette        |  PGP Public key available on request 
  799. goyettep@ccnet.com  |  Fingerprint: 54 03 19 EE 99 57 FB 79
  800.                     |               74 0A D0 E6 BE 84 0E DA
  801. - ---------------------------------------------------------
  802.  
  803. +++++++++++++++++++++++++++
  804.  
  805. >From Richard Cardona <rickc@mail.utexas.edu>
  806. Date: 5 Jun 1994 17:43:21 GMT
  807. Organization: UT-Austin
  808.  
  809. In article <2ssqb6$apf@ccnet.ccnet.com> Paul Goyette, goyettep@ccnet.com
  810. writes:
  811. >So, what is this Cliping Extension, and what version of what program do I
  812. >need to
  813. >be able to use it?
  814.  
  815. In System 7.0.x, you need to run Macintosh Drag and Drop and the clipping
  816. extension to have full clipping files support.  What are clipping files? 
  817. They are Drag and Drop data the finder can support and create files out
  818. of.  Right now I believe the Finder only supports text, pictures and
  819. sound.  Moovs are in the works.  With the clipping extension, the finder
  820. can even open the clipping files and show you what they contain - neato!
  821. Example, highlight a piece of text from SimpleText and drag it over to
  822. the Finder, release it, and the Finder will create a text clipping file. 
  823. You must have the clipping extension to do this.  Similarly, a text
  824. clipping file can be dragged back into Simpletext and "pasted."
  825.  
  826. In System 7.5,the clipping extension is useless and built in to the
  827. Finder, but you still need the Drag and Drop extension for now.
  828.  
  829. I suggest you get a copy of both the Drag and Drop extension 1.1 and the
  830. Clipping extension from June's Developer CD.  The documentation is also a
  831. little confusing, claiming you need Finder 7.1.3 also.  (7 Pro's Finder
  832. is 7.1.4)  But, I know this combo works together (at least on a
  833. Powermac).  I don't have an on-line ftp site for the clipping extension,
  834. anyone? The WWDC contains the Drag and Drop extension for 7.5 I don't
  835. recommend this version for use without 7.5.
  836.  
  837. Rick
  838.  
  839. +++++++++++++++++++++++++++
  840.  
  841. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  842. Date: Mon, 6 Jun 1994 20:29:54 GMT
  843. Organization: Apple Computer
  844.  
  845. Paul Goyette, goyettep@ccnet.com writes:
  846. > So, what is this Cliping Extension, and what version of what program do I
  847. > need to
  848. > be able to use it?
  849.  
  850. You need Finder 7.1.3 or 7.1.4. (7.1.4 is identical to 7.1.3 except for the
  851. size of a text field in the 'About This Mac' window, to support the
  852. PowerMacs.)
  853.  
  854. Richard Cardona, rickc@mail.utexas.edu writes:
  855. > Right now I believe the Finder only supports text, pictures and
  856. > sound.  Moovs are in the works.
  857.  
  858. The Finder will make clipping files out of any kind of data an application
  859. can drop, and you can then take those clippings and drop them into another
  860. app. The only type limitations are what kinds of clippings the Finder can
  861. open up and display -- only text and pict, right now.
  862.  
  863. > I suggest you get a copy of both the Drag and Drop extension 1.1 and the
  864. > Clipping extension from June's Developer CD.
  865.  
  866. D&D 1.1 is also on the bookmark CD with 'develop' 18. This includes Finder
  867. 7.1.3.
  868.  
  869. --Jens Alfke
  870.   jens_alfke@powertalk              Rebel girl, rebel girl,
  871.             .apple.com              Rebel girl you are the queen of my world
  872.  
  873. ---------------------------
  874.  
  875. >From valentin+@pitt.edu (Shawn V. Hernan)
  876. Subject: allocating memory quickly -- how?
  877. Date: 2 Jun 1994 20:28:04 GMT
  878. Organization: The University of Pittsburgh
  879.  
  880. Greetings all, 
  881.  
  882.  
  883.      I want to allocate a large array (1000 elements) of pointers to
  884. characters the beginning of a program (it makes sense to do it this way
  885. in this case) . So, in a loop, I have code that looks like the
  886. following:
  887.  
  888.     array[i][j] = NewPtrClear(80);
  889.  
  890.     I have a similar Unix and VMS program that uses malloc in the same
  891. way I use NewPtr above. All three programs work pretty well, excpet
  892. that allocating the memory on the Macintosh is VERY SLOOOOOOW. Is there
  893. a faster way to allocate lots of little chunks of memory than NewPtr?
  894. malloc dies a cold death on the Mac, and I don't know why. I've looked
  895. through the faq's with no luck. 
  896.  
  897.  
  898.        Any help is deeply appreciated. 
  899.  
  900. Thanks, 
  901. Shawn
  902.  
  903.  
  904.  
  905.  
  906. Shawn Valentine Hernan       |Is the War on Drugs worth it?  
  907. The University of Pittsburgh |Why does the government want your guns?  
  908. valentin+@pitt.edu           |Does RICO ring a bell?   
  909. 412-624-6425                 |Did you vote in the last election?
  910.  
  911. +++++++++++++++++++++++++++
  912.  
  913. >From mgr@aggroup.aggroup.com (Mike Russell)
  914. Date: Thu, 02 Jun 1994 15:36:06 -0800
  915. Organization: the ag group, inc.
  916.  
  917. In article <2slfcl$78r@usenet.srv.cis.pitt.edu>, valentin+@pitt.edu (Shawn
  918. V. Hernan) wrote:
  919. >      I want to allocate a large array (1000 elements) of pointers to
  920. > characters the beginning of a program (it makes sense to do it this way
  921. >     array[i][j] = NewPtrClear(80);
  922.  
  923. try allocating one giant block instead:
  924.  
  925.  char *p = NewPtrClear(80L * height * width);
  926.  
  927. then in your loop
  928.  
  929.  array[i][j] = p + ((long)i * (long)j) * 80L;
  930.  
  931. As for why - the reason goes back to the original tiny Mac that the
  932. Memory Manager was designed for.  Call it a homage to history.
  933.  
  934. +++++++++++++++++++++++++++
  935.  
  936. >From stk@uropax.contrib.de (Stefan Kurth)
  937. Date: 3 Jun 1994 04:06:01 +0200
  938. Organization: Contributed Software GbR
  939.  
  940. In article <2slfcl$78r@usenet.srv.cis.pitt.edu>,
  941. Shawn V. Hernan <valentin+@pitt.edu> wrote:
  942.  
  943. > that allocating the memory on the Macintosh is VERY SLOOOOOOW. Is there
  944. > a faster way to allocate lots of little chunks of memory than NewPtr?
  945.  
  946. NewHandle might be a little bit faster than NewPtr, depending on how many
  947. relocatable blocks you have in your heap; however, I doubt that the
  948. difference will be very big.
  949.  
  950. > malloc dies a cold death on the Mac, and I don't know why.
  951.  
  952. What problems do you have with malloc?
  953.  
  954. In the program that I'm currently writing, I have to deal with
  955. ten-thousands of very small blocks; at first I used handles for all of
  956. them, because, well, we're on a Mac, and "one uses" handles on a Mac. Later
  957. I have changed all the code to use malloc instead, and some portions of the
  958. program are now more than twice as fast (especially the routines that
  959. allocate lots of blocks). I'm not very happy about the fact that free()
  960. never releases the memory that has been allocated, but speed is more
  961. important for me than that (in this case at least - normally I don't use
  962. malloc in my programs).
  963.  
  964. ________________________________________________________________________
  965. Stefan Kurth                 Berlin, Germany              stk@contrib.de
  966.  
  967. +++++++++++++++++++++++++++
  968.  
  969. >From rang@winternet.com (Anton Rang)
  970. Date: 04 Jun 1994 23:45:19 GMT
  971. Organization: Minnesota Angsters
  972.  
  973. In article <coopem-030694133005@coopem.dialup.access.net> coopem@panix.com (Marc Cooperman) writes:
  974. >In my limited experience in mac programming, I read somewhere that the Mac
  975. >memory manager was designed to manage a system with small memory (like 128K
  976. >- remember that). So basically any memory operation can cause the heap to
  977. >be compacted - the mac is trying to optimize memory utilization and
  978. >minimize fragmentation.
  979.  
  980.   This is true to some extent.  If you use pointers much, you'll get
  981. quite a lot of memory shuffling, because the memory manager tries to
  982. keep all of the non-relocatable blocks together.  If you use handles
  983. instead, and call MaxApplZone() at the beginning of your program,
  984. there won't be too much shuffling going on.
  985.  
  986.   I should also note that I got some information in the mail a couple
  987. of months ago from a company that makes a replacement for the whole
  988. malloc()/newptr()/newhandle() suite.  I think it's called SmartHeap.
  989. Looked pretty interesting, for programs which need to do a *lot* of
  990. memory allocation.
  991. --
  992. Anton Rang (rang@winternet.com)
  993.  
  994. +++++++++++++++++++++++++++
  995.  
  996. >From shawn@greebe (shawn@mdli.com)
  997. Date: Mon, 6 Jun 1994 16:43:15 GMT
  998. Organization: HoloNet National Internet Access System: 510-704-1058/modem
  999.  
  1000. Shawn V. Hernan (valentin+@pitt.edu) wrote:
  1001. > malloc dies a cold death on the Mac, and I don't know why. I've looked
  1002. > through the faq's with no luck.
  1003.  
  1004. Assuming that you are using Think C, the dead malloc may actually be a 
  1005. problem where you might be overrunning the limits of your allocated
  1006. block. In Think C this can corrupt the next structure in such a way that
  1007. is frequently locks up the machine at the next memory allocation call
  1008. which tries to use this memory. Is it possible that you are trying to
  1009. store 80 character strings in those character pointers ? The terminating
  1010. null would them blow out the next allocation and cause just this sort
  1011. of behavior.
  1012.  
  1013. This is a long standing Think C behavior and lots of people have run into
  1014. it, not really a bug (you are after all overrunning your allocation), 
  1015. but quite annoying.
  1016.  
  1017. I agree with the original poster about allocation of a single large block
  1018. and then assigning the addresses, this is often faster. Think actually uses
  1019. a variation of this for malloc.
  1020.  
  1021. Shawn Lavin (shawn@mdli.com)
  1022. As always, my opinions are my own
  1023.  
  1024.  
  1025. ---------------------------
  1026.  
  1027. >From brandyn@apple.com (Brandyn Webb)
  1028. Subject: sqrti() [Re: Faster Square Root Algorithm]
  1029. Date: 27 May 1994 16:28:39 -0700
  1030. Organization: Apple Computer Inc, Cupertino, CA
  1031.  
  1032.     Here's the integer sqrt() code I use; it looks similar to
  1033. some others posted, but may be a little faster (or slower; who
  1034. knows).  Hope someone finds it useful:
  1035.  
  1036.  
  1037. #define iterate(e)            \
  1038.     y <<= 1;                \
  1039.     temp = (y|1)<<(2*e);    \
  1040.     if (temp <= X) {        \
  1041.         y |= 2;                \
  1042.         X -= temp;             \
  1043.     }                 
  1044.  
  1045. unsigned sqrti(X)
  1046. register unsigned X;
  1047. {
  1048.     register unsigned yy, y, temp;
  1049.  
  1050.     y = 0;
  1051.     iterate(15); iterate(14); iterate(13); iterate(12);
  1052.     iterate(11); iterate(10); iterate(9); iterate(8);
  1053.     iterate(7); iterate(6); iterate(5); iterate(4);
  1054.     iterate(3); iterate(2); iterate(1); iterate(0);
  1055.     return y>>1;
  1056. }
  1057.  
  1058.  
  1059.     -Brandyn (brandyn@brainstorm.com)
  1060.  
  1061.  
  1062. +++++++++++++++++++++++++++
  1063.  
  1064. >From lakeland@mu.sans.vuw.ac.nz (Corrin Lakeland)
  1065. Date: 6 Jun 1994 00:55:23 GMT
  1066. Organization: SANS, Victoria University of Wellington, New Zealand.
  1067.  
  1068. > [Another SQRT routine]
  1069.  
  1070. I was just wondering, would it not be faster to set up a log table in 
  1071. memory and use that for calculating square roots.  Depending on how much 
  1072. speed and or accuracy you need you could change the table (speed = 
  1073. greater range, accuricy = more choices).  This should be very fast to 
  1074. look up if you are doing square roots extensivly - otherwise the memory 
  1075. use would make it not worth while.  
  1076.  
  1077. Disclaimer : I have not tested this meathod for speed, while it will 
  1078. work, it may turn out to be slower or use excessive amounts of ram.
  1079.  
  1080. Corrin Lakeland (lakeland@mu.sans.vuw.ac.nz)
  1081.  
  1082. +++++++++++++++++++++++++++
  1083.  
  1084. >From afcjlloyd@aol.com (AFC JLloyd)
  1085. Date: 6 Jun 1994 02:51:02 -0400
  1086. Organization: America Online, Inc. (1-800-827-6364)
  1087.  
  1088. In article <2sts5r$41e@st-james.comp.vuw.ac.nz>,
  1089. lakeland@mu.sans.vuw.ac.nz (Corrin Lakeland) writes:
  1090.  
  1091. >> [Another SQRT routine]
  1092. >
  1093. >I was just wondering, would it not be faster to set up a log table
  1094. in 
  1095. >memory and use that for calculating square roots.  Depending on how
  1096. much 
  1097. >speed and or accuracy you need you could change the table (speed = 
  1098. >greater range, accuricy = more choices).  This should be very fast
  1099. to 
  1100. >look up if you are doing square roots extensivly - otherwise the
  1101. memory 
  1102. >use would make it not worth while.  
  1103. >
  1104. >Disclaimer : I have not tested this meathod for speed, while it will
  1105.  
  1106. >work, it may turn out to be slower or use excessive amounts of ram.
  1107.  
  1108. If you're willing to use a table lookup method, a technique that I
  1109. have found to be very fast is to compute a table of square roots and
  1110. use entries from it to seed Newton-Raphson.  The trick is to estimate
  1111. Log2(N) by finding the topmost set bit of N.  Then use this estimate
  1112. to "normalize" N into an index in the lookup table, lookup the value,
  1113. and then "denormalize" the value back into the correct range.  Once
  1114. you have this estimate, you only need a very small number of
  1115. iterations.  For example, a table of 128 values provides initial
  1116. seeds accurate enough to compute the square root of a 32-bit integer
  1117. in just one iteration of Newton-Raphson.  The same table can be used
  1118. to do Fixed or Fract square roots in two iterations each.  If a table
  1119. of 128 values is too large then you can reduce the table down to 32
  1120. (maybe 16) entries and then do one more iteration of Newton-Raphson.
  1121.  
  1122. Jim Lloyd
  1123. afcjlloyd@aol.com
  1124.  
  1125.  
  1126. ---------------------------
  1127.  
  1128. End of C.S.M.P. Digest
  1129. **********************
  1130.  
  1131.  
  1132.