HDTenEightyP/NetNews huggingface dataset:
From: bowman@reed.edu (BoBolicious)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Which Inside Macintosh books are most essential?
Date: 7 Jan 93 02:30:55 GMT
Article-I.D.: reed.1993Jan7.023055.24474
Organization: Reed College, Portland, OR

In article <1993Jan7.012839.18495@leland.Stanford.EDU> bizarre@leland.Stanford.EDU (Bruce Templeton) writes:
>I've got enough money now to buy 2 or 3 of the new Inside Macintosh books.
>Which ones are the most essential?  I figured that _Toolbox Essentials_ is
>necessary, but which others should I buy?

My personal ranking of "essentiality" is:
_TB Essentials_
_Files_
_Memory_
_Processes_

Your mileage may vary, depending on what you want to do.  The 2nd edition of
_Technical Intro to the Mac Family_ is out, too, but isn't too useful unless
you've never been near a Mac before.

cheers,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
"On Monday, numbers floated everywhere, and the world was full of 
approximations."  -- Spencer Heinz, _The Oregonian_, 1/5/93
Newsgroups: comp.sys.mac.programmer
Subject: Need disassembler utility
From: seth@physc1.byu.edu
Date: 6 Jan 93 18:55:04 -0700
Distribution: world
Organization: Brigham Young University

Hello all.
I remember a while back someone mentioning some utility that allows one to
disassemble programs and have a look at them in assembly. I know this can be
done in THINK C if you have a C source , and I am unaware of any other ways of
doing this, except using MacsBug of course, which I would actually rather not
do. Specifically, I would like to look at some Pascal code I have written and
then perhaps modify it and include it as inline assembly code in THINK C with
some C stuff. If someone could point me to such a utility (or more than one) I
would be most appreciative. I have access to ftp sites, so just a name and a
site (and if possible, the directory would help) would do. Thanks a lot!
Seth Leigh
BYU Physics Dept.
Newsgroups: comp.sys.mac.programmer
From: maynard@leah.msc.cornell.edu (Maynard J. Handley)
Subject: Re: GNU and MPW Shell?
Organization: Cornell-Materials-Science-Center
Date: Mon, 11 Jan 1993 09:08:58 GMT


>Once someone ports the stand-alone gcc to the mac, you will _no longer_
>need
>to pay APDA $150 for MPW and however-much for their C compiler.
>
>People like _us_ will be able to have an inexpensive C, C++, Objective-C,
>I
>think they're working on Fortran and Pascal. That's FIVE languages for
>the
>price of NONE. Add to this that we could compile the rest of GNU and have
>a
>UNIX-alike.
>

Well if these ports are anything like the latest port of ghostScript to the
mac, I don't see MPW or Think C as going out of business soon. I paid a
little more for a mac so I could get away from programs with command line
interfaces, where I have to read the manual to figure out how anything
works. So far I have yet to see a port of any gnu util to the mac that is
worth the 5 minutes effort it took 
to get it to my hard drive.

When these things become mac apps, not recompiled unix apps, wake us all
up.

Maynard Handley
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: QuickDraw: Why Can't it Mirror Right?
Organization: Kalamazoo College
Date: Tue, 5 Jan 1993 22:31:22 GMT

urban@yoda.fsl.noaa.gov (Art Urban) writes:
>There is something wrong with either QuickDraw or me... :-)
>
>If I draw a line from 0,0 down and to the left, why won't QuickDraw mirror
>the line when I draw it down and to the *right*?

'coz it doesn't use a very good algorithm.  QD always draws lines from
top to bottom, but instead of splitting the horizontal error equally
along the line, it biases it.  Are you getting a bias toward the top
when you draw left and a bias toward the bottom when you draw right?
(Just a guess.)

>No matter
>what I do, I cannot coerce QuickDraw to create a mirrored (pixel for pixel)
>line angle.

Nope.  You can't.  Even if you could, I heard someone making noises
about 7.1 drawing lines differently than all previous systems.  If true,
you probably don't want to use lines to make regions where every pixel
is important.

>I need this for a bisymetrical region I'm making, so I can't 
>just flip around some CopyBits operation (I presume).

Well, when I needed a small hexagon region a few weeks ago, I ended up
framing all the individual rectangles, top to bottom.  It's not pretty,
but I only had to make it once, and the resulting region is exactly the
same as if I did it with LineTo()s.  Except that it'll still be the same
even when System 12 is released and LineTo(), instead of drawing
straight lines, uses cubic splines which for technical reasons will only
be able to _approximate_ straightness...

