HDTenEightyP/NetNews huggingface dataset:
From: bernie@metapro.DIALix.oz.au (Bernd Felsche)
Subject: Re: SCCS & make
Keywords: SCCS, make, C
Organization: MetaPro Systems, Perth, Western Australia
Date: Sun, 12 Apr 92 14:15:07 GMT

In <26461@hydra.Helsinki.FI> mnykanen@cs.Helsinki.FI (Matti Nykanen) writes:

>The man entry on "make" states that it works with SCCS, i.e. when a file
>is missing it tries to "SCCS get" a read-only copy for compilation
>first. This works on C source files with suffix ".c" but *not* with
>header files with suffix ".h". How could I correct this?

Funny, it's worked for me... maybe I'd already written
the RULES (see man make) -- got the hint?

>Internet: Matti.Nykanen@Helsinki.FI  Department of Computer Science
>Voice:    +358 0 708 4207            University of Helsinki,Finland
-- 
+-----+ Bernd Felsche                     _--_|\  #include <std/disclaimer.h>
| | | | MetaPro Systems Pty Ltd          /      \ bernie@metapro.DIALix.oz.au
| | | | 328 Albany Highway,              X_.--._/         Fax: +61 9 472 3337
|m|p|s| Victoria Park, Western Australia 6100  v        Phone: +61 9 362 9355
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.programming
Subject: Re: functions & return values (was Re: Reinventing the wheel)
Date: 13 Apr 92 09:20:07 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <3582@caslon.cs.arizona.edu>, dave@cs.arizona.edu (Dave Schaumann) writes:
: To bring up a specific example, which would you rather have to debug --
: a program supporting this language construct:
:   foo a ; bar b ;
:   { a, b } = quux() ;
: 
: or something like this:
: 
:   struct foobar{ foo a ; bar b ; } ;
: 
:   foo a, bar b ; foobar baz ;
: 
:   baz = quux() ; a = baz.a ; b = baz.b ;
:   /* may not even be necessary to have explicit a and b vars now... */
: 
: The same programming power is available with both constructs; but in the
: second, the programmer doesn't have to remember that the first value
: returned is a foo and the second is a bar; the compiler takes care of
: it instead.

Why can't I have what was present years ago in MESA, which is like
	x: foo; y: bar;
	procedure quux [] returns [a: foo; b: bar]; ...
	...
	[a: x, b: y] := quux [];

This is, after all, the kind of thing one does in ML:
	let {a: x, b:y} = quux in ...

There are many reasons to want multiple assignment; multiple function
results is just one of them.
-- 
I am writing a book on debugging aimed at 1st & 2nd year CS students using
C/Modula/Pascal-like languages.  Please send suggestions (other than "you
_must_ cite "C Traps and Pitfalls") to ok@goanna.cs.rmit.oz.au
Newsgroups: comp.programming
From: cmdorat@tc.fluke.COM (Richard Kowalsky)
Subject: Multi-tasking kernel
Keywords: 80186 kernel cheap
Organization: John Fluke Mfg. Co., Inc., Everett, WA
Date: Wed, 8 Apr 1992 20:14:46 GMT

Hi,  I would like to learn more about embedded multi-tasking operating
systems and to that end, I would like to to play arround with one on
this little generic 80186 project board I have.

My question is: does anyone out there know where I can get sources
for a multitasking kernel that could be hacked up to run on a small
generic 80186 based board?  I realize this question is complicated by
the fact that you have no idea what the boards architecture looks like
but I am not sure how to describe it in the space provided.  It is just
a 80186 CPU W/some RAM & ROM, 1 -serial port and 1 SCSI port.  

I would like to be able to write some C++ code to eventually 'hook' ito
the multitasking kernel.  This is totally for personal education and
as such I don't want to spend any more money than necessary.  I have
seen some kernels/OS in magazines that look like they would be perfect
to dink arround with, but they are upwards of $500.00. :-(

There has to be some grunt modules out there that people have developed
for practice or fun.  Could any of you point me to one or even recommend
one?

I would also like to hear from anyone who wants to educate me on some
of the pitfalls/secrets of taking a multasking kernel, porting it to
a small hardware platform and then writing upper level code to interface
with it.


I apologize if this posting is determined to be in the wrong group.
I picked the one that  A) I have access to. & B) Looked appropriate.
I will be happy to post elsewhere if I offended someone.

