HDTenEightyP/NetNews huggingface dataset:
From: ram@turing.think.com (Tim Ramsey)
Newsgroups: comp.sys.mac.programmer
Subject: Dead keys and serial ports
Date: 17 Nov 92 14:36:22
Organization: Thinking Machines Corporation, Cambridge Mass., USA
NNTP-Posting-Host: turing.think.com



1) I have been trying for some time now to remove the dead keys from the
option key in an application that I am building.  Does anyone know how to
do this (I know it can be done because lots of comm programs do it to
simulate a control key.)

2) I have another program (written in Think C) which can open and
initialize the serial moodem port just fine with the calls RAMSDOpen
followed by SetSerial.  When I try to do this with the printer port the
SetSerial call returns -28.  Any ideas

Thanks

-Tim Ramsey (ram@think.com)  
--
-Tim Ramsey		TMC Applications Engineer

at ETCA:				|	at IPG:
CREA SP SEH				|	IPG, Centre de Calcul
16 bis, Avenue Prieur de la Cote d'Or	|	4 Place Jussieu
94114 Arcueil CEDEX			|	75252 Paris CEDEX 05
FRANCE					|	FRANCE
phone: 42.31.99.40			|	phone: 44.27.24.43
fax:   42.31.99.55			|	fax:   44.27.48.94
email: ram@etca.fr			|	email: ram@ipgp.jussieu.fr

Home: 46.83.04.43
Newsgroups: comp.sys.mac.programmer
From: f85-tno@nada.kth.se (Tommy Nordgren)
Subject: Re: THINK Pascal- program crashes only when stand-alone
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 18 Nov 1992 19:23:21 GMT

	There might be explicit initialistaion code for the toolbox managers
in the code. In that case the application will crash unless implicit
initialisation is turned off with an {$I-} compiler directive first in the 
source.
Newsgroups: comp.sys.mac.programmer
From: csuley@cs.cornell.edu (Christopher Suley)
Subject: Word 5.0a silliness
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Fri, 20 Nov 1992 00:13:43 GMT

If you have a copy of Microsoft Word 5.0a and a debugger handy, you
might find this amusing.

* Start up Microsoft Word.
* Begin typing.  Don't click the mouse anywhere.
* Enter the debugger and set a trap on Word's calls to WaitNextEvent.
  ("atba waitnextevent" in MacsBug)
* Resume execution.
* Don't type anything. Don't click the mouse.
* Enjoy the fact that the debugger is never entered.
* Now, hit a key.  You will fall into MacsBug at a call to WaitNextEvent.
* Resume execution.  The character appears on the screen, and once again,
  the debugger is never entered.
* Click the mouse.  You should now start repeatedly getting breaks at
  WaitNextEvent.

Once you start typing, Word never calls WaitNextEvent until you hit a key!
If you click the mouse, it resumes calling WaitNextEvent regularly like a
normal, well-behaved application, but as soon as you type, it will stop
calling it and only call it when you hit a key.

If you have a copy of my little shareware trifle Zipple (available at
sumex and mac.archive - it puts an animated image over your Apple menu title)
you will notice an interesting side effect of this odd coding practice.
Zipple will freeze up.  This is because it is written as a driver that
gets time periodically.  The way the system gives drivers time is by calling
WaitNextEvent.  Word doesn't call WaitNextEvent.  My driver doesn't get
time, so it doesn't run.  I imagine other drivers that need time don't get
called either.  Yuck.
From: liran@bimacs.BITNET (Eshel Liran)
Newsgroups: comp.sys.mac.programmer
Subject: patching GetResource
Date: 15 Nov 92 12:35:46 GMT
Organization: Math & CS, BarIlan U, Ramat-Gan, Israel

I wrote a small INIT which is supposed to patch GetResource.
The problem is that at install time when I get the trap's
address, the address I get is of a code resource, and not
equel to the address I see when I type _GetResource in
MacsBug.
My guess is that some other code resource patched the trap
before me (who could it be when I am using a minimal sys 7 ?)
At patch time when I try to reference the trap's address I
got at install time, the address is not relevant any more,
and I can't call the 'old' GetResource from my 'new' GetResource.

Any Ideas ?
Thanks,
Liran Eshel,
Bar-Ilan University, ISRAEL
liran@bimacs.cs.biu.ac.il
Newsgroups: comp.sys.mac.programmer
From: REEKES@applelink.apple.com (Jim Reekes)
Subject: Re: sndPlay while animating
Date: Mon, 16 Nov 1992 21:19:52 GMT
Organization: Apple Computer, Inc.
Followup-To: comp.sys.mac.programmer

