HDTenEightyP/NetNews huggingface dataset:
From: keith@taligent.com (Keith Rollin)
Subject: Re: Stripping Mac text for Usenet
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Fri, 11 Dec 1992 21:08:55 GMT

In article <1992Dec10.231215.3423@kth.se>, d88-jwa@dront.nada.kth.se (Jon
Wtte) wrote:
> 
> In <keith-101292104807@kip-28.taligent.com> keith@taligent.com (Keith Rollin) writes:
> 
> >I just checked it out, and you're right: it doesn't quite do what I want.
> >For example, it changes opt-d to d, opt-y to Yen, and opt-x to =. I prefer
> >to make it clearer by changing them to opt-d, opt-y, and opt-x.
> 
> Is this the giy making the next Latest and Greatest OS!?

Yep! Me, and only me. Don't worry. I'm not working on any of the
international stuff. (Although why I'm taking all this guff from a person
who doesn't even know how to spell "guy" I'll never know.  :-)  )


> Of course this extension would totally fail on anything but a
> US keyboard layout! What you call opt-8, I call opt-q.
> 
> The only sane thing would be looking the KCHR backwards and
> see what came out; still the output would not bear any
> resemblance to what the READERs KCHR might look like.

I started by looking at the KCHR. However, for two reasons, I gave it up.
One was the reason you mentioned: what I need to type to get an
extended-ASCII character isn't the same as what you type. Also, there are
several ways of generating the same character, and I didn't feel like
coming up with a heuristic to determine the best one.


> 
> Just install unicode, will ya?

This is kind of like the first telephone: until the second one was
invented, the first one was useless. I'll be glad to send UniCode when you
can start receiving it. "Just send me your OS," you say? Sorry...

So...who's the smartest person out there? If I'm looking at a lower-case
delta, an upper-case sigma, or something that the Greeks never even thought
of, what can I turn it into so that Jon can understand it on his end?

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
From: deweeset@ptolemy3.rdrc.rpi.edu (Thomas E. DeWeese)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C 32K segment
Date: 19 Dec 92 20:15:23 GMT
Distribution: usa
Organization: Rensselaer Polytechnic Institute, Troy, NY

In article <chuck-181292154535@choffman.gte.com> chuck@gte.com (Chuck Hoffman) writes:
>In article <1go3ohINN4pq@network.ucsd.edu>, sah@coast.ucsd.edu (Scott A.
>Herndon) wrote:

 He Want's
>> 	int Height[129][129];

>I would try an approach using NewHandle, to get the memory you need at
>execution time, instead of at compile time.  Then initiailize the array
>after you get it.

 OK I agree with you so far. Continue

>typedef	struct	heightStruct
>	{	int	h1;
>		int h2;
>	}	**heightStructH;
WHAT are you doing defining a structure?

>myHeightStructH =
>		(heightStructH) NewHandle(129 * sizeof(struct heightStruct));

well this is equvalent to:
struct	heightStruct arry[129];  //Not what he wanted int [129][129]

>/* later, to get info from element 5 ("j") of the structure:	*/
>j = 5;
>workH2 = (*(*myHeightStructH + j)).h2;
Well a much more intuitive way would be:
workH2 = (*myHeightStructH)[j].h2;  //Although I still don't know why
				    //you have a structure defined.

>/* remember about locking/unlocking, and, when done, disposing	*/

Well there are two "good" ways of doing this.  The transparent way and
the easy way.
for the transparent way what you want to do is:

int **arry;
void main(void)
{
  int i,x;

  arry = NewPtr(sizeof(int *)*129);
  for (i=0;i<130;i++)
    arry[i] = NewPtr(sizeof(int)*129);
  
  //Now since we used Ptr's you don't have to worry about locking unlocking.
  //and a reference would be as follows.

  x = arry[15][25];
}

The Good Way(TM) to do this would be

int **arry;

void main(void)
{
  int i;

  arry = NewHandle(sizeof(int *)*129*129);  //now everything is one block
  
  //an access would be done as follows

  x = (*arry)[15*129+25]; //we need the 15*130 to offset the rows
                          //Note that if we were to pass any addresses
		          // you would have to lock the memory down
}

a macro might make this nicer such as

#define index(a,x,y) (*a)[x*129+y]
                            ^^^ note hardcoded array row size!

so an access would be:
  x = index(arry,15,25);

BTW you are now using a language that starts arrays at 0.  This makes
indexing, and generating offsets so much nicer.  I know that Fortran always
starts at 1 (and you have to create global arrays, no dynamic mem alloc
until recently).  But one thing you will learn is that while you might think
it is easier to start indexing at 1, you really are better off getting used
to indexing at 0. (so your array would by int arry[128][128]) assuming you
really want and array of 128 elements.
  						Thomas DeWeese
