HDTenEightyP/NetNews huggingface dataset:
From: ghm@sserve.cc.adfa.oz.au (Geoff Miller)
Subject: Re: Will we keep ignoring this productivity issue?
Organization: Australian Defence Force Academy, Canberra, Australia
Date: Thu, 19 Nov 1992 03:22:16 GMT

johnson@cs.uiuc.edu (Ralph Johnson) writes:

>shanks@saifr00.cfsat.honeywell.com (Mark Shanks) writes:

>>> Can love of programming be taught?

>>I maintain that superior
>>programming ability is inherent; it can be developed in those who
>>who have it, but you can't teach it any more than you could turn a
>>tennis star into a stock broker or an orchestral conductor into 
>>a neurosurgeon.

>You can teach fastidiousness (my wife teaches it to my children),
>you can teach leadership, you can teach musical talent and athletic
>ability.  You can teach writing, you can teach playing tennis, you
>can teach how to be a stock broker, you can teach how to conduct
>an orchestra and how to be a neurosurgeon.   Sure, you can't teach
>EVERYBODY how to do it, and, in general, it takes so much time to
>be good at anything that people have to pick one thing and then
>spend most of their life concentrating on it.  But it is just silly
>to claim that all things in life are inherent and cannot be taught....

I think you have misunderstood.  Sure, you can teach people to do 
something well, but there is a difference between "good" and
"great".  You can teach someone to play the trumpet  -  can
you teach them to improvise like Miles Davis?  You can teach someone
to write English  -  can you teach them to write something that will
match Faulkner or Steinbeck?

You can teach programming, and of those who are taught some will be
great and some merely good.  It isn't just practice, it isn't just
hard work  -  programming is a creative activity, and in any such
activity there's an inner spark (no, not sparc:-) which is present
or absent.  In saying this, I'm not trying to put down the many good
(but not great) programmers in the world, but you have to be good in
any field to recognise the gulf between good and great.

Geoff Miller  (g-miller@adfa.oz.au)
Computer Centre, Australian Defence Force Academy

Newsgroups: comp.lang.c
From: carl@montebello.ecom.unimelb.EDU.AU (Carl Brewer)
Subject: Re: strange things with gcc
Organization: Dept. Engineering Computer Resources, Melbourne Uni.
Date: Mon, 16 Nov 1992 23:26:24 GMT

In article <9232201.24197@mulga.cs.mu.OZ.AU> carl@montebello.ecom.unimelb.EDU.AU (Carl Brewer) writes:
>I've ahd some funny problems with gcc on SunOS 4.1.2 of late, it doesn't
>seem to handle fflush(stdin) very well (ie not at all).

which has been explained, I'm burning the book today !!!


 wonder if anyone can offer a suggestion as to how to get this little
routine to work.

because, if I *don't* do the undefined fflush(stdin) before I try to grab
any input, then the thing doesn't work at all, it just skips itself, somewhere
it is reading in a <cr> from, and the only way I can get it to avoid that,
is to use the evil (non-ansi?) fflush(stdin).  All I want is a simple
pause and wait for <cr>, it *should* be so easy as to be rediculous ...

