HDTenEightyP/NetNews huggingface dataset:
From: wysocki@netcom.com (Chris Wysocki)
Subject: Re: International Number Formats
Organization: Connectix Corporation, San Mateo, CA
Date: Tue, 15 Dec 1992 05:02:12 GMT

In article <4TS=Cj-@engin.umich.edu> Michael F. Kamprath <kamprath@space-grant.sprl.umich.edu> writes:

>I'm trying to decipher IM VI with respect to how to convert a floating point
>number into a string to be displayed in the correct format (as set by the Nums
>&Date control panel) and vice versa (that is, strings --> numbers).

Use the Script Manager routine Str2Format to convert a format string
(such as "#,###,###;-#,###,###") to a canonical NumFormatString (which
describes the format string in a script-independent manner), then use
FormatX2Str and FormatStr2X to convert between 80-bit SANE extendeds
and formatted strings.  You can obtain the necessary NumberParts table
from the 'itl4' resource via:

    Handle      itl4H;
    NumberParts parts;
	
    itl4H = IUGetIntl(4);
    FailNILRes(itl4H);
    parts = *(NumberParts *)(*itl4H + (**(Itl4Handle)itl4H).defPartsOffset);

The one trick is that you need to save the canonical NumFormatString
returned by Str2Format in some way (e.g. in a resource), since
Str2Format will interpret the format string differently depending on
the current system environment (active script system, Numbers and
Dates control panel settings, etc.)  To avoid this, write a throw-away
program that calls Str2Format and saves the resulting NumFormatString
in a resource.  Then, when you need to display a formatted number in
your main program, get the saved NumFormatString resource, lock it
down, and pass the dereferenced handle to FormatX2Str.  Complete
details about Str2Format, FormatX2Str and FormatStr2X can be found in
the Worldwide Guide to System Software stack, available on the
developer CDs.

Chris.
-- 
------------------------------------------------------------------------------
Chris Wysocki                                     Internet: wysocki@netcom.com
Software Engineer                                   America Online: AFA ChrisW
Connectix Corporation                                   CompuServe: 72010,1140
From: werner@dewey.soe.berkeley.edu (John Werner)
Newsgroups: comp.sys.mac.programmer
Subject: Re: initing Linked Lists and then Sorting them...
Date: 18 Dec 1992 20:10:44 GMT
Organization: School of Education, U.C. Berkeley
Distribution: usa
NNTP-Posting-Host: dewey.soe.berkeley.edu

In article <1992Dec18.190934.7747@midway.uchicago.edu> phoenix@uhuru.uchicago.edu (Lord Phoenix) writes:
>Ok, I have been spinning in circles for the past two months and I am about 
>ready to quit...  I have tried to initialize a doubly linked list and i think
>it works, but when I try to sort it doesn't...
>I know people must have been able to do this but I just can't figure it out...

