HDTenEightyP/NetNews huggingface dataset:
From: aelman@Xenon.Stanford.EDU (Adam Elman)
Subject: Re: first-year programming languages
Organization: CS Department, Stanford University, California, USA
Distribution: na
Date: 13 Nov 92 22:23:22 GMT

bdewbank@cbnewsc.cb.att.com (bryan.d.ewbank) writes:

>The first language in a computer science should be a machine language or
>two.  Perhaps a single-address machine, a double address machine, and
>something "unusual".

>The reason I say that is that computer science is different than simply
>training coders.  Any general-purpose language will do to train coders,
>but computer science folk need to understand the tools of their trade.

>Using a machine language also points out -- at a gut level -- that all
>languages really do the same thing.  it's just the syntax and the ease
>of use that differs.  It is possible to write a spell-checker in Fortran,
>but it ain't pretty.

I disagree strongly with this for two reasons:
One:  Machine language is a _serious_ turn-off to people who aren't
already committed to computing.  The assembly language class here is
known as one of the hardest classes in the CS major -- if it was the
first one, I think there would be very few people in Computer Science.
Remember -- a first-year class is not just an introduction to the
"tools of the trade" -- it should also be designed to get people
excited about their field so that they are willing to put some time
into it.  This would have the effect of chilling interest in CS, and
making for a VERY small group of people who would want to continue.

Two:  Since when was machine language really a good introduction to
the "tools of the trade"?  Machine/assembly languages introduce a
single topic in CS -- that of memory and CPU behavior.  You can
certainly make an argument that everything in CS is based on that
topic, but I would argue that most other topics in CS are at
sufficiently abstract a level that machine language is _not_ a good
intro.  I have not written a program in assembly since last winter,
and I don't expect to anytime in the near future.  However, I use
concepts such as algorithms, data structures, pointers, procedural
programming, etc. etc. in _all_ my CS classes (including the assembly
class, for that matter!).  _Those_ topics are what first-year CS
students should be learning.

I would agree that there is a good amount of debate on whether the
emphasis of a first-year class should be on the ideas of programming
structures, etc., (languages such as Pascal or C) or algorithms
(something like Scheme, Lisp, or ML).  But I think that emphasizing
the bare-bones machine aspects would be crazy.

After all, we're not EE students. :-)

Adam Elman
aelman@cs.stanford.edu

Newsgroups: comp.programming
From: mrhoten@cs.stanford.edu (Matthew Rhoten)
Subject: Re: Looking for Mac assemblers
Originator: mrhoten@Xenon.Stanford.EDU
Organization: CS Department, Stanford University, California, USA
Date: 11 Nov 92 00:47:31 GMT

seth@physc1.byu.edu writes:

>Hi. I am looking for a good Mac assembler that is sys.7 savvy and
>32-bit clean, but I do not want to spend the big bucks for MPW
>Assembler, and I have not found Consulair Development System adequate.
>Does anyone out ther know of any other assemblers, be they shareware
>or commercial?

Two of my friends wrote such an assembler for their senior project.
It is being used now in an assembly-language programming course here
and is, if I might say so, rather cool. I believe the software is for
sale or otherwise available; you might contact
dancliff@cs.stanford.edu for information.

 -matt
-- 
Matthew Rhoten | mrhoten@cs.stanford.edu | m_rhoten@leland.stanford.edu
"When Adam and Eve first saw each other, that's when the blues started."
 -John Lee Hooker
Newsgroups: comp.programming
From: schnitzi@cs.ucf.edu (Mark Schnitzius)
Subject: Re: Finding a zero byte in a 32-bit word
Organization: University of Central Florida
Date: Wed, 4 Nov 1992 20:27:19 GMT

alexande@genghis.borland.com (Mark Alexander) writes:

>But I'm looking for something that avoids all the tests and branches.
>I've seen a trick that involves one ADD, two ANDs, and a NOT, but it
>may be proprietary.  Have any non-proprietary tricks been published?

A follow-up question:  There are algorithms which are _proprietary_??!

Mark Schnitzius
schnitzi@eola.cs.ucf.edu
University of Central Florida
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.programming
Subject: Re: Mutual reference in C?
Date: 11 Nov 92 05:02:47 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <1djb0tINNa9t@morrow.stanford.edu>, ehh@camis.Stanford.EDU (Edward H. Herskovits) writes:
> simple question to which i couldn't find an answer in standard c books:
Are you sure?  It's really something very fundamental.
> if there are two structures, a and b, that refer to each other,
> ...
> i know that in pascal (ugh) i could use the "forward" keyword; what
> would be the equivalent thing to do in c?