(btw, acc (the Sun ANSI C compiler) does work when fflush(stdin) is used,
but barfs if I don't use it ...

maybe there is some other way to clear the buffer from stdin (preferable
without using ioctl) ????



-- 
 Annal  Natrach, Usthvah Spethed,         carl@ecr.mu.oz.au (IRC: Bleve)
 Dochoel Dienve                           carl@munagin.ee.mu.oz.au
					  carl@montebello.ecom.unimelb.EDU.AU
 Merlin, where are you?  Call your dragon, to weave a mist...
From: 2hujwant@kuhub.cc.ukans.edu
Newsgroups: comp.lang.c
Subject: 2-D Arrays
Date: 23 Nov 92 01:02:29 CST
Organization: University of Kansas Academic Computing Services


OK. I have a question:
 
        How are two-dimensional arrays SUPPOSED to be defined?
 
When I took my "intro to C" class, our teacher told us that you 
define them just like any other array, but with another index. 
i.e.: 
 
        char some_array_name [dim1] [dim2]
 
and that would take care of allocating the memory. BUT, he said, if 
we want to pass these arrays to a function, that the compiler, in 
its non-range-checking way would not know how the array was defined 
from just the pointer to a base address, (and I suppose this makes
sense to me). So, he said, if we want a two-dimensional array that 
we can pass around to/from functions (and what good is an array that 
you couldn't?) we should define it thusly:
 
        typedef struct {
                char text[dim1][dim2];
        } 2-d_arraytype;
 
        2-d_arraytype TheArray;
 
And from there access it as:
 
        TheArray.text[row][col]
 
Or pass it to a function as:
 
        void some_func (2-d_arraytype *a_pointer)
 
And, of course, from there access it as:
 
        *a_pointer->text[row][col] = some_character;
 
etc, etc, etc.
 
My real question is, then, Is this the "correct" way to manipulate 
2-d arrays, or is there a better way. The problem (for me) comes 
when I try to pass that array pointer to an external assembly 
routine. I don't think I understand exactly how that looks in 
memory, which is what you really need to know to do any real 
processing on it in assembly.
 
So, if any of you veteran coders out there want to take the time to 
e-mail me a response to this, I would be very grateful. Also, if 
you do, I have plenty of other small/petty/novice-type questions 
that I could post, as long as no one gets too annoyed.
 
Later!
 
====================================================================
Sean White                                              
                                                         
an Outlaw at                                              
The University of Kansas -- NCAA champs 1988 and 1993!    
                                                          
===================== 2hujwant@kuhub.cc.ukans.edu ==================
From: buc5045@cuphub.cup.edu
Newsgroups: comp.lang.c
Subject: window menus and mouse access
Date: 21 Nov 92 02:07:16 GMT
Organization: California University of Pennsylvania, California, PA

Can anyone help me with making text windows i C???

Basically, I want to add window menus to a program that I am writing.

Also, I want to be able to access these menues using both keyboard and mouse.

Reference books would be helpful, please recommend some.


STRYFE


David B. Bucco
Cal. U. of PA
Applied Comp. Sci.

David B. Buc
Newsgroups: comp.lang.c
From: jrv@truth.mitre.org (Van Zandt)
Subject: Re: C source to mktime() ?
Organization: The MITRE Corp., Bedford, Ma.
Date: Mon, 23 Nov 1992 18:13:53 GMT

In article <blimoges-201192161959@macx.sts.sobeco.com> blimoges@sobeco.com (Bertrand Limoges) writes:
>Here I am coding away, and I need to use mktime() in order to convert
>a struct tm * to a time_t value but the function is not present on the
>system I'm working on (MIPS). time, localtime, ... are there, but not
>mktime! 

Look for something like localtime18 at ftp.uu.net, I believe in the comp.sources
archives.

Flame MIPS too, of course :-)

                   - Jim Van Zandt <jrv@mbunix.mitre.org>
Newsgroups: comp.lang.c
From: wkaufman@us.oracle.com (William Kaufman)
Subject: Re: Typedefing builtin... thanks.
Organization: Oracle Corporation, Redwood Shores CA
Date: Tue, 24 Nov 1992 02:57:30 GMT
X-Disclaimer: This message was written by an unauthenticated user
              at Oracle Corporation.  The opinions expressed are those
              of the user and not necessarily those of Oracle.

In article <1992Nov20.164732.8121@cimage.com> ejd@cimage.com (Ed Driscoll) writes:
] In article <1992Nov17.235519.24646@pure.com> rpeck@pure.com (Ray Peck) writes:
] >[...#define'ing WORD...]
] 
] I've been thinking about doing it that way myself, but it seems to me that
] you would want two variants of each size: one for when you need EXACLTY
] that number of bits, and one when you just need AT LEAST that number of
] bits.

    If you ever need *exactly* n bits, you'll find yourself frustrated
eventually.  What set of #defines will give you exactly 8 bits on a
machine with 9-bit chars and 36-bit ints?

    (Before you reply: Yes, they exist.  Honeywell/Bull machines are
like this.  Also, some machines allowed 6-bit bytes, at the programmers
option.  And, saying you'll never work on one of these is the surest way
to make sure that you will.)

    Using a set of "at least" macros, though, is fine, as long as you're
willing to limit yourself to reasonably large machines: there *are*
machines out there without 32-bit ints, after all.

] The former type would be used where the exact size matters (say,
] something you're reading from a file, or something used for bit flags).

    You should never write binary data when you expect to move data
between different machines; and, if you aren't moving binary data
between machines, you'll never need this type.  (See the FAQ, section
17.2.)

    The suggestion wrt flags is correct, though; and, you can restrict
the set of macros to unsigned types.  But, because you can't be certain
about the size of the types available, this is really an "at least"
type: you need to address at least N bits, not exactly N bits.

                                           -- Bill K.

Bill Kaufman,          | "Hush my darling / Be still my darling /
Corporate Lackey       |  The lion's on the phone,..."
wkaufman@us.oracle.com |              -- "The Guitar", They Might Be Giants
Newsgroups: comp.lang.c
Subject: Mail Call
From: lindstrom@acs.harding.edu
Date: 18 Nov 92 07:54:06 -0500
Reply-To: lindstrom@acs.harding.edu
Organization: Harding University

