HDTenEightyP/NetNews huggingface dataset:
From: kenny@netcom2.Netcom.COM (Ken Smith)
Subject: Novice HashTable Question
Organization: Netcom Online Communications Service
Distribution: comp
Date: Sat, 9 Jan 1993 22:27:56 GMT

I want to use the HashTable class to implement a symbol table for a
simple expression evaluator that I'm writing, however there seems to
be one crucial feature missing from HashTable (or more likely I just
can't figure it out).

My question:  Given a "value", how does one determine its associated
              "key" in a HashTable?

When using hash tables that I've written in the past, I've found it
useful (actually essential) to be able to quickly lookup a table entry
given *either* its key or its value.

In other words, how come there isn't a "keyForValue" method in addition
to the existing "valueForKey" method?

Thanks in advance,
Ken Smith
--
_______________________________________________________________________
                                                       kenny@netcom.com
-- 
_______________________________________________________________________
                                                       kenny@netcom.com
Newsgroups: comp.sys.next.programmer
From: pbeiler@fnma.com (Phil Beiler)
Subject: HELP: - app: fileOperationCompleted:
Reply-To: pbeiler@fnma.com
Organization: Fannie Mae
Date: Thu, 7 Jan 1993 21:18:43 GMT


I am having problems with the method:

app: fileOperationCompleted:

I performed the following command:

	rc = [[Application workspace] 
		performFileOperation:WSM_RECYCLE_OPERATION 
		source:THE_PATH 
		destination:"" 
		files:fileList
		options:NULL];

The request returns a positive integer, which means that it should call  
the fileOperationCompleted method, when the operation has completed. The  
file gets moved to the recycler, by the method never gets called.

I am positive that the application delegate is set to the file with the  
app: fileOperationCompleted method.

I wrote a simple test program and can't get it to work. 

Any help would be appreciated.

Phil Beiler
FannieMae, Washington DC
Newsgroups: comp.sys.next.programmer
From: frank@glocke.hotb.sub.org (Frank Thomas)
Subject: Re: Problems using gcc 2.3.3
Date: Sun, 3 Jan 1993 17:05:01 GMT

In article <PFKEB.92Dec30221114@kaon.SLAC.Stanford.EDU>  
pfkeb@kaon.SLAC.Stanford.EDU (Paul F. Kunz) writes:
> So here we are...
> 
> - gcc 2.3.3 doesn't support NeXT's extensions to Objective-C which
> were introduced with NeXTSTEP3.0   So you can't use gcc for any
> compilation requiring the appkit; cuz it will hit things like 
> ``@class'' almost immediately.
> 
> - NeXT's cc++ doesn't support GNU's extension to the C++ language which
> were introduced with gcc 2.x.   So you can't use cc++ for any
> compilation requiring libg++; cuz it will hit things like
> ``#include-next stdlib.h'' almost immediately.
> 
> So if I understand things right (please correct me if I'm wrong), we
> are really in bad shape.   We can't use both the latest release of
> gcc/libg++ and NeXTSTEP 3.0 in the same application.
> 
> Anybody else find this distrubing?
YES,
and the question raises again 
WHY the hell can we not force NeXT to release it's changes to gcc.
They must release the source if they distribute the binaries. 

Newsgroups: comp.sys.next.programmer
From: pkim@cory.Berkeley.EDU (-)
Subject: window dragging
Organization: University of California, at Berkeley
Date: Mon, 11 Jan 1993 05:55:10 GMT

i'm having a problem getting a window to drag properly when the user drags in
a view within the window (the window is a NX_PLAINSTYLE window so it has no
titlebar).  it seems to work fine except that every now and then, the window
"vibrates" around the mouse point.  for example, if i start dragging the
window to the left, the window, every now and then, will oscillate in a 
circular  fashion for a  half a second.  the amplitude of the oscillations
sometimes reaches a hundred pixels or so.
here's the code (it should be pretty straightforward):
- mouseDown:(NXEvent *)theEvent
{
    NXPoint	current;
    NXCoord	dx, dy;
    NXRect	wframe;
    BOOL	tracking = YES;
    int		mask;

    mask = [window addToEventMask:NX_MOUSEDRAGGEDMASK];

    current = theEvent->location;
    [window getFrame:&wframe];
    [window convertBaseToScreen:&last];
    dx = NX_X(&wframe) - current.x;
    dy = NX_Y(&wframe) - current.y;
    theEvent = [NXApp getNextEvent:MOVE_MASK];
    if (theEvent->type == NX_MOUSEUP) {
	return self;
    }

    while (tracking) {
	current = theEvent->location;
	[window convertBaseToScreen:&current];
	[window moveTo:(current.x + dx) :(current.y + dy)];
	tracking = (theEvent->type != NX_MOUSEUP);
	if (tracking) {
		NXPing();
		theEvent = [NXApp getNextEvent:MOVE_MASK];
	}
    }
    [window setEventMask:mask];

    return self;
}

i can't use dragFrom::theEvent: because i need to move other windows with this
one (dragFrom::theEvent: doesn't send window update messages to the delegate).
so, if anyone can either find the error in my code or tell me of another way
to get several windows to move in tandem with the one the user is dragging,
let me know.

thanks in advance,
paul kim
pkim@cory.berkeley.edu
Newsgroups: comp.sys.next.programmer
From: Bob_Vadnais@pdh.com (Bob Vadnais)
Subject: Re: How to request that workspace execute 'eject'?
Reply-To: Bob_Vadnais@pdh.com
Organization: PDH, Inc.
Date: Tue, 5 Jan 1993 01:52:08 GMT

In article <1i8ujsINNljg@shelley.u.washington.edu> 
zeno@phylo.genetics.washington.edu (Sean Lamont) writes:
>
> Is there any way to request that the workspace request the
> current removable-media disk in the drive?  Because of
> file permissions (and not wanting to run the program with
> root permissions) I can't use DKIOCEJECT. 

If you're using 3.0, this is another job for 
NXWorkspaceRequestProtocol.  Use the method  
(BOOL)unmountAndEjectDeviceAt:(const char *)path.

Cheers,
Bob

(UTFDL?)
--
Bob_Vadnais@pdh.com (NeXT Mail welcome)
PDH Inc., 2635 North First Street Suite 224, San Jose, CA 95134-2034
Voice: (408)428-9596  Fax: (408)428-9599
From: biff@biff.gbdata.com (Dwight Everhart)
Newsgroups: comp.sys.next.programmer
Subject: Re: RTFD, copying to Objects and Archiving
Date: Mon, 11 Jan 1993 03:42:37 GMT

In article <1993Jan7.213019.7023@ornl.gov> woo@ornl.gov (John W. Wooten)  
writes:
> I am working on an application where I compose questions
> that will contain rich text (including diagrams).  I have a simple  
> subclass of Object called QuestionObj that I create an instance of for  
> each question and then maintain the questions in a List Object.
> 
> The text is in a text field with id "text".
> 
> I try to do the following:
> 	NXStream *buffer;
> 	
> 	count = [questions count];
> 	newQuestion = [[QuestionObj alloc] init];
> 	buffer = NXOpenMemory(NULL,0,NX_WRITEONLY);
                                    ^^^^^^^^^^^^
> 	[text writeRTFDTo:buffer];
> 	[newQuestion setText:buffer];
> 
> Now in the QuestionObj, I have:
> - setText:(NXStream *)str
> {
> 	buffer = str;
> 	return self;
> }
> - (NXStream *)text
> {
> 	return buffer;
> }
> with interface of:
> @interface QuestionObj:Object
> {
> 	int num;
> 	NXStream *buffer;
> }
> 
> - setNum:(int)val;
> - (int)num;
> - setText:(NXStream *)str;
> - (NXStream *)text;
> 
> Now, first it appears that I'm not getting the Rich Text because I  
> can't get it back out of the object with text method.

You're opening the stream as write-only.  Either open it as as read-write, or  
close the stream and have your setText method store the address of the  
buffer, rather than the stream.  To do the latter, after writing the stream,  
use NXGetMemoryBuffer() to get the address of the memory buffer that was  
created.  Use NXClose() (or NXCloseMemory() with the NX_TRUNCATEBUFFER  
option) to close the stream.  Give setText: the address of the buffer.  Then,  
when you want to read from the buffer, you can use NXOpenMemory() with the  
address of the buffer as returned by your text method.


> Also, if this even works, in the -read -write methods of the
> QuestionObj class, what do I put for the descriptor when I use
> NXWriteTypedStreamToFile ?

I don't know if you can archive a NXStream, but, if you use the second option  
I suggested, you can archive the memory buffer with NXWriteArray() with a  
type of "c".


> I used a * when it was a char * and it worked.

The "*" type is meant for strings.  It probably won't work right with memory  
buffers.

--
Dwight Everhart          "Technology turned out to be less important than
Houston, Texas            sales and distribution methods ... we consistently
biff@biff.gbdata.com      outsold people who had better technology."
NeXTMail and MIME OK      -- Thomas J. Watson Jr., on the success of IBM
Newsgroups: comp.sys.next.programmer
From: wave@media.mit.edu (Michael B. Johnson)
Subject: weirdness: wave's or IB? 
Organization: MIT Media Laboratory
Date: Sun, 10 Jan 1993 23:49:16 GMT

Hi folks.  I would swear this was working a few weeks ago, but now it's not...

I'm writing some IB palettes which contains subclasses of Object, not View.
The objects are actually proxies for other full fledged processes running
on some arbitrary computer on the net.  If you do the obvious thing, i.e.
each time your ObjC object init's it starts up the companion process, you
end up with a bunch of "extra" processes.  For example, when you load your
palette into IB, IB init's each of the objects in your palette.  Then when
you drag an object from your palette into the Files Window, IB inits another
one.  So far, for each object on your palette you've got two processes 
floating out on the net that you don't want.  

You then go in to test mode.  At this point, you do want that process to
start up.  So what to do?

Well, IB is nice enough to declare a bunch of protocols that should help
you.  Jean-Marie has subclassed NXApp for IB and made it respond to a few
new messages.  So, in your init and awake msgs, if you put the following
code:

if ([NXApp resondsTo:@selector(isTestingInterface)])
{  // we're in IB
   if (![NXApp isTestingInterface]}
   {  // building interface, not testing
      return self;
   }
   //we're testing the interface, really exec the process
}
else
{  //we must be in an app (not IB), really exec the process
}

[self initWholeThang];

So, if you have some routine initWholeThang that actually starts up the 
associated process, you should be golden.  Unfortunately, I seem to be
getting NO back from [NXApp isTestingInterface] both when I'm building
the interface (i.e.just frobbing around in IB) and when I'm testing the
interace (command-r).  I would swear this was working fine a few weeks
ago, and I even diff'ed my current code against that version, and nothing
is different in that part.  Any ideas, please...  E-mail, and I'll summarize
if anyone points out my foolishness.  Thanks.


-- 

-->  Michael B. Johnson
-->  MIT Media Lab      --  Computer Graphics & Animation Group
-->  (617) 253-0663     --  wave@media-lab.media.mit.edu
From: jalegre@tsp.med.umn.edu (John Alegre)
Newsgroups: comp.sys.next.programmer
Subject: Trouble with setitimer and getitimer.
Date: 8 Jan 93 21:52:38 GMT
Article-I.D.: news2.1993Jan8.215238.29927
Organization: University of Minnesota

I am trying to time a tight SCSI read loop on a 
NeXT machine.

I am having trouble with the UNIX functions
setitimer and getitimer.

My code (or one variation of it) looks like this:

struct itimerval	after;

setitimer(ITIMER_REAL, &after, 0L);
	puts("Starting");
	for(i=1;i<=num;i++)    
		[self performSCSIRequest];
	puts("Done");
getitimer(ITIMER_REAL, &after);

I have not been able to get any kind of succesful
data out of setitimer or getitimer.  If I do not
assvalues to the various componets of after,
I get back 0 or all fields.  If I do assaign
initial values, I either get back the same values
or garbage.

All comments welcome
---
John N. Alegre
Andante Systems
VideoLabs Inc.

#############################################################
# NeXTMail preferred.             |
# jdev@andante.mn.org             |
# alegrej@andante.mn.org          | If you plant ice,
# jalegre@lenti.med.umn.edu       |  you're gonna harvest wind!
# alegrej@libros.andante.mn.org   |    Hunter/Garcia      
#############################################################
Newsgroups: comp.sys.next.programmer
From: zmonster@athena.mit.edu (Eric M Hermanson)
Subject: Beginner Programmer Help
Organization: Massachusetts Institute of Technology
Date: Tue, 5 Jan 1993 23:24:47 GMT

I am new to NeXT Programming (but am very familiar with NeXT in general).
I am looking for reference information on NeXTstep programming.  So far, I
have checked into Garfinkel's programming book and the NeXTstep developers
library books.  The NeXTstep developers library has seven or so volumes,
and I was wondering if anyone can reccommend the three or four most crucial
volumes in the library for a beginner to have.  Also, is the book by
Garfinkel a substitute for the NeXTstep developers library?

Thanks,
Eric


Xref: sparky comp.sys.next.programmer:7995 comp.sys.next.advocacy:3567
From: Conrad_Geiger@NeXT.com (Conrad Geiger - Manager, International NeXT User Groups)
Newsgroups: comp.sys.next.programmer,comp.sys.next.advocacy
Subject: Calling all Exhibitors for 1993 NeXTWORLD Expo
Date: 5 Jan 93 23:32:33 GMT
Reply-To: user_groups@next.com
Followup-To: comp.sys.next.programmer

To NeXTSTEP developers,

If you are interested in booth space for this year's NeXTWORLD Expo,
please read the message below.  I hope to see you in San Francisco
in May!

Conrad Geiger
Manager, International NeXT User Groups

____________________________________________
Announcing the 1993 International NeXTWORLD Expo
and Calling all Exhibitors!!!

Join us from May 25-27 at Moscone Center in San Francisco for the
second annual gathering of the worldwide NeXT community, and
International Developers conference, an educational Users conference,
a NeXTSTEP product exposition, and a global User Group meeting!

NeXTWORLD Expo is being co-sponsored by NeXTWORLD Magazine and
Digital Consulting, Inc. (DCI).  DCI is handling all show management
and logistics for this year's Expo.

EXHIBITORS
Contact Matthew Schmuck or Charlie Hurth at DCI West--
	408 280 6778 voice
	408 280 6779 fax

Exhibitor kits will be available December 28.  Space will be assigned
on a first-come, first-serve basis. (Past NeXTWORLD Expo exhibitors
will be given priority consideration for space selection through
January 10).

Calls are pouring in, and choice space is moving quickly, so don't
delay!

EXPO AND CONFERENCE ATTENDEES:

To participate in the User Conference, Developer Conference, or to
attend the Expo, call 1-800-767-2336.  International callers can fax
inquiries to DCI at 508-470-0526. Please label all correspondence:

	Attention: NeXTWORLD Expo.


Newsgroups: comp.sys.next.programmer,comp.lang.postscript
From: henry@trilithon.mpk.ca.us (Henry McGilton)
Subject: Re: Arcs and circles from curveto
Organization: Trilithon Software
Date: Tue, 12 Jan 1993 17:51:32 GMT

In article <1993Jan11.014246.4735@drefla.mese.com> matt@drefla.mese.com (Matt  
Brandt) writes:
    *  I've been able to come up with a pretty good approximation
    *  of a circle using curveto . . .
<<<<<   stuff deteleted  >>>>>>
    *  of course, you can repeat for the bottom of the circle.
    *  Like I said though, this is only an approximation. Does
    *  anybody out there have a better approximation of circle
    *  drawing using curveto? I need to do it this way for bizarre
    *  reasons and I would like to improve the accuracy a little bit.
You can't get an accurate enough circle with only two curves.  You
need one curve per quadrant, and you draw four of them.  The ``magic
number'' for the circle is  0.555.  Here's an example which you
can hack to your needs.

            %!PS
            /R 288 def
            /M R 0.555 mul def
            306 396 translate
            R 0 moveto
            R M dup R dup 0 exch curveto
            M neg R dup neg M R neg 0 curveto
            R neg M neg dup R neg dup 0 exch curveto
            M R neg R M neg R 0 curveto
            closepath
            stroke

I cross posted this to comp.lang.postscript, because, as Eric Scott
pointed out, this topic is pure PostScript and only tangentially
NeXT related.


        ........  Henry
Newsgroups: comp.sys.next.programmer
From: jjfeiler@relief.com (John Jay Feiler)
Subject: Re: RTFD, copying to Objects and Archiving
Reply-To: jjfeiler@relief.com
Organization: relief consulting
Date: Mon, 11 Jan 1993 06:24:06 GMT

In article <1993Jan7.213019.7023@ornl.gov> woo@ornl.gov (John W. Wooten)  
writes:
> I am working on an application where I compose questions
> that will contain rich text (including diagrams).  I have a simple  
> subclass of Object called QuestionObj that I create an instance of for  
> each question and then maintain the questions in a List Object.
> 
> The text is in a text field with id "text".
> 
> I try to do the following:
> 	NXStream *buffer;
> 	
> 	count = [questions count];
> 	newQuestion = [[QuestionObj alloc] init];
> 	buffer = NXOpenMemory(NULL,0,NX_WRITEONLY);
> 	[text writeRTFDTo:buffer];
> 	[newQuestion setText:buffer];
> 
> Now in the QuestionObj, I have:
> - setText:(NXStream *)str
> {
> 	buffer = str;
> 	return self;
> }
> - (NXStream *)text
> {
> 	return buffer;
> }
> with interface of:
> @interface QuestionObj:Object
> {
> 	int num;
> 	NXStream *buffer;
> }
> 
> - setNum:(int)val;
> - (int)num;
> - setText:(NXStream *)str;
> - (NXStream *)text;
> 
> Now, first it appears that I'm not getting the Rich Text because I  
> can't get it back out of the object with text method.
> 
> I know most of this works with ascii text (I tried this all out using  
> char *buffer;
> first)
> 
> Also, if this even works, in the -read -write methods of the
> QuestionObj class, what do I put for the descriptor when I use
> NXWriteTypedStreamToFile ?
> I used a * when it was a char * and it worked.
> 
> What do I put for a typed stream?
> 
> 
> - - - - - - - - -
> J. W. Wooten


Just a guess, but are you doing a NXSeek(buffer, 0L, NX_FROMSTART) before  
trying to access data in the stream?  

	John

--
John Feiler                             jjfeiler@relief.com
4926 152nd St. SW                       NeXTmail Welcome!!!
Edmonds, WA  98026-3344      Independent NeXTSTEP Developer 
Newsgroups: comp.sys.next.programmer
From: joseph@lilliput.fdn.org (Joseph Goldstone)
Subject: Custom IB Palette object mushed together from boxed control objects
Keywords: IB Palette control
Organization: Lilliputian Pictures - Paris, France.
Date: Mon, 11 Jan 1993 19:44:30 GMT

Probably the error here is in my conception of how IB works, but...

I want to agglutinate several standard UI objects (four TextFields and a  
one-element Matrix of SliderCells) into a new UI object, and have that object  
on a palette.  The Textfields serve to label the slider, indicate the slider's  
min and max values, and display the slider's current numeric value as text.

Because I plan on using an awful lot of these (for a 3DKit camera settings  
interpolation program) I wanted to
  1) for N labelled sliders have N outlets in my App's distributor object, not  
5*N
  2) have each labelled slider accept messages to set and get current values  
and to set and get the labelled slider's min and max values
  3) put these thangs on a palette so that I could re-use them in other  