In article <1992Nov15.235830.17180@afterlife.ncsc.mil>,
mssmith@afterlife.ncsc.mil (M. Scott Smith) wrote:
> 
> In article <BxruHF.F11.1@cs.cmu.edu> mak+@cs.cmu.edu (Matthew Alan Kane) writes:
> >Situation:
> >I have animation running during vbl
> >and am playing snd resources with sndPlay.
> >
> >Problem:
> >How do I keep my animation going while the sound is playing?
>
> Here's the code:
> 
> First, set up a sound channel.
> 
> void ThisWorks(void)
> {
>   SndChannelPtr   myChannel;
>   OSErr           myErr;
>   SndCommand      mySndCommand;
>   Handle          mySoundEffect;
> 
>   myErr = SndNewChannel(&myChannel, sampledSynth, initMono, nil);
> 
>   mySoundEffect = GetResource('snd ', SOUND_RESOURCE_ID);
> 
>   mySndCommand.param1 = 0;
>   mySndCommand.param2 = 0;
>   mySndCommand.cmd = flushCmd;
> 
>   myErr = SndDoImmediate(myChannel, &mySndCommand);
>   myErr = SndPlay(myChannel, mySoundEffect, true);
> }

You didn't initialize the channel pointer before calling SndNewChannel. 
This will trash random locations of memory.  You need to add the line:

    myChannel = nil;

before calling SndNewChannel.

> I'm not certain the "flushCmd" deal is necessary..

It's not.  Also, the next problem is that after you play this sound you
need to know when you can dispose of the sound channel.  Also, in this
example the channel was a local variable on the stack so you'll lose your
referece to it.  It needs to be a global or some how be made available
later in the program so you can call SndDisposeChannel. Using a
CallBackProc and the callBackCmd will help you to determine when the sound
has finished.

-----------------------------------------------------------------------
Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | "All 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."
Newsgroups: comp.sys.mac.programmer
From: leonardr@netcom.com (Leonard Rosenthol)
Subject: Re: is there a way to find out who is using an app ?
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Tue, 17 Nov 1992 05:02:25 GMT

In article <1e950uINN3lb@usenet.INS.CWRU.Edu> jxs18@po.CWRU.Edu (Jerry Sy) writes:
>
>I have an application that runs in multiuser mode out on an appleshare
>server volume.  Now whenever I make some changes and want to update,
>I can't because people are using the program.  Now the appleshare
>program will tell me who is currently logged on, but not who is
>using my program.
>
>is there a way to determine (programmatically or otherwise) who is
>using an app on the server, short of going to each and every one
>of the 50 users who are currently logged in ?
>
	Nope, there is no way to tell who has a file open.  This is a REAL
problem if you want to do multi-user software, where a given file could be
open by many people at the same time.

-- 
-----------------------------------------------------------------------------
Leonard Rosenthol			Internet: 	leonardr@netcom.com
Director of Advanced Technology		AppleLink:	MACgician
Aladdin Systems, Inc.			GEnie:		MACgician

Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: Re: BINHEX SOURCE CODE
Organization: Iowa State University, Ames, IA
Date: Mon, 23 Nov 1992 15:12:17 GMT

In article <8667.99.uupcb@outlan.ersys.edmonton.ab.ca> charles.berlinguette@outlan.ersys.edmonton.ab.ca (Charles Berlinguette)  writes:
>I would like to get the source code, or a description of an output file
>for the BINHEX decoder/encoder as used in the files processed in the
>group comp.binaries.mac.
>
>Thanks.
>                                                                                 

You can look for DeHQX ... I think that source has been posted somewhere
on the net. There is a 'non-technical' description of the format also.
Look in the info-mac archives in the source directory. info-mac/src/c.

