HDTenEightyP/NetNews huggingface dataset:
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Prefs file source code
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Thu, 1 Oct 1992 02:27:00 GMT

In article <72915@apple.Apple.COM>, grobbins@Apple.COM (Grobbins) wrote:
> 
> In article <D2150096.o1pwue@sproul.sproul.com> Sproul@sproul.sproul.com (Mark Sproul) writes:
> >Several people asked for this source code. ...It now handles the PREFERENCES
> >folder in the system folder properly.
> 
> No, it hardcodes the name "Preferences" and assumes that it is in the
> System folder.  Applications should instead use FindFolder under
> Systems 6 or 7 to locate the preferences folder.  FindFolder is
> documented starting on page 9-42 of Inside Mac VI.

Q&A:
> gestaltFindFolderAttr, documented in Chapter 3 of Inside
> Macintosh VI, to see if FindFolder is available), if you're
> using MPW 3.2 (or the current Think compilers) glue is
> automatically included in your compiled code, making it safe
> to call FindFolder under System 6. The glue will check if
> FindFolder is available, and if it is not, will return the
> System folder's vRefNum and dirID as as prefVRefNum and
> prefDirID for the kPreferencesFolderType selector. Go ahead
> and use the System folder values as the location for the
> preferences file under System 6.

While I agree you should use FindFolder (definitely don't hard code it!),
and its really nice that you can just call it without worrying about
whether its implemented or not, I disagree with using the System Folder on
System 6 machines.  Many programs (mostly sharware programs I think :-)
were using the Preferences folder before System 7 was even released.  Its
sad that its always the english spelling, but we can't do much about that
except put it in the resource fork so it can be internationalized, but the
Preferences folder is at least a good approximation.

So I'd say (blatantly ignoring Apple's recomendation, and waiting for the
Apple Thought Police to come break down my door :), check if you are
running in System 6, and create and use the Preferences folder if you are
(you can (of course) use FindFolder to find the System Folder so you know
where to look for/put the Preferences folder...)

Have fun all, I'll go lock my door :-)
   Peter.

_______________________________________________________________________
Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
From: MacUserLabs@cup.portal.com (Stephan - Somogyi)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Looking for Resourceror
Date: Mon, 28 Sep 92 09:13:54 PDT
Organization: The Portal System (TM)
Distribution: world

fixer@faxcsl.dcrt.nih.gov (Christopher Tate) writes:

>I'm looking to get hold of Resourceror (from Mathemaesthetics, according
>to the FAQ), but I don't know where to find that company. Anybody have any
>info?

Send email to resorcerer@applelink.apple.com.

__________________________________________________________________________
Stephan Somogyi            puzzle-piece together-putter            MacUser
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Newsgroups: comp.sys.mac.programmer
Subject: C.S.M.P. Digest V1 #177 Available
Date: 5 Oct 92 12:27:18 GMT
Article-I.D.: cs.1992Oct5.122718.13914
Followup-To: poster
Organization: University of Oregon Computer and Information Sciences Dept.


C.S.M.P. Digest             Mon, 05 Oct 92       Volume 1 : Issue 177

Today's Topics:

	How do you acess chooser username??
	MacINTERCOMM Invisible Xfers! (PR)
	Things That May Become Dim
	GDevices:  screenActive flag?
	reducing TCL project size
	faceless background app's.
	2 simple questions about locked blocks



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.  (This means you can't post questions to the
digest.)

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                                         University of Oregon
mkelly@cs.uoregon.edu                             Computer Science Department
_____________________________________________________________________________
From: ramirez@mcclb0.med.nyu.edu
Newsgroups: comp.sys.mac.programmer
Subject: AppleTalk Sample Code
Date: 30 Sep 92 01:52:10 GMT
Organization: NYU Medical Center, New York, NY 10016, USA

Hello *,

	Could someone send me or let me know where I can find sample code for
AppleTalk Transactions?
	I need to communicate with a printer over an ether network in order 
to download a postscript file.

	I need to know how to specify the printer name and the zone where the
