HDTenEightyP/NetNews huggingface dataset:
From: kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Re: Will we keep ignoring this productivity issue?
Date: 20 Nov 92 10:20:24 EST

In article <BxyJAF.Js2@cs.uiuc.edu>, johnson@cs.uiuc.edu (Ralph Johnson) writes:
> ghm@sserve.cc.adfa.oz.au (Geoff Miller) writes:
[...]
> Sure, some people that you teach become much better than others.
> But *everybody* who has skills learned them.  *Somebody* taught
> Miles Davis to improvise, even if that somebody was himself (which 
> it probably was, in part, but he could probably tell you the many
> people who helped).  The claim that the main reason why some people
> do better than others is because some people are geniuses and other 
> people are not is sheer mysticism.  I bet Miles Davis is not a
> genius on any standardized test.  
[...]
So what?  Is he a genius in his chosen field?  I disagree about the sheer
mysticism.   We are back in the nature vs nurture argument.  Mye experience
tells me something at variance with your statements here.  People may have
helped, but not that many can take and extent like Davis (and others) do.

> But genetics is much less important than experience.  
Substantiation please.  This statement requires support from data.
[...]
> For example, I
> saw a study of how good debuggers work, and one of the amusing things is
> that they talk to people more than they look at source code.  This particular
> system was very large, and it was impossible to figure out what it did by
> looking at the source code, so the good debuggers knew who the experts
> were and would ask them.  This has helped me a lot.  If the normal techniques
> don't work, I am quicker to ask questions from experts.
Reference please - sounds interesting.

George Kambic
sd
From: rwy@matt.ksu.ksu.edu (Robert Young)
Newsgroups: comp.lang.c
Subject: Using BC and BP together?
Date: 19 Nov 1992 14:59:17 -0600
Organization: Kansas State University
NNTP-Posting-Host: matt.ksu.ksu.edu
Summary: Can BP(any level) use BC++3.1 created libraries?
Keywords: C C++ Pascal

I want to know if the Borland Pascal (any level) and Borland C/C++ 3.1
can be used together.  I have some things written in C/C++ that I would
like to be able to use in a Pascal program.  I'm pretty sure that DLL's
made by BC++3.1 can be used with Windows versions of Pascal or with BP7.0


Years ago, the .OBJ files between TC2.01 and TP3.0(?) were compatible.
How have things changed since then?

Robert Young   rwy@matt.ksu.ksu.edu

Newsgroups: comp.lang.c
From: sbbrown@magnus.acs.ohio-state.edu (Stephen B. Brown)
Subject: Re: the abs() function in C
Organization: The Ohio State University Radio Observatory
Date: Fri, 20 Nov 1992 16:28:07 GMT

>In <pebi.722223424@zephyr.aem.umn.edu> pebi@aem.umn.edu (Peter A. Bidian) writes:
>>Isn't abs(-2)=2 in C?
>>I always get 0.

In article <maurer.722246649@magellan.stanford.edu> maurer@nova.stanford.edu (Michael Maurer) writes:
>you probably want to say abs(-2.0), if the abs() function expects a
>floating point argument.  or abs((double)-2).

Actually, on all the systems I've experience with, the abs() function
works on integers and it's the fabs() function which works on floating
point.  I suspect that Peter's problem is actually that he's expecting
	abs(-2.0)==2.0
to work, and it won't, but
	fabs(-2.0)==2.0
will.  fabs() should probably be called dabs() since it takes a double
argument and returns a double value, but the distinction is moot in
many dialects of C.

Of course, if he's using ANSI style function prototype declarations,
then the compiler can complain about
	abs(-2.0)
so then he's got another problem.  It was actually this example which
convinced me to convert to using function prototype several years
ago, as I had some kind of blind spot about fabs() and in many
situations a K&R compiler won't complain.  E.g.
	double f;
	f = sqrt(abs(-2.0));
will pass, but f is nothing like 1.414...
-- 
Steve Brown, N8HFI              sbbrown@magnus.acs.ohio-state.edu
Chief Engineer, The Ohio State University Radio Observatory ("Big Ear")
Xref: sparky comp.lang.c:16586 comp.software-eng:4310
From: johnson@cs.uiuc.edu (Ralph Johnson)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Re: Will we keep ignoring this productivity issue?
Date: 16 Nov 92 12:11:11 GMT
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL

pdh@netcom.com (Phil Howard ) writes:

