HDTenEightyP/NetNews huggingface dataset:
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Pi (was Re: NO NUMBERS! (or even SHORT INTS!))
Organization: Computer Science, University of Melbourne, Australia
Date: Sun, 11 Oct 1992 10:16:48 GMT

hartman@ulogic.UUCP (Richard M. Hartman) writes:

>#define PI ((double) 3.1415926535897932384626)
[...]
>For floating point constants it's usually best to define as double
>to force greater precision.

You clearly have little knowledge of the C language.

The type of a floating point constant is always double, unless it has
a type suffix (one of 'f', 'F', 'l', or 'L') at the end.
For greater precision, you can use the type long double, in which case
you should use an 'l' or 'L' suffix, ie.

	#define PI 3.14159265358979323846L

Of course, since pi is defined in the standard header file <math.h>, you
should use that value in preference to defining it in yourself, if you
are justing using double rather than long double.

	#include <math.h>
	#define PI M_PI

-- 
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: kenny@world.std.com (Kenneth R Crudup)
Subject: need a long signed multiply
Organization: Software Tool&Die, (Boston), MA
Date: Wed, 14 Oct 1992 17:58:19 GMT



I am looking for a signed multiply routine that recieves two longs
(long here == 32-bit) and returns long. If it uses the "*" operator, the
multiply used internally can only be 16bit x 16bit = 32bit signed, which
is what I have on this chip.

Thanks in advance,

	-Kenny

-- 
Kenny Crudup, Unix Systems Consultant	kenny@world.std.com
16 Plainfield St. Jamaica Plain, (Boston), MA 02130-3633
Home +1 617 524 5929 	Home Fax +1 617 983 9410
							Lick Bush in '92!
Newsgroups: comp.programming
From: bell@nella4.cc.monash.edu.au (mr g.a. bell)
Subject: Help with Menus in TurboVision
Keywords: TurboVision
Organization: Monash University, Melb., Australia.
Date: Mon, 12 Oct 1992 09:01:03 GMT



Please help, can anyone supply SRC for menus in TurboVision (in C)

I have read the Manual and can not seem to do what I need to do.

Firstly 

Having a Top level menu without a submenu 

and Secondly

Having a submenu within a submenu.

I know that TMenuItem and TSubMenu have overload operators
but I can not seem to get the syntax correct for what I want.

also where can I find example SRC to Turbovision?
Any help appreciated

thanks,

Gary

``````````` bell@nellads.cc.monash.edu.au `````````````````````````````````````
| Gary Bell                                                                   |
| Department of Robotics and Digital Technology                               |
|Faculty of Computing, Caulfield Campus, Monash University, Australia         |
-- 
``````````` bell@nellads.cc.monash.edu.au `````````````````````````````````````
| Gary Bell                                                                   |
| Department of Robotics and Digital Technology                               |
|Faculty of Computing, Caulfield Campus, Monash University, Australia         |
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.programming
Subject: Re: Literals as variables (was Re: NO NUMBERS!...)
Date: 11 Oct 92 12:58:39 GMT
Organization: AND Software BV Rotterdam

In article <ral.718642823@panda> ral@imagen.com (Robert A. Lerche) writes:
|hartman@ulogic.UUCP (Richard M. Hartman) writes:
|
|>There was a really old bug I heard of once.  FORTRAN compiler
|>kept literal values as if they were variables (who knows why,
|>perhaps it had to do w/ the machine architecture....) so when 
|>a typo occurred, instead of:
|>	i3 = i1+1
|>they had:
|>	3 = i1+1
|
|>and from then on the numeric constant '3' in the program was
|>interpreted as whatever the value of "i1+1" was at the time
|>(i.e. if i1 had been 5, i1+1 would have been 6 and from then
|>on,
|>	i2 = 1+3
|>would set i7 to the value of 9!!!)
|
|This seems the appropriate spot to point out that C explicitly defines
|character string literals as variables.  That is, a program is
|explicitly allowed to modify a literal, with results parallel to the
|above.

