HDTenEightyP/NetNews huggingface dataset:
From: etter@casim.bio.umb.edu (Ron J. Etter)
Newsgroups: comp.sys.mac.programmer
Subject: Foreground-background-foreground switch doubles speed?
Date: 23 Dec 92 16:20:04 GMT
Organization: UMass/Boston
X-Xxmessage-Id: <A75DFD0715011AC9@casim.bio.umb.edu>
X-Xxdate: Wed, 23 Dec 92 11: 24:55 GMT
X-Useragent: Nuntius v1.1.1d16

I am writing a simulation program in Think Pascal and have encountered 
some strange (I think) behavior in my code (most likely) or possibly 
WaitNextEvent.  In short, the problem is that the speed of the program 
while in the foreground (with no other applications running) is almost 
twice as fast if it has been sent to the background and then brought 
back to the foreground compared to just leaving it in the foreground.  I 
don`t understand why simply switching the program in and out of the 
background should influence the foreground speed.  I`d appreciate it if 
someone could tell me what I am doing wrong or if they have experienced 
a similar problem.  Below is the source and a description of how the 
code works.  

During each loop of the simulation, a function is called to determine if 
the user has pressed a stop button on the screen.  The stop function 
contains a call to WaitNextEvent so the program can be switched between 
foreground and background.  It is background enabled.   Below is the
code.  SleepTicks is set to 1 at startup. Thanks in advance for any 
help you might provide. 


{-------------------------------------------------------------------}
	function StopRun: boolean;
		const
			mousemovedmessage = $FA;
			SuspendResumeMessage = 1;
			ResumeMask = 1;
		var
			Event: EventRecord;
			wh: point;
			stop: boolean;
begin
	stop := false;
	if WaitNextEvent(EveryEvent, Event, SleepTicks, nil) then
		begin
			case Event.what of
				KeyDown: 
					Stop := true;
				MouseDown: 
					begin
						wh := Event.Where;
						GlobalToLocal(wh);
					stop := PtInRgn(wh, StopRgn[modeltype]);
						end;
				app4Evt: 
					case BSR(event.message, 24) of
						MouseMovedMessage: 
							;
						SuspendResumeMessage: 
				if BAND(event.message, ResumeMask) <> 0 then
							begin{Resume event}
								SleepTicks := 1;
								DrawWindow;
								end
							else
							begin {Suspend event}
								SleepTicks := 2;
								end;
					end; {case BSR}
				otherwise {Do nothing}
			end; {case}
		end; {waitNextEvent}

		if stop then
			begin
				InvertRgn(StopRgn[modeltype]);
				Delay(5, ticks);
				InvertRgn(StopRgn[modeltype]);
			end;
		StopRun := stop;
	end;
{--------------------------------------------------------------------}
Newsgroups: comp.sys.mac.programmer
From: martinher@urvax.urich.edu
Subject: SetKeys Command in MPW
Reply-To: martinher@urvax.urich.edu
Organization: University of Richmond
Date: Sat, 26 Dec 1992 00:29:41 GMT

SetKeys obviously exists, I used it.  I am trying to RTFM.  Does anyone
know where the reference is located and which manual?  I found 'setkeys'
by looking at the Commando command list.  I tried it and it worked
in some simple cases but more complicated ones (if-then logic) did
not.  Obviously, I can write those as commands and bind them but they
were only one liners anyway and I would like to see the 'rules'.

Herb Martin
martinher@urvax.urich.edu
Newsgroups: comp.sys.mac.programmer
From: rduta@nyx.cs.du.edu (Radu)
Subject: Re: using the A5 register (help wanted)
Keywords: Help wanted
Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
Date: Mon, 4 Jan 93 05:16:29 GMT

Ok, that's a start.  So you say that A5 is used as a reference for the global
application variables.  Is this an agreed standard?  For example, if i wrote
a program strictly in asembly, would even need set up A5, from the description
you gave me it sounds as though the compiler creates and uses A5 for it's 
own purposes, which i doubt.  I think I heard somewhere that it's used to
store QuickDraw information that pertains to the current application.