Greetings-
  Can someone tell me how to get a C program to make a system
call (SunOS Unix, using the bundled compiler).  I would like
to have a program send me a mail message every time it is
called (it is living on another, less secure machine.. I want to
keep track of its usage).

  Please e-mail to glind@sun1.hu.edu

   Thanks-
     Greg Lindstrom
Newsgroups: comp.lang.c
From: dfuller@portal.hq.videocart.com (Dave Fuller)
Subject: Re: Reading Filenames into an ARRAY
Organization: VideOcart Inc.
X-Newsreader: Tin 1.1 PL3
Date: Wed, 18 Nov 1992 19:41:38 GMT

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.
: 
 
DOS 2.0 ???  Pretty old.

you can do this. you will have to build the functionality to pick the         
filename yourself though. there isn't any preset method for that.
These functions exist in microsoft compilers, but i'm not so sure
about any others. i believe also borland. If they don't exist as these
names they probably exist in some form as a similar name. But, as i siad,
i don't know.

_dos_findfirst() - allows you to find the first file matching the 
                   requirements you give it.
_dos_findnext()  - finds the next file matching the requirements.

Look these up in a manual, its the only way to really understand them.
You use a structure (find_t) for both calls. The last selected file
information is kept in the structure, so the findnext call knows where
to continue looking in the path you specified.

When you call _dos_findfirst you specify a path, a file spec (wildcards
are accepted), and a file type to look for (normal, read-only, hidden,
system, volume id, subdir, or archive). This returns the file info in the
structure. Then when calling _dos_findnext() you pass it the structure
it finds the next valid file, and returns it in the structure. You 
continue to use _dos_findnext() until you get a return value other than
a 0. 

File information that is available from the structure:
last time file was written to
last date file was written to
length of file in bytes
file name                             

Like I said, the reference will give a good, solid explanation. Mine is
sketchy and doesn't give full syntax an usage notes.

Dave Fuller
dfuller@portal.hq.videocart.com
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: How to extract file descriptor
Date: 21 Nov 1992 20:08:17 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1992Nov21.065113.21296@nuscc.nus.sg> isc40038@nusunix1.nus.sg (LIM FANG HOW) writes:
>Qn1 : Does the structure pointed by file pointer contains the file
>      descriptor ? I could not find the file descriptor in the stdio.h
>      in my system (SUN sparc using 4.3BSD)

It's called "_file" in the struct _iobuf.  But you don't really need to
know that, since it's very system-specific.

>Qn2 : If yes, how to extract it from the structure ?

Use the fileno() macro, which takes a FILE*.  This should be portable
across most Unix flavors, and maybe even to some non-Unix systems.

>      I tried the following and it returns fd not defined :
...
>               fdes=fp->fd;

That should be

		fdes=fileno(fp);

>Qn3 : Is there any way to lock a file using the file pointer instead of
>      file descriptor ?

No, locking is not part of stdio.  Many systems that can support stdio
(i.e. just about any system) don't support file locking.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.c,comp.software-eng
From: miket@hermes.tcs.com (Michael Turner nmscore Assoc.)
Subject: Re: Will we keep ignoring this productivity issue?
Organization: Teknekron Communications Inc.
Date: Wed, 18 Nov 1992 02:22:24 GMT

In article <books.110.0@fsunuc.physics.fsu.edu> books@fsunuc.physics.fsu.edu (Roger Books) writes:
>In article <1992Nov17.091220.9284@iccgcc.decnet.ab.com> kambic@iccgcc.decnet.ab.com (Bonus, Iniquus, Celer - Delegitus Duo) writes:
>>
>>IMHO, there is probably no better background for SE than physics.  Why? 
>>Problem solving.  Experimental techniques.  Basic understanding of the
>>strangeness of the universe.  All useful.  
>
>I don't know about that last one.  The Physicists are some of the most
>intelligent people I know... but, their programming is ... atrocious ...

I guess I'd have to second that, though I've seen a few exceptions,
mostly among theoreticians.

I think that whatever the best background is, it is something that involves
being able to describe mundane things, categories, processes and relations
and such like as precisely as possible.  A good philosopher, psychologist, or
sociologist might manage this pretty well compared to some physicists,
though most probably wouldn't.

I see a lot of "humpty-dumpty" rationalizing in most of the software
activities I've been involved in.  Computers don't really know what
words mean, so

	for (i = 0; i < 10; ++i) a += i;

