HDTenEightyP/NetNews huggingface dataset:
From: scott@mcl.ucsb.edu (Scott Bronson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Creating background tasks (HELP!).
Date: 24 Aug 92 00:50:37 GMT

In <1992Aug13.200535.18236@sunfs3.Camex.COM> kent@sunfs3.Camex.COM (Kent Borg) writes:

>In article <1992Aug13.170029.3055@qiclab.scn.rain.com> baer@qiclab.scn.rain.com (Ken Baer) writes:

>>What I want to do is allow our 3D rendering software to render in the
>>background to the user can use the modeller etc. while rendering.
>>Could someone either post, or point me to some documented code to set
>>this up?

>1) When your code gets CPU time (you will know this because it is
>executing) do your thing.

>2) When the user decides to say something to your running code--for
>example canceling the rendering he mistakenly started--notice the
>"Stop" menu choice, or "Cancel" button, or command-period keystroke,
>and act on it (by stopping in this case).  

3) Set the "accept background null events" in your size resource or you'll
wait a really long time for your code to finish if you switch it to the
background...  I forget to do this way too often.

>Because this is a user-oriented machine which is valuable precisely
>for its user interface, be very responsive about noticing that the
>user is talking to you.  Don't make the user pound on the keyboard.

Er, technically speaking the user cannot interact with your program
while it is in the background.  He/she/it must switch it to the
foreground to cancel the rendering.  I assume your renderer already
allows cancel, so no changes here.  I believe the only two events you
get while you are backgrounding are nullEvt and updateEvt and an
OS activate event when you get switched back forward.  (I think...)