In any case what exactly is A5, does it hold and pointer or handle, and what
is the format for what it holds?

radu

--
********************************************************************************
I only kill to know I'm alive!
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Newsgroups: comp.sys.mac.programmer
Subject: C.S.M.P. Digest V1 #226 Available
Date: 22 Dec 92 12:54:05 GMT
Article-I.D.: cs.1992Dec22.125405.13042
Followup-To: poster
Organization: University of Oregon Computer and Information Sciences Dept.


C.S.M.P. Digest             Tue, 22 Dec 92       Volume 1 : Issue 226

Today's Topics:

	DPI on the fly
	Floating Point to String Conversion
	Invalidating the Entire Screen?
	3D graphics...
	How do you make a master disk?
	Possible Bug  With MPW
	Reading in jpeg compressed PICT files



The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.

The digest is a collection of article threads from the internet newsgroup
comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
regularly and want an archive of the discussions.  If you don't know what a
newsgroup is, you probably don't have access to it.  Ask your systems
administrator(s) for details.  You can post articles to any newsgroup by
mailing your article to newsgroup@ucbvax.berkeley.edu.  So, to post an
article to comp.sys.mac.programmer, you mail it to
comp-sys-mac-programmer@ucbvax.berkeley.edu.  Note the '-' instead of '.'
in the newsgroup name.

Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject.  The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
cs.uoregon.edu).  Article threads are not added to the digest until the last
article added to the thread is at least one month old (this is to ensure that
the thread is dead before adding it to the digest).  Article threads that
consist of only one message are generally not included in the digest.

