HDTenEightyP/NetNews huggingface dataset:
From: vijay@cdsun.fnal.gov (Vijay Gurbani)
Newsgroups: comp.programming
Subject: Re: help with reading from socket
Keywords: Socket, read
Date: 28 Sep 92 13:03:48 GMT
Distribution: usa


I tried email, but it bounced back. So here goes:

In comp.programming you write:

>	I would like to use read() (or a related function
>     to read from a socket, and stdin. But here is the catch, 
>     if no data is waiting from stdin, or the socket i want
>     read to return 0(but read just waits there for input
>     to come in).

You cannot change the return value of read(2) system call! The manual
states that read(2) returns the number of bytes actually read, or -1
on error. Thus a return value of 0 implies that there is nothing to be
read. But in the default case, read(2) exhibits blocking behaviour; i.e.
if there is no data to read from a descriptor, read(2) will block on
that descriptor till there is data availaible. You can modify this
behaviour by coercing read(2) to operate in non-blocking behaviour, in
which case, read(2) will immedeately return with a status of -1, but
errno will be set to EWOULDBLOCK. You would check the value of errno,
and if it is EWOULDBLOCK, sleep for a couple of seconds, and perform a 
read(2) again. Check the manual pages for ioctl(2) and fcntl(2) to see 
how to render a descriptor non-blocking.

- vijay
--
 (____)   Chicago Bulls                33   54   Vijay K. Gurbani               
'(o  o)`  1990-91 NBA World Champions     24     Fermi National Accelerator Lab.
  \  /    1991-92 NBA World Champions  05   23   vijay@{cdsun,fnsg01}.fnal.gov
== OO =====#include <all_neccessary_evils>====All opinions are mine, of course==
From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
Newsgroups: comp.programming
Subject: Re: reference counting garbage collection
Date: 4 Oct 92 17:55:02 GMT
Reply-To: nickel@cs.tu-berlin.de
Organization: STONE Project, Technical University of Berlin, Germany

In article <22B5RB10w165w@mindvox.phantom.com>
grow@mindvox.phantom.com (George Row) writes:

> This post is a request for references to papers or books with guidelines 
> for  the use of reference counting garbage collection.
[...]

Sorry, I don't know any. But this article reminds of a question that
never puzzled me enough to dig through the literature:

How does reference counting garbage collection (RCGC) deal with
circular data structures? 

--
Juergen Nickelsen
From: wingo@apple.com (Tony Wingo)
Newsgroups: comp.programming
Subject: Re: Costs per line of code
Date: 28 Sep 92 18:45:46 GMT
Followup-To: comp.programming
Organization: Apple Computer

In article <RZ0JRB2w165w@mantis.co.uk>, jonathan@mantis.co.uk (Jonathan
Egre') wrote:
> 
> avg@rodan.UU.NET (Vadim Antonov) writes:
> 
> > In article <-191659999@hpopd.pwd.hp.com> richi@hpopd.pwd.hp.com (Richard Jenn
> > >If a software engineer costs (say) US$150000/year [1], including all overhea
> > >and she writes 10 lines of code per day [2]
> > 
> > Wow. Wow. I'd love to join that organization. I'd f* off all those
> > overpaid executives :-) Why nobody pays me US$60 per line? And i'm
> > not a Pascal or COBOL programmer -- my job is writing device drivers,
> > a bit trickier stuff than spitting out payrolls!
> > 
> > Life is unfair, i guess.
> 
> I think the figure of $150,000/year includes lots of overheads: office space,
> equipment, phone bill, training bills, a quarter of a secretary, a tenth of a
> manager, a tenth of an accountant, social security or pension contributions 
> which do not show up on the software engineer's payslip, etc.

plus contributions to health insurance, XMAS parties .....

A very crude rule of thumb used by some places I've worked is that the
total ("burdened") cost to a company of an engineering employee is about
2.5 times the engineer's gross salary. (Actually I've heard multipliers in
the range 2-4. All should be taken with a large grain of salt).

> Similarly, the 10 lines of code per day also includes (or do I mean 
> "excludes"?) a lot of overheads: time spent on documentation, time spent
> discussing requirements with the client, time spent testing, time spent on
> training, time spent replacing 1000 lines of code with a different 1000 lines
> of code because the client changed his or her mind, etc.
> 

Yeah, I think typically, the "lines of code per day" metric is arrived at
by taking the total number of man days in the project from conception to
shipping, and dividing it by the number of lines of code, so it includes
(among other things) all the design, debugging and documentation efforts,
which typically overshadow the actual coding effort.

The best discussion of the pointlessness of this whole approach to
measuring software productivity is in Fred Brook's marvelous book "The
Mythical Man-Month".  Recommend reading.

And an exercise for the reader:

"If one worker can dig a posthole in five minutes, how long would it take
ten workers to dig the same posthole?"

-tony

>>usual disclaimer<<
From: dsg@impmh.uucp (Dave Gordon)
Newsgroups: comp.programming
Subject: Re: Daylight saving time (UK)
Date: 28 Sep 92 17:02:00 GMT
Distribution: uk
Organization: Integrated Micro Products Ltd

In <1992Sep24.151232.14461@rtf.bt.co.uk> bonnaud@rtf.bt.co.uk (Neil Bonnaud) writes:
>
>  are the dates [of GMT/BST change] calculated (e.g. always the last Sunday
>  in October) so an algorithm can be used or is it an arbitary decision by
>  the powers that be (i.e. enter changeover dates in advance)???

I tried to find an algorithm for this many years ago ... unsuccessfully.
I have heard that it is an arbitrary decision on a year by year basis; I
also heard that some diaries have been known to mark in the dates of
changeover as 'provisional' i.e. they have gone to press before the
official word has been received.

Anyway, good luck in trying to find out whether there really is an
algorithm; if you find one, I'd like to know about it...
-- 

                        Dave
===============================================================================
        You are in a maze of twistly little standards, all different
===============================================================================
Newsgroups: comp.programming
From: dm@stekt3.oulu.fi (Hannu Helminen)
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Followup-To: comp.programming
Organization: University of Oulu, Dept. of EE, Finland
	<mcdonald.347@aries.scs.uiuc.edu> <1992Oct4.023152.13600@ncsu.edu>
	<1992Oct4.220604.989@organpipe.uug.arizona.edu>
Date: Mon, 5 Oct 1992 14:12:53 GMT

In article <1992Oct4.220604.989@organpipe.uug.arizona.edu> dave@cs.arizona.edu (Dave Schaumann) writes:

> I am reminded of something I once read somewhere (yeah, I know -- real
> specific, huh?).  Hmm... perhaps it was in _Elements of Programming
> Style_?

> Anyway, it said it was appropriate to have exactly 3 numbers in your program:
> zero, one, and many.

Imagine you are writing a 3D graphics package. I suspect you would
write a generalized package for projecting n-dimensional objects onto
m-dimensional hyperplanes (m < n), and then use it with n=3, m = 2.
If our universe suddenly decided to be 6-dimensional, the program
would still work correctly!

The point is: it may generally be bad practice to have numbers
hard-coded into your code. However, one should not say that they
should be avoided at all costs.
--

   _| _ _    Hannu    dm@stekt.oulu.fi    // Does anybody else in here
  (_|| | )  Helminen dm@phoenix.oulu.fi \X/ feel the way I do?
Xref: sparky comp.programming:2773 comp.lang.c:14524 comp.lang.pascal:5818 comp.lang.objective-c:580
From: markh@csd4.csd.uwm.edu (Mark)
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: 4 Oct 1992 22:27:50 GMT
Organization: Computing Services Division, University of Wisconsin - Milwaukee
NNTP-Posting-Host: 129.89.7.4

(Using embedded constants)

In article <kaufman.718082916@Xenon.Stanford.EDU> kaufman@CS.Stanford.EDU writes:
>How about the following:
>
>GMST = 24110.54841 + (8640184.812866 + (0.093104 - 6.2e-6 * Tu) * Tu) * Tu;
>
>which is the equation for the relationship between Greenwich mean sidereal
>time and Universal time. (or was in 1985).  I could also post the equation
>for the nutation of the Moon, which has 19 terms.  Surely you don't expect
>someone to define constants for each of them...

#define GtoU(T) \
   ((24110.54841 + (8640184.812866 + (0.093104 - 6.2e-6*(T))*(T))*(T))

...

GMST = GtoU(Tu);

...

GMST2 = GtoU(Tu2); /* Assuming there's multiple uses of GtoU */

...

etc.

that's one of a million different way I'd handle it.  Which way I actually
choose would depend on the context where this particular piece of code was
located.

Maybe you could show us the entire source?
From: fouts@bozeman.hpl.hp.com (Martin Fouts)
Subject: Re: Costs per line of code
Date: Thu, 24 Sep 1992 18:17:26 GMT
Reply-To: fouts@hpl.hp.com
Organization: Hewlett-Packard Labs

In article <1992Sep24.033653.15950@afterlife.ncsc.mil>, sjr@afterlife.ncsc.mil (Stephen J. Roznowski) writes:

|> Before this gets too far a field (if it hasn't already) ...
|> [Since I asked the original question]
|> 
|> Let me try to phrase this question in a different manner:
|> 
|> [...] [i.e. if I was buying insurance for this
|>    software -- how much insurance to buy?]
|> 

Insurance is based on replacement cost, or purchase price, not on
value.  I can buy an insurance policy based on the price I paid for
the object, which is objective and may not be related to its value in
any obvious way.  This is a good approch for items whose replacement
costs are not likely to change, so that the purchase price is a good
estimate of the replacement cost. I can also buy an insurance policy
based on the probable replacement cost at the time I have to replace
the item.  Such policies are usually sold to cover objects whose
replacement cost is know to be trending in a particular direction: I.
E. houses, the replacement cost of which goes up.

The value of an object is only indirectly related to the cost of that
object, but that is an economics issue, and not appropriate for
comp.programming.

Marty
-- 
Martin Fouts                  |  M/S 1U-14
Member of Technical Staff     |  HP Laboratories
EMAIL:  fouts@hpl.hp.com      !  MAIL:  P.O. Box 10490
PHONE:  (415) 857-2971        |  SHIP:  1501 Page Mill Road
  FAX:  (415) 857-8526        |  Palo Alto, CA 94304-1126

novae erratae!
From: oksalahti@hylkn1.Helsinki.FI (Oksalahti Mikko)
Newsgroups: comp.programming
Subject: How to implement interpolation?
Keywords: interpolation, curves
Date: 6 Oct 92 16:29:19 GMT
Organization: University of Helsinki

Hello curve-coders,

What is a simple way the program the following interpolation:

	I have a list (or array) of controlpoints in 3D-space (x,y,z). For
	example n points.

	I want the draw a nice smooth curve which is interpolated through
	these controlpoints (THROUGH them, not any Bezier/B-spline curve).

So how to do it?

PS. If the simple way is also fast, I'm totally satisfied.

	Thanks in advance, Mikko Oksalahti
			   oksalahti@cc.helsinki.fi
Newsgroups: comp.programming
From: pk@cs.tut.fi (Kellom{ki Pertti)
Subject: Re: Need Book Reviews on Sedgewick's Algorithms Books
Organization: Tampere Univ. of Technology, Finland.
	<1992Sep26.202928.7318@donau.et.tudelft.nl>
	<1992Sep27.042748.1871@m.cs.uiuc.edu>
Date: Mon, 28 Sep 1992 14:48:20 GMT

I recommed Sedgewick's 'Algorithms in C' to my data structures and
algorithms students as a very good reference book. It is not as good
as a teaching text, primarily because it was not written as one.  We
use Scheme as the language of the course, so the book also gives a
different perspective to the algorithms.
--
Pertti Kellom\"aki (TeX format)  #       These opinions are mine, 
  Tampere Univ. of TeXnology     #              ALL MINE !
      Software Systems Lab       #  (but go ahead and use them, if you like)


--
From: bonnaud@rtf.bt.co.uk (Neil Bonnaud)
Newsgroups: comp.programming
Subject: Re: Costs per line of code
Date: 28 Sep 92 08:44:45 GMT
Organization: BT Customer Systems, Brighton, UK

sjr@afterlife.ncsc.mil (Stephen J. Roznowski) writes:
> I'm looking for some estimates for what it costs to produce/document/maintain
> a line of code. What I'm trying to compute is the "worth" of a software
> package.
> 

In line with most of the follow-ups to this article, I don't beleive counting
lines of code.

We had a marvelous metrics system called "Function Point Analysis" which
counted lines of code, multiplied it by number of files accessed, added some
for number of user screens displayed and then fudged it a bit with a
complexity rating if some of the routines used a complex algorithm (e.g.
1) It was easy to write, I know what it does
2) I can just understand it, even though I wrote it
3) Someone else wrote it and it's too complex for me to understand.

This sort of thing may work for COBOL transaction programs, providing you
don't count the 250 lines of declaration at the top.  However, an equivalent
Program in C might be half the size simply because so much more can be
put into one line.


Personally, I beleive that programming is an art form and cannot be measured
in mere numbers.  It's like trying to value a painting based on the number
of brush strokes used to produce it or the area of canvas it covers.

Neil Bonnaud
BT Customer Systems
Newsgroups: comp.programming
From: alanj@endeavor18.tek.com (Alan Jeddeloh)
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: 5 Oct 92 18:49:22 GMT
Article-I.D.: shaman.1906
Followup-To: comp.programming
Organization: Tektronix, Inc.

In article <mcdonald.355@aries.scs.uiuc.edu> mcdonald@aries.scs.uiuc.edu (J. D. McDonald) writes:
-
-OK look at this, which, like the nutation of the moon, is a better example:
-
- ...
-
-	*dml = (3.31364e-1-(1.0281e-2+4.692e-3*x1)*x1)*sx5+
-	      (3.228e-3-(6.4436e-2-2.075e-3*x1)*x1)*cx5-
-	      (3.083e-3+(2.75e-4-4.89e-4*x1)*x1)*s2x5+
-	      2.472e-3*sx6+1.3619e-2*sx7+1.8472e-2*s2x7+6.717e-3*s3x7+
-	      2.775e-3*s4x7+6.417e-3*s2x7*sx3+
-	      (7.275e-3-1.253e-3*x1)*sx7*sx3+
-	      2.439e-3*s3x7*sx3-(3.5681e-2+1.208e-3*x1)*sx7*cx3;
- ...
- etc.

I have no complaints about your constants or your variable names, per se.
Particularly if you are implementing a formula taken directly from the math
in a standard reference, it makes sense to retain the original variable names
from the reference, assuming you have a comment refering the reader to the
reference.

But since you are using both variable names which contain digits ("s2x5"),
and constants which contain both letters and operators ("1.208e-3") --

<begin shouting>

COULD YOU KINDLY SEPARATE CONSTANTS, OPERATORS AND VARIABLES WITH WHITESPACE
SO SOMEBOBY CAN READ IT?

<end shouting>

Thank you.

--
    Alan Jeddeloh      W:(503) 685-2991  H:(503) 292-9740
    Tektronix, Inc.  D/S 60-850; PO Box 1000; Wilsonville, OR 97070
    Alan.Jeddeloh@tek.com          Let sleeping dogs^H^H^H^Hbabies lie
    You can put the children to bed, but you can't make them sleep!
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
From: david@gdstech.grumman.com (David Nettles)
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Reply-To: david@gdstech.UUCP (David Nettles)
Organization: Grumman Data Systems-Woodbury
Date: Tue, 6 Oct 1992 12:35:15 GMT

In article <1992Sep29.093516.23758@odin.diku.dk> klaus@diku.dk (Klaus Ole Kristiansen) writes:
>jfr@RedBrick.COM () writes:
>
>>So I suggest a coding standard: numbers should be barred from use in
>>variable and type names.  Only letters can be used.  Numbers can only
>>appear where you define manifest constants (#def, const, etc.) to 
>>names and inside strings (where they generally do no harm).  
>
>>Any comments?
>
>A friend of mine once accused me of writing spaghetti code, because
>had written
>
>count := count + 1
>
>He insisted that it should be
>
>count := succ(count)
>
>He is a physics major, BTW
>
>Klaus O K


Well, in fact, you are both writing "spaghetti code".
It really should  be:

	inc(count);

Have a nice day.	=)

-- 
****************************************************************************
   David E. Nettles
   Internet: david@gdstech.grumman.com
   Grumman Data Systems
Xref: sparky comp.programming:2748 comp.lang.c:14276 comp.lang.pascal:5727 comp.lang.objective-c:567
From: dak@messua.informatik.rwth-aachen.de (David Kastrup)
Subject: Re: Lookahead (was: Re: Pascal vs C)
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date: 29 Sep 92 11:15:42 GMT

dave@cs.arizona.edu (Dave Schaumann) writes:

>Here's some more "problem areas" in parsing C:

>First, of course, the infamous typedef-vs-id problem -- if typedefs are
>just another flavor of identifier, and you have

>	{ <declarations> ; foo * a ; <etc> }

>The question arises: what should "foo * a" parse to?  If "foo" is a typedef
>name, it should parse to a declaration of "a", otherwise it should parse
>to a simple multiplication.  The traditional solution is to have the lexer
>ping the symbol table to see whether an ID is really a typedef or not.  But
>this introduces its own problems: since the structure of tokens now depends
>on the state of the symbol table, you can no longer use any kind of algorithm
>that depends on looking ahead on the token stream...

>Here's another one.  Suppose you have

>	int foo( int a, int b, int c, /* ... etc */

>Is this the start of a prototype, or a function header?  There's no
>way to tell until you've seen the token after the closing parenthesis.
>Even worse, you can write prototypes like

>	int foo( int, int, int, /* ... etc */
But you can simply postpone the decision by waiting if you get a {, or
something else. This `partial ambiguity', as you call it, is not even
partial, because the last example IS a valid function header. You may
use it to specify arguments of a function that are not needed at the
current time of development, and thus save yourself unused variable
warnings.
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
From: samodena@csemail.cropsci.ncsu.edu (S. A. Modena)
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Organization: Crop Science Dept., NCSU, Raleigh, NC 27695-7620
Date: Sun, 4 Oct 1992 02:31:52 GMT

In article <mcdonald.347@aries.scs.uiuc.edu> mcdonald@aries.scs.uiuc.edu (J. D. McDonald) writes:
>In article <1992Oct2.083136.11412@ITcorp.com> geoff@ITcorp.com (Geoff Kuenning) writes:
>
>
>
>>(1) It is generally a mark of weak programming
>>(2) It is generally poor practice
>>(3) It is *always* poor practice
>
>Sigmund Freud had a name for people who think like the above, and
>its not very pretty: Anal Retentive.
>
>
>Doug McDonald

And the answer to that is: Ziggy Freud didn't program computers.....
the commentary accompanying the above statements are quite
defensible.....so possibly it's not Goeff who quite so anal....retentive.

Steve
---
+------------------------------------------------------------------+
|     In person:  Steve Modena     AB4EL                           |
|     On phone:   (919) 515-5328                                   |
|     At e-mail:  nmodena@unity.ncsu.edu                           | 
|                 samodena@csemail.cropsci.ncsu.edu                |
|                 [ either email address is read each day ]        |
|     By snail:   Crop Sci Dept, Box 7620, NCSU, Raleigh, NC 27695 |
+------------------------------------------------------------------+
         Lighten UP!  It's just a computer doing that to you.
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Newsgroups: comp.society
From: jlenarci@monu6.cc.monash.edu.au (John Lenarcic)
Subject: Computer programming education for the deaf
Organization: Monash University, Melb., Australia.
Date: Tue, 6 Oct 1992 02:25:49 GMT



I would like to find out if there are any universities or
colleges that offer special courses for the deaf dealing
with computer programming (particularly if they are taught
in Ameslan, Auslan or British Sign Language).

I believe that there is a National Technical Institute for
the Deaf within the Rochester Institute of Technology. Do they
offer Computer Science courses for the deaf community? Is there
an e-mail contact for this institute?

Do they teach computer programming at Gallaudet University in
Washington, DC ? If so, I'd like to establish e-mail contact with
the course co-ordinator.

Thank you for your assistance.


                cheers,

                John Lenarcic

                Postal address:
                Department of Software Development,
                Monash University,
                P.O. Box 197,
                Caulfield East, Victoria 3145
                AUSTRALIA

                Fax number: 61-3-5732745

                E-mail address:
                jlenarci@monu6.cc.monash.edu.au
Newsgroups: comp.society
From: hauben@cunixf.cc.columbia.edu (Michael Hauben)
Subject: Help Needed with Communications and Computers
Organization: Columbia University
Date: Mon, 5 Oct 1992 15:58:28 GMT

        I am taking a Computers & Society Class right now and
need to figure out what would be important to write my term paper
about. I am also thinking of proposing a major or concentration
on Computers & Society. For this paper I am thinking about
writing on the progressive impact computers have had on
communications. So, I would appreciate any references or
suggestions anyone might have to offer. By suggestions I mean
what people think would be a worthwhile question in the
combination of computers and communications that would be worth
focusing on.

The Following are just notes I made to myself. But if you feel
there is a way further to build on them, please let me know.

        Thanks!
        -Michael    hauben@cunixf.cc.columbia.edu

Paper Topic Ideas for Computer & Society

My paper will focus on the developing role and importance of
telecommunications ( or maybe the combination of computer and
communication technology.) Possible topics would be:

1) The Equalitarian role computers play in communications. (How
conferencing + bbses allow animosity and thus remove many
intimidations putting ideas in the front. Also because asychorous
allows as many people as possible to participate in whatever
timeframe. Basically allows anyone who wants to speak the right
to speak.) Facilitation of freedom of speech

2) How computer networks facillitate the transfer of information
and flow of information. More specific?
Spreading information to a wider body of people. allowing people
to become more educated.

3) Making the world a smaller place...allowing for new
international communities to form. (based on common interests,
backgrounds, or abilities.)

4)What Usenet is and what it might or could become, or what
direction it is going in. What potential exists.

-------

Or is my question: did telecommunications help bring the berlin
wall down and the events in eastern europe.
Also remember how students in China (Tianiman Square) and France
utilized the new telecommunications technologies.
Date: Mon, 28 Sep 1992 13:28 EDT
From: TFLAVELL@pbs.org
Subject: PBS Videoconference Announcement
Newsgroups: comp.society
Date: 25 Sep 1992 17:19:28 +1000
From: Jonathan Ridler <JONATHAN@ucsvc.ucs.unimelb.edu.au>
Subject: Int. Conf. on I.T. and People (ITaP) Moscow, May 93
Newsgroups: comp.society
From: wagner@utoday.com (Mitch Wagner)
Newsgroups: comp.society
Subject: (no subject given)
Date: 2 Oct 92 21:13:32 GMT
Article-I.D.: utoday.9210021713.aa12511

Newsgroups: comp.society