HDTenEightyP/NetNews huggingface dataset:
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Proper way to do Self-Modifying code?
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Tue, 5 Jan 1993 20:25:43 GMT

In <1993Jan5.183337.20064@gallant.apple.com> alexr@apple.com (Alexander M. Rosenberg) writes:

>Immediate move instructions are generally faster than using an address
>register. It adds up, especially when lots of small bitmaps may be necessary.

Hmm, well, I'm not convinced. Let's say you move a bitmap. Using an
address register, you will only have to change the register. For a
"compiled" bitmap, you would have to change each and every immediate
move instruction. Not to mention that immediate instructions and
longer, and thus takes more bus cycles in fetch; those bus cycles
do also compete with the cycles spent writing to VRAM. (Some slow
NuBus cards take 7 cycles for a longword write, but then fetching
an 8-byte instruction instead of a 4-byte one takes 4 extra cycles
on an LC)

It all comes out in amortized performance; if the blitting has to be
raving fast, but you have ample of time to precompute the next
image, compiled bitmaps would be OK (except they flush the cache on
040s; that's bad speed-wise) but if you have general throughput
problems, register-relative blitting is DEFINATELY the right thing
to do.

Just pass rowBytes in d0 and the address of the first pixel in
a0, and make VERY SURE that address is longword aligned or you
will suffer much more from misaligned writes than you will from
the difference in register-based and immediate addressing.
	
>The one shot compile may even be possible to do at compile time, depending on
>the way the screen bitmap is available on the target machine. The problem with

Not on the Mac, of course. However, certain other systems have
a measly register set and the screen card (note the singularis)
on a fixed address; I'm sure the timings you cite are for VGA
and not for anything flexible like the mac QD device model.

Cheers,

							/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   This signature is kept shorter than 4 lines in the interests of UseNet
   S/N ratio.
From: bredell@tdb.uu.se (Mats Bredell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Default buttons in dialogs
Date: 7 Jan 93 15:34:19 GMT
Reply-To: Mats.Bredell@udac.uu.se
Organization: Uppsala University Computing Center (UDAC)
X-Newsreader: TIN [version 1.1 PL6]

BoBolicious (bowman@reed.edu) wrote:
: In article <880840m.29.726366713@axe.acadiau.ca> 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY) writes:
: >Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
: >the number 1 button, fail to show up in my app with the heavy outline around 
: >them. What am I doing wrong?
: 
: Sounds like you're not drawing the heavy outline. ;-)
: Seriously, there's nothing I've seen anywhere that would indicate this
: happens automatically...whatever gave you that idea?
: 
: Anyhow...
: 
: There are several ways to do it.  One is to make a userItem whose sole purpose
: in life is to draw the outline whenever the dialog is updated.  Or you can
: do the simple-but-not-quite-as-kosher thing, right before you call ModalDialog:
: 
: GetDItem(theDialog,1,&DType,&DItem,&itsFrame);
: InsetRect(&itsFrame,-4,-4);
: PenSize(3,3);
: FrameRoundRect(&itsFrame,16,16);
: PenSize(1,1);
: 
: ...or something like that.  I think the 16's are "standard".

There's a toolbox call that draws the outline for the default button. I can't
remember the name, but it's in a tech note (works for system 7 only).

/Mats
-- 
Mats Bredell                                   Mats.Bredell@udac.uu.se
Uppsala University Computing Center (UDAC)     Ph:  +46 18 187817
Department of medical systems                  Fax: +46 18 187825
Sweden                                         Think straight - be gay!
Newsgroups: comp.sys.mac.programmer
Subject: Re: TextEdit Wierdness
From: misc042@cantua.canterbury.ac.nz (Mr M J Miller)
Date: Tue, 12 Jan 1993 00:41:24 GMT
Organization: University of Canterbury, Christchurch, New Zealand.
X-Newsreader: TIN [version 1.1 PL8]

Mr M J Miller (misc042@cantua.canterbury.ac.nz) wrote:
> My app has multipl windows each containing a TEdit record and a 
> verticle scroll bar. When I create a new document/window/TEdit record
> that works fine, does all the right things-Fine.
> When I create window #2 that works fine also-Great.
> When I toggle back to #1 mouse selection goes _REALLY_ wierd for #1
> -I cant even place the carat!
> However if I toggle back to #2, then #2 is still fine but #1 never
> comes right.
> This happens every time I create a new document, the document created last
> is always ok but all others wont do mouse! (but will do TEKey?!).

This has been fixed!
5 minutes after the post, I realised that I was NOT providing
TEScroll with an appropriate set port (ie not setting thecurrent
port to mycurrentwind).

Thanks all the same 
MJMiller.

Newsgroups: comp.sys.mac.programmer
From: Rick E Romkey <rer@sun1x.res.utc.com>
Subject: Creating a PREFS file...
X-Xxmessage-Id: <A7786F8654010309@cheetah.res.utc.com>
X-Xxdate: Tue, 12 Jan 93 12:52:22 GMT
Organization: United Technologies Research Center
X-Useragent: Nuntius v1.1.1d9
Date: Tue, 12 Jan 1993 17:30:35 GMT

I am trying to create a preferences file for my application
using Think C 5.0.  Unfortunately, I'm not too "up" on
creating directories and the like, so I dunno what to do.
  
How do I create a direcotry and related files within the
preferences folder?  Also, is there a particular file TYPE
that a PREFS file should be (so that I can associate my
FREF and BNDL's properly)?

I basically wanna create the directory, "myDirectory"
and several files within it (like below).

1)    System Folder:Preferences:myDirectory
2)    System Folder:Preferences:myDirectory::file1
3)    System Folder:Preferences:myDirectory::file2
etc...