programs (I've wanted this functionality before)

Straightforward enough to create a Palette project, and in the new Palette  
window align things as I liked and Group them into a Box object.  But IB only  
lets you drag things into windows that happen to be subclasses of View (even  
though they can have extra baggage on their shoulders, witness the ProgressView  
in the Palettes tutorial being grouped within a box - the box gets dragged into  
any new App's window along with the ProgressView itself).

But how to indicate that the group of objects comprising this box are part of  
the new class I'm defining?  I can whip up a class definition pretty readily in  
Edit that contains id pointers to the five enclosed objects, and parse it; but  
only a dragged-in custom view will let you replace its type (or rather, specify  
with which type it will later be replaced) in IB's attributes inspector, so  
this newly-parsed class definition does me no good.

I suppose I'd be happy if I could figure out how to reparent the controls that  
I'd grouped into the Box as subviews of my custom View, and to set the id  
pointers in the custom View's object to those controls.

Sure, I could assemble the controls inside the object programmatically, but if  
this is the only way, then I'm appalled at IB.  I can't believe that the  
distance from simple object to compound is as great as the distance between  
interactive construction of user interfaces from UI object palettes, and using  
Edit to create C code that manually instantiates UI objects.

Can someone point out my more obvious conceptual problems here, so I can move  
on from thinking about sliders to thinking about shaders?  :)

-- joseph

Newsgroups: comp.sys.next.programmer
From: death@netcom.com (David Burrowes)
Subject: Question re: NeXT rtf graphics control words
Followup-To: death@kira.net.netcom.com 
Summary:  What are # and c in  {{\NeXTGraphic# myFile.eps \height3 \Width 4}c}? 
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Distribution: usa
Date: Tue, 5 Jan 1993 06:57:57 GMT

There's no doc that I can find in the 2.1 NeXTStep release (I'm not yet
running 3.0.  Loonngg story) that defines anything about the 
NeXTGraphic construction in their rtf files.  Anyone know the answers 
to these questions?

