HDTenEightyP/NetNews huggingface dataset:
From: brnstnd@nyu.edu (Dan Bernstein)
Newsgroups: comp.programming
Subject: --- comp.programming charter: read before you post (weekly notice)
Date: 6 Sep 92 04:00:11 GMT
Organization: IR

comp.programming	Programming issues that transcend languages and OSs.

It is a matter of courtesy to read a USENET group for at least a month
before posting anything to it. You should be familiar with this article
and with all the regular announcements in news.announce.newusers. A
newsgroup is like a crowded meeting hall filled with people who want to
talk about similar subjects. Chances are that if you just stick your
head in and shout, you'll be saying something totally inappropriate or
asking a question which someone else asked last week, and everyone will
be angry at you. To avoid this, _read_ before you post.

What you _should_ post here (the charter):

	comp.programming is an unmoderated group for discussions of
	programming issues which are not limited to a specific machine,
	operating system, or language: in particular, algorithms of all
	types. ``Programming issues'' means _practical_ programming
	issues: it is considered very bad form here to discuss issues
	with which you do not have direct programming experience.

What you _should not_ post here:

	Any issue which is limited to a specific machine, operating
	system, or language is completely inappropriate for this group.
	If you are programming under UNIX, use comp.unix.programmer. If
	you are programming a PC, use comp.os.msdos.programmer. If you
	are programming a Mac, use comp.sys.mac.programmer. If you are
	programming an Amiga, use comp.sys.amiga.programmer. If you are
	programming a game and think that your question is of interest
	to other game programmers, use rec.games.programmer. If you're
	absolutely sure that your question is on the use of the C
	language---it wouldn't make sense if you were using a different
	language---try comp.lang.c. If your question is a meta-question
	which has to do with features of various programming languages,
	use comp.lang.misc. If your question has to do with theoretical
	results which have to do with computer science rather than
	programming, try comp.theory. Finally, if you're sure that your
	question would make sense under a variety of operating systems,
	running on a variety of machines, and in a wide variety of
	programming languages, then comp.programming is probably right.

	Note added 3/9/92: If you want source code for something, you'll
	get better response in comp.sources.wanted, which was created to
	handle such requests.

Other comp.programming conventions:

	It's often difficult to talk about programming without quoting
	the results of that programming---i.e., code. There is nothing
	wrong with using a particular language to present code samples,
	as long as they _could_ have been expressed in various other
	languages. However, you are less likely to have your question
	understood if you illustrate it with a choice segment of APL
	than if you use pseudo-code, Algol, C, etc.

For future reference, comp.programming passed by a vote of 403-47. It
was created 3/1/92.

---Dan
Newsgroups: comp.programming
From: ppc1@cec1.wustl.edu (Peter Pui Tak Chiu)
Subject: FULL HOUSE
Organization: Washington University, St. Louis MO
Date: Sun, 13 Sep 1992 14:44:11 GMT


hi everyone,

i am trying to find the probability of getting a hand of full house from a
shuffled deck of 52 cards.

theoretically, the probability (i think) is:

        (13 * 4C2) * (12 * 4C3)
        -----------------------  =  0.001440576
                 52C5

but i wrote a c program to calculate this probability and the results turn
out to be very different.

here is part of the results i have:

* the first column denotes the number of trials
* the second column denotes the probability obtained so far


5400000 0.00420815
5410000 0.00420758
5420000 0.00420867
5430000 0.00420829
5440000 0.00420937
5450000 0.00421046
5460000 0.00421154
5470000 0.00420987
5480000 0.00420967
5490000 0.00420765
5500000 0.004208  ..... this means after 5500000 trials, the prob. is 0.004208


from these results, i conclude that the probability would be pretty much around
0.00421 which is very different from the theoretical value.

does anyone know why???

i have included the program i wrote.  it is written in C++ and is very crude...
please try it and give me some feedback.

thanx a lot!

pete


// To calculate the probability of getting a full house

#include <iostream.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>