Get any good algorithms book (like Sedgwick's "Algorithms") and look
at the section on the "merge sort".  It's handy for sorting linked
lists, and has good performance (N log N, I think).  The trick when
sorting a doubly-linked list is to treat it like a singly-linked one,
then go back and reconstruct the back-pointers when you're done.  If
you're worried about sorting records with huge data objects in them,
maybe you should have pointers or handles to the data instead.
-- 
John Werner                        werner@soe.berkeley.edu
UC Berkeley School of Education    510-642-9651
From: mspace@netcom.com (Brian Hall)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Duplicate Object in Think C?
Date: 20 Dec 92 20:30:18 GMT
Article-I.D.: netcom.1992Dec20.203018.6764
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

russotto@eng.umd.edu (Matthew T. Russotto) writes:
>In article <white.724729120@sfu.ca> white@fraser.sfu.ca (Steve White) writes:
>>How do you duplicate an object without knowing its class?  We would like
>>to write something like
>[...] 
>>sizeof( class_name )
>> 
>>will return the size of an object in a class.  We get "illegal use of
>>class type" when we try to compile, e.g., 
>> 
>>sizeof( Window )

Have you tried newObj = oldObj->Copy();  Copy is a method of the CObject
class.  It will make a copy of the object, but you may want to override
it in subclasses to make sure it makes a copy of the data, and not a copy
of the references to data, if that is what you want.


-- 
 
 \ | /   | Brian Hall                 mspace@netcom.com
 - : -   | Mark/Space Softworks       Applelink: markspace
  /|\    |                            America Online: MarkSpace
 |-+-|   |
/-\|/-\  | PUI: Programming Under the Influence.
Newsgroups: comp.sys.mac.programmer
From: geoff@cc.uow.edu.au (geoffrey roberts)
Subject: Depth and Device Manager Questions
Summary: Need help on getting Max Depth and Using Dev. Manager on graphics cards
Keywords: Maximum Depth, Device Manager, Direct Device
Organization: University Of Wollongong
Date: Sat, 12 Dec 92 05:59:06 GMT


   I have a couple of questions concerning the graphics environment on 
the mac.   If anyone knows that answers to these could they please 
contact me on e-mail:

                        g.roberts@uow.edu.au

1.	Question concerning depth

    In order to get as much information about the colour environment as 
possible, I need to get the maximum possible depth of each device.   I 
realise that after (and including) system 6.0.5 I can recursively call 
the HasDepth function passing to it every possible depth.   This seems 
a little long winded.   Is their a cleaner way?
Secondly, if using the HasDepth function is the only possible way of 
determining the maximum depth of a device, how can I find the maximum 
possible depth of a device before system 6.0.5?   All we know is that 
it must be 8 bit or below prior to this system (if 32 bit QD is not 
installed).
    Please note that any system I use to determine the maximum depth 
will need to work on both PDS and NuBus slots.

2.	Question on sample code.

    I have a couple questions regarding  the "DirectSetEntries" sample 
code found on the February 92 Developers CD.   The documentation on 
this sample code suggests that it can possibly be used possibly for 
animating on a direct device.   This is exactly what I need to do!
    In this code calls are being made to the device manager, yet Inside 
Macintosh Vol II it states:
"The display screen is not a device; drawing on the screen is handled 
by quickdraw"
Does this apply to pre-colour machines only.   ie, Can I use device 
manager calls to communicate to the graphics card - (NOT TO THE SCREEN) 
on Macintosh's with colour quickdraw?   If so, will these calls work on 
machines that have a graphics card in their PDS.
Secondly, could someone please explain the parameters that are being 
passed to PBControl?   I assume that the parameters passed in this code 
are described in "Designing cards and Drivers for the Macintosh".   I 
have no need for this full documentation - is there a smaller list of 
parameters for graphics cards somewhere?
Finally, would this call work on machines that use the PDS slot for 
their graphics card?


Thanks in advance

Geoff

g.roberts@cc.uow.edu.au
Newsgroups: comp.sys.mac.programmer
From: tom@dtint.uucp (Thomas R. Kimpton)
Subject: Re: MacTCP Programming idea/request
Organization: Digital Technology, International
Date: Wed, 16 Dec 92 18:26:27 GMT

In article <peter-151292115938@rocky.curtin.edu.au> peter@ncrpda.curtin.edu.au (Peter N Lewis) writes:
[deleted]
>Which shows pretty simply the IP of the various machines on the net that
>have an IPADDRESS.
>
>Note that MacTCP doesn't register the IP number until its actually needed,
>so you won't find IPADDRESS registrations for Macs that haven't used an TCP
>services since their last restart.
>
>There are no doubt lots of Mac NBP utilities that will give this list as
>well.
>
>BTW, none of this requires any MacTCP programming.  In fact, it would be
>impossible to use any TCP programming to find out this information, this is
>one of the advantages that AppleTalk has over TCP.
>
>Have fun all,
>   Peter.
>
>_______________________________________________________________________
>Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055


You can find the IP addresses that have been registered by sending
ICMP_ECHO request (ping) packets to the broadcast address for your
net.  I didn't know about MacTCP not registering it's IP address
until it was used.  This explains why I wasn't getting everyone's
IP address back when I pinged broadcast, though they were all up
and connected to the net.


-- 
---
Tom Kimpton                            tom@dtint.dtint.com
Digital Technology Int.                (801)226-2984	
500 W. 1200 South, Orem UT, 84057      FAX (801) 226-8438
Newsgroups: comp.sys.mac.programmer
From: egw@utkvx3.utk.edu (Wolpert, Edward Greenwal)
Subject: HELP! *Need quick help on Window Copying...
News-Software: VAX/VMS VNEWS 1.41    
Organization: University of Tennessee Computing Center
Date: Sat, 12 Dec 1992 02:18:00 GMT

	Hello... I've got a project due monday, and need some info quick...
I want to take a region on the main window, copy it elsewhere, mess with the
original window, and 'merge' the two screens together.  I've done the
following:
	1) Made New Rgn,
	2) Copy Winptr^.VisRgn to new Rgn
	3) Messed with the Window,
	4) Tried UnionRgn(NewRgn, WinRgn,WinRgn) and failed.