printer is located.

Thanks in advance.
Edwin Ramirez
Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.sys.mac.programmer
Date: Thu,  1 Oct 1992 18:40:09 -0400 
From: Kip Walker <kw27+@andrew.cmu.edu>
Subject: Heap woes....

In a little program I'm working on, I'm trying to allocate memory for an
offscreen pixmap.  I have called MoreMasters and MaxApplZone, and
checked my heap before the NewPtr - I have 500K free, and am trying to
get only 32K. - and the heap has only 900 or so bytes used
non-relocatably.

After the NewPtr call, I get the pointer, but my heap has been eaten -
now it shows a HUGE 300K nonrelocatable block in use.

anyone have ideas about the cause of this?

Thanks in advance folks...


Kip Walker
----------------------------+
kwalker+@cmu.edu            |  "Here's your I.D.,
kw27+@andrew.cmu.edu        |     ideal for identifying one and all."
kip@drycas.club.cc.cmu.edu  |              -Jethro Tull

Xref: sparky comp.sys.mac.programmer:16250 comp.sys.mac.system:12359
From: larimer@zeus.cdc.com (Mark D. Larimer)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.system
Subject: Re: AppleSingle Conversion
Date: 29 Sep 92 03:09:40 GMT
Followup-To: comp.sys.mac.programmer
Organization: Control Data Systems, Inc.
X-UserAgent: Nuntius v1.1.1d11
X-XXMessage-ID: <A6ED330CEC01A11B@larimer.cpg.cdc.com>
X-XXDate: Mon, 28 Sep 92 04:09:16 GMT

In article <william.zwicky-280992171153@exodus.cray.com> Bill Zwicky, 
william.zwicky@cray.com writes:

>Does anyone know of a Mac file utility that will convert between
>AppleSingle format and the native Mac format.  I've looked 
>on a few anonymous ftp sites but can't seem to find anything.

On bric-a-brac.apple.com is a utility called Tiger that will decode
uuencoded AppleSingle files.  Will that help?

Mark D. Larimer

(Control Data Systems, Inc.) && (University of Minnesota)
Internet: larimer@zeus.cdc.com
From: sho@bohr.physics.purdue.edu (Sho Kuwamoto)
Newsgroups: comp.sys.mac.programmer
Subject: How do I draw icl8's?
Date: 30 Sep 92 18:40:13 GMT
Organization: Purdue University Physics Department

IM VI gives the following useful info:
    [PlotIcon and PlotCIcon] will not draw any icons that
    are defined by the icon resources new to system 
    software 7.0 -- namely, the 'ics#', 'icl4', 'ics4',
    'icl8', and 'ics8' resources.

Unfortunately, IM VI does not seem to say how one goes about
drawing these icons.  Well, how *do* I draw these types of
icons?  Also, is there an easy way for me to hilight the
icons in the same way that the Finder does?

-Sho
--
sho@physics.purdue.edu
Xref: sparky comp.sys.mac.programmer:16408 comp.sys.mac.hardware:18189
From: busey@stein.u.washington.edu (Thomas Busey)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.hardware
Subject: Re: Do you know how to have both a network and a local printer?
Date: 1 Oct 92 21:51:18 GMT
Article-I.D.: u.1992Oct1.215118.237
Organization: University of Washington

pascal@CAM.ORG (Pascal Gosselin) writes:

>Farallon's Liaison (now up to version 3.0.3) will let you have your
>Ethernet as your 'home' device AND create a 2nd HIDDEN Zone on your LocalTalk
>port (printer or modem or both).  This new zone will be accessible from
>your Mac, but invisible to everyone else. 

>-Pascal
> 
>-- 
This is almost what I want.  I would like the second zone (which is connected
via the LocalTalk port) to not be hidden, i.e. connected to the rest of the
Ethernet appletalk zones through the other computer (the one with the ethernet
card).  I want everyone to be able to see everyone else. 
Since I don't have a laserprinter, this configuration is fine, security-wise.
Will Liaison accomplish this?