int BAD,hand[5];		// BAD when the hand dealt is illegal
				// e.g. 5 of the same kind.
				// hand is an array holding the cards dealt
long COUNTER=0, GOOD=0;		// COUNTER = # of trials
				// GOOD = # of full house dealt


void init(){
for(int i=0;i<5;i++)hand[i]=rand()%13;	// deal the cards
}

int fullhouse(){			// determine if fullhouse or illegal
int counter[13],flag3=0,flag2=0;
BAD=0;
for(int i=0;i<13;i++)counter[i]=0;
for(i=0;i<5;i++)counter[hand[i]]++;
for(i=0;i<13;i++){
	if(counter[i]==3)flag3++;	// detect for 3 of a kind
	if(counter[i]==2)flag2++;	// detect for a pair
	if(counter[i]>4)BAD=1;}		// detect for a bad hand
return((flag3==1) && (flag2==1));
}

main(){
srand((unsigned)time(NULL));		// initialize random seed
while(1){
init();					// deal the cards
if(fullhouse())GOOD++;			// if a FULLHOUSE is dealt, increment
					// GOOD
if(!BAD)COUNTER++;			// if the hand dealt is legal
					// increment COUNTER
if(!fmod(COUNTER,10000))cerr<<COUNTER<<" "<<double(GOOD)/COUNTER<<"\n";
	// print out the result every 10000 trials in the format:
	// [ # of trials ] [ probability obtained so far to get full house ]
}}
From: bbcs3410@Oswego.EDU (Eric T. Meddaugh)
Newsgroups: comp.programming
Subject: Date Reminder
Date: 11 Sep 92 02:01:05 GMT
Reply-To: bbcs3410@oswego.Oswego.EDU (Eric T. Meddaugh)
Distribution: usa
Organization: Instructional Computing Center, SUNY at Oswego, Oswego, NY

I have a little utility program that I made up, which will reminder a person
of certain events when they power up they're computer each day.  These
events can be entered in by the user.  It's called REMINDER.EXE and is a 
self-extracting file.  I'm not sure where to post it, so I'd though I'd say
something about it here.  If anyone knows a good newsgroup to post to, or
would like me to E-mail a copy, then E-mail me at bbcs3410@oswego.oswego.edu.
Also if anyone knows where I can drop this off in a ftp site, I'd like to know
too.  Thanks.
Newsgroups: comp.programming
From: dwagon@nella9.cc.monash.edu.au (Dougal Scott)
Subject: Dynamic Hashing Algorithm needed
Organization: Monash University, Melb., Australia.
Date: Sat, 5 Sep 1992 06:48:49 GMT

Does anyone have an algorithm for dynamic hashing? I remember reading about it
somewhere, but cannot remember where.
-- 
Dougal Scott-Dougal.Scott@fcit.monash.edu.au  Faculty of Computing & Info Tech
I am eager for the pleasures of the flesh more    Monash University, Caulfield
than for salvation, my soul is dead, so I shall            Victoria, AUSTRALIA 
look after the flesh. -Carmina Burana
Newsgroups: comp.programming
From: newberry@nmsu.edu (Jeff Newberry)
Subject: baseball stats program
Organization: Computing Research Lab
Distribution: comp
Date: Tue, 8 Sep 1992 18:04:24 GMT


Does anyone know where I can find a good baseball stats program with
multiple teams, multiple players, pitching stats, etc.

Jeff Newberry
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.programming
Subject: Re: Pascal vs C
Date: 15 Sep 92 04:26:30 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Organization: University of Arizona

In article <HBF5qB1w164w@oneb.almanac.bc.ca>, nimcompu@oneb writes:
>Ok.  I'm just one of thos guys that is just comming onto the programming 
>scene.  I have gone through what I think is quite a bit of Pascal.  But what 
>I would like to know is whick language (Pascal or C) is better for 
>programming in and why.

Pascal was designed as a teaching language, and C was designed to write
systems programs (compilers, operating systems, etc).  This has had a
profound effect on the design decisions that went into each language.