If your region is too big to fabricate with rectangles, I don't know
what to tell you.  Anyone have any bright ideas?
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "Estimated number of DOS viruses in existence today:  1,500
  Number of Macintosh-based viruses:  Less than 40
  New DOS viruses discovered in summer '92:  More than 100"   - ComputerWorld
Newsgroups: comp.sys.mac.programmer
From: babin@lobby.ti.com
Subject: Re: Alert Help
Organization: Texas Instruments
Date: Tue, 12 Jan 1993 15:57:32 GMT

In article <1993Jan12.002334.330@physc1.byu.edu> seth@physc1.byu.edu writes:
> [stuff deleted]
>
>BUT, this does bring up a couple of new questions. Within the last few weeks I
>seem to remember a guy asking why he couldn't get a default button surrounded
>autonatically by the "default" round-corner rectangle. Someone said that this
>was not autonatic, and discussed ways of doing this. On my machine with THINK
>Pascal it DOES seem to be automatic. Also, why didn't this show up in ResEdit?
>Is this a "feature" of THINK Pascal? It must be, as I created some alerts in
>THINK C before, and I don't recall anything being surrounded by the "default"
>rectangle then.
>
>Seth Leigh
>BYU Physics Dept.
>
>

My understanding (based on use and what I've read here) is as follows:
   - The #1 DITL item in an alert box will be highlighted automatically
     (may be dependent on using NoteAlert, StopAlert, etc)
   - Dialogs will not have a default item highlighted automatically.
     You (the programmer) have to handle this yourself.

This behavior resides in the toolbox (Dialog Manager) and is not dependent
on the development environment (Think, MPW).

Corrections expected (and requested) if any of the above is erroneous.

-------------
Mike Babin
babin@lobby.ti.com
AOL: MBabin
From: grobbins@Apple.COM (Grobbins)
Newsgroups: comp.sys.mac.programmer
Subject: Re: code for Finding Prefs File (long)
Date: 7 Jan 93 09:42:05 GMT
Organization: Mac Experimental System Software

In article <D2150096.mv05jr@sproul.sproul.com> Sproul@sproul.sproul.com (Mark Sproul) writes:
>Below is code for finding and working with prefs file in system 7
>prefernce folder and working with said file

Modern Mac applications should use the FindFolder call to locate
the Preferences folder.  For an example, see the DTS snippet prefs 
(available via anonymous ftp from ftp.apple.com, in the directory 
/dts/mac/sc/snippets/toolbox.)  FindFolder is documented in the 
Finder Interface chapter of Inside Mac VI.

Grobbins           grobbins@apple.com

No disclaimers apply.
Newsgroups: comp.sys.mac.programmer
From: farm@gpu.utcs.utoronto.ca (B. Munroe)
Subject: How to do multiple mod keys for menu command?
Organization: UTCS Public Access
Date: Tue, 5 Jan 1993 08:11:22 GMT


Just a simple question:  how can I implement multiple modifier keys
for menu command keyboard equivalents?  For example, I use 
(as recommended) command-P for printing.  How can I specify 
shift-command-P for another function (and have the nice little up arrow
appear beside the pretzel in my menu)?

Sorry to waste the bandwidth on such a simple question but I've up and
down IM to no avail.

Any and all help is much obliged.

Thanks.

Bob Munroe


-- 
.............................................................
Bob Munroe		: Internet>	farm@utcs.utoronto.ca
The Farm		: CompuServe>	71160,3455
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: what is the best C compiler
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Tue, 5 Jan 1993 21:52:26 GMT

Stan,

Can gcc 1.37.1 for MPW compile itself?
From: stern@comb1.comb.umd.edu (Brian Stern; COMB)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TCL, MultiFinder, and Progress Dialogs
Date: 11 Jan 1993 16:16 EST
Organization: University of Maryland, Center of Marine Biotechnology
Distribution: world
NNTP-Posting-Host: comb1.comb.umd.edu
News-Software: VAX/VMS VNEWS 1.41    

In article <96290@rphroy.ph.gmr.com>, rrichter@link.ph.gmr.com (Roy Richter PH/32) writes...
>I want to have a progress dialog up for an operation that takes
>over a minute, so I've got the usual text string, and a horizontal
>bar that fills up as the operation proceeds.  It would be nice to
>also:
> 
>(1) let the Multifinder take time slices to update other programs,
>	I assume that WaitNextEvent will do it;
>(2) Have a "Cancel" button the user can push to cancel the 
>	operation.  This has me stuck.
>
Call WNE with a mDownMask. If it returns true then call FindControl to get
the control handle (pass it theEvent.where as the point) and then
TrackControl. If TrackControl tells you that the mouseup occurred in
your cancel button then go ahead and cancel the operation. Note that Apple
now recommends a distinction between a 'Cancel' button and a 'Stop' button
where the first results in a complete return to the conditions before the
operation was started and the latter merely interuppts the operation. So if
the operation were copying files 'cancel' would delete any files that had 
been copied up to the point when the cancel button was hit and 'Stop' would
leave any files which had already been copied but wouldn't copy any more.

Brian Stern
Stern@mbimail.umd.edu
From: erh0362@tesla.njit.edu (Elliotte Rusty Harold)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Best Mac value of all time
Date: 7 Jan 93 21:52:35 GMT
Organization: New Jersey Institute of Technology


    How about the Performa 600?  $1995 for a 4/160 combination at Sears.  I'd 
say that's the best current buy.  For the 50% more you'd pay for a IIvx I'd 
expect at least a 68040 instead of just a cache and FPU.  I also suspect the 
new LCIII is going to be a real price/performance leader when it's released at 
the end of the month.  If the rumors are close to correct, that ought to make 
possible a IIci equivalent system (minus the NuBus slots) complete with 
keyboard, color monitor, and printer for under $2000.


--Elliotte
Newsgroups: comp.sys.mac.programmer
From: 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY)
Subject: Default buttons in dialogs
Organization: Acadia University
Date: Thu, 7 Jan 1993 00:31:53 GMT


Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
the number 1 button, fail to show up in my app with the heavy outline around 
them. What am I doing wrong?
From: kevin@crash.cts.com (Kevin Hill)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C bug? [sprintf]
Date: 11 Jan 93 10:35:44 GMT
Organization: CTS Network Services (crash, ctsnet), El Cajon, CA


 One thing that you **might** try is using the source of sprintf in
