HDTenEightyP/NetNews huggingface dataset:
From: merrick@aic.lockheed.com (Darrell Merrick)
Newsgroups: comp.sys.mac.programmer
Subject: Re: AIFF and 'extended' type
Date: 18 Aug 92 15:59:02 GMT
Organization: Lockheed Artificial Intelligence Center

In article <1992Aug17.204116.11424@nosc.mil>, frantzen@nosc.mil (Louise E. Frantzen) writes:
> 
> I have a question regarding the AIFF file format and the 'extended' type
> which is used for the SampleRate.  I am using THINK C 5.0.  I have been
> studying the info on AIFF in IM Vol VI and am stumped on this one.  On 
> page 22-49 of IM VI, in listing 22-13, the hex value "400DADDD1745D145826B"
> is given as "AIFFSampleRate (22kHz in extended type)".  I have looked through
> Types.h and do not understand how the above hex value translates into the
> sample rate of 22254.5455 Hz.  If anyone can give me some direction on how
> to understand this or tell me what other documentation to look at I would
> be very appreciative.
> 

I usually try to avoid dealing with such data types (Fixed, extended, etc) 
directly and use conversion functions instead.  For AIFF files you can define 
sampleRate as a long and use the Long2Fix function to convert it within the 
SetupAIFFHeader call (the SetupAIFFHeader function is looking for a sample 
rate of type Fixed):

#include <SoundInput.h>
#include <AIFF.h>
#include <FixMath.h>

long sampleRate = 44100;
oSError = SetupAIFFHeader(file, numChannels, Long2Fix(sampleRate), sampleSize, NoneType, 
           				  soundSize, numFrames);


Also, if you want to know the low-level details of handling extended and Fixed data 
types, the Apple Numerics manual covers such things.
From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Creating background tasks (HELP!).
Date: 14 Aug 92 12:32:58 GMT
Followup-To: comp.sys.mac.programmer
Organization: MSD

In article <1992Aug13.170029.3055@qiclab.scn.rain.com>,
baer@qiclab.scn.rain.com (Ken Baer) wrote:
> 
> OK, first of all, I do realize that the Mac OS does not yet support real
> Multitasking (nor does MS Windows). But, I keep hearing about certain
> applications or inits that allow programs to run in the background (like
> the one that allows Think C to compile in the background).  What I want
> to do is allow our 3D rendering software to render in the background to
> the user can use the modeller etc. while rendering.  Could someone either
> post, or point me to some documented code to set this up?  What are the
> limits and conditions to this?  We are already doing this under Windows,
> so I imagine a similar process should be possible on the Mac.
> 
> Any and all related information will be greatly appreciated.
     
	    Well, what you're really seeing is applications that can do tasks in
the background.  When the front application doesn't have pending events and
it calls WaitNextEvent background applications get time - that is, if the
frontmost application is well-behaved (please, gurus, correct me if I
misspeak!)

What you want to to is bone up (i.e., read Inside Mac) on the Event Manager
(maybe?) and see how applications that are not in the foreground get time. 
Then you need to structure your rendering task so it can be done in small
chunks, because it would not be polite for a background task to grab the
computer and not let go (cf PrintMonitor!).  Once you set up your renderer
this way, it needs to be on the lookout for those events that apps get when
they're in the background, and do some rendering then.  It's easy to talk
about, but, I believe, difficult to achieve in practice!


chuck

|- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
|- National Library of Medicine - National Institutes of Health --|
|- Bethesda, MD 20894 -  !aixelsyd evah uoy siht daer nac uoy fI -|
|- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
From: Daryl_Spitzer@mindlink.bc.ca (Daryl Spitzer)
Newsgroups: comp.sys.mac.programmer
Subject: DeleteMenu doesn't work
Date: 22 Aug 92 17:20:34 GMT
Organization: MIND LINK! - British Columbia, Canada
Distribution: world

I'm trying to have a menu appear in the menu bar when a certain window is
active, and disappear when anything else is.  But I can seems to remove the
menu from the bar.  After lots of fiddling I finally tried stepping through
this:

{
        MenuHandle hMenu = NULL;

        hMenu = GetMenu( 901 );
        InsertMenu( hMenu, 0 );
        DrawMenuBar();
        DeleteMenu( 901 );
        DrawMenuBar();
}

Everything works fine, except the menu is still there when the menu bar is
drawn after DeleteMenu.  Inside Macintosh (volumes I & IV) don't have much
to say about it.  I'm stumped.

Should I try tracing throgh DeleteMenu with MacsBug?  I'm not sure
I'd recognize what I find there anyway.

