HDTenEightyP/NetNews huggingface dataset:
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Algorithms in C++ (was: text compression)
Date: 10 Sep 92 01:30:50 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple

In article <BuA4xL.9KE@taligent.com>, keith@taligent.com (Keith Rollin)
wrote:
> I'd be interested in people's opinions, too. I have "Algorithms in C" (and like
> it, so there, nyaah!), but when I looked at the C++ version, it looked like ol'
> Bob just used C++ in the sense that it's mostly a superset of C. I didn't see
> any use of classes. It's sort of like re-releasing "Algorithms" under the name
> "Algorithms in MPW Object Pascal", and not changing any of the contents.

Yeah, I would not run to the nearest book store and get the C++ version
if you have any of the earlier versions. I just bought it mainly because
silly me didn't have any of the earlier Sedgewick versions, and it made
sense to take the new C++ version (because I use C++ most of the time here
at 
work). And the critique was right, few of the samples would be called
C++ classes. Heck, I guess most of us have implemented a TLinkedList
classone or two times :-).

Kent

-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.
Newsgroups: comp.sys.mac.programmer
From: leonardr@netcom.com (Leonard Rosenthol)
Subject: Re: Patching the _Launch Trap
Date: Tue, 08 Sep 92 06:56:48 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 

In article <1992Sep8.024049.20121@Arco.COM> John Champion <dedjhc@arco.com> writes:
>Hi all,
>I'm trying to install a fairly unobtrusive head patch into the _Launch
>trap.  The problem is that no matter what I do, my patch always gets
>re-patched (presumeably by the system).  This unknown code does not pass
>control down the line like a normal patch would, so my code never gets
>called.
>
	Welcome to the wonderful world of "protected patches".  This is a
new trick in System 7 to make sure that programmers don't "screw up" system
patches.  It basically means that it is near impossible to patch such a trap.

	If you could post what you are trying to accomplish by patching _Launch
someone could probably suggest an alternate approach that would be successful.

-- 
-----------------------------------------------------------------------------
Leonard Rosenthol			Internet: 	leonardr@netcom.com
Director of Advanced Technology		AppleLink:	MACgician
Aladdin Systems, Inc.			GEnie:		MACgician
From: urlichs@smurf.sub.org (Matthias Urlichs)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Creating background tasks (HELP!).
Date: 8 Sep 1992 13:17:51 +0200
Organization: University of Karlsruhe, FRG
NNTP-Posting-Host: 127.0.0.1

In comp.sys.mac.programmer, article <1992Aug24.234902.26204@kronos.arc.nasa.gov>,
  joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91) writes:
> In article <1992Aug24.133440.1050@sunfs3.Camex.COM> kent@sunfs3.Camex.COM (Kent Borg) writes:
> >In article <scott.714617437@mcl> scott@mcl.ucsb.edu (Scott Bronson) writes:
> >>(don't use GetNextEvent unless you HAVE to)
> >
> >Quite right.  My posting was wrong.  I though that WaitNextEvent()
> >reduced to the same thing as GetNextEvent() when the wait was zero and
> >the rgn empty.  Wrong.  WaitNextEvent() also calls SystemTask() for
> 					      ^^^^^^^^^^^^^^^^^^
> 
> No.  WaitNextEvent() does NOT call systemTask() -- it has its own
> way of dealing with this type of action for you.  But it does not,
> to the best of my knowledge, call SystemTask(), which should not be used 
> (does nothing?) under systems with WaitNextEvent().

WaitNextEvent calls GetNextEvent when the wait is zero and the region empty.
GetNextEvent calls SystemTask internally.
(This is under System 7.0.1. Set a BReak on WaitNextEvent, Go, set a BReak
 on SystemTask, Go, StackCrawl, examine code at calling points.
 Clear breakpoints, Go.  All this is Macsbug; your debugger may vary. :-)
All three routines are reimplemented by System 7.

Given this, calling SystemTask is superfluous but definitely harmless.

-- 
"For that matter, compare your pocket computer with the massive jobs of
a thousand years ago.  Why not, then, the last step of doing away with
computers altogether?"
		-- Jehan Shuman
-- 
Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: EditText items larger than 255 bytes?
Date: 10 Sep 92 21:20:27 GMT
Organization: National Instruments, Austin, TX
NNTP-Posting-Host: falcon.natinst.com

In article <1992Sep10.200136.18513@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent) writes:

	[how to get more than 255 chars out of a dialog text item deleted]