(I've tried all the similar rgn commands.)
	I"m not looking for style, but I can be (almost) assured that my
hacking instead of programming had prob caused the error.  Any suggestions?
(After this Sunday, the point will be moot.)  If I'm commiting a sin :) by
doing this, any help is welcome.  Please post here or send reply's to the above
address, or wolpert@lead.chem.utk.edu.
	Thanks,
	Edward Wolpert

Newsgroups: comp.sys.mac.programmer
From: Bathsheba.Grossman@launchpad.unc.edu (Bathsheba Grossman)
Subject: Re: Menus with another font than Chcago
Organization: University of North Carolina Extended Bulletin Board Service
Date: Fri, 18 Dec 1992 06:48:17 GMT

In article <1992Dec17.223202.13243@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak;Guest of Distributed Systems Lab) writes:
>In <5848@krafla.rhi.hi.is> rson@rhi.hi.is (Mimir Reynisson) writes:
>>How can I let the standard MDEF display it's contents with something
>>other than Chicago? Geneva 9 to be precise? Is it sufficent
>>just to change the system font global variable? and then change it
>>back after PopupSelect?
>
>You have to set the font and size you want into the low-memory
>globals SysFontFam and SysFontSize. Then set LastSPExtra and
>CurFMInput to -1. Finally, save the txSize field of the
>WMgrPort (and, if you have colour QD, the WMgrCPort) and set it
>(them) to zero.
>
>Then PopUpMenuSelect.
>
>Then restore the txSize fields, restore SysFontFam and
>SysFontSize and set LastSPExtra and CurFMInput to -1.


Is this a joke?  Why not just do it the documented way: when creating the
popup menu, just give it the procID,  popupMenuCDEFProc + popupUseWFont =
1016.   Then set the window or dialog font to whatever floats your boat. 
IM VI, 3-18.

Also, there's been some complaint about the difficulty of writing MDEF's.
I've found that if you're only trying to add a few pretty dingbats,
like MSWord's shift characters, you can bypass the nasty bits by calling
the system MDEF from within your own and then doing the extras on top.  So
something like the following appears in your MDEF:

GetResource('MDEF',textMenuProc);	/*get system MDEF*/
savMDEF = (*theMenu)->menuProc;
(*theMenu)->menuProc = sysMDEF;		/*pass message to it*/
if (message == mChooseMsg)	/*store *which because sysMDEF will mung it*/
	whichCopy = *which;

CallPascal(message,theMenu,menuRect,hitPt,which,*sysMDEF);
(*theMenu)->menuProc = (Handle)savMDEF;	/*and put me back*/


Now mSizeMsg can be ignored, you get free balloon help and standard items, and
you need only draw, highlight, and unhighlight your own features.  

-Sheba

--
   The opinions expressed are not necessarily those of the University of
     North Carolina at Chapel Hill, the Campus Office for Information
        Technology, or the Experimental Bulletin Board Service.
           internet:  laUNChpad.unc.edu or 152.2.22.80
Newsgroups: comp.sys.mac.programmer
From: phoenix@uhuru.uchicago.edu (Lord Phoenix)
Subject: initing Linked Lists and then Sorting them...
Organization: University of Chicago
Distribution: usa
Date: Fri, 18 Dec 1992 19:09:34 GMT

Ok, I have been spinning in circles for the past two months and I am about 
ready to quit...  I have tried to initialize a doubly linked list and i think
it works, but when I try to sort it doesn't...
I know people must have been able to do this but I just can't figure it out...
I would really apreciate some code showing me step by step how to do this.
And please don't send me a really sucky sort algorithm, the records are going 
to be quite big.  i.e. They will have smallish (I hope) 32 bit images...

So please anyone who has a heart please help... Vacation is here and I going to
start working on the project again.

Lord Phoenix
E-Mail: phoenix@uhuru.uchicago.edu
From: purcell@sciences.sdsu.edu (Guy B. Purcell)
Newsgroups: comp.sys.mac.programmer
Subject: Std. fmt. for saving window info?
Date: 17 Dec 92 03:23:14 GMT
Organization: San Diego State University Computing Services
X-Newsreader: TIN [version 1.1 PL8]

Is there a "standard" method and/or format for saving a window's info
(size, position, etc.) between its incarnations?  I assume such
stuff should be put into a resource -- is there an agreed-upon one
to use?  Thanks.