No, "forward" in Pascal has nothing to do with structs.

The method for declaring mutually recursive data types in C and Pascal
is essentially the same.  The mutual references must involve pointers,
so
	- first declare all the pointer types you need
	- then declare the other types, using the pointer types.

In Pascal, you can use ^Type before Type has been defined.
In C, you can use struct Tag before Tag has been defined.

Pascal:
	type
	    aPtr = ^aRec;
	    bPtr = ^bRec;
	    aRec = record ... b: bPtr; ... end;
	    bRec = record ... a: aPtr; ... end;

C:
	typedef struct aRec *aPtr;
	typedef struct bRec *bPtr;
	struct aRec { ... bPtr b; ... };
	struct bRec { ... aPtr a; ... };

You _can_ eliminate the typedefs in C, but it is usually handy to have
them around, because a program that manipulates these things is likely
to have a lot of variables of these pointer types.
From: bdewbank@cbnewsc.cb.att.com (bryan.d.ewbank)
Newsgroups: comp.programming
Subject: Re: first-year programming languages
Date: 13 Nov 92 17:19:15 GMT
Distribution: na
Organization: AT&T

The first language in a computer science should be a machine language or
two.  Perhaps a single-address machine, a double address machine, and
something "unusual".

The reason I say that is that computer science is different than simply
training coders.  Any general-purpose language will do to train coders,
but computer science folk need to understand the tools of their trade.

Using a machine language also points out -- at a gut level -- that all
languages really do the same thing.  it's just the syntax and the ease
of use that differs.  It is possible to write a spell-checker in Fortran,
but it ain't pretty.
-- 
- Bryan Ewbank, b_d_ewbank@att.com	| ``Whatever you do, work at it with
  AT&T Bell Labs, 2000 N Naperville Rd	| all your heart, as working for the
  Naperville IL 60566			| Lord, not for men.'' -- Col 3:23
From: alexande@borland.com (Mark Alexander)
Newsgroups: comp.programming
Subject: Re: Finding a zero byte in a 32-bit word
Date: 9 Nov 92 18:51:21 GMT
Article-I.D.: borland.1992Nov9.185121.27621
Organization: Borland International
Originator: alexande@genghis.borland.com

In article <1992Nov9.183758.27054@borland.com> I wrote:
>>A follow-up question:  There are algorithms which are _proprietary_??!
>
>Apparently not, since the solutions that have been posted are the
>same as the one I had been looking at suspiciously.

I was referring only to the zero-finding algorithm here; undoubtedly
there are other algorithms that ARE proprietary.  Sorry for the confusion.
From: ch952@cleveland.Freenet.Edu (Isaac D Reuben)
Newsgroups: comp.programming
Subject: Mac compilers?
Date: 6 Nov 1992 06:25:12 GMT
Organization: Case Western Reserve University, Cleveland, Ohio (USA)
NNTP-Posting-Host: hela.ins.cwru.edu


Forgive me if this is the wrong group to ask this question to but
I have nit been using usenet very long.

I am looking for a BASIC compiler and a Pascal compiler for the
macintosh. I would prefer it if you had the ftp address for a 
shareware program that does either of these but even if you just
suggest some good commercial programs it would still be very
helpful.

Thanx,
Isaac Reuben
-- 
Isaac Reuben
isaacr@aol.com
<insert random clever phrase here>
Newsgroups: comp.programming
From: 890045c@dragon.acadiau.ca (Frank Cheeseman)
Subject: Who out there is a DEVELOPER?
Summary: IBM program for OS/2 application developers
Keywords: IBM DAP
Organization: Acadia University
Distribution: canada
Date: Wed, 11 Nov 1992 20:52:54 GMT

HI!

Before the flames start, theis is NOT an AD.
I am not selling anything, just letting you know 
what's here for you.  

If you are a software developer, and you are working
on products to run under OS/2, or porting to OS/2,
you should probably know that IBM runs a program in
Canada to help out such developers.  Membership is 
free, and benefits are many (information on OS/2 itself,
IBM products used by developers, early betas, mailings
of useful information for developers)

Please do NOT reply to this account, because it does
not belong to IBM, and I will not be able to check my mail
until Christmas.

Instead, respond by phone to (416) 946-3790 (me)
                          or (416) 946-3786 (my manager, Ken Fadelle)
for more information or to enroll.