Tom Busey
busey@u.washington.edu
University of Washington
>+--------------------------+-------------------------------------------------+
>    Pascal Gosselin        |     Communications Accessibles Montreal  
>    pascal@CAM.ORG         |  A non-profit corporation.  Newsfeeds & More.   
>  Apple Support Specialist |  For info: info@CAM.ORG or Voice (514) 923-2102
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: QuickTime Compressed PICTs
Date: 29 Sep 92 16:28:26 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <7446@lib.tmc.edu>, draper@odin.mda.uth.tmc.edu (E.J. Draper) writes:
>
>
> How do I go about recreating GetPictInfo() functionality with QuickTime
> compressed images?

I've never done this, but here's a possible approach:

Draw the picture into a CGrafPort where you've intercepted the new StdPix
bottleneck (this is the one that gets called to draw compressed pixmaps).
In your interceptor routine, you should be able to call GetCompressedPixMapInfo
and get back an ImageDescriptionHandle for the compressed image. This image
description contains the pixel depth, as well as the compressor ID, custom
colour table (if any) and other useful info.

> p.s. - Apple engineers: Special casing GetPictInfo() for non- QuickTime
> data is a real drag.  It greatly diminishes the usefulness of the
> GetPictInfo() call (as a matter of fact it makes it damn near useless).

Amen. There still seem to be a few gaps in general systemwide support of
QuickTime capabilities. Has anybody had more success than I have in printing
QuickTime-compressed images on a LaserWriter?

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
Something tells me I'll never be clairvoyant.
From: Hank.Woods@p0.f222.n125.z1.FIDONET.ORG (Hank Woods)
Newsgroups: comp.sys.mac.programmer
Subject: Re: CSMP FAQ Moderator Retiring
Date: 28 Sep 92 10:32:03 GMT
Organization: FidoNet node 1:125/222.0 - Macademe/Emma, San Francisco CA

> Due to a lack of time and motivation, I do hereby retire as moderator

> of the Frequently Asked Questions list for this newsgroup. I hope

> someone will offer to take over this most prestigous and rewarding

> position (ahem). All persons volunteering for this position should

> write to me - the first such person will receive everything I have

> collected for the FAQ, and all subsequent persons' messages to me

> will be forwarded to the first person, so that they can fight amongst

> themselves to decide who gets the honor of continuing this monumental

> effort.

 

Ill gladly take over your position....Send me all of what you have!



--  
Hank Woods - via FidoNet node 1:125/555
    UUCP: ...!uunet!hoptoad!kumr!fidogate!222.0!Hank.Woods
INTERNET: Hank.Woods@p0.f222.n125.z1.FIDONET.ORG
Newsgroups: comp.sys.mac.programmer
From: jyct@mundil.cs.mu.OZ.AU (John Yew Choong THAM)
Subject: Help with scroll bar
Organization: Computer Science, University of Melbourne, Australia
Date: Fri, 2 Oct 1992 03:52:50 GMT

Hi,

	I would like any help in regard to coding for scroll bars on the
	Macs.  I am writing an application in Think C 5.0 and I have used
	AppMaker to generate my windows.  The problem is, with one
	of my windows, the scroll bar does not appear until I click on the
	region where the scroll bar exists with the mouse.  Do I have to do a
	redraw each time I switch from another window?  Besides all of the 
	above, I'm not sure how to get the window to scroll down anyway.
	Any help would be greatly appreciated.

John - the Novice Mac Programmer.
Internet Address : jyct@mundil.cs.mu.oz.au
From: ckuznia@phakt.usc.edu ( Ckuznia)
Newsgroups: comp.sys.mac.programmer
Subject: Background tasks on Mac?
Date: 6 Oct 1992 09:06:27 -0700
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: phakt.usc.edu

Is it possible to run background tasks on a mac?  While a program is
running, how can I get back to Finder without killing it, or how can I
launch a program without leaving Finder?

I am running System 7.0.1 on a Quadra.  

Thanks