is basically same as

	for (rabbit = 0; rabbit < 10; ++rabbit) giraffe += rabbit;

Many programmers don't care a whole lot what's said, and are more
concerned about about how things work.  The writing style of many of
them makes me think that software is a kind of high-income refugee
camp for dyslexics.

OOA/OOD appeals to me, in part, because of its emphasis is where the
emphasis should be: on naming and describing things in a reasonably
intuitive way.  Physics is more focused on modeling and predicting
the behavior of counter-intuitive phenomena.  Only pure reasoning
power is in common between these two.
---
Michael Turner
miket@tcs.com
Newsgroups: comp.lang.c
From: yngvar@krill.NoSubdomain.NoDomain (Yngvar Foelling)
Subject: Re: strange things with gcc
Organization: University of Bergen, Norway
Date: Tue, 17 Nov 92 16:53:55 GMT

I've seen plenty of questions like this:
- How can I dump the input buffer?
- Use fflush(stdin).
- No. Not standard.
- How, then?
- Dunno.
- Can't be done.

Or the like.  What I don't understand is why nobody have used what to me seems
like the most reasonable solution.  It seems like most of the time the intention
is to discard the remainder of the line after having read some input, or simply
to wait for the user to press RETURN.

So what's wrong with this?

    int c;

    do {
        c = getchar();
    } while (c != '\n' && c != EOF);

-- 
ISO 8859-1: Yngvar Flling  | Private address:
ASCII:      Yngvar Foelling | Tertnesveien 121
E-mail:     yngvar@imr.no   | N-5084 Tertnes
Xref: sparky comp.lang.c:16786 comp.software-eng:4398
From: rws@optima.UUCP (Ronald W. Schmidt)
Newsgroups: comp.lang.c,comp.software-eng
Subject: maintenance questions
Date: 19 Nov 92 09:21:15 GMT
Followup-To: comp.lang.c


	My initial posting of some questions got a few answers, some
agreeing, some disagreeing - both helpful.  What I was really trying
to assess was the potential utility of a MYCIN type symptom based
expert diagnostic system for software maintenance.  If maintenance is 
carried out by the original authors of the system then a symptom based
diagnostic approach will not be very helpful.  Human intelligence will
be better than expert intelligence.  The utility of such an approach
is clearly most useful in a situation where people whose familiarity
with the system is not so great must do maintenance and where the most
frequent resolution to a problem is to match symptoms against known
problems and give known solutions.   I worked under such circumstances
and am wondering how common they are in the software industry as a
whole.  I would expect that such circumstances would be most likely
at places that produced software which had a wide distribution so 
that there is no chance for the original developers to handle all 
questions.

	I did manage to find a book with more recent maintenance statistics
than Boehm et al.  Capers Jones book on _Programming Productivity_
gives some helpful statistics.  Unfortunately the impact of modern
programming languages on field maintenance was only touched on
and most of the answers to my questions were not directly addressed.

	For any who did not care to comment the first time, or would
like to try again in the above mentioned context.  

1) In a competitive market there is a need for short term corrective 
	maintenance that is not quite like software evolution.  There
	is a need for fixes that get a customer around a problem safely 
	and immediately to prevent the customer from switching to another 
	product.

2) Companys hire special group of people for maintenance.

3) In corrective maintenance creating new fixes is burdensome and undesireable
	and infrequent compared to the distribution of already known
	inter-release fixes.

4) By the time the decision is made to modify software a lot of information
	has been gathered by a support person attempting to avoid making
	any modification.


Thanks in Advance
-Ron
Newsgroups: comp.lang.c
From: drkhoe@nmt.edu (ONID)
Subject: Survey - Research
Organization: New Mexico Tech
Date: Thu, 19 Nov 1992 03:08:50 GMT

                              QUESTIONNAIRE
                         TO EXAMINE CAFFEINE USE
                        AMONG COMPUTER SCIENTISTS
                         AND ELECTRICAL ENGINEERS
                                     
Most of us enjoy consuming caffeine in one form or another. The purpose of
this questionnaire is to examine how much caffeine is being consumed, what
form the caffeine is being consumed in, and who is consuming it.

Please answer these questions with email to: bob@jupiter.nmt.edu
with the subject 'survey'.

**Please do not post your answers, that will waste bandwidth**

You don't have to quote the whole article, just use 6 lines or so:
EXAMPLE
	1 CS
	2 85 cans
	3 Jolt
	4 5 pots
	5 none (gives me a headache)
	6 45 Vivarin/hr.

Thank you!

1. What is your field of work/study?
    EE       CS        BothNeither

2. How much soda do you consume per day (average)?
    ________