>Now I have a question.  When you make a new TERecord, it is 32k in size,
>right?
>
>If you have a modal dialog box with 4 text areas, that's automatically
>128k of RAM sucked up for 4x255 = 1020 bytes for actualy data (retrieved or
>set via the SetIText/GetIText calls.  If you used the MacOS calls to
>the letter, that's a 1020/128k percent utilization... pretty awful.
>
>Hey, Apple!  How about creating a new TextEdit interface so that we can
>specify the buffer size to use -- as large or small as we need?
>
>-Brent

When you make a new TERecord you only allocate memory for a TERec which is
initially a little over 100 bytes large.  The actual text is stored in a handle
that grows according to how much text you have.
So if your (one-line) text contains 10 characters you'll use about 130 bytes
which is less than a Str255.  If you actually have 255 characters in your
item, you'll need about 43% more memory than if items used Str255; with 10
characters you actually save about 50%.

Of course there is the overhead for two handles but that's quite negligible.

-- 
   Stepan Riha -- stepan@natinst.com
Newsgroups: comp.sys.mac.programmer
From: valerio@cpsc.ucalgary.ca (Valerio Franceschin)
Subject: Problems with NSetPalette and SetWindowPic
Organization: University of Calgary Computer Science
Date: Sat, 5 Sep 1992 00:44:12 GMT


I have some problems with NSetPalette and SetWindowPic:

1) I'm using NSetPalette to attach a palette to a window. I then want to detach
this palette, and just set the window to black/white.  I tried DisposePalette,
and even attaching a new Palette with two entries (black/white) but the window
still seems to be attached to the original palette.  Does anyone know how I
can set my window back to use only black/white ?

2) I am having a problem with SetWindowPic (for automatic updates).  It seems
that the window contents are being drawn twice when I first draw a picture into
it.  Also, if I scale the window, its contents are drawn twice.  If I take out
the call to SetWindowPic, this doesn't happen (however, when the window is moved
from the back to the front, it is not updated!).  Does anyone know what the
problem could be ?

Any help would be GREATLY appreciated.  Please send e-mail to me directly.

thanks,
From: cinquin@imag.fr ( Philippe Cinquin)
Newsgroups: comp.sys.mac.programmer
Subject: Is a resource fork already open?
Date: 7 Sep 92 11:48:55 GMT
Organization: IMAG Institute, University of Grenoble, France

Sorry if this is a stupid question, but how do you know if the resource fork of
a file is already open?

Thanks for your replies. If you email please do so at "ocinquin@timb.imag.fr".
From: sold@kit.uni-kl.de (Christoph Sold)
Newsgroups: comp.sys.mac.programmer
Subject: Re: MacApp News group?
Date: 12 Sep 92 16:35:27 GMT
Organization: Universitaet Kaiserslautern

In article <1992Sep10.113833.22987@ifi.uio.no> erlingm@ifi.uio.no (Erling Mork) writes:
>From: erlingm@ifi.uio.no (Erling Mork)
>Subject:  MacApp News group?
>Date: Thu, 10 Sep 1992 11:38:33 GMT
>
>I looked through all new groups and tried to find one on MacApp, but couldn't.
>I am a MacApp programmer, and would like a forum to discuss MA-specific
>things. Is there a news group I missed?  If not, would anyone else be
>interested in starting such a group? It would lessen the humongous load
>of messages that come in daily in .programmer!
>
>------------------------------------------------------------------------
>Erling Mork: Student at U of Oslo, Programmer at Data Nostra A/S
>internet: erlingm@ifi.uio.no; AppleLink: NOR0042
>Disclaimer: My opinions are my own and I'm NOT responsible for the economy.


Such a group would of course be very nice. I think it should be named
something like  comp.sys.mac.oop  , maybe with subgroups .macapp2, .
macapp3, .tcl, and (in the near future) .bedrock to sort out the unwanted 
stuff. It would also be nice if apple fills this group/s with the already 
distributed MacApp2/3Tech$ mailing list messages and serves as a binary 
repositiory at bric-a-brac.apple.com.

-Christoph

Christoph P. Sold                   CATS Software GmbH
                                    Mussbacher Landstr.2
sold@kit.uni-kl.de                  W-6730 Neustadt (Weinstrasse)
ger.xse0035@applelink.apple.com     Germany

"If an apple is fun, what the heck is an appletree?"
Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: What is Balloon Writer?
Organization: HoloNet (BBS: 510-704-1058)
Date: Mon, 7 Sep 1992 08:03:01 GMT

Newsgroups: comp.sys.mac.programmer
From: edcrwfrd@unlv.edu (Edward Crawford)
Subject: Re: Idea for New Program
Organization: UNLV
Date: Tue, 15 Sep 92 17:14:36 GMT