1) The NeXTGraphic control word takes a numeric parameter.  I've seen this
	with several different values (most commonly 0), but with noapparent
	meaning to this number.  What DOES it mean?
2) Outside the inner group in this construction, there's always a character.
	I've seen both , and <.  Again, there's no indication of what these
	mean.  (Example: {{\NeXTGraphic0 foo.eps \height2 \width2},}  )

I know that last character is necessary, but I can find no pattern to why one
character is in that position, rather than some other.

Thanks in advance for info, tips, or just hunches!

\david john burrowes
death@kira.net.netcom.com

 
 

Newsgroups: comp.sys.next.programmer
From: eps@futon.SFSU.EDU (Eric P. Scott)
Subject: Re: Arcs and circles from curveto
Reply-To: eps@cs.sfsu.edu
Organization: San Francisco State University
Date: Tue, 12 Jan 1993 02:25:36 GMT

PostScript approximates each quadrant of a circle with a curveto.

e.g. If you do a pathforall against 0 0 125 0 360 arc, you should
find something like:

	125 0 moveto
	125 69 69 125 0 125 curveto
	-69 125 -125 69 -125 0 curveto
	-125 -69 -69 -125 0 -125 curveto
	69 -125 125 -69 125 0 curveto

BTW, This question properly belongs in comp.lang.postscript; it's
not the least bit NeXT-specific.

					-=EPS=-
From: lacsap@plethora.media.mit.edu (Pascal Chesnais)
Newsgroups: comp.sys.next.programmer
Subject: Re: Problems using gcc 2.3.3
Date: 5 Jan 93 20:11:06 GMT
Reply-To: csn@plethora.media.mit.edu
Organization: MIT Media Laboratory

In article <1993Jan3.170501.242@glocke.hotb.sub.org>  
frank@glocke.hotb.sub.org (Frank Thomas) writes:
> YES,
> and the question raises again 
> WHY the hell can we not force NeXT to release it's changes to gcc.
> They must release the source if they distribute the binaries. 

uh,  dude chill,  NeXT has released the complete sources
to their modifications to gcc for 3.0...  It was a timely
release too.

They are even available on plethora.media.mit.edu via anon
f t p.

pasc
Newsgroups: comp.sys.next.programmer