HDTenEightyP/NetNews huggingface dataset:
From: brnstnd@nyu.edu (Dan Bernstein)
Newsgroups: comp.programming
Subject: --- comp.programming charter: read before you post (weekly notice)
Date: 26 Jul 92 04:00:10 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: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: finding 1st one in integer
Organization: Loral Western Development Labs
Date: Tue, 21 Jul 1992 20:51:27 GMT

In article <1992Jul21.150033@is.morgan.com> berlin@is.morgan.com (Alexander Berlin) writes:
>how about this one line solution:
>
>unsigned int i;  /* given integer */
>unsigned int j;  /* working variable */
>int          bitset;  /* result */
>
>   for(j=1, bitset=1; ; bitset++, j+=j) if (i==j) break; /* sets bitset */
>
>Will work, of course, only when exactly one bit is set. But you want
>efficiency, so there is no unnecessary conditions. And it looks portable -
>doesn't even rely on the int size. 

This is no problem as i^(i-1) produces a value consisting on just the least
sigfinicant bit in i

Athough your solution is really no faster then right shifting 1 bit at a time
until odd and counting the shifts.  For 32 numbers or larger table lookup
solutions will typically be faster. 
--
Mark Biggar
mab@wdl1.loral.com
From: pinkas@caraway.intel.com (Israel Pinkas)
Newsgroups: comp.programming
Subject: Re: Does "400% faster" make sense? (Was: Re: finding 1st one in integer)
Date: 23 Jul 92 17:08:25 GMT
	<1992Jul22.172337@is.morgan.com>
Organization: Software Technologies, INTeL Corporation, Santa Clara, CA
In-reply-to: berlin@is.morgan.com's message of 22 Jul 92 21:23:37 GMT

berlin@is.morgan.com (Alexander Berlin) writes:

   If some job takes me 100 seconds and you can do it in 25 seconds:
   I am 300% slower then you are.              (100-25)/25*100 
   You are 75% faster than I am(not 300)       (100-25)/100*100
   Your performance is 400% of mine.           (1/25)/(1/100)*100
   My performance is 25% of yours.             (1/100)/(1/25)*100



Guess again Alexander.  When calculating delta%, divide by the original
number.  Thus:

If some job takes me 100 seconds and you can do it in 25 seconds:
    I am 75% slower then you are.	(25-100)/100*100%   = -75%
    You are 300% faster than I am.	(100-25)/25*100%    = 300%
    Your performance is 400% of mine.	(1/25)/(1/100)*100% = 400%
    My performance is 25% of yours.	(1/100)/(1/25)*100% =  25%


To compare:

If I can dig a hole in 60 seconds, and you can dig the hole in 30 seconds,

you are twice as fast as me:	60/30
I am half as slow as you:	30/60


For more info, see a good high school algebra book.

-Israel
--
Disclaimer: The above are my personal opinions, and in no way represent
the opinions of Intel Corporation.  In no way should the above be taken
to be a statement of Intel.
Newsgroups: comp.programming
From: msb@sq.sq.com (Mark Brader)
Subject: Re: Does "400% faster" make sense? (Was: Re: finding 1st one in integer)
Organization: SoftQuad Inc., Toronto, Canada
Date: Fri, 24 Jul 92 07:59:17 GMT

> If some job takes me 100 seconds and you can do it in 25 seconds:
>     I am 75% slower then you are.	(25-100)/100*100%   = -75%
>     You are 300% faster than I am.	(100-25)/25*100%    = 300%
>     Your performance is 400% of mine.	(1/25)/(1/100)*100% = 400%
>     My performance is 25% of yours.	(1/100)/(1/25)*100% =  25%

He's right, of course.  And one might add:
      You take 25% as much time as me.  (Or one-quarter)
      You take 75% less time than I do.	 (Or three-quarters)
      I take 400% as much time as you.  (Or four times)
      I take 300% more time than you.  (Or three times)