PS.  You may have heard about the PDK CD-ROM.
     That's us!  The PDK is free to any DAP
     (Developer's Assistance Program) members
     who want one.

PPS.  If you HAVEN'T heard, the PDK is a CD-ROM
      with the newest OS/2 beta, complete technical
      libraries and red books, CSET/2, and more
      goodies than I can list here.

It's your dime, SO CALL ALREADY!
Newsgroups: comp.programming
From: aelman@Xenon.Stanford.EDU (Adam Elman)
Subject: Re: first-year programming languages
Organization: CS Department, Stanford University, California, USA
Distribution: na
Date:  9 Nov 92 22:30:30 GMT

kem@csri.toronto.edu (Kem Luther) writes:

>Not sure where to ask this.  If you answer, use email so we won't
>clutter this newsgroup with unwanted banter.

>I work for a college  which is reviewing its first-year programming
>environment for students who will become computer science majors.
>The question came up:  what computer languages are used in the
>first year programming courses in other colleges?  Anyone have  
>some figures on this?

Stanford was using Pascal until last year, when the first-year
programming classes were redone to use C, since all the upper-level
courses require proficiency in C.

Adam Elman
aelman@cs.stanford.edu

Newsgroups: comp.programming
From: mjr@hussar.dco.dec.com (Marcus J. Ranum)
Subject: Re: first-year programming languages
Organization: Digital Equipment Corporation, Washington ULTRIX Resource Center
Distribution: na
Date: Mon, 9 Nov 1992 20:41:58 GMT

>The question came up:  what computer languages are used in the
>first year programming courses in other colleges?

	I had the choice of PDP-11 assembler or Pascal, but that was
before the C juggernaut.

	Nowadays, I'd like to see colleges teach Modula-3 or some
modern programming language, with real support for objects, threads,
typing and data hiding (C++ need not apply).

mjr.
From: melby@dove.yk.Fujitsu.CO.JP (John B. Melby)
Newsgroups: comp.programming
Subject: Re: Mutual reference in C?
Date: 9 Nov 92 05:08:54 GMT
Organization: Open Systems Dept. Div. 2 Sect. 1, FUJITSU LTD.
In-reply-to: ehh@camis.Stanford.EDU's message of 9 Nov 92 00:16:45 JST
Followups-To: comp.lang.c

>if there are two structures, a and b, that refer to each other,
>struct {
>        b       *bPtr;
>} a;
>
>and
>
>struct {
>        a       *aPtr;
>} b;
>
>how can i declare these two structures such that they can refer to pointers
>of each other?

You can declare your structs as follows, assigning a name to each struct
that gets referenced in another declaration:

typedef struct _a {
	struct _b *bPtr;
} a;

typedef struct _b {
	struct _a *aPtr;
} b;

-----
John B. Melby
Fujitsu Limited, Yokohama
melby@yk.fujitsu.co.jp
Newsgroups: comp.programming
From: kem@csri.toronto.edu (Kem Luther)
Subject: first-year programming languages
Distribution: na
Date: 9 Nov 92 20:23:25 GMT

Not sure where to ask this.  If you answer, use email so we won't
clutter this newsgroup with unwanted banter.

I work for a college  which is reviewing its first-year programming
environment for students who will become computer science majors.
The question came up:  what computer languages are used in the
first year programming courses in other colleges?  Anyone have  
some figures on this?


-- 
----------------------------------------------------------------------------
Kem Luther           Dept. of Computer Science         University of Toronto 
Voice: 416-769-3112                                     kem@csri.toronto.edu
----------------------------------------------------------------------------
Newsgroups: comp.programming
From: tsullivan@trentu.ca (Tim E. Sullivan)
Subject: Re: Mac compilers?
News-Software: VAX/VMS VNEWS 1.41    
Organization: Trent University Computer Services Department
Date: Fri, 6 Nov 1992 07:32:00 GMT

In article <1dd348INN583@usenet.INS.CWRU.Edu>, ch952@cleveland.Freenet.Edu (Isaac D Reuben) writes...
>I am looking for a BASIC compiler and a Pascal compiler for the
>macintosh. I would prefer it if you had the ftp address for a 
>shareware program that does either of these but even if you just
>suggest some good commercial programs it would still be very
>helpful.

  Well, Symantec puts out Think Pascal for the Mac. I've never used it, but 
I've heard good things about it. It is commercial.

   Tim Sullivan
   tsullivan@trentu.ca
   cstes@blaze.trentu.ca

A Disclaimer? Yeah, and people BELIEVE what I write, too...
---
 "Virtual Reality has NOTHING on Calvin."
       - Suzy, from Calvin and Hobbes
From: paj@uk.co.gec-mrc (Paul Johnson)
Newsgroups: comp.programming
Subject: Probabilistic Prime Numbers
Date: 10 Nov 92 17:07:33 GMT
Reply-To: paj@uk.co.gec-mrc (Paul Johnson)
Organization: GEC-Marconi Research Centre, Great Baddow, Essex

I am trying to write a small prime number generator using Algorithm P
in Knuth.

Note for those without a copy of Knuth: this algorithm uses a randomly
generated number to perform a primality test.  It can return one of
two results: "Not prime" or "Probably prime".  If the latter, then the
chance of error is < 0.25.  Repeated tests with different random
numbers can reduce this probability very quickly.

I cannot understand the discussion of this test in Knuth, nor can I
understand what his variables are.  Is `n' the number under test, or
is it `q'?  If the former, why the statement "Let n = 1 + (2^k)q" just
before the statement of Algorithm P.

What I would really like is some C or Pascal code which implements
Algorithm P.  Failing that, a restatement with a more careful
declaration of variables would be gratefully received.  Sedgwick and
Numerical Recipies do not deal with primes.  Can anyone help?

Thanks in advance,

Paul.

Paul Johnson (paj@gec-mrc.co.uk).	    | Tel: +44 245 73331 ext 3245
--------------------------------------------+----------------------------------
These ideas and others like them can be had | GEC-Marconi Research is not
for $0.02 each from any reputable idealist. | responsible for my opinions
Newsgroups: comp.programming
From: seth@physc1.byu.edu
Newsgroups: comp.programming
Subject: Looking for Mac assemblers
Date: 10 Nov 92 05:50:06 GMT
Article-I.D.: physc1.1992Nov10.125006.186
Distribution: world
Organization: Brigham Young University

Hi. I am looking for a good Mac assembler that is sys.7 savvy and 32-bit clean,
but I do not want to spend the big bucks for MPW Assembler, and I have not
found Consulair Development System adequate. Does anyone out ther know of any
other assemblers, be they shareware or commercial?
Seth Leigh
BYU Physics Dept.
"... fools mock, but they shall mourn..." (Ether 12:26)
Newsgroups: comp.programming,comp.lang.misc,comp.edu
From: crawford@boole.mitre.org (Randy Crawford)
Subject: Re: first-year programming languages
Organization: The MITRE Corporation, McLean, VA
Distribution: na
Date: Tue, 10 Nov 1992 02:59:41 GMT

In article <1992Nov9.152324.2715@jarvis.csri.toronto.edu> kem@csri.toronto.edu (Kem Luther) writes:
>
>I work for a college  which is reviewing its first-year programming
>environment for students who will become computer science majors.
>The question came up:  what computer languages are used in the
>first year programming courses in other colleges?  Anyone have  
>some figures on this?

I think this was discussed in comp.edu about 3 months back.  As I recall,
Penn, Columbia, Cornell and MIT all use Scheme as a first course PL followed
by C or Pascal in the post-data structures courses.  In this month's CACM, 
there's a discussion of the use of Ada as a first PL (a really rotten 1PL, 
IMHO).