>In EE you START from the bottom and work your way up.  You learn to
>understand the building blocks.  Computers SHOULD be taught the same
>way.  In fact I am awfully tempted to say that the circuit theory and
>digital circuits courses should be taught to even though wanting to
>become programmers.  At least some machine language should be.

I can speak about three schools.  I majored in CS at Knox College,
a 4 year liberal arts school, in 1977.  I then got my PhD at Cornell,
and now teach at the U. of Illinois.  Knox required a semester of
circuit theory, a semester of digital circuits (my class project
was to design a PDP-8) and a course on machine language and architecture.
Cornell prides itself on being very strong on theory, and tried its
best to ignore hardware while I was there, but it still had a whole
semester on machine language and architecture, students were encourage
to take courses in EE.  Illinois has an engineering-oriented undergraduate
curriculum.  The core courses include a circuits course (after a year
of physics), a digital logic course, and an assembly language and
architecture course that I am currently teaching.  Students are required
to take an advanced architecture course, too, and some will take an
advanced circuits course.

So, this kind of program is not rare.  I'm sure that all the better
engineering schools have programs like it.  My guess is that it is
less common in a liberal arts schools, since they often will have trouble
finding someone who can teach electronics, but all the schools I went to
taught CS this way  :-)

Ralph Johnson
From: rumisk@garfield.cs.mun.ca (Rubin Dineum)
Subject: Help with C and Unix Books
Organization: CS Dept., Memorial University of Newfoundland
Date: Wed, 18 Nov 1992 21:34:16 GMT

Would any person(s) reading this message recommend a specific book used
for the purpose of self learning and training in programming with C in
the Unix environment?

If you do, I would be extreamally gratefull for the posting (or mailing)
of the title and author.

Much appreciated...




 _____________________________________________________________________________
|                                       \/  |\______\              ~   ~      |
|    `Tis strange but true;             []  | |      |             o- -o      |
|      for truth is often strange,---   []  | |     /                L        |
|        Stranger than fiction.'        []  | |    /  umisk        -=-=-      |
|                                       []  | |   /                `---'      |
|            -- Lord Byron              []  | |   \                  V        |
|                                       []  | |    \  jfernand@nyx.cs.du.edu  |
|                                       /\  | |     \                         |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ |      \~~~~~~~~~~~~~~~~~~~~~~~~
                                             \|_______\


Newsgroups: comp.lang.c
From: wright@staff.tc.umn.edu (Mark Wright)
Subject: Re: Reading Filenames into an ARRAY
Keywords: in MOSDOS, Borland C 3.1
Organization: University of Minnesota
Date: Wed, 18 Nov 1992 22:04:33 GMT

In article <1992Nov18.164544.13273@netcom.com> bobb@netcom.com (Bob Beaulieu) writes:
>I want to be able to display a list of specific files in the current
>directory from within my program. I want to be able to allow users to
>select from a list of these file to be acted upon (printed,deleted,...).
>
>Is there an easy way to do this? It has to be DOS 2.0+ and not a
>windows application.
>
>Any helpful comments will be appreciated!
>
>Thanks,
>
>Bob Beaulieu
>bobb@netcom.com
>-- 
> =============================================================
> Bob Beaulieu                                 bobb@netcom.com  
> San Jose, CA                                 (408) 978-0818  
> =============================================================

Here's what I use.  The first will read in all files matching the file
specifier in path (note: \name will look for a file named name in the root
directory, it will not list the files in a directory \name).  The second
will provide the list of all the directories matching path.
Also, when you are done with char *files[], be sure to free all the strings
allocated by the functions.  Enjoy.

/****************** FILE LIST **********************************************/
 
int file_list( char *files[], char *path )
 
{
  struct ffblk file_info;
  int i;
 
  i = 0;
  if (findfirst( path, &file_info, FA_ARCH ) == 0) {
    files[i++] = strdup( file_info.ff_name );
    assert( files[i-1]  );
    while (findnext( &file_info ) == 0) {
      files[i++] = strdup( file_info.ff_name );
      assert( files[i-1]  );
    }
  }
 
  return i;
}
 
/****************** FILE LIST **********************************************/
 
 
 
 
 
/****************** DIR LIST ***********************************************/
 
int dir_list( char *files[], char *path )
 