And the one I prefer, at least when the factor involved exceeds about 2:

      You are faster than me (or I am slower than you) *by a factor of 4*.

No ambiguity there!
-- 
Mark Brader		"Actually, $150, to an educational institution,
Toronto			 turns out to be about the same as a lower amount."
utzoo!sq!msb, msb@sq.com				-- Mark Horton

This article is in the public domain.
Newsgroups: comp.programming
Subject: Re: floating point routines with double precision
From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
Date: Fri, 24 Jul 1992 02:08:28 GMT
Organization: University of Auckland, New Zealand.

jtien@venice.eng.uci.edu (Joe Tien) writes:

>Does anyone know where I can get floating point routine using double precision?
>The CPU I'm working on doesn't have a FPU so all the fp operations needs to be
>done in software. What I plan to do is take the fp routines in C and 
>hand-translate them to assembly code (I don't have a compiler either, :-( )

Take a look at the source of the GNU-C distribution for the Atari ST at
atari.archive.umich.edu [141.211.164.8]; it's got double precision
routines. The basic routines are written in 68000 assembler (which is
one of the nicer assembler languages around); the higher functions
(sin, cos, exp) are contained in the pml library and written in C.
They do use IEEE format, but I don't think they actually implement the
standard with respect to NaN's, INF and gradual underflow.

Hope this helps
-- 
Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
The joy of engineering is to find a straight line on a double logarithmic
diagram.
Newsgroups: comp.programming
From: ferincz@methan.chemie.fu-berlin.de (Jozsef Ferincz)
Subject: Re: Does "400% faster" make sense? (Was: Re: finding 1st one in integer)
Date: Thu, 23 Jul 1992 11:43:34 GMT
Reply-To: ferincz@methan.chemie.fu-berlin.de
Organization: Free University of Berlin, Organic Chemistry

kers@hplb.hpl.hp.com (Chris Dollin) writes:
>berlin@is.morgan.com (Alexander Berlin) writes:

I think also that (slower = 1 / faster), but it was not a question... (AB!)
-- 
Jozsef Ferincz               INTERNET : ferincz@methan.chemie.fu-berlin.de    
Freie Universitaet Berlin           : ferincz@kristall.chemie.fu-berlin.dbp.de
Takustr.3, D-1000 Berlin 33  UUCP : ferincz@fub.uucp                          
Fax : +(49 30) 838 51 63     Tel.: +(49 30) 838 26 77, 838 53 63
From: pdh@netcom.com (Phil Howard )
Newsgroups: comp.programming
Subject: Re: Does "400% faster" make sense? (Was: Re: finding 1st one in integer)
Date: 24 Jul 92 18:38:26 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

msb@sq.sq.com (Mark Brader) writes:

>      You take 25% as much time as me.  (Or one-quarter)
>      You take 75% less time than I do.	 (Or three-quarters)
>      I take 400% as much time as you.  (Or four times)
>      I take 300% more time than you.  (Or three times)

This all depends on the wording.

If I am "100%" as fast as you, I am just the same speed as you.

If I am "100%" faster than you, I am twice the speed.

This involves SEMANTICS about whether or not the original quantity is
included or not.

Consider the statement:

I made the program run 100% faster.

So instead of figuring out 4000 calculations per second on a problem,
I've added to that 100% * 4000 = 4000 more.  It is now 8000, which is
simply twice as much speed.

1 time  = 100% as fast / as much =   0% faster / more
2 times = 200% as fast / as much = 100% faster / more
3 times = 300% as fast / as much = 200% faster / more
and so on.
-- 
/***********************************************************************\
| Phil Howard  ---  KA9WGN  ---  pdh@netcom.com   |   "The problem with |
| depending on government is that you cannot depend on it" - Tony Brown |
\***********************************************************************/
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.programming
Subject: Re: finding 1st one in integer
Date: 24 Jul 92 14:52:54 GMT
Organization: University of Helsinki

peterk@public.sub.org (Peter Kittel) writes:
>Why tables? We *have* bit operators in C!

Speed.  Tables of suitable sizes are the best alternative if you want
portable speed (the same code should work as fast as possible on as many
machines as possible), and in fact is the fastest possibility on many
machines.  This is true for many other bit counting operations as well.

--
Lars.Wirzenius@helsinki.fi
Newsgroups: comp.programming
From: danm@watson.ibm.com (Dan McCabe)
Subject: Re: Naming conventions
Date: Tue, 21 Jul 1992 17:27:06 GMT
Reply-To: danm@grumpy.watson.ibm.com (Dan McCabe)
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM TJ Watson Research


In article <1992Jul15.211906.17223@natinst.com>, karmira@natinst.com
(Apostolos Karmirantzos) writes:
|>   I have seen some name conventions like
|> 	namep -> pointer to name
|> 	
|>   but I can't remember them. Does any of you know them? I believe that
|> the author is Writh.
|>   Can anyone help?
|> 	Lakis 
|> 
|> -- 
|> Karmirantzos Apostolos		e-mail: karmiran@cs.wisc.edu

Charles Simonyi of Microsoft proposed such a notion in his Ph.D. 
dissertation at UC Berkeley. The use of his notation is wide spread within
Microsoft. A description of the naming convention is described in a
Byte article which appeared in late '91 (August, September, October???) called
"The Hungarian Revolution".

Cheers,
danm
From: rhyde@slick (randy hyde)
Newsgroups: comp.programming
Subject: Re: One Pass Assemblers
Date: 24 Jul 92 20:25:12 GMT

In article <Dyw7NB1w164w@naos.actrix.gen.nz> ewen@naos.actrix.gen.nz (Ewen  
McNeill) writes:
> For the original poster, I think A86 was a one pass assembler for the
> 80x86 family.  I never used it much, and it's been quite a while since I
> did, so I could be wrong.
> 
> --
> Ewen McNeill, ewen@naos.actrix.gen.nz (or ewen@actrix.gen.nz)

Actually, MASM 6.0 is now a one-pass assembler.  Not that it's public
domain or anything like that.
From: bj@fractal.physics.colostate.edu (B.J. Buchalter)
Newsgroups: comp.programming
Subject: Re: Collision Detection
Date: 27 Jul 92 23:38:02 GMT
Organization: Colorado State University, Fort Collins, CO  80523

In article <18052.2a6ea82e@levels.unisa.edu.au> Andrew writes:
> Does anybody out there know of a fast efficient way to detect and handle
> colliding objects in two dimensions (there may be multiple objects colliding
> as well)...
> 
> it may be a similar problem to gas particles colliding...

Need to know what shape.  If the particles are arbitrary shape you should  
discretize them (put them on a bitmap)... then the collision criterion is  
simple.  If they are simple geometric objects then the criterion is simpler.

> Please email me...

My machine does not seem to know who your machine is. Maybe you can email me  
directly or post your internet address.  I'm bj@phonon.physics.colostate.edu --
bj@129.82.140.50.

> Part of my Honours project is to animate objects and then detect when they
> collide and generate there new position...the problems come in when after a
> collision occurs the object then collides with another object, when it  
bounces
> away...

determining what to do to the particles after they collide can be a lot harder  
to do then detecting the collision in the first place.  need more details on  
what you are trying to accomplish.
-B.J.
From: paj@uk.co.gec-mrc (Paul Johnson)
Newsgroups: comp.programming
Subject: Re: Collision Detection
Date: 28 Jul 92 08:12:28 GMT
Reply-To: paj@uk.co.gec-mrc (Paul Johnson)
Organization: GEC-Marconi Research Centre, Great Baddow, UK

In article <18052.2a6ea82e@levels.unisa.edu.au> Andrew writes:
> Does anybody out there know of a fast efficient way to detect and handle
> colliding objects in two dimensions (there may be multiple objects colliding
> as well)...
> 
> it may be a similar problem to gas particles colliding...

Depending on the numbers of objects and their sizes relative to the
screen, it may be worth while setting up an array or hash table of
screen zones.  If you have only a few percent of the screen occupied
by objects then a hash table will be more memory efficient.  I'll let
you work out the tradeoffs for yourself.

The idea is that the screen is split into (say) 100x100 zones.  If an
object is in (or partly in) a zone then it is entered into a list of
objects in that zone.  Then you only have to do collision detection on
the small number of objects which are nearby.

If your objects follow simple trajectories then you can also do the
collision detection when the trajectory is set up.

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: ppc1@cec1.wustl.edu (Peter Pui Tak Chiu)
Subject: Simplification
Organization: Washington University, St. Louis Mo.
Date: Sat, 25 Jul 1992 11:48:54 GMT


hi everyone,

i have a real naive question:

        how to do symbolic simplification using scheme, lisp or anything...?

what i mean is symbolic simplification like MATHEMATICA.

here are some examples:

          (* a (+ b (/ c a))) ==> (+ (* a b) c)
          (+ (* a b) (* a c)) ==> (* a (+ b c))

these are just very simple cases and are intended to explain what i mean...
i want to know a way to find the "simplest form" of any algebric expression.
not only those which are as simple as the above.

can anyone tell me how to do it or refer me to some books that talk about it?

thanks in advance

peter
From: pdh@netcom.com (Phil Howard )
Newsgroups: comp.programming
Subject: Re: 400% makes sense
Date: 28 Jul 92 18:22:14 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

norman@a.cs.okstate.edu (Norman Graham) writes:

>Not exactly. 400% is a nonsensical term. Percent (%) means 'per hundred' or
>'of each hundred', and thus is only meaningful for values between 0 and
>100 (inclusive). Percent is best used for absolute measurements, rather
>than relative comparisons such as the above example.

I do not see where any limit must exist.  Dividing 400 by 100 leaves 4.
It's not a negative number.  It's not an imaginary number.  It's 4.


>The use of percent in relative comparisons naturally leads to subtle
>misunderstandings.  Thus its best to say something like "machine A
>(at 20 M op/sec) is four times as fast as machine B (at 5 M op/sec)."

I agree that is better to say.  But I think the problem is that there
are differences in the understandings of the semantics of the WORDS
(i.e. we all work the formulas the same way, but just come up with
different fomulas).

(5 M op/sec vs 4 M op/sec)
"machine A is 20% slower than machine B"
"machine A is 80% of the speed of machine B"

Wording makes a difference.
-- 
/***********************************************************************\
| Phil Howard  ---  KA9WGN  ---  pdh@netcom.com   |   "The problem with |
| depending on government is that you cannot depend on it" - Tony Brown |
\***********************************************************************/
From: jjh91r@ecs.soton.ac.uk (Jon. Hallett)
Newsgroups: comp.programming
Subject: Re: Calculating a cube root
Date: 22 Jul 92 09:25:52 GMT
	<1992Jul20.123722.27958@cs.ruu.nl>
	<1992Jul20.160255.17562@organpipe.uug.arizona.edu>
	<1992Jul21.085023.11890@cs.ruu.nl>
Organization: Southampton University Computer Science
In-reply-to: jeroen@cs.ruu.nl's message of 21 Jul 92 08:50:23 GMT

In article <1992Jul21.085023.11890@cs.ruu.nl> jeroen@cs.ruu.nl (Jeroen Fokker) writes:
[...]
   >> #define EPSILON 0.00001

   >  which of course limits the accuracy quite severly.

[...]

I've played about with this on my calculator and found that about five
or six iterations of the Newton-Raphson loop is enough for a single
precision result.  I got a first approximation by bit twiddling the
exponent field of the float.

Jon. Bently's second `Programming Pearls' book has a column called
`Birth of a Cruncher'.  The column describes how he applied
Newton-Raphson approximation, unrolling, and a bit of clever
approximation to speeding up a calculation with a square root in it.
Most useful is the discussion of the errors generated by
Newton-Raphson approximation---the behaviour of the error justifies
the claim that about six iterations is enough for a single precision
float.
--
Jon.
From: ppc1@cec1.wustl.edu (Peter Pui Tak Chiu)
Newsgroups: comp.programming
Subject: MAZE ALGORITHM
Date: 21 Jul 92 15:11:55 GMT
Organization: Washington University, St. Louis Mo.


Dear fellow programming fans and programmers,

I am trying to look for an algorithm to generate a maze.  Do you know
where I can find one?

Please let me know...

Thanks in advance!

-- ppc1@cec1.wustl.edu
Newsgroups: comp.programming
From: wdr@world.std.com (William D Ricker)
Subject: Re: Soundex algorithms, database indexing -- alternative
Organization: The World Public Access UNIX, Brookline, MA
Distribution: usa
Date: Wed, 29 Jul 1992 04:03:41 GMT

The Soundex algorithm described by two previous follow-ups is only
the best-known of sounds-like alorithms.  It is tied to single-language
assumptions, which may be violated in the CD-Disc application cited.

A proprietary algorithm which is available for license and as a
product which might fit that application better is Proximity
Technology's Proximity Search algorithm.  They have a (patented) VLSI
accelerator chip which used to be necessary (on old PC-ATs) if the
database grew larger than trivial (400 records); a modern 486 might
not need one, I don't know.  Their "Friendly Finder" would list the
10 to 20 records which most closely match the key you are typing,
with the list changing as you extend the key, character by character --
like incremental-search mode in emacs, only it shows 20 matching lines,
like list-matching-lines.  Usually there are a few records in the list
that you don't understand why their algorithm thinks they're a close
match, but what you want is almost always on page 1.  In 1986, Friendly
Finder would scan DBase II and III and ASCII files.  I suppose
they may have upgraded it for DBase IV.

They will also license to developpers to use the library & hardware
in your programs -- but for a customer-inquiry device, the pop-up
database-searcher may be just right -- you can paste the product
number from the searcher into the order-entry program, I think!

The company exists to exploit their two resources: the Proximity
Search Algoritm in hardware and software, and their exclusive
licesinsing arrangement with Merriam-Webster's lexicographic database.
(Yes, that pocket-dictionary/spell-checker/thesaurus that has the
MW logo on it has the Proximity algorithm in it, and probably has 
their logo in fine print too.)

To contact them: in 1986, they had an office in Framingham Mass,
which I visited as an Evil Defense Contractor looking for useful
technologies for databases (they already had a contract with NSA
for use of their VLSI chip in something hush-hush, but that had
little to do with me except provide a handle for checking references
if I got my sponsor interested); it may still be there if you call
508-555-1212.  Their literature listed home office as:
    Proximity Technology Inc.
    3511 NE 22nd Avenue
    Fort Lauderdale, FL 33308-6226
    305-566-3511   (FAX: -2088)
    TELEX 160054 PRXMTY


Disclaimer: My only remuneration from them was a Beta copy of the
thesaurus that my wife was supposed to review, but never used due to
lack of a harddrive to install it on and a trial (no hardware) copy of
Friendly Finder for evaluation.  Hmmm.  Maybe I should install those
again, they are nice programs.  I wonder how it would work on my 
1E4 record book catalogue on the super-486 at the office?
-- 
Bill Ricker wdr@world.std.com      "The freedom of the press belongs 
(formerly wdr@wang.com)             to those who own one."
Newsgroups: comp.programming
From: markh@csd4.csd.uwm.edu (Mark William Hopkins)
Subject: 400% makes sense
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Date: Sat, 25 Jul 1992 17:13:14 GMT

20,000,000 operations/second is 400% of 5,000,000 operations/second.

Case closed.
Newsgroups: comp.programming