In article <BuLrCA.7qJ@well.sf.ca.us> vito@well.sf.ca.us (Andris Paul Vitols) writes:
>
>Dear Mac Programming Wizards:
>
>I think it is a little bit of a pain to go up to the
>little "Computer Icon" in the far right of the menu bar
>to switch to different applications.
>
>I'd like to see a shareware program that creates a floating
>pallete of icons that represent the currently running
>applications.  I would like this pallete to have these 2
>preferences options: 1.) User can pick what size icons
>are in the pallete (Small Icon or Large Icon.) 2.) User can
>have the floating pallete always be the front-most window.
>
>The user can then have this floating pallete easily accessible
>and simply double click on the icon for the program they want
>to switch to.
>
>Can anyone do this?

The program that does this is called Applicon.

Newsgroups: comp.sys.mac.programmer
From: greeny@top.cis.syr.edu (J. S. Greenfield)
Subject: Trouble with GetIconSuite
Organization: Syracuse University, CIS Dept.
Date: Sun, 6 Sep 92 19:17:40 EDT

I just started trying to use the System 7 icon drawing routines documented
in Tech. Not #306 "Drawing Icons the System 7 Way."

I'm having trouble with GetIconSuite, however.  The call is supposed to
create an empty icon family and then load the family with icons
taken from an icon family in an open resource file.

The program bombs with a bus error (_StripAddress) when GetIconSuite is
called under 32-bit addressing, however.  Under 24-bit addressing, it
sometimes produces garbage when I draw the icon (using PlotIconSuite) and
then a bus error when the Suite is disposed (using DisposIconSuite), and
sometimes produces a bus error when GetIconSuite is called.

Since it doesn't look like a 32-bit dirty problem (and would be insane if
it were, since this is System 7 stuff!), I guessed that GetIconSuite was not
properly creating the empty icon family.  So I tried calling NewIconSuite
first, which caused the bus errors to stop, but just produces a blank
image when the PlotIconSuite is called (as though no icons are loaded).


Has anybody been able to get these routines working?  Are there known bugs, or
undocumented tricks that are necessary to use these functions (and in
particular, GetIconSuite)?


Thanks.


-- 
J. S. Greenfield                                         greeny@top.cis.syr.edu
(I like to put 'greeny' here, 
but my d*mn system wants a 
*real* name!)                        "What's the difference between an orange?"
From: jacobs@cerritos.edu
Newsgroups: comp.sys.mac.programmer
Subject: custom folder icons in sys7
Date: 15 Sep 92 20:29:09 PST
Organization: Cerritos College, Norwalk CA

	I am having a problem creating custom icons for individual folders. I
was recently given a set of folders with custom icons and I would like to
create some of my own.

	I have gone into Resedit and checked the info for one of the folders
and it's hidden icon file. I created my own folder and icon file with the
appropriate resources, (same ones in the files given to me), and I set all the
attributes that I could find the same as the sample. I double-checked
everything, all the settings in the info windows are the same.
	However, when I restart, all I get for the folder that I am trying to
create a new icon for is the same old generic folder.

	Am I missing some setting other than those in the Info box?
	
	How do I set which icon I want a folder to use?

	Is there some other method of assigning an icon to a folder?

	I selected the "use custom icon" selection in the folder info box. How
do you assign an icon to a folder after you do that?


Help!!!!!!!!!! I can't figure out what else to do!


Any help apperciated,

Karl


--------------------------------------------------------------------------------Karl Jacobs jacobs@cerritos.edu
"I long for the days when men were men, women were women, and little fuzzy 
creatures from Alpha Centauri were little fuzzy creatures from Alpha Centauri"!!--------------------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: krk@itl.itd.umich.edu (Kenneth Knight)
Subject: Re:  MacApp News group?
Organization: Instructional Technology Laboratory, University of Michigan
Date: Thu, 10 Sep 1992 15:07:27 GMT

In article <1992Sep10.113833.22987@ifi.uio.no> erlingm@ifi.uio.no (Erling Mork) writes:
>
>I looked through all new groups and tried to find one on MacApp, but couldn't.
>I am a MacApp programmer, and would like a forum to discuss MA-specific
>things. Is there a news group I missed?  If not, would anyone else be
>interested in starting such a group? It would lessen the humongous load
>of messages that come in daily in .programmer!