{
  struct ffblk file_info;
  int i;
 
  i = 0;
  if (findfirst( path, &file_info, FA_DIREC ) == 0) {
    if (file_info.ff_attrib == FA_DIREC) {
      files[i++] = strdup( file_info.ff_name );
      assert( files[i-1]  );
    }
    while (findnext( &file_info ) == 0)
      if (file_info.ff_attrib == FA_DIREC) {
        files[i++] = strdup( file_info.ff_name );
        assert( files[i-1]  );
      }
  }
 
  return i;
}
 
/****************** DIR LIST ***********************************************/

-- 
Mark Wright
wright@epx.cis.umn.edu
From: dik@cwi.nl (Dik T. Winter)
Newsgroups: comp.lang.c
Subject: Re: Rounding floating point numbers in C
Date: 24 Nov 92 01:45:35 GMT
Organization: CWI, Amsterdam

In article <1992Nov22.040145.6371@u.washington.edu> golbone@stein.u.washington.edu (Sima Hashemifar) writes:
 > No! No! No! You can not in any way deduce the properties of the floating
 > point system based on the rounding behavior.
You do not know how wrong you are.  At the very least rounding behaviour
will give information about the number of bits to store the mantissa of
the number (when given enough roundings).
 >                                              For one, most modern fp
 > units may be convinced to act in many way, affine ...
But they generally do not change it on the fly, so you have to make some
assumptions.
 > More impotantly, there are elementary rules for rounding in scientific
 > world. Any odd number followed by 5 is rounded down while even numbers
 > are rounded up. Based on this simple rule, the results printed above
 > are not valid in your laboratory notebook.
Now I am not in physics but in mathematics, so if physics says the above
it might very well be true (makes my card-play scoring scientific rather
than ad-hoc, I like that).  But you still fail to see that on your system
there is nothing like a trailing 5.  The only possibilities are a trailing
1 or a trailing 0, nothing else is available.

 > BTW, I ran the numbers through my fortran compiler on DEC/Ultrix, I got 
 > the scientifically correct results, BUT the C compiler generated the
 > results above. I can only say that "C" has a different floating point
 > model than Fortran.
I presume that C is pre-ANSI and so uses double precision in its calculations
while Fortran uses single precision only, so actually the C results will
be more precise ;-).  Learn something about the inexactitude of floating-
point numbers.  It helps a lot.

-- 
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland
home: bovenover 215, 1025 jn  amsterdam, nederland; e-mail: dik@cwi.nl
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: const char *p == char const *p ?
Date: 20 Nov 92 09:32:29 GMT
Organization: AND Software BV Rotterdam

In article <Bxzonp.2oH@research.canon.oz.au> greyham@research.canon.oz.au (Graham Stoney) writes:
|jos@and.nl (Jos Horsmeier) writes:

[ I babbled about char * const p; ]

|While Jos it correct in what he says about `char * const p', Jutta is not
|making a mistake, since they're talking `const char * p'.

Yes, Jutta was correct, I simply goofed by misreading the original question.
I'm sorry for the confusion. I realize that I mustn't post or reply when
my morning blood/coffee ratio in my veins is still high ... ;-)

kind regards,

Jos aka jos@and.nl
Newsgroups: comp.lang.c
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Subject: Re: 2-D Arrays, Revisited.
Organization: McGill Research Centre for Intelligent Machines
Date: Wed, 18 Nov 92 10:26:04 GMT

In article <17489@pitt.UUCP>, fahad@cs.pitt.edu (Fahad A Hoymany) writes:

> I am writing a function that should accept a 2-D array (hopefully of
> any size), [...the argument array must be a 2-D array, not done with
> an array of pointers...].

> What should the formal parameters line look like?

This cannot be done without knowing the size of all but the first
dimension at compile time.  To use your "int a[2][5]" example, you have
to know the 5 at compile time.  The formal parameter line can be
deduced easily enough:

- argument is of type int [2][5].
- argument is an array in an rvalue context, so it decays to a pointer
   to its first element; new type is thus int (*)[5].