Pascal was made easy to learn by leaving out features that make it easy
to shoot yourself in the foot.  Unfortunately, these same features
turn out to be useful when it comes time to write complex and robust
code.  You can generally code around the difficulties, but it can be
obnoxious.

C, of course, has its own problems.  There are some features (old-style
parameter declaration, the whole declaration syntax, the when-is-a-
typedef-a-typedef problem, etc) that persist mostly for historical
compatability with old programs.  C has a lot of very powerful features,
which are, of course, prone to abuse.

C has the advantage of wide-spread availability (tho I can't imagine
that Pascal is /that/ far behind), and a close affinity with the Unix
(tm) environment.

Personally, given the choice between Pascal and C, I'd take C every time.
For me, the difficulties that are presented by Pascal's "saftey features"
are just too much of a bother.

If you have the choice, you might also consider Modula 2, Modula 3, or
Oberon as alternative Pascal-like languages (which I'm told don't suffer
from the same flaws that Pascal does).

-- 
Dave Schaumann			dave@cs.arizona.edu
Newsgroups: comp.programming
From: gary@nexnix.demon.co.uk (Gary Howland)
Subject: Expression manipulation
Distribution: world
Organization: nexnix
Date: Wed, 9 Sep 1992 19:52:10 +0000

Has anyone got a short program (any readable language - ie. not assembler)
that can take a simple expression (such as 3x + 4y + 5z = 6) and
produce a report for each of the x, y and z variables, such as

	x = (6 - 4y - 5z)/3
	etc.

Thanks in advance - Gary.
From: mtj@babar.asd.sgi.com (Michael Jones)
Newsgroups: comp.programming
Subject: Re: FULL HOUSE (REVISED)
Date: 14 Sep 92 20:15:20 GMT
Organization: Silicon Graphics, Inc.

Well, I rewrote it rather than debugging it. I've seen lots of
ways to simulate "random cards" that just don't work. Whenever
a Monte-Carlo simulation (literal, this time) has problems it
is wise to inspect the source and use of random numbers.

Advcie:

 1. Calling rand() is risky, stick with random().

 2. There is a much better way to shuffle the deck (see below).

Code (which may have faults of its own, no doubt):

-------8<------- Cut Here -----8<----- Cut Here -----8K-----

#include <stdio.h>

void make (int *deck)
{
int card;

for (card = 0; card < 52; card++)
    deck[card] = card % 13;
}

void shuffle (int *deck)
{
int card;
int swap;
int temp;

for (card = 0; card < 52; card++)
    {
    swap = random() % 52;

    temp = deck[card];
           deck[card] = deck[swap];
                        deck[swap] = temp;
    }
}

int test (int *hand)
{
int card;
int count[13];
int sets[6];

for (card = 0; card < 13; card++)
    count[card] = 0;

for (card = 0; card <  5; card++)
    count[hand[card]]++;

for (card = 0; card <  5; card++)
    sets[card] = 0;

for (card = 0; card < 13; card++)
    sets[count[card]]++;

return (sets[2] == 1 && sets[3] == 1) ? 1 : 0;
}

int main (int argc, char *argv[])
{
int card;
int hands = 0;
int found = 0;
int deck[52];

make(deck);

while (1)
    {
    shuffle(deck);

    for (card = 0; card < 52 - 5; card += 5, hands++)
        found += test(&deck[card]);

    if ((hands % 1000000) == 0)
        {
        printf("f=%5d h=%10d f=%16.14f%\n", found, hands, found/(double)hands);
        fflush(stdout);
        }
    }
}

-------8<------- Cut Here -----8<----- Cut Here -----8K-----

Results:

babar!mtj% cc -o right right.c
babar!mtj% right
f= 1403 h=   1000000 f=0.00140300000000
f= 2879 h=   2000000 f=0.00143950000000
f= 4312 h=   3000000 f=0.00143733333333
f= 5804 h=   4000000 f=0.00145100000000
f= 7218 h=   5000000 f=0.00144360000000
f= 8661 h=   6000000 f=0.00144350000000
f=10074 h=   7000000 f=0.00143914285714
 :
