HDTenEightyP/NetNews huggingface dataset:
From: jahnke@biosci.arizona.edu (Jerome Jahnke)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Why the Piracy? Here's why...
Date: 25 Jan 93 22:46:48 GMT
Followup-To: comp.sys.mac.programmer
Organization: University of Arizona

In article <tal691.727611868@huxley>, tal691@huxley.anu.edu.au (Tonio
Loewald) wrote:
> 
> jason@ab20.larc.nasa.gov (Jason Austin) writes:
> 
> >In article <1993Jan20.141942.23817@gn.ecn.purdue.edu> jess@gn.ecn.purdue.edu (Jess M Holle) writes:
> >-> The only differences between software piracy and theft in general is that
> >-> 
> >-> 1)  There is no direct material cost to this sort of theft.
> 
> >	Wrong.  It takes years, thousands of hours of work, and
> >computer hardware to create and maintain an average software package.
> >All that material cost is in every copy of that program.
> 
> That material cost is indirect. Software is freely manufactured
> once the mold is made, so to speak. Please debate the points I make,
> not the points you believe I make or assume I make for your own
> strange rhetorical purposes.

You are using my work for free to make money. If you steal a word processor
I developed, and used it for your resume typing business you have stolen my
efforts and returned me nothing. You make money and I don't. The problem is
that intellecutal property is less tangible than manufactured property. But
if you use my work to make money I am entitled to make money from you.

Consider this. How come law enforcement agents can stop someone from
selling "fake" products (like Reebok Shoes, or Levis Jeans?) They aren't
stealing anything from Reebok or Levis? So according to you we can all just
buy third rate shoes and paste Reebok on them and sell them for 150 dollars
(US) a piece.

Finally you continue to say the poor have a right to steal. That it doesn't
cost anyone anything. That does not matter. If I had something you needed
and did not want to sell it to you even though I had no use for it, and if
it were stolen would not miss it. Nor would I ever have any use for it, and
it cost me nothing to manufacture (say a tree in my front yard). It would
still be wrong, and illegal to steal it.

Jer,
----
Jerome Jahnke
Biology Learning Center
University of Arizona
jahnke@biosci.arizona.edu or +1 (602) 621-3820
Newsgroups: comp.sys.mac.programmer
From: mssmith@afterlife.ncsc.mil (M. Scott Smith)
Subject: Question about bit manipulation
Organization: The Great Beyond
Date: Sun, 24 Jan 1993 02:37:28 GMT

Hi!  I'm working on a library of routines for doing direct-screen graphics
on the Mac..  One thing I'm concentrating on right now is my own "masking"
routines, so that the background can shine through areas of "sprites"
(pictures) that are specially marked.

Basically, I write to the screen by doing something like this:

  long *long_ptr;

  long_ptr = (address of memory location representing part of screen to draw to)

  *long_ptr = 0xaaaaaaaa;

   The way I have this set up, four pixels would be written to the screen,
each of color "aa" -- aa, or 170 in base-10, represents the color defined
in my CLUT as entry 170 (out of 256).  So, say that entry was blue -- I would
have four horizontal blue pixels plotted on the screen.

   All works well.  I have developed a system for converting pictures into
this format, so I can easily (and VERY quickly!) plot these pictures on screen.
But, now I want to replace all "00"'s with the color from the background at
that location..  If that makes sense.

So, if the first four pixels of the screen look like this:

a1a1a1a1

And I want to plot a "ee0000ee" on the screen, I would want the result to be:

eea1a1ee

I hope that makes sense..  Now, the way that I'm attacking this, is to basically
bit-or the two together.

I.e. "ee0000ee | 00a1a100" should yield "eea1a1ee", which is what I want.

But the problem is, Think C doesn't seem to want to deal with long's greater
than four hexadecimal digits..  That is, if I do:

  printf("%x\n", 0xffffffff);

It prints:

  ffff

And so forth..

My questions are: (1) why? (2) how can I fix/work around this?

Now that I go back and fool around, I'm getting unusual results for the
following:

  unsigned long int junk = 4147483645;

  printf ("[%ld]\n", junk);

It prints out "-147483651"..

Am I missing something that's obvious?

Thanks in advance for any help..

M. Scott Smith
  (mssmith@afterlife.ncsc.mil || umsmith@mcs.drexel.edu)
From: mikeh@kralizec.zeta.org.au (Michael Hore)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Shareware summary (long)
Date: 22 Jan 1993 09:05:44 +1100
Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.42bis
NNTP-Posting-Host: kralizec.zeta.org.au


>>  [Program] was favorably reviewed in Byte magazine and in a number of
>>books [...], and they all mentioned my name. It's a nice thing to put on
>>your resume.

