HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.sys.mac.programmer
Subject: Re: What is error -5016?
From: cwhi2@cs.aukuni.ac.nz (Craig Dean          Whitmore       )
Date: Tue, 15 Sep 1992 21:54:15 GMT
Organization: Computer Science Dept. University of Auckland

In <f4Tl03xo821300@amdahl.uts.amdahl.com> jsp@uts.amdahl.com (James Preston) writes:

>cwhi2@cs.aukuni.ac.nz (Craig Dean          Whitmore       ) writes:

>}This -5016 problem is a special error that programmers introduced to indicate
>}that the 680x0 was going into superviser mode and if the person didn't turn
>}the MAC off in the next five years that there MMU would cease to function.

>Well, shucks, I did this on a PB100.  I didn't think it had an MMU.

The Power Book has a MMU (but this is not widely know(Well not all all).
Macintosh put this computer out with one but the MMU had a few bugs in it and
they disconnected it from the main processor so if wouldn't interfere with
the operation of the computer.  If you take the computer apart(very easy to
do (It'll invalidate your warrenity So!)) and move the jumper cable labled
I41 from position 12 on he motherboard to 13 and this will enable the MMU.
This helps performace very much (increases speed by 100%).

>}I don't know why you should get that error - the only way that this error
>}came up was when programmers did a call to the operating system to open a
>}screen with dimensions of 244 x 199 and to turn on file sharing. 

>Wow, you sure must be right, 'cause that's EXACTLY what I did just before
>the call to ResolveAlias!  So if I make the screen 244 x 198 it should
>work, right?

Yes, you are right.  If you make the screnn anything but 244 x 198 then your
shouldn't have any problems with the -5016 error any more.



>}- but that
>}didn't work all the time.   If this thing happens again you should in my
>}opinion sue macintosh for releasing macintosh computer without getting all
>}there bugs out of their machines.

>Ok, are you a lawyer?  Go ahead and start the suit for me, we can talk
>about your fee later, after you've won the 27.3 million dollars for me.

Ok I am a lawyer. I looked into the possibility of sueing macintosh for every-
thing that they have but there is a flaw.  They don't have any money.  After
releasing there latest computer they went backrupt and they don't have any
money left.  There is a possibility that we could get them to melt all of there
computers they haven't sold yet and get all the gold out of them.  I estimate
that we could get a ton of gold from all the circuit boards.

If you want to go any futher then contact me.


>--James Preston

-- 
----------------------------------------------------------------------------
|Craig Whitmore                     |  /////                               |
|Auckland University                | (<>_<>)                              |
|Auckland                           |  \---/                               |
From: alexr@apple.com (Alexander M. Rosenberg)
Newsgroups: comp.sys.mac.programmer
Subject: Re: popup menus in non-system font
Date: 11 Sep 92 17:10:32 GMT
Organization: Hackers Anonymous
X-Useragent: Nuntius v1.1.1d8
X-Xxdate: Fri, 11 Sep 92 18:12:17 GMT
X-Xxmessage-Id: <A6D6218197010C7C@mtdew.apple.com>

In article <1992Sep10.214027.7936@dcs.qmw.ac.uk> Jeremy Roussak,
jeremyr@dcs.qmw.ac.uk writes:
>Now, this works a treat. Until, that is, I run an app like
>MSWord (are there any?) or even, I am told, MacWrite IIJ. Then
>(and sometimes for no apparent reason), although the font
>changes for the popup, the size doesn't: it stays at 12 point.
>Checking with MacsBug, SysFontSize is set to 9.
>
>The problem persists after running MSWord, even after quitting
>it. Sometimes it will then go away again, but more often it
>persists until I reboot.

This is the result of some _very_ sloppy programming on the parts
of Claris, Microsoft, etc.

They have a custom MDEF that draws their cute little up-shift arrow
symbol and the like. MDEFs draw in the Window Manager port. They
change some values in that port and don't restore them.

In particular, the text size field is frequently changed to 12.
What was wrong:

1.) They changed the value of a system-wide structure for a specific
purpose and didn't restore it.

1A.) (Only in some applications) Instead of using a trap to change these
values, they slam them directly into the structure, despite years of
Apple recommending otherwise.

2.) They typically set the font to 0 and the size to 12. This is incorrect.
The system font is 0, and the system font size is 0. Size 12 is not correct
for a Kanji system, for one.

