HDTenEightyP/NetNews huggingface dataset:
From: bowman@reed.edu (Eric Bowman (bobo))
Newsgroups: comp.sys.mac.programmer
Subject: It *looked* like a good book,
Date: 31 Aug 92 20:33:25 GMT
Article-I.D.: reed.1992Aug31.203325.9154
Organization: Reed College, Portland, OR

But it really sucks.

The _Macintosh Inside Out_  series thus far has been quite good.  But 
_Extending the Macintosh Toolbox_ is *really bad*.  I'm pissed off that
I spent good money on a book with lots of sample code that is just *bad*.
Much of it won't compile, and was clearly converted from pascal to c.

I got the book because it looked like it had some good stuff in it; now I
really wish I had looked it over more carefully.
Newsgroups: comp.sys.mac.programmer
From: siegel@world.std.com (Rich Siegel)
Subject: Re: Inconsistantcy in Think C
Organization: GCC Technologies
Date: Sun, 30 Aug 1992 17:35:28 GMT

In article <1992Aug30.091804.1@acad2.alaska.edu> asmah@acad2.alaska.edu writes:
>I have run into some very strange problems working with Think C 5.0 lately and 
>would like to know if anybody know's what is causing them.  Here is one I can 
>easily define.
>
>I have a sprintf() statement which doesn't work the first time through, but
>works during a second time.  As far as I can tell, all the variables are
>identical during both passes.  This is what it looks like.
>
>CharsHandle  input;
>TEHandle TEFields[20];
>
>input = TEGetText(TEFields[0]);
>sprintf((**ARH.c_employee).last_name,"%.*s",(**TEFields[0]).teLength,(**input));
>return 1;
>

If your ANSI library is in a different segment than the routine with
the printf, then your call to printf() is causing a segment load,
which in turn will cause the handles (**ARH.c_employee) and (**input)
and (**TEFields[0]) to move. The best way to solve this problem is to
lock the handles before calling sprintf(), or place the ANSI library
in the same segment as the code that calls into it, to avoid the
segment load. In general, it's not a good idea to depend on
dereferences like this as arguments to function calls.

R.



-- 
-----------------------------------------------------------------------
Rich Siegel                              Internet: siegel@world.std.com
Software Engineer & Toolsmith
GCC Technologies
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Newsgroups: comp.sys.mac.programmer
Subject: Re: dereferencing Handles( was Re: incrementation differences...)
Date: 25 Aug 92 20:17:11 GMT
Organization: Kalamazoo College

sdorner@qualcom.qualcomm.com (Steve Dorner) writes:
>k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
>>Unless you call Toolbox routines
>>that move memory, the block will never move.
>
>1. Don't trust any list of toolbox routines that supposedly don't move
>memory.  People patch stuff, and s**t happens.  Code defensively.

While I admit to not having considered this, it seems to me that anyone
who applies a memory-moving patch to a non-memory-moving trap is a
Miscreant In The First Degree.  A lot of interrupt code relies on those
appendices being right!  I mean, yeah, I'm all in favor of defensive
coding, but this is going a little too far...

Or am I out of touch, and people have been doing this for years?