Thanks in advance for any advice or recommendations.
Richard Kowalsky
(206) 356-6279
cmdorat@tc.fluke.COM
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.programming
Subject: Re: functions & return values (was Re: Reinventing the wheel)
Date: 12 Apr 92 17:21:01 GMT
Organization: U of Arizona CS Dept, Tucson

In article <SRA.92Apr11145847@nansen.ecs.soton.ac.uk> sra@ecs.soton.ac.uk (Stephen Adams) writes:
>In article <3595@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave Schaumann) writes:
>> 
>>   #define SWAP( a, b ) { TYPEOF(a,b) tmp ; tmp = a ; a = b ; b = tmp ; }
>> 
>> (yeah, I know this should really be do{ ... }while(0))
>
>I do not think that suggesting redefining the C preprocessor
>is the right way to go.  The C preprocessor has alway been
>an unsatisfactory tool for this kind of thing---what happens
>if I use SWAP(tmp,x) in my program?

Seems like this problem could be avoided by carefully choosing names.
For instance, it would probably be better to use `MACRO__tmp' instead of
simply `tmp' in the SWAP() macro.  My first illustration of SWAP was
merely to provide an example of how TYPEOF could be used effectively,
and not as a bullet-proof example of how to write SWAP().


>C++ and some other languages support parametric polymorphism

And IMHO, this is probably the best way to deal with functions (like SWAP)
that can be written with some types unspecified.  However, this thread
started off discussing a proposed change to C that would be far less
sweeping than introducing parametric polymorphism...

-- 
Dave Schaumann			dave@cs.arizona.edu
Newsgroups: comp.programming
From: ressler@cs.cornell.edu (Gene Ressler)
Subject: Re: Multiple types of things in linked lists
Keywords: sorting, lists
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Distribution: na
Date: Tue, 14 Apr 1992 19:50:47 GMT

In article <1992Apr9.031137.29927@bronze.ucs.indiana.edu> burleigh@bronze.ucs.indiana.edu (Frank Burleigh) writes:
> need ideas but must sketch out what I'm up to before I can ask...
>
>1. make sorting more difficult (how to sort linked lists);
>

Chris Dodd <dodd@csl.sri.com> pointed out to me that
there's an easy and useful way to modify the list quicksort
I gave earlier to get better average time performance and
O(n) performance on sorted lists.  I've hacked it so it also
gets O(n) on inputs that are reverse-sorted.  It's just a 4 line
addition:

#include <stdio.h>

typedef struct node { struct node *next; } *NODE, NODE_REC;

static int (*Cmp)();

/* Quicksort list h, append (by induction) t at
   the end, and deposit the result in *r. */
static void qs(NODE h, NODE t, NODE *r)
{
  NODE p, q, lo, hi;
  int nlo, nhi;

  while (h != NULL) {

    /* inductive case */
    nlo = nhi = 0; lo = hi = NULL;

    /* reverse descending prefix onto `hi'; store pivot in h; if done, append t and rtn */
    for (q = h, p = h->next; p != NULL && (*Cmp)(h, p) >= 0; h = p, p = p->next) {
      h->next = hi; hi = h; ++nhi;
    }
    if (p == NULL) { h->next = hi; q->next = t; *r = h; return; }

    /* partition */
    for ( ; p != NULL; p = q) {
      q = p->next;

      if ((*Cmp)(p, h) < 0) { 
	p->next = lo; lo = p; ++nlo;
      } 
      else {
        p->next = hi; hi = p; ++nhi;
      }
    }

    /* recur */
    if (nlo < nhi) {
      qs(lo, h, r);
      r = &h->next; h = hi;	/* eliminated tail-recursive call */
    }
    else {
      qs(hi, t, &h->next);
      t = h; h = lo;		/* eliminated tail recursive call */
    }
  }
  *r = t;			/* base case */
}