That's for sure.  My freeware offering had a couple of good mentions
in MacTutor (now MacTech).  As a result, a prospective employer, a
respected Mac software house, had me in quite quickly for an interview.
At the interview they had just 3 questions:

"What do you want to do?
Here are our projects, -- which one are you interested in?
When can you start?"

:-)

Cheers,  Mike.

----------------------------------------------------------
Mike Hore          mikeh@kralizec.zeta.org.au
.sig deliberately kept short to minimize .sig/noise ratio.
----------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: Verifying valid handles, how to?
Organization: HoloNet National Internet Access BBS: 510-704-1058/modem
Date: Wed, 27 Jan 1993 05:23:53 GMT


John brings up a very very important point. use other mechanisms for
handle management to avoid memory leaks and handle double deletions.

I myself use a magic 16bit "boolean" in conjuction with each and every
handle I allocate (I hardly ever use pointers) and use the magic value in
a tattle tale routine upon deletion and program termination (sometimes) to
tell me what problems I've introduced.

I also never purge unless need to and purge the right amount, and never
compact unless need to and try to compact the right amount, and never do
either if there is enough room for the desired handle plus the current
reserved size of a contiguous imaginary area of the heap (usually about 32K)

by putting all these routines together in one set of utilities, you can
then include the "memory_Initialized" flag in the same rountine to check
for double creations as well as deletions..... of course none of this
stuff is new to people who have to occasionally write massive applications.

With object-oriented mentalities, perhaps people may even start defining
"handle" classes... Nah.... that may be going to extremes.

-- Bill Williams

Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: My GrowZoneFunc got a ridiculous request
Organization: Kalamazoo College
Date: Tue, 26 Jan 1993 07:45:53 GMT

My app went into an infinite loop this afternoon.  When I broke into
Macsbug this evening, I found that it was trying, over and over, to
get enough memory to do a LoadResource().

Upon perusal, it turned out that my GrowZoneFunc was being asked to
allocate a bizarre amount of memory.  Namely, 0xDA7DE240 bytes.
That's well over three billion, or about -600,000,000 in signed decimal.
An unusual request.


It was in the infinite loop because the TCL's grow zone function,
CApplication::GrowMemory(), checks to see whether bytesNeeded minus
freeSpace is less than zero.  That value, of course, was way less than
zero, like about 600 megs less than zero, so it happily returned 1,
telling the Memory Manager "there, I did it--try it now."  The Memory
Manager chokes on the request, re-calls the grow zone function, and
things go on like this for, well, hours.

When I forced CApplication::GrowMemory() to return 0, telling the Memory
Manager "sorry, I give up--deny the request", everything worked OK until
that resource was requested again.  Then the GrowZoneFunc was again
called and again asked to free up -600 megs.


I'm guessing that the resource map is trashed, and that the long that
should read the resource's actual size (about 24K) now reads
"DA7DE240".  That would explain it, I suppose.  But my heap is fine, and
Macsbug correctly tells me the type, ID, and name of every resource in
it.  So it's not _too_ corrupted.  Let's see...well, after refusing that
second request, the game has been working just fine for fifteen
minutes.  And ResEdit verifies the resource file as OK (it's big, 6.4
megs).

I figure if I patch GrowMemory() to return 0 if the request if absurd,
that'll take care of the infinite looping.  Should I just call this a
fluke?  Or what?
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "I don't think people need optimization any more. ...  If you look at the
  history of programming-language design, almost every major screw-up is a
  consequence of people pandering to some optimization...."   - S. Wolfram
From: mgraf@sydvm1.VNET.IBM.COM (Michael Graf)
Date: Mon, 25 Jan 93 11:31:30 EDT
Newsgroups: comp.sys.mac.programmer
Subject: GWorld Not found
Organization: Australian Programming Centre (IBMA)
Disclaimer: This posting represents the poster's view only.
News-Software: Usenet 3.1

 Recently I asked about the best way to move PICT data and refresh screens,
and was rightly pointed to using an offscreen Graphics screen (GWorld).
Well, I read the IM VI section and started working with it, and when I
try to compile my THINK Pascal v4.02 code, it seems to NOT find ANY of
the offscreen GWorld API calls.
 I have used MANY calls document in IM VI, and am wondering what do I need to
do to get the Gworld calls recognized ? DO I need to include some other
library ?

 The call it complains about (first) is the
   GetGWorld
but also on
   SetGWorld
etc.

  Any advice from those experienced would be most gratefully appreciated.

  Thanx in advance for the pointers.


