HDTenEightyP/NetNews huggingface dataset:
From: 9119175@sunvax.sun.ac.za (Jacques Strydom)
Subject: hash function
Organization: University of Stellenbosch, RSA
Date: Mon, 5 Oct 1992 10:10:52 GMT

I am looking for a hash fuction that operates on random strings of length
between 3 and 30 characters.



What i have tried is to sum the ascii values in random string and then
find the sum modulo x.  Where x is a prime and one more than the amount
of buckets used in the table.  Will it be effective (*concerning the 
distribution of the hashvalues*) to use any prime?


I am going to use the seperate chaining method for collision handling.

Any info will be gladly accepted


Please mail me if you can help.



Jacques Strydom
University of Stellenboch
South Africa

strydom@cs.sun.ac.za
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.programming
Subject: Re: reference counting garbage collection
Date: 5 Oct 1992 20:03:18 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1992Oct4.220907.1053@organpipe.uug.arizona.edu> dave@cs.arizona.edu (Dave Schaumann) writes:
>On the other hand, if cycles in your structures are fairly rare, you could use
>reference-cound collection with an occasional call to a mark-and-sweep
>algorithm to catch the stragglers...

Also, if your cycles never become disconnected, you may not have any
problem.

For instance, if you're modeling families, you may have references to
parents, children, spouses, and siblings, with lots of cycles resulting.
But if deleting a spouse link in one direction implies that the inverse
spouse link will always be deleted, and similarly for all the other links,
and you always delete internal links before deleting outside references to
the subgraph, you'll never get a cycle of uncollectable garbage.

The above caveats are pretty easy to apply to hierarchically organized data
and some other data with relatively uniform reference patterns.  Less
restrictive GC techniques are popular in AI languages because they tend to
have more random reference patterns.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.programming
From: mjs@hubcap.clemson.edu (M. J. Saltzman)
Subject: Re: Costs per line of code
Organization: Clemson University, Clemson SC
Date: Tue, 6 Oct 1992 15:42:47 GMT

In article <ld1ddmINNo95@news.bbn.com> pplacewa@bbn.com (Paul Placeway) writes:
>< Tony Wingo writes:
>
>< >"If one worker can dig a posthole in five minutes, how long would it take
>< >ten workers to dig the same posthole?"
>
>sjr@afterlife.ncsc.mil (Stephen J. Roznowski) replies:
>
>< I prefer to think of the original question as follows:
>< If a worker digs an average of 12 postholes an hour earning $10.00 per
>< hour, approximately how much will it cost me to dig 120 postholes with
>< 10 workers? [and to really get back to the intent of the original question
>< how much are those postholes worth?]
>
>Unfortunately, as Brooks points out, this is the wrong way to think
>about a software (or hardware) project, because generally the group is
>not making 120 different completely independent postholes (programs),
>but one much larger hole (program).  Since the parts the individuals
>are working on must fit together and work, building each piece is a
>very small part of the total effort (and therefore cost).
>
>So the question is more like "If a worker digs an average of 100
>shovelfulls of dirt in an hour earning $10.00 per hour, how long will
>it take 10 workers to dig 1 posthole?  How long if they are digging in
>clay?  How long if digging in granite?"
>
>		-- Paul Placeway <pplacewa@bbn.com>

I think it was Brooks who said: No matter how many women you assign
to the job, it still takes nine months to give birth to a baby.

-- 
		Matthew Saltzman
		Clemson University Math Sciences
		mjs@clemson.edu
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.programming
Subject: Re: Translators preserving comments
Date: 2 Oct 92 10:41:56 GMT
Organization: AND Software BV Rotterdam