/* Sort any singly linked list where the `next' pointer is the first field 
   wrt predicate `cmp'.  Uses O(lg n) stack and no other temp space. */
void lqsort(void *lstp, int (*cmp)())
{
  Cmp = cmp; qs(*(void**)lstp, NULL, lstp);
}

/* Quick and dirty sort utility. */

typedef struct line {
  struct line *next;
  char text[1];
} *LINE, LINE_REC;

int cmp_lines(LINE l1, LINE l2)
{
  return strcmp(l1->text, l2->text);
}

void main(void)
{
  char buf[1000];
  LINE lst, p;
  void *malloc();

  lst = NULL;
  while (gets(buf) != NULL) {
    p = malloc(sizeof(LINE_REC) + strlen(buf));
    strcpy(p->text, buf);
    p->next = lst; lst = p;
  }
  lqsort(&lst, cmp_lines);
  for (p = lst; p != NULL; p = p->next)
    puts(p->text);
}
From: edotto@uipsuxb.ps.uiuc.edu (Edward C. Otto III)
Newsgroups: comp.programming
Subject: Re: Job of COBOL (was: Programming Standards Question)
Date: 16 Apr 92 18:27:04 GMT
Organization: University of Illinois at Urbana

gaynor@pepper.rutgers.edu (Silver) writes:


>    if a is greater than or equal to b, that is,
>       a is not less than b, i.e.,
>       the difference of a and b is non-negative

Naw - but it will soon support the whatif:

	whatif a is greater than b or less than c?
		...
		...
	elsewhatif a is greater than c?
		...
		...
	don'tcare
		...
		...
	end-whatif

and the whathappenswhen:

	whathappenswhen a is greater than c is ...
	thenwhathappens is ...
	ifthathappened then thenthishappens: ...
--
Edward C. Otto III   	    *  E-mail addresses:  e-otto@uiuc.edu
Printing Services Office    *  Phone:  217/333-9422
54A E. Gregory Drive	    *  "The only thing we have to fear is
Champaign, IL  61820	    *  24 line .signature files..."
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.programming
Subject: Re: functions & return values (was Re: Reinventing the wheel)
Date: 11 Apr 92 01:23:08 GMT
Organization: U of Arizona CS Dept, Tucson

In article <#+vf~^w7&@twinsun.com> junio@twinsun.com (Junio Hamano) writes:
>There are more cases in which { and } pairs might be useful to
>denote tuples in C.  Two cases I can think of offhand are:
>
>1. when we want to make up a structure value on the fly.  e.g.
>	struct foo { int bar; char *baz; } a;
>	a = (struct foo){ 1, "one" };

This is a part of the language (See Harbison & Steel, p 90).

I agree it would be nice to be able to have anonymous structure constants
(say, for function parameters) without having to declare a variable.
That way,

  quux( {foo=1 ; bar = 2} ) ;

would be the same as

  tmp.foo = 1 ; tmp.bar = 2 ; quux(tmp) ;

>GCC already supports 1. (constructor expression).

That's a Good Thing.

>2. when we want to write a swap macro.  e.g.
>	#define SWAP(a,b) ({(a),(b)}={(b),(a)})

I'm probably opening up another can of worms, but I don't think this is a good
idea.  What is the purpose of this feature?  Seems like a rather extreme measure
(not to mention bizarre and possibly ambiguous syntax) just to be able to write
The Perfect Swap Macro...

The Right Way (TM, IMHO) to address this problem is to start by redefining the
preprocessor.  If you let the preprocessor have access to the symbol table, you
can define swap as something like

  #define SWAP( a, b ) { TYPEOF(a,b) tmp ; tmp = a ; a = b ; b = tmp ; }

(yeah, I know this should really be do{ ... }while(0))

Notice how TYPEOF() has a potential of being useful beyond a very limited
context.  Also, giving the preprocessor access to the symbol table means you
can have pre-defined macros like __FUNCTION__ (and __CLASS__ in C++).

-- 
Dave Schaumann			dave@cs.arizona.edu
Xref: sparky comp.programming:747 misc.misc:2367 talk.bizarre:10214
From: mjd@saul.cis.upenn.edu (The Special Case)
Newsgroups: comp.programming,misc.misc,talk.bizarre
Subject: Re: need a HINT on a C code parsing name-strings
Date: 6 Apr 92 15:02:08 GMT
	<1992Apr6.143533.20512@ux1.cso.uiuc.edu>