Guy (purcell@hera.astr.ua.edu)
From: paul@taniwha.UUCP (Paul Campbell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Detecting reboot or startup
Date: 19 Dec 92 03:54:21 GMT
Organization: Taniwha Systems Design

In article <cmcclary-151292113831@mcclary-mac.ucs.indiana.edu> cmcclary@ucs.indiana.edu (Charles McClary) writes:
>What is the best/preferred method for an application to detect if the
>system has been rebooted or restarted since it (the application) last ran.

Assuming you saved the time your app last ran in a file and resource and
then read it back again into 'last_time_ran' then try:

	unsigned long	last_time_ran, now;

	ReadDateTime(&now);
	if ((now - (TickCount()/CLOCKS_PER_SEC)) > last_time_ran) {
		// - we rebooted since last time we ran
	}

	Paul
-- 
Paul Campbell    UUCP: ..!mtxinu!taniwha!paul     AppleLink: CAMPBELL.P
Use up your Quayle jokes now while they're still good "Quayle for Pres. in '94"
     Q: Why is Marilyn Quayle like Marion Barry?
     A: They both suck a little dope.
Newsgroups: comp.sys.mac.programmer
From: rmaag@iiic.ethz.ch (Rolf Maag)
Subject: altech systems/midi pascal
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Fri, 18 Dec 1992 17:33:32 GMT

i am writing a midi software and a freind fo mine showed me midi pascal by altech systems. now i desperately look for a registered copy, can anyone tell me, if altech system has an email adress?

has anyone had bad experoence with midi-pascal?

regards, Rolf Maag
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Using VBL for animation
Organization: Kalamazoo College
Date: Sat, 12 Dec 1992 02:36:32 GMT

gregt@function.mps.ohio-state.edu (Gregory M Ferrar) writes:
>I'm trying to create fast, flicker-free animation.  I'm using a Quadra 700
>with a 16" monitor, which is my startup screen, and two 12" monitors.
>
>The task itself simply restores A5, sets the Boolean global, resets its
>counter, gets the old A5 back, and quits.
>
>Judging by the way the animation looks, the redraws are correctly SPACED but
>are offset from where they should be-- the vbl lines are always in the same
>places, indicating that animation is in fact in synch with VBL but not in
>phase.
>
>The time taken to draw is extremely small-- roughly 150,000 move.l instructions
>on a Quadra 700.

Well, lessee.  150,000 instructions, let's assume about five cycles each.
(You're going to RAM each time, that's your bottleneck, and the Quadra
uses, what, 70 ns RAM?  OK, that's 7 Mhz max, which means the absolute
best you can do is just under four cycles each.  No data cache hitting
here, I presume.) 150,000 instructions times 5 cycles divided by
25,000,000 cycles per second is 3/100 seconds.  Your monitor probably
refreshes every 1.5/100 seconds or so.  So I'd expect that you'll have to
take two "ticks," more or less, to draw this.

The good news is, you _can_ do a two-tick refresh without tearing if you
work at it a little.  The trick is to start your refresh just _behind_,
not ahead, of the electron beam--that way, you run along as fast as you
can right behind it, and by the time it finishes, starts again, and
finishes again, you're done too.

Trouble is, there's no sure-fire way to know exactly where the electron
beam is.  (Even the Apple II had a way to do this, sigh.)  You have to
wait for the VBL task to fire, then wait as long as you think it'll take
for the beam to get around to the top of the screen again and start
down, minus the time that the VBL tasks (yours included) take.  As far
as I know, it really is just a guessing game;  tweak it until it works.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "This sounds like a semantico-psychological backwardization of the
  real world image."   - Dave Bloom (bloomda@ctrvax.vanderbilt.edu)
Newsgroups: comp.sys.mac.programmer
From: absurd@apple.apple.com (Tim Dierks, software saboteur)
Subject: Re: Driving mac program from another
Date: Fri, 18 Dec 1992 22:23:37 GMT
Organization: MacDTS Marauders
Followup-To: comp.sys.mac.programmer

In article <1992Dec18.175034.23523@kth.se>, d88-jwa@dront.nada.kth.se (Jon
Wtte) wrote:
> In <1992Dec18.041429.22979@philmtl.philips.ca> ray@philmtl.philips.ca (Ray Dunn) writes:
> However, affecting someone elses jGNEFilter means patching in on
> INIT time; so you'll have to have a cool INIT/APPL combo.

Actually, jGNEFilter is not (currently) swapped at process switch times;
if you change jGNEFilter in one app, you've changed it in all of them.
This makes life a little scary for jGNEFilter writers; if more than one
person patches this vector, the earlier ones are never allowed to go
away, because pointers to their code are stashed somewhere unknown.

Scary, huh?

Tim Dierks
MacDTS pinball addict (TM)
From: veizades@apple.com (John Veizades)
Newsgroups: comp.sys.mac.programmer
Subject: Re: MacTCP Programming idea/request
Date: 11 Dec 92 18:34:33 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <1992Dec11.083919.1344@galaxy.gov.bc.ca>,
cconstantine@galaxy.gov.bc.ca wrote:
> 
> Here is an interesting programming request/idea for use on MacTCP Ethernet
> networks.  Write a utility that will poll all of the Mac's on the network for
> their IP address.  This would be a method of IP control as well as determining
> if there are duplicate addresses on the net.  This utility should possibly also
> be able to get the ethernet address (NIC) of the actual ethernet card as well. 
> This way, it can be compared to an existing database and you could track down
> exactly who is using what address.  
> 
The current version of MacTCP (1.1.1) will no allow the system to come up
unless it has a unique IP address (MacTCP ARPs for its own address before
completing the open).  The next version of MacTCP (2.0) will inform the
user of the IP address and hardware address of the offending host through
the use of an alert.

I think this solves your concern.

John Veizades...
Apple Computer, Inc.
MacTCP Lead Engineer
Xref: sparky comp.sys.mac.programmer:20052 comp.sys.mac.apps:18768
From: perm@csd.uu.se (Per Mildner)
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.apps
Subject: Re: Looking for a Prolog that runs on PB100
Date: 18 Dec 92 14:19:25
Organization: Computing Science Dept.,Uppsala University, Sweden
Distribution: world
NNTP-Posting-Host: groucho.csd.uu.se
In-reply-to: sti@batman.cs.hut.fi's message of 17 Dec 1992 23:10:06 GMT


Tricia should run just fine, depending on the amount of ram you have.
It requires 2.5 meg in its default configuration but this could
probably be tweaked by some magic with ResEdit. It's available from
ftp.csd.uu.se by anonymous ftp in pub/Tricia/Mac, note that you need
to get the version that doesn't require 68020 ot better. The version
on sumex (and mirrors, it has dissapeared from sumex) requires 68020
or better.

Tricia is a WAM based (ie compiled) prolog with little to no mac
specifics.

Questions etc to tricia-request@csd.uu.se
Regards,
--
Per Mildner			perm@CSD.UU.SE
Computing Science Dept.		tel: +46 18181049
Uppsala University, Sweden	fax: +46 18521270
Newsgroups: comp.sys.mac.programmer
From: ksand@apple.com (Kent Sandvik )
Subject: Re: Problems with MacApp
Date: Sun, 13 Dec 1992 00:32:36 GMT
Organization: (Evil Eye Creature from Mars, Inc.)
Followup-To: comp.sys.mac.programmer

In article <1fp6gdINNmqk@calvin.NYU.EDU>, roy@mchip00.med.nyu.edu (Roy
Smith) wrote:
> 
> 
> 	After making a number of false starts at Mac programming with
> ThinkC, I've decided to take a shot at MPW.  I've installed MPW 3.2 and
> MacApp 3.0.1 from the ETO-8 CD-ROM and am trying to run through the MacApp
> Tutorial (C++).  Starting right at the beginning, I tried to build the
> Nothing application like the tutorial says, but can't get it to work.
> Here's what I get:
> 
> mabuild nothing -autobuild -nodebug
> MABuildTool - v. 3.0.1 Release 6/10/92          Start: 11:49:04 12/2/92
> 
> Copyright Apple Computer, Inc. 1986-1992
> All Rights Reserved.
> 
> Target Folder: "Qwerky:MacApp 3.0.1:Libraries:.NoDebug Files:"
> Making:        MacApp.Lib.MAMake
> Rezzing:       MacApp.r
> File "Qwerky:MacApp 3.0.1:Libraries:MacApp.r"; Line 25; ###
> Qwerky:MPW:Tools:Rez - Can't find the declaration for the resource type
> 'aedt' (0x61656474).

The missing 'aedt' resource bug strikes again. The ETO CD should have a bug
guide (actually two of them in the same documentation folder) where this
problem
is defined and where we also described the workaround. In addition, the ETO
#9 has
a MacApp 3.0.1* release where the bug is fixed. 

You need to add  the missing 'aedt' resource to the MacAppTypes.h file.
This resource was defined
in Types.h, but it was taken out in the MPW revision, and someone forgot
:-)
to place it into the MacApp resource files. 

Here's an 'aedt' resource if you don't have access to earlier ETO CDs where
the
resource is present:


/*------------------aedt  Apple Events Template -----------------*/
/* Resource definition used for associating a value with an apple event */
/* This really only useful for general dispatching */

type 'aedt' {
	wide array {
	unsigned longint;	/* Event Class 	*/
	unsigned longint;	/* Event ID 	*/
	unsigned longint;	/* Value 	*/
	};
};


Place this one inside the MacAppTypes.r file, just after the:
#define sectionCancelMsgID		'cncl'		// Section Cancel Event

line.

Kent
-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.