HDTenEightyP/NetNews huggingface dataset:
From: felciano@summit.stanford.edu (Ramon M. Felciano)
Subject: Q:List manager returns irregular rects?
X-Posted-From: InterNews1.0a5@leland.stanford.edu
Organization: Stanford University Medical Media and Information 
 Technologies
Date: Wed, 30 Sep 92 19:04:21 GMT
Xdisclaimer: No attempt was made to authenticate the sender's name.


Hi!

I'm writting an LDEF to display a list of PICTs (pulled from PICT
Files). An interesting "quirk" I've noticed is that if the list is long
enough to display 3.5 cells, the fourth call to your Draw message will
have a rect that is half as high as the rest.

Is this normal LDEF behaviour. I would've thought the List Manager
would send the same cell size each time, and simply crop the drawing
area appropriately for partially visible cells.

I've got a pretty simple work around: I calculate the rect myself
starting from the top of the incoming one, then clip the drawing region
to the rect passed into my LDEF. Anyone have any better ideas?

Thanks!

Ramon

+----------------------------------------------------------------+
| Ramon M. Felciano                felciano@summit.stanford.edu  |
| Associate Director, SUMMIT       (415) 723-9688                |
| Stanford University Medical Media and Information Technologies |
+----------------------------------------------------------------+
Newsgroups: comp.sys.mac.programmer
From: spencer@panix.com (David Spencer)
Subject: Re: Regular Expressions
Date: Thu, 1 Oct 1992 18:03:58 GMT
Distribution: usa
Organization: PANIX Public Access Unix, NYC

In <1520@twinkletoes.hera.Sbi.Com> rpd@hera.Sbi.Com (Richard P. Daley) writes:

>Does anyone know where I can find source code to implement searching through
>text for regular expressions?  I'm hoping to find something like re_comp()
>and re_exec() on the Sun.

The gnu regular expression library is at prep.ai.mit. The version in
the grep/egrep sources has been built and tested (for years) by
wizards. The separate regex library is called beta, but it's an
extended and rationalized version of the grep regex code.

It has bsd compatible calls, as well as its own comp/exec format.

The bsd regex code is on gatekeeper.dec.com.

You can also try the agrep code. It allows slightly more general
searching than extended regular expressions. It's from University of
Arizona; try archie to get the location.

dhs   spencer@panix.com

Newsgroups: comp.sys.mac.programmer
From: bernard@cs.colorado.edu (Bernie Bernstein)
Subject: Crippled LC Sound Chip? (was Re: Sound Manager Phooey!)
Followup-To: comp.sys.mac.programmer
Organization: University of Colorado at Boulder
Date: Tue, 6 Oct 1992 16:02:47 GMT

In article <1992Oct5.022712.3448@news.cs.brandeis.edu>,
dan@chaos.cs.brandeis.edu (Dan Schwarz) wrote:
> 
> In article <w=mz_wc@rpi.edu> johnsd2@rpi.edu writes:
> >I am having a problem with an extension I am writing. This extension
> >is really a background app (type='appe'), which plays sounds asynchronously
> >in the background (which sounds are specified with annother program, that
> >works);
> ...
> >This strange freeze happens on a friends LC whenever
> >the sound is played, even  from an APPL. (but only if its
> >asynchronously)
> 
> Speaking as a programmer who has done some SERIOUS sound manager hacking,
> I can sympathize with your frustration. Here's what I can tell you:
> 
> * the Mac LC uses a crippled version of the Apple Sound Chip. So does the LC II
> and Classic II, by the way. Major difference is that this chip can only handle
> monophonic sound output, and cannot support simultaneous sound recording &
> playback.

I recently wrote a hack which listens to the sound input device, filling a
bunch of buffers. It then plays back random buffers while continuing to
fill or replace the other buffers. Everything is done asynchronously.
According to the above quote, this is impossible to do on a Mac LC.

I have been getting email from several LC users who say that the program
seems to fill the buffers correctly, but nothing is played back. This seems
to fit with the "crippled chip" theory.

Is there any gestalt call to see if the current machine has the "crippled
chip"? I would like my program to continue to work the way it is now on
most machines, but use a workaround for the crippled machines.


    o,  ,,   ,      | Bernie Bernstein                    | ,    ,,
    L>O/  `,/ `    ,| University of Colorado at Boulder   |/ `,,/  `
   O./  '  / . `, / | home: 303-444-3168                  |     / ` `  ,.
  ,/   /  ,      '  | email: bernard@cs.colorado.edu      | /        ''  `