I suppose I could use GetMenuBar & SetMenuBar, but since I'm using the THINK
Class Library (which uses DeleteMenu) it would be a lot of work.

--
-------------------------------------------------------------------
 Daryl_Spitzer@mindlink.bc.ca     "Life isn't just, life just is."
         a2251@mindlink.bc.ca              -- Me  (I think.)
-------------------------------------------------------------------
Xref: sparky comp.sys.mac.programmer:14268 misc.education:3168 soc.college:3651
From: solman@athena.mit.edu (Jason W Solinsky)
Newsgroups: comp.sys.mac.programmer,misc.education,soc.college
Subject: Re: Computer Science Programs
Date: 20 Aug 92 14:15:41 GMT
Organization: Massachusetts Institute of Technology

In article <1992Aug19.195612.5537@src.umd.edu>, tedwards@src.umd.edu (Thomas Grant Edwards) writes:
|> In article <ELM.92Aug15022615@terrorism.berkeley.edu> elm@cs.berkeley.edu writes:
|> >In article <1992Aug14.230223.17066@athena.mit.edu> solman@athena.mit.edu (Jason W Solinsky) writes:
|> >=>If you plan on going to graduate school in CS, go to (in order) MIT,
|> >=>Stanford, CMU, UCB, or the University of Illinois at Urbana or don't
|> >=>think of it. Anything less than a good GPA and great recomendations
|> >=>from a second tier CS school (Ivy League, Caltech) and you probaly
|> >=>won't make it. If you're from a third tier school, forget it.
|> 
|> Of course, something else to consider is not only the quality of the
|> theoretic education you get, but the amount of hands-on experience w.
|> computer systems and research you get.  While alot of people will 
|> consider undergraduate research as an unneccessary part of an education,
|> the reality is that when you go looking for a job out of college
|> w. no experience, you'll be in worse shape than someone who went to
|> a slightly lesser-tier school (such as Johns Hopkins) but actually
|> got to work w. a professor on a serious research project.

I should note then that the primary advantage that MIT has amongst the
undergraduate schools is that it blows away all the others on this last
point. That was, in fact, the deciding point when I decided to come here.

Jason W. Solinsky
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon W{tte)
Subject: Re: HELP: how can I ...
Originator: d88-jwa@dront.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Fri, 21 Aug 1992 16:57:25 GMT

> cchen@silver.ucs.indiana.edu writes:

   I am new to this THINK C programming stuff and I have two questions
   that might be obvious to some of you seasoned MAC programmers:

   1. How can I find out what kind of video card is installed through my
      program?

"What kind" !? What if there are several video cards? No card?
Internal video? Multiple screens?

Maybe you mean what kinds of bit depths the attached screens
have? Look in Inside Mac VI; it has a fairly good explanation.
IM V also goes on about the same info. Beware; the user may
change bit-depth at any time; if you write directly to screen,
be sure to take that into account.

If you want to simply list "Card XXX installed" try:
1) If color QD is not available, it's internal to the machine.
2) If color QD _is_ available, loop through all screens/devices,
   and check the slot info there, then query the slot.

   2. How can an application getthe document name/path through which the
      application is invoked?

I posted on this yesterday...

Immediately after startup:

	short refNum = CurResFile ( ) ;
	PBHGetFCBInfo ( .... using refNum .... ) ;

This will give you the name, the vRefNum and dirID to the
current resource file, which happens to be the application
at startup. Use HOpenDF to open the applications data fork
using this info.

-- 
- I have decided that it is not boxes but my lack of skill that's the problem.
- Traitor! This kind of attitude will get you nowhere around here. If you must
  know, it's not your boxes that are the problem, it's your lack of a
  sufficient number of boxes. Go out and buy something.
From: mlanett@Apple.COM (Mark Lanett)
Newsgroups: comp.sys.mac.programmer
Subject: Re: how many monitors? (FAQ?)
Date: 20 Aug 92 04:31:57 GMT
Distribution: na
Organization: Apple Computer Inc., Cupertino, CA

stern6@husc10.harvard.edu (Michael Stern) writes:

>How do I determine how many monitors are hooked up at any given time?
>As a bonus question, how do I determine the size, bit depth, etc. of
>monitors other than the 'main' one?

Take a look at GetDeviceList, GetMainDevice, and TestDeviceAttribute, all in
IM V.
-- 
Have a bajillion brilliant Jobsian lithium licks.
Mark Lanett, NOT speaking for anyone. Personal opinion only.
From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Weird Quickdraw Bug w/ Geneva
Date: 19 Aug 92 10:13:17 +1200
Organization: University of Waikato, Hamilton, New Zealand