Any help (through email if you could....) would be
appreciated!

Rick.
From: mellon@ncd.com (Ted Lemon)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Stallman and friends
Date: 12 Jan 93 00:17:00 GMT
	<MELLON.93Jan7170831@pepper.ncd.com>
	<1993Jan08.225711.1785@eng.umd.edu>
	<ray-080193210004@bear.dfrf.nasa.gov>
Followup-To: comp.sys.mac.programmer
Organization: Network Computing Devices, Inc.
In-reply-to: ray@xrt.dfrf.nasa.gov's message of 9 Jan 93 06:27:45 GMT


>Competition improves the breed.  (I, at least, take that as a given.)

Evolution results in the emergence of things that are more fit than
what they replace.   Competition is an inefficient form of evolution -
basically, rather than taking the genes of two individuals and
selecting the best traits from each, you observe the traits of an
individual, postulate ways in which it could be improved, and develop
a complete new genetic code for the new individual that you wish to
create.   Call it Revolution.

GCC may indeed be due for a revolution - things are getting pretty
cumbersome internally.   However, you have to admit that making
incremental changes to an existing product is often cheaper than
rewriting it from scratch.   Certainly, a lot of hardware
manufacturers have believed this to be true in the case of gcc.

GCC evolves quickly because the source code is freely available.  If
it were a closed system, it would probably only be producing VAX code
right now.  The fact is that in many ways, this method of software
development is inherently quicker than development in a closed system.
Many of those of us who support the efforts of the FSF do so because
we're tired of reinventing the wheel and would like to get on to
inventing new things.

Another facet of this is that I would rather have a free Unix
implementation than a vendor-provided implementation, because vendors
have shown themselves to be uniformly incapable of producing anything
stable and functional.   If I have the source, and something about it
bugs me, I can fix it.   The end-user who doesn't want to have to
tweak things can purchase the service from somebody who does want to.

			       _MelloN_
--
mellon@ncd.com						uunet!lupine!mellon
Member of the League for Programming Freedom.   To find out how software
patents may cost you your right to program, contact lpf@uunet.uu.net
From: chris_russo@gateway.qm.apple.com (Christopher Russo)
Newsgroups: comp.sys.mac.programmer
Subject: Re: (Q) Need bit manipulation algorithm
Date: 11 Jan 93 21:29:10 GMT
Organization: Apple

In article <1993Jan08.012806.14863@eng.umd.edu> Matthew T.
Russotto, 
russotto@eng.umd.edu writes:
>>There is a neat trick for counting the number of bits in a
word that
>>a Microsoft geek showed me one time.  If there are k bits
with 1's,
>>it runs in O(k) time.

I learned a cool way in an interview here at Apple.  For the
number of 
bits in a byte, all you'd need is a 256 byte look-up table
where the 
index designated by, say, 00001010 would be index $A into the
table which 
would contain the number 2 (that you put there.)  It's pretty
fast.
-----Christopher Russo
----- I admire a clever .sig message.  Wish I had one. <sigh>
----- day 408.974.6070
Newsgroups: comp.sys.mac.programmer
From: petrick@dms.agames.com (Jim Petrick)
Subject: Re: Default buttons in dialogs
Organization: Atari Games Corporation
Date: Tue, 12 Jan 1993 04:00:47 GMT

In article <880840m.29.726366713@axe.acadiau.ca> 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY) writes:
>
>Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
>the number 1 button, fail to show up in my app with the heavy outline around 
>them. What am I doing wrong?

From the back of MacTutor V8 No.1 Apr/May '92 (tip of the month):