f=626140 h= 435000000 f=0.00143940229885
f=627612 h= 436000000 f=0.00143947706422
f=629051 h= 437000000 f=0.00143947597254
^C
-->> 95% 3:21:14 11542.0u 38.1s 48kmem <<--

Timing on my workstation, an SGI 4D420/VGX (2 40Mhz R3000's, 32MB ram). 

By the way ... how did you derive the analytic result?

-- Michael Jones    mtj@sgi.com  415.390.1455  M/S 7L-590
		    Silicon Graphics, Advanced Graphics Division
		    2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Newsgroups: comp.programming
Subject: Re: FULL HOUSE
Date: 13 Sep 92 16:07:22 GMT
Organization: Computer Science, University of Melbourne, Australia

ppc1@cec1.wustl.edu (Peter Pui Tak Chiu) writes:

>hi everyone,
>
>i am trying to find the probability of getting a hand of full house from a
>shuffled deck of 52 cards.
>
>theoretically, the probability (i think) is:
>
>        (13 * 4C2) * (12 * 4C3)
>        -----------------------  =  0.001440576
>                 52C5
>
>but i wrote a c program to calculate this probability and the results turn
>out to be very different.
[...]
>does anyone know why???
>
>i have included the program i wrote.  it is written in C++ and is very crude...
>please try it and give me some feedback.
>
>thanx a lot!

[spelling flame on]
That should be "thanks", not "thanx"!
[spelling flame off]

>// To calculate the probability of getting a full house
>
>#include <iostream.h>
>#include <time.h>
>#include <stdlib.h>
>#include <math.h>
>
>int BAD,hand[5];		// BAD when the hand dealt is illegal
>				// e.g. 5 of the same kind.
>				// hand is an array holding the cards dealt
>long COUNTER=0, GOOD=0;		// COUNTER = # of trials
>				// GOOD = # of full house dealt

Avoid using globals variables without good reason.

>void init(){
>for(int i=0;i<5;i++)hand[i]=rand()%13;	// deal the cards
>}

Here is the cause of your problem.
Using the above function to deal the cards will not give the same distribution
as you would get doing it properly. You need to keep track of which cards
have already been dealt, since once you have dealt 2 aces, for example,
the chance of getting a third ace should be reduced to less than 1/13 since
there are only two more left in the deck.

I'd post code showing exactly how to do this, but I'm begining to think
that maybe this is a homework assignment, in which case you should probably
do it yourself ;-) It's not that difficult.

>int fullhouse(){			// determine if fullhouse or illegal
>int counter[13],flag3=0,flag2=0;
>BAD=0;
>for(int i=0;i<13;i++)counter[i]=0;
>for(i=0;i<5;i++)counter[hand[i]]++;
>for(i=0;i<13;i++){
>	if(counter[i]==3)flag3++;	// detect for 3 of a kind
>	if(counter[i]==2)flag2++;	// detect for a pair
>	if(counter[i]>4)BAD=1;}		// detect for a bad hand
>return((flag3==1) && (flag2==1));
>}
>
>main(){
>srand((unsigned)time(NULL));		// initialize random seed
>while(1){
>init();					// deal the cards
>if(fullhouse())GOOD++;			// if a FULLHOUSE is dealt, increment
>					// GOOD
>if(!BAD)COUNTER++;			// if the hand dealt is legal
>					// increment COUNTER
>if(!fmod(COUNTER,10000))cerr<<COUNTER<<" "<<double(GOOD)/COUNTER<<"\n";
>	// print out the result every 10000 trials in the format:
>	// [ # of trials ] [ probability obtained so far to get full house ]
>}}