Newsgroups: comp.sys.mac.programmer
From: Igor Livshits <igorl@uiuc.edu>
Subject: Icon Families
X-Xxdate: Mon, 5 Oct 92 00:44:39 GMT
X-Useragent: Nuntius v1.1.1d12
Organization: NCSA
Date: Mon, 5 Oct 1992 23:44:16 GMT
X-Xxmessage-Id: <A6F63D97ED0114C6@spiff.ncsa.uiuc.edu>

Hello,

I am befuddled:  Is there a call that will fetch a handle to an icon
family?

IM VI clearly states that a Notification Manager record will take either
a handle to a SICN resource or a handle to an icon family. 
Unfortunately, I have only seen examples with small icons.  If someone
has successfully sent a color icon to the Notification Manager, please
tell me how...


Many thanks, igor
Newsgroups: comp.sys.mac.programmer
From: felciano@summit.stanford.edu (Ramon M. Felciano)
Subject: Q: Deep dark MDEF menu manager debugging...
X-Posted-From: InterNews1.0a5@leland.stanford.edu
Organization: Stanford University Medical Media and Information 
 Technologies
Date: Fri, 2 Oct 92 22:23:17 GMT
Xdisclaimer: No attempt was made to authenticate the sender's name.


1. Question
===========
I've got a really aggravating bug for my MDEF (written in THINK Pascal
4.0.1). The bug occurs in one particular situation (surprise), which is
when you access a custom hierarchical menu from within a custom menu.
In particular:

   o  I've got a main menu that uses my custom MDEF.
   o  In that menu is a hierarchical item that brings up a 3 item
      menu (using the standard MDEF).
   o  The second item in that three item menu brings up another menu
      which uses my custom MDEF.

When I try this with the compiled MDEF, the second custom menu (i.e.
two hierarchical levels down) doesn't appear. But when I try this from
within THINK Pascal, I get a "NIL Pointer" error >>in Runtime.lib<<<
!!!! Aagh! How do I debug this?

Is this a problem with my MDEF being (or not being) reentrant? Is it OK
to lock a menu handle from within the MDEF code? Aaagh!


2. Warning to other MDEF developers
===================================
I've got another a bug that had me stumped for several weeks before I
solved it. THINK Pascal generates a custom header when creating code
resources. This is essentially the same as the normal code resource
header, but adds some code that puts the address of the code resource
into the ToolScratch global. The idea is that you can use this to get a
handle to your code resource from within it, and lock it down. 

The problem is that the Menu Manager uses ToolScratch to store the
selected menu and item numbers when flashing your menu item. Thus your
custom MDEF may not work right because THINK's header clobbers the
ToolScratch. I solved the problem by NOPing out the code in question,
and it works fine. Just thought you might want to be aware of this.

Thanks!

Ramon

+----------------------------------------------------------------+
| Ramon M. Felciano                felciano@summit.stanford.edu  |
| Associate Director, SUMMIT       (415) 723-9688                |
| Stanford University Medical Media and Information Technologies |
+----------------------------------------------------------------+
From: minow@Apple.COM (Martin Minow)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Using ReadXPRam and WriteXPRam traps
Date: 1 Oct 92 22:31:09 GMT
Organization: Apple Computer Inc., Cupertino, CA


jst@dcs.ed.ac.uk (Julian Turnbull) asks about the ReadXParam and WriteXParam
traps as he needs to access the location (latitude, longitude, and timezone
offset).

The proper way to access this information is by using the ReadLocation and
WriteLocation functions described in the ScriptManager chapter of Inside Mac VI.

Hope this helps.

