HDTenEightyP/NetNews huggingface dataset:
From: cooljohn@leland.Stanford.EDU ( Magdaleno)
Subject: Accessing Data in Resource	
Keywords: Resource, Data Handle, Handle
Organization: DSG, Stanford University, CA 94305, USA
Date: Mon, 14 Dec 92 20:30:30 GMT

Here's one problem of mine that I hope has a quick solution. 

In the midst of writing a game, a created my own resource type, say:
MTYP, and in it I stored the map of the game.

Now in my program, this is what I do to access the data:

type
	pMapType = array[1..MAXSIZE] of integer;
	pMapPtr = ^pMapType;

var
	pMap : pMapType;

procedure LoadInMap;
var
	MapRes : Handle;
begin
	MapRes := GetResource('MTYP',MAPID);
	pMap := (pMapPtr(MapRes^)^);		{ YUCK. }
	etc....
end;

	Well this code works for getting info out of the resource,
but unfortunately, I haven't figured out how to point the Handle
in the right direction, when I want to call WriteResource.
	
	So I have two questions:
(1)	Is there better way to access the data... through the Handle.
(2)	If so/not how do I make, in this case, MapRes point to
	the memory where my array is stored. I've tried type
	coercion to no ado.

	
	Thank you in advance, 

	John Magdaleno
	cooljohn@leland.stanford.edu
From: ray@philmtl.philips.ca (Ray Dunn)
Newsgroups: comp.sys.mac.programmer
Subject: Driving mac program from another
Date: 18 Dec 92 04:14:29 GMT
Organization: Not Philips.

Question from someone fairly Mac illiterate but who has a serious need to
know:

Given a Mac program which normally takes much mouse events and keyboard
input, is it possible (easily/with difficulty) to have that program run
automatically with the input being generated by another program?

To save time, I'd appreciate an email answer, and will summarize replies
back to here.

Thanks.
-- 
Ray Dunn at home        |  Beaconsfield, Quebec  |  Phone: (514) 630 3749
ray@philmtl.philips.ca  |  ray@cam.org           |  uunet!sobeco!philmtl!ray
From: gregt@function.mps.ohio-state.edu (Gregory M Ferrar)
Newsgroups: comp.sys.mac.programmer
Subject: Using VBL for animation
Date: 11 Dec 1992 17:17:18 -0500
Organization: Department of Mathematics, The Ohio State University
NNTP-Posting-Host: function.mps.ohio-state.edu

I'm trying to create fast, flicker-free animation.  I'm using a Quadra 700
with a 16" monitor, which is my startup screen, and two 12" monitors.

I am currently installing a VBL task in the startup screen's VBL list.  This
task simply sets a variable to TRUE.  The theory is that when I am ready to
draw the screen, I can just set that variable to FALSE, wait for it to become
TRUE, and then draw quickly.  However, when I do this, I STILL get retrace
lines in the middle of my animation.

Here's the code:

-------------------------------------------------------------------------

void install_vbl_task(void)
{

	short		error;
	DefVideoRec	video_info;

	/* Find the slot number of the video card */
	GetVideoDefault (&video_info);

	/* Install the screen refresh interrupt */
	refresh_task.the_vbl_task.qType = vType;
	refresh_task.the_vbl_task.vblAddr = (ProcPtr) set_refresh_flag;
	refresh_task.the_vbl_task.vblCount = VBLS_BETWEEN_FRAMES;
	refresh_task.the_vbl_task.vblPhase = 0; 
	
	/* Save the applications's A5 where the VBL task can find it */
	refresh_task.application_A5 = (long) CurrentA5;

	/* Install the task */		
	error = SlotVInstall((QElemPtr)&refresh_task.the_vbl_task,
				video_info.sdSlot);

}	/* install_vbl_task() */

-------------------------------------------------------------------------

The task itself simply restores A5, sets the Boolean global, resets its
counter, gets the old A5 back, and quits.

Judging by the way the animation looks, the redraws are correctly SPACED but
are offset from where they should be-- the vbl lines are always in the same
places, indicating that animation is in fact in synch with VBL but not in
phase.

The time taken to draw is extremely small-- roughly 150,000 move.l instructions
on a Quadra 700.

Any suggestions?  Am I doing something stupid?  I sincerely appreciate any
suggestions.

  -Greg Ferrar (gregt@function.mps.ohio-state.edu)