deweeset@rdrc.rpi.edu
From: bpb9204@tamsun.tamu.edu (Brent Burton)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Sound Input questions (real time usage)
Date: 15 Dec 1992 12:24:33 -0600
Organization: Texas A&M Univ., Inc.
Distribution: usa
NNTP-Posting-Host: tamsun.tamu.edu

bpb9204@tamsun.tamu.edu (Brent Burton) writes:
|
|Think of my program as simply drawing a bar, which has a height
|that is proportional to the sound level coming in, like a meter.
|
|Since my program is effectively a level meter, I just need the current
|values.  Another approach I was thinking about was using a small buffer,
|like << 100 bytes.  Since the buffer is small, the value contained in
|it would be relatively close the the current value.  Is this feasible?

I have learned a lot about the Sound Manager during the last few days,
and I have solved my problem.  

Essentially, what you would do is to call a routine, InitSound() for example,
to open the driver and begin recording.  You would then poll the device
to determine the current sound level whenever you needed to know the
sound level.  Finally, when you are done polling/using the device, you
call a routine such as KillSound() to stop recording and close the device.

This turned out to be simple, and brief pseudocode follows for the
routines:  (The code is from memory, so be sure to check, for instance,
  the parameter block's field names)

------------------------------------
#include <SoundInput.h>

long sndRefNum;

#define kAsynch TRUE

InitSound()
{
  OSErr e;
  SPB   s;

  e = SPBOpenDevice( NULL, siWritePermission, &sndRefNum);
  if ( e != noErr)
  {
    /** initialize the parameter block - fill in all fields - see IM 6 **/
    s.count =0;  s.milliseconds=0; s.buffPtr = NULL;  s.buffLen = 0;
    s.completionRoutine=NULL; s.interruptRoutine=NULL; 
    s.inRefNum = sndRefNum;          /* ... */

    e = SPBRecord( &s, kAsynch);  /* record asynchronously */
    if (e != noErr)
    {  /* error */  }

  } else { /* error */ }
} /* InitSound() */

/**** After InitSound() is called, you can poll the device to get 
***** various characteristics about the recording.
**  Call SPBGetRecordingStatus()  (see inside mac 6)  to get
**  recording time so far, remaining, the current sound level on the
** input, etc.
*****/

/** Once your are done with polling, call KillSound() to clean up **/
KillSound()
{
  OSErr e;
  e = SPBStopRecording( sndRefNum);
  e = SPBCloseDevice( sndRefNum);
  sndRefNum=0;
} /* killSound() */

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

Hope this can help someone else.  It works for me.

-Brent

-- 
+-------------------------+
| Brent Burton    N5VMG   |    
| bpb9204@tamsun.tamu.edu |  
+-------------------------+ 
Newsgroups: comp.sys.mac.programmer
From: winney@dal.mobil.com (Randy Winney)
Subject: Programmer's Editors 
Keywords: editor 
Organization: Mobil Exploration & Producing Technical Center(MEPTEC), Dallas. 
Date: Fri, 18 Dec 1992 16:14:11 GMT


Does anyone have any experience with Preditor or the Object Works editor?
Are they worth the money?

winney@dal.mobil.com
From: rudolph@unixg.ubc.ca (Christopher E Rudolph)
Newsgroups: comp.sys.mac.programmer
Subject: PixMaps
Date: 14 Dec 92 00:03:57 GMT
Organization: The University of British Columbia
NNTP-Posting-Host: unixg.ubc.ca
Summary: How do I declare pixel data from scratch?
Keywords: pixmap question


Hello,

I would like to declare pixel data for a PixMap data structure from
within my program and not have to call the data from, say a cicn in a
resource.


Example:  

Say I had a ball that I would like to decribe in terms of actual pixels on
the screen.  How would I go about declaring an array of values for this
ball, which I would then like to assign to the baseAddr field of the
PixMap data structure.

My biggest problem is I don't know how to go about defining the pixel image.
If anyone could help me out with this I would really appreciate it.

Thanks in advance,

Chris Rudolph (ComputerScience, UBC) <rudolph@unixg.ubc.ca>
------------------------------------------------------------
From: amanda@intercon.com (Amanda Walker)
Newsgroups: comp.sys.mac.programmer
Subject: Re: MacTCP Programming idea/request
Date: Sun, 13 Dec 1992 04:32:59 -0500
Organization: InterCon Systems Corporation
Distribution: world
Reply-To: amanda@intercon.com (Amanda Walker)
NNTP-Posting-Host: chaos.intercon.com
X-Newsreader: InterCon TCP/Connect II 1.1b22

cconstantine@galaxy.gov.bc.ca writes:
> What do you all think????  Is there a utility that does this already?? 
> if so where is it, I want/need it. 

It's called SNMP (Simple Network Management Protocol).  We have an INIT that 
responds to SNMP queries, which we bundle with WatchTower, our SNMP 
management software.  I also believe that MacTCP 2.0 will support SNMP, 
either out of the box or with an add-on module.



Amanda Walker
InterCon Systems Corporation


Newsgroups: comp.sys.mac.programmer,comp.sys.mac.comm
From: Norbert Mueller <K360171@alijku11.edvz.uni-linz.ac.at>
Subject: Mac Postscript on UNIX PostScript Printer
X-Xxmessage-Id: <A7537172DB026205@nmueller.chemie.uni-linz.ac.at>
X-Xxdate: Tue, 15 Dec 92 10:26:42 GMT
Organization: Johannes Kepler Univ., Inst. of Chemistry
X-Useragent: Nuntius v1.1.1d12
Date: Tue, 15 Dec 1992 10:28:02 GMT

Maybe an FAQ:
I want to print Mac generated PostScript files (from LaserWriter 7.1
Driver or Tektronix Phaser Driver) on a remote UNIX host after ftping.
So far I have had no success - the printer simply does nothing, 
although it works with local generated PostScript.
(The UNIX host is a CONVEX, the printer a PHASER II PXi)

Thanks for any help


Norbert MSller
Institute of Chemistry
Johannes Kepler University
A-4040 Linz
Austria 
e-mail K360171@ALIJKU11.bitnet
       K360171@EDVZ.uni-linz.ac.at
       Norbert@soft.uni-linz.ac.at
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Uniquely identifying a Mac? How?
Date: 15 Dec 92 12:17:56 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <9235010.4295@mulga.cs.mu.OZ.AU> mtc@mundil.cs.mu.OZ.AU (Michael Trevor CUTTER) writes:

>We are looking for a way to uniquely identify a Mac, probably one on a network,
>but not necessarily. Is the serial number or similar available somewhere in the
>ROMs or parameter RAM? (Highly unlikely, I know - specially since PRAM can be
>reset)

The ROMs are masked, so doing them unique would be a trifle expensive :-)
(You could do it by burning wit a laser)