In System 7, there are 3 toolbox traps not in the Think C interfaces.

pascal OSErr SetDialogDefaultItem( DialogPtr dlog, short item ) =
	{0x303C, 0x0304, 0xAA68};

pascal OSErr SetDialogCancelItem( DialogPtr dlog, short item ) =
	{0x303C, 0x0305, 0xAA68};

pascal OSErr SetDialogTracksCursor( DialogPtr dlog, Boolean tracks ) =
	{0x303C, 0x0306, 0xAA68};


SetDialogDefaultItem	- Specifies the default item for a dialog AND
			  ensures a thick round rect around the button.

SetDialogCancelItem	- Ties item to the Command-Period key sequence.

SetDialogTracksCursor	- Tells Dialog Manager to use the I-beam cursor
			  when cursor enters an editable text field.


The first may be of some help to you.
-- 
===========================================================================
Atari Games Corp.                            -- jim petrick
Milpitas, Ca                                    petrick@agcvax.agames.com
Newsgroups: comp.sys.mac.programmer
From: davea@xetron.com (Dave Alverson)
Subject: Re: Communications Programming on the Mac
Organization: Xetron Corporation, Cincinnati, Ohio
Distribution: usa
Date: Wed, 13 Jan 1993 00:17:52 GMT

In article <1993Jan12.042700.3993@midway.uchicago.edu> kat6@midway.uchicago.edu writes:
>trouble getting a file to transfer. I've looked for books on the subject,
>but haven't found any. Does anyone know of any books that would help, or,
>preferrably, does anyone have any sample source code for transferring a text
>file on a mac through a modem? Thanks a lot.
>

Check out "C Programmers Guide to Serial Communications" by Joe Campbell.  It
is published by Howard Sams & Co.  It is pretty good, although it has
pretty much an IBM-PC perspective when it gets to hardware details.

  -- Dave


-- 
Z    Dave Alverson,  davea@xetron.com
Newsgroups: comp.sys.mac.programmer
From: fieldd@cuug.ab.ca (Dan Field (@Eucart Consulting Inc) 239-3958)
Subject: Think C linker bug
Organization: Calgary UNIX User's Group
Date: Sun, 3 Jan 1993 21:24:36 GMT

I'm (attempting) to build a 2-segment code resource (an XCMD)
using Think C 5.0.4 on a IIsi.  The link phase hangs the machine
intermittently with the "Linking <filename>" banner on the screen.
Sometimes, it doesn't hang, but then doesn't replace the code
resources in the output file.  Sometimes it doesn't hang, writes
the resources, but the code doesn't work properly (this latter
case could by my own bug, but I haven't been given a chance to
find out for sure).  Has anyone seen this?  If so, is there a
workaround?  Thanks in advance.


    Dan Field
    fieldd@sun.cuug.ab.ca
Newsgroups: comp.sys.mac.programmer
From: kcompute@rock.concert.net (Kevin P Dankwardt -- K Computing)
Subject: Custom Controls
Organization: CONCERT-CONNECT -- Public Access UNIX
Date: Wed, 6 Jan 1993 22:09:27 GMT