Some time back a RFD for a MacApp (and general-purpose object programming for
the Mac) newsgroup was suggested. I haven't seen anything since that message
on comp.sys.mac.announce. 
However, even though no specific newsgroup exists for MacApp (and TCL).
discussions there are mailing lists that can be subscribed too. For
MacApp 2.0 and 3.0 you can join mailing lists that are run out of AppleLink
send 'subscribe' messages to MacApp.Admin@applelink.apple.com. 
For the MacApp 2.0 list ask for MacApp2Tech$ and for MacApp 3.0 ask for
MacApp3Tech$.

If you use TCL send a 'subscribe' message to tcl-request@brown.edu (think
that is correct - it might be tcl-talk-requst I do not recall).

  ** Ken **
From: cinquin@imag.fr ( Philippe Cinquin)
Newsgroups: comp.sys.mac.programmer
Subject: Not standalone "PICT" and "snd " resources?
Date: 11 Sep 92 16:18:09 GMT
Organization: IMAG Institute, University of Grenoble, France

Hi all!

Is it possible to create "snd " and "PICT" resources that aren't standalone,
but
refer to files by the mean of an alias record, just as QuickTime does with
"moov" resources?

Thanks in advance for your replies. If you email, please do so at
"ocinquin@timb.imag.fr".
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: QuickTime, Director, Closing Windows
Date: 10 Sep 92 17:39:41 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <37864@sdcc12.ucsd.edu>, sakelley@euclid.ucsd.edu (Scott Kelley) writes:
> I'm working on a large multimedia project with MacroMind Director. Since
> Director's QuickTime support leaves something to be desired (it's buggy)

