HDTenEightyP/NetNews huggingface dataset:
From: alastair@hecate.phy.queensu.ca (A.B. McLean)
Subject: Re: Pointers to functions in method definitions
Organization: Queen's University, Kingston
Date: Thu, 7 Jan 1993 19:00:37 GMT

In article <C0CAtI.KqM@knot.ccs.queensu.ca> alastair@hecate.phy.queensu.ca  
(A.B. McLean) writes:
> POINTERS TO FUNCTIONS IN METHOD DEFINITIONS
> 
> I want to write a method that will accept a pointer to a C function.
> For example, let the function be a simple Gaussian:-
> 
> void gaussian(x,a,y)
> float x,a[],*y;
> {
>   float arg;
>   
>   arg = (x-a[2])/a[3];
>   *y += a[1]*exp(-arg*arg);
> }
> 
> In the interface file I would expect (Kernigham amd Ritchie section  
5.11)
> the method definition to look like 
> 
> - methodName:void(*gaussian)(float, float*, float*);
> 
> and in the implementation file I may have
> 
> - methodName:void(*gaussian)(float, float*, float*)
> {
>   // ...
>   return self;
> }
> 
> When I try to do this the compiler gives me the message
> 
>   parse error before `void'
>   
> Any suggestions ?
> 
> Alastair McLean
> alastair@hecate.phy.queensu.ca

Thanks to everyone who replied to my pointer to a function problem. 
Here is a summary of the replies:-the syntax given below works..
I tried them !
_______________________________________________________

No, types of arguments to Objective C methods are not specified in the
same way as types of arguments to regular C functions.  Rather, they are
specified in C "cast" format -- e.g., -method:(int)i; not -method:int i;

For your example:

- methodName:(void(*)(float, float*, float*))functionName;

-- 
Ray Spalding
ray.spalding@oit.gatech.edu (NeXT Mail accepted)
________________________________________________________

The syntax for specifying a function pointer is wrong.  Try the following:

- methodName: (void (*)(float, float*, float*))gaussian;

Or, even better

typedef  void (*GaussianFunc)(float, float*, float*);

- methodName: (GaussianFunc)gaussian;


--
Frank Mitchell
frank@fnbc.com (NeXTmail)
________________________________________________________

The best solution might be that to use "typedef".  Simply, you define
a GaussianType as:

typedef void (*GaussianType)(float, float *, float *);

and then declare

- mothodName : (GaussianType) handler
{
 // ...
 return self;
}

and that will do.

ken
zhao@acsc.com
________________________________________________________
Try

- methodName:(void (*gaussian)(float, float*, float*)));

Perhaps this will work (types have to be in parenthesis).

Marcel
waldvoge@nessie.cs.id.ethz.ch (Marcel Waldvogel)
________________________________________________________
Thanks 
Alastair McLean
alastair@hecate.phy.queensu.ca

Newsgroups: comp.sys.next.programmer
From: fjh@oce.nl (Erik Hommersom)
Subject: InterfaceBuilder: No KeyAndOrderFront at app's startup??
Originator: fjh@oce-rd2
Keywords: ProjectBuilder; InterfaceBuilder; makeKeyAndOrderFront
Organization: OCE Nederland B.V.
Date: Tue, 5 Jan 93 13:09:20 GMT

Hi there,

When I start an application, made with InterfaceBuilder in a Terminal, 
it is not activated, but the Terminal application remains the active
application. 

Instead I would like to have MyApplication become active after it has been
launched from a Terminal, without having to click on one of its windows. 

The problem I have is that I cannot figure out where to call the method
"makeKeyAndOrderFront" if not in the main.m program generated by
InterfaceBuilder?

Can someone tell me how to activate an application at startup under these
conditions?

Thanks,

Erik Hommersom
OCE Research & Development, Venlo, The Netherlands

      ###########################################################
      #  This note does not necessarily represent the position  #
      #     of Oce-Nederland B.V. Therefore no liability or     #
      #      responsibility for whatever will be accepted.      #
      ###########################################################
Newsgroups: comp.sys.next.programmer,comp.sys.next.bugs
From: ben@fizz.fdn.org (Benoit Grange)
Subject: Strange things in make depend
Date: Sun, 10 Jan 1993 14:46:22 GMT

If you issue a make depend command in a project, the file  
Makefile.dependencies contains references of *ALL* the appkit headers for  
each object file. This produces HUGES dependencies list (more than 100Kb),  
slowing down the make process.

To build the dependencies make depends issues 'cc -MM <all sources> |  
awk...' and the cc manual says

     -MM  Like -M but the output mentions only the user-header
          files included with #include "file".  System header
          files included with #include <file> are omitted.

So why are all imported <appkit/xxx.h> listed ? Is that because of #import  
instead of #include ? I don't care having dependencies with them.

I currently use a sed script to remove all this stuff. My makes are now  
going somewhat faster. The first command issued appears after one second  
instead of something like 5 or more seconds.
-- 
----
Benoit Grange - PARIS - FRANCE

Mail to : ben@fizz.fdn.org (SMALL NeXTMails accepted, < 10kb)
Xref: sparky comp.sys.next.programmer:7991 comp.sys.next.misc:23519
From: gildayn@harborcoat.cs.mcgill.ca (Neil GILDAY)
Newsgroups: comp.sys.next.programmer,comp.sys.next.misc
Subject: Ideas for financial applications needed!!!
Date: 5 Jan 93 20:13:45 GMT
Organization: SOCS, McGill University, Montreal, Canada

Hi,

I am looking for ideas for financial applications that need to be built.

Imagine that I have an extremely powerful real time market data developer's  
kit, a powerful real time financial news developer's kit, and a bunch of  
powerful programmers; what should I build???

neil
Newsgroups: comp.sys.next.programmer
From: ben@fizz.fdn.org (Benoit Grange)
Subject: About dragging non square images
Date: Sun, 10 Jan 1993 15:59:18 GMT

I am implementing a dragging operation in one of my applications.
The dragged image is some rectangular bitmap, sized between 20 and 140  
pixels. It may be square, but some are not.

When dragging it over a NeXT Mail window, the dragged image is truncated,  
or messed up with an other image (part of the image is recovered with an  
other). Is that a known bug, or should the dragged image be square ? I  
can't find statements about this in the documentation.
-- 
----
Benoit Grange - PARIS - FRANCE

Mail to : ben@fizz.fdn.org (SMALL NeXTMails accepted, < 10kb)
From: goodmadi@NeXTwork.Rose-Hulman.Edu (David I Goodman)
Newsgroups: comp.sys.next.programmer
Subject: Determining Line hieght in a rich text object
Date: 13 Jan 1993 05:48:46 GMT
Organization: Computer Science Department at Rose-Hulman
Reply-To: goodmadi@NeXTwork.Rose-Hulman.Edu (David I Goodman)
NNTP-Posting-Host: o233-26.nextwork.rose-hulman.edu
Keywords: text, line height, font size, clueless

I am trying to determine the height of a line of text in a text object.  The  
text object will contain rich text, which may include multiple size fonts.  The  
text object contains an array of breaks which allows me to determine _IF_ a  
change took place, but I can't figure out how to tell what the change was.  The  
sign (bit) of the line descriptor in the break array notifies me when a change  
occurs, does anybody know where to look from there?  Any clues would be most  
appreciated.

--Dave
---------------------------------------------------------------------------
| David I Goodman -- goodmadi@nextwork.rose-hulman.edu                    |
---------------------------------------------------------------------------
"We live in our minds, and existence is the attempt to bring that life into  
physical reality, to state it in gesture and form."
			- Howard Roark
			_The_Fountainhead_ by A. Rand
From: dave_moore@next.com (Dave Moore)
Newsgroups: comp.sys.next.programmer
Subject: Re: Symbol tables of dynamically loaded objects in gdb
Date: 4 Jan 93 18:31:01 GMT

In article <1hdse7INNslm@gap.caltech.edu> bchen@cco.caltech.edu (Bing-Qing  
Chen) writes:
> I was trying to figure out how to add symbol tables of dynamically  
loaded
> objects to gdb. According to the GDB document, I tried the following
> commands: "load file", "load-file file" and "add-symbol-file file addr".
> The first command returns "You can't do that when your target is `exec'"
> if the program is not running or "You can't do that when your target is
> `child'" when it is running, I wonder when I can use the "load"  
command?!
> The second command seems to do nothing, while the third command does not
> recognize address argument and it crashes gdb with "Segmentation fault"
> if no address is given. This is really frustrating. Any help would be
> greatly appreciated.
> 
> Thanks,
> Bing Chen
> bchen@cco.caltech.edu

If you're running on 3.0 you shouldn't have to do anything to get the  
symbols loaded.  Gdb just notices that code was loaded, and loads up the  
symbols.  In fact you can use the future-break (fb) command to set  
breakpoints in the code before you load it.  Any breakpoints in it are  
forgotten about when the code is unloaded or the program is restarted, but  
they come back when the code is loaded again.  It just ought to work.  

As for the above commands add-file is the one to use.  This can force  
symbols in.  If you supply a "debug-file" argument to rld_load or  
objc_loadModules (there is no way to do this if you're using bundles),  
this is the file to give to add-file.  If you don't do this, but know what  
address the code was loaded at you can give this address as a second  
argument to add-file with the original object file as the first one.

Dave Moore
Software Development Tools
NeXT Computer, Inc.
From: tjhendry@king.mcs.drexel.edu (Jonathan Hendry)
Newsgroups: comp.sys.next.programmer
Subject: Re: Workspace ghosting rules
Date: 9 Jan 93 19:33:31 GMT
Reply-To: tjhendry@king.mcs.drexel.edu (Jonathan Hendry)
Organization: Drexel University

In article <1993Jan8.161309.1075@afs.com>, Michael_Pizolato@afs.com (Michael Pizolato) writes:
|> In article <1993Jan7.152148.285@afs.com> Michael_Pizolato@afs.com (Michael  
|> Pizolato) writes:
|> > I'm working on some drag 'n' drop stuff where I intend to use ghosting,
|> > a la File Viewer. [rest deleted]
|> 
|> I just discovered an icon called "badFolder.tiff" in
|> /usr/lib/NextStep/Workspace.app/WM.app, so that's how the "ghosting"
|> is done for folders the user has no permission to see.
|> 
|> Also, I received a suggestion to try 1/3 alpha and NX_WHITE sover'd
|> over the icon for ghosting during drag, but while it's much closer
|> than the 50% NX_LTGRAY I was using (thanx Scott!) it's still not
|> identical to what File Viewer does. 
|> 
|> BTW, I forgot to mention that I'm running NeXTSTEP V3.0. 
|> 
|> Still searching,
|> Michael
|> 
|> --
|> Michael_Pizolato@afs.com
|> ~18 kyu
|> Q16
|> NeXTMail appreciated

Ah. I see you`ve learned your lesson about flaming. :)