Newsgroups: comp.sys.mac.programmer
From: Anthony Van Alphen <ava@bnr.ca>
Subject: FSOpen and System 7 Alias
X-Xxdate: Mon, 14 Dec 92 15:55:59 GMT
Organization: Bell-Northern Research
X-Useragent: Nuntius v1.1.1d12
Date: Mon, 14 Dec 1992 15:50:40 GMT

If I write an application and use the standard FSOpen FSRead functions
supplied with
MPW can the file be aliased and the alias opened?  When I try to open an
alias I think I 
am opening the alias itself.  Is there a trick? Or am I doing something
wrong?

Regards...Anthony
ava@bnr.ca
From: girj@vax5.cit.cornell.edu
Newsgroups: comp.sys.mac.programmer
Subject: Need user opinions of Think Reference
Date: 11 Dec 92 12:04:38 EST
Reply-To: ps16@.cornell.edu
Distribution: comp.sys.mac.programmer
Organization: Cornell University

Hi,

I would like to know from someone who has used Symantec's Think Reference

Please reply  by email to ps16@cornell.edu.

Thanks muchas...
From: bowman@reed.edu (Mr. Stress Tensor)
Newsgroups: comp.sys.mac.programmer
Subject: Software control of landscape/not landscape
Date: 18 Dec 92 20:51:37 GMT
Article-I.D.: reed.1992Dec18.205137.23378
Organization: Reed College, Portland, OR

What's the best way to force landscape printing?  It would be nice if PrGeneral
would do it, but apparently it can't (?).  I'd love to be wrong about that.
It seems a bad idea to mucking directly into the print record, since I certainly
can't test on every printer there is.  It also seems like it might be possible
to fake a mousedown in the Page Setup dialog so that it defaults to landscape,
but I'd like, if possible, to be able to use the print record for various
nefarious porpoises.

Thanks,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
Ask not what's inside your head but what your head's inside of. - W. Mace
From: werner@dewey.soe.berkeley.edu (John Werner)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Advice needed
Date: 13 Dec 1992 08:30:37 GMT
Organization: School of Education, U.C. Berkeley
NNTP-Posting-Host: dewey.soe.berkeley.edu

In article <1992Dec13.062936.26772@midway.uchicago.edu> hd12@midway.uchicago.edu writes:

>1. Usually what's the percentage the software author can get from the 
>company's profit? Any estimation in terms of dollar? (assuming say, $70
>each copy.)

Don't agree to a percentage of the "profit", whatever that means.  Ask
for a percentge of the gross, i.e. you get a percentage of every
dollar of revenue they get on your program, regardless of their
expenses to produce it.  This way you don't have to worry quite as
much about them fudging their costs to make the profit look lower.  On
one educational program I wrote, I and the other authors get 15% of
the gross.  We also got a decent advance.  In hindsight, we might have
been able to get more.

>2. If the company offer fixed percentage of their profit, how am I supposed
>to make sure they will keep their promise, since I don't have access to
>their balance sheet?

See #1.  If you get a cut of the revenues instead of the profits, you
just need to see the sales reports, not the balance sheet.  The
contract should say that you get to see some sort of sales report, and
should say how often.  I think we get one every 6 months.

>3. Do I need a lawyer to make it legally binding?

You need a good, tightly-worded contract to make it legally binding.
Unfortunately, you this usually means you need a lawyer.  On the
program I wrote, we negotiated our own contract, starting with the
pre-canned one the publisher tried to get us to sign and combined with
lots of advice from our lawyer.  We had him look over a few drafts and
the final contract before we signed it.  I think we ended up paying
him about $500.  This was in Chicago; I can probably find his
name/number if you want them.

>4. Any tips? Precautions? Suggestions?

Make sure you have a valid, registered copyright on the program.
Don't just put a copyright on it, send in the forms to the copyright
office too.

Try to have the contract say that you retain copyright in the program;
it gives you more control and rights, and a better legal position if
you ever end up in court.  If they insist on getting the copyright, be
aware that you're giving something up, and try to get something from
them in return.

Depending on how commercial the program is, you might want to try to
get some sort of promise that they will put a certain amount of effort
into marketing/advertising or the rights revert to you.  This would be
hard to get, but might be something to negotiate away.
-- 
John Werner                        werner@soe.berkeley.edu
UC Berkeley School of Education    510-642-9651
Newsgroups: comp.sys.mac.programmer
From: cmcclary@ucs.indiana.edu (Charles McClary)
Subject: Detecting reboot or startup
Followup-To: comp.sys.mac.programmer
Organization: Indiana University
Date: Tue, 15 Dec 1992 16:40:03 GMT

What is the best/preferred method for an application to detect if the
system has been rebooted or restarted since it (the application) last ran.