In article <1992Aug18.202015.13117@hobbes.kzoo.edu>, k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
> cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) writes:
>>k044477@hobbes.kzoo.edu (Jamie R. McCarthy) wrote:
>>>
>>> cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) writes:
>>> >
>>> >When 9 pt. Geneva is used, the text comes out as a
>>> >VERY pale yellow (instead of the expected black).
>>>
>>> Sounds like you're messing with the screen's color table, and not
>>> letting the system know that you're doing it.
>>> Theoretically, there's no way you can do this :-) if you're using the
>>> Palette Manager exclusively...
>>
>>OK, that makes sense. I am certainly NOT doing it on purpose. The only
>>color environment changes I THINK I'm making involve getting the palette
>>associated with a window and using SetPalette to assign the same palette to
>>several other windows (but not the one with the problem).
>
> Hmmm.  This may be bad;  I've never seen a prohibition against having
> the same palette accessed by more than one window, but I've never seen
> anything allowing it either.

As I recall, the capability to share a palette among multiple windows was
added in System 6.0.2. Or possibly 6.0. It is explicitly allowed in the
section titled "Associating One Palette With Many Ports" on page 20-18 of
IM6.

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
Newsgroups: comp.sys.mac.programmer
From: fchen@phoenix.Princeton.EDU (Franklin M. Chen)
Subject: Novice to C seeking code
Originator: news@nimaster
Organization: Princeton University
Date: Wed, 19 Aug 1992 18:19:54 GMT

I recently started to learn C on the Macintosh (with THINK C) and I came
across informative-seeming articles on programming in old issues of
_MacUser_, featuring a generic application shell (May-July 1990?).  I
found the source code for the first installment of the series at an ftp
site, but the rest of it isn't there.  Does anyone have the complete
source code for _MacUser_'s "GenApp"?

	Franklin Chen
	fchen@phoenix.princeton.edu

P.S. Please reply by email if possible, as I do not read this newsgroup.

Newsgroups: comp.sys.mac.programmer
From: ely@norton.com (Dave Ely)
Subject: Re: MacsBug symbols from assembler code?
Organization: Symantec / Peter Norton
Date: Sat, 22 Aug 1992 02:47:24 GMT

datpete@daimi.aau.dk (Peter Andersen) writes:

 > How do I make a (global) symbol known to MacsBug? I have tried
 > adding 
 > 
 >    DC.B $8C, 'MySymbol' 
 >    DC.W $0000 
 > 
 > after the last RTS in the code of the procedure, as described in the
 > MacsBug manual (Appendix G, p.118, MacsBug version 6.1 manual), but
 > the symbol is not known to MacsBug, when I try to debug the code. 
 > 
 > I am using MPW 3.2.2, System 7.0.1 (US), MacsBug version 6.2b2 on a
 > Macintosh IIx.

You need something like this:

   DC.B $8C, 'MySymbol'
   dc.b $0
   DC.W $0000

The MacsBug symbol has to be padded to an even word length so that the
data length offset (DC.W $0000) is on an even address. There is a
macro which comes with the samples for for the MPW assembler which
shows how to create MacsBug strings. I think it's called DbgStr.

-- 
 ______________________________________________________________
    Dave Ely          \   Internet:  david_ely@qm.norton.com
    Symantec Corp.     \             ely@norton.com
    Peter Norton Group  \ AppleLink: Ely.D
From: jgreene@Bonnie.ICS.UCI.EDU (Kevin Greene)
Subject: HELP with palette rotation....
Newsgroups: comp.sys.mac.programmer
Date: 14 Aug 92 02:11:55 GMT

Could someone please email me info and/or code to help me with doing
palette rotation.... After looking through the inside mac stuff, I still
can't get palette rotation to work using animate palette calls or just
set palette calls...
(If possible Think C code is appreciated).

Thanks

Kevin

Newsgroups: comp.sys.mac.programmer,comp.sys.mac.system
From: bpb9204@tamsun.tamu.edu (Brent)
Subject: Re: Need desperate help !
Organization: Texas A&M Univ., Inc.
Distribution: na
Date: Wed, 12 Aug 1992 22:24:07 GMT