In article <1a5qtfINNa9p@bigboote.WPI.EDU> rcarter@wpi.WPI.EDU (Randolph Carter <Joseph H. Allen>) writes:
|Every once in a while I get the desire to make a really good ANSI-C to K&R-C
|translator.  It's unque feature would be that it inserts appropriate
|typecasts to preserve the exact meaning of the original ANSI code.  For
|example:
|
|	long a; double b; int c;
|	void f(int,int,int,char *);
|
|	f(a,b,c,0);
|
|would be translated into:
|
|	long a; double b; char c;
|	int f();
|
|	f((int)a,(int)b,c,(char *)0);
|
|Anyway, that could easily be done with a real ANSI-C parser.  A neat
|additional feature would be if it could preserve the comments properly.  My
|best idea so far is to have the scanner attach the comments which appear to
|the immediate left of any token to the token it passes to the parser.  The
|parser then has to propogate the comment through the parse tree (or through
|various levels if a parse tree is not made).  Then when new code is output,
|the comments are generated as each level of the parse tree is unparsed.
|
|Has anyone seen something similer to this?  I'm curious if and how anything
|similer has been done in other translators (pascal to C is probably the
|closest problem).  

Wouldn't it be easier to parse the source code and generate a bunch
of macros for it? Something like:

#if __STDC__ != 1
#define void int
#define ARGS(x) 
/* And maybe some more stuff I can't think of, right now */
#else
#define ARGS(x) x
#endif

followed by one macro per function declared:

#define f(a, b, c, d) KR1_f((int)a, (int)b, (int)c, (char*)c)