Pass very small values to the sleepTime parameter in WaitNextEvent
(don't use GetNextEvent unless you HAVE to), and when you get time,
take a tick or two and get a few more calculations again.  Then call
WaitNextEvent so that other processes can get their fair time.  You
can use the following loop so that you can get the processor for a
fair amount of time:

// Uncompiled C code from memory below -- use at own
// risk, but you get the idea.
long l; EventRecord e;
while( task not done ) {
    if( WaitNextEvent( everyEvent, &e, 0L, nil ) ) {
	HandleUpdateOrOSEvent();
    } else {
        l = Ticks + 2;
        do {
	    SmallIncrementalPartOfYourTask()
	} while( Ticks < l );
    }
}

Note that if you want to be future compatible, use TickCount() instead
of the low memory global Ticks.  I use TickCount() because I figure that
if Ticks ever fails, it will be trivial to re-compile using TickCount().
However, none of the apps I've developed have been commercial (so far)
so I haven't had to worry about expensive upgrades.

This is how I've been doing it.  If anyone has any suggestions, please
do tell.

	- Scott
Newsgroups: comp.sys.mac.programmer
From: felciano@summit.stanford.edu (Ramon M. Felciano)
Subject: Q:How to write into a PictComment
X-Posted-From: InterNews1.0a2@leland.stanford.edu
Organization: Stanford University Medical Media and Information 
 Technologies
Date: Wed, 2 Sep 92 01:56:30 GMT
Xdisclaimer: No attempt was made to authenticate the sender's name.

Hi!

I'd like to write a string to a PICT resource I'm saving. I seem to
understand the call pretty well, but don't see how to indicate which
PICT I'm saving to. In particular, all of the sample code I've seen
writes the comment while building the picture.

I'd like to be able to read in a PICT resource, do some processing on
it, store a string in its comment field, and save it back out, all
_without_ showing the image.

Is there any way to do this without setting up an offscreen bitmap to
fake the picture drawing into?

Thanks!

Ramon

+-------------------------------------------------------------+
| Ramon M. Felciano           felciano@summit.stanford.edu    |
|                             (415) 723-9688                  |
+-------------------------------------------------------------+
From: jtgorman@cs.arizona.edu (J. Taggart Gorman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: STUFFIT FORMAT
Date: 1 Sep 92 07:35:42 GMT
Reply-To: jtgorman@cs.arizona.edu (J. Taggart Gorman)
Organization: Organization?  We don't need no steenking organization!
Discliamer: Upon my being captured or killed, my professors will
            disavow any knowledge of me, my statements, and/or
            my mission.


In article <1992Sep1.053037.39@terminator.cc.umich.edu>,
Citizen leonardr@ccs.itd.umich.edu writes :
>	The StuffIt Engine is still available as part of the StuffIT Deluxe
>and StuffIt SpaceSaver packages, and (as mentioned above) can also be 
>licensed for direct inclusion in your own applications.  Also, all of
>our application products (Lite, Deluxe, Expander, UnStuffIt, etc.) are all
>Apple event aware and include an 'aete' resource (as per the OSA guidelines)

  This message is not necessarily aimed at Leonard.

  How does one read the "aete" resource?  With a template, right?  If so,
where can I find the necessary template?  My ResEdit doesn't have it (I have to
dredge thru the resource in straight hex/char, ick!), and I don't recall seeing
it at any ftp site?  Is it in a league with BalloonWriter?  (Ie, only available
from ADPA?)

 Thanks.

|--------------------------------|    "If you were happy all of your life,
|      J. Taggart Gorman Jr.     |     you wouldn't be human - you'd be a
| jtgorman@caslon.cs.arizona.edu |     game show host."
|--------------------------------|             Winona Ryder, in _Heathers_
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Top byte of 24-bit offscreen gworld?
Date: 4 Sep 92 17:47:49 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <28628@vedge.UUCP>, brad@vedge.UUCP (Brad Fowlow) writes:
> Can anyone say how quickly or terribly things might
> go awry if I try to keep some extra info in the top 8 bits
> of the pixel data of a 24-bit offscreen gworld?
>
> That byte is awfully tempting as a place for alpha stuff.
> And for the moment I'm not too concerned with how the code
> will react under system 12; I just don't want sneaking
> randomness to show up next week.
> Have I missed something in IM6 that unequivocally rules
> this out, or permits it?  Has anyone else been similiarly tempted?

I get the feeling from IM6 that there is no great crime in using the extra
byte for your own purposes. Just bear in mind that most QuickDraw drawing calls
clear that byte in pixels that they modify; I think it's only CopyBits and
its relatives that would preserve that byte, and then probably not in all
circumstances.

Basically Apple isn't interested in adding future alpha channel support or
making any future use of that byte. Or so I gather. Remember, at least one
of Apple's video cards doesn't even have RAM allocated to store that byte!

And, let's face it--what can you do with alpha channels, that you can't do
using "blend" mode with CopyBits, and blend mask pixmaps with
CopyMask/CopyDeepMask? These existing QuickDraw blending facilities are so much
more powerful...

Lawrence D'Oliveiro                       fone: +64-7-856-2889
Computer Services Dept                     fax: +64-7-838-4066
University of Waikato            electric mail: ldo@waikato.ac.nz
Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
Q: Why do dogs make poor astronauts?
A: They keep sticking their head out the window and burning up on re-entry.
Newsgroups: comp.sys.mac.programmer
From: gadget@engin.umich.edu (Timothy David Sharpe)
Subject: Re: Internet mail from the Macintosh
Date: Thu, 27 Aug 92 23:17:42 EDT
Organization: University of Michigan Engineering, Ann Arbor

In article <71607@apple.Apple.COM> 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)...
Sounds to me like you need to learn SMTP.

It's not very difficult, and you should be able to send mail in about 3 secs
per message.

check the rfc's, I think it's 1285.

Tim

Newsgroups: comp.sys.mac.programmer
From: jbush@magnus.acs.ohio-state.edu (J Eric Bush)
Subject: Radius Monitors GrayRgn ?
Organization: The Ohio State University
Date: Wed, 2 Sep 1992 03:32:20 GMT

Does anyone know what the proper procedure is for determining when a
Radius Portrait monitor has been tilted?  I had tried using
screenBits.bounds, and read where the method should be using GrayRgn.

Does anyone know what global or value has changed when the monitor is
titled and does it send an update message to all open applications?

Thanks in advance, reply by email or net.

Eric
-- 
------------------------------------------------------------------------------
J. Eric Bush
Internet: jbush@magnus.acs.ohio-state.edu
From: js43+@andrew.cmu.edu (James William Stepanek)
Newsgroups: comp.sys.mac.programmer
Subject: Color Palette programming.
Date: 28 Aug 92 06:51:32 GMT
Organization: Materials Science and Engineering, Carnegie Mellon, Pittsburgh, PA