>We are considering assigning each mac a unique chooser name then disabling the
>Sharing Setup Control panel...this is the best solution so far.

If you run MacTCP, each mac will have/get its own IP address;
likewise, EtherNet cards have a 6-byte EtherNet address that's
unique in the world.

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
   The word "politics" is derived from the word "poly", meaning
   "many", and the word "ticks", meaning "blood sucking parasites".
                     -- Larry Hardiman
From: David.T.Greenfield@dartmouth.edu (David T. Greenfield)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How do I STOP my TextEdit field from updating?
Date: 16 Dec 92 15:16:26 GMT
Organization: Dartmouth College, Hanover, NH
X-Posted-From: InterNews1.0b3@newshost.dartmouth.edu

In article <1992Dec13.182630.4371@netcom.com>
bskendig@netcom.com (Brian Kendig) writes:

> How can I STOP the TextEdit field from redrawing itself immediately
> when I delete a line?

Try setting the clip rgn to exclude the TERec's viewRect before your
series of calls to TEDelete.  Then when you are finished call TEUpdate.

David
david.t.greenfield@dartmouth.edu
Newsgroups: comp.sys.mac.programmer
From: rmah@panix.com (Robert Mah)
Subject: No password from UGGetUserInfo
Date: Fri, 11 Dec 1992 21:46:10 GMT
Organization: PANIX Public Access Unix, NYC
Keywords: Users Groups Appleshare

I'm trying to use the the UGGetUserInfo function in the Appleshare 3.0 API
and can get a list of users.  However, their passwords do not come back.

The target Users & Groups Data File is personal file sharing data file.  How
can I get the passwords for each user?

Also, how do I access the <guest> account?

Thanks,
Rob
 