Martin Minow
minow@apple.com
From: REEKES@applelink.apple.com (Jim Reekes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: SndStartFilePlay() problems...
Date: 6 Oct 92 19:38:30 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <#90wHsxy&9@atlantis.psu.edu>, dn5@apix.psu.edu (D. Jay Newman)
wrote:
> 
> Hi:
> 
> I have been working on a program which needs to play several
> fairly lengthy sounds from disk.  I now use the SndStartFilePlay()
> function, because we couldn't tolerate the delays involved in
> reading the entire sound into memory before starting to play
> it.
> 
> For sound files longer than about 120,000 bytes long, it works fine.
> For ones shorter than this, there is a "click" at the end of the sound;
> whenever there is a click at the end of a sound, there is a click at
> the beginning of the next sound.  This didn't happen when we read
> the entire sound into memory first!
> 
> The sounds were recorded with MacRecorder at 22 kHz with no
> compression, and saved as AIFF files.  The same thing happens if
> the sound is saved as a resource file.  There is silence both before
> and after each sound in the file.
> 
> I have used SndStartFilePlay both with a real sound channel and by
> forcing it to create one.  It does the same thing each time.
> 
> As this is for language testing, I have little control over the sounds
> themselves (they are generally voices, but could be other things).

Add more silence to the end of the sound by sending a bufferCmd to the
channel of about 1024 samples of 0x80s at a 22kHz sampling rate.

-----------------------------------------------------------------------
Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | RAll opinions expressed are mine, and do
20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
Cupertino, CA 95014          |       employer, Apple Computer Inc.S
From: werner@soe.berkeley.edu (John Werner)
Newsgroups: comp.sys.mac.programmer
Subject: When is DeviceLoop present
Followup-To: comp.sys.mac.programmer
Date: 26 Sep 1992 23:02:18 GMT
Organization: UC Berkeley School of Education
Distribution: world
NNTP-Posting-Host: 128.32.157.31

Does anyone know what I should check for to see if the DeviceLoop trap is
available?  The first mention I can find of it is in IM VI, which implies
that it arrived with system 7, but I'm not sure if it was part of 32-bit
Quickdraw too.  

In versions of my app that run on all OS versions, I'm going to do the
right thing and see if _DeviceLoop is available, and roll my own if it
isn't.  But in versions that require System 7 (or 32-bit QD?), I'm
wondering if I can just assume it's there and get rid of the extra code.

Thanks.

--
John Werner                         werner@soe.berkeley.edu
UC Berkeley School of Education     510-642-9651
Newsgroups: comp.sys.mac.programmer
From: kdlee@milli.cs.umn.edu (Kevin D. Lee)
Subject: Re: Parsing text files
Organization: University of Minnesota, Minneapolis, CSci dept.
Date: Wed, 30 Sep 1992 14:46:24 GMT

In article <1992Sep30.140336.3663@ucsvc.ucs.unimelb.edu.au> u2005681@ucsvc.ucs.unimelb.edu.au writes:
>Hi folks,
>
>I wonder if any of you people out there can give me some advice?
>I've been programming for quite a while but I havn't had much to do
>with the Mac file system and related toolbox calls.
>
>As part of a new application, I am trying to read a text file of numbers
>and strings into a series of variables. The idea is to use the numbers as
>co-efficients for a simulation and the strings as labels for various graphs.
>
>As I understand it, the Mac OS deals with text files as UNIX-C does with
>binary files ie you specify how many bytes to read and what buffer to read
>them into. But in the absence of a standard library, how is it possible to 
>read numbers and strings of differing lengths?
>
>An explanation (or even some source code in C) would be most excellent.
>
>I appreciate your time and effort.
>C.Hofflin
>----------------------------------------------
>"Insert your own clever, deep and meaningful quote here"

I handle parsing a text file by reading all of the data into a handle.


My next step is to lock the handle and start to dereference it by assigning
a char pointer to point to the first byte. I then use the sscanf function 
from ansi c to parse out the items that I am interested in.  After each
sscanf make sure you move your char pointer to the correct position.  If
this is to vague let me know and I will provide more details.

Kevin Lee
From: udmorrow@mcs.drexel.edu (Daniel Morrow)
Newsgroups: comp.sys.mac.programmer
Subject: problems with uRuntime.lib in THINK Pascal
Date: 29 Sep 92 19:41:54 GMT
Distribution: usa
Organization: Drexel University, Dept. of Math. and Comp. Sci.

I've been writing a Mac program in THINK Pascal and lately I've been
trying to make the program's size smaller.

Anyway, the problem is this,
	throughout the program's entire development I've been using the
	Runtime.lib library. (about 22k)
	Then I found out about the uRuntime.lib library (micro-Runtime)
	which is only about 6k or so.

	Everything compiles okay, but I get four link errors which are:

	undefined: "%_ProB" <followed by files which have procedures and func's>
	undefined: "%_ProE" <again, followed by files which have proc's and func's>
	undefined: "%_IPRO" <for only the main file>
	undefined: "%_TPRO" <for only the main file>

So my theory goes like this, the micro-Runtime library doesn't recognize
BEGIN and END in procedures or in the main program.

Is this true or is there another explanation for the link errors?

(I have no idea what those link errors truly mean, I am just guessing)

I would greatly appreciate an explanation for THINK Pascal's behavior
in this matter. (I am using version 4.0)

Thanks.
-Dan.
udmorrow@mcs.drexel.edu.
From: sje@xylos.ma30.bull.com (Steven J. Edwards)
Subject: Tape archive file floppy I/O with Mac SupraDrive
Reply-To: sje@xylos.ma30.bull.com
Organization: Bull HN, Worldwide Information Systems, Billerica, Mass., USA
Distribution: comp
Date: 6 Oct 92 14:43:18

I have:

	Mac with standard 1.44 Mbyte SupraDrive

	Various Intel machines at work and home with 1.44 Mbyte drives

	Unix and Coherent running on the Intel machines

	Standard tar software on the Intel machines

I need:

	The ability to read ("tar x") and write ("tar c") tape archive
format floppies on the Mac SupraDrive in a fashion compatible with the
Unix and Coherent machines.  The Unix and Coherent machines are
already tar floppy compatibile among themselves.

I don't want any part of the path to say "MS-DOS" intermediary.  The
files will be directories and ASCII data files, none of which have
resource forks.  No wacky names, either.

I feel that someone must have done this before, but I am unble to
locate any code.

Any help is appreciated.

 [The above opinions expressed are my own; not necessarily held by others.]
      == Steven J. Edwards           Bull HN Information Systems Inc. ==
      == (508) 294-3484              300 Concord Road         MS 820A ==
      == sje@xylos.ma30.bull.com     Billerica, MA 01821          USA ==
"That Government which Governs the Least, Governs Best." -- Thomas Jefferson
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Screen Capture prob.  Please HELP!!!!!!
Date: 30 Sep 92 06:57:02 GMT
Article-I.D.: falcon.1acm8uINN4gt
Organization: National Instruments, Austin, TX
NNTP-Posting-Host: falcon.natinst.com

[ Why doesn't cmd-shift-3 work during a while(!Button()) ? ]

>> The cmd-shift-# key combinations are processed by GetNextEvent or
>> WaitNextEvent.  Your app never even sees the events.  Put a
>> WaitNextEvent loop in instead of a "while(!Button());" loop, and you
>> should handle all FKEYs properly.
>
>This sounds like a very good solution but the problem is that I am using an old
>version of the Meridian Ada Compiler which does not support system 7.  Is there
>another way of doing this with pre-system 7 routines???
>

GetNextEvent is pre-system 7 and is described in Inside Mac I p.257,258:
"GetNextEvent also makes the following processes happen [...] If the user
holds down the Command and Shift keys while pressing a numeric key that has a
special effect, that effect occurs..."

	- Stepan
-- 
   Stepan Riha -- stepan@natinst.com
From: ST202153@brownvm.brown.edu (Andrew Shearer)
Newsgroups: comp.sys.mac.programmer
Subject: Artifacts in QuickTime movies
Date: Sat, 3 Oct 1992 06:25:47 EDT
Organization: Brown University - Providence, Rhode Island  USA
NNTP-Posting-Host: brownvm.brown.edu
News-Software: BNN via BNN_POST v1.0 beta

I'm writing a graphing program that exports QuickTime movies, and the results
look great, except for a few pixels that get left behind by each key frame.
I'm using the Animation compressor at 1 bit per pixel, losslessly (or so it
should be). The QuickTime code is straight out of the Movie Construction
FD sample.  The key frames themselves are fine and erase any previous
artifacts, but then leave a few of their own.  The really strange thing is
that this only seems to happen with motion to the _right_; leftward movements
have no problem!  Asking QT to do frame differencing based on the previous
compressed image rather than the expanded one doesn't improve things.
Does anyone have an idea what the problem is?

Andrew Shearer (Andrew_Shearer@brown.edu)
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Think Pascal and ResEdit questions
Organization: Kalamazoo College
Date: Mon, 28 Sep 1992 18:59:28 GMT

eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
>tree@kira.uvm.edu (Tom Emerson) writes:
>|>eijkhout@cupid.cs.utk.edu (Victor Eijkhout) writes:
>|> 
>|>    2/ I have programmed mouse-and-menu programs before on the Atari ST, and
>|>    the resource construction programs there gave you a possibility to
>|>    give symbolic names to items in the resource, which you then used in your
>|>    program.
>|>    ... Is such a thing possible with ResEdit, combined with Think
>|>    Pascal?
>|> 
>|> Not as such.
>
>On the Atari the resource construction program yielded a .RSC file
>with the resource and a .RSD file with for C 'define' and for Pascal
>'Const' statements...
>
>This file is then loaded into your program, and you only have
>to remember the name 'File_menu', and not its ID.
>
>If I've understood ResEdit correctly, then the number of an item in a 
>menu is simply the number of the line it appears on. This is awful:
>If I insert a menu item higher up I have to change the item ID in
>my program. Have I really understood this correctly?

Yes, you have.  A nice extension to Think C 4.0.x, "4Plus", provided
this and many other features.  (Not for menu items, though--it would
produce a .h file that did 'enum's attaching resource names to IDs.
So you could change menu numbers on the fly, but not menu items.)

This would be a way-cool tool, if someone wanted to write it--a
drag-n-drop app that accepted any file, and spelled out its resources in
some clean header file.  Preferences would include:  whether to write a
C or Pascal header;  the prefix for all the constants ("r", for
example);  whether to convert "two word" to "two_word" or "twoWord";
and so on.  The option of writing separate files for separate groups of
resources would be nice too--when I change a menu item, I don't want to
have to recompile all my C files that #include the enumerations of the
'snd ' resources.

Hmmm.  If I didn't already have six things on the back burners, I'd
consider tossing this one on too.  Or has it been done already?
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "To flame someone on an open forum is, to me, the height of insensitivity."
   - P.J. Plauger
From: mwu@orion.oac.uci.edu (Matt Wu)
Subject: Measuring text in different fonts
Newsgroups: comp.sys.mac.programmer
Organization: University of California, Irvine
Date: 30 Sep 92 20:23:53 GMT


I'm currently writing a program that will need to measure the width of
text as it will appear on a written page.  I've been using the stringwidth
function to do this.  However, as the Macintosh uses bit-mapped fonts,
I was wondering how accurate this would be as compared to, say, final
output out of a PostScript laserprinter?  If this is not a very accurate way
of measuring text width, can you offer any suggestions as to how I could
get better results?

Thanks,

Matt
mwu@orion.oac.uci.edu
Newsgroups: comp.sys.mac.programmer
From: davep@county.lmt.mn.org (Dave Polaschek)
Subject: Re: Help re: hiding the menu bar
Followup-To: comp.sys.mac.programmer
Reply-To: davep@county.lmt.mn.org (Dave Polaschek)
Organization: LaserMaster Corp
Date: Tue, 29 Sep 92 14:49:33 GMT

Hank.Woods@p0.f222.n125.z1.FIDONET.ORG (Hank Woods) writes:
> What other goodies, soes the "Mac Programming Secrets, 2nd edition" have 
> to offer, besides hiding the menu bar? Can you name another few goodies, 
> that are mentioned in the book.

Here we go...

Chapters 1&2: History & Philosophy.  Some good insight into why things are 
the way they are and why you might consider breaking the rules and when you 
probably shouldn't.

Intermission: Unexpurgated, uncensored about boxes from Multifinder 1.0 and 
System 7.0a9.  These alone are almost worth the purchase price.

Chapter 3: Application skeleton.  Pretty handy and a good base to build upon, 
which is what a skeleton should be.

Chapter 4: Dialogs -- includes a handy progress indicator (in color) and 
shows how to do moveable modals and modeless dialogs.

Chapter 5: QuickDraw -- Offscreen drawing was the good thing I learned here.

Chapter 6: Mouse Tracking -- a few things I wouldn't have thought of until 
they made things behave badly.

Chapter 7: Windows -- Tiling and Stacking 'em.  Keeping many of them straight.

Chapter 8: Files -- How to do 'em right.

Chapter 9: Standalone code -- a good primer on cdevs INITs, WDEF, and 
patching system traps.

Chapter 10: Other goodies -- how to do command-period Keith's way (which I'm 
still not sure if I'm going to implement or not, but I'm glad I saw his way, 
regardless); a password dialog; hiding the Menu bar; and a goofy spinning 
pointer.