I am trying to create a program which shows data on temperature regimes
in castings. I need to be able to create a palette of just reds and
yellows. I would like to be ablt ot do this from inside the program. I
have Inside Macintosh IV but can't figure it out for the life of me. The
program is in Pascal and I am using Think Pascal. Any help would be
greatly appreciated. Thanks in advance.
James Stepanek
esp
From: cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton)
Newsgroups: comp.sys.mac.programmer
Subject: Re: GNU C++ for the Macintosh?
Date: 2 Sep 1992 21:09:06 GMT
Organization: Academic Computing

In article <pyknjaa.nagle@netcom.com>, nagle@netcom.com (John Nagle) wrote:
> 
> Glen.Stewart@f175.n2240.z1.ieee.org (Glen Stewart) writes:
> >I see that GNU C++ supports over 40 different processors and comes with source 
> >code.  Is it avaiable as a running Macintosh program?
> 
>       GNU C++ is not available for the Macintosh for religious reasons.
> Details in "gnu.misc.discuss".

Bzzzt. Wrong. g++ is available for MPW and can be found on ftp.apple.com.
From: utimbake@mcl.ucsb.edu (Bonard Timmons)
Newsgroups: comp.sys.mac.programmer
Subject: Unix==>MPW porting Question
Summary: How do you install Unix C compiler code under Mac C?
Keywords: Oaklisp Makefile install Dylan
Date: 3 Sep 92 17:25:59 GMT


Hi, everyone.  I am trying to install Oaklisp -- apparently a pretty good
language; it influenced the design of Apple's new Dylan OOL. 

	My question: how do I do it?  In Unix it is easy -- just type:

		make install

and all is well.  I am using MPW-compatible "Harvest-C" compiler and realize
that the Oaklisp distribution contains "Makefile" shell scripts.  What's
the best way to hack this so that the compiler can handle it?  Are there any
good references out there that cover these basics?

	(I know this must be a common problem;is it a FAQ?  Thanks in advance!)

--
Bake Timmons, III

-- "...there's nothing higher, stronger, more wholesome and more useful in life
than some good memory..." -- Alyosha in Brothers Karamazov (Dostoevsky)
Newsgroups: comp.sys.mac.programmer
From: stepan@natinst.com (Stepan Riha)
Subject: Re: dereferencing Handles( was Re: incrementation differences/THINK C 4.0 vs. 5.0)
Organization: National Instruments, Austin, TX
Date: Tue, 25 Aug 1992 17:42:28 GMT

In article <1992Aug25.150911.19008@bnr.ca> gcote@crchh74f.BNR.CA (Gary Cote) writes:

Gary asks whether the following snippet violates "safe hadnle conventions"