-- 
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
From: johnsd2@vccnw07.its.rpi.edu.its1 (Daniel Norman Johnson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: PICT Updates and Refreshes
Date: 16 Nov 92 00:52:16 GMT
Article-I.D.: rpi.4fv1rnj
Reply-To: johnsd2@vccnw07.its.rpi.edu.its1
Organization: Sun Microsystems, Inc.

In article 640@almaden.ibm.com, mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:
>  Can anyone please provide me with some hints, pointers, advice or
>code to help me handle updates to a PICT (read in from a resource) within
>a window. I would like to only have to refresh portions of the PICT, rather
>than refresh the entire window, based on the current Update Region.
>
>  Basically, I read in a specific PICT resource and display it in a window.
>Then as the user makes updates, I would like to only update (via the
>update event or program controlled) certain potions. I could read in the
>PICT again and display it but this is very slow and inefficient, considering
>all the other objects currently shown.
>  There MUST be a better way !!
>
>  Is it possible to READ IN and display portions of a PICT resource ?
>or Read in and store it elsewhere and then move portions of it around ?
>or Update specific portions easily ?
>
>  Any help, advice or suggestions would be most gratefully received.
>  Thanx in advance, for the help....
>

Perhaps you could set up a GWorld or something, write teh PICT to that
and tehn copybits to the window? This would be very fast.

---
			- Dan Johnson
And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0

These opinions have had all identifiying marks removed, and are untraceable.
You'll never know whose they are.
Organization: Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.sys.mac.programmer
Date: Thu, 19 Nov 1992 09:51:25 -0500 
From: Robert Ward <rw23+@andrew.cmu.edu>
Subject: fast 32 bit screen copy


Does anyone have suggestions on how to do the following:

Using the Apple graphics accelerator card and a IIfx, a friend needs to
transfer a 450x450 32 bit image from memory to the screen in 50 msec or
less. Right now he's at about 100 msec using offscreen gworlds as
described in apple tech note 120.

Are there faster techniques for bitmap transfers, or is there a graphics
card available that could speed things up?

Thanks,
Rob
rw23@andrew.cmu.edu
From: de19@umail.umd.edu (Dana S Emery)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Undo Hints
Date: 17 Nov 92 12:39:37 GMT
Followup-To: comp.sys.mac.programmer
Organization: personal

In article <1992Nov13.200442.29821@cs.uoregon.edu>,
alana@majestix.cs.uoregon.edu (Thomas Alan Akins) wrote:
> 
> Tips on how to "remember" the last edit command and the storage of a string of
> text that the user may wish to undo (Undo Typing), etc.

You dont state your development tools.  If they are Think Pascal, or Think
C, you should look at the code of CSwitchboard, CAbstractText,
CTextEditTask, CTextStyleTask and CEditText for how this is done in the
TCL.  If you intend to use TE for your text engine, this would be a good
model (whether or not you are using objects).  If you intend to use styled
TE, then you will also need to look at CStyledText and the styledTE task
objects as well.  if you want to see these in action, build the
NewClassDemo project, it showcases both forms of TE based editors.  Of
course, that will limit you to 32000 character files.

The TCL alters the actual data, but remembers how to undo the alteration. 
It is arguably better to provide a means of describing the underlying data
which allows you to specify changes in a nondestructive manner.

For non TE displayed text, one might establish an array of
handle/offset/run triplets (frags) which together comprise a virtual
buffer.  This would allow the original text to exist in a handle, with
subsequent revision text existing in other handles, and the array
determines which fragments are readout in what order.  Any deleted text
will split its frag into 2, any added text will add a frag.  ancilliary
lists might be used to track the frags of each handle, so that one can
determine when it contributes nothing.  Your undo would track the changes
made to the frag list, and would itself be part of the filter used in
reading out the text.  You are on your own as to what to do for style
changes, IM 6:15.38 has a very nice picture of how a styled TE tracks data,
 you could take it for a model (but useing 24 or even 32 bit offsets),
unless your chosen text engine already has something better.

When your user does a Save, you would readout the frags into a new handle,
and reduce the array to a single frag again.  Obviously, all those handles
will need locking from time-time, so this is a major exercise in paranoia. 
You will want to have continuous typing be directed into one handle, as it
should be considered one undo.

Oh, BTW, good luck.
--

Dana S Emery <de19@umail.umd.edu>
Newsgroups: comp.sys.mac.programmer
From: cplai@csie.nctu.edu.tw ()
Subject: image processing,sharpen, calibrate, dither, contrast.....
Organization: Dep. Computer Science & Engin. of Chiao Tung Univ., Taiwan, ROC
Date: Tue, 17 Nov 1992 15:24:25 GMT


Hi:
    I am doing a image processing project right now, I have to manipulate some
functions to a scanned picture. like sharpen, calibrate, dither, contrast.....,
Could someone give me some directions how to find the infos?
    I need to know the theory and how to implement it, of course, any source
codes will be appreciated.

   Please reply to:
   cplai@ccsun5.csie.nctu.edu.tw

   Thanks.


scott

Newsgroups: comp.sys.mac.programmer
From: Quinn <quinn@cs.uwa.edu.au>
Subject: Re: Determining modifier key status without an event record
X-Xxdate: Tue, 24 Nov 92 01: 15:17 GMT
Organization: The University of Western Australia
X-Useragent: Nuntius v1.1.1d12
Date: Tue, 24 Nov 1992 01:33:17 GMT

In article <1992Nov20.090240.10742@tdb.uu.se> Mats Bredell,
bredell@tdb.uu.se writes:
>A lot of programs behave differently if you hold down a certain modifier
key
>while selecting from the menu. However, you should also change the menu
item
>title when this happens. I've never seen a program that lets you press
the
>modifier *after* the original menu click.

#1 MultiFinder 6.1b9 (Apple menu)
#2 Think Pascal 4 (lots of menus eg File)

Aren't custom MDEFs wonderful.  Actually Think Pascal's MDEF has
problems under certain circumstances...  If you move the mouse up
and down the menu (thereby highlighting different items) and tap
on the option key rapidly, it will occasionally stuff up the item
highlighting.  I don't have the nerve to report this one as a bug (-:

Quinn "The Eskimo!"      <quinn@cs.uwa.edu.au>     "Support HAVOC!"
Department of Computer Science, The University of Western Australia
  -- Danger!  Pedant!
Newsgroups: comp.sys.mac.programmer
From: ogd@selway.umt.edu (ozymandias G desiderata)
Subject: Does anybody want to sell me Inside Mac v4-6?
Organization: ::AOAIOXXYSZ::
Date: Mon, 23 Nov 1992 21:40:47 GMT

	Ah, c'mon, you know you _want_ to. There's nothing all that
useful in volumes 4 and 5, and with System 7 being the bitter
disappointment that it is, you don't need volume 6 either. Besides,
you know you never read the damn things anyway. Make me an offer, and
if it's reasonable, I won't refuse. I would prefer that the books in
question be in a form close to the original (still in one piece, no
pieces of pepperoni pizza squashed between the pages as bookmarks, no
illegible Da Vinci-esque backward scrawling obscuring exactly the bit
of information I need to make IAC work).
	e-mail me at ogd@selway.umt.edu (checked obsessively), or call
me at 1-(406)-243-3658 (if (God forbid) my roommate answers the phone
and starts making strange keening noises at you when you ask for
ozymandias, ask for Forrest and he might figure it out). Evening
hours, of course.

(insert smileys as needed)

thanks in advance,
ozymandias G desiderata

-- 
----		"Give me your hand and I'll tell you your future,
		 give me your wallet and I'll tell you your past."
		  - Mudwimin, "Oom Pa Pa"
(ogd@selway.umt.edu) - PGP 2.0 public key available upon request.
From: jpugh@apple.com (Jon Pugh)
Newsgroups: comp.sys.mac.programmer
Subject: Re: The Forgetful Finder
Date: 21 Nov 92 06:05:18 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <D2150035.ilna6e@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org
(Michael Peirce) wrote:
> 
> Why would they be adding QuickDraw GX to the Finder?  To the system,
> yes; to the Finder, I doubt there is any reason to do this.

I believe it's some of the printing stuff, but I don't really know.  I was
just throwing everything into the bucket.  ;)