Help! Does anyone know of some sample code that incorporates some
custom controls? It appears that all of the reference books merely
touch on the subject (even Apple's Inside Macintosh).

I will be grateful for any leads and I will summarize to the net any
information I receive. 

Please send me e-mail directly:
kcompute@rock.concert.net

thanks in advance, kevin dankwardt
From: alexr@apple.com (Alexander M. Rosenberg)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Proper way to do Self-Modifying code?
Date: 5 Jan 93 18:33:37 GMT
Organization: Hackers Anonymous

In article <1993Jan4.120353.16699@kth.se> Jon Wltte, d88-jwa@dront.nada.kth.se
writes:
> However, I think you could write the code quite conflict-free
> and as fast using just address-register-relative addressing
> and maybe a data register for rowBytes. Modifying the instructions
> data takes time to do; I think using a register pair would be
> FASTER - and more compatible.

Immediate moved bitmaps are _much_ faster than those drawn via table lookups.
This is a technique that they call "Compiled Bitmaps" in rec.games.programmer.
Immediate move instructions are generally faster than using an address
register. It adds up, especially when lots of small bitmaps may be necessary.

The one shot compile may even be possible to do at compile time, depending on
the way the screen bitmap is available on the target machine. The problem with
compiled bitmaps is that they typically are double in size over the plan data,
which is why Andy would want to compile them when the game is launched.
Several games take a long time to start up, like Maelstrom (although this is
probably because Maelstrom keeps all it's sprite data as icl8 resources, and
loading, locking, and detaching that many resources takes time).
---------------------------------------------------------------------------
-  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.       -             -
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: Setting Default Directory
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 6 Jan 1993 14:58:00 GMT

In <1iejtiINN8no@rave.larc.nasa.gov> wjb@cscsun2.larc.nasa.gov (William J. Bene) writes:

>Given the following FSSpec record:

>How can I set the default directory to FSSpec.name?  In other words, I have a 

It's a bad idea.

Anyway, get the dirID of the directory, using PBGetCatInfo,
and then call HSetVol. Leaving HSetVol is dangerous. Try:

	HGetVol ( old )
	HSetVol ( new )
	OpenStuff ( )
	HSetVol ( old )

Then you can of course use the opened stuff.

Cheers,

						/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
Newsgroups: comp.sys.mac.programmer
From: walrath@faw.uni-ulm.de (Wayne K. Walrath)
Subject: Interpreting MacPaint format
Organization: FAW (Research Institute For Applied Knowledge Processing, Ulm, Germany)
Date: Tue, 12 Jan 1993 09:04:45 GMT

I would like to be able to read and display MacPaint format files,
is this a known format? Can anyone tell me what's involved or explain the
data structures?

Thanks,
-wayne
walrath@faw.uni-ulm.de

-- 
Newsgroups: comp.sys.mac.programmer,comp.os.ms-windows.programmer.tools,comp.windows.ms.programmer
From: ipser@solomon.technet.sg (Ed Ipser)
Subject: Re: Stallman and friends
Organization: TECHNET, Singapore
Date: Wed, 6 Jan 1993 06:38:42 GMT

In article <D2150035.mtvsj2@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
>I just wanted to thank the large number of folks who sent me email
>on this subject.  It's nice to know there are lots of us who think
>Stallman is a kook.

I don't believe that it is fair or accurate to describe Stallman as a mere
kook. If you strip away the leftist rhetoric and the "tax them to subsidize
us" drivel, you will find a very sound business idea. In essence, what 
Stallman et alia are doing is charging computer manufactureres for the
privalege of having GNU software on their platforms which they then distribute
for "free". This is no more kooky than "free" tv which charges advertisers
instead of viewers. And so long as GNUs relationship with the computer
manufacturers remains one of commerce, only, we should all be grateful for
the additional alternative his participation in the market provides us.
From: Chris Johnson <chrisj@emx.cc.utexas.edu>
Newsgroups: comp.sys.mac.programmer
Subject: Re: Why does BinHex exist?
Date: 7 Jan 1993 22:57:24 GMT
Organization: University of Texas at Austin Computation Center
Distribution: world
NNTP-Posting-Host: gargravarr.cc.utexas.edu
X-UserAgent: Nuntius v1.1.1d16
X-XXMessage-ID: <A7720C9F2C01BE1F@gargravarr.cc.utexas.edu>
X-XXDate: Thu, 7 Jan 93 22:36:47 GMT


In article <1993Jan7.215843.3868@reed.edu> BoBolicious, bowman@reed.edu
writes:
>Mail on the internet, at least in the u.s., can only handle 7-bit bytes.
>Binhex converts 8 bit bytes to 7 bit bytes.  Thus it makes the files 
>slightly larger...in principle, 1/8 bigger.

Quibbles: BinHex 4.0 actually encodes in a 6 bit format, where all the 
characters are relatively standard and should map into alternate 
character sets (like EBCDIC) and back without error. The characters 
used by BinHex to represent its 6 bit bytes are as follows (in order):

    !"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr

So, in principle, we're looking at a 2/8 increase in size. However, 
BinHex includes a run-length encoding scheme which can help trim a bit
off the ultimate size of encoded files. Unfortunately, most BinHex
encoders don't appear to support this feature. (I noticed this when I
implemented one that *did* a while back.) Note that the run-length 
encoding is most useful when the file being encoded is NOT already
compressed. It doesn't help much (but it does help a little) with most
compressed archive files.

As to comments made by others that BinHex is a pain to deal with, two
points: (1) depending on what you're trying to do, binary is unusable,
so there are time when you just have to have something like BinHex, 
and (2) I'd suggest getting a communications program that decodes 
BinHex files on-the-fly during the download. Use one of those, and 
you'll never have to see another BinHex file. Most ftp clients for the 
Mac (XferIt, Fetch, etc.) provide this on-the-fly decoding.


Chris Johnson