- formal parameter type must match (modulo a couple of quibbles that
   I'd rather not go into here).

Thus, the formal parameter must have type int (*)[5]:

	sometype dosomething(int (*array)[5])
	{
	 ...
	}

or, if you want to be portable to pre-prototype compilers,

	sometype dosomething(array)
	int (*array)[5];
	{
	 ...
	}

Notice the 5 must be specified.  If you try to write "int (*array)[]"
instead, the resulting pointer cannot really be used; the only value
for the first subscript that makes any sense is 0, since the size of
the pointed-to thing is not known.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.lang.c
From: iceman@honey.cs.mcgill.ca
Subject: C coding style
Organization: SOCS, McGill University, Montreal, Canada
Distribution: NA
Date: Fri, 20 Nov 1992 21:32:53 GMT

Hello,

	What kind of convention is usually used for naming global variables?
	I know Apple recommends adding a lower-case 'g' in front of the
	variable name, e.g. gDeviceList. However, when using multi-file
	projects, this doesn't differentiate between static globals (private
	to the module) and extern globals (public globabls that can be
	refered to from outside the module they're declared in).

--
----------------------------------------
McGill University				E-mail: iceman@cs.mcgill.ca
School Of Computer Science			Tuan Huynh

Newsgroups: comp.lang.c
From: rene@hamel.uucp (Rene Mueller)
Subject: Re: The Correct Way To Write C if-Statements
Organization: Free University of Berlin, Germany
Date: Mon, 23 Nov 1992 22:27:02 GMT

In article <hansg.722248402@risken>, hansg@risken.vd.volvo.se (Hans Granqvist) writes:
|>
|> But, I must object strongly to your
|> saying that there's only need to test 'if' or 'if not'. Some FAQ I think
|> once said (it still does, I presume) that there is a LOGICAL difference
|> to 0, '\0', and NULL. So why not test against the correct values? After
|> all, we are here to aid others understand our code when we are not
|> around anymore... :-)
First 0 and '\0' IS the same (char-values are treated as int inside computations).
Next there is a slightly diffrence between NULL and NUL ('\0').
NULL is defined as pointer!
But inside if-statements it makes no difference!!

|> |>And, then, is there the slight casuality that 'TRUE' was defined to, per
|> |>chance, '4711'?
|>
Hmm..., very little chance...
in most cases were both are defined it will looks this way:
#define	FALSE	0
#define	TRUE	(!FALSE)

|> |Anyone who defines TRUE and FALSE such that (! TRUE) isn't
|> |equal to FALSE or (! FALSE) isn't equal to TRUE shouldn't be coding
|> |in C.  The only pair of values that meet both conditions is 0 for
|> |FALSE and 1 for TRUE.
TRUE

	rene@math.fu-berlin.de
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: Reasons for using C vs. Fortran or vic
Date: 17 Nov 92 12:40:17 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <1992Nov15.204958.21224@csservices.Princeton.EDU>, blume@tyrolia.Princeton.EDU (Matthias Blume) writes:
> In article <1992Nov15.201555.20678@thunder.mcrcim.mcgill.edu>,
> mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
>> 					der Mouse
> BTW, what does ``der'' mean?  If it is intended to resemble the
> german phrase for ``the mouse'', then it should be ``die Maus''... :)

Periodically German-speakers point this out.  I no longer remember the
origin of the name in any detail (it's some fifteen years old).  While
I think the "der" probably comes from German by some (probably
roundabout) route, the phrase is not supposed to be German.

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
Newsgroups: comp.lang.c
From: blume@tyrolia.Princeton.EDU (Matthias Blume)
Subject: Re: Reasons for using C vs. Fortran or vic
Reply-To: blume@tyrolia.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Sun, 15 Nov 1992 20:49:58 GMT

In article <1992Nov15.201555.20678@thunder.mcrcim.mcgill.edu>,
mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
[ real stuff deleted ]
|> 
|> 					der Mouse
					^^^
|> 
|> 			    mouse@larry.mcrcim.mcgill.edu

BTW, what does ``der'' mean?  If it is intended to resemble the german phrase
for ``the mouse'', then it should be ``die Maus''... :)

-Matthias
Newsgroups: comp.lang.c
From: e3ubec@fnma.COM (Blaine Crowther)
Subject: Re: Looking for "C" Source Line Counter
Reply-To: e3ubec@fnma.COM
Organization: Fannie Mae
Date: Mon, 23 Nov 1992 23:04:53 GMT

If you can't find one try this:

void
main( int argc, char * argv[])
{
     #define DELIMITER ';'

     int  ch,
          line = 0;
          
     FILE * fp;
     
     if( argc != 2)
          fprintf( stderr,"Please input a file name\n");
     
     else if( (fp = fopen( argv[1], "r")) == (FILE *)NULL)
          fprintf( stderr,"File '%s' could not be opened\n",argv[1]);
     else
     {
          while( (ch = getc( fp )) != EOF)
                if( DELIMITER == ch )
                    line++;     
          fprintf(stdout,"File %s contains %d lines.\n", argv[1], line);
     }
}