3.) Your pop-up is drawn in the Window Manager Port by the sytem supplied
MDEF. You've temporarily changed the system font and size to be the font
and size you want. It ends up being drawn in the correct font at the size
that the application slammed in in step 2, typically 12.

What have we learned?

1.) Don't be a bad dog!

2.) Save and restore all system-wide things you change unless the intent
is for the change to affect others.

3.) Listen carefully to the statements that DTS has to say.

4.) Save the current Window Manager port font and size and set them, via
the correct _TextFont and _TextSize traps to 0 around your call to
PopUpMenuSelect.

5.) The pop-up control in System 7 was fixed this way in System 7 Release 7.1.
---------------------------------------------------------------------------
-  Alexander M. Rosenberg  - INTERNET: alexr@apple.com      - Yoyodyne    -
-  330 Waverley St., Apt B - UUCP:ucbvax!apple!alexr        - Propulsion  -
-  Palo Alto, CA 94301     -                                - Systems     -
-  (415) 329-8463          - Nobody is my employer so       - :-)         -
-  (408) 974-3110          - nobody cares what I say.       -             -
From: Joe.Francis@dartmouth.edu (Joe Francis)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Needed: Refrernces for programming MacTCP
Date: 13 Sep 92 22:29:39 GMT
Organization: Dartmouth College, Hanover, NH
X-Posted-From: InterNews1.0a4@newshost.dartmouth.edu

In article <1992Sep09.233857.15170@CS.ORST.EDU>
noord@prism.CS.ORST.EDU (David Noor) writes:

> I am *trying* to design a program for the Macintosh which will end up
> using MacTCP. I need help, because the Inside Macintosh books do not have
> anything about MacTCP in them. So can anyone out there tell me where to
> maybe ftp, or some other way to get programming information for MacTCP?
> I know about the APDA MacTCP developers kit, but the CS dept. wont loan it out
> to students and i dont have $600+ free in my account or anything :).

APDA sells the aforementioned kit for $100.00.  If you already have
MacTCP and only need the documantation, you can purchase the MacTCP
v.1.1 Documentation Kit through APDA for $60.00.

APDA can be called toll free at 1 800 282 2732.

You may also want to see if anyone at OSU's computation center has it,
and is willing to lend you the documentation.
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: vrefNum from Path Name
Organization: Taligent
Distribution: usa
Date: Sat, 5 Sep 1992 04:57:15 GMT

In article <15143@claris.com>, wombat@claris.com (Scott Lindsey) writes:
> 
> In article <Btwwt5.7Bv@taligent.com>, keith@taligent.com (Keith Rollin)
writes:
> > 
> > Remember, Inside Mac says that you should _NOT_ create FSSpecs by hand. You
> > should always call FSMakeFSSpec. Don't go filling in the parID and vRefNum
> > fields yourself. (There is one exception to this, which is that you can
freely
> > assign one FSSpec record to another.)
> 
> Hmm.  But what if you're under System 6 without FSSpec calls?  In particular,
> FTSend() requires an FSSpecArrayPtr, apparently without regard to whether
> you're running System 6 or 7.
> In this case I fill in the FSSpec by hand and hope that the FT tool can deal
> with the fact that it can't use FSSpec calls to process the file referred to. 

What you're supposed to do here is go ahead and call FSMakeFSSpec. But before
you do that, install your own custom SysError() handler. If you call
FSMakeFSSpec and it's not implemented, your SysError handler will be called with
dsCoreError, or unimplemented trap. Check for that, and then you can fill in the
FSSpec record by hand.

Actually, this could be tough, since debuggers and System 7 like to intercept
SysError and put up pretty dialogs and stuff. If you encounter problems patching
into SysError, you may just want to patch in at the A-Trap dispatcher level.

Or you could just implement _HighLevelFSDispatch (trap AA52) yourself. Then
you'd be obeying the rules when you called FSMakeFSSpec! Yeah, I like this idea
the best. But then, I also like biting my toenails.

--
Keith Rollin
Phantom Programmer
Taligent, Inc.
From: jsp@uts.amdahl.com (James Preston)
Newsgroups: comp.sys.mac.programmer
Subject: What is error -5016?
Date: 12 Sep 92 06:01:38 GMT
Reply-To: jsp@pls.amdahl.com
Organization: Amdahl Corporation, Sunnyvale CA