Charlie
From: markl@netcom.com (Mark Lentczner)
Subject: ThinkC stack and profile bugs
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Thu, 1 Oct 1992 22:24:31 GMT


Folks-

I've been trying to tune my code for speed and I have come accross
some bugs in Think C.  I have given detailed information below.
HELP!  Am I missing something and/or are there any work arounds?

Thanks-
 Mark Lentczner
 Glyphic Technology
 markl@netcom.com
 
1- Stack Alignment
------------------
It seems that Think C doesn't take care to ensure that the stack
is aligned on a multiple of 4 boundry.  This means that if you are
manipulating long int locals, you code can easily take 50% more time
if the stack is mis-aligned on entry to the function.

Compound this with the fact that string literals affect where the
stack gets placed at run time!  This leads to the interesting code
fragment:
	{
		long	i, s;
		
		for ( i = 300000l, s = 0; i > 0; --i) s += i;
		
		#if 0
			printf("s = %ld\n", s);		
		#else	
			printf("* s = %ld\n", s);	// two characters longer
	}
The for loop will take 50% longer with one printf over the other!

I have a grungy fix for this (involving inline functions that futz
with the stack- yuch!), but I wish there was something better.

2- Profiler Logic Error
-----------------------
In VIA_timer.c there is a logic error.  Notice the careful work
in VIA_Ticks() in reading the VIA's counter hi byte: the hi byte
is read, then the lo, and then the hi again to ensure that the lo
byte didn't roll over 'tween the hi and lo reads.  This same logic
must be employed when reading the hi word (which is generated by
the interrupt routine)  The code should look something like:
	...
	do {
		elapsed.word.hi = upperWord;
		do {
			timer.byte.hi = VIA[vT1CH];
			timer.byte.lo = VIA[vT1C];
		} while (timer.byte.hi != VIA[vT1CH]);
		elapsed.word.lo = ~timer.word;
	} while (elapsed.word.hi != upperWord);
	
	return(elapsed.dword);
	...
Where the interrupt routine now bumps the new static short upperWord
instead of elapsed.word.hi.