your program and then use the debugger to step through it to see
where it is messing up.
 
 
 Another subtle nasty problem with using libraries is that if you change
options - you might have to recompile the library using the new options.
To do this - open the library and then recompile it with the settings that
you are using your program.
  -Kevin
From: cconstantine@galaxy.gov.bc.ca
Newsgroups: comp.sys.mac.programmer
Subject: Variable Wierdness!!!! Help!!!!
Date: 8 Jan 93 19:32:09 -0800
Organization: BC Systems Corporation

I have a really bizzar problem with some database code I am writing.  One of
the fields in the standard FoxBase/dBase header is the Number of Records in the
Database.  This field is 4-Bytes (LONG right!!) So I look at this field and see
a rather LARGE negative number (something like -23453568476).

A friend of mine at work suggested swaping the bits around, ie: take the low
and move it to high and visa-versa.

OK,  Now when I look at the high and low Words of this field in different
variables, they both change after taking the appropriate word out.

Here is the header structure and the ReadDBF function I have written:


#define HiWrd(aLong)	(((aLong) >> 16) & 0xFFFF)
#define LoWrd(aLong)	((aLong) & 0xFFFF)

typedef struct
{
	char		valid;
	char		date[3];	/* Don't forget this is zero based!! */
	long		numRecs;
	short		numHead;
	short		numPerRec;
	short		res1;
	char		flag;
	char		encrypted;
	long		net[3];
	char		prodFlag;
	char		res2[3];
} dbfHeader, *dbfPtr, **dbfHandle;


void ReadDBF( void )
{

	short			fRef,lcount,hcount;
	long			count,ltest;
	Handle			testBuf;
	dbfHandle		testDBF;
	OSErr			errCode;
	
	errCode = FSOpen("\pDevelop HD:MPW:AR DataLogger:3test.dbf", 0, &fRef);
	if (errCode)		/* Error getting the file */
		DeathAlert( errOpenFile );
	
	/* try getting to the actual Field data */
	testBuf = NewHandle( sizeof( dbfHandle ) );
	if (testBuf == 0) /* Error allocating Memory */
		DeathAlert( errNoMem );
	count = sizeof( dbfHandle );
	
	HLock( testBuf );		/* better safe than sorry */
	errCode = FSRead( fRef, &count, *testBuf );
	if (errCode)
		DeathAlert( errCantRead );
	testDBF = (dbfHandle)testBuf;
	ltest = (**testDBF).numRecs;
	HUnlock( testBuf );
	
/*	testDBF = (dbfHandle)testBuf; */
	FSClose( fRef );
	lcount=LoWrd( ltest );  // These are macros defined for effeciency
	hcount=HiWrd( ltest );  // yes, they are declared properly because
				// Apples' HiWord and LoWord do the same thing
	
}
Some of this code come directly from THINK Reference.  Anyway, When I look at
the lcount and hcount variables in SourceBug 1.0.1 each variable changes to
what the other one is after the line has been executed.  This is the most
bizzare thing I have seen!!!!!  Is this a bug with MPW C 3.2.4 or my
program????????