>|>nxtWrd(char **theDataPtr, char *lab, int  tabs)
>|>{
>|>	char *temp;
>|>	int i=0;
>|>	
>|>	temp = *theDataPtr;
>|>	
>|>	while(*temp == '\t') 
>|>	{
>|>		temp++; i++;
>|>	}

>[It seems that]
>once theDataPtr is dereferenced and copied into temp, this leaves him
>open to the great disappearing memory trick...

The answer is NO!  temp is going to be fine as long as no functions is
called that might relocate memory.  Thus, if you were to call NewPtr or
NewHandle (for example) *after*  temp = *theDataPtr;  then you would be in
trouble.  Since the only things that are being done are assignment, comparisons
and some arithmetics temp is quite safe.

However a thing to be carefull about is code of the form:

	Handle	h;

	*h = foo();

where foo() causes memory to be relocated.  If the LHS is evaluated first, it
might be incorrect once foo is called.  The correct way to write this would be

	Handle	h;
	char	c;

	c = foo();
	*h = c;

	- Stepan
-- 
   Stepan Riha -- stepan@natinst.com

Newsgroups: comp.sys.mac.programmer
From: rreid@mnemosyne.cs.du.edu (Mr. Robin R. Reid)
Subject: Help for a new programmer...
Keywords: Inside Macintosh
Organization: University of Denver, Dept. of Math & Comp. Sci.
Date: Wed, 26 Aug 92 17:24:53 GMT

I'm a new programmer who is confused by one of the code samples
in "Inside Macintosh : Files," and I'm hoping someone can help
me to understand what I read there...

Listing 1-8 on page 1-22 declares a variable

  myBuffer : Ptr;
  
and later allocates the pointer with the call

  myBuffer := NewPtr(myLength);
  
but, as far as I can tell, this pointer is not de-allocated
anywhere.  Am I missing something, or is this just an error
in the code?  

Also, I was wondering if anyone could offer some help with
the fact that a TEHandle is declared but not used...

Thanks in advance!
From: csuley@cs.cornell.edu (Christopher Suley)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Comparing strings 'n stuff...
Date: 28 Aug 92 17:19:16 GMT
Article-I.D.: cs.1992Aug28.171916.16996
Organization: Cornell Univ. CS Dept, Ithaca NY 14853

In article <chuck-280892124136@choffman.gte.com> chuck@gte.com (Chuck Hoffman) writes:
>In article <1992Aug28.134804.9876@sun1x.actc.res.utc.com>,
>rer@utrcv1.res.utc.com (Rick E Romkey) wrote:
>> 
>> 
>> 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.
>> 
>
>If you are using THINK C, there are two routines for converting between
>strings of Pascal format (with length byte at the beginning) and C format
>(with null character at the end).  They are "PtoCstr" and "CtoPstr".  If
>you get both strings into C format, then you can use the C library routine
>"strncmp" to compare them, even if they are of dissimilar length.
>

If you stored the strings in your resource file in 'STR#' (string list)
resources, you could use GetIndString to read them into a Str255 variable.
Then, you could use IUMagIDString (or EqualString, I think) to compare them.
All the calls mentioned are documented in Inside Macintosh volume 1.
From: REEKES@applelink.apple.com (Jim Reekes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Checksumming MemErr global variable (Tech Note 7) problem
Date: 26 Aug 92 20:26:04 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <1992Aug18.181714.12276@midway.uchicago.edu>,
chh9@quads.uchicago.edu (Conrad Halton Halling) wrote:
> 
> Tech Note 7 says:
> 
> "If you are having strange, memory-related problems, one thing that
> you can do to help find them is to checksum on MemErr (the low memory
> global word at $220).  In MacsBug, type "SS 220 221"....  When MemErr
> changes, the debugger will appear, and you can check your code to make
> sure that you are checking MemErr.  If not, you might have found a problem
> that could cause your program to crash!"
> 
> I tried this, but apparently StripAddress() is using MemErr because it
> is stuffing strange numbers into this global variable, so this technique
> doesn't seem to work any more.  Does anyone know why StripAddress()
> is using MemErr??
> 
> Furthermore, although I can get the "SS" command to work on an SE, a IIcx,
> and a IIci under System 7, it locks up a IIsi.  The cursor changes to
> the watch, the hands move a few times, the cursor disappears, and then
> nothing.  Has anyone had problems with this?


> I tried this, but apparently StripAddress() is using MemErr because it

I don't believe it.  Go into the debugger and list the code for
StripAddress.
(e.g. IL StripAddress in MacsBug).  Do you see it referencing MemErr?
If nothing else, put the machine into 32 bit mode if possible and then
do your testing.  In 32 mode, StripAddress is just an RTS instruction.

-----------------------------------------------------------------------
Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | RAll opinions expressed are mine, and do
20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
Cupertino, CA 95014          |       employer, Apple Computer Inc.S
Newsgroups: comp.sys.mac.programmer
From: leonardr@ccs.itd.umich.edu
Subject: Re: STUFFIT FORMAT
Originator: leonardr@diddley.ccs.itd.umich.edu
Organization: Campus Computing Sites, University of Michigan-Ann Arbor
Date: Tue, 1 Sep 1992 05:30:37 GMT

In article <1992Aug30.060353.4783@tamsun.tamu.edu> sefhelp@tamuts.tamu.edu (Steve Fuller) writes:
>In article <5121.1243.uupcb@meaddata.com> tim.meade%theweb@meaddata.com (Tim Meade) writes:
>>I am in need of the Stuffit or Unstuffit format. Is this in the public
>>domain?  I want to do a conversion program and would like to be able to
>>directly handle these files.  Any help would be apprecitive.
>>
>
>Not much chance of obtaining the new 3.0 format. HOWEVER, SD (and SL?) support
>' a large number of Apple events'. Contact Aladdin for details.
>(408) 761-6200 or ALADDIN@Applelink
>
	Actually we license the format information to "needy" people, we also
license the StuffIt Engine for inclusion in products that wish to provide
stuffing/unstuffing capabilities. You want to call Aladdin and ask to speak
to licensing.

>If Leonard is reading, perhaps he could provide more info. Like:
>Can applications call the StuffIt Engine? or must the use the SD App?
>Can the free UnStuffIt handle Apple Events? or be externally scripted?
>
	The StuffIt Engine is still available as part of the StuffIT Deluxe
and StuffIt SpaceSaver packages, and (as mentioned above) can also be 
licensed for direct inclusion in your own applications.  Also, all of
our application products (Lite, Deluxe, Expander, UnStuffIt, etc.) are all
Apple event aware and include an 'aete' resource (as per the OSA guidelines)
for describing the supported events.  

-- 
-----------------------------------------------------------------------
Leonard Rosenthol		  Internet: leonardr@ccs.itd.umich.edu
Director of Advanced Technology   AppleLink: MACgician
Aladdin Systems, inc.		  GEnie:     MACgician
From: niko@iastate.edu (Nikolaus E Schuessler)
Newsgroups: comp.sys.mac.programmer
Subject: message for brad@tazboy.jpl.nasa.gov
Date: 31 Aug 92 18:40:16 GMT
Organization: Iowa State University, Ames, IA

** couldn't get this mail through... **
* sigh *

>    Video (GetMainDevice) Palette/colortable manipulation routines...

> ?
     The video card gets initialized with 256 default colors (IIcx
8bit video card). I'm suspecting that I'm gonna have to talk directly
with the video card to change palletes & stuff cause most of the
facilities will require an init_pallettes and possibly init_quickdraw
calls (which probably aren't in rom).

>    > GetFont/Resource calls (for system fonts in rom)

> Sort of, I think.

>    Memory stuff...

> The routines are available but you may need to setup your own heap first.
> The boot routine has its own heap but it may not be setup the way you
> want it.

>    Slot Manager...

> Yes

>    And what does the memory map look like at this point?

> this is a big question, could you be more specific.
> also, what machine are you using?

The startup sequencs 'sets up device tables' (video) and 'loads' the diskdriver
et. al. How do I know what memory address is safe to load a program into?
I'm gonna have to write my own malloc, so it'll have to know what not
to touch...

(IIcx 5MB, 40M hd)

> Depends on how much of the mac environment you can keep looking like the
> mac os thinks it should look like.

This is what scares me... 'what the mac os thinks it should look like'
probably isn't info that is easy to get at.

> I have played with this stuff quite a bit and really enjoy digging in to
> these issues.  

  Me too... I finally understand how the games get control of the entire
screen... and do it rather speedily.. the use the screen buffer
directly (??).

> Let me know if you have any specific questions that I might
> be able to figure out for you.  

Well... right now I'm trying to get my program to boot off a floppy...
I have some sample code written for gcc/MACMINIX which is helpful,
but I still have to figure out how and where to write this code
on the floppy to get it to boot .. details details...

thanx for the helpful info...

-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50010                                snail: 272 Durham 
Newsgroups: comp.sys.mac.programmer
From: brunner@crchh447.bnr.ca (James Brunner)
Subject: Sample drag&drop program needed
Reply-To: brunner@crchh447.bnr.ca (James Brunner)
Organization: Bell-Northern Research, Richardson, Tx
Date: Tue, 25 Aug 1992 20:49:20 GMT

I'm doing a quick port of some filters from UNIX and I'd like to know if
there is any sample drag&drop shells out there for Think C.

Specifically, I want to drag a file onto an application.  The application
should then prompt (SF) for the output file.  Possibly an additional dialog
will follow for parameters.  The program will read the dropped file, crunch,
and write to the output file.

Any sample source very appreciated and further suggestions on how to port
this type of program quickly (like UNIX command line interpretors, etc).

Please respond by e-mail (brunner@bnr.ca)
-- 
---------------------------------------------------------------------------
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.
From: mxmora@unix.SRI.COM (Matt Mora)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Zbasic+System 6/7 Speed
Date: 25 Aug 92 16:03:14 GMT
Organization: SRI International, Menlo Park, California

In article <15639.2A996B26@zeus.ieee.org> Ray.Arachelian@f204.n2603.z1.ieee.org (Ray Arachelian) writes:

>Is there something ZBasic does wrong in terms of WaitNextEvent or 
>GetNextEvent?  Certainly with ZBasic you have almost no control over these 
>commands, as it does it's own event handling to buffer you away from the 
>tool box.  This is good for new programmers, but gets very cumbersome with 
>me.

Yes it calls WNE/GNE before every line of your basic code. Not very
efficient. Don't worry about it.  Wait for future basic and
upgrade as soon as you can.



Matt

-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________
Newsgroups: comp.sys.mac.programmer