I'd probably choose scheme as a first course PL given its strengths in
introducing powerful programming language concepts simply, and then Ada 
(especially Ada 9X) for subsequent courses.  I like C++, but think it loses 
out to Ada in that it is _very_ hard to learn, requires knowledge of C or 
Pascal first, and is a rather impure OOP which allows immature programmers 
too much latitude in programming sloppily.

(I've cross-posted this to comp.lang.misc and comp.edu to continue this thread
elsewhere.  Comp.programming is supposed to be a forum for algorithms and the
like.)

-- 

| Randy Crawford        crawford@mitre.org        The MITRE Corporation
|                                                 7525 Colshire Dr., MS Z421
| N=1 -> P=NP           703 883-7940              McLean, VA  22102
From: avg@rodan.UU.NET (Vadim Antonov)
Newsgroups: comp.programming
Subject: Re: Help - What Is Wrong?
Date: 11 Nov 1992 16:04:17 -0500
Organization: Berkeley Software Design
NNTP-Posting-Host: rodan.uu.net

Well, both advices (i.e. to have strict guards in loops instead of
weak ones and to use if-s covering all cases) should be taken with
a LARGE grain of salt.

First of all, never write for( x = 0.0 ; x != 1.0 ; x += 0.1 ) ...

Then, use assert-s.

Instead of relying on infinite loops (and given modern CPUs
32-bit "infinite loop" may be under a second) which can
pass unnoticed (or worse...) you may write

	assert(i <= n);
	for( ; i < n ; i++ )
		....

In case of ifs

	if( cond1 ) {
		...
	} else if( cond2 ) {
		...
	} else {
		assert(cond3);
		...
	}