3- VIA Interrupts Lost
On my PowerBook 170, when I run the Profiler code with the VIA,
after a short while the VIA interrupts cease to come.  The effect of
this is that the upper word of VIA_Ticks()'s result never changes.
In turn this means that when the lower word rolls over, the time
calculated by profile_exit will be negative.  Note that profile_exit
checks for this ( if (net < 0) net = 0 ) but it is really an error
condition (time never goes backward...) and it throws the profile 
results way off (many routines are lists as having a zero min-time
'cause of this and thus the averages are way off!).  Could this be
a System 7 thing?


Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: fast serial I/O in Think C with extra hardware?
Organization: HoloNet (BBS: 510-704-1058)
Date: Tue, 29 Sep 1992 06:06:26 GMT

I (mostly a friend though) have hacked the serial driver to halve the
sample clock rate in the driver so that serial speeds double that of 57600
baud are available. In fact a loop cable linking bothe ports at 115,000
baud in and out at the same time on a standard IIci showed not problems
sending Zmodem protocol files.
 
On sad side effect:
 
Interrupts occured so frequently using both ports at this speed that
TickCount barely ever advanced!!!!!!!!!!!!!!!!!!!!
 
The chip could, not too safely, be halved again to go double the 115,000
baud but everyone I know only needs to go only 115,000 baud to support our
Telebit Worldblazer modems.
 
 
You'll figure it out.
 
(Check dartmouth LocalTalk/serial source from old Doctor dobbs, check MIDI
serial port stuff from various mactutors, get the zilog docs, get a
debugger/dissassembler.
 
 
115,000 baud is potentially quite simple.
 
Bill Williams
From: schulte@KLIN.FAR.RUU.NL ("Bas Schulte, Spider")
Newsgroups: comp.sys.mac.programmer
Subject: Execution timing of ODOC
Date: 6 Oct 92 00:29:01 GMT

In <0q3-4l@engin.umich.edu>, Michael F. Kamprath 
<kamprath@space-grant.sprl.umich.edu> wrote:

>Whenever I send my application an open document >event from outside the 
>application, it will not actually open the >document until I bring the 
>application to the front.  How do I get the >program to open it imediately
>while it is still in the background?  I assume >this ia an easy one, but I
>just don't see it.


Hmm, your ODOC handler might do a SetFrontProcess to your app's process serial 
number to do this, but I don't think it is always a good idea to bring your app 
to the front when it receives an ODOC event (Apple?),

best regards, 

Bas Schulte.


----
This is getting better and better!
from: schulte@klin.far.ruu.nl
Newsgroups: comp.sys.mac.programmer
From: Michael F. Kamprath <kamprath@space-grant.sprl.umich.edu>
Subject: Execution timing of ODOC
Date: Mon, 05 Oct 92 13:05:20 EDT
Organization: University of Michigan, Aerospace Engineering
X-Useragent: Nuntius v1.1.1d11
X-Xxmessage-Id: <A6F5EEA84B01C4FC@sprl-mac2016.sprl.umich.edu>
X-Xxdate: Mon, 5 Oct 92 13:07:52 GMT

Whenever I send my application an open document event from outside the 
application, it will not actually open the document until I bring the 
application to the front.  How do I get the program to open it imediately
while it is still in the background?  I assume this ia an easy one, but I
just don't see it.

========================================================================
| Michael F. Kamprath                   | The University of Michigan   |
|   kamprath@space-grant.sprl.umich.edu |      Aerospace Engineering   |
|   kamprath@engin.umich.edu            |                              |
+---------------------------------------+------------------------------+
| This country is a _democracy_.  It is NOT a "Two Party Sytem."  DO   |
| NOT believe The Lie that not voting Republican or Democratic will    |
| waste your vote.  Vote for who ever you please, and let the          |
| politicians find out what a democratic government is all about.      | 
========================================================================
From: scott@mcl.ucsb.edu (Scott Bronson)
Newsgroups: comp.sys.mac.programmer
Subject: Do I need to init the Comm Toolbox?
Keywords: comm toolbox
Date: 6 Oct 92 01:46:55 GMT

I'm writing an application that uses the Communications Resource Manager
to find all the virtual serial ports installed.  Do I need to call InitCRM
before finding the devices (using the code snippet found at the end of
the communications resource manager in Inside the Communications Toolbox?

I've tried it both ways (with InitCRM and without) and it works both ways.
Thanks for any help someone can give me!

	- Scott

P.S. please send replies by email too, as now that school has started, I've
fallen woefully behind in reading my news.  Thanks again.
From: finchm@csugrad.cs.vt.edu (Michael Finch)
Newsgroups: comp.sys.mac.programmer
Subject: Printing in color
Summary: How does one copy a grafport to the printer and retain color info?
Keywords: printing color gworlds grafport
Date: 2 Oct 92 20:31:17 GMT
Organization: Virginia Tech Computer Science Dept, Blacksburg, VA

I am currently working on a project and have encountered a problem.

I do all of my drawing to a gworld and I wish to copy the info
from the gworld to the printer's port.  When I use copybits I loose
the color info.  If i draw directly to the printer's grafport I
get the colors.

I have tried the same tests with a WindowPtr, If I copy from the
window to the printer I also loose the color info.

Am I overlooking something simple?

-MIke

-- 
finchm@csugrad.cs.vt.edu | Every program has at least one bug and can be 
Michael Finch            | shortened by at least one instruction -- from which,
Va Tech Computer Science | by induction, one can deduce that every program can
ACM Vice President       | be reduced to one instruction which doesn't work.
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: TCL archives
Organization: Kalamazoo College
Date: Tue, 6 Oct 1992 12:51:10 GMT

peterc@cubetech.com writes:
>Where's the FTP site where all the shareware/freeware TCL classes
>are archived?

ftp.brown.edu, in pub/tcl.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 I tried to sleep my way to the top
 But my alarm clock always woke me right up