3. What kind of soda do you drink?
    ________

4. How much coffee do you consume per day (average)?
    ________

5. How much tea?
    ________

6. Do you take any caffeinated pills? If so, how many?
    Vivarin  NoDoze    Maximum Strength Excedrin
    ______   ______    ______

bob@jupiter.nmt.edu
Bob "Chunkstyle" Broilo
-- 
----------------------------------------------------------------------------
Amiga to the Bone | SF2 Fanatics: Can you hang with the Guile combo's?
Moshing - the number one dance in America.  Kill the preacher hang the pope.
-------------------------------drkhoe@nmt.edu-------------------------------
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: How to print an integer as binary?
Date: 19 Nov 92 18:26:13 GMT
Organization: University of Helsinki

cs202144@umbc8.umbc.edu (cs202144) writes:
[...]
>  putchar(i & 1 | '0');
[...]
>
>Nice and short and portable ;)

Hardly portable, since there are no guarantees that setting the lowest
bit of '0' will yield '1'.  I see no reason to not write, for example,

	putchar("01"[i & 1]);

which is guaranteed to work.

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
   MS-DOS, you can't live with it, you can live without it.
Newsgroups: comp.lang.c
From: reza@peri.jsc.nasa.gov (Reza Razavipour)
Subject: ioctl and non block reads
Organization: Lockheed
Date: Fri, 20 Nov 1992 15:57:32 GMT

I am totally new to sockets and need to figure out a
way to see if there is a message to be read before I 
go read it. I need to  go on if no message is available.
I use ioctl but cannot get it to work. I never get a message.
Can some kind person e-mail me some words of wisdom on how to
read a socket without having to wait?
Thanx,
Reza.
From: clive@x.co.uk (Clive Feather)
Newsgroups: comp.lang.c
Subject: Re: Is this ANSI?
Date: 20 Nov 92 16:21:21 GMT
Organization: IXI Limited, Cambridge, UK

In article <9eRguB1w165w@quest.UUCP> srhqla!quest!kdq writes:
>    I'm working on an HP9000, in UNIX, using the native C compiler
>which claims to be ANSI compliant.  It appears to be, in most things,
>even though you've got to jump through hoops to really get it into ANSI
>mode with the correct ANSI includes.

Funny - I just type "c89 prog.c -o prog" and it's perfect.

> Here is (a simplified version of) the struct that the compiler
> calls an error:
>
> struct FM
> {
>	short	data_len;
>	char	data[];        /*  This line is the kicker  */
> };
>
> As I recall, ANSI says this is legal,

You recall wrong. This declaration gives "data" the 'incomplete type'
"array (size unknown) of char". The standard says [6.5.2.1]:
| A structure or union shall not contain a member with incomplete or
| function type.

A diagnostic is required in this situation. Any compiler failing to
generate one is not ANSI/ISO compliant - ask for your money back.

Note that both "char data [1]" and "char *data" are legal here, as they
give "data" type type "array (size 1) of char" and "pointer to char"
respectively. As a stand-alone declaration, the original line would also
be permitted:

    char data [];

    /* Code accessing data in certain ways only */

    char data [10];

    /* More code */

The code indicated by the first comment may take the address of data,
and may use it in any way (such as subscripting it) that causes it to
decay, via the Rule, into a pointer. It may *not*, however, pass it to
"sizeof" or anywhere else that the standard requires a 'completed
type'.

-- 
Clive D.W. Feather     | IXI Limited         | If you lie to the compiler,
clive@x.co.uk          | Vision Park         | it will get its revenge.
Phone: +44 223 236 555 | Cambridge   CB4 4RZ |   - Henry Spencer
Fax:   +44 223 236 550 | United Kingdom      |
From: elias@proxxi.uf.se (Elias M}rtensson (proxxi))
Newsgroups: comp.lang.c
Subject: Re: Typedefing builtin... thanks.
Date: 20 Nov 92 21:20:36 GMT
Organization: proxxi

yngvar@imr.no (Yngvar Foelling) writes:

>BTW, does anyone know about a C-compiler with 64-bit longs?  Even if there
>aren't any right now, it seems to me that one would have to be written to take
>advantage of 64-bit architechtures.  In that case, using long instead of int
>would be overkill.

GNU C uses "long long" (ie: long long a = 1000L) to represent numbers
twice as big as the "long" type.

>-- 
>Yngvar Fxlling (yngvar@imr.no)
>Institute of Marine Research
>Bergen
>Norway

######################
#   Elias Martenson  #
# elias@proxxi.uf.se #
######################
Newsgroups: comp.lang.c