bpb9204@tamsun.tamu.edu (Brent) writes:
|andyp@treehouse.UUCP (Andy Peterman) writes:
||In article <1992Aug9.122506.7454@jarvis.csri.toronto.edu>
||parki@csri.toronto.edu (Brian Parkinson) writes:
||>
||>The result is about 8500 (give or take).  So, in one second, my
||>Mac can only count to 8500 ?????????
||
||Here's the result of the above code on a Quadra 700 (68040 @ 25 Mhz):
||
||Without direct FPU calls: 184055
||With direct FPU calls (-mc68881 compiler flag): 1667404
|
|Mac Plus:
|value of fx : 1924.000000      (improvement of about (1924-1840)/1840 = 5%)
|value of dx : 162908   (integer)

I just ran that on my new IIsi and the figures are:
10850  (for floating point -- double long)
1360000+ (for long integers)

-Brent
From: daven@notable.com (Dave Newman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Storing a reference to a file ..
Date: Mon, 17 Aug 92 18:06:05 PST
Organization: Notable Technologies, Inc.
Reply-To: daven@notable.com
X-Mailer: uAccess LITE - Macintosh Release: 1.5v4


In article <5222@krafla.rhi.hi.is> (comp.sys.mac.programmer), rson@rhi.hi.is (Reynir Hugason) writes:
| Ok here is the scenario: I have a project file. I want to store from within
| the project file, which files are included in the project and some info
| about each file. Presently I simply take the FSSpec and save it; however,
| this is not suffiecent. What happens is that my program cant find files
| if I start up from another disk. The only solution I can imagine is to
| store the volume name and perhaps creation date of the volume as well ANDOR
| use these file id things.
| 
| How would you do it?

As someone else noted, you can save aliases to the files. That doesn't work
so well if you're going to sell into the population of Macs that don't run
System 7. In that case, your suggest should work fairly well (FSSpec, vol
name and vol creation date&time)

BTW - System 6 and older doesn't have FSSpecs, but it's not hard to gather
up all the info that goes into an FSSpec using the older file system calls.

--Dave

-----------------------------------------------------------
Dave Newman                 |  AOL:      AFC Tinman
Artillery Spotter           |  ALink:    TINMAN
Notable Technologies, Inc.  |  CIS:      70743,3323
Voice:    510.208.4449      |  internet: daven@notable.com
FAX:      510.444.4493      |  
-----------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: Re: Need public domain preprocessor & compiler
Organization: Iowa State University, Ames, IA
Date: Thu, 13 Aug 1992 13:26:50 GMT

In article <1992Aug12.082744.2799@aston.ac.uk> barretpj@uhura.aston.ac.uk (Phil J Barrett) writes:
>>I don't have MPW so I can't use the gnu tool version that
>>is supposed to exist
>
>Where? Anyone know anything about this?
>
>I don't want to miss any positive info on this, so if you have any, please
>mail me at barretpj@uhura.aston.ac.uk as well as posting here!
>

If you want the MPW version you could probably find it by ftp'ing to
ftp.apple.com.

If  you want the original version (for unix machines) to hack out yourself,
you might want wuarchive.wustl.edu.

ftp <address>
username: anonymous
passwrod: username@xxx.xxx.xx



-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50010                                snail: 272 Durham 
Newsgroups: comp.sys.mac.programmer
From: barretpj@uhura.aston.ac.uk (Phil J Barrett)
Subject: Re: Need public domain preprocessor & compiler
Organization: Aston University
Date: Wed, 12 Aug 1992 08:27:44 GMT

>I don't have MPW so I can't use the gnu tool version that
>is supposed to exist

Where? Anyone know anything about this?

I don't want to miss any positive info on this, so if you have any, please
mail me at barretpj@uhura.aston.ac.uk as well as posting here!

Phil Barrett
Aston University
Birmingham, UK
From: u_banzai@mcl.ucsb.edu (Marc Tamsky)
Newsgroups: comp.sys.mac.programmer
Subject: Re: reverse video mode?
Date: 23 Aug 92 10:38:12 GMT
Organization: Banzai Institute for Strageic Information & Biomedical Engineering
NNTP-Posting-Host: dial-slip18.ucsd.edu
X-UserAgent: Nuntius v1.1.1d7
X-XXMessage-ID: <A6BCB7EB39020B12@dial-slip18.ucsd.edu>
X-XXDate: Sun, 23 Aug 92 03:35:07 GMT

Well I know that Connectix Powerbook Utilites (CPU) has a "Backlight Saver"
that does exactly what we are looking for.

I can activate it with the hotkey, and it reverses the screen, and everything
that updates, like clocks and things like that get updated correctly
(reversed).

So this looks like it does everything right.  Now to figure out how they did
it.

----------
u_banzai@mcl.ucsb.edu    	  KB6JWE		 Marc Tamsky

In New Salem, ND stands the worlds largest Holstein Cow.
12000#, 38' H, 50' L.....	it's fiberglass!
Newsgroups: comp.sys.mac.programmer
From: Michael F. Kamprath <kamprath@caen.engin.umich.edu>
Subject: Re: THINK Debugger Question
Date: Tue, 18 Aug 92 04:40:08 EDT
Organization: University of Michigan, Aerospace Engineering
X-Useragent: Nuntius v1.1.1d5
X-Xxdate: Tue, 18 Aug 92 04:40:25 GMT

In article <sqd-pmB@engin.umich.edu> Michael F. Kamprath, kamprath@caen.engin.umich.edu
writes:
>In article <71221@apple.Apple.COM> Martin Minow, minow@Apple.COM writes:
>>steve.herman%express@freedom.msfc.nasa.gov (Steve Herman) notes that
>>his application never gets an open document apple event when running
>>under the Think C debugger. When you run under the debugger, your
>>application does not have its own signature, but (if I remember correctly),
>>uses 'KAHL'. Frontier has a work-around for this. If I were you, I'd assume
>>that TCL handles the four required AppleEvents correctly, assuming, of course,
>>that you set the SIZE flags correctly in the project type dialog, and
>>make sure the rest of your program works correctly.
>>
>
>I really don't think this would matter unless you are sending custom AEs 
>manually from another program.  The standard AE's sent by the system 
>automatically use KAHL as the program signature.  
>


OOPS!  I just remebered, OAPP != ODOC and so their will be a problem. 
Silly me.  But the rest of my post still applies.  Maybe, though, a quick
fix would be to use ResEdit to chang the creator type of the file you
wish to open by your program while running w/ Think C to KAHL.  Just
a thought, not tried or tested :-)