Thanks,
Charlie McClary
Indiana Univ.
cmcclary@indiana.edu
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Book recommendation needed
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Fri, 18 Dec 1992 17:48:00 GMT

In <7DV=v3-@engin.umich.edu> positron@engin.umich.edu (Jonathan Scott Haas) writes:

>nice, but doesn't go far enough. Specifically, what I'd like to do
>is have a window containing a color picture that uses a palette other
>than the system palette, that scrolls properly with scroll bars, whilst
>the user clicks and drags irregularly-shaped pieces of the picture, which
>show outlines and rubber bands as they drag, scrolling the picture
>appropriately if the user drags outside the window, and... but you get
>the idea. A basic book just isn't going to cut it. Any recommendations?

Why isn't a basic ToolBox book going to cut it? Maybe for the pallette,
but that's covered in IM V and VI. All the other things (windows,
scroll bars, dragging outlines, ...) are simple and basic to ANY
mac program.

>Oh, one other thing... my budget is limited, so I can't run out and buy
>the whole _Inside_Mac_ just yet. I've heard there's an electronic version
>available... can anyone confirm/deny this?

Well, wait until your budget recovers. Or buy at least volume I and VI,
after that II, IV and V in that order. Or buy a CD ROM reader and
a $30/year _Develop_ subscription; the magazine is good and it comes
with a large reference/tools CD that you HAVE to have.

Cheers,

							/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
 Engineering: "How will this work?" Science: "Why will this work?" Management:
 "When will this work?"  Liberal Arts: "Do you want fries with that?"
                     -- Jesse N. Schell
Newsgroups: comp.sys.mac.programmer
From: milligan@netcom.com (Michael Milligan)
Subject: Getting 'Sharing Setup' info from system? (Q)
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Fri, 18 Dec 1992 23:44:52 GMT

I'm interested in getting the name the user has entered in the Sharing Setup
control panel for registration purposes in an application I'm writing.  Can
anybody tell me how this is done?

-M
From: cook@cs.umass.edu (Robert Cook)
Newsgroups: comp.sys.mac.programmer
Subject: Possible Bug with fseek in MPW C 3.2.4?
Date: 17 Dec 92 15:38:55 GMT
Organization: University of Massachusetts
X-UserAgent: Nuntius v1.1.1d12
X-XXMessage-ID: <A756093D9A0128C5@alice.cs.umass.edu>
X-XXDate: Thu, 17 Dec 92 15:38:53 GMT

I'm trying to increase the size of a file using the function fseek with
no luck,
i.e.
           err=fseek(fp,offset,SEEK_END);
the fseek statement returns back an error, -1.

According to the book "C - A Reference Manual" third edition, by Samuel
P. Harbison and
Guy L. Steele Jr. this is possible, and I quote from pg 305, "If
wherefrom is SEEK_END
and offset is positive, then the file is extended the indicated amount
from it end with
unspecified contents."

The MPW 3.0 C Reference Manual also eludes to this fact by stating on pg
122, "If whence
is SEEK_END, the new position is the size of the file plus offset."  But
on pg 123 it states
under "Return values", "An example of an improper seek is an fseek before
the beginning of,
or past the end of, the file."

So what gives,  can I use fseek to increase the size of a file?
If so, does this mean MPW C 3.2.4 has a bug in it?

Thanks,

Bob Cook
Computer Science Department
University of Massachusetts
Amherst, MA 01003
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: PPC Sessions, or Any ports in this storm?
Date: 16 Dec 92 17:21:27 +1300
Distribution: world
Organization: University of Waikato, Hamilton, New Zealand

In article <1ghueaINNnuf@flop.ENGR.ORST.EDU>, kempkec@mist.CS.ORST.EDU (Christopher Kempke) writes:
>
> First a simple question:  Can I assume that PPC Session reference numbers
> are unique to a running application?

I think that session and port numbers are unique systemwide, not just to an
application. I've been doing some messing about with PPC from HyperCard,
and several times I've made some mistake in a script, tried quitting HyperCard
and going back in, and failed to open my port because it was already open.

Remember the PPC Toolbox can be used from interrupt level and INIT code, not
necessarily by an application. I don't think it knows anything about
application contexts; that knowledge belongs to higher layers, like the
High-Level Event and AppleEvent Managers.

> Worse, the ReadParam and WriteParam (why the name change from send/receive
> to write/read, guys?) don't include the port reference number.  The
> only thing I can consistently get is the session reference number, and
> of course there's two big problems with that:  a) it's not documented to
> be unique, so I can't necessarily map it back to the port number, and
> b) there's no obvious way to convert them, short of building a table myself
> as I open the sessions, and c) the session reference number is not even
> listed as being a readable value in the completion procedure, so potentially
> in a later system it could be corrupted or overwritten by the time it reaches
> the completion routine.