**********************************************************************
Regards,
  Michael Graf                INTERNET:    (mgraf@sydvm1.vnet.ibm.com)
                              BITNET:      (mgraf@vnet)
**********************************************************************
Newsgroups: comp.sys.mac.programmer
From: ray@netcom.com (Ray Fischer)
Subject: Re: TCL nightmare for C++ illiterate ex-windows programmer
Organization: Netcom. San Jose, California
Date: Fri, 22 Jan 1993 01:00:15 GMT

REE700A@MAINE.MAINE.EDU writes ...
>  Well, I got Think C, read Macintosh Revealed series and finally bought
>Mark & Cartwright's Programming Primer.  Granted the real problem's here
>are impatience and an information defecit, but I'm having serious problems
>with the Think Class Library.

Hmm.  You too, eh?  Useful, yes, but it rather reminds me of the
original phone-book edition of Inside Mac.  26 chapters, each of which
assumed you already knew the other 25.  Except now it's 50-some
classes.

>  I took "Starter.p" and added a class called "Flash", which is a floating
>point representation of a rectangle.  Included methods to get QD-compatible
>rectangle coordinates.  (Wonder of wonders... it worked!).  But I COULD NOT
>GET THE RECTANGLE TO DRAW!.

I don't know the class library that well, but it probably calls the
draw routine in response to an Update event (see Window manager
chapter of Inside Mac).  One way to generate same may be to call 
something like InvalRect().

-- 
Ray Fischer                   "Convictions are more dangerous enemies of truth
ray@netcom.com                 than lies."  -- Friedrich Nietszsche
From: jochen@blanc.north.de (Jochen Meyer)
Newsgroups: comp.sys.mac.programmer
Subject: Calling external code resources - how?
Date: 23 Jan 93 11:10:15 GMT
Article-I.D.: blanc.01050014.odph61
Reply-To: jochen@blanc.north.de (Jochen Meyer)
Organization: Jochen & Son
X-Mailer: uAccess - Macintosh Release: 1.5v4

Hello, folks!

I am currently writing a program that I want to be extensible. The
most common way of handling extensibility seems to be using external
code resources, like in Canvas or BBEdit.

Where can I find information on how to do this? The Segment Manager
chapter of IM gives no clues on this. Anyone has got some sample code
on this?

Thanks
	Jochen




-------------------------------------------------------------
| Jochen Meyer         |  Internet: jochen@blanc.north.de   |
| Sandfurter Weg 11a   |  phone: (+49) -441 / 50 85 47      |
| D-2900 Oldenburg     |------------------------------------|
|----------------------|"Features are well-documented bugs."|
Newsgroups: comp.sys.mac.programmer
From: sokoloff@athena.mit.edu (James T Sokoloff)
Subject: Re: Getting Caller ID information from a modem?
Organization: Massachusetts Institute of Technology
Date: Tue, 26 Jan 1993 23:17:14 GMT

In article <C11621.HoC@news.udel.edu> kurisuto@chopin.udel.edu (Sean J. Crist) writes:
>Caller ID, a telephone service started a few years ago, allows you to see
>the phone number of the party calling you before you answer the phone. 
>After the second ring, these data are somehow transmitted to a box which
>displays the number on an LCD display.
>
>Does anybody know how this data is transmitted, and whether it is possible
>for a Mac to read this information through an ordinary modem?   I would
>have thought that additional hardware would have been necessary (perhaps
>hardware which does not presently exist), but I recently saw an ad for a
>software product which seems to be accomplishing this.  What I want to
>write is a program which keeps a log of incoming calls (time and length of
>call and the number of the caller would be automatically recorded; the
>user would type in a description of the call).
>
>--Kurisuto

Look in comp.dcom.* groups and ftp to lcs.mit.edu for technical info.

---Jim Sokoloff

Newsgroups: comp.sys.mac.programmer
From: salmon@cwis.unomaha.edu (David Salmon)
Subject: Re: Custom defProc questions
Organization: University of Nebraska at Omaha
Date: Wed, 27 Jan 1993 11:37:51 GMT

I believe that the initCntrl message is sent when you call NewControl.
This is before you have hacked the controlProc pointer. Therefore you
need to call the init message yourself, immediately after NewControl.
You should probably check the contrlData field or something to see if
your control has been initialized (I'm not sure what other messages
NewControl may send).

To draw an icon as a title of a popup menu, set aside some area of the 
screen and draw the current selection. Nothing to do with the menu
manager. Doesn't matter if it is text or what. If you want to draw an
icon as the title of a menu in the menu bar, I think you have to 
write an MBDF proc.

As a general rule in defprocs, ignore all messages your defproc doesn't
understand. Some of these message (I presume) apple uses for special 
purposes. Just return.