-- 
[--------------------------------------------------]
[  Robert S. Mah   |  "Every day an adventure,     ]
[  rmah@panix.com  |   every moment a challenge."  ]
[--------------------------------------------------]
From: bskendig@netcom.com (Brian Kendig)
Newsgroups: comp.sys.mac.programmer
Subject: How do I STOP my TextEdit field from updating?
Date: 13 Dec 92 18:26:30 GMT
Organization: Starfleet Headquarters: San Francisco

I have a window with a TextExit field in it that I'm using as a
command-line interface to a program.  Since there's a limit on how
much text a TextEdit record can hold, I check periodically to see if
the amount of text in the record has crossed a threshhold, and if so,
I delete lines from the beginning of the record until it's back below
the threshhold again.

Problem is, when I delete the first line of text (by using TESetSelect
then TEDelete), the text visible in my window scrolls up one line,
naturally.  (The end of the text is at the bottom of my window, and
the start of the text is scrolled off the top of the window.)  Then my
procedure to adjust the window scrolls the text back down to look like
it was before, causing an annoying flicker.

How can I STOP the TextEdit field from redrawing itself immediately
when I delete a line?  I TEDeactivate it, and turn off TEAutoView.  I
will eventually get around to updating the window on the screen, at
which time I want the text to be redrawn -- but not now!

-- 
_/_/_/  Brian Kendig                             Je ne suis fait comme aucun
/_/_/  bskendig@netcom.com                de ceux que j'ai vus; j'ose croire
_/_/                            n'etre fait comme aucun de ceux qui existent.
  /  Nolite te bastardes     Si je ne vaux pas mieux, au moins je suis autre.
 /  carborundorum.                                               -- Rousseau
Newsgroups: comp.sys.mac.programmer
From: rmaag@iiic.ethz.ch (Rolf Maag)
Subject: midi help needed
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Mon, 14 Dec 1992 15:29:50 GMT

hi there,

i am writing a midi-sequencing program with think c 4.0. i don't want to write my own midi-device driver, so can anyone tell me where i can get one? or maybe someone has a nice include file? anyway, thanx a lot and have fun..


email to rmaag@iiic.ethz.ch
From: d88-jwa@cyklop.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Assembly with C question...
Date: 13 Dec 92 21:43:24 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <1992Dec12.232559.265@physc1.byu.edu> seth@physc1.byu.edu writes:

>My question is, why are all the function calls done in this way? How can I 
>tell what the offset relative to a5 is? I am confused. I have till now only

You can't, since that's the linker's job.

>In the MDS Assembler we always could tell just what our offsets were, 
>becaused we used labels. I don't understand how all these function calls can

You can still use labels, like

	jsr Init

as long as Init is extern declared.

>be made with an offset of $0000(a5). Isn't a5 the global area? Why are the 
>function calls going there anyways? Shouldn't they be going to the code area,
>with offsets relative to the PC? I obviously don't see what is supposed to be

The jump table is loaded relative to A5, and subroutines that aren't
static are placed in the jump table, so their CODE segments can be
unloaded.

I further recommend reading up on the Segment Loader in Inside Mac II.

Cheers,

							/ h+

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

   Speed is arbitrary. Don't believe me? Try a PowerBook 180 running
   System 7 against a 486 laptop running Windows 3.1.
Newsgroups: comp.sys.mac.programmer
From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
Subject: Re: C vs. PASCAL
Organization: University of Illinois at Urbana
Date: Fri, 18 Dec 1992 08:10:59 GMT


The C vs. Pascal question is a bit hard on the Mac. The 'native language' of 
the Mac is Pascal. That means that all the first edition Inside Mac sample code
and the best  3rd-party Mac programming manuals are Pascal-oriented. All the 
system calls use Pascal-style calling conventions (semms like arcana until you
actually have to deal with it, at which point it becomes a constant hassle for
C and asm mixed work) And most salient: Think Pascal is the most highly 
evolved, smoothest, friendliest tool for creating Mac applications. For folks 
on a budget, it is the only real Pascal choice, and since it is the direct 
descendant of the earliest Mac and Lisa development systems, it has had a long
time to be refined into a really nice tool. HOWEVER(!), even Think Pascal has 
the common drawbacks of any Pascal vs. C: more rigid rules and looser final 
code. As an example, I have a program I originally developed in Pascal. I 
recently ported it to C. It is very small to begin with, just 10k compiled in 
Pascal, but the C version is all of 2k. Most of that is inevitably a fixed-size
overhead (i.e. a 20k app in Pascal might be well over 10k in C...) but if you 
really need tight final code, you're better off with C. Ditto if portability is
critical (Think Pascal actually ports pretty well since it resembles Turbo 
Pascal a bit, but since the Pascal standard is a bit thin and dated, no decent
Pascal is totally portable) 

In the final analysis, it depends on what you want to do. If you intend to 
program for others and for pay, you really need to learn C, and should probably
start now. If you are just going to be doing a few little things for yourself 
and maybe little shareware stuff, Pascal will definitely be faster in 
development, and so you will have the product sooner, even if it is a bit 
larger. If you can swing it, consider getting BOTH a C and Pascal compiler.  
recently Symantec (the Think folks, due to a merger) ran a neat little promo 
where all their registered owners of both Think systems got good deals on the 
other one. This MIGHT still be around, so you could get the pair pretty 
reasonably. btw: I only mention the Think packages because they are the only 
credible systems that don't require Apple's MPW, which is NOT a reasonable 
option for your Plus, and maybe not for a lot of people with bigger Macs.

PS: if you like Downline, try the new Stuffit Expander, that is both more 
reliable and more capable than Downline, and is absolutely free.
From: jesjones@milton.u.washington.edu (Jesse Jones)
Newsgroups: comp.sys.mac.programmer
Subject: NOW Menus 4.0 and the PopUp Menu CDEF
Date: 12 Dec 92 01:54:40 GMT
Article-I.D.: u.1992Dec12.015440.12445
Organization: University of Washington, Seattle


   I've had reports from several users that my program crashs with
NOW Menus 4.0 installed. I can't imagine why it would crash - as far
as I know I don't do anything shaky. I do, however use Chris Faigle's
wonderful PopUp Menu CDEF version 1.4. Does anyone know whether the CDEF 
has conflicts with NOW Menus (or anything else). Can anyone tell me for 
certain if NOW Menus works with the CDEF? 

  --Jesse
From: lari@strauss.cs.unc.edu (Humayun Lari)
Newsgroups: comp.sys.mac.programmer
Subject: Curves in QuickDraw GX
Keywords: Curves, QuickDraw GX
Date: 14 Dec 92 02:45:27 GMT


Hi, all. Yes, I have finals starting tomorrow, but there's one little question
I just *have* to ask... :-)

Fact: QuickDraw GX is going to use quadratic bezier curves a la TrueType.

However: editing quadratic curves is somewhat painful compared to editing
PostScript cubic curves, because of the number of extra points required to
describe similar contours.

So: are we going to see lots of GX programs that <ouch> make us use quadratic
curves to describe shapes? Or <grin> is there some magic way to display cubic
curves using quadratics? As far as I know, there's no simple way of doing so.
Does <gasp> GX provide some way of performing this magic? If not <"display
ignorance" mode on>, shouldn't it?

I guess what I'm worried about is programs showing up that make editing curves
harder than it needs to be -- much like the spline curves in MacDraw...

Stressfully yours,

Humayun Lari
(lari@cs.unc.edu)

P.S. Personally, I *still* think NuGraph sounds a little cooler than "QuickDraw
GX"... of course, average users might think it was a charting package...
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.misc,bgsu.general,bgsu.mac,comp.programming
From: dnebing@andy.bgsu.edu (Dave Nebinger)
Subject: Programming Group and the 32k TextEdit barrier
Followup-To: comp.sys.mac.programmer
Organization: Bowling Green State University B.G., Oh.
Date: Sun, 20 Dec 1992 00:51:48 GMT



TextEdit is limited to files smaller than 32k. Doesn't that suck! 

Well, instead of complaining about the limits on TextEdit, I would like 
to do something about it. I think there is a need for something that is 
public-domain that can handle this problem, whether in the form of a 
library or actual source code.

Now before you think about whipping out those flame-throwers and 
thrashing me for not looking into other options, I want to tell you that 
I have. These are my thoughts:

1)  Existing PD or ShareWare editors: There is quite a range of these 
    that are available to anyone who can ftp them. And these are all 
    very good programs. While they are fine as editor in themselves, 
    there still is no way to handle the files greater than 32k by 
    your own application. You must either communicate directly with 
    the editor or trust the user to do all of the work. While this 
    can solve the problem, it becomes quite a hassle for the user to 
    be switching in and out of two apps. Also, if you implement the 
    communication with the application, you rely on the fact that 
    the author will not change the communication method. If it does 
    change, you have to change your app to keep up compatibility. 

2)  I know that there is a TCL class CPEditText which can handle files 
    greater than 32k. To use this, you are restricted to to using the 
    TCL.

3)  I also know about the Word Solution Engine, a third party library 
    for handling files greater than 32k. This would be perfect, except 
    for the price.

4)  There also exists the CAPPS library from Think that came out a 
    long time ago, but it is currently unsupported and I don't know 
    how to get my hands on it.

For these reasons, I would like to create something to fix these 
problems. But since it is a large, somewhat complicated project, it 
would probably be completed faster and easier as a group project. 

If you are interested in being part of such a group, email me for 
more details. The request for more information will not bind you in 
any way to the group once it gets going.

For more info (or the inevitable flame;), email to: 

dnebing@andy.bgsu.edu

Thanks,

Dave Nebinger
dnebing@andy.bgsu.edu