The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
[128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
file /pub/mac/csmp-digest/README before downloading any files.  The most
recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
archive has a mail server; send a message with the text '$MACarch help' (no
quotes) to LISTSERV@ricevm1.rice.edu for more information.

The digest is also available via email.  Just send a note saying that you
want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
automatically receive each new issue as it is created.  Sorry, back issues
are not available through the mailing list.

Send administrative mail to mkelly@cs.uoregon.edu.


-- 
_____________________________________________________________________________
Michael A. Kelly                                               Senior Partner
mkelly@cs.uoregon.edu                                      High Risk Ventures
_____________________________________________________________________________
Newsgroups: comp.sys.mac.programmer
From: koehn@vms.macc.wisc.edu
Subject: Re: AppMaker and TCL
Organization:  University of Wisconsin Academic Computing Center
Date: 23 DEC 92 19:33:40    

In article <cardinal.724710188@pythagoras>, cardinal@informix.com (Edward Cardinal) writes...

>Does anyone know what version of TCL code AppMaker produces? In particular,
>does it use the new Table classes for list panes, or does it use its own?

AppMaker 1.5.2 generates TCL 1.1.2 compatible code. The class it uses for lists 
is a subclass of CArrayPane.

Brad Koehn
koehn@macc.wisc.edu
From: genglish@applelink.apple.com (Gary English)
Newsgroups: comp.sys.mac.programmer
Subject: Re: where to get info on Quicktime
Date: 28 Dec 92 18:40:05 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer

In article <1992Dec18.205429.4262@oakhill.sps.mot.com>,
hunter@oakhill.sps.mot.com (Hunter Scales) wrote:
> 
> 
> 	Can someone tell me where to get information on how to use
> 	Quicktime in a program?


The QuickTime developer package from the
Apple Programmers Developer Association 
has all the documentation and header files.
Lots of sample code and piles of movies and stills.

The QuickTime for Windows SDK also includes 
that material.

APDA is at ...  800-282-2732.




> 	I understand that it is possible to replace the decompression
> 	routines in Quicktime.

The Image Compression Manager uses modular codecs.
The codecs are implemented as Component Manager
components and are easy to work with.  The components
can be placed in the QuickTime INIT, the system folder
or in the movie file.

The QuickTime for Windows solution is similar but uses
DLLs.



> 	and my Sparcstation, MPEG wins hands down on quality of
> 	picture.  

My exposure to MPEG was not as positive as yours.
Perhaps MPEG2 will be more interesting.
Compact Video is way cool for motion video.
JPEG is way cool for stills.
There are other codecs with trade-offs
in quality/size/speed/cost/hardware assist etc....




>  Is the Quicktime video decompressor DCT-based?
> 	(probably not considering the multitude of multiplies needed).

The JPEG codec is DCT based.
The other codecs use other methods.




Gary English
Continuous Improvement Engineer
Newton Software
Apple Computer, Inc.
Newsgroups: comp.sys.mac.programmer
From: rtmd30@email.sps.mot.com (Greg Ferguson)
Subject: Re: New to macintosh programming...
Followup-To: comp.sys.mac.programmer
Organization: Motorola
Date: Wed, 30 Dec 1992 08:03:05 GMT

In article <chuckb.725567825@milton>, chuckb@milton.u.washington.edu (Chuck
Bass) wrote:
> 
> I am an experienced C programmer beginning work on a 
> Mac (coming from workstation/PC programming).  I am wondering if
> there is a specific book or other reference to help my
> transition to the mac.  I would like learn specifics about
> portability issues such as memory allocation and file IO.
> 
> If anyone has any info, anecdotes, references on making this
> transition I would apprecitate it.
> 
> chuckb
> 
> (I'm using Think C)

Other books which are highly recommended are:

    Macintosh Programming Secrets, 2nd Ed.
    Knaster and Rollin,
    Addison Wesley
    $29.95 U.S.

    How to Write Macintosh Software, 3rd Ed.
    "The Debugging Reference for the Macintosh"
    Scott Knaster
    Addison Wesley
    $28.95 U.S.
    
The style of the books are informal, with a lot of insight into potential
problems you might run into.

A subscription to Develop from APDA with the CD-ROMs would be good too.
There's a pretty good collection of source and snippets on the disk along
with the technical notes, human interface guidelines, online versions of
the Inside Mac books...

Also, you might want to get a demo of the Think Reference. Copies are
available at many of the archive sites. Or, just buy a copy. I think it's
worth it even with the errors it contains. It should be updated soon.
(Maybe in time for MacWorld I hope!)

You really do need the Inside Mac books, but Apple's about half way through
updating them. About five of the new series are out now, but they reference
others in the set which are not available. So, you'd need the original
versions too unless you've got them online which takes up over 10Meg...
which is where my recommendation for the CD-ROM subscription comes in. :-)

Greg Ferguson
Programmer/Engineer
Desktop Networking System
SPS, World Marketing
Motorola, Inc.
Newsgroups: comp.sys.mac.programmer
From: Quinn <quinn@cs.uwa.edu.au>
Subject: Re: Installation gripes (again)
X-Xxdate: Tue, 22 Dec 92 01: 14:09 GMT
Organization: The University of Western Australia
X-Useragent: Nuntius v1.1.1d13
Date: Tue, 22 Dec 1992 01:18:45 GMT

Lawrence D'Oliveiro, ldo@waikato.ac.nz writes (with sarcasm):
>The other wonderful product that sticks in my mind is the Aldus
installer.
>This one presents you with a wonderful array of options, and generates an
>installation log, and everything.

An installation log is one thing I'd really love to see in the Apple
Installer.  I'm sick of having to dredge through the system folder
looking for stuff the installer put there only so I can remove it
and place it all on the file server.

Hey, you never know, the installer might actually be capable of
generating one.  Some sort of hidden undocumented debugging feature
akin to Disk First Aid's progress window.  Wouldn't it be nice.
Wishful thinking strikes again.

But that's only a minor complaint.  I love one button installation,
I love one button installation, ...

Share and Enjoy.

Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
Department of Computer Science, The University of Western Australia
  -- I love one button installation.
Newsgroups: comp.sys.mac.programmer
From: art@leis.base.bellcore.com (A. Zysk)
Subject: Best C Programmer's Text Editor
Reply-To: art@leis.base.bellcore.com (A. Zysk)
Organization: ZEI Software
Date: Tue, 29 Dec 92 19:48:32 GMT

I am in search of a good text editor for C programming
on the MAC Plus.

I have seen an old copy of an EMACS port which is the best I've
seen so far but has the following shortcommings:

1. Have to type full directory pathname to open files not
   in the current directory.

   (All I want to do is open a file in ../include/tmp.h
    or ../../include/tmp.h, etc.)

2. Needs faster startup.

   Perhaps put unused code in resource until needed.
   Any other ways to speed up time to start up editor?
   Critical to improve edit, compile,link,test,cycles.

I like EMACS or any editor that allows multiple scrolling windows.

Are others out there yearning for the same things as me?

P.S. ( I am using Aztec C from Manx, happy with all except my
       difficulty in coaxing Aztec's tools to work in a heirarchical
       directory structure )  ( If switching to Think C is the answer,
       has anybody ported a large Aztec C application to Think C ?
       Or what would it take to maintain portability between the two ? )

Newsgroups: comp.sys.mac.programmer
From: ppc1@cec2.wustl.edu (Peter Pui Tak Chiu)
Subject: off-screen bitmap
Organization: Washington University, St. Louis MO
Date: Sat, 2 Jan 1993 06:25:16 GMT

hi everyone...

i am trying to create an off-screen buffer in which i can draw in and then
copy the completed picture back to the screen.  i have tried the following
method but it doesn't seem to work very well...

i am using MPW.

first of all, i create a BitMap of size 300 x 300 pixels in memory by the
following:

	move	#11552,d0	; size of BitMap
				; since rowWidth = 38, so each row has 304 bits
				; 304 x 304 / 8 = 11552 bytes
	ext	d0		; extend to long word
	_NewPtr			; get non-relocatable block of size 11552
	move.l	a0,BitMap.baseAddr	; set up BitMap base address
	move	#38,BitMap.rowBytes	; set up rowBytes
	clr	BitMap.bounds.Top	; set up bounding rectangle
	clr	BitMap.bounds.Left
	move	#300,BitMap.bounds.Bottom
	move	#300,BitMap.bounds.Right

BitMap is defined as follows:

Rect	RECORD	0
	Top:	ds	1
	Left:	ds	1
	Bottom:	ds	1
	Right:	ds	1
	ORG	Top
	TopLeft:	ds.l	1
	BottomRight:	ds.l	1
	ENDR

BitMapRecord	RECORD	0
	baseAddr:	ds.l	1
	rowBytes:	ds.w	1
	bounds:		ds.l	Rect
		ENDR

BitMap	ds	BitMapRecord

note that i have missed out some code that checks if there exists a block
of size 11552 bytes... just to make things clear.

then i save all the drawings into the BitMap and restore them onto the
window by doing this:

	pea	BitMap	; BitMap is the only parameter	
	_SetPBits	; set port to BitMap

	...... CALLS TO DRAWING ROUTINES, MoveTo, LineTo, ...etc 

	move.l	myWindowPointer,-(sp)	;push pointer of myWindow
	_SetPort			;set port to myWindow

	pea	BitMap		;source BitMap
	pea	myRectangle	;source Rectangle
	pea	myRectangle	;destination rectangle
	move	#srcCopy,-(sp)	;normal copy mode
	clr.l	-(sp)		;don't want to clip to a maskRgn, so just
				;pass NIL for the maskRgn parameter
	_StdBits		;call bit transfer

where myRectangle is defined as:
	myRectangle:	dc	0,0,300,300

and myWindowPointer is defined as:
	myWindowPointer: ds.l	1

the problem that i have is only part of the BitMap got copied to the
destination window.  The area that got copied is (top:0, left:0, bottom:80,
right: 100) and the rest of the 300x300 window area is just a mess...

i really don't know what has gone wrong... i have been sitting all day in
front of the computer trying to figure out what could be wrong but still
didn't make any progress.

the only thing i am suspecting wrong is the NIL parameter.  I want to pass
a NIL pointer for the last parameter of _StdBits but i am not sure what to
push on stack.  should i just pass a long word zero?  or what?

what is the constant value defined for NIL or NIL pointer...???

i really would appreciate it if anyone can give me some suggestion on this
matter.
	
thank you very much in advance!!!

peter


Newsgroups: comp.sys.mac.programmer
From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
Subject: Re: Programming Group and the 32k TextEdit barrier
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Tue, 22 Dec 1992 20:49:23 GMT

In <iscjcw-211292110332@ajax.ucop.edu> iscjcw@uccvma.ucop.edu (Jerry Wilcox) writes:

>Might I ask why you aren't considering taking advantage of the ground we
>have broken with TopSoft? TopSoft has a structure, an incorporated
>non-profit, and is beginning to have name recognition. There are multiple

I wouldn't touch TopSoft with a stick.

I have publicly criticized TopSoft for certain specific
reasons, but never gotten any reply.

Stay away from TopSoft, at least as long as it sounds more like
a megalomaniac pushing poor beginners around than a collection
of open minds doing things for fun and learning.

Cheers,

							/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   The word "politics" is derived from the word "poly", meaning
   "many", and the word "ticks", meaning "blood sucking parasites".
                     -- Larry Hardiman
From: noah@apple.com (Noah Price)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Uniquely identifying a Mac? How?
Date: 23 Dec 92 19:33:56 GMT
Followup-To: comp.sys.mac.programmer
Organization: (not the opinions of) Apple Computer, Inc.

In article <peter-211292133304@rocky.curtin.edu.au>,
peter@cujo.curtin.edu.au (Peter N Lewis) wrote:
> Isn't it clear why its not done?  If Apple put a serial number on the 
> machine, and people successfully copy protect their programs, the immediate
> consequence of this is that the value of the machine drops a great deal.
> All those users can't pirate the programs they want, so they stop buying
> the machines, and buy other machines where they can get the programs 
> they want for free.  This may not be moral, but I haven't found much
> connection between morality and reality.  Besides, its not Apple's 
> problem if people pirate (non-apple) software, quite the opposite,
> Apple benifits by this.

Sorry to burst your bubble.  As developers who watch the newsletters know,
Apple is quite active in anti-piracy education efforts.

People have already talked about why the simple serial number is more
trouble than it's worth for copy-protection (or more accurately, for
execution control).  More advanced devices, yes those ugly dongles, solve
some of these problems by adding some intelligence.  More important, they
can move from machine to machine so you don't have to go through
administrative back-flips when you service, upgrade, or replace a machine. 
Newer ones can even key multiple application, so you don't get a
dongle-tree growing off your keyboard.