Uh-oh. And here I was looking forward to my 3.1 upgrade... :-{

>   My XObject is very simple: It gets two numbers and a string as
> parameters, opens the movie filename found in the string, and plays it
> with the upper left corner in the coordinates specified. So far so good.
>   Problem: When I call CloseWindow to dispose of the window after I've
> played the movie, QuickDraw erases the region that had the movie in it,
> and puts a white rectangle there instead.

Did you actually open your own window, rather than playing the movie in
Director's stage window? Does the latter not work? It's just that I've seen
an example Director movie which did exactly this, using the Apple/Claris
QTMovie external. Even worked with Director 2.0.1, too.

 This is a problem because it
> presents the user with an unexplained flash in the movie window. (From
> director I'll use a single frame of the movie as a castmember in
> Director, and when the user clicks on it, I'll play the movie on top of
> it. When the movie stops, I want it to CLEANLY go back to the first
> frame.

If you really have to open your own window, I guess one thing to try is
save the bits behind it, and restore them after closing the window. Director
will still get an update event and redraw that area, but this is probably
not worth worrying about.

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
Xref: sparky comp.sys.mac.programmer:15122 comp.sys.mac.misc:16150
From: zeke@reed.edu (Zeke Koch)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.misc
Subject: Re: Opinions on THINK Reference?
Date: 8 Sep 92 08:08:47 GMT
Article-I.D.: reed.1992Sep8.080847.22423
Organization: Reed College, Portland, OR

Mats.Bredell@udac.uu.se writes:
>psweeney@miavx1.acs.muohio.edu writes:
>:
>: Is Symantec's THINK Reference worth it?  It doesn't support
>: IM VI, and I have heard of no upgrades.  However, I have
>: seen a friend's copy, and it looks pretty useful.
>
>I'm using THINK Reference and I think it's very good. But there are some
>things that keep annoying me.
>

[Annoying things deleted]

I have a copy that I bought when I thought I was goingto do mac
programming. Does anyone want it?

Zeke
-- 
                           zeke@reed.edu 
"NeXT has made it possible for Tiny Tim to over-extend himself and buy
a Ferrari for the price of a Hundai and now Tiny Tim is pissed because
the gas station attendant won't sell him gas for 3 cents a gallon."
From: jasper@geriatrix.cs.uoregon.edu (Jon Barber)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Sound Loop in a with a Modal Dialog?
Summary: this guy needs asynchronous sound
Date: 10 Sep 92 17:27:52 GMT
Organization: University of Oregon Computer and Information Sciences Dept.

>>(Danny W. McCampbell) wrote:
>> 
>> Hi.  I want to play a sound continuously while a modal dialog is 
>> present on the screen.

> Jim Reekes from Apple responds:
>
>The approach I would take is to start the sound, then call ModalDialog.
>You need to use the callBackCmd and a CallBackProc.  You first play the
>sound (ie. bufferCmd) then issue the callBackCmd.  When the sound ends
>your CallBackProc is called.  This will call SndDoCommand with another
>bufferCmd to start the sound again.

yahh man - you have a wrong approach.  You definitely want
to use the way cool _asynchronous_ capabilities of the
sound manager.  Jim's saying the same thing, if a little
technically.  

I just finished a way cool Think C 5.0 TCL class "CQuickSound" which
would is specifically for playing asychronous sounds efficiently
and with minimal pain for the programmer.  

How many people would be interested in free- or share-ware code
for quick&easy asynchronous sound playback?

As Byan K. "Beaker" Ressler says, "Join the Noisy Revolution Today!"

	- jasper@cs.uoregon.edu
Newsgroups: comp.sys.mac.programmer
From: kire@cyklop.nada.kth.se (Jan-Erik Mngs)
Subject: Re: THINK C 5.0.3/TCL 1.1.2 Updates
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Tue, 15 Sep 1992 21:36:04 GMT

   An new update for THINK C, 5.0.3, has been released. This update corrects
   problems with the Quadra and other problems present in earlier versions of the
   compiler. Also available is TCL 1.1.2 (the same as that released in 5.0.2).

It's also avaliable for anonymous ftp from aux.nada.kth.se
(130.237.226.207), in /pub/THINK_C_5.0.3_Update.sea.hqx.

It does _not_ include the TCL 1.1.2 update (can be found
elsewhere).

	"Kire"

(a commercial: /pub/atmap.0.1b7.sea.hqx on aux.nada.kth.se is a
nice program for drawing "topology maps" of your AppleTalk
internets, written by a nice guy here (ragge@nada.kth.se))
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: ***** MAJOR CRISIS RESOLVED (thanx) ****
Organization: Iowa State University, Ames, IA
Date: Wed, 9 Sep 1992 19:31:15 GMT

It indeed seemed to be a stiction problem.  I took it to my friendly local
Apple dealer and it * did * turn out to be fixable under warranty
(yea!).  They will replace it soon.. They 'jump started' it as some suggested
(I didn't wanna mess up something guessing where the right screws were
to remove) and I got all my files off... I feel much better...

thanx to all who responded...

-- 
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: ejw1@kimbark.uchicago.edu (Eric Weidl)
Subject: Re: Easiest way to find my PSN (Process Serial Number)
Reply-To: ejw1@midway.uchicago.edu
Organization: Academic and Public Computing
Date: Tue, 15 Sep 1992 14:46:29 GMT

In article <x-znmmf.gurgle@netcom.com> gurgle@netcom.com (Pete Gontier) writes:
>ejw1@kimbark.uchicago.edu (Eric Weidl) writes:
>
>>	Is there any easy way to determine my own Process Serial Number?  
>
>GetCurrentProcess. There are also constants which you can stuff
>into a PSN, but I can never remember their names, so I just call
>the trap. :-)

Of course!  If I call GetCurrentProcess right after I am launched, A5 will be 
mine and I'll get my own PSN.  I had been thinking about GetCurrentProcess,
but figured that I'd call it when I needed it, ie. when I was in the 
background.  At that time, it would return a PSN, but not mine.  If I call it 
before entering my event loop, I'll be in the foreground and it should work.


>>	The reason I want to know my PSN is so that I can call
>>SetFrontProcess() to bring myself to the foreground in response to an 
>>AppleEvent.  I've tried every combination of parameters in AESend() and 
>>AEInteractWithUser(), but to no avail. So, I thought I'd try
>>SetFrontProcess.
>
>This will certainly work, and I'm no expert on AE, but I believe the
>idea is to let the sender of the event decide whether your app should
>come to the front. Perhaps forcing your app to the front is not a
>desirable effect.

We are working on a gopher client which uses a number of different apps to 
view different file types.  The different apps communicate via AppleEvents. 
Since the applications act as a suite, and I know who is asking me to open 
a document and why, I'm taking liberties with interaction levels, etc.  

I looked at the Sender and Reciever examples apps on the Developer's CD and 
determined that the correct set of parameters to bring an app to the 
foreground was: Reciever app, kAEInteractWithAll (or kAEInteractWithLocal), 
and then call AEInteractWithUser(); Sender app, kAECanInteract (or 
kAEAlwaysInteract), kAEWaitReply, and kAECanSwitchLayer.  With this 
conbination of bits, the Reciever app comes to the foreground when it recieves 
the AppleEvent, but my app doesn't.

>-- 
> Pete Gontier // EC Technology // gurgle@netcom.com

Eric
-- 
===================================================================
               Eric Weidl    e-weidl@uchicago.edu
      University of Chicago -- Academic and Public Computing
===================================================================
Newsgroups: comp.sys.mac.programmer