Jon
Newsgroups: comp.sys.mac.programmer
From: tgsnyder@eos.ncsu.edu (The Yankee...)
Subject: THINK C 5.0 and dialogs
Originator: tgsnyder@c00401-346dan.eos.ncsu.edu
Keywords: THINK-C, spooge, late-night-taco.ncsu-death
Reply-To: tgsnyder@eos.ncsu.edu (The Yankee...)
Organization: North Carolina State University, Project Eos
Date: Wed, 18 Nov 1992 22:12:12 GMT



I've written a small clock program with some neat animation and stuff.  I
have a small problem however.  I create a dialog to change the alarm time,
and after I've done this, when I try to exit the program, the machine
sometimes crashes.  I'm running an LC w/10 MB and system 6.0.7.

Has anyone else had trouble with this?  Is it a bug fixed in an update?  Am
I just doing something wrong?  More than likely, it's choice number 3.
Quitting simply involves exiting a main loop.  I can't figure out why this
would cause it to crash.

What is the proper form for using a dialog?  Is it required that I free
up the memory when I'm done with it?  Actually, I think I do, but it's been
a while, classes have kept me busy.  I've tried several different
implementations.  They all did what they were supposed to, but all crashed
when I tried to quit.  Ach, 'tis late and I babble...

Any help would be appreciated.