========================================================================
| Michael F. Kamprath           | The University of Michigan           |
| kamprath@caen.engin.umich.edu | Department of Aerospace Engineering  |
|-------------------------------+--------------------------------------+
|       And if a man can't change the world these days,                |
|       I still believe he can change his own destiny.                 |
|                                 --Michael Peters (The Alarm)         |
|                                   "The Spirit of '76"                |
========================================================================
From: de19@umail.umd.edu (Dana S Emery)
Newsgroups: comp.sys.mac.programmer
Subject: Re: FlushEvents necessary? (was: Re: Toolbox init)
Date: 20 Aug 92 09:22:02 GMT
Followup-To: comp.sys.mac.programmer
Organization: Personal

If ones application interpretes key events in a way that make blind type
ahead a dangerous option, then by all means flush away.  

scenario: The user mouses into a file icon file name, intending to correct
it, but instead his mouse button stutters, and accidentally launches the
file.  Since the poor fool might have been simultaneously typing with the
left hand, the characters typed will end up misconstrued.

For most programs, this would not be any problem, but text mungers which
retain the previous selection context (Nisus, MPW shell) would respond by
supplanting the selected text with the type ahead.  If the type ahead
included a fat-fingered command-s, poof, instant lost data.

Also, the user is now pissed at himself, and is likely to be in a
dangerously energetic mood, where self destructive behaviour might occur,
(ie, quit w/ reflexive save changed).

Yes, virginia, in my experience since 1968, it has even happened to me.
--

Dana S Emery <de19@umail.umd.edu>
Organization: Materials Science and Engineering, Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.sys.mac.programmer
Date: Fri, 14 Aug 1992 10:23:45 -0400 
From: James William Stepanek <js43+@andrew.cmu.edu>
Subject: Color Pascal programming

I have been trying to make a program which shows 256 color graphics using
Think Pascal and have gotten nowhere. I have Inside the Macintosh V, but I can't make heads or tails of it. The programming books are too old to feature any
color. If anyone could send me some code or give me the name of a good book
on the subject(include isbn is possible) I would really appreciate it.
Thanks in advance.
James Stepanek
esp
From: mxmora@unix.sri.com (Matthew Xavier Mora)
Newsgroups: comp.sys.mac.programmer
Subject: What is a sun raster file? can a pict file be converted?
Date: 20 Aug 92 22:25:39 GMT
Followup-To: comp.sys.mac.programmer
Organization: SRI International

What is a sun raster file? is that like a pict file? is it 
just a bitmap or is it opcodes like a pict file?

Has anyone coverted a mac pict file to a sun raster file?

Thanks

Matt

P.S. While I type this note, my mac is being backed up via retrospect to a 
dc 2000 tape drive. What an incredible program. This is the only program
that
really knows what background processing is! The mac is not being brought to
a halt because its being backed up. My cursor flashes and the screen keeps
up with my typing. How did they do that? Great job Dantz.