Hope this helps.

-- 
David C. Salmon
salmon@unomaha.edu
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: (Debug) Why am I getting a TRAPV error here?!!
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Fri, 22 Jan 1993 07:00:58 GMT

In article <1993Jan21.041257.6776@leland.Stanford.EDU>,
felciano@summit.stanford.edu (Ramon M. Felciano) wrote:
> 
> I'm jumping into MacsBug on a TRAPV error when I try to use a popup
> menu using my MDEF. I've narrowed it down as far as I can, but my
> assembly isn't strong enough to go any further.
> 
> The error is occuring in a rouine that calculates the screen that has
> the largest intersecting area with the menu's rect. Here's the Pascal
> code excerpt:
> 
>      {***** TRAPV Error after this next line *****}
>      InterArea := (commonRect.bottom - commonRect.top) *
> (commonRect.right - commonRect.left);

You're going to have to coerce one of the subtractions into a LONGINT. All
of your values are INTEGERs, and the results of the subtractions and
multiplication will also be an INTEGER. However, the result of the
multiplication can easily exceed the range for INTEGERs (any 256 x 128
window will do). Try the following:

    interArea := LONGINT(r.bottom - r.top) * (r.right - r.left);

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
From: mab22@po.CWRU.Edu (Michael A. Balfour)
Newsgroups: comp.sys.mac.programmer
Subject: need help with Sound Manager!
Date: 28 Jan 1993 20:34:40 GMT
Organization: Case Western Reserve University, Cleveland, Ohio (USA)
NNTP-Posting-Host: slc5.ins.cwru.edu


Hi!  I've spent quite a bit of time writing routines that will play
background music during the execution of a program (i.e. game).  I've run
into a few problems:
 
1) If I use the wave table, it seems that I can't open a channel that uses
sampled sound.  This would be useful for sound effects.
 
2) If I use the wave table, I also can't open another channel that uses the
wave table if all 4 wave tables are already taken.  It would be useful to
override the sound coming out of that wave channel for wave sound effects,
if I can't play sampled ones.  I can't just stop and start the older
channel, because that would wreck any sort of synchronizing that I have
going.
 
3) If I use samples installed as instruments, I can't open more than 3
channels, and this slows down performance tremendously.  I've seen programs
(Studio Session, Prince of Persia) that can run several channels of samples
without slowing down, so it MUST be possible...
 
In Inside Macintosh Volume II, there's a reference in the Device Manager
chapter to being able to load the Sound Buffer with 370 bytes at a time
that get sent directly to the speaker.  If there aren't any solutions to
the above problems, is it realistically possible to write entirely new
routines that access the Sound Buffer directly?  If so, I understand how to
transpose waves and samples, but how do you play more than one at the same
time?
 
If you have an answer that's too long to answer here, PLEASE e-mail me!

Mike Balfour
Student
Case Western Reserve University
Cleveland, OH

mab22@po.cwru.edu
From: rgonzal@gandalf.rutgers.edu (Ralph Gonzalez)
Newsgroups: comp.sys.mac.programmer
Subject: QuickBASIC source code & comments
Date: 21 Jan 93 16:20:00 GMT
Organization: Rutgers Univ., New Brunswick, N.J.


In case anyone's interested, I have some QuickBasic source code I use for
a Microcomputer Graphics class. This includes examples of drawing, mouse
interaction, and also a simple application framework which adheres fairly
well to the Mac guidelines. Email me if you're interested.

Having just completed a commercial application using QuickBASIC, I agree
wholeheartedly that it is a lousy environment for serious work! It's good
for smaller programs, though.

I haven't been able to find many books on Mac QB, either. Microsoft has
one which comes with a copy of the QB interpreter. "Learn BASIC for the
Apple Macintosh Now". Probably a good deal for students.

By the way, while QB 1.00E is supposedly System 7 compatible, it still
crashes on me occasionally during compilation! (Even when I reboot
without extensions.) No problem if I reboot with 6.0.7...

-Ralph Gonzalez
-- 
Ralph Gonzalez, Computer Science, Rutgers Univ., Camden, NJ
Phone: (609) 225-6122; Internet: rgonzal@elbereth.rutgers.edu
--
Newsgroups: comp.sys.mac.programmer
From: lardieri@hotlips.Princeton.EDU (Stephen Lardieri)
Subject: Automatic dismissal of Notification Manager alerts
Originator: news@nimaster
Organization: Princeton University
Date: Sat, 23 Jan 1993 19:04:41 GMT