I have tried various arragnements of my code and the same thing still happens. 
I have also tried using Apples HiWord & LoWord routines, but the same thing
happens.

Please help!!!


Carl B. Constantine
CCONSTANTINE@galaxy.gov.bc.ca
Newsgroups: comp.sys.mac.programmer
From: jlohn@eng.umd.edu (Jason D. Lohn)
Subject: foreground/background colors
Date: Fri, 08 Jan 93 17:18:41 GMT
Organization: Project GLUE, University of Maryland, College Park

Subject: foreground/background colors

Forgive if common knowledge...

As an experienced X-windows user, I really like being able to change
the fg and bg colors of my windows.  Now I find myself using a mac
w/system 7 nearly all the time, and I'd like to have the same
capability.  I've tried to find a program (pd/commercial) that can do
this, but since my search came up empty, I figured I'd try to hack
something myself.

First, has anyone out there done this?  If not, any pointers on how it
might be done?  I'd settle for reverse video (ie white fg, black bg)
if nothing else.

Btw, I'd like this for my *mac* apps... for apps running elsewhere, my
mac X server does this fine.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Jason Lohn              Microsystems Laboratory        University of Maryland
jlohn@eng.umd.edu                                      College Park, MD 20742
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Xref: sparky comp.sys.mac.programmer:20691 comp.sys.mac.comm:12636
From: Chewy@cup.portal.com (Paul Frederick Snively)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.comm
Subject: Re: Mac RPC calls
Date: Tue,  5 Jan 93 09:07:04 PST
Organization: The Portal System (TM)