Followup-To: misc.misc
Organization: Eaters of Wisdom
In-reply-to: mwbg9715@uxa.cso.uiuc.edu's message of 6 Apr 92 14:35:33 GMT

In article <1992Apr6.143533.20512@ux1.cso.uiuc.edu> mwbg9715@uxa.cso.uiuc.edu (Mark Wayne Blunier) writes:
>   ZIP code, most forms ask for them but give enough space to write
>   3 of the digits, and as of yet I've never run into a form that
>   has enough space to add the 'plus four' digits!

    Yeah, the people who design those forms always seem to live
in Ub, North Carolina.
--

        A woman does NOT like a CLUMSY, FUMBLING man with an ICE PICK.
Mark-Jason Dominus 	  			    mjd@central.cis.upenn.edu 
Newsgroups: comp.programming,comp.ai
From: uh311ae@sunmanager.LRZ-Muenchen.DE (Henrik Klagges)
Subject: Re: Genetic Algorithms
Keywords: GA
Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
Date: Fri, 10 Apr 1992 17:12:44 GMT

rsm@doe.carleton.ca (Raul San Martin) writes:

>Would anybody know where to find some public domain Genetic
>Algorithms software?

ftp to ftp.aic.nrl.navy.mil.   Contains all the stuff from the
clearing house for GA's.

Cheers, Henrik
IBM Physics Group Munich
MPCI at LLNL
From: sboswell@sdcc13.ucsd.edu (Triangle man)
Newsgroups: comp.programming
Subject: Garbage collection
Date: 11 Apr 92 14:13:14 GMT
Organization: University of California, San Diego

I'm looking for working garbage collection code, hopefully with
a technical paper describing the algorithm.  I've seen Joel Bartlett's
mostly-copying collector so far.  I'd like to see what else is out
there.

The reason I ask for C code is because C is one of the few languages
that's low level enough to write such programs.  Also, this ensures
the collectors don't depend on special compilers to work.  (One thing
I really like about Bartlett's collector.)

I'm especially interested in hybrid collectors, i.e. mark & sweepers
that can compact the heap.  I'm writing one right now for one of my
many projects, and I'd like to see what else is out there, and how
they handle issues that I have to deal with.

I should say that high heap utilization is needed -- one of my
complaints about DEC's mostly-copying collector is that you can
only use half of the heap at a time, and that one stack-referenced
object in a page is enough to put the entire page into the stable
set.  (Although I really like the GCCB idea.)  I'll be using this
code on a machine where virtual-memory support is hosey
and real memory is usually in short supply (i.e. Macintosh), so I
need to use as much of the heap as I can.

Thanks in advance!

Steve Boswell
whatis@ucsd.edu
whatis@gnu.ai.mit.edu
Newsgroups: comp.programming,comp.ai
From: kath@geriatrix.cs.uoregon.edu (kathleen freeman)
Subject: Expert systems in the public domain
Keywords: GA
Organization: University of Oregon Computer and Information Sciences Dept.
Date: Fri, 10 Apr 1992 22:58:48 GMT

>>Would anybody know where to find some public domain Genetic
>>Algorithms software?
>
>ftp to ftp.aic.nrl.navy.mil.   Contains all the stuff from the
>clearing house for GA's.

How about some expert systems in the public domain?  It's
not the es shell I need, but the knowledge (rules and data),
and some example output.

Thanks,
Kathleen
From: eker@cwi.nl (S.M. Eker)
Newsgroups: comp.programming
Subject: Re: How To Calculate Logarithm?
Date: 10 Apr 92 18:17:26 GMT
Reply-To: eker@cwi.nl (S.M. Eker)
Distribution: comp
Organization: CWI, Amsterdam