Also, I suggest you get hold of a C++ version of "cb" or "indent".

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.programming
From: sjm@bcrki65.bnr.ca (Stuart MacMartin)
Subject: Re: Dynamic Hashing Algorithm needed
Reply-To: sjm@bcrki65.bnr.ca (Stuart MacMartin)
Organization: Bell-Northern Research, Ottawa, Canada
Date: Tue, 8 Sep 1992 17:27:11 GMT

In article <dwagon.715675729@nella9.cc.monash.edu.au>
dwagon@nella9.cc.monash.edu.au (Dougal Scott) writes:
>Does anyone have an algorithm for dynamic hashing? I remember reading about it
>somewhere, but cannot remember where.
>-- 

Dynamic File Structure for Partial Match Retrieval
Based on Overflow Bucket Sharing.  Tak-Sun Yuen and David Hung-Chang Du,
IEEE Transactions on software engineering vol. SE-12 No.8 August 1986

Note: The hash value is unconstrained; the hash table uses only n bits of it
in any overflow bucket.  The full hash value of each key is held with
the key in the overflow bucket, so you might as well use it when scanning
overflow buckets for an exact match.  This saves on expensive comparisons,
e.g. strcpy

If you need dynamically-extensible hashing on disk using little memory:

University of Warwick Theory of Computation Report no.27:
Spiral Storage: incrementally augmentable hash addressed storage
G.N.N. Martin  March 1979

Hope this is what you wanted.

Stuart

: Stuart MacMartin                                    email: sjm@bnr.ca      :
: Bell-Northern Research                              phone: (613) 763-5625  :
: PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA    Standard disclaimers apply. :
From: robert@cse.fau.edu (Robert France)
Newsgroups: comp.society.development
Subject: IS conferences?
Summary: IS in developing countries confs.
Date: 10 Sep 92 14:27:55 GMT
Organization: Florida Atlantic University, Boca Raton, FL, USA

Can anyone tell me when the next Information Technology in Developing
Countries (IFIP) conference will be held? I'd also be interested in hearing
about other conferences on the use and development of IS in developing
countries (particularly in the Caribbean region) - 
if you have any related conference notices or call for papers
can you please contact me (preferably by email). My email address is
robert@cse.fau.edu

Thanks.

Robert

-- 
Robert B. France                              |    Tel: (407) 367-3857
Assistant Professor                           |    Fax: (407) 367-2800
Dept. of Computer Science and Engineering     |    
Florida Atlantic University                   |    email: robert@cse.fau.edu
From: lpress@isi.edu (Laurence I. Press)
Newsgroups: comp.society.development
Subject: LDC Networking List/Archive
Date: 4 Sep 92 22:33:04 GMT
Reply-To: lpress@venera.isi.edu (Laurence I. Press)
Organization: USC-Information Sciences Institute


             GNET: an Archive and Electronic Journal

                  Toward a Truly Global Network

Computer-mediated communication networks are growing rapidly, yet 
they are not truly global -- they are concentrated in affluent 
parts of North America, Western Europe, and parts of Asia.  