(I wrote this late at night, the newserver barfed on me, and I didn't feel
	like re-writing it today, so if it's unclear, lemme know)

-- 
Tim (tgsnyder@eos.ncsu.edu - North Carolina State's Project EOS)

a.k.a.  The Human Tripod
a.k.a.  THE Yankee
From: intolabb@oasys.dt.navy.mil (Steven Intolubbe)
Newsgroups: comp.sys.mac.programmer
Subject: Apple's ethernet bd and AROSE
Date: 23 Nov 92 20:14:57 GMT
Reply-To: intolabb@oasys.dt.navy.mil (Steven Intolubbe)
Organization: Carderock Division, NSWC, Bethesda, MD


    I am trying to find out if Apple's ethernet board is just
for ethernet or if it is a generic I/O board that you plug
different external interface modules into.  If it is generic,
I would like to know where to get information on it and on
programming it under AROSE.

				  Thanks,
				  Steve
From: charles.berlinguette@outlan.ersys.edmonton.ab.ca (Charles Berlinguette) 
Newsgroups: comp.sys.mac.programmer
Subject: BINHEX SOURCE CODE
Date: 22 Nov 92 11:06:00 GMT
Reply-To: charles.berlinguette@outlan.ersys.edmonton.ab.ca (Charles Berlinguette) 
Distribution: world
Organization: Outland BBS  UUPCB  403-475-9588

I would like to get the source code, or a description of an output file
for the BINHEX decoder/encoder as used in the files processed in the
group comp.binaries.mac.

Thanks.
From: sarachanbd@crd.ge.com (B. D. Sarachan)
Newsgroups: comp.sys.mac.programmer
Subject: Code resources:  THINK vs. MPW
Date: 16 Nov 92 22:18:38 GMT
Reply-To: sarachanbd@crd.ge.com (B. D. Sarachan)
Distribution: usa
Organization: GE Research & Development Center

Code resources created using THINK C can have multiple segments, and
can include global and static data using the RememberA0(), SetupA4(),
and RestoreA4() functions?

Do MPW-created code resources have similar capability, or are they limited
to 32K with no global/static data?

Thanks,

Brion Sarachan 


-- 
==
  sarachanbd@crd.ge.com

  Brion Sarachan
  G.E. Corp. R. & D.
  P.O. Box 8, Rm. KW-C273
  Schenectady, NY 12301

  Tel. (518) 387-6553
  Fax  (518) 387-7080

Please note that the "Standard Disclaimer" applies here.
Newsgroups: comp.sys.mac.programmer
From: fixer@faxcsl.dcrt.nih.gov (Chris Spiral Catfish Tate)
Subject: Re: Problem isolated but not understood (THINK Pascal standalone crash)
Reply-To: fixer@faxcsl.dcrt.nih.gov
Organization: Computer Systems Laboratory, DCRT, NIH
Date: Thu, 19 Nov 1992 13:02:02 GMT

In article <Bxy3q0.231@news.udel.edu>, kurisuto@chopin.udel.edu
(Sean J. Crist) writes:
>
>SetHandleSize(Handle(DestinationHandle), GetHandleSize
>    (Handle(SourceHandle))); {Make the two handles the same size}
>BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
>    GetHandleSize(Handle(SourceHandle))); {Copy the contents 
>    of one handle into the other}

This looks suspicious, because there's a Toolbox call within the parameter
list to the BlockMove() procedure.  Does anyone know whether GetHandleSize()
moves memory?  It seems unlikely, but you never know.  You could try

   (* sourceSize is a LONGINT *)

   sourceSize := GetHandleSize(Handle(SourceHandle));
   BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
      sourceSize);

and see if that helps.

Alternatively, you could just use the HandToHand() OS Utility call, thus:

   (* DO NOT allocate DestinationHandle previously! *)

   DestinationHandle := SourceHandle;
   err = HandToHand(Handle(DestinationHandle));

This allocates a new handle, copies the contents of the argument block into
it, and sets the argument to be equal to it, i.e. causes DestinationHandle
to point to a new copy of what it *used* to point to.  You have to remember
seperately the original handle.  See Inside Macintosh II-374 for full details.

------------------------------------------------------------------------------
Christopher Tate             | The Leadfoot Collection, Continued:
Management System Designers  |     * Heavy Fuel (Dire Straits)
                             |     * Last Scene in September (Preston Reed)
fixer@faxcsl.dcrt.nih.gov    | Because driving fast is a cathartic experience.