Is there a way for a program running in the foreground to a) detect
when some other program has put up a Notification Manager alert box
and b) automatically dismiss that alert box if the user doesn't
respond in a certain amount of time? 

The program in question is meant to be left running unattended for
long amounts of time.  It should obviously not block Notifications
completely in case the user happens to be in the vicinity of the
Macintosh, but if the machine is sitting in an empty room trying to
get work done, then it should not come to a screeching halt because
some other program is trying to tell the absent user about new e-mail
or somesuch.

What would be ideal is to have any timed-out Notifications re-displayed
when the user returns and clicks the mouse to tell my program that
a human being is present again.  Is that possible?

Oh yes; this program will be System 7 only.
From: keith@taligent.com (Keith Rollin)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think Reference 2.0 Review
Date: 22 Jan 93 07:31:27 GMT
Followup-To: comp.sys.mac.programmer
Organization: Taligent

In article <1jn6paINNs7r@life.ai.mit.edu>, peterc@hal.gnu.ai.mit.edu (Peter
Creath) wrote:
> 
> [comments about Think Ref 2.0's astonishing 7.1MB disk footprint]
> 
> I'd still like to see them do on-the-fly decompression so we could get
> that down to 3 to 5 MB (of course you don't compress indexes, or if you do,
> you load them all at once into RAM)

I think that IS the compressed size. Here's what you get:

AppleEvents
AppleTalk
Basic Toolbox
DAM/Edition/PPC/Slot
Online Help
Sound Mgr
Toolbox Index Pages
WWSO Mgr

"Basic Toolbox" is mostly what you got with TR 1.0. All the other databases
contain new information. Additionally, "Basic Toolbox" contains the rest of
the information that you wanted from IM VI.

Compare this to the amount of information you get with SpInside Mac (14.2
Meg), Inside Mac VI (21.4 Meg), and all the Technotes (12.8 Meg). With
those products, you get pretty much the same information, but at many times
the size of TR 2.0. If you want, you can also toss in 411 (16.3 Meg) and
the combined totals of IM-Files, IM-Memory, IM-Processes, and IM-Devices
(17.5 Meg).

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
From: rieger@msen.com (Steve Rieger)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Mac Databases
Date: 26 Jan 1993 02:13:41 GMT
Organization: Msen, Inc. -- Ann Arbor, Michigan
Distribution: usa
NNTP-Posting-Host: garnet.msen.com
X-Newsreader: TIN [version 1.1 PL8]

Depending on your needs you may also find the Hunk Manager useful. This is
a fairly simple, easy to use database system. The API is modeled after the
Resource Manager, but the underlying engine is much more powerfull. I
haven't used the product but I know of at least one commercial application
that does (Component Manager) and I'm sure there are others. There are
demos available on America Online and Compuserve - possible ftp'able as
well, but I'm not sure where from. Contact information is:

        GETTYS GROUP SOFTWARE INC
	401 EAST ILLINOIS STREET
	SUITE 600, CHICAGO, IL  60611
	PHONE 312.836.4222
	FAX 312.836.4220

--steve (rieger@msen.com)
Newsgroups: comp.sys.mac.programmer
From: boortz@sics.se (Kent Boortz)
Subject: A malloc() built upon sbrk() on a Mac?
Organization: Swedish Institute of Computer Science, Kista
Distribution: comp
Date: Wed, 27 Jan 1993 10:57:28 GMT



I have a malloc() replacement that I want to port to Mac.
It assumes a continuous memory area and a upper bound
moved by the Unix sbrk() call.

What I came to think of is this:

1.	Allocate a fixed stack space (this is the normal way
	on a Mac, isn't it?)
2.	Allocate with NewPtr() memory at the lowest address
	in the application heap. This will be immediately
	after the stack space.
3.	Implement sbrk() with SetPtrSize() on this memory area
	and let malloc() take memory from this area.
4.	If SetPtrSize() fails I do a MaxApplZone() and try
	again.

This way my "Unix" memory handling will grow from low application
heap address to high and normal mac allocation will grow from
high memory address to low. The collision of memory will still
be handled by the memory manager.

My problem is to do (2) because normally I can't tell the mac memory 
manager where I want to take memory. A solution to that could be:

		AllocMem = NewPtr(MaxMem(&any));
		SetPtrSize(AllocMem,size_wanted);

Any thought about this? Is there other ways of doing what I want?

Is there any way of doing mmap() on a mac? I have some large allocated
blocks that sometimes has to grow, and many small blocks. This sometimes
lead to big holes in the malloc memory area. If I could place these blocks
sparse they could grow and shrink without moving.

/kgb
--
Kent Boortz
boortz@sics.se
Newsgroups: comp.sys.mac.programmer