I haven't heard of any cases where the system altered a field where there
was only a right-arrow next to its description. I trust this is still true
with the PPC Toolbox. (He said with a straight face.)

> Is there really no way to do this?   I _can't_ be the only person who
> needs to send data from the application to its own completion routines.
> Can I?

One common technique is to make the PPC parameter block part of a larger
structure that you know about. You can put whatever information you like in
the fields following it.

There's another technique I like to use (because it also works in more
difficult situations), but it involves generating code at run-time, which
upsets some squeamish types. :-)

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+13:00
From: jimc@tau-ceti.isc-br.com (Jim Cathey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: 3D Graphics
Date: 14 Dec 92 20:16:36 GMT
Organization: ISC - Bunker Ramo, Spokane, WA

In article <830021@hplvec.LVLD.HP.COM> bayes@hplvec.LVLD.HP.COM (Scott Bayes) writes:
>This has always annoyed me.  Bresenham's algorithm, which handles this
>very well--optimally, one might say--has been around _forever_.  Why
>does Apple choose to draw lines with "hooks" on the ends?

Well, QD lines have to do a few other things like be convertable to a
region, and handle fat pens.  Perhaps it has something to do with this?
I once did a line drawer similar to QD's, in that it had to handle both
additional operations.  I started with Bresenham's, but I had to do some
post-processing to convert the raw output into something that would work
for this.

-- 
+----------------+
! II      CCCCCC !  Jim Cathey
! II  SSSSCC     !  ISC-Bunker Ramo
! II      CC     !  TAF-C8;  Spokane, WA  99220
! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
! II      CCCCCC !  (509) 927-5757
+----------------+
			One Design to rule them all; one Design to find them.
			One Design to bring them all and in the darkness bind
			them.  In the land of Mediocrity where the PC's lie.
Newsgroups: comp.sys.mac.programmer
From: wolfmc@rtsg.mot.com (Michael Wolf)
Subject: Is there any utilities for counting NCSS in code?
Keywords: utility
Organization: Motorola Inc., Cellular Infrastructure Group
Date: Fri, 11 Dec 1992 18:32:25 GMT

Are there any utilities for doing simple metrics on code, like
number of non-commented source statements (NCSS), operands, 
operators etc.?

If so please let me know.

I do not have FTP access, so anything on the net I would have to be able
to get it via email, or from a mail file server.

Thanks.


MJW

-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
| Michael J. Wolf          | McIntosh Jr:  The power to crush the other kids|
| Software Engineer        |                                                |
| wolfmc@green.rtsg.mot.com|      Disclaimer?  Hell, I don't even know her! |
-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-

Newsgroups: comp.sys.mac.programmer
From: ksand@apple.com (Kent Sandvik )
Subject: Re: Questions about Bedrock
Date: Sun, 13 Dec 1992 00:36:15 GMT
Organization: (Evil Eye Creature from Mars, Inc.)
Followup-To: comp.sys.mac.programmer

In article <Bz04Lq.C48@cpsc.ucalgary.ca>, dupont@cpsc.ucalgary.ca (Lucien
Dupont) wrote:
> In article <ksand-071292173641@wintermute.apple.com> ksand@apple.com (Kent Sandvik ) writes:
> >Well, it's going to be many things, but we can't talk about it until
> >the final version features have been locked down. Expect Bedrock versions
> >for both m68k and PowerPC in the long term. Release date next year :-).
> >System requirements, don't know yet exactly.

> Can you mention if it's going to be in C++? (ie. Should one learn C++ now?
> I'm using Think C's object extensions, so it shouldn't be too hard I suspect)

Yes, I could mention that C++ is the preferred language. However! I don't
think
we want to lock ourselves to another language that will bet obsoleted by
the next
craze-language by the year of 1998, so expect us to make sure that for
instance
dynamic OO languages will work with Bedrock in future (isn't the word
future
a handy one?).

You shouldn't have big problems switching from Think C 5.0 C extensions
to pure C++.

Kent
-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.
Newsgroups: comp.sys.mac.programmer
From: siegel@world.std.com (Rich Siegel)
Subject: Re: External editors for THINK C
Organization: GCC Technologies
Date: Thu, 17 Dec 1992 14:46:25 GMT