It depends upon what you mean by `RPC.'

All three of the platforms that you mention support `RPC' in one form or
another in their current respective OSes (Windows for Workgroups, BSD UNIX/X/
Motif, and System 7.0 or later).  The problem is that Windows for Workgroups
speaks `Network DDE,' Berserkeley UNIX speaks SUN RPC and probably others, and
System 7.x speaks AppleEvents.

Obviously, you're facing a language barrier if you wish to get these platforms
talking to each other. :-)

The situation between the Mac and the UNIX worlds doesn't actually have to be
too much of a pain--you may have seen the recent announcement for GUSI (the
Grand Unified Socket Interface) here.  Amongst other nice things, it gives
Macs using MacTCP Berserkeley-style sockets, which SUN RPC relies on, and
SUN's RPC code is available at a number of FTP sites (including Apple's, if
memory serves me correctly).  So if you're willing to use MacTCP to yak at
your UNIX boxes, and your UNIX boxes speak SUN RPC, and you're willing to
perform the marriage of SUN RPC and GUSI, then you've solved that problem.

You can find GUSI at nic.switch.ch as software/mac/src/mpw_c/GUSI_10.sit.bin.
If you have access to archie, you can use it to find SUN's RPC code; it's all
over the net.  Again, I'd even try ftp.apple.com.

I believe that Microsoft has a DDE library for the Mac (but don't hold me to
this).  If so, that should complete the construction of this unholy trinity
that you propose. ;-)

Hope this helps,
Paul Snively
Chewy@cup.portal.com
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Why is new(p) so slow in THINK Pascal?
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Fri, 8 Jan 1993 21:03:22 GMT

In article <C0JIxw.3KG@world.std.com>, siegel@world.std.com (Rich Siegel)
wrote:
> 
> In article <4940@svin09.info.win.tue.nl> wstomv@win.tue.nl writes:
> >In order to compare some sorting procedures for linked lists (implemented
> >in THINK Pascal) I applied them to random lists of varying lengths.
> >It turns out that the procedure new(p), which allocates storage for
> >a dynamic variable pointed to by p, is extremely slow.  Does anyone
> >know why?  New-ing a thousand items takes a noticeable time, new-ing
> >10,000 items takes minutes (on my lowly SE/30).
> 
> New() for pointer variables simply calls NewPtr. With that many small
> blocks, you're overloading the Memory Manager, which has to find space
> low in the heap each time you call New. Under the circumstances, you
> might want to think about an alternative storage strategy.
> 
> Starting with an initial free list of pointer blocks is OK, but you're
> still hammering the Memory Manager - you might want to think about
> allocating a single large chunk and using pieces of it as you need them.

MPW Pascal, as well as malloc() in both THINK and MPW C, does this.
Chunking instead of calling NewPtr each time is a *big* win. I did a simple
test:

p = NewPtr(50) 10,000 times = 3917 ticks
h = NewHandle(50) 10,000 times = 238 ticks
p = malloc(50) 10,000 times = 26 ticks.

...on my lowly Quadra 900.   :-)

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@byse.nada.kth.se (Jon Wtte)
Subject: Re: Think C bug? [sprintf]
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Mon, 11 Jan 1993 22:06:17 GMT

In <1993Jan11.194525.18175@afterlife.ncsc.mil> mssmith@afterlife.ncsc.mil (M. Scott Smith) writes:

>It sounds like some people have had no problems with sprintf, while others
>have.  I wasn't sure if it was commonly used by Mac C programmers; are there
>Toolbox calls (non-ANSI) that Mac pros tend to use instead?

Yes, there are a whole bunch of calls in SANE and the international
utilities that handle international formats as well.

>Does sprintf only operate with arrays of characters, or will it be happy with
>types like Str255?  Or do I have to coerce Str255's to make them work?  I

Str255 _is_ an array of characters. Depending on your compiler switches,
you may have to cast it to (char*).

>not the next.  (It seems if Think C saw me passing a Str255 to sprintf it
>was happy about it; but if later in the program I passed a "real" string to
>it, then it suddenly saw problems with one of the calls..  I guess it's checking
>types to make sure I'm being consistent.)

Seems like you did not include stdio.h and Think C generated a
prototype from the use you made of it the first time; ALWAYS
check the box "Require Prototypes" and also ALWAYS include the
headers.

>Is sprintf the best way to capture the functionality of Pascal's concat?

Definately not;

1) sprintf can't handle pascal-style strings (content, not type)
2) if you use C strings, use strcat.
3) if you use pascal strings, use ConcatPStrings, which I think
   is in the file TBUtils.h or something similar.

Cheers,

							/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   This signature is kept shorter than 4 lines in the interests of UseNet
   S/N ratio.
From: wstomv@wsinpa04.win.tue.nl (Tom Verhoeff)
Newsgroups: comp.sys.mac.programmer
Subject: Why is new(p) so slow in THINK Pascal?
Keywords: THINK Pascal, dynamic variables
Date: 8 Jan 93 11:58:05 GMT
Reply-To: wstomv@win.tue.nl

In order to compare some sorting procedures for linked lists (implemented
in THINK Pascal) I applied them to random lists of varying lengths.
It turns out that the procedure new(p), which allocates storage for
a dynamic variable pointed to by p, is extremely slow.  Does anyone
know why?  New-ing a thousand items takes a noticeable time, new-ing
10,000 items takes minutes (on my lowly SE/30).

I did call MaxApplZone at the very beginning of my program.  I also
tried various numbers of calls to MoreMasters, without avail.
I presume that dynamic variables in THINK Pascal are stored in
non-relocatable blocks (where can I find that information; in my 4.0
manuals I couldn't find a clue), and therefore MoreMasters would not
be useful anyway.

My practical solution is to create a FreeList of free dynamic variables
and prime it at the beginning with a sufficient number items.
Instead of new and dispose I then use NewElement and DisposeElement
defined in terms of the FreeList.  Now it works like a train, except...
that priming is still incredibly slow (fortunately to be done only once).

	Tom
-- 
INTERNET: wstomv@win.tue.nl  /    Eindhoven University of Technology
VOICE: +31 40 47 41 25      /    Dept of Mathematics & Computing Science
FAX: +31 40 43 66 85       /    PO Box 513, NL-5600 MB Eindhoven, Netherlands
From: urritche@mcs.drexel.edu (Ralph Paul Ritchey)
Newsgroups: comp.sys.mac.programmer
Subject: Balloon Writer?
Date: 12 Jan 93 03:33:20 GMT
Organization: Drexel University


Netters:

I have read here on the net about a program titled Balloon Writer.
Is it a commercial app, or is it available on the net (I haven't been
able to locate it...)

If it's commercial, is there something else out there that is public domain
or shareware that would work/help create resources for balloons?

If there is any interest, I'll post a summary.

Ralph Ritchey
urritche@mcs.drexel.edu
Newsgroups: comp.sys.mac.programmer