>2. Be aware that function calls to an unloaded segment may move memory,
>(division of longs on 68000's is one such...)

Ouch.  A painfully good example.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "It's bad enough to send a rude message to another via such an anonymous
  channel [as email].  To flame someone on an open forum is, to me, the
  height of insensitivity."                                 - P.J. Plauger
Newsgroups: comp.sys.mac.programmer
From: greeny@top.cis.syr.edu (J. S. Greenfield)
Subject: Re: Open file at launch time?
Organization: Syracuse University, CIS Dept.
Date: Tue, 1 Sep 92 22:56:52 EDT

In article <5575@omphalos.bug.co.jp> tague@omphalos.bug.co.jp (Tague Griffith ) writes:
>
>Under system 7.0, when your application is opened, the finder first sends the
>application an kAEOpenApplication ('oapp')  apple event.  Your application 
>should respond by doing anything it needs to do at startup.  Then the finder
>sends your application an kAEOpenDocuments 'odoc' event which includes a list
>of alias records to the double clicked files, resolve the aliases and then
>open the files.  Pretty much the same thing with the print document event as
>well.

Actually, under any normal circumstances, the finder will *either* send
an "oapp" or an "odoc" but *not* both.  (That is, immediately after launching.)

If you get an "oapp" it means that your application was launched *without*
any documents--and you should take any appropriate action--for example,
opening a new, untitled window.

If you get an "odoc" it means that your application was launched *with*
documents (those listed in the "odoc" event).

If you were to get *both*, it would (normally) indicate that the application
was first launched without any documents, and then a document was launched
(double-clicked, or dropped on the app, for example) *after* the app was
already running.


-- 
J. S. Greenfield                                         greeny@top.cis.syr.edu
(I like to put 'greeny' here, 
but my d*mn system wants a 
*real* name!)                        "What's the difference between an orange?"
Newsgroups: comp.sys.mac.programmer
From: agoates@nyx.cs.du.edu (Alan Goates)
Subject: Notification Manager...
Organization: University of Denver, Dept. of Math & Comp. Sci.
Date: Sat, 29 Aug 92 18:52:48 GMT


  I don't know if this has been discussed before, but I found a major wedge
in IM vol 7. OK, it says that you can get a flashing SICN with NMInstall (?-
I don't have it here in front of me right now) by passing a handle to the
resource. Fine, that works. But it also says that youu can pass a handle to
an Icon Family that contains a small color icon (ics8, i suppose) and it will
flash the color icon instead. The problem is that there is no such thing as 
an Icon Family as an object. An Icon Family is a concept, a group of resources
with the same ID numbers, but how do you pass a Handle to a concept?????
I've tried passing handles to the individual members of the Icon Family (ICN#,
ics#,icl8,ics8) with no luck. I also tried passing the resource number and
and a Handle to the resource number. AAARRRGGGHHH!!! What do they really mean?

If anyone has ever gotten this to work, I'd love to hear from you.

Thanks,
AL
From: sbill@informix.com (Bill Stackhouse)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Set/Get Cursor
Date: 3 Sep 92 17:25:02 GMT
Organization: Informix Software, Inc.


> sbill@informix.com (Bill Stackhouse) writes:

   Why does the following cause EvenBetterBusError detect a NIL pointer
   problem?

      SetCursor(*GetCursor(iBeamCursor));


The problem EvenBetterBusError was reporting was somewhere else and
was unrelated to Set/GetCursor. Thanks for the help

Bill Stackhouse
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: CFront error "cannot make a ..."
Date: 30 Aug 92 03:25:24 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple

In article <71806@apple.Apple.COM>, jwo@Apple.COM (Jamie Osborne) wrote:
> I am using MacApp 3.0.1 w/ MPW 3.2 and C++ 3.2.  I am trying to do a relatively simple thing- use the PPCBrowser call.
> 
> Here's what I do:
> 
> OSErr	CAEProcessor::PPCBrowseConnect()
> {
> 	PortInfoRec thePortInfo;
> 	TargetID 	theTarget;
> 	
> 	AEAddressDesc theAddress;
> 	Str255		theAddressee;
> 	
> 	if ((PPCBrowser ((ConstStr255Param) nil,(ConstStr255Param) nil,FALSE,
> 		&theTarget.location,&thePortInfo,
> 			(PPCFilterProcPtr) nil,(ConstStr32Param) nil)) != noErr)
> 		return false;
>
Funny, I just answered this on AppleLink, most likely you are looking
at the CIncludes PPCBrowser function prototypes, when you should look
at the MacApp specified C interfaces (that have C++ call by references
instead of pointers).

Here's a snippet that compiles/works (from AEGestalt, on Developer CDs):

/	Do a PPC Browser lookup of existing nodes that talk the same protocol,
//	i.e. an open application with the same signature
#pragma segment ADoCommand
pascal void TLookupCommand::DoIt()
{
	FailInfo fi;
	TargetID theTargetID;
	PortInfoRec thePortInfo;
	AEAddressDesc targetAddress;
	CStr255 thePrompt = "Find node you want to examine";
	CStr255 theType = "AEGestalt Nodes";
	CStr255 windowTitle;

	if (fi.Try())
	{
		FailOSErr(PPCBrowser(thePrompt, theType, FALSE, theTargetID.location,
thePortInfo, MyPPCBrowserFilter, "")); // !!!note, not address, instead VAR
		fi.Success();
	}
	else
	{
		fDocument->fOKNode = FALSE;
		if (fi.error == userCanceledErr)
			return;
		else
			fi.ReSignal();
	}

...

Cheers,
Kent Sandvik
... Saturday evening, time to go home from the office...

---
Warning, Bimbo eruptions most likely to happen in California this weekend.
From: timm@void.ncsa.uiuc.edu (Tim McClarren)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Shareware legality question
Date: 1 Sep 92 18:20:14 GMT
Article-I.D.: void.timm.715371614
Distribution: comp.sys.mac.programmer
Organization: University of Illinois at Urbana

joseph@joebloe.maple-shade.nj.us (Joseph Nathan Hall) writes:


>In article <BtvFx6.L9x@news.cso.uiuc.edu> (comp.sys.mac.programmer), resnick@cogsci.uiuc.edu (Pete Resnick) writes:
>) >I submitted a shareware copyrighted program to sumex-aim.  In the
>) >README file I included a line that read <Public domain houses, such as
>) >Educorp, must contact me before distributing this program>.  I guess I
>) >aint no legal wizard, and I should have worded that more carefully.
>) 
>) >Do I have any rights here, or did I goof with my language.