In article <1992Dec17.125120.4384@alw.nih.gov> fixer@faxcsl.dcrt.nih.gov writes:
>I seem to recall that THINK C 5.0.3 and later (or is it 5.0.4?) has introduced
>some hooks for external editors to work along with it.  However, I haven't
>heard anything about the internals of this mechanism.  Does anyone have any
>real info on this?

You're mis-remembering. THINK C 5.0.3 included hooks so that utilities
such as PopupFuncs could cleanly hook into THINK C's own editor, but this
doesn't provide the ability to use a non-THINK C editor.

R.



-- 
-----------------------------------------------------------------------
Rich Siegel                              Internet: siegel@world.std.com
Senior Software Engineer
GCC Technologies
From: smsilver@coos.dartmouth.edu (Scott M. Silver)
Newsgroups: comp.sys.mac.programmer
Subject: Reading STR#
Summary: How does one read the STR#'s of unlimited length in pascal
Keywords: str# mac pascal c resource resedit
Date: 13 Dec 92 21:10:15 GMT
Organization: Dartmouth College, Hanover, NH

How do I read STR#'s (individual strings) from my resource in pascal.  I want to be able to get ones of a length bigger that 255...or somewhat unlimited ast the case may be (<32k).  I tried using GetIndString, but that seems only to allow strings of up to 255 chars...Thanks in advance.

Scott
Newsgroups: comp.sys.mac.programmer
From: white@fraser.sfu.ca (Steve White)
Subject: Duplicate Object in Think C?
Organization: Simon Fraser University, Burnaby, B.C., Canada
Date: Sat, 19 Dec 1992 01:38:40 GMT

How do you duplicate an object without knowing its class?  We would like
to write something like
 
r = duplicate( p );
 
to get an object r of the same class and attributes as p.
 
We tried to write such a thing of our own using some combination of
sizeof, memmove, and Bless, but ran into a couple of problems.
 
The Think C Class Library Manual claims that 
 
sizeof( class_name )
 
will return the size of an object in a class.  We get "illegal use of
class type" when we try to compile, e.g., 
 
sizeof( Window )
 
Is there some setting we're missing, or what?  We're running v. 5.0.4.
 
Is there some standard way of achieving the duplication of an object?
From: carlsonb@mari.acc-admin.stolaf.edu (Bradley P Carlson)
Newsgroups: comp.sys.mac.programmer
Subject: HARVEST C beginner question
Summary: Need hints from a Harvest-C user
Date: 15 Dec 92 18:27:14 GMT
Organization: St. Olaf College; Northfield, MN

I'm new to Macintosh programming, and am trying to use Harvest C
(Freeware, (c)1992 Eric Sink), which shares traits of Think C and MPW.
I've set it up (with the requisite MPW libraries) in its default
configuration: all the bundled 'example' code is in its own folder.
When I open one of these example projects, select one of its source
files and select "Compile," the compilation window opens, pauses, then
displays: 
"": O FATAL,: File not found: filename.c

Not to be daunted, I moved the example files into the main Harvest-C
folder, but compilation attempts end with:
"filename.c":8 FATAL,:Include File not found  header.h

(This seems strange because the headers are in another folder,
altogether and the compiler finds them fine when the C code is in the
"Examples" folder")

I'm sure things would begin to fall into place if I could just get
"Hello World" to compile :) .

If anyone out there uses Harvest-C, or has looked at it and it made
sense, I'd appreciate a few hints!  Grateful for anything and
everything,

Bradley Carlson -carlsonb@stolaf.edu
Newsgroups: comp.sys.mac.programmer
From: bluea@marcus.its.rpi.edu (Alan Samuel Blue)
Subject: Compact Video - Compression times
Summary: Are there reasonable ways to speed compression?
Keywords: qt1.5 supermac
Date: Thu, 17 Dec 1992 01:59:52 GMT

Is it possible to write _just_ the compression part of QT for other
platforms? I ask because the 'Compact Video' compressor is hideously
slow. It produces ver nice results - but 3hrs on a IIci for one
minute of video is too much. 

As a grad student, I have access to some nice computers - RS6000's,
 and an IBM 8090d. If possible, it would be nice to grab the 
movie on the mac, edit it, then upload it for compression.
Applying real processing power :) should help.

There is lots of sample code for movie 'editors', but I see nothing
about the actual codec's themselves - I assume they are Apple is 
keeping a tight lid on them?

As a side note - Is there anything interesting I can write to use
the AMD29000 on the 8*24GC? 


Sam Blue                         bluea@rpi.edu
Chem. Eng. Grad.
Rensselaer Polytechnic Institute