Well, it's a bit tricky, but I think that the ANSI-C standard implicitely
states that a character string literal is _not_ modifiable:

ANSI-C 3.1.4 String literals:

`Identical string literals of either form need not be distinct. If the
program attempts to modify a string literal of either form, the behavior
is undefined.'

[ end quote ]

Let me give an example:

int i= 1, j= 1;

i= 2;

would j contain the value 2, after the last assignment of i? No, but have
a look at the following example;

char *p= "foo", *q= "foo";

p[0]= 'b';

Would q point to a string literal "boo"? No one knows, sometimes it
does, when the compiler is smart enough to do string folding, sometimes
it doesn't. I've seen implementations where string literals are stored
in memory where just read access is allowed.  Modifying string literals 
can mess things up.

Again, I can't find any explicit reference in the ANSI-C standard that
says that string literals are modifiable, but on the other hand, I can't
find any explicit reference that they are _not_ modifiable. Just the
paragraph I quoted above ...

kind regards,

Jos aka jos@and.nl
From: phd85@seq1.keele.ac.uk (D.H. Holden)
Newsgroups: comp.programming
Subject: Re: C programing
Date: 9 Oct 92 11:55:18 GMT
Organization: Keele University, England

From article <1992Oct8.152326.10066@hubcap.clemson.edu>, by mjs@hubcap.clemson.edu (M. J. Saltzman):
> In article <1992Oct7.204027.5598@netcom.com> pdh@netcom.com (Phil Howard ) writes:

	Teach yourself C.

	Schildt.

	This teaches C on the understanding that the student is learing
	to program for the first time.
	I've also found it useful learning C even though I have been an
	F77 program for several years.
--
Dave.
phd85@uk.ac.keele.seq1
Newsgroups: comp.programming
From: pt@geovision.gvc.com (Paul Tomblin)
Subject: Ellipses?
Reply-To: pt@geovision.gvc.com
Organization: Not officially GeoVision Systems Inc., Ottawa, Ontario
Date: Thu, 15 Oct 1992 14:48:16 GMT

I need an algorithm for generating points along an ellipse.  I assume I
would have to specify three input points (centre, semi-major axis end,
and another?)  These ellipses cannot be contrainted to have the semi-major
axis along the x-axis.

Thanks...
-- 
Paul Tomblin, pt@geovision.gvc.com
(This is not an official opinion of GeoVision Systems Inc.)
"I don't have time to think it through: I've got to get this code written!"
From: thewiz@toz.buffalo.ny.us (The Wiz)
Newsgroups: comp.programming
Subject: Re: A good 'diskette-filling' algorithm?
Date: 14 Oct 92 23:50:32 GMT
Organization: The Tower of Zot - (716)8338-616

vaarisko@tnclus.tele.nokia.fi writes:

> 
> Does anyone know a good algorithm for a 'diskette-filling' program?
> The algorithm should find a subset of a set of numbers (=file sizes)
> the sum of which is closest, but not bigger, than a given number (=disk
> space left) ie. kind of a 'best-fit' algorithm..
> 
> I intend to put the algorithm into practice using 4dos batch language, so if
> it tends to be *VERY* slow, maybe a 'nearly best-fit'-algorithm would do.

        I have a programed called FILL (for the IBM PC) that fills 
floppies by taking the sizes of all the files, and coping the files to 
the disks, always taking the largest file that will fit.  
        It's a simple algrorythm, take all the file sizes and sort them, 
take the free space on the disk and copy the largest file that will fit, 
remove it from the list and repeat until there is no file that will fit 
or the disk is full, then go to the next disk.
        If you have a good file size variety it does well.  I copied 60 
floppies worth of compressed files from my harddrive with it, and 48 of 
them have 0 bytes free, 10 more have under 10K each free.....
        If you want a copy of the program E-Mail me and we can make 
arrangements (it's shareware).

---------------------------------------------------------------------
thewiz@toz.buffalo.ny.us (The Wiz)
-- Change this!
Newsgroups: comp.programming,comp.lang.misc
From: bosullvn@unix1.tcd.ie (Bryan O'Sullivan)
Subject: Re: C programing
Followup-To: comp.lang.misc
Organization: Department of Computer Science, Trinity College, Dublin, Ireland
Date: Sat, 10 Oct 1992 19:02:57 GMT

phd85@seq1.keele.ac.uk (D.H. Holden) writes:

>> In article <1992Oct7.204027.5598@netcom.com> pdh@netcom.com (Phil Howard ) writes:

>Teach yourself C.

>Schildt.

A proviso: many of Schildt's examples don't work.  They have
obviously never been tested; one (in one of his books) even pretends
to be a Pascal-to-C translator, and just does straight lexical
substitution of equivalent token types.  If you have bad enough
judgment to buy several of his books, you'll be disappointed to
notice that he lifts large blocks verbatim from one and plasters
it into various of the others.  Very unethical, in my opinion.
Still, I do know some people who swear by Schildt.  Most, however,
having read his books, avoid them; I would advise anyone to do
likewise without even bothering to try them out.

	-- Bryan

--
Bryan O'Sullivan                                        bosullvn@unix1.tcd.ie
Department of Computer Science                     "Pieces of nine, pieces of
University of Dublin                                nine!" -- a parroty error
Newsgroups: comp.programming
From: hp@vmars.tuwien.ac.at (Peter Holzer)
Subject: Re: Literals as variables (was Re: NO NUMBERS!...)
Organization: Technical University Vienna, Dept. for Realtime Systems, AUSTRIA
Date: Fri, 9 Oct 1992 23:21:15 GMT

ral@imagen.com (Robert A. Lerche) writes:

>This seems the appropriate spot to point out that C explicitly defines
>character string literals as variables.  That is, a program is
>explicitly allowed to modify a literal, with results parallel to the
>above.

This seems the appropriate spot to point out that C explicitely defines
the result of attempting to modify a string literal as undefined. That
is, a program is explicitely forbidden to modify a literal, with
results ranging from quietly ignoring the writes, over actually
changing the literal (and possibly other literals as well) or
terminating the program with an exception to uuencoding and
crossposting itself to comp.programmers, alt.peeves and
alt.binaries.pictures.tasteless.

>Technology marches on.

Right! 
-- 
|    _  | Peter J. Holzer                       | Think of it   |
| |_|_) | Technical University Vienna           | as evolution  |
| | |   | Dept. for Real-Time Systems           | in action!    |
| __/   | hp@vmars.tuwien.ac.at                 |     Tony Rand |
From: jfc@nic.cerf.net (Co Ho)
Newsgroups: comp.programming
Subject: Recurring Appointment Calendar algorithm
Date: 13 Oct 92 21:05:58 GMT
Article-I.D.: news.3098
Organization: CERFnet


Hello, I am working on a Appointment/Calendar program and looking for
sources/algorithms to figure out the Recurring Appointments problem.

The problem is very simple:  Professor X. will teach a class next Spring
(Jan/93 - June/93) which will meet at 8-9AM, MWF, He also belong to a
committee which meet for the entire year (1993) on the third Wed. of every
month at 8AM.

What is the best way to calculate his appointment book and give warning
for any time conflict?

Thanks.

jfc@nic.cerf.net
Newsgroups: comp.programming
From: kumar@asl.dl.nec.com (Sudhir Kumar)
Subject: Re: Is a generic finite state machine engine reasonable?
Organization: NEC America, Advanced Switching Laboratory
Date: 12 Oct 92 21:26:28 GMT

schall@swtech06.cfsat.honeywell.com (Loren Schall) writes:

>Hello Netters, a colleague of mine brought me an interesting question
>and I knew that you would have some useful input.

>We're involved with a large realtime application that includes several
>pieces which could reasonably be implemented as finite state machines.
>Is it possible and reasonable to implement a "generic" finite state
>engine?  Please reply via e-mail and I'll summarize and re-post.  If
>you think this is an inapropriate place for this discussion, tell me
>where the right place is.

<deleted>

Look into LEX. 
I am sure you will be able to write a good utility using LEX to serve all your
needs involving finite state machines.

Good luck,

-- sudhir


>Loren
>schall@swtech.cfsat.honeywell.com (Loren Schall)

--
Sudhir Kumar		Any opinions expressed are strictly
kumar@asl.dl.nec.com    my own  and have nothing to do with
(214) 518-5000          NEC America, Inc.
1525 Walnut Hill Lane 
Newsgroups: comp.programming
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: Calculating a CRC of other CRCs
Organization: Curtin University of Technology
Date: Sun, 11 Oct 1992 05:54:04 GMT

In article <1992Oct7.051657.25322@nntpd.lkg.dec.com>,
usenet@nntpd.lkg.dec.com (USENET News System) wrote:
> 
> In article <1992Oct5.103012.9011@iccgcc.decnet.ab.com>
schmidtg@iccgcc.decnet.ab.com writes:

> Anyway, CRCs are a special kind of checksum.  In transmission over some
> kinds of channels, burst errors are common.  CRCs are usually tuned to
> catch 100% of all burst errors up to a certain number of consecutive bytes.
> They'll still only catch roughly the average proportion of burst errors
> past that limit, as any other checksumming method would (for the same size
> of checksum).
> 
> So if you have a reliable channel and you only want to test whether two
> sources PROBABLY match, you could just do + (arithmetic add) or XOR or
> something else on all the bytes of each source.  And when a small chunk
> is edited, subtract the checksum of the old portion (or XOR it back out)
> and add the checksum of the new portion (or XOR it in) and it's a piece
> of cake.

CRCs also detect swaps.  If your editing operations can include swaping
operations (eg, swap two lines of a text file), then you won't want to
use either addition or XORing, since they will both give you the same
result in this case and produce a false match.  I agree with the general
statement though, CRCs are usually overkill.  I'd suggest you do
something like this: In a single pass thru the file, calculate (using 32
bit numbers):

c1 = c1 + C[i]                       addition
c2 = c2 XOR C[i] << ((8*i) % 4)      XOR (rotated to use all 32 bits)
c3 = c3 XOR C[i] << ((3*i) % 24)     sliding XOR
and if you really want it, a real CRC as well.

Now, if all four of them match, you can be pretty sure that the files
are equal, of course, there is always a chance they aren't...

> Of course, this technique is about 50 years old, which means we can assume
> someone's going to get a patent on it soon  :-(

Aint that the sad truth.
   Peter.

_______________________________________________________________________
Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
From: jhenders@jonh.wimsey.bc.ca (John Henders)
Newsgroups: comp.programming
Distribution: world
Organization:  One of these days for sure
X-News: HERMES MMAIL 1.04 Rev. Sep  5 1992
Subject: Re: C programing
	<ratner.718408818@ficus.cs.ucla.edu>
	<1992Oct7.204027.5598@netcom.com>
	<1992Oct8.152326.10066@hubcap.clemson.edu>
	<1992Oct13.220406.3376@mksol.dseg.ti.com>
Date: Thu, 15 Oct 1992 00:36:10 -0700

In <1992Oct13.220406.3376@mksol.dseg.ti.com> mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:

>Exactly right.  The problem with finding a 'simple' book on C is that
>it will probably teach you just enough to handily blow your foot right
>off.  I still recommend Pascal as a first language, keeping in mind
>that most of the world isn't as kind to you as a Pascal compiler is
>going to be.  Then, after you understand about program development,
>worry about learning something like C.

    One of the best introductory books I've found for C is The C Primer 
from Byte books, written by Les Hancock and Morris Krieger, unlike some
others  I've looked at, the layout take you slowly and logigaly through
the basics up to the more advanced concepts. It makes no pretence of
turning you into  wizard overnight, but it does cover the basics in as
easy to follow way.
    Definately well named as a primer. After finishing it, you can go on
to the more advanced books with a good grounding in the basics.

    To get this off the C topic, which would be better restricted to 
comp.language.c, has anyone ever found a single book that allowed them 
to learn to be thoroughly proficient in any computer language? I always
seem to have at least 3 books on any language, finding that no one book 
can clarify every problem.

-- 

 "If Rush fans were braindead, why are there so   Bruce Bufalini
 many people posting to alt.music.rush?"              PSU
From: timster@brahms.udel.edu (Timothy P Brennan)
Newsgroups: comp.programming
Subject: COOL - parallel programming language
Date: 11 Oct 92 17:23:44 GMT
Organization: University of Delaware

I have to do some research on the "COOL" object-oriented parallel programming
language but I am having trouble finding references.  If anyone out there has
some information on this language or knows of some sources please e-mail.

Thanks
Tim Brennan      timster@brahms.udel.edu
From: James_Zuchelli@qm.claris.com (James Zuchelli)
Newsgroups: comp.programming
Subject: Re: C programing
Date: 7 Oct 92 20:04:17 GMT
Distribution: na
Organization: Claris Corp

In article <1ask1jINNjv5@usenet.INS.CWRU.Edu>, ai686@cleveland.Freenet.Edu (Ishaq Syed) writes:
> 
> 
> I am highschool student..and I would like to request a book that
> would teach me C in a si,mple way.  All the books I have incountered
> so far have been very complcateed.  I would like a name of a book that
> is good for self learning people.  The place I can buy the book would also 
> be nice.  Thank you very much.
> 
> 				ishaq

Kochan has a good book on c programming.  there are several books which start
you out easily.  I think there is one called "C made easy" that is pretty good.

It depends, too, on which platform you are on.  If Mac there are some good C
books, if PC there are many, if you just want a general C book you'll probably
have to browse a bit to see which book (and style of wrting ) you like best.

Any large book store in your area that has computer books probably has a good
selection.  

What I often do when looking for a book is to take a command or instruction and
compare how two or three different books explain it.  The one that makes the
most sense is often the best book.

James Zuchelli
--------------------
the above is my personal opinion and does not represent the opinion of Claris
corp or my employer.
Newsgroups: comp.programming
From: ender@cs.montana.edu (Jacob Cormier)
Subject: Re: Skip lists (was: Speeding up linked lists)
Organization: Dept. of Computer Science, MSU, Bozeman Mt 59717
Date: Thu, 15 Oct 1992 00:16:24 GMT

In article <1992Oct14.050230.18438@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
>Dave Schaumann (dave@cs.arizona.edu) answers a question in comp.lang.c:
>
>> > How else can one speed up linked list lookups?
>> 
>> Use a different data structure.  Hash tables, tries, binary search trees,
>> stacks and queues are all useful modifications on the basic linked-list
>> structure, and each has its own strengths and weaknesses.
>
>To this bag of tools should be added the skip list, which was invented
>by William Pugh in 1987 and described by him in the June 1990 issue of
>Communications of the ACM.  They have also been described by Frederick
>Hegeman in the February 1991 issue of the C Users Journal.
>
> [deleted description of skip list]

I have some articals and some pseudocode for this that I got off the net
last year.  If anyone would like a copy, Email me.

--------------------------------------------------------------------------------
Jake Cormier | Poncho Magoo's, the worlds only Irish-Mexican | No,  I don't know
ender@fubar.cs.montana.edu     |   restaurant, located in    | what kind of food
oususajc@trex.oscs.montana.edu |  scenic Kalispell, Montana  | they really serve
From: torbenm@diku.dk (Torben AEgidius Mogensen)
Newsgroups: comp.programming
Subject: Re: Is a generic finite state machine engine reasonable?
Date: 13 Oct 92 14:37:47 GMT
Organization: Department of Computer Science, U of Copenhagen

schall@swtech06.cfsat.honeywell.com (Loren Schall) writes:

>We're involved with a large realtime application that includes several
>pieces which could reasonably be implemented as finite state machines.
>Is it possible and reasonable to implement a "generic" finite state
>engine?  Please reply via e-mail and I'll summarize and re-post.  If
>you think this is an inapropriate place for this discussion, tell me
>where the right place is.

>I'm envisioning a (static) initialization step where the specific
>machine is defined (inputs, transitions, and outputs) and an
>invocation process taking an input and producing an output (the
>actual state transition being internal and invisible).

>The main objective we're looking for is ease of maintenance.  We
>believe that it would be easier to maintain several state machine
>descriptions and one implementation, than several different state
>machine implementations.

>Does anyone know of any appropiate references or examples (Ada, C,
>or C++ would be must useful).

In this years conference on Compiler Construction a paper by L.O.
Larsen describes how one can generate an efficient specific finite
state machine from a generic one by partially evaluating the generic
machine with respect to a definition. The paper is in Springer-Verlag
LNCS 641.

	Torben Mogensen (torbenm@diku.dk)
From: jost@jake.prz.tu-berlin.de (Jost Weinmiller)
Newsgroups: comp.programming
Subject: packet driver interface
Date: 15 Oct 92 15:42:56 GMT
Organization: TU-Berlin TUBKOM, Germany

Hi,

i am looking for a source code, building an addressable interface
to a packet driver.

i want to hand over packets from a higher layer to the
packet driver (got the driver already), have the driver
send the packets, grab the packets on the other end
and hand them over to the receiving higher layer again.

sounds quite simple, but i just cant find the interface.

any pointers welcome.

cheers
jost
-- 
jost weinmiller                
markelstrasse 41              
1000 berlin 41               
030/7933164
Newsgroups: comp.programming
From: lum@leland.stanford.edu (Benjamin Lai)
Subject: Writing Computer Programs by Direct Manipulation of Data Structures
Keywords: visual programming programming-by-example novel user interface
Organization: DSO, Stanford University
Date: Mon, 12 Oct 92 05:46:25 GMT

Newsgroups: comp.programming
From: kermits@ikaros.cc.uch.gr (Aggelos Keromyths)
Subject: Screen Program
Organization: Computer Science Department, University of Crete HELLAS
X-Newsreader: Tin 1.1 PL3
Date: Thu, 15 Oct 1992 17:37:35 GMT

Anyone managed to make the GNU screen program for IBM RS/6000 AIX 3.2?
Aggelos

Newsgroups: comp.programming
From: wingo@apple.com (Tony Wingo)
Subject: Re: NO NUMBERS! (or even SHORT INTS!)
Date: Thu, 8 Oct 1992 21:53:47 GMT
Organization: Apple Computer
Followup-To: comp.programming

In article <392@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman)
wrote:
> 
> There was a really old bug I heard of once.  FORTRAN compiler
> kept literal values as if they were variables (who knows why,
> perhaps it had to do w/ the machine architecture....) so when 
> a typo occurred, instead of:
> 	i3 = i1+1
> they had:
> 	3 = i1+1
> 
> and from then on the numeric constant '3' in the program was
> interpreted as whatever the value of "i1+1" was at the time
> (i.e. if i1 had been 5, i1+1 would have been 6 and from then
> on,
> 	i2 = 1+3
> would set i7 to the value of 9!!!)

Actually, the way this usually came about had to do with the fact that
FORTRAN passes arguments to subroutines by reference, so that if you had
something like:

    SUBROUTINE FOO(J)
    J = J+1
    END

and then somewhere in your program you had a line like

   CALL FOO(3)

you would in many cases change the value of the constant 3 to 4.  This has
been the source of many subtle bugs in FORTRAN programs.  

-tony

>>usual disclaimer<<
Xref: sparky comp.programming:2835 comp.lang.c:14691