The declaration of the original function `f' has to be changed into: 

void KR1_f(ARGS(int, int, int, char*));

The definition of the original function has to be changed into:

void f(a, b, c, d)
int   a;
int   b;
int   c;
char *d;
{ /* body */ }

which isn't that much work, IMHO. The comments would just be passed to
the output. This eliminates the construction of an entire parse tree
and the reconstruction of the source code out of it.

kind regards,

Jos aka jos@and.nl
Xref: sparky comp.programming:2761 comp.lang.c:14448 comp.lang.pascal:5780 comp.lang.objective-c:572
From: mcdonald@aries.scs.uiuc.edu (J. D. McDonald)
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: 2 Oct 92 16:15:43 GMT
Article-I.D.: aries.mcdonald.347
Organization: UIUC SCS

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
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.programming
Subject: Re: Lookahead (was: Re: Pascal vs C)
Date: 28 Sep 92 16:35:09 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Organization: University of Arizona

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 */

Thus, you have a partial ambiguity between prototyes and function headers,
which makes the situation even more muddy.  Fortunately, this is fairly 
easy to deal with in an LR() parser, but it pretty much forces you to
do nasty things to your grammar if you want to use an LL() algorithm.

There are other problems with typedef names in function prototypes
(see Jim Roskind's C & C++ grammars for full details), but I haven't
studied them well enough to explain them clearly.

Anyone designing a new language would be well advised to use C (and
C++) as primers of mistakes worth avoiding.

-- 
--- jumbo shrimp --- pretty ugly --- awfully nice --- constant change ---
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
From: crawford@boole.mitre.org (Randy Crawford)
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Organization: The MITRE Corporation, McLean, VA
Date: Tue, 29 Sep 1992 04:35:22 GMT

In article <1992Sep28.003421.1246@RedBrick.COM> jfr@RedBrick.COM () writes:
(...) 
>The problem I started thinking about is WHY IN THE WORLD WOULD ANYONE
>USE SHORT INTS IN A PROGRAM, 

I agree that short ints are antiquated and generally counterproductive except
when packing data.  But I appreciate having the automatic onvversion routines
among 1, 2, and 4 byte integers built into C, because sometimes, I pack data.

>In a related conversation, someone mentioned that many organizations have
>coding standards that let them redefine the size of ints to keep this
>from happening.  For instance use int1, int2 and int4 as typedefs and you 
>can make them whatever you want.  This is where the thought struck me that
>makes me curious to get other peoples' opinion on.  Why would you EVER
>use NUMBERS in a program.  

The C bug which you encountered is a perfect example of the need for INT2s
and INT4s.  Because most PLs don't specify IN or OUT variables using subranges,
the programmer cannot know how large a data structure is needed to hold return
values.  As such, the data type MUST match that specified by the function call
prototype (if it exists).  Because dissimilar architectures often have different
names for 2 byte ints, you will find the function prototypes differing from
machine to machine.  The only way I know to produce code which is portable 
across their C libraries is to describe argument variables as being of sizes 
which match each architecture's prototypes with a minimum of re-editing.  How 
better to do that than embed the integer size in the type name (INT2, INT4, 
UINT2, UINT4, ...)?

--
Randy
crawford@mitre.org
-- 

| Randy Crawford        crawford@mitre.org        The MITRE Corporation
|                                                 7525 Colshire Dr., MS Z421
| N=1 -> P=NP           703 883-7940              McLean, VA  22102
From: seggers@semyam.dinoco.de (Stefan Eggers)
Date: 2 Oct 92 13:02:23 +0100
Subject: Re: Daylight saving time (UK)
Newsgroups: comp.programming
X-Newsreader: TIN [version 1.1 PL6]

Neil Bonnaud (bonnaud@rtf.bt.co.uk) wrote:

> OK then - a follow up question from me - am I right in thinking that
> a) for the UK the clocks go forward from 1AM to 2AM and back from 2AM to 1AM?
> b) other countries using daylight saving time change at the same time?

In  germany  it goes from 2:00 AM to 3:00 AM (in spring) or 3:00 AM to
2:00  AM  (in  fall).  It starts on easter sunday and ends on the last
sunday in september.

Stefan.
-- 
Stefan Eggers                UseNet: seggers@semyam.dinoco.de
Max-Slevogt-Str. 1
W-5000 Koeln 91
Federal Republic of Germany

Newsgroups: comp.programming
From: schimmel@gandalf.ca (Fred Schimmel)
Subject: Re: Calculating a CRC of other CRCs
Organization: Gandalf Data Ltd.
Distribution: na
Date: Tue, 6 Oct 1992 21:32:58 GMT

In <1992Oct5.103012.9011@iccgcc.decnet.ab.com> schmidtg@iccgcc.decnet.ab.com writes:



>I am looking for a mechanism to quickly compare two programs.  Each program
>will reside on a different CPU and the programs may be large, so a direct byte
>by byte comparison would be too time consuming.  I only need to know whether
>the two programs are identical or they are different -- I will not be generating
>difference listings.  I would like to use a CRC computed on the entire program
>as a means of comparison.

>In addition, the program is organized as "chunks" and a chunk may be
>independently edited.  However, when the chunk is edited, I would like to
>avoid having to recalculate the CRC for the entire program.  I would like to
>somehow "incrementally" update the CRC based on a small change.  I doubt this
>is possible, so an alternative is to calculate a CRC for each chunk and then
>calculate the CRC for the entire program by calculating a CRC on all of the
>"chunk CRCs".  In that way, I can avoid having to examine the entire program
>each time a chunk has changed.

>However, I don't know how reasonable it is to calculate "a CRC of other CRCs".
>There may be some statistical pitfalls in doing this which may reduce the
>effectiveness of the CRC and introduce the possibility of error.

>Does anybody have any thoughts on this?

>Greg Schmidt		schmidtg@iccgcc.decnet.ab.com

Please refer to the article in IEEE Transactions on Communications, Vol 40,
No 6, June 1992, starting on page 989 titled: "A Method for Updating a Cyclic
Redundancy Code". This describes how to modify a CRC which protects a frame
relay data frame which has had some header bits modified as it passes through 
the network. The CRC is modified by the difference rather than recalculating 
it. The problem is this method may only be useful for bit modification, not
insertion or deletion.

Hope this helps.

---

Fred Schimmel                                    schimmel@gandalf.ca
Gandalf Data Ltd.                                                 ^^
Cherry Hill, NJ   USA    << my desk's in NJ -- my host's in Canada^^
Newsgroups: comp.programming
From: grow@mindvox.phantom.com (George Row)
Subject: reference counting garbage collection
Keywords: abstract data type reference counting
Organization: [Phantom Access] / the MindVox system
Date: Sun, 4 Oct 1992 11:50:00 GMT

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

My aim is to create an abstract type module which  supports 
reference counting garbage collection on the type which it provides.

The technique has long been part of programming "folk wisdom" it has a
 pedigree going back to Knuth vol1 1968 and earlier; it is referred to   
in passing by many text-books (Sincovec&Wiener in the modula domain, and 
Cox & Novobilski in C domain).          
 
HOWEVER I have not found a single treatment anywhere which explains
 fully what facilities should be provided in a garbage-collectable
 abstract type module and the rules for using these facilities in an
 application module.
  
I would be glad to receive suggestions and will summarise responses,
if there is sufficient interest.
 
Note I am not asking how to write a compiler or interpreter which 
supports ref counting garb coll, but how to provide garb coll in the
raw C or Modula2 world whichj supports only alloc/dealloc.

If you have read this far thanks for 20 lines worth of attention! :)



George Row                  grow@mindvox.phantom.com  on internet
                            cfyx33@mgvax.ulster.ac.uk on Janet
University of Ulster at Magee College

Xref: sparky comp.programming:2742 comp.lang.c:14243 comp.lang.pascal:5706 comp.lang.objective-c:564
From: klaus@diku.dk (Klaus Ole Kristiansen)
Newsgroups: comp.programming,comp.lang.c,comp.lang.pascal,comp.lang.objective-c
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: 29 Sep 92 09:35:16 GMT
Organization: Department of Computer Science, U of Copenhagen

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
Newsgroups: comp.programming
From: dshaker@qualix.com (Doug Shaker)
Subject: Re: Daylight saving time (UK)
Reply-To: dshaker@qualix.com
Organization: QUALiX Group, Inc.
Date: Mon, 5 Oct 1992 19:37:22 GMT

In article 46944@semyam.dinoco.de, seggers@semyam.dinoco.de (Stefan Eggers) writes:
>Neil Bonnaud (bonnaud@rtf.bt.co.uk) wrote:
>
>> OK then - a follow up question from me - am I right in thinking that
>> a) for the UK the clocks go forward from 1AM to 2AM and back from 2AM to 1AM?
>> b) other countries using daylight saving time change at the same time?
>
>In  germany  it goes from 2:00 AM to 3:00 AM (in spring) or 3:00 AM to
>2:00  AM  (in  fall).  It starts on easter sunday and ends on the last
>sunday in september.
>
 
Does anyone know of a document that would summarize the customs/localizations
that different political units have adopted regarding summer-time/daylight-
savings-time and their equivalents [ Does South American have daylight savings
time in January, for example?]

 - Doug Shaker

	voice:	415/572-0200
	fax:	415/572-1300
	email:	dshaker@qualix.com
	mail:	Qualix Group
		1900 S. Norfolk St., #224
		San Mateo, CA 94403
From: jonathan@mantis.co.uk (Jonathan Egre')
Newsgroups: comp.programming
Subject: Re: Costs per line of code
Date: 23 Sep 92 15:42:41 GMT
Organization: Mantis Consultants, Cambridge. 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.
> 
> For example, if a line of code cost about $50.00 to produce, then a 10,000
> line package represents an investment of $500,000.00.

In my humble opinion, I think you're going about this the wrong way.

A 10,000-line package represents an investment of whatever you paid for it.

If you employed 20 people with an average salary plus overheads of 
$40,000/year for 6 months to produce the software, then you have an 
investment of exactly 20 * $40,000 * 0.5 = $400,000.

If you bought the copyright from the authors for $600,000 then you have made
an investment of $600,000.

The "worth" of the package is either what you paid for it, or what you think
other people will pay for it (either for the complete copyright, or the
total expected sales of copies).  Take your pick.

-- Jonathan Egre' = jonathan@mantis.co.uk = jonathan_e@cix.compulink.co.uk --

From the Usenet Dictionary of English Usage:
clueless: Adjective describing someone with opinions different from your own
                     
Xref: sparky comp.programming:2777 comp.lang.c:14529 comp.lang.pascal:5822 comp.lang.objective-c:583
From: ulrich@galki.toppoint.de (Ulrich Gall)
Newsgroups: comp.programming
Subject: Re: Costs per line of code
Date: Fri, 25 Sep 92 20:04:27 GMT
Distribution: world               
Organization: private UUCP site, Kiel, Germany

avg@rodan.UU.NET (Vadim Antonov) writes:
>
> In article <-191659999@hpopd.pwd.hp.com> richi@hpopd.pwd.hp.com (Richard Jennings) writes:
> >If a software engineer costs (say) US$150000/year [1], including all overheads
> >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!

I think it really depends on what kind of software it is. Writing device
drivers like Vadim does is, in my opinion, about 50 times more time consuming
than writing, say, a game.

Thus, asking how much a line of code costs does not really make sense - all
you can tell is a range from maybe $3 to $150.

To everybody out there who thinks this just tooooo much:

Writing a line of code is not just typing 20 bytes on your PC keyboard. You
have to maintain your program (You have to be able to understand what it does
years later...) and write lots of documentation, even for yourself. And,
usually, every program is rewritten from 2 to 20 times...



Ulrich
Ulrich Gall, Seebrooksberg 2, W-2300 Klausdorf, Germany
Tel.: +49-431-790292, EMail: ulrich@galki.toppoint.de
From: nanda@kuhub.cc.ukans.edu
Newsgroups: comp.programming
Subject: Help Needed : Turbo Pascal
Date: 26 Sep 92 20:36:21 CDT
Organization: University of Kansas Academic Computing Services

Can someone tell me how to write binary values directly to a port in turbo
pascal ??

Pls reply to Nanda@kuhub.cc.ukans.edu

Thanks is advance..


-Sushmeeta
Newsgroups: comp.programming
From: reeuwijk@dutentb.et.tudelft.nl (C. van Reeuwijk)
Subject: Re: Need Book Reviews on Sedgewick's Algorithms Books
Organization: Delft University of Technology, Dept. of Electrical Engineering
Date: Sat, 26 Sep 1992 20:29:28 GMT

In <1992Sep25.205420.25049@saifr00.cfsat.honeywell.com> lam@saifr00.cfsat.honeywell.com (Josh Lam) writes:

>Hi,

>Can any one please provide reviews/comments on Sedgewick's 
>'Algorithms', 'Algorithms in C' and 'Algorithms in C++'? 
>(*please* comment on the books and not on any particular language!)


In short: I like the book.

It does a good job of explaining all the basic algorithms that a programmer
should know (or at least know about). It also gives sound advice on
programming in general and the usefulness of the various algorithms in
real-life problems.

I must add, though, that I have not learned any of these algorithms from
the book; I have bought the book as a reference to replace the Knuth books
that were available at my previous job. This book is more limited 
but much more readable.

=-=-=-=
C. van Reeuwijk			e-mail: C.vReeuwijk@ET.TUDelft.NL
From: pdh@netcom.com (Phil Howard )
Newsgroups: comp.programming
Subject: Re: filling a BST from random and sorted data
Date: 6 Oct 92 18:33:48 GMT
Article-I.D.: netcom.1992Oct6.183348.22383
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

pdh@netcom.com (Phil Howard ) writes:

>Does anyone have any references for an algorithm suitable for filling
>in a binary search tree from data that in some cases will be in random
>order and in some cases will be sorted in ascending sequence?  I'd
>like to approach the average tree search access times as would be
>expected from random input.

Just to clarify this a bit.  The order of the arriving data is unknown
as it arrives.  I might normally expect random order, but in many cases
I would really have to expect an already sorted order because the data
is subject to humans trying to arrange it in certain cases, and they
might sort it.

The data arrives by calls to the insert logic.  There is no opportunity
to look into the future.  The tree must be in a consistent state with
all data reachable when the insert logic returns.

Some suggests have come by e-mail.  Thanks.  I'll be looking up some of
these references.
-- 
/***********************************************************************\
| Phil Howard  ---  KA9WGN  ---  pdh@netcom.com   |   "The problem with |
| depending on government is that you cannot depend on it" - Tony Brown |
\***********************************************************************/