-- 
Jonathan W. Hendry
Drexel University College Of Information Studies
Anderson Financial Systems "Programmer-in-Exile" :)
hendryjw@duvm.ocs.drexel.edu (No NEXTMail :( )
From: rawyatt@phakt.usc.edu (Robert Alexander Wyatt)
Newsgroups: comp.sys.next.programmer
Subject: Screen Black Out
Date: 3 Jan 1993 23:14:50 -0800
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: phakt.usc.edu


Does anyone know how to black the screen out entirely on a mono system once one
has logged out...is there an app to do this? Something like BackSpace which can
run once all users are logged out...

I know this is probably a silly question, but I had to ask...

-Rob
rawyatt@scf.usc.edu


Newsgroups: comp.sys.next.programmer
From: paul@phoenix.Princeton.EDU (Paul Lansky)
Subject: Micropolis 2gig drive problems
Originator: news@nimaster
Organization: Princeton University
Date: Mon, 11 Jan 1993 22:16:19 GMT


We just took delivery of a Micropolis ASI-500L 
2 Gig (formats to 1.7 gig) drive.  It is plug
and play and comes up with no problems.  
What is wrong is that it is quite slow on 
non sequential transfers.  That is cating
a big file to /dev/null (using dd) yields
only about a 400kbyte per second transfer
rate.  This is very slow.  Our wrenVII gives
us almost a meg a second under these conditions.

The NeXT disk utility program, on the other
hand shows a 1.5 meg per second transfer
on sequential transfers, but this is 
not how life works.  The disk is formatted
at 512k.

Anyone have any experiences or recommendations
on this?

Thanks

Paul Lansky
paul@princeton.edu

Newsgroups: comp.sys.next.programmer
From: Michael_Pizolato@afs.com (Michael Pizolato)
Subject: Re: Workspace ghosting rules
Reply-To: Michael_Pizolato@afs.com
Date: Fri, 8 Jan 1993 16:13:09 GMT

In article <1993Jan7.152148.285@afs.com> Michael_Pizolato@afs.com (Michael  
Pizolato) writes:
> I'm working on some drag 'n' drop stuff where I intend to use ghosting,
> a la File Viewer. [rest deleted]

I just discovered an icon called "badFolder.tiff" in
/usr/lib/NextStep/Workspace.app/WM.app, so that's how the "ghosting"
is done for folders the user has no permission to see.

Also, I received a suggestion to try 1/3 alpha and NX_WHITE sover'd
over the icon for ghosting during drag, but while it's much closer
than the 50% NX_LTGRAY I was using (thanx Scott!) it's still not
identical to what File Viewer does. 

BTW, I forgot to mention that I'm running NeXTSTEP V3.0. 

Still searching,
Michael

--
Michael_Pizolato@afs.com
~18 kyu
Q16
NeXTMail appreciated
Newsgroups: comp.sys.next.programmer
From: Bob_Vadnais@pdh.com (Bob Vadnais)
Subject: Re: Setting the UNIX Preferences from a service
Reply-To: Bob_Vadnais@pdh.com
Organization: PDH, Inc.
Date: Tue, 5 Jan 1993 00:59:09 GMT

In article <1993Jan3.073519.1235@parsec.mixcom.com> 
alberto@parsec.mixcom.com (Manuel Alberto Ricart) writes:
>
> Is there a way of messaging the Workspace to be in UNIX
> Expert mode? (Is there a way of finding out what messages
> the Listener responds to?)  

I'm not sure if there's an officially documented way to do it,
but there's no black magic involved and it's not very complicated.
All you need to do is set the preference in the defaults database,
then use the NXWorkspaceRequestProtocol method to notify the 
workspace that the defaults database changed.  

The following function should do just that.

void setUnixExpert(BOOL expert) 
/* Requires NS3.0 or greater (for NXWorkspaceRequestProtocol) */
{
  const char *unixExpertValue = NXGetDefaultValue("System", "UnixExpert");
  const char *newUnixExpertValue = expert ? "No" : "Yes";
  BOOL changeDefault = (unixExpertValue == NULL) || 
                (strcasecmp(unixExpertValue, newUnixExpertValue));
   
  if (changeDefault) {
    NXWriteDefault("System", "UnixExpert", newUnixExpertValue);
    [[Application workspace] defaultsChanged];
  }
  
}

Cheers,
Bob
--
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
Newsgroups: comp.sys.next.programmer
From: matt@drefla.mese.com (Matt Brandt)
Subject: Arcs and circles from curveto
Organization: Applied Engineering
Date: Mon, 11 Jan 1993 01:42:46 GMT

I've been able to come up with a pretty good approximation of a circle
using curveto that works like this:

	x y rad 0 180 arc

is approximately equivalent to:

	x-rad y x-rad y+2*rad/3 x+rad y+2*rad/3 x+rad y curveto

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.

matt
From: Robert_La_Ferla@hot.com
Subject: Re: Selection in rotated text?
Keywords: Text, NeXTSTEP 3.0, barcode
Reply-To: Robert_La_Ferla@hot.com
Organization: Hot Technologies
Date: Fri, 8 Jan 1993 17:19:14 GMT

The NeXTSTEP 3.0 Text object does.  Both our bar code objects (BarCodeKit)  
 
and application (Bar-a-Coda) allow you to edit the text portion (a Text object) of a bar code while it is rotated.

Robert La Ferla
Hot Technologies

In article <1993Jan7.194739.3816@pilhuhn.ka.sub.org> jr@sade.ka.sub.org (Jochen Richter) writes:
> Hi,
> 
> the NeXTSTEP text object doesn't support selection in rotated text.
> Is there any workaround?
> 
> Any suggestions appreciated.
ted.

Robert La Ferla
Hot Technologies

In article <1993Jan7.194739.3816@pilhuhn.ka.sub.org> jr@sade.ka.sub.org (Jochen Richter) writes:
> Hi,
> 
> the NeXTSTEP text o
Newsgroups: comp.sys.next.programmer
From: gad@eclipse.its.rpi.edu (Garance A. Drosehn)
Subject: Re: The Darker Side of C++ (forwarded)
Date: Tue, 12 Jan 1993 22:47:26 GMT

bjorn@darmok.uoregon.edu (Bjorn S. Fjeld Pettersen) writes:
> rpomeroy@aunext1.amd.com (Ron Pomeroy x(Coop)) writes:
> >       [quoting from a paper:]
> > >>The worst disadvantage of C++ at the moment is political:  accepting
> > >>C++ as the standard OO language de facto tends to kill other existing
> > >>languages, and stifle the development of a new generation of
> > >>essentially better OO languages.
> > 
> > Aaaaaaaaaamen!!
> > 
> > --
> > Ronald Pomeroy		[Objective-Cruntime: [Smalltalk runtime]];
> 
> When I can do this in Obj-C I would be happy (tm):
> 
> 	String a = "hello", b = " ", c = "world";
> 	cout << a + b + c + '\n';

I do wish Objective C (and every other language) did handle character  
strings in a much more reasonable manner (such as the above).  I really  
really hate the C idea that a string is an array of characters, and that the  
compiler doesn't have any concept of what to do with it.

> Until then things (tm) look soooo much prettier in C++.

Well, the above looks prettier, that doesn't mean that all C++ code looks  
prettier.

> (BTW, where is that multiple inheritance in Obj-C???)

Seems to me that more people have hung themselves trying to use multiple  
inheritance in C++ than have really missed multiple inheritance in Objective  
C.  In any case, that ignores the issue mentioned in the paper.  With  
everyone jumping to have C++ as "the OOP language", *all* other OOP  
languages will be stifled.  I'll grant that Objective C isn't the ultimate  
OOP language, but that doesn't mean that C++ *is*.

(from what I know of things, which is unquestionably limited, I think I'd  
favor something more like Modula-3 myself.  But then, I don't know things  
like Smalltalk at all)

I really REALLY don't mean to encourage a religious war over languages, but  
I hate *anyone* quoting a 3-line program and saying "See, this program  
proves that everything in language X is better than everything in language  
Y".  You can't intelligently compare computer languages based on a tiny  
snippet of code.

--
Garance Alistair Drosehn     =     gad@eclipse.its.rpi.edu
ITS Systems Programmer            (handles NeXT-type mail)
Rensselaer Polytechnic Institute;           Troy NY    USA
From: xepo@csd4.csd.uwm.edu (Scott R Violet)
Newsgroups: comp.sys.next.programmer
Subject: Querying Event Driver
Date: 11 Jan 1993 03:40:57 GMT
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Distribution: usa
NNTP-Posting-Host: 129.89.7.4
Originator: xepo@csd4.csd.uwm.edu


HI all,
	I trying to write a program that needs to be able to check
what is being typed on the keyboard even if this app isn't the current
app.  I found the way to get the address of the keyboard device, but
from there I am unsure as to what to do.  Is there a specific place
from the beginning of the device address that can tell me what the
current key that was pushed is?  Or would it be impossible for me to
try and accomplish something like this?  Can what I want to do be
accomplished with some ioctl() calls?  And if so, what would they be.
Any comments or suggestions would be great,
-- 

		-Scott Violet (xepo@csd4.csd.uwm.edu)
From: bjorn@darmok.uoregon.edu (Bjorn S. Fjeld Pettersen)
Newsgroups: comp.sys.next.programmer
Subject: Speaker and Listener
Date: 4 Jan 93 07:44:22 GMT
Article-I.D.: pith.1i8psmINNr2b
Organization: University of Oregon Network Services
NNTP-Posting-Host: cisco-ts2-line27.uoregon.edu

Well I almost get it to work. I start up my speaker, it starts up the listener,  
and nothing happens :(

Could some kind soul out there send me the necessary code -- preferably using  
msgwrap for the messages. Also a question: does the speaker have to have an  
NXapp?

All help would be greatly appreciated!

--bjorn

------------------------------------------------------------------------------
Bjorn S. Fjeld Pettersen
bjorn@doek.uoregon.edu                       NextMail Welcomed
#include <std-disclaimer.h>
------------------------------------------------------------------------------
From: izumi@pinoko.berkeley.edu (Izumi Ohzawa)
Newsgroups: comp.sys.next.programmer
Subject: Re: Pointers to functions in method definitions
Date: 6 Jan 1993 09:49:24 GMT
Organization: University of California, Berkeley
Distribution: world
Reply-To: izumi@pinoko.berkeley.edu
NNTP-Posting-Host: moica.berkeley.edu

In article <6164@rosie.NeXT.COM> sam_s@NeXT.com (Sam Streeper) writes:
>alastair@hecate.phy.queensu.ca (A.B. McLean) writes:
>> I want to write a method that will accept a pointer to a C function.
>
>I would guess that this isn't directly possible; it looks like the Objective-C  
>runtime doesn't have the ability to encode data of type function pointer.

In NextDeveloper/Examples/AppKit/Graph/Expression.h, there is an example
that uses typedefs.  It may not cover all situations, but at least
the code can remain comprehensible if you can use it.


/* function supplied by term implementor for evaluation */
typedef float EXPTermEvalFunc(int numArgs, float *args);

 .....

- addFuncTerm:(const char *)name minArgs:(int)min maxArgs:(int)max
					evalFunc:(EXPTermEvalFunc *)func;
 /*
  * Adds a function to the set of functions this Expression can parse.
  * Functions look like "name(arg1, arg2,...)" in the text that is
  * parsed.  At evaluation time the C function func() will be called with
  * the values of the arguments. ....
  */


--
Izumi Ohzawa             [ $@Bg_78^=;(J ]
USMail: University of California, 360 Minor Hall, Berkeley, CA 94720
Telephone: (510) 642-6440     Fax:  (510) 642-3323
Internet: izumi@pinoko.berkeley.edu (NeXT Mail OK)