will do essentially the same thing as suggested

	if( cond1 ) {
		...
	} else if( cond2 ) {
		...
	} else if( cond3 ) {
		...
	} else
		abort();

but will print out additional information making the search easier
(it's especially useful if the stack was trashed so debugger can't
reconstruct the sequence of calls) and the program can be later
recompiled with null assert-s to eliminate the performance penalty
for extra checks.

--vadim
Newsgroups: comp.programming
From: is@groucho.dev.uga.edu (Bob Stearns)
Subject: Re: Partial sort/Nearest neighbor
Organization: University of Georgia
Date: Fri, 13 Nov 1992 20:04:17 GMT

In article <1e0a35INN511@agate.berkeley.edu> shein@nima.berkeley.edu (Soren Hein) writes:
>I have a small list (9 or 25 elements) of integers between 0 and 255.  
>My goal is to find the average of the K elements which are closest in
>absolute value to a given element in the list.  K is typically about
>half of the list length. I need the algorithm to be as fast as possible;
>space consumption is no problem.
>
Try the following:
   Initialize S to the empty list, heap representation
   Let T be your original set
   for t in T do
     if |S|<k, insert t-t_0 into s, in sorted order by magnitude
     if |S|>k then
       if |t-t_0| < |S[k]| then
          remove S[K] and insert |t-t_0| into k in sorted order by magnitude
   end
   average S for your new value.
This seems to do the trick in O(nlogk) time. Another approach, which
should approach O(n), is a modified Quick Sort algorithm. You only have
to continue to curry the partition containing k, using the absolute
value function as your comparison operator.
-- 
Bob Stearns
University of Georgia
is@groucho.dev.uga.edu
(404)542-5110
Newsgroups: comp.programming,comp.lang.misc,comp.edu
From: howesb@fraser.sfu.ca (Charles Howes)
Subject: Re: first-year programming languages
Organization: Simon Fraser University, Burnaby, B.C., Canada
Distribution: na
Date: Wed, 11 Nov 1992 06:45:40 GMT

>>In article <1992Nov9.152324.2715@jarvis.csri.toronto.edu> kem@csri.toronto.edu (Kem Luther) writes:
>>>
>>>I work for a college  which is reviewing its first-year programming
>>>environment for students who will become computer science majors.
>>>The question came up:  what computer languages are used in the
>>>first year programming courses in other colleges?  Anyone have  
>>>some figures on this?

At SFU, we have Modula-2, QuickBASIC, and Pascal.

Modula-2 is used in CMPT-101, the absolute first course for a CMPT SCI
degree.

QuickBASIC is used in CMPT-100, programming for non-CMPT SCI people.

I'm not sure where Pascal is used, but I helped someone who was doing a
first-year assignment using Pascal.


There are also 6 single-credit correspondence courses that teach Cobol,
C, PL/I, Fortran, Pascal and Smalltalk.  They are additional languages, but
still are labelled 'first year'.

I suspect a review of our own is in order...

--
I am a *student*.  Trust nothing I say.
From: shein@nima.berkeley.edu (Soren Hein)
Newsgroups: comp.programming
Subject: Partial sort/Nearest neighbor
Date: 13 Nov 1992 13:20:37 GMT
Organization: U.C. Berkeley -- ERL
Distribution: world
NNTP-Posting-Host: nima.berkeley.edu

I have a small list (9 or 25 elements) of integers between 0 and 255.  
My goal is to find the average of the K elements which are closest in
absolute value to a given element in the list.  K is typically about
half of the list length. I need the algorithm to be as fast as possible;
space consumption is no problem.

What I'm doing at the moment is to create another list whose elements
are the absolute differences between the original elements and the given
element.  Then I sort the new list, keeping track of the permutations.

This is needlessly slow, because I don't need the K elements to be in
order, and I don't need the remaining elements to be in order either.

[The above problem arises in image processing and is known as
"nearest neighbor filtering".]

Please e-mail any suggestions to shein@robotics.berkeley.edu, and
I will summarize if there is interest.

Thanks,
/Soren
Newsgroups: comp.programming,comp.graphics
From: cegarcia@yog-soggoth.MIT.EDU (Carlos E Garcia)
Subject: HELP: PHIGS
Organization: Massachusetts Institute of Technology
Date: Wed, 11 Nov 1992 21:43:44 GMT

Hi there I'm having problems running my motif/phigs executables.  I'm getting errors
that say my display isn't set up for pex.  I've attached motif X11 phigs and pex.  What 
else do I need to get going.  I believe that I need to set some environment variables -
but what?  Something that goes "setenv _________".  Would appreciate any help from someone
already running phigs.

		
			Carlos Garcia
Newsgroups: comp.programming