>You can certainly make them stop.  Alas, you have no other remedy
>if your work is not registered with the Library of Congress.

>As I understand the law:

>If you work is unpublished (which in this case, it is not), you need
>not include any copyright notice in order to prevent its unauthorized
>distribution and/or reproduction.  In fact, you must explicitly waive
>your rights.  Since US copyright law reform you automatically have copyright
>of any work (excepting work-for-hire, etc.), even if there is no copyright
>notice.

Yes, this is exactly right and is known as implicit copyright.  It protects
authors from stolen work.  Anyways, a letter from your lawyer would probably
be most effective, and some lawyers charge a nominal fee (last time I did
it it cost me $50) for the service.  Is it worth the $50 to you?

-- 
Tim McClarren     | "...a bajillion brilliant Jobsian lithium licks."
timm@ncsa.uiuc.edu|
(217)244-0015     |
From: neath@brazil.psych.purdue.edu (Ian Neath)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Seed for random numbers?
Summary: watch those calls!
Date: 27 Aug 92 16:00:09 GMT
Organization: Purdue University

In article <1992Aug26.213810.13252@reed.edu> bowman@reed.edu
(Eric Bowman (bobo) writes:
>I've written a program that used by a class here that has stochastic
>elements to it.  I've been using the seconds since 1901 deal to seed
>my random number generator; unfortunately, when a class uses it, they
>get similar seeds and (sometimes) near identical results on different
>machines.

I had this problem once.  It turned out I was using GetDateTime(&randSeed)
but was calling rand() for my numbers.  It took many hours to realize
that rand() was the ANSI call, Random() was the Toolbox call.  You might
want to check this (and vice versa, using srand(clock()) and using Random()).

-ian

--
    Ian Neath, PhD     | There are four kinds of people in this world:
neath@psych.purdue.edu | cretins, fools, morons and lunatics - U. Eco
From: peirce@outpost.SF-Bay.org (Michael Peirce)
Newsgroups: comp.sys.mac.programmer
Subject: Re: incrementation differences/THINK C 4.0 vs. 5.0
Date: 26 Aug 92 17:55:44 GMT
Reply-To: peirce@outpost.SF-Bay.org (Michael Peirce)
Organization: Peirce Software
X-Mailer: uAccess - Macintosh Release: 1.5v4


In article <38119@unix.SRI.COM> (comp.sys.mac.programmer), mxmora@unix.SRI.COM (Matt Mora) writes:
> 
> Also why can't the compiler say this when a ";" is missing.
> 
> Missing an ";" at the end of this line. Should I add one?"
> "Add one and Continue" or "Cancel"
> 
> instead of
> 
> "Missing a ";" at the end of statement."
> 
> and stop compiling. 
> 
> Compilers have a long way to go yet. I can't believe that the Mac user
> interface hasn't worked its magic on compiler designers yet.

In a previous life I worked at DEC and used the Language Sensitive
Editor (LSE) and the Ada compiler on VMS.  IT DID THIS.

Actually it would make the change to your source code in LSE and then
ask you for confirmation.  I can't remember ever telling it not to
keep the change.

It was a pretty good development environment for VT based applications
(though called them programs in those days :-)

I also remember an, ahem, COBOL compiler that made the type of assumptions
you are talking about.  Of course, I'll never admit to writing a single
line of COBOL.

--  Michael Peirce      --   peirce@outpost.SF-Bay.org
--  Peirce Software     --   Suite 301, 719 Hibiscus Place
--                      --   San Jose, California USA 95117
--  Makers of...        --   voice: (408) 244-6554 fax: (408) 244-6882
--            SMOOTHIE  --   AppleLink: peirce & America Online: AFC Peirce
From: rer@utrcv1.res.utc.com (Rick E Romkey)
Newsgroups: comp.sys.mac.programmer
Subject: Comparing strings 'n stuff...
Date: 28 Aug 92 13:48:04 GMT
Organization: United Technologies Research Center
X-Xxmessage-Id: <A6C3A7927D011E65@dcemax1.res.utc.com>
X-Xxdate: Fri, 28 Aug 92 09:51:14 GMT
X-Useragent: Nuntius v1.1.1d7


I am trying to compare a Str255 with a String which exists
in my resource file.  I have loaded it in, but I am at a loss
as to what to do to compare these two strings to see if they
are equivalent.


Boolean CompareStrings( Str255 inString )
{
	StringHandle	textHandle;
	
	textHandle = GetString( 128 );
	
	if (textHandle == nil) {
		SysBeep(20);
		ExitToShell();
	}
	
/* WHAT DO I DO NOW??????? */
}


Any help?
Rick E Romkey
Distributed Computing Environments
United Technologies Research Center
East Hartford, CT
(203)727-7195
Newsgroups: comp.sys.mac.programmer
From: "John Lacey" <johnl@spinner.cs.indiana.edu>
Subject: Apple events and Think C
Organization: Computer Science, Indiana University
Date: Wed, 26 Aug 92 15:17:25 EST
X-Mailer: ELM [version 2.3 PL11]

I am trying to get a simple app with Apple events going, but I can't
even get by the Open Application event.

Problem #1: Using the code snippets from IM VI, the call to
AEGetAttributePtr returns errAENotAEDesc.  The only thing I did was
call AEProcessAppleEvent, and call AEGetAttributePtr first thing in my
handler.

Problem #2: Is there any way to debug Apple event handlers in Think C
5.0?  If I run under Think C, AEProcessAppleEvent returns
noOutstandingHLE.  No such problems with the built application.

What am I missing, and is there a good reference for this, or some
example code?

-- 
John Lacey                   `Everything must end; meanwhile we
                              must amuse ourselves.' --Voltaire
From: joseph@joebloe.maple-shade.nj.us (Joseph Nathan Hall)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Internet mail from the Macintosh
Date: Fri, 28 Aug 92 12:06:04 EDT
Organization: 5 Sigma Software
Reply-To: joseph@joebloe.maple-shade.nj.us
X-Mailer: uAccess - Macintosh Release: 1.5v5


In article <71607@apple.Apple.COM> (comp.sys.mac.programmer), mlanett@Apple.COM (Mark Lanett) writes:
) mwalker@novell.com (Mel Walker) writes:
) 
) >I'm trying to figure out a way, using MacTCP hopefully, to send mail from a
) >Macintosh application. Note that I do not wish to read mail, just send it.
) 
) Why don't you just go get the Eudora source (ux1.cso.uiuc.edu), or (maybe,
) not sure) NewsWatcher (ftp.apple.com)...
)

The current issue of MacWeek has a survey of Internet (SMTP) based
mailers.  As usual, some are free and some aren't.

I've also had good results with uAccess, which is the UUCP-based mailer/
news package I'm currently using.  (It was flakey for a few days when
I was configuring it, but now, for whatever reason, it works just
fine.)

uunet!joebloe!joseph   (609) 273-8200 day   joseph%joebloe@uunet.uu.net
v   v  sssss | Certified Guru: all-grain brewing,| 2102 Ryan's Run East
 v v  s   s  | C, synthesizer comp & arranging,  | Rt 38 & 41
  v    sss   | photography. Also not a bad cook. | Maple Shade NJ 08052
-----My employer isn't paying for this, and my opinions are my own-----
Newsgroups: comp.sys.mac.programmer
Subject: Re: Seed for random numbers?
From: fry@tara.harvard.edu (David Fry)
Date: 26 Aug 92 18:53:34 EDT
Organization: Harvard Math Department

In article <1992Aug26.213810.13252@reed.edu> bowman@reed.edu (Eric Bowman (bobo)) writes:
>I've written a program that used by a class here that has stochastic elements
>to it.  I've been using the seconds since 1901 deal to seed my random number
>generator; unfortunately, when a class uses it, they get similar seeds and
>(sometimes) near identical results on different machines.  Does anyone have
>a suggestion for how a unique seed for each machine could be created?  I
>don't know AppleTalk yet, but perhaps there is some i.d. associated with
>each machine that could be EORed with the seed?

If s1 and s2 are two seeds for the Macintosh random number generator,
then s1 and s2 being close does not imply that the subsequent random
sequences will be "close," whatever that means.  Your phrase
"(sometimes) near identical results" indicates to me that your
stochastic model is just giving similar results for different
sequences.  Certainly this is not uncommon.

Unless each Mac is synchronized to the second and the students start
the programs at identical times, they should have different sequences, 
and each pair of sequences is as "different" as any other randomly 
selected pair.  In other words, there's no reason to believe that 
seed=1 and seed=2 will give sequences more similar than seed=1 and 
seed=10000.

If this is still unsatisfactory, you could put up a dialog box asking
the students to enter a seed.  Or you could use TickCounts(), which is
the number of 60ths of second since the computer was turned on.


David Fry                                  fry@math.harvard.edu
Division of Applied Sciences               fry@huma1.bitnet
Harvard University                      ...!harvard!huma1!fry
Cambridge, MA  02138
From: gb2a+@andrew.cmu.edu (George J. Baxter)
Newsgroups: comp.sys.mac.programmer
Subject: ML for the Mac????
Date: 28 Aug 92 11:29:33 GMT
Article-I.D.: andrew.gebbuRW00iUyQ5gEwc
Organization: Science & Technology Center, Carnegie Mellon, Pittsburgh, PA

Does anybody know of a standard ML compiler for the Mac????
-gjb
-----------------------
gb2a@andrew.cmu.edu		    baxter@a.cfr.cmu.edu

"Only a Hawaiian can say Humuhumunukunukuapuaa five times fast, correctly."

"I think we're in for a bad spell of wether."
Newsgroups: comp.sys.mac.programmer
From: Holland_Thomas@Tandem.Com (Tom Holland)
Subject: Error #-108 during shutdown
Followup-To: comp.sys.mac.programmer
Organization: Tandem Computers
Date: Sat, 29 Aug 1992 20:24:12 GMT

Hi ,

  I'm working on a program which loads a code resource into the shutdown
manager 
for execution during a Restart. When the code resource is executed, the
application 
which loaded it is no longer running.  Amongst its  duties, this code
resource loads
a 'snd ' resource from a resource file and plays it. For short sounds, this
works fine.
The problem I have run into is that for larger (~40K) sounds
Get1IndResource produces
an error -108 (memory full error -- not enough room in heap zone).  

Since my code resource is executed by the shutdown manager, my
understanding is that
the heap in question is the system heap. Can the system heap really not
have 40KB to spare?
The relevant characteristics of my system are: IIci, 20MB ram,  System
7.0.1  updated, 
Think C 5.0.1. 

Any comments or thoughts on this would be appreciated. Thanks.
 

Tom Holland

Holland_Thomas@Tandem.Com,       |Soap and education are not as sudden as a

Tandem Computers, Cupertino Ca.  |massacre but are more deadly in the long
run.
                                 |    - Mark Twain
Newsgroups: comp.sys.mac.programmer
From: potts@itl.itd.umich.edu (Paul Potts)
Subject: Re: Sound Loop in a with a Modal Dialog?
Organization: Instructional Technology Laboratory, University of Michigan
Date: Thu, 3 Sep 1992 17:19:25 GMT

In article <1992Sep3.145524.8874@utkux1.utk.edu> danny@utkux1.utk.edu (Danny W. McCampbell) writes:
>Hi.  I want to play a sound continuously while a modal dialog is 
>present on the screen.  I have successfully go the loop to work
>without the modal dialog statement but the loop is only executed
>twice when I call modal dialog.  Here is  some sample code:
>
>dialogtrue := true;
>while dialogtrue do
>begin
>  FlushSndChannel(mySndChan);
>  if SoundisStopped(mySndChan) then
>  begin
>    PlaytheSound(mySndChan);
>  end;
>  ModalDialog(nil, itemHit);			{Call Modal Dialog until the user clicks in the dialog}
>  if itemHit = 1 then
>    dialogtrue := false;
>end;
>StoptheSound(mySndChan);
>DisposDialog(AboutDialog);				{Dispose of the Dialog}
>
>The sound plays only twice then stops playing.  Any ideas how I can
>do this successfully?  Thanks in advance.

This seems somewhat convoluted. Can you post the actual code that you use
to play the sound, and what your dialog should do? It makes a difference.

Keep in mind also that your sound will restart after each click on a button
in the dialog, but while the dialog is on the screen, the sound could 
stop playing and you would then be left sitting there waiting for something
to happen (for one of the buttons in the dialog to get activated)
for it to start up again.

For a dialog in which any of the buttons numbered other than zero
should dismiss the dialog, I would do something like:

- start playing sound
- itemHit =0;
- while (!itemHit)
       ModalDialog (nil, &itemHit);
- Turn off sound

The technique for playing the sound might influence how you do this; for
example, are you playing a long sample that might end while the user is
deciding what to do with the dialog? If so, you could set it to loop. Are
you dynamically playing notes such that you need to stuff freqDurationCmds
into the sound queue? If so, you might want to do this from a filter
procedure to your dialog. It could look at the sound queue during null
events and if it is nearly empty, stuff some more notes into it.

You might consider stuffing a copy of the pointer to the sound channel in
the dialog, so that your filter procedure could look at it when it runs
without having to access a global. There are various ways to do this kind
of thing if you are interested.
 
>
>Danny McCampbell


-- 
"...remove protective cap. Hold atomizer with thumb at base and nozzle 
between first and second fingers. Without tilting head, insert nozzle into 
nostril. Fully depress rim with a firm, even stroke and sniff deeply."
-advice for presidential candidates from Paul Potts - potts@itl.itd.umich.edu
From: slink@laforge.cs.byu.edu (Geoffrey Slinker)
Newsgroups: comp.sys.mac.programmer
Subject: PICT file format
Keywords: PICT FILE FORMAT
Date: 31 Aug 92 23:23:45 GMT
Reply-To: slink@laforge.cs.byu.edu (Geoffrey Slinker)
Organization: Digital Equipment Corporation

Where can the file format of a PICT file be found? Is it in Inside Mac?

slink@bert.cs.byu.edu
From: ar4@sage.cc.purdue.edu (Piper Keairnes)
Newsgroups: comp.sys.mac.programmer
Subject: THINK Reference
Date: 28 Aug 92 21:20:10 GMT
Distribution: na
Organization: Purdue University

I just recently purchased THINK Reference and now am ashamed that I didn't
buy it earlier. It is a wonderful reference program. However, I am
interested in knowing an approximate date (season?) on which an update
will be released which contains System 7 additions.

-- 
Piper Keairnes - Computer Science   ** PUCC Consultant for money. **
INTERNET: ar4@sage.cc.purdue.edu    **   Mac programmer for fun.  **