I personally don't think these should be used at all though, except for
mega-buck vertical market applications, or software sold in countries with
little or no respect (or legal clout) for copyright and piracy protection.

noah

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noah@apple.com                                 Macintosh Hardware Design
...!{sun,decwrl}!apple!noah   (not the opinions of) Apple Computer, Inc.
Newsgroups: comp.sys.mac.programmer
From: jtbell@hubcap.clemson.edu (Jon Bell)
Subject: Re: Assembly??
Organization: Presbyterian College, Clinton SC
Date: Wed, 23 Dec 1992 04:30:17 GMT

another good assembly book is Steve Williams's "68030 Assembly Language
Reference", published by Addison Wesley, ISBN 0-201-08876-2, $29.95.

Jon Bell / Dept. of Physics & C.S. / Presbyterian College / Clinton SC
Newsgroups: comp.sys.mac.programmer
From: ficara@remus.rutgers.edu (ken ficara)
Newsgroups: comp.sys.mac.programmer
Subject: fprintf to ImageWriter??? Help!
Summary: Trying to write to printer w/ stdio functions
Keywords: debugging macintosh imagewriter think c
Date: 2 Jan 93 17:45:22 GMT
Organization: Rutgers Univ., New Brunswick, N.J.

In Scott Knaster's HOW TO WRITE MACINTOSH SOFTWARE, 2nd ed, page 118,
a useful debugging technique is suggested: opening the printer port
and using standard printing functions to send debugging info straight
to the printer.