In article <PAUL.92Apr10104516@nsx.kagaku.se.fujitsu.co.jp>,
paul@kagaku.se.fujitsu.co.jp (Paul Donnelly) writes:
|> Can anyone help me with calculating logarithms - either natural
|> logarithms or base 2 logarithms? I wish to implement these functions
|> for *fixed* precision numbers in machine code for use in a data
|> compression algorithm. I have already implemented two versions myself.
|> One used the Taylor expansion for ln, but the expansion of ln has
|> very bad convergence and is woefully slow. A more successful method
|> was to implement then natural exponential function e^x (which has much
|> quicker convergence), then to use an iterated search to get the
|> inverse function natural log. I would try a value - if it was too big
|> I tried a smaller value; if it was too small, I tried a bigger value.
|> Each time, I halfed the step size. Thus each call to e^x gave the next
|> bit of precision for ln(x). I'm still not satisfied, however. I'm sure
|> the 'C' library funcion uses a much quicker, and smaller algorithm.
|> Anyone know what it is?? Thanks for any help.
|> 
|> Paul

I think the trick is to use a polynomial with precomputed coefficients.
You want to find the coefficients that minimise the maximum error over the
range of arguments for a polynomial of given degree - there's a pile of
theory about this that I've long since forgotten - something to do with
Chebyshev
polynomials I think. You want to look at an introductory text on numerical
analysis or a book of maths tables in which such coefficients are tabulated.

Also use Horner's rule to evaluate your polynomial to save on multiplications.

Steven
Newsgroups: comp.programming
From: sad@camelot.bradley.edu (Shrijay Dalal)
Subject: Shareware rules
Organization: Bradley University
Distribution: usa
Date:  8 Apr 92 21:05:16 GMT

Hello,

I have a friend who has written a program and he wants to release it
Shareware.  Can anyone send me a list of rules and guidelines for
Shareware software?  

Thanks,
Shrijay 


--
Shrijay Dalal                       | "Sometimes I think the surest sign that 
Internet: sad@buhub.bradley.edu     | intelligent life exists elsewhere in the
        am819@cleveland.freenet.edu | universe is that none of it has tried
                                    | to contact us." -- Calvin of C&H
From: gaynor@pepper.rutgers.edu (Silver)
Newsgroups: comp.programming
Subject: Re: Job of COBOL (was: Programming Standards Question)
Date: 16 Apr 92 17:01:27 GMT
Organization: Rutgers Univ., New Brunswick, N.J.

allan@cs.cornell.edu (James Allan) writes:
> I programmed in COBOL for several years.  On occasion, some fellow
> sufferers and I would attempt to make our COBOL as verbose as possible:
> 
> 	if a is greater than or equal to b
> 
> I suppose it's not really much different than trying to write
> obfuscated C, just in a different direction....

Does it support redundancy, perhaps introduced by the `i.e.' or `that is'
(preferred for its length) construct?

    if a is greater than or equal to b, that is,
       a is not less than b, i.e.,
       the difference of a and b is non-negative

Heh.  You could achieve the same (null) effect with `and', but, well, `that is'
is longer.  Heh.

Regards, [Ag]
Newsgroups: comp.programming
From: ludemann@quintus.com (Peter Ludemann)
Subject: Re: SCCS & make
Keywords: SCCS, make, C
Organization: Quintus Corporation, Palo Alto, CA
Date: Tue, 14 Apr 1992 17:55:51 GMT

In article <26461@hydra.Helsinki.FI>, mnykanen@cs.Helsinki.FI (Matti Nykanen) writes:
> The man entry on "make" states that it works with SCCS, i.e. when a file
> is missing it tries to "SCCS get" a read-only copy for compilation
> first. This works on C source files with suffix ".c" but *not* with
> header files with suffix ".h". How could I correct this?

The question was just asked in the AIX newsgroup.  Here's the
answer I posted there; it probably applies to anyone not using
a BSD-derived Unix.

In article <1992Apr10.155446.12938@wrkgrp.COM>, jmd@wrkgrp.COM (Joseph M DeAngelo) writes:
> 
> I use SCCS on my Sun system quite effectively.  When I run 'make'
> on my RS6000, however, it fails to notice backdated source and
> fails to fetch the updated versions.  Is there some trick I should
> be aware of??  I believe we run AIX 3.1 .