I'm calling ResolveAlias on an alias that references an unreachable
AppleShare volume (because I'm not connected to the network at the
time).  It returns error number -5016.  That number doesn't seem to
be documented in Inside Mac volume VI.  Does anyone know the official
meaning of that error number?  I'd like to be able to give a reasonable
error message to the user; can I just assume that -5016 means, "You're
not connected to the network, bozo"?

--James Preston
Newsgroups: comp.sys.mac.programmer
From: andy@infotec.ch (Andrew Warinner)
Subject: Looking for hex grid algorithms
Organization: Infotec S.A.
Distribution: comp
Date: Mon, 14 Sep 1992 15:57:20 GMT


Does anyone out there in netland have any code, pseudo-code or
alogrithms for dealing with a hexagonal grid system (especially
calculating line-of-sight paths)?  I picked something up from
the net a long time ago but I have misplaced it (that's what
happens when you switch continents ;-).

Thanks in advance,

Andrew Warinner				"C'est la vi"
(andy@infotec.ch)			Infotec S.A.
phone:  022/738 44 33			8 avenue de Frontenex
fax:    022/786 50 61			1207 Geneva, Switzerland
From: wombat@claris.com (Scott Lindsey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Keeping the cursor visible
Date: 4 Sep 92 23:44:50 GMT
Organization: Claris Corporation, Vancouver WA
Wombat: yes
Number: 12324

In article <D88-JWA.92Sep2133330@dront.nada.kth.se>, d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
> 
> @claris.com (Scott Lindsey) writes:
> 
>    ShowCursor won't actually show the cursor if it's only obscured.  I don't
>    think there's a legal way to unobscure a cursor, however, setting the low-
>    memory global CrsrNew = 0xFF forces it to really redraw. (CrsrNew is 0x8CE
>    and is a 1-byte value).
> 
> How abotu just calling InitCursor?
> 
> It sets the cursor to an arrow, and shows it (and clears
> the show/hide count) and then you can call SetCursor to
> set it to the shape you want.

I've lost the original message, but I think the issue was a progress cursor
(beachball or something).  In fact, in ClarisWorks, I use CrsrNew to show the
cursor whenever the beachball comes up, just in case the cursor was obscured.
That way, you won't be sitting there with an obscured spinning beachball.

--
Scott Lindsey <wombat@claris.com>
From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Patching the _Launch Trap
Date: 9 Sep 92 17:21:36 GMT
Organization: Computer Science Dept, QMW, University of London

In <BuA3vu.97H@taligent.com> keith@taligent.com (Keith Rollin) writes:

>I do something like this. I patch InitGraf right now, but I'm considering a
>scheme where I patch InitAllPacks, instead. The problem with patching InitGraf
>is in determining if the call is being made from the start of an application.
>Some InitGraf calls are made from INITs at INIT time (by ShowINIT, for example);
>some applications call InitGraf more than once (applications written with THINK
>Pascal are common "offenders"); and CE Toolbox calls InitGraf at shutdown time
>under certain circumstances. If you patch InitGraf, you'll have to look out for
>all these cases.

The other problem with patching _InitGraf is that it doesn't
move memory, so neither can (should) your patch. We won't get
into the "all traps move memory because of patches" here! You
can argue that unexpectedly moving memory within _InitGraf
probably won't matter because of the way in which apps call it,
but it's a little unsafe. _InitFonts, on the other hand, does
move memory and is usually called immediately after _InitGraf.

When is _InitAllPacks called?

Jeremy
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 20:28:56 GMT

In article <1992Sep10.150727.4240@terminator.cc.umich.edu> krk@itl.itd.umich.edu (Kenneth Knight) writes:
>In article <1992Sep10.113833.22987@ifi.uio.no> erlingm@ifi.uio.no (Erling Mork) writes:
>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 **
>

The place to send 'subscribe' messages for the TCL-talk mailing list is
tcl-request@brown.edu. At least that address exists according to finger.

  ** Ken **
From: d88-jwa@dront.nada.kth.se (Jon W{tte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Best text compression?
Date: 7 Sep 92 10:19:45 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden
Originator: d88-jwa@dront.nada.kth.se

> agoates@nyx.cs.du.edu (Alan Goates) writes:

   Second, does anyone know what the best published (Public Domain) algorithm is
   for compressing text. And does anyone know where I could get my hands on example
   source code for said algorithm (The only one I've seen is Lempel-Ziv).

Lempel-Ziv isn't too bad (actually, that's two whole familys of
algorithms)

Source avaialble for the macintosh is LZRW-1b which is a high-
speed, LZ-77 derivative.

"Yabba" is an LZ-78 relative that also is in the public domain.

-- 
Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069

Help eradicate FIDO-Net <-> Usenet gateways in our time!
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Opinions on THINK Reference?
Date: 7 Sep 92 20:34:43 GMT
Followup-To: comp.sys.mac.programmer,comp.sys.mac.misc
Organization: Apple

In article <1992Sep6.152213.12596@miavx1.acs.muohio.edu>,
psweeney@miavx1.acs.muohio.edu wrote:
> 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.

Currently the sold Think Reference does not have all the IM VI
information.

I've seen that bundle sold for less than $50, I would rather 
spend the money on this nice package, than sit and have six
huge volumes always open on my small table.

I'm eagerly awaiting the day when all important programming references are 
integrated to development environments. 411, Blue Notes and 
Think Reference is just the first generation of lookup tools.


Kent
"I would rather have a thousands idiots attacking my position, than
have one idiot helping to defend it."	[Paraphrased from Voltaire]
-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.
From: chuck@gte.com (Chuck Hoffman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Animated Cursor
Date: 9 Sep 92 12:53:01 GMT
Followup-To: comp.sys.mac.programmer
Organization: GTE Laboratories

In article <1992Sep4.175646.10103@magnus.acs.ohio-state.edu>,
jbush@magnus.acs.ohio-state.edu (J Eric Bush) wrote:
> 
> To do an animated cursor the way the Finder does it, you have a acur resource 
> with the numbers of the CURS icons in the rotation.  Make a copy of your finder
> and save it to disk.  Look at the acur and CURS resource with ResEdit.
> 
> Then, inyour application, you just keep a variable with the current cursor,
> add one to it, and then do a SetCursor procedure/function.

Thanks, Eric.  Sometimes when I look for something complicated, I miss the
simple.

Chuck Hoffman
chuck@gte.com
GTE Laboratories, Waltham, Massachusetts, USA
(617) 466-2131
=====================================
I'm not sure why we're here, but I am sure that while we're here we're
supposed to help each other.
=====================================
From: maunsell@cephalo.neusc.bcm.tmc.edu (John Maunsell)
Newsgroups: comp.sys.mac.programmer
Subject: Printing in White
Date: 9 Sep 1992 19:39:38 GMT
Distribution: na
Organization: Baylor College of Medicine
X-UserAgent: Nuntius v1.1.1d9
X-XXDate: Wed, 9 Sep 92 19:40:07 GMT

I have an application in which I need to do black and white graphics in
which white 
lines are drawn on a black background.  ForeColor(whiteColor) works fine
in a window 
on the screen, but no white lines appear on the black background when I
send the 
output to a LaserWriter.  I know LaserWriters don't like regions, but can
they not handle 
erasing pixels?  I am overlooking something, or is there a way to get
around this?
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Is a resource fork already open?
Organization: Taligent
Date: Tue, 8 Sep 1992 21:43:28 GMT

In article <NEERI.92Sep8130709@iis.ethz.ch>, neeri@iis.ethz.ch (Matthias
Neeracher) writes:
> 
> In article <1992Sep8.153520.10687@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence
D'Oliveiro, Waikato University) writes:
> >In article <39464@imag.imag.fr>, cinquin@imag.fr ( Philippe Cinquin) writes:
> >> Sorry if this is a stupid question, but how do you know if the resource
fork of
> >> a file is already open?
> >
> >If a file is already open by somebody else, you'll get an error if you try
> >opening it in a mode that's incompatible with the other person's open mode.
> >
> >But I suspect you're really asking what happens when you open a resource file
> >twice from the same application. The answer is, you will get the same file
> >refnum back the second time. So how do you tell that this is happened? It can
> >be done, without too much low-level messing about.
> 
> >[Low level messing about deleted :-]
> 
> Excuse me, but am I missing something obvious or is there a much simpler way
to
> determine if the resource fork is already open?
> 
> PBGetCatInfo returns a field called ioFlAttrib, and according to
> _Inside Macintosh:Files_, bit 2 of that field is set if the resource
> fork is open.

Sometimes you want to know if the resource fork is open in _your_ application.
Calling PBGetCatInfo will tell you if the file is open within _any_ application.
The method Lawrence posted is the proper method.

(Another method, which is more fun but which is very likely to break at some
time in the future is to walk the resource chain, pull out refnums, call
GetFCBInfo on them, and see if the file you are interested in is returned.)

--
Keith Rollin
Phantom Programmer
Taligent, Inc.

Newsgroups: comp.sys.mac.programmer
From: j-norstad@nwu.edu (John Norstad)
Subject: Re: NewsWatcher source for TC
Followup-To: comp.sys.mac.programmer
Organization: Northwestern University
Date: Thu, 10 Sep 1992 17:20:23 GMT

In article <88434@netnews.upenn.edu>, berry@a.chem.upenn.edu (Don Berry)
wrote:
> 
> O.K., I'm getting tired of the various (and previously reported) bugs
> with NewsWatcher as released, and I guess I'm ready to hack my own
> version.  Would any of you kind souls make my life easier by sending
> me your NewsWatcher source _preferably_ for ThinkC 5.0x, including
> your nifty modications?  Since beggars can't be choosers, I'll happily
> accept MPW source, too, although then hints for conversion to ThinkC
> would also be helpful. 
> 
> Modifications of which I've heard talk (some time ago) include 
> 1. avoiding the "too many groups" bug, and
> 2. a more logical approach to retrieiving long (>32k) articles 
>    (get it all at once, but only put the first 32k into a window; this 
>     avoids a second retrieve when the user saves the article.)

Both of these problems, and many others, were fixed some time ago in
NewsWatcher 1.3d6. The program and source code and tons of documentation
are available via anonymous FTP to ftp.acns.nwu.edu [129.105.113.52], in
the pub/newswatcher directory. The source code is compatible with both
Think C and MPW C. Think project files and an MPW makefile are both
included.

John Norstad
Academic Computing and Network Services
Northwestern University
j-norstad@nwu.edu
Newsgroups: comp.sys.mac.programmer
From: aland@chaos.cs.brandeis.edu (Alan D.)
Subject: Re: IO ReDirection in Think C
Organization: Organization is for those who don't like chaos
	<1992Sep12.061719.4937@tamsun.tamu.edu>
Date: Mon, 14 Sep 1992 01:24:14 GMT

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

>yjc@po.cwru.edu (Jerome Chan) writes:
>|
>|  How does one activate the IO re-direction capabilities of the console
>|package in ANSI library for Think C 5.0.x?

>#include <Whateverfilesyouneedtoinclude.h>
>#include <console.h>

>main( int argc, char * argv[])
>{
>  argc = ccommand( &argv);

>  // continue on here with the argument processing like normal
>}

Or, if you meant, how do you redirect std{in, out, err}, you can just
use the standard ANSI C calls:

      FILE *freopen(const char *pathname, const char *type, FILE *stream);

in other words, you would do:

	stdin = freopen(filename, "r", NULL);

I think...  Check the Think C manuals for exact info.

	-=Alan
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: Simple (?) Resource Manager program?
Organization: Iowa State University, Ames, IA
Date: Sun, 6 Sep 1992 23:01:45 GMT

I recently thought I'd write a simple getResource program to read
in a font and dump it out in bitmap form (array declarations in C)
to be compiled with a program. I however get really weird numbers..
i.e. fontwidth of > 1000 or height > 100? That's outrageous...
(plus no matter what id I get, the numbers are always the same).
I think I'm missing something basic.

Here is the program...

void main(void)
{
   Handle ahand;
   FontRec  *fontptr;
   char s[80];
   short fontid;
   short error;
   
   printf("Enter font id: ");
   gets(s);
   fontid = atoi(s);
      
   printf("Getting 'FONT' id %d\n",fontid);
   
   ahand = GetResource('FONT',0);
   
   if (ahand == NULL)  {
      printf("Got null handle... exiting (1).\n");
      exit(1);
   }
 
   error = ResError();
   if (error) {
      printf("Got reserror %d (1)\n",error);
      exit(1);
   }
   
   LoadResource(ahand);
   
   error = ResError();
   if (error) {
      printf("Got reserror %d (2)\n",error);
      exit(1);
   }
      
   HLock(ahand);
   fontptr = (FontRec *) (*ahand);
   
   fontptr-> xxx  /* this should be the fontrec data right ? */

   [...]

}

Thanks anyone who can help...
-- 
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