HDTenEightyP/NetNews huggingface dataset:
From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
Subject: Re: TCL: Bizzare Behavior Time
Organization: NASA/ARC Information Sciences Division
Date: Tue, 12 Jan 1993 20:58:10 GMT

In article <1993Jan11.170231.17969@fsl.noaa.gov> urban@yoda.fsl.noaa.gov (Art Urban) writes:
>I'll cut right to the problem...
>
>Swatch reports that my application's heap has gone BAD BAD BAD BAD
>(Swatch's words, not mine). I followed the source code until this condition
>occured, and it happens right after a call to new ( anObject ). My TRY,
>CATCH, ENDTRY doesn't blow up, so the call must've worked, yet my heap is
>cooked. I'd look into the code for new, but there is no way to get it into
>the debugger to trace it (is there?). 

Usually this is caused (for me) by disposing of a bad pointer/handle.


>
>Also, this problem *used to* crash badly enough that even Macsbug could not
>recover (on a StripAddress call which I did not make). The odd thing about
>this is that when I turned on 32 bit addressing for the Mac, my program
>doesn't crash, but the heap still gets scrambled.
>Art Urban 					        urban@yoda.fsl.noaa.gov
>===============================================================================


-- 
----------------------------------
#include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
joshr@kronos.arc.nasa.gov
"Me lost my cookie at the disco." -- Cookie Monster
From: noah@apple.com (Noah Price)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Duplicate Object in Think C?
Date: 5 Jan 93 18:00:31 GMT
Followup-To: comp.sys.mac.programmer
Organization: (not the opinions of) Apple Computer, Inc.

In article <1993Jan5.015329.15824@reed.edu>, eric@reed.edu (eric) wrote:
> 
> Don't thinkC objects know what class they are, and can't you get this
> using CObject::GetClassName?  I don't think that you have to override
> this method, but then I can't recall ever having used it so . . .

Are you talking about copying objects?  I don't think you need to worry
about getting the class name.

The object itself will be copied by

newObject = anyObject->Copy();

The reason that I (and Brian Hall, I think) was suggesting you might need a
subclass is only if your object contains a reference to data that also
wants to be duplicated.

For example, if one of your instance variables is a handle, the Copy()
method will copy the handle (i.e., you'll have another pointer to the same
master pointer), but NOT the data the handle references.  You have to
decide for the particular situation if you just want a second handle to the
same data, or if you want a new copy of the data.

noah

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noah@apple.com                                 Macintosh Hardware Design
...!{sun,decwrl}!apple!noah   (not the opinions of) Apple Computer, Inc.
From: potts@oit.itd.umich.edu (Paul Potts)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C bug? [sprintf]
Date: 11 Jan 1993 22:14:32 GMT
Organization: Instructional Technology Laboratory, University of Michigan
NNTP-Posting-Host: helen.oit.itd.umich.edu

In article <1993Jan11.194525.18175@afterlife.ncsc.mil> mssmith@afterlife.ncsc.mil (M. Scott Smith) writes:
>Hi..  I'm the original poster who asked about potential problems with sprintf.
>
>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?

It depends on what you want to do. Basically, sprintf gives you the
functionality of printf (formatted printing of strings, characters, etc.)
to memory instead of to a device. Like printf, sprintf is not type-safe;
it doesn't know about the types of things that you send it. The
routine will try its best to do what you tell it, but if you give it, for
example, a short quantity to print when you've told it via the formatting
information to expect a longword, the results will be, as they say,
"undefined."
 
I've used sprintf pretty extensively in XCMDs. I'll mention a few details
to the newsgroup; if you want help on why some specific piece of code doesn't 
seem to work, I'd be happy to take a look at it by mail. One of the nice things
about sprintf is that it doesn't require the full ANSI library; you can
use ANSI-small or ANSI-A4 for code resources. 

>
>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?  

Like most of the string-handling functions in C, sprintf uses the generic
type char * (pointer to character) as its argument, and this is what gets
written to. If you're using sprintf you must make sure that your destination
is what you expect it to be. If you're using the type Str255, remember that
sprintf will write strings in the zero-terminated format, whereas Pascal code
and a lot of the Toolbox functions expect strings in the length-first format.
THINK C has a quickie function which will do this conversion.

>think some of my problems were traced back to that.  At the same time, I wasn't
>sure what the problem was, because something would compile fine one way but
>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..  

Again, post an example...

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

For this you might want to look into using the C function strcat, which
will append one string on to another. Keep in mind that C strings can be
any length, but if you expect to convert the string back to a Pascal-form
string you must be sure that it will fit.

-- 
Politics is crime pursued by other means.              
potts@oit.itd.umich.edu      CI$ 71561,3362 (rarely)
Newsgroups: comp.sys.mac.programmer
From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
Subject: Re: (Another) Bug in Think Back?
Organization: Symantec Corp.
Date: Tue, 12 Jan 1993 14:30:09 GMT

   In article <1itfp7INN9od@transfer.stratus.com>, dswartz@redondo.sw.stratus.com (Dan Swartzendruber) writes:

   |> I've been using the Think Back extension, by Phil Shapiro.  The only weird
   |> thing I've noticed is that when I background an operation, while it is
   |> going on, the Apple Menu seems disabled.  That is, I can select it and
   |> move to various entries, but none of them do anything.  ALso, the menu
   |> bar seems grayed out.  Is this a bug?
   |> 

Well, the only menu bar that should be grayed out is THINK C's. I
think I disabled the Apple Menu because I had problems using
OpenDeskAcc() from inside of CopyBits. After you switch out of THINK
C, you should be able to use other apps normally.

In article <1993Jan12.085347@informatik.uni-kl.de> kemper@informatik.uni-kl.de (Michael Kemper [RHRK]) writes:

   Well, I found another bug, causing Think Pascal to jump into
   MacsBug just after compiling my code (in the moment, when it starts
   the application in the TP environment). It is not a serious bug,
   since typing "es" in MacsBug does everything right.  
   Any suggestions how to avoid this?

This one I haven't heard of.

*sigh* ... I am _way_ too busy right now to work on the THINK Back
code or to fix any bugs in it. It's especially a shame because Devon
Hubbard has written a great cdev interface for the "next" version, but
I want to fix one last bug before releasing it.

If anyone is interested in working on THINK Back, drop me an email. It
is written mostly in THINK C, with some inline assembly in a couple
places. It does involve a number of trap patches, so you should feel
comfortable with writing INITs and patching the toolbox if you want to
work on it.

	-phil
--
   Phil Shapiro                                   Software Engineer
   Language Products Group                     Symantec Corporation
		   Internet: phils@cs.brandeis.edu
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
Newsgroups: comp.sys.mac.programmer
Subject: Re: protection == !piracy
Date: 9 Jan 1993 15:47:07 GMT
Organization: /etc/organization
Distribution: world
NNTP-Posting-Host: hal.gnu.ai.mit.edu


In article <1iksk9INNlv9@skeena.ucs.ubc.ca> sainaney@unixg.ubc.ca
(Narayan R. Sainaney) writes:
>
> There is no doubt that any software company SHOULD take action if a
> pirate copy of its program is found.

Even if you assume that, the company should not start with the basic
assumption that the original purchaser did something wrong.  He/she may
have given or sold the package (as a whole, which is permitted by most
`shrink-wrap' licenses) to someone else, or someone may have broken
into the office last week.

(Maybe it was a Christmas present?  I have received software for
Christmas before.  The original purchaser is no more responsible for my
actions with it than is James T. Kirk.)

-- 
 \  /   Charles Hannum, mycroft@ai.mit.edu
 /\ \   PGP public key available on request.  MIME, AMS, NextMail accepted.
Scheme  White heterosexual atheist male (WHAM) pride!
Xref: sparky comp.sys.mac.programmer:21160 comp.os.ms-windows.programmer.tools:1971
From: mellon@ncd.com (Ted Lemon)
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
Subject: Re: Stallman and friends
Date: 11 Jan 93 06:38:54 GMT
	<1993Jan6.134236.4897@miki.pictel.com>
Followup-To: comp.sys.mac.programmer
Organization: Network Computing Devices, Inc.
In-reply-to: boba@miki.pictel.com's message of 6 Jan 93 13:42:36 GMT


>The FSF has a more sweeping agenda to make all software "free."  Since 
>Stallman heads both [the FSF and the LPF], the distinction between them can
>sometimes blur.

Bzzt.   Stallman resigned as President of the LPF several years ago
because he and many LPF members were concerned that people were
assuming that the LPF and the FSF were pursuing the same agenda.
This is not true.   The LPF is pursuing the agenda of ending patent
protection and look&feel protection for software.   The FSF is
pursuing the agenda of revoking *all* Intellectual Property rights on
software, including the copyright.

Don't kid yourself.  There is a need for good software out there.  If
there were no Intellectual Property protection on software at all, a
software industry would still exist, and competent programmers would
still pull down decent salaries.  It'd be a lot different than today's
software industry, but perhaps not as different as you might imagine.
Take a look at how Cygnus Support operates sometime...

			       _MelloN_
--
mellon@ncd.com						uunet!lupine!mellon
Member of the League for Programming Freedom.   To find out how software
patents may cost you your right to program, contact lpf@uunet.uu.net
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: Why Control Segmentation?
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Sun, 10 Jan 1993 18:34:16 GMT

In article <C0Mo2n.BDE@news.cso.uiuc.edu> cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole) writes:
>Provided the programmer designs the code well, there ought 
>to be no excuse for having an object splittable between segments (i.e. at the 
>function level)  

However, there is usefulness for taking certain class's initialization methods
(i.e., those classes which are initialized once only per app open) and putting
them all into a single segment which is discarded after (say) the IApplication
call.
Newsgroups: comp.sys.mac.programmer
From: brunner@crchh447.bnr.ca (James Brunner)
Subject: Re: C array question
Date: Tue, 12 Jan 1993 22:15:26 GMT
Distribution: usa
Reply-To: brunner@crchh447.bnr.ca (James Brunner)
Organization: BNR, Inc.

In article <C0prG1.AsC@plato.ds.boeing.com>, housen@plato.ds.boeing.com (Kevin housen/.na) writes:
|> I am making a jump from Pascal to C and have a simple question
|> regarding creation of a 2D array at runtime.  I want to create
|> an array of floats r rows by c columns.  A (non-Mac) friend
|> suggests
|> 
|>         float **m        /* this will be the 2D array */
|>         int r, c, count
|> 
|>         m = (float **) malloc (r*sizeof(float *));
|>         for (count=0, count < r, count++)
|>             m[count] = (float *) malloc (c * sizeof(float) );
|> 
|> 1.  If, instead of malloc, I want to use the Mac memory manager
|>    routines, does it matter if I use NewPtr or NewHandle (assuming
|>    I lock handles at the appropriate times)?  Does malloc just
|>    call NewPtr?

What this is doing is allocating an array of pointers and then for each pointer
in the array, allocating another array.  For example, for a 2x3 array, this is
allocating one array of 2 pointers AND 2 arrays of 3 elements.  Note that this
is VERY different from declaring "int x[2][3]" which allocates one contiguous
block of 6 ints (but can be doubly indexed).

malloc is generally eqivalent to NewPtr.  Can you do this with handles?  Well,
yes you can, but it gets a bit ugly.  You would have a handle to an array of
handles to arrays.  If this is localized code or you just do this once for the
program, I wouldn't hesitate to use NewPtr.  If, however, you allocate and
deallocate these things like mad all over your program (and in random order),
I would consider the handle approach.

|> 2.  Can this be generalized to a 3D array?

A three dimensional array could be done as:
	an array of pointers for the first dimension
	an array of pointers for each element of the second dimension
	an array of items of third level elements
-- 
---------------------------------------------------------------------------
Jim Brunner - (brunner@bnr.ca)
All opinions are my own and have nothing whatsoever to do with BNR, NT,
NTI, Bell Canada, or any of the BCE corporations or affiliates.
Newsgroups: comp.sys.mac.programmer
From: Quinn <quinn@cs.uwa.edu.au>
Subject: Re: Think Ref 2.0
X-Xxdate: Mon, 11 Jan 93 00: 58:30 GMT
Organization: The University of Western Australia
X-Useragent: Nuntius v1.1.1d13
Date: Mon, 11 Jan 1993 01:04:33 GMT

In article <PHILS.93Jan8135651@chaos.cs.brandeis.edu> Phil Shapiro,
phils@chaos.cs.brandeis.edu writesIn article 
>In article <wondertr.726513991@sfu.ca> wondertr@fraser.sfu.ca
(wondertree 
>learning center) writes:
>>
>>   my big question is does 2.0 allow one to copy the sample code out
>>of the program...
>
>Yes. While THINK Ref 2.0 doesn't support arbitrary text selections, it
>has a new menu item that copies the code examples on the current page
>to the clipboard.

My, that's intuitive!

>The main reason was that supporting arbitrary selections would've
>required a basic TextEdit engine. For speed, THINK Ref uses a simple
>imaging model supported by DrawString or DrawText. [...] It was decided
>that copying all source code text was an adequate solution, given our
>constraints of memory and speed.

I agree, a fast solution is best BUT...

How about Nuntius' solution of copying whole lines at a time.  Sure
it's not as good as full character based selection but at least
the users have some hope of figuring out how it works (and it's
a darn sight more convenient too).

OK, OK, it's not my program, I'll shut up.  It's only a suggestion.

Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
Department of Computer Science, The University of Western Australia
  -- 20 - 20 program design hindsight!
Newsgroups: comp.sys.mac.programmer
From: a-giles@uchicago.edu (Aaron Giles)
Subject: Re: GWorlds and Windows - a problem....
Reply-To: a-giles@uchicago.edu
Organization: University of Chicago High Energy Physics
	<1993Jan10.225929.1773@midway.uchicago.edu>
Date: Mon, 11 Jan 1993 05:40:48 GMT

In article <1993Jan10.225929.1773@midway.uchicago.edu> grass@cs.uchicago.edu (Joshua Grass) writes:

>>You probably need to move the SetGWorld call before NewCWindow.  QuickDraw
>>does an amazingly good job of crashing when the port is set to an offscreen
>>GWorld at the wrong time.  (I had a TCL app which drew in an offscreen port
>>while updating a progress bar.  The number of times I restarted while
>>debugging is best left unsaid.)

>One problem might also be the think c has an error in its mac library with
>NewCWindow, namely that it returns a window, not a cwindow.  I've fixed mine
>and recompiled it and alot of color window stuff works now.  This is with
>ver 5.0. newer versions might have fixed this fairly glaring problem.

Sorry, but this isn't an error.  The only difference between a
CWindowRecord and and WindowRecord is that the former contains a
CGrafPort and the latter a GrafPort.  Seeing as these two port records
are purposefully the same size (otherwise all hell would've broken
loose with the introduction of color!), all the window-specific fields
are at the same location in both WindowRecords and CWindowRecords.  I
don't know why your color window stuff didn't work the other way, but
changing the definition isn't the real solution to the problem.

To quote from the new IM: Toolbox Essentials tome:

pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect,
                            ConstStr255Param title, Boolean visible,
                            short procID, WindowPtr behind,
                            Boolean goAwayFlag, long refCon);

And I believe it's been that way all along.  (BTW, the THINK C headers
in version 5.0+ are just the MPW C headers with small modifications;
more than likely, the original function prototype was written by
Apple, not by Symantec).

Aaron
a-giles@uchicago.edu
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: Stallman and friends
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Thu, 7 Jan 1993 04:22:03 GMT

In article <D2150035.mtvsj2@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
>I just wanted to thank the large number of folks who sent me email
>on this subject.  It's nice to know there are lots of us who think
>Stallman is a kook.

Hey! Look, man: all compiler writers are kooks. Stallman just happens to be
giving his kookyness away.

If a kook can write a general language, general target compiler (make no
mistake, that is what gcc is), that's one potentially rich kook. Maybe you
feel that since he makes gcc so available, that's what makes him a kook...

Now, we have a potentially rich but generous kook... I say we need more kooks
like that kook...
Newsgroups: comp.sys.mac.programmer
From: "brad ward" <brad.ward@canrem.com>
Subject: dos-mac-dos
Reply-To: "brad ward" <brad.ward@canrem.com>
Organization: Canada Remote Systems
Distribution: comp
Date: 10 Jan 93 14:10:26 EST

I have a Question about DOS to Mac back to DOS transfers.  I have a
friend who has a IBM-clone and no modem I some times d/l him file but
when I give them to him they some times don't work.  I am using a Mac
IIci and a 2400 Smart one modem and Zterm 0.90 communication software.
I am also using Access Pc 2.0 to mount DOS disk on my Mac.
Is there any setting on Zterm I shouldchange so the file comes out
closer to the DOS formate?

Brad:-)
--
Canada Remote Systems  - Toronto, Ontario
World's Largest PCBOARD System - 416-629-7000/629-7044
Newsgroups: comp.sys.mac.programmer
From: sjk6119@ritvax.isc.rit.edu (Sgt. Kleper)
Subject: Re: Why the Piracy? Here's why...
Reply-To: sjk6119@ritvax.isc.rit.edu
Organization: Rochester Institute of Technology
Date: Tue, 5 Jan 1993 23:43:23 GMT

I see both your points, and I don't think piracy is right, but there's
a big difference between piracy and shoplifting - If you pirate something
you're making a copy - the original is still there. Shoplifting takes
the original. Not to say that piracy doesn't hurt companies, but it's
not the same thing.
Newsgroups: comp.sys.mac.programmer
From: boba@miki.pictel.com (Bob Alexander)
Subject: Re: Stallman and friends
Organization: PictureTel Corporation
Date: Mon, 11 Jan 1993 18:12:00 GMT

Ted Lemon writes:
>Don't kid yourself.  There is a need for good software out there.  If
>there were no Intellectual Property protection on software at all, a
>software industry would still exist, and competent programmers would
>still pull down decent salaries.

There is a need for food, too.  But in countries where gov't policies
prevent farmers from making a profit, very little food gets produced.

A demand for good software is not sufficient.  There must also be an
adequate economic environment.  You might be right that such an
environment does not require intellectual property rights.  But I'd
like to see some evidence.

>                                 It'd be a lot different than today's
>software industry, but perhaps not as different as you might imagine.
>Take a look at how Cygnus Support operates sometime...

OK, that's one piece of evidence, just as some kibbutzim are evidence
that food can be produced on a non-profit basis (*).  Is it sufficient to
turn the entire software world upside down?  I don't think so.

     Bob Alexander                                     boba@pictel.com
       The more the government does, the better libertarianism looks
     -----------------------------------------------------------------
     Organizations don't have opinions; people do.  The above opinions
     do not reflect those of the directors, stockholders, managers, or
     other employees of PictureTel.

(*) Before anyone points out that kibbutzim have their problems too, note
that I said "*some* kibbutzim."
Xref: sparky comp.sys.mac.programmer:21150 comp.sys.mac.oop.misc:209
From: bpb9204@tamsun.tamu.edu (Brent Burton)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.oop.misc
Subject: Re: David Betz and Bob Language
Date: 10 Jan 1993 21:32:32 -0600
Organization: Texas A&M Univ., Inc.
NNTP-Posting-Host: tamsun.tamu.edu

gort@netcom.com (george harrington) writes:
|In article <1i886lINNg1v@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent Burton) writes:
|>
|> [... about passing LOTS of arguments to a function ...]
|>Well, the stuff, for the most part, will work, but I can't put too much
|>confidence into code that uses anticonventions like your above example.
|>
|Actually, this is the way functions are defined in unix shells; probably
|the reasoning is to allow for a variable number of parameters. You 
|would write 
|   for i
|   do
|      some code here
|   done
|
|and i would loop across all the parameters.

Point taken, but the shell programming technique is due to the
environment.  The same technique, when used in a language such
as C with features to *cleanly* access 10 or 50 arguments, just
does not make good programming sense to me.  I consider it
a kludge, and a sloppy one at that.

-Brent
-- 
+-------------------------+
| Brent Burton    N5VMG   |    
| bpb9204@tamsun.tamu.edu |  
+-------------------------+ 
Newsgroups: comp.sys.mac.programmer
From: hpoppe@ncar.ucar.edu (Herb Poppe)
Subject: Re: ADSP prob: dspOpen gives errState! hints? (Q)
Organization: National Center for Atmospheric Research
Date: Wed, 6 Jan 1993 16:04:46 GMT

In article <justin.726314554@tasman> justin@tasman.cc.utas.edu.au (Justin 
Ridge) writes:

> Now to the point of this posting.  I am trying to write a client
> application that will communicate with a server application on another 
Mac,
> via an AppleTalk network, using ADSP in THINK C.  However, I cannot get a
> local socket to issue an open request (dspOpen).
> ...
> (*myDSPPBPtr).ccbRefNum = connRefNum;
> ...

You have failed to initialize the client's connection end (dspInit) before 
calling dspOpen.
How else can you get a value for 'connRefNum'.?

Herb Poppe                 National Center for Atmospheric Research (NCAR)
hpoppe@ncar.ucar.edu       1850 Table Mesa Dr.
(303) 497-1296             Boulder, CO  80303