I, too, had problems with using SCCS on AIX.  The problems were two-fold:

1. The file formats are slightly incompatible (about 1/10 of the time,
   I get a message about "corrupted SCCS file").  This is very irritating;
   does anyone know a work-around?  (My source runs on both machines,
   but each SCCS thinks the other one has a corrupt file.)

2. AIX's make doesn't understand the default "SCCS get" stuff that
   SUN's make understands.  On the SUN, I can write:
	%.pl:
		$(SCCS) $(SCCSFLAGS) get $(SCCSGETFLAGS) $@ -G$@
   (actually, this isn't necessary because of the default rules).

   However, it appears that %.pl is not recognized, so I had to do:

	SOURCE = file1.pl file2.pl ... filen.pl
	$(SOURCE):
		$(SCCS) $(SCCSFLAGS) get $(SCCSGETFLAGS) $@

   (I can't remember why I dropped the -G$@ flag, but it had to do
   with another incompatibility.)

Isn't it nice having a standard like Un*x?  Everybody can have
their own standard ...

-- 
	Peter Ludemann  +1-415-813-3800  ludemann@quintus.com
From: allan@cs.cornell.edu (James Allan)
Newsgroups: comp.programming
Subject: Job of COBOL (was: Programming Standards Question)
Date: 15 Apr 92 14:21:27 GMT
Article-I.D.: cs.1992Apr15.142127.15199
Organization: Cornell Univ. CS Dept, Ithaca NY 14853

dave@cs.arizona.edu (Dave Schaumann) writes:
>Not that I'd ever admit to any such thing, but when I took a C*b*l class, the
>teacher insisted we spell out GREATER and LESS than, explaining that it was
>"too easy to get > and < confused".

I programmed in COBOL for several years.  On occasion, some fellow
sufferers and I would attempt to make our COBOL as verbose as
possible:

	if a is greater than or equal to b

I suppose it's not really much different than trying to write
obfuscated C, just in a different direction....
From: bill@Celestial.COM (Bill Campbell)
Newsgroups: comp.programming
Subject: Re: Difference between SCCS and RCS
Keywords: RCS, SCCS
Date: 11 Apr 92 19:29:30 GMT
Organization: Celestial Software, Mercer Island, WA

In <1992Apr10.164723.18085@dsg.tandem.com> narayan@aravali.everest.tandem.com (Pankaj Narayan) writes:

>Which of thesae is better, and why ?
>I get the feeling that people are moving from RCS to SCCS, but
>haven't been able to figure out why. I use RCS, and find it sufficient.

>Anyone out there who is a SCCS diehard may know more about this.

I used to use SCCS but switched a couple of years ago to RCS under
CVS for several reasons:
    1.  RCS is freely distributable and I can put it on my
        client's systems without requiring them to purchase
        a Development System.

    2.  I have source code so I can fix things if necessary.  The
        only time I've had to do this was when gnu-diff started
        belching on ascii files with occasional control characters
        and I had to insert a -a option in the rcsdiff code.

    3.  CVS allows multiple concurrent development efforts
        (doesn't restrict one lock per file).  It also provides
        tools to make it easier to maintain local modifications
        to 3rd party code.

Bill
-- 
INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
             uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
Newsgroups: comp.programming
From: markh@csd4.csd.uwm.edu (Mark William Hopkins)
Subject: Re: How To Calculate Logarithm?
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Distribution: comp
Date: Fri, 10 Apr 1992 15:44:13 GMT

In article <PAUL.92Apr10104516@nsx.kagaku.se.fujitsu.co.jp> paul@kagaku.se.fujitsu.co.jp (Paul Donnelly) writes:
>Can anyone help me with calculating logarithms - either natural
>logarithms or base 2 logarithms? I wish to implement these functions
>for *fixed* precision numbers in machine code for use in a data
>compression algorithm...

If you can find a good way to do square roots, especially of numbers near
1 (where sqrt(1 + d) ~~ 1 + d/2), then the following will work for large
enough N:

Y = ln(X):
----------
for (Y = X, I = 0; I < N; I++) Y = sqrt(Y);
Y--; Y <<= N;
Newsgroups: comp.programming