That's a list of the highlights.  A friend of mine who isn't a mac programmer 
skimmed the book and enjoyed it just for some of the humor in the writing and 
for the feel of Mac Programming that it gave.  I wouldn't recommend it as a 
first book to have to learn to program the Mac, but it's a good buy once 
you've collected the entire Inside Mac series.  Collect all 23, win valuable 
prizes.

Dave Polaschek           	Internet:davep@county.lmt.mn.org
LaserMaster Corp. R&D  	      					ICBMNet:44^59'N 93^13'W
7156 Shady Oak Rd.  					      									AppleLink:LaserMax
Eden Prairie, MN 55344  			 			      	  	ATTNet:6129439204
-- Cuius testiculos habes, habeas cardia et cerebellum. --
Newsgroups: comp.sys.mac.programmer
From: chrism@col.hp.com (Chris Magnuson)
Subject: Disassembly with source in MPW?
Date: Wed, 30 Sep 1992 17:01:19 GMT
Organization: HP Colorado Springs Division

  I must be overlooking something here...how do you get dissassembled output
with source code interleaved in between?  I used DumpObj to get something
of the form:

 00000000:   4E56 0000     LINK A6,#$0000
   more assembly follows...

and the source lines are located later in the file.  Is there a way to
get the source lines in the same listing as the assembly code with MPW?

Thanks,
chrism@col.hp.com
Newsgroups: comp.sys.mac.programmer