It's ansi , so it should work anywhere. Nothing fancy, it just counts
semi-colons. If you want all lines, just redefine DELIMITER '\n' for
new lines.

command line execution would be:

program_name file_name

blaine
From: goudreau@robin.rtp.dg.com (Bob Goudreau)
Newsgroups: comp.lang.c
Subject: Re: The Correct Way To Write C if-Statements
Date: 16 Nov 92 17:51:17 GMT
Organization: Data General Corporation, RTP, NC

In article <3860@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
>
>|Who the hack has invented this unlucky 
>|     if  (cond) {
>|         ugly_statements;
>|         }
>|paranthesis-into-if-line-style ????
>
>Well, I think it was Dennis M. Ritchie himself who did this, ...

Actually, this isn't quite right.  The K&R style is to align the
terminating brace with the first letter of the "if" (or "while",
etc.):

    if (cond) {
        ugly_statements;
    }


----------------------------------------------------------------------
Bob Goudreau			Data General Corporation
goudreau@dg-rtp.dg.com		62 Alexander Drive	
+1 919 248 6231			Research Triangle Park, NC  27709, USA
Newsgroups: comp.lang.c
From: herman@nosc.mil (John W. Herman)
Subject: Re: CRC-32 C code needed
Organization: Naval Ocean Systems Center, San Diego, CA
Date: Fri, 20 Nov 1992 01:52:22 GMT

--
If you want to do your own CRC's, Embedded Systems magazine recently,
(Jan 92 I think) had an article on CRC's and how to generate them
effeciently.
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.c
Subject: Re: using variables of type date in UNIX
Date: 16 Nov 92 05:57:30 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <92314.235928U17868@uicvm.uic.edu>, U17868@uicvm.uic.edu writes:
> I want to know how I can use the variable of type date in C.

There is no built-in "date" type in C.
There is, however, a type time_t defined in ANSI C (in Classic C, use
'long') and some handy functions for manipulating these values.  The
reason that I say that there is no "date" type is that time_t has a
finer grain (seconds) and typically doesn't have much range.

To find out what you have in your UNIX system, explore
	% man ctime

> For example, how could I define a variable like
> "todays_date" to be of type date and then read the input in the format like
>                        11/09/92

That is an exceptionally bad format to use.  To me, that date uniquely
and unambiguously means the 11th day of the 9th month of the 92nd year (of
the current century).  If you can possibly arrange for dates to be entered
in a format like
	1992.09.11
do so.  If not, prompt for day, month, and year separately.

There is a standard function called strftime() which takes time_t values
and converts them to strings according to a format.  There is not, however,
any _standard_ function for converting in the opposite direction.  The
standard DOES include a function
	time_t mktime(struct tm *tptr)
which normalises the time record and converts the result to a single number.
You can do
	struct tm xxx;  time_t t;
	xxx.tm_year = 92, xxx.tm_month = 09-1, xxx.tm_day = 11;
	xxx.tm_hour = 0, xxx.tm_min = 0, xxx.tm_sec = 0;
	t = mktime(&xxx);

Alas, mktime() is _still_ not available in many UNIX C libraries.  Beware
of C compilers that support ANSI _syntax_ but not all the ANSI _library_.
Newsgroups: comp.lang.c
From: kknudsen@vyasa.helios.nd.edu (keith knudsen)
Subject: Source code for database
Organization: OUC, University of Notre Dame
Distribution: usa
Date: Sun, 22 Nov 1992 22:28:55 GMT


I'm looking for a source code for a database program.  I'd like to look it 
over for ideas as I am about to write one for myself.  Anyone know where I
can find this??

Thanks for your help.

Keith
Newsgroups: comp.lang.c
From: torek@horse.ee.lbl.gov (Chris Torek)
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Converting an int or a float into a string*???
Date: 19 Nov 1992 18:35:13 GMT
Organization: Lawrence Berkeley Laboratory, Berkeley
Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
NNTP-Posting-Host: 128.3.112.15

In article <mT1cuB12w165w@rhps.chi.il.us> warlok@rhps.chi.il.us
(Jon L Fincher) writes:
>You could try to standard C function fcvt() ...

This, like previous advice to call gcvt(), is suspect at best.  I
cannot speak for C++, but fcvt() is not an ANSI C function, and is not
present in all implementations.  In particular, we removed it from the
4.4BSD C library.  Fcvt() merely implemented sprintf()'s `%f' format
anyway, so if you want that behavior, use sprintf().
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
Newsgroups: comp.lang.c