He suggests the following in Pascal:

var
	printer: Text;
begin
	Reset (printer, '.bout');
	WriteLn (printer, 'Text text text...');

I tried to translate this to C and came up with the following:

#include <stdio.h>

main ()
{
	int		i;
	FILE	*printerPort;
	
	if (!(printerPort = fopen ( ".bout", "w")))
		printf ("%s","Cannot open printer.");	
	else
		printf ("Opened printer.");
	if	(ferror(printerPort))
		printf ("%s","Error on printer port stream.");	
		
/*
	for (i=1 ; i<=10 ; i++)						
		printf (printerPort, "%s", "this is a test\n\r");
*/

	fclose (printerPort);	

}


This program reports that the printer port has been opened and does
not report an error on the stream. But it crashes with an address
error,even if the printf statement is commented out.

The Pascal version doesn't work either, but I'm not as familiar with Pascal.

Does anyone know how to do this? It would be an incredibly useful
technique but for the crashing. :)

Thanks!


Ken Ficara                                        ficara@remus.rutgers.edu
GEnie: K.FICARA / Compuserve: 71311,1461 / AOL: KENFICARA / Prodigy: (Ha!)
Newsgroups: comp.sys.mac.programmer
From: ctrbdo@iapa.uucp%mailhost.ecn.uoknor.edu (bryan d oakley)
Subject: MacMINIX
Organization: FAA / Mike Monroney Aeronautical Center
Date: Thu, 31 Dec 1992 16:22:24 GMT

