HDTenEightyP/NetNews huggingface dataset:
From: davidc@brahms.udel.edu (David Casper)
Subject: 3 Questions...Please
Organization: University of Delaware
Date: Fri, 14 Aug 1992 02:53:31 GMT

Help!
 
I am far from an expert at writing code! :-)  I have a few 
questions...and I would greatly appreciate any help.  The
questions are conceptual, so I would be happy with just a
couple of sentences to guide me in the right direction (however,
I am not intimately familiar with all of the C/C++ programs
that are at my disposal...so please mention key functions by
name)  Also, if anyone has written code that does some of
the things that I'm looking for (and if it's not a problem),
please email...even without any explanations (I would learn
from trying to figure it out myself!)
 
(NOTE: I'm using Borland C/C++ 3.1)
 
1.  I am looking for any help/direction/code/hints/etc...
    concerning a general Graphical User Interface.  i.e.,
    the "standard" menu-bar across the top of the screen
    and pull-down-menus, pop-up windows, dialog boxes, etc...
    (I know that the Windows platform for BC++ takes care
    of a lot of the "dirty work" for Windows programs, but
    I would like to create DOS programs)  I don't even
    know where to start, but I do know that I need to create
    general routines...so if anyone wouldn't mind sharing
    code, please send.
 
2.  I am also looking for any help with incorporating a standard
    mouse into my programs.  What functions should I use...once
    again: anyone willing to send code?
 
3.  Also, how do I go about printing out a screenful of graphics
    to a "standard" HP laser printer (or similar)?
 
ANY help -- no matter how short (or if it's just some code sent
with/without explanation) will be GREATLY APPRECIATED.  
Or, could someone direct me to an anonymous FTP site that might
have C/C++ code?
 
Thanks in Advance,
David (davidc@brahms.udel.edu)

-- 
David W. Casper
davidc@brahms.udel.edu
From: rmartin@thor.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: Is C++ "for the rest of us" ?
Date: 20 Aug 92 02:06:12 GMT

rons@hardy.u.washington.edu (Ronald Schoenberg) writes:

>It seems to me that an important distinction exists between those who
>write classes (who are expert in C++) and those who use them (who
>don't have to be). 

I don't agree with this philosophy.  I don't think that OO divides
programmers into "class writers" and "class users".  In any
cooperative effort, where software is split into subsystems and teams
are assigned to write those subsystems; the subsystems will have to
communicate with each other.  Thus, each team will have to write
classes which will be used by the other teams.

A real object oriented application is not composed of a few classes
glued together with a lot of c-like functions.  It is a set of
interacting classes.  There should be almost no executable code which
is not a method of a class.


--
Robert Martin                        Training courses offered in:
R. C. M. Consulting                       Object Oriented Analysis
2080 Cranbrook Rd.                        Object Oriented Design
Green Oaks, Il 60048 (708) 918-1004       C++
From: young@umd.edu (Neal Young)
Newsgroups: comp.lang.c++
Subject: simple C++ X-windows lib? (help me not reinvent the wheel)
Date: 17 Aug 92 22:50:56 GMT
Organization: UMIACS


I want to write some very simple X-windows C++ code:
a few buttons, some interactive graphics (draw
circles, bitmaps, text, get mouseclicks).

I'm new to C++ and X-windows.
If you've been through this already,
maybe I can learn from your experience.

I have athena widgets and g++-2.2.

My question: what approach would you recommend:

(a) Have C++ call C routines using Xlib and/or Xaw.

(b) Ditto with a more complete toolkit than Xaw.
    (Requires installation of the toolkit.) 
    If so, which?

(c) Install and use one of the existing C++ class libraries
    mentioned in the X-windows FAQ.  If so, which?

(d) Just use "C", no C++.

(e) Other?

Thanks for your feedback.

Neal
--


	Neal Young  <young@umiacs.umd.edu>
Newsgroups: comp.lang.c++
From: ba2431216@ntuvax.ntu.ac.sg
Subject: test
Organization: Nanyang Technological University - Singapore
Date: Thu, 20 Aug 1992 07:12:13 GMT

Hello,

This is a test. Please remove this message.

Newsgroups: comp.lang.c++
From: teb@dendron.forestry.umn.edu (Thomas E. Burk)
Subject: using extended(?) memory with BC++
Reply-To: teb@dendron.forestry.umn.edu (Thomas E. Burk)
Organization: University of Minnesota
Date: Fri, 14 Aug 1992 15:04:10 GMT


I am writing a C++ program that requires approximately 400KB for data.  Using
BC++ on a Gateway 2000 - 486 w/ 3 MB RAM, I encountered problems allocating  
space for my data because the program was restricted to ~350 KB for data.  I
tried to use the large memory model, but that did not work.

Is BC++ capable of using extended(?)/expanded(?) memory or is it capable of
virtual memory with paging to disk?
 
--
Please e-mail me at mnguyen@mercury.forestry.umn.edu and I will summarize.
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++
Subject: Re: Doubly-linked list trick (was Re: Garbage Collection for C++)
Date: 19 Aug 92 17:32:41 GMT
	<DAVEG.92Aug14194411@synaptx.synaptics.com> <2009@appli.se>
	<16ovt2INN3nq@early-bird.think.com> <2134@appli.se>
Reply-To: tmb@idiap.ch
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
In-reply-to: niklas@appli.se's message of 19 Aug 92 08:33:14 GMT

In article <2134@appli.se> niklas@appli.se (Niklas Hallqvist) writes:

   Emphasises mine!  This means the trick WILL be portable to all platforms
   where there exists an integral type large enough (ie. almost all platforms).
   I agree that this may be a bad habit, BUT... what I wanted to tell was:
   It's REAL HARD (read: impossible) to implement GC on most architectures if
   this rule [allowing conversions of pointers to/from integers] is left in.

No, it's not at all hard. Since C++ programs that rely on
integer/pointer conversions are already unportable, a very small
number of these already unportable programs would simply be unportable
to a larger number of implementations.

In practice, none of this is a significant problem: even if you carry
out integer/pointer conversions, almost all of the time you are going
to keep the real pointer around, either as an integer or as a pointer.
Those old program programs that don't (if any) can be run either with
GC turned off, or they can be modified slightly to keep the original
pointers around.

C/C++ has undergone significantly greater changes than this.

For a more extensive discussion of these issues, I suggest looking at
comp.compilers.

					Thomas.

PS: Where was the outcry of indignation when, all of a sudden,
uninitialized static member definitions didn't count as definitions
anymore? Unlike restricting encoded pointers, this did force me to
change some of _my_ source code.

PPS: As to the XOR trick, you can use doubly linked lists of small
arrays of elements to get equivalent space savings portably.
Newsgroups: comp.lang.c++
From: fjh@mundil.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Problem: Viewing intermediate C in Borland C++?
Organization: Computer Science, University of Melbourne, Australia
Date: Fri, 21 Aug 1992 16:50:23 GMT

kazi@chopin.udel.edu (Zunaid Kazi) writes:

>Is it possible to view the intermediate C files in Borland C++,
>like the +i option for CC?

No. Borland C++ compiles directly to object code. There are no
intermediate C files.

The closest thing to the +i option for CC is the -S option will produce
assembler output.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature VIRUS is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Tagged Pointers
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Wed, 12 Aug 1992 14:24:27 GMT

In article <9222518.29850@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>
>>>Ok, what about tagged references for ortogonality?
>>
>>	And tagged values, right?  (Also known as tagged unions).
>>
>>	I originally put 'and you have tagged references just like
>>tagged pointers (so I needn't describe them) execpt that the
>>syntax is different' in my post.
>>
>>	But now I don't think that you can HAVE tagged references.
>>Tagged pointers are VARIABLES, like pointers. References are not,
>>they cannot be changed. If you had tagged references you would knoy
>>be able to use them where you coudl use a pointer:
>>
>>	[T1, T2]& r;
>>	r.function();
>>
>>Am I wrong on this, do tagged references make sense?
>
>Yes, they do make sense.
>
>For example, although the tag cannot change, you can still pass a tagged
>reference to a function that does not know what the tag is.
>

	Tagged references make sense. My proposal for tagged pointers
should be modified to remove the restriction that, for example

	[X,Y] *p;
	p->f();

must have the same return type (i.e. X::f() and Y::f() need NOT have
the same return type. One just duplicates the whole statement,
and then factors out common subexpressions. ALternatively,
differentiate the cases up the parse tree until a common return
type is found---always at the statement level since a statement 
is implicitly

	(void) expr;

This is the rvalue rule. For lvalues the rule is opposite,
of the multiple cases one must be prefered.

The idea of tagged pointer and references, though is NOT to declare
functions taking them as arguments, so much as to declare multiple
functions, one for each type:

	f(float*);
	f(int*);
	f(double*);
	f(char*);

	[float,int] *p;
	[int,double] *q;

	f(p); f(q);

This is more efficient, achieving object code reuse.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: panetta@cithe503.cithep.caltech.edu (James Panetta)
Subject: problem with overloading * in a template
Keywords: templates, operator overloading
Reply-To: panetta@cithe501.cithep.caltech.edu (James Panetta)
Organization: California Institute of Technology, Pasadena
Date: Fri, 21 Aug 1992 01:19:16 GMT

I am trying to implement an abstract vector datatype (how original!).
The problem is, I need the length to be placed in the declaration.
With this in mind, I am trying to overload the binary * operator to
output the (unit metric) scalar product, and the syntax of the overload is
giving me major problems.

Here is  my code:

#include <iostream.h>

template<class T,int n>  class vector
{
   protected:
      T* data;
      int siz;
   public:
      vector() : siz(n) , data(new T[n]) { /*verify*/ }
/* standard dot product */
      T operator *(const vector& , const vector& );
};  /* class vector */

template <class T, int n>
T vector<T,n>::operator *(const vector& v1, const vector& v2)
{
	T dotprod=0;
	   if ( (n != v1.siz)
        || ( n != v2.siz)
        || ( v1.siz != v2.siz ))
   {
      cout << "Vector size mismatch in dot product";
      return 0;
   }
   for (int i=0 ; i < n ; i++) dotprod += v1.data[i] * v2.data[i];
   return dotprod;
}

main()
{
        vector<float,3> foo, bazz;
        vector<float,5> bar;
        float dp;

/* assume vectors have been set to something meaningful */

        dp = foo * bazz;
        cout << "foo * bazz = " << dp << endl;
}


When I compile this code on a VAX using GNU C++ version 2.2.2 (vax vms)
I receive the error message:
vector.cc:type conversion required for binary operation on types 
    `vector<float ,3>' and `vector<float ,3>'

I assume there is some problem in my defining sequences for the operator.
I have checked in ARM and Barkakati's OOP in C++, and they aren't much help.

Please e-mail me with solutions.

Jim Panetta

-- 
Panetta@cithex.caltech.edu          :-(     A witty saying proves nothing.
Panetta@cithex.bitnet               :-|
Panetta@cithe503.cithep.caltech.edu :-)                             Voltaire
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++
Subject: Re: destruction of temporaries
Date: 20 Aug 92 18:26:10 GMT
	<23466@alice.att.com> <3920@starlab.UUCP> <23487@alice.att.com>
Reply-To: tmb@idiap.ch
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
In-reply-to: ark@alice.att.com's message of 19 Aug 92 18:22:44 GMT

In article <23487@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:

   Destruction at end of block is far from a hopeless approach, but I
   think it loses on balance.  Indeed, there's something to be said for
   almost every approach, which is why this is a knotty problem.

Let me put in another vote for leaving things the way they are.

People want temporaries to live longer so that they can write
certain expression that involve returning pointers or references
to (the contents of) temporaries.

However, delaying the destruction of temporaries (say, to the end of
an expression) fixes nothing. It makes a slightly larger set of
programs acceptable, but you still have to know in detail whether some
object has been derived in one way or another from a temporary. For
example, "char *p = s+t;" still leaves "p" undefined (if s and t are
Strings).

The price you pay is that of making another set of programs use
(sometimes considerably) more memory. This is important in particular
for scientific applications, which can use many large temporaries
during a single expression. Such expressions (usually already tricky
the way they are) would be nearly impossible to rewrite by hand in
order to minimize memory use.

Maybe the ANSI C++ committee will accept this change.  I think it
would be a big mistake. I'm generally for features that make life
easier for the programmer, but the price for this one is simply too
high.

You can avoid unexpected behavior involving temporaries by programming
defensively. In particular, this means: do _not_ return a reference or
pointer to an explicit or implicit argument or its contents (*this,
call-by-value, call-by-reference). Furthermore, do _not_ define cast
operators to pointer types in your classes (instead, make them normal
member functions that you have to call explicitly).

					Thomas.
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Distribution: world
Subject: Re: Is C++ "for the rest of us" ?
X-Mailer: cppnews $Revision: 1.14 $
Organization: Trumphurst Ltd.
Date: Wed, 19 Aug 1992 21:53:41 +0000


In article <1992Aug17.154133.21417@saifr00.cfsat.honeywell.com> lam@saifr00.cfsat.honeywell.com (Josh Lam) writes:

> Like you mentioned, using C++ requires a new way of thinking.  
I would dispute that - C++ ALLOWS a new way of thinking - it does not 
REQUIRE it - you can use C++ as a "smarter C" if you wish (this is one of 
its greatest strengths - and greatest weaknesses).

Mind you, most programmers will WANT to get to grips with OOP as soon as 
they see the possibilities.
---
Nikki Locke              |                        | nikki@trmphrst.demon.co.uk
Trumphurst Ltd.          | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
PC and Unix consultancy  | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Demon.co.uk is a dial-up subscription access point to the Internet.
Newsgroups: comp.lang.c++
From: Bob Hathaway <objsys@netcom.com>
Subject: Re: Object What is an OODBMS?
Date: Thu, 13 Aug 92 02:08:25 GMT
Organization: Object Systems

In article <BEVAN.92Aug12152127@jaguar.cs.man.ac.uk> bevan@cs.man.ac.uk (Stephen J Bevan) writes:
>In article <RCZ5NS@netmbx.netmbx.de> jrobie@netmbx.netmbx.de (Jonathan Robie) writes:
>   When we create a new class we frequently want to use code or data 
>   that already exist in another class.  For instance, if we have a class 
>   called LinkedList we might choose to use this when implementing our 
>   stack.  In fact, we might say that a Stack is a LinkedList which also 
>   has the push() and pop() functions.  We can do this directly using a 
>   mechanism called inheritence:
>
>       class Stack : public LinkedList
>       {
>       public:
>	   void    push(int i);
>	   int    pop();
>       };
>
>   In this example we would call LinkedList the base class and Stack the 
>   derived class.
>
>Is this generally considered good use/example of inheritance?

No.  It should be privately inherited in C++ or even contained as
an aggregate member as I believe you suggest below.

>I don't think a "Stack is a LinkedList" at all, rather a
>LinkedList is a possible implementation of a Stack.  I'd therefore use
>parametric rather than inclusion polymorphism to represent this (i.e.
>use a template in C++ speak).  Is my preference for parametric rather
>than inclusion polymorphism blinding me to some advantage in the
>above?

With generics you lose the inclusion polymorphism of the base class.
Same (recommended) loss with private inheritance though.

bob
objsys@netcom.com
Newsgroups: comp.lang.c++
Subject: Help : Encryption Algorithms
From: ebolog@elaine.ee.und.ac.za (EDWIN BOLOGNA : THIRD)
Date: 20 Aug 92 13:08:51 +0200
Organization: Electronic Eng., Univ. Natal, Durban, South Africa


Does anyone out there happen to have PAS, C, or ASM source code to decode
and code good encryption algorithms.

Any information at all on any of these algorithms will be greatly appreciated.

        Desperate fellow programmer (And very Greatful for any information)

                E.B. (EBOLOG@ELAINE.EE.UND.AC.ZA)

PS : Please be kind hearted and Assist !
Xref: sparky comp.lang.c++:12772 comp.std.c++:1106
From: gtj@goanna.cs.rmit.oz.au (Glenn T Jayaputera)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Need help on Template
Date: 23 Aug 92 11:11:51 GMT
Followup-To: poster
Organization: RMIT Department of Computer Science

I need help....
I would like to create a class template that can print it content.
since the value contained can be anything (user define or base types), then I
limit the user that he has to defined his own print routine.  This print routine
is in charge on how to print the object.  This print routine will be pass
to the class template when the user wants to print the value of the
class

In short the class template is like this

template <class T>
class someClass {
   T *pVal;
public:
  void printObj(void (*CustomPrint)(T *))  {
    CustomPrint(pVal);
  }
};

class test  {
  int value;
public:
  friend void printMe(test *);
};

void printMe(test *ptest) {
  cout << ptest->value;
}

main()  {
  someClass<test> classObj;
  classObj.printObj(printMe);

  return 1;
}

However, the major drawback of this style is "printMe() should have to be" 
nobody's possesion.  That is I have to make is _friend_ to my type (ie
test).  What I want is the printMe() is the member of class test itself.

Can somebody show me how to do it??

Thank in advance,
Glenn Jayaputera
no one's o

Newsgroups: comp.lang.c++
From: rons@hardy.u.washington.edu (Ronald Schoenberg)
Subject: Re: Is C++ "for the rest of us" ?
Organization: University of Washington, Seattle
Date: Mon, 17 Aug 1992 14:47:11 GMT

In article <1355EN@netmbx.netmbx.de> jrobie@netmbx.netmbx.de (Jonathan Robie) writes:
>I have been talking to managers who are very nervous about
>moving to C++.  It seems to have a reputation for being
>difficult to master, and those of us who program in C++
>are sometimes considered Gurus.
>
>C++ certainly helps structure large projects, and after
>making the switch I have absolutely no desire to go back
>to C.  But it does require a new way of thinking, and it
>has some rather obscure aspects...
>
>What guidelines would you give to a manager who is trying
>to decide whether to use C++ for an new project?  Would you
>suggest that a team with average programmers move to C++ ?
>Should a programming team attempt a C++ project if they do
>not have any C++ gurus to fall back on?
>
>

It seems to me that an important distinction exists between those who
write classes (who are expert in C++) and those who use them (who
don't have to be).  For example, M++ is a library of classes that is
essentially an array language extension of C++.  The author of those
classes was a C++ expert.  The user of those classes, however, needs
little more expertise than that required for any array language like 
MATLAB or Mathematica.  M++ even simplifies doing class design for 
applications because it takes care of memory handling and garbage 
collection. 
    
Soon it will be possible to buy all of the classes one needs to do the
hard stuff and programmers will not have to deal with it if they don't
want to.  At this time, however, companies will probably need at least
one C++ "guru" to do the hard stuff. 
Newsgroups: comp.lang.c++
From: dan@BofA.com (Dan Brockman)
Subject: Re: destruction of temporaries
Organization: Bank of America, Capital Products, RMTG #5906
Date: Wed, 19 Aug 92 01:18:46 GMT

In article <46140@sunquest.UUCP> bill@sunquest.UUCP (Bill Raves) writes:
>know the details of the implementation.  What *specific* guidelines
>would you suggest for avoiding potential problems with unnamed tem-
>poraries?

Guideline suggestion:  I think it a useful exercise when weighing such
questions to contemplate: "Could I do this sort of thing with an int?"
An int is a very basic data type of C, and so serves as a model type in
many respects.  If you could use an unnamed temporary int under conditions
a, b, and c, then maybe an unnamed temporary object of class Foo should
qualify for analogous use, and if not, then why not?

-- 
 ------------------------------------------------------
 Daniel Brockman                       tel 415-953-0406, fax 415-622-2892
 Bank of America, Dept 5906, 555 Calif St
 San Francisco 94104 USA              email uunet!odinba!dan dan@BofA.COM
Xref: sparky comp.lang.c++:12310 comp.object:3198 comp.databases:6092
From: lenzen@next400.fernuni-hagen.de (Frank Lenzen)
Newsgroups: comp.lang.c++,comp.object,comp.databases
Subject: OODBMS-Comparison
Keywords: OODBMS
Date: 13 Aug 92 13:41:33 GMT
Followup-To: comp.lang.c++


    Laboratory for Databases and Knowledge Based Systems
                               


The   laboratory  is  a  part  of  the  chair  "Applied  Computer
Science  I"  of  the  department  for  computer  science  at  the
university  of  Hagen.  It serves for the  transfer  of  know-how
about   actual   developments  in  the  area  of  databases   and
knowledge based systems which are relevant to practice.

One  of  our main research interests lies in the area of "Object-
Oriented  Database  Management  Systems  (OODBMS)".  As  we   are
preparing  a  comparison between different  OODBMS  we  presently
explore  the  systems  ONTOS  of  ONTOS,  Inc.  and  Gemstone  of
Servio Logic for their capabilities.

For  the  purpose  of continous investigation  of  this  kind  of
database management systems we are still  searching for

   -  applications using OODBMS
   -  as  well  as  new  product announcements of developers  and
       distributors.

We  are  also interested in persistent contacts to and  qualified
discussions   with  other  OODMBS  users  as  well   as   product
developers.

If  you  would like to cooperate with us, please send us a  short
note to the following address.

Many thanks in advance for your assistance

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ FernUniversitaet Hagen   +  Frank Lenzen                   +
+ Praktische Informatik I  +                                 +
+ Feithstr. 140            +  Phone-No.: +49.2331.987.2703   +
+ W - 5800 Hagen 1         +  EMail: lenzen@fernuni-hagen.de +
+ Germany                  +  Fax-No. :  +49.2331.987.314    +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   
Newsgroups: comp.lang.c++