Internet:   chrisj@emx.cc.utexas.edu
UUCP:       {husc6|uunet}!cs.utexas.edu!ut-emx!chrisj
BITNET:     chrisj@utxvm.bitnet
CompuServe: >INTERNET:chrisj@emx.cc.utexas.edu
AppleLink:  chrisj@emx.cc.utexas.edu@internet#
From: caruso@gbi01.enet.dec.com (Angelo Caruso)
Subject: Re: How to find fRefNum?
Organization: Digital Equipment Corporation
Date: Mon, 4 Jan 1993 22:37:53 GMT


In article <1993Jan4.175435.5894@nosc.mil>, frantzen@nosc.mil (Louise E. Frantzen) writes...
> 
>Hello everyone, 
> 
>Could someone please tell me exactly what an fRefNum is and how one
>obtains this mysterious number? I am looking at Inside Mac VI page 22-100
>at the SetupAIFFHeader call whose first argument is an fRefNum.  I have 
>looked through all the Inside Macs I can get my hands on and can't find
......

Well, I am really glad you asked a question I can answer 8-). fRefNum is
returned by any call used to open a file. I use HOpenDF/HOpenRF, there are
other.

Enjoy , Angelo.

P.S. If I understand IM IV (it isn't always the case...) you have to open a
file for writing and then SetupAIFFHeader, given the file reference of that
file, writes the right header for you.
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How does my app know that its document was double clicked?
Date: 4 Jan 93 11:32:12 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <C04pu0.I5B@netnews.jhuapl.edu> jensen@aplcomm.jhuapl.edu (Robert Jensen) writes:

>I wrote an application, defined document types, and I can double click on 
>a document created by the application and cause the application to be
>launched.  How does the application know to open the double-clicked 
>document?  I really did study Inside Macintosh, but couldn't figure this 
>out.  Thanks for any hints.

Under SYstem 6, you'll have to call CountAppParams() and GetAppParams()
(It's in Inside Mac II)

Under system 7, you get 'oapp' and/or 'odoc' AppleEvents.

Cheers,

						/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

 -- I don't fear death, it's dying that scares me.
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Alert Help
Date: 12 Jan 1993 09:43:13 -0600
Organization: National Instruments, Austin, TX
Distribution: world
NNTP-Posting-Host: falcon.natinst.com

In article <1993Jan12.002334.330@physc1.byu.edu> seth@physc1.byu.edu writes:

>tried yet - I tried renumbering the items. I made my button item #1, and, you
>guessed it, this time the buttin was surrounded by the "default" rectangle.
...
>BUT, this does bring up a couple of new questions. Within the last few weeks I
>seem to remember a guy asking why he couldn't get a default button surrounded
>autonatically by the "default" round-corner rectangle. Someone said that this
>was not autonatic, and discussed ways of doing this. On my machine with THINK
>Pascal it DOES seem to be automatic. Also, why didn't this show up in ResEdit?
...
>Seth Leigh
>BYU Physics Dept.

Item #1 gets framed automatically in Alerts but NOT in Dialogs.  ResEdit
doesn't show the frame because it's not really displaying your Alert but
rather "faking" it's final appearance.  I use Resorcerer and it will show
the border around item #1 in an alert; it will also draw the appropriate
icon in a Stop, Note, or Caution alert.
BTW, Resorcerer has en excellent dialog editor that even lets you preview
list items.  It will also generate C code for your dialog, including framing
the OK button and dealing with lists and radio button groups.

	- Stepan

-- 
   Stepan Riha -- stepan@natinst.com
From: cahan@bigboy (Denny Cahan)
Newsgroups: comp.sys.mac.programmer
Subject: Think Ref 2.0
Date: 7 Jan 93 19:34:26 GMT
Organization: Temple University

I just received an upgrade offer for think reference from Symantec. Has
anyone actually purchased the upgrade? (at a hefty $39 for volume 6).
Does it contain all the calls for Quicktime? I am kinda stuck trying to
decompress some images and this would be really hepful. Just wondering.

Denny
cahan@bigboy.cis.temple.edu
From: bowden@csd4.csd.uwm.edu (Have you kissed your Quadra today?)
Newsgroups: comp.sys.mac.programmer
Subject: What's the best assembly lang guide for 680[20|30|40]?
Date: 8 Jan 1993 19:28:17 GMT
Organization: The World Wrestling Federation
Distribution: world
NNTP-Posting-Host: 129.89.7.4
Keywords: opcodes and more opcodes
Originator: bowden@csd4.csd.uwm.edu

Hiya,

 I was wondering what the best machine/assembly language manual
is for the various Motorola CPUs.  I've got MPW coming and I doubt
that the assembler will come with one.  It would be nice if the manual
covered the FPU also. :)

Mucous gratuitous,
John

Newsgroups: comp.sys.mac.programmer