GNET is an archive/journal for documents pertaining to the effort 
to bring the net to lesser-developed nations and the poorer parts 
of developed nations.  (Net access is better in many "third 
world" schools than in South-Central Los Angeles).  GNET consists 
of two parts, an archive directory and a moderated discussion.

Archived documents are available by anonymous ftp from the 
directory global_net at dhvx20.csudh.edu (155.135.1.1).  To 
conserve bandwidth, the archive contains an abstract of each 
document, as well as the full document.  (Those without ftp 
access can contact me for instructions on mail-based retrieval).

In addition to the archive, there is a moderated GNET discussion 
list.  The list is limited to discussion of the documents in the 
archive.  It is hoped that document authors will follow this 
discussion, and update their documents accordingly.  If this 
happens, the archive will become a dynamic journal.  Monthly 
mailings will list new papers added to the archive.

We wish broad participation, with papers from nuts-and-bolts to 
visionary.  Suitable topics include, but are not restricted to:

   descriptions of networks and projects
   host and user hardware and software
   connection options and protocols
   current and proposed applications
   education using the global net
   user and system administrator training
   social, political or spriritual impact
   economic and environmental impact
   politics and funding 
   free speech, security and privacy 
   directories of people and resources 

To submit a document to the archive or subscribe to the moderated 
discussion list, use the address gnet_request@dhvx20.csudh.edu.  

Larry Press
From: mem@bnr.co.uk
Newsgroups: comp.society.futures,alt.society.futures
Subject: Global working
Date: 8 Sep 92 13:25:43 GMT
Reply-To: mem@bnr.co.uk ()
Organization: BNR Europe Limited, London Road, Harlow, Essex, GB

Have you had any experience with working with people at a site remote
to you? Do you telework? Do you have to communicate with colleagues in
a different continent? If so, I'd be interested to hear about the
triumphs and the woes. 

How did you communicate with your colleagues?  What kinds of systems
did you use e.g. phone, fax, groupware, etc?  What worked well and why? What
were the problems you encountered? What adaptations to your behaviour
did you have to make in order to cope with the remoteness of your
colleagues? How did the physical distance between you affect your
working practices? How were the social/managerial relationships in the
group affected? How did you feel about having to work with colleagues
you couldn't meet on a daily basis?

Please email your anecdotes, thoughts, etc. etc. on teleworking and
global communication to:

M.E.Morris@bnr.co.uk

Many thanks ... Michele



*************************************************************************
email: M.E.Morris@bnr.co.uk    phone: +44 279 429531   fax: +44 279 441551
BNR Europe Limited, London Road, Harlow, Essex, CM17 9NA, England.

        I think it's kind of interesting the way things get to be.
        The way the people work with their machines.
**************************************************************************
From: mem@bnr.co.uk
Newsgroups: comp.society.futures
Subject: Global working
Date: 8 Sep 92 13:35:25 GMT
Reply-To: mem@bnr.co.uk ()
Organization: BNR Europe Limited, London Road, Harlow, Essex, GB


Have you had any experience with working with people at a site remote
to you? Do you telework? Do you have to communicate with colleagues in
a different continent? If so, I'd be interested to hear about the
triumphs and the woes. 

How did you communicate with your colleagues?  What kinds of systems
did you use e.g. phone, fax, groupware, etc?  What worked well and why? What
were the problems you encountered? What adaptations to your behaviour
did you have to make in order to cope with the remoteness of your
colleagues? How did the physical distance between you affect your
working practices? How were the social/managerial relationships in the
group affected? How did you feel about having to work with colleagues
you couldn't meet on a daily basis?

Please email your anecdotes, thoughts, etc. etc. on teleworking and
global communication to:

M.E.Morris@bnr.co.uk

Many thanks ... Michele



From: mem@bnr.co.uk ()
Newsgroups: comp.society.futures,alt.society.futures
Subject: Global working
Reply-To: mem@bnr.co.uk ()
Followup-To: 
Distribution: world
Organization: BNR Europe Limited, London Road, Harlow, Essex, GB

Have you had any experience with working with people at a site remote
to you? Do you telework? Do you have to communicate with colleagues in
a different continent? If so, I'd be interested to hear about the
triumphs and the woes. 

How did you communicate with your colleagues?  What kinds of systems
did you use e.g. phone, fax, groupware, etc?  What worked well and why? What
were the problems you encountered? What adaptations to your behaviour
did you have to make in order to cope with the remoteness of your
colleagues? How did the physical distance between you affect your
working practices? How were the social/managerial relationships in the
group affected? How did you feel about having to work with colleagues
you couldn't meet on a daily basis?

Please email your anecdotes, thoughts, etc. etc. on teleworking and
global communication to:

M.E.Morris@bnr.co.uk

Many thanks ... Michele



*************************************************************************
email: M.E.Morris@bnr.co.uk    phone: +44 279 429531   fax: +44 279 441551
BNR Europe Limited, London Road, Harlow, Essex, CM17 9NA, England.

        I think it's kind of interesting the way things get to be.
        The way the people work with their machines.
**************************************************************************