I've seen several references of late to MacMINIX.  Anyone care to
describe the product? 
-- 
----------------------------------------------------------------------
Instrument Approach Procedures Automation              DOT/FAA/AMI-230
----------------------------------------------------------------------
Bryan D. Oakley                    ctrbdo%iapa@mailhost.ecn.uoknor.edu
From: liran@bimacs.BITNET (Eshel Liran)
Newsgroups: comp.sys.mac.programmer
Subject: Deliminator char in AFP C++ sample
Keywords: AFP
Date: 24 Dec 92 13:02:05 GMT
Organization: Math & CS, BarIlan U, Ramat-Gan, Israel

The "AFP C++" sample code uses '@' as it's deliminator character in path names.
WHY ????
Is't it safer to use ':' instead ?
Knowing that the finder doesn't allow one to use ':' in a file or volume name ?

-Liran
Newsgroups: comp.sys.mac.programmer
From: urban@yoda.fsl.noaa.gov (Art Urban)
Subject: TCL, Another Question...
Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
Date: Tue, 22 Dec 1992 18:46:43 GMT

Slowly but surely I'm getting the hang of this TCL wizardry :-)

However, I would like to display a "startup" window while the application
loads, and preps. My question is: where is the best place to implement this
behavior?

I have tried putting the code in IMyApp(), after the call to IApplication,
but since nothing else happens here, my window is displayed and then closed
in the blink of an eye.

I suspect I will have to put my startup-window in a global variable, show
the window during IMyApp(), and then Close() the window in the last method
which is executed before event looping occurs.

I've probably missed the obvious, that's why I'm asking the net :-)

Mucho Thanxo!

-- 
Art Urban 					       urban@stout.atd.ucar.edu
===============================================================================
 "What's Next? Chasing bunnies on a motorbike until their hearts explode? -Crow
===============================================================================
Newsgroups: comp.sys.mac.programmer