HDTenEightyP/NetNews huggingface dataset:
From: u055@csx.cciw.ca (James Sprenger)
Subject: Re: anyone have any f77 code to do matrix mult,trans,inv operations ???
Organization: Canada Centre for Inland Waters
Date: Fri, 20 Nov 1992 20:24:22 GMT

In article <Bxzqp2.5rp@acsu.buffalo.edu> v087mxgb@ubvmsb.cc.buffalo.edu (somewhere over Buffalo) writes:
>Hi all,
>
>I haven't had any luck finding PD stuff this simple, so here goes
>a public begging:
>
>does anyone have some *simple* subroutines coded to do the following
>simple operations:
>
>multiply a matrix by a vector
>multiply two matrices
>invert a matrix
>transpose a matrix
>

... Just a thought,  I recall a book call _NUMERICAL_RECIPIES_, I've seen
Pascal and C(++) versions, there may be a FORTRAN version.  It'll probably
have source code that you can adapt to your needs, if not complete routines.

Cheers!
-- James Sprenger --
  u055@csx.cciw.ca  
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Newsgroups: comp.lang.fortran
From: dnl@convex.is.macsch.com (David Lombard)
Subject: Re: How does one return a logical value...???
Organization: MacNeal-Schwendler Corp.
Date: Thu, 19 Nov 92 16:16:34 GMT

In article <BxwrJC.GME@cs.uiuc.edu> ctaylor@cs.uiuc.edu (Conrad W Taylor) writes:
>         I have written a function which returns a logical
>value, CheckActivity(previous, ROWS, COLS), previous is an
>array.  I'm using it like this:
>
>        IF (CheckActivity(previous, ROWS, COLS) .EQ.  .TRUE.) THEN
>          uncontrol = uncontrol + 1
>        ENDIF
>
>My compiler says that I have mixed types when I use .TRUE. .  What
>should I use I tried T instead of .TRUE. . It doesn't give errors
>but it doesn't increment the uncontrol... it never goes into the
>IF statement; skips it completely.  I'm new to FORTRAN and please
>if anyone knows what I should do, let me know via e-mail.  Thanks
>in advance to all that reply to my e-mail.
>

I *assume* you have the declaration:

	logical CheckActivity

In such case, the result of the function is already a TRUE/FALSE value.

_You_do_not_compare_logicals_to_.TRUE._or_.FALSE._!!!!!!!!!!!!

You should just write:

	IF( CheckActivity( previous, ROWS, COLS ) ) THEN

Also, never, ever, write

	logvar = .FALSE.
	if( _some_logical_expression_ ) logvar = .TRUE.

Instead write

	logvar = _some_logical_expression_

Say What You Mean!


Regards,
DNL

                 MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;

David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
(213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
Newsgroups: comp.lang.c
Subject: Re: LZW Compression algorithm
Date: 17 Nov 92 12:49:47 GMT
Organization: McGill Research Centre for Intelligent Machines

In article <Bxs4oA.9s6.2@cs.cmu.edu>, kosak+@cs.cmu.edu (Corey Kosak) writes:
> In article <1992Nov15.200257.20378@thunder.mcrcim.mcgill.edu> mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
>> In article <BxMAwz.D6C@willamette.edu>, bbrown@willamette.edu (Brian Brown) writes:
>>> Does anybody have any information on how to implement LZW
>>> compression/decompression?
>> [description of compression algorithm]

> Mr./Ms. Mouse leaves off the description of the decoding process.

> The description that Herr/Frau Mouse gives for the encoding process
> is almost correct.  The problem is that in the given algorithm, the
> encoder's table updates are one step ahead of the decoder's; this
> usually doesn't matter, but will cause incorrect behavior for some
> input.

True enough.  This is a relatively subtle point I probably should have
mentioned: as you point out, when the input being compressed is of the
form xfooxfoox for some character x and string foo, the compression
algorithm will generate a code that the decompressor does not yet
recognize at the time it gets it.

The compress(1) source I have access to contains the following snippet:

	/*
	 * Special case for KwKwK string.
	 */
	if ( code >= free_ent ) {
            *stackp++ = finchar;
	    code = oldcode;
	}

When compressing KwKwK (w is a string, K is a single character) and Kw
is present in the table but KwK is not, the encoder will emit the code
for Kw and enter KwK, and the next code it emits will be the
newly-entered one for KwK, which a naive decoder won't yet know how to
recognize.  Consequently, the decoder recognizes input codes it doesn't
yet have in its table as indicating this has occurred, and compensates.
(The decoder does have enough information to decode this correctly,
since the previous code will always be the one for Kw, from which KwK
can trivially be deduced.)

Fortunately, this is the only circumstance in which a correct
compresser will generate a code the decoder doesn't already know...

					der Mouse

			    mouse@larry.mcrcim.mcgill.edu
From: lpeters@postmaster@hq.af.mil (Leslie D Peters)
Newsgroups: comp.lang.c
Subject: Re: *** IMPORTANT DISCOVERY ***
Date: 20 Nov 92 15:07:31 GMT
Reply-To: lpeters@marge.hq.af.mil
Organization: 7th Communications Group

In article <1992Nov18.235959.3071@spock.UUCP>, aorpha@spock.uucp (Andreas Orphanides) writes:
|> In article <1992Nov16.221156.18458@spock.UUCP> kurgan@spock.uucp (Andrew Twyman) writes:
|> >In article <1992Nov13.210911.3086@msuinfo.cl.msu.edu> knaggs@cps.msu.edu (Scott A Knaggs) writes:

|> >Not only is this too sick to be on rec.humor (which isn't necessarily bad),
|> >but it's nauseating and DUMB!  Keep it out of my face.  You're even more of a
|> >pervert than I am, and that's a sick thought.
|> >-- 
|> >-------------------------------------------------------------------------------
|> >|  -"I have something to say.  It's better to burn out, than to fade away!"-  |
|> >|                          -* THERE CAN BE ONLY ONE *-                        |
|> >kurgan@choate.edu--------------------------------------------------------------
|> 
|> Well, my aarch-nemisis, i see that in one field we agree.
|> 
|> PERVERTS SHOULD BE KEPT OFF THE NET. man, that paragraph is grosser than kurgan's (in real life) face!
|> 
|> ramirez (soon)
|> aorpha@choate.edu
|> .sig pending
A second grenade to you, sir.
-- 
/============================================================================\
|                    ___                     |                               |
|       ___....-----'---`-----....___        | I haven't lost my mind --     |
| =========================================  |                               |
|        ___`---..._______...---'___         |  it's backed up on            |
|       (___)      _|_|_|_      (___)        |   tape somewhere.             |
|         \\____.-'_.---._`-.____//          |                               |
|           ~~~~`.__`---'__.'~~~~            | lpeters@marge.hq.af.mil       |
|                   `~~~'                    |                               |
\============================================================================/
From: farid@gradient.cis.upenn.edu (Hany Farid)
Newsgroups: comp.lang.c
Subject: Re: Help with 'make' files.
Date: 23 Nov 92 22:20:03 GMT
Organization: /home/farid/.organization
In-reply-to: nahaym@chdasic.sps.mot.com's message of 23 Nov 92 20:28:39 GMT


>   all: main
>   main:	main.o misc.o
>	   cc main.o misc.o -o main
>   misc.o : misc.c
>	   cc -o misc misc.c
>   main.o : main.c
>	   cc -o main main.c 
>
>   I then type 'make', but it never links the main
>   and misc together....

Try this:
	main: main.o misc.o
		cc -o main main.o misc.o

	main.o: main.c
	misc.o: misc.c
You do not need to explicitly give the rules for main.o and misc.o
since the default make rules know how to handle them.

Hany Farid
Newsgroups: comp.lang.c,comp.software-eng
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: Wanted: Supported equivalent of FileMerge
Organization: Twin Sun, Inc
Date: Fri, 20 Nov 1992 23:06:28 GMT

mzimmers@netcom.com (Michael Zimmers) writes:

>In article <1992Nov20.015605.10416@spectrum.xerox.com> leisner@eso.mc.xerox.com writes:

>>GNU diff is quite impressive and has excellent and extensive documentation!! 

>I haven't seen GNU diff, but the mere fact that is needs extensive
>documentation implies that it's inconsistent with Scott McGregor's
>stated objective for programming tools, that a tool ought to be easy
>to install, easy to learn and easy to use.  His company's Mergeahead
>comes with a one-page installation sheet and online help, and that's 
>it (and that's enough).

Please try GNU diff instead of criticizing it out of ignorance.
The documentation Leisner refers to is online help, too.
Of course, you can print it out if you like -- some people prefer this.

GNU diff has also seen some improvements since McGregor's old study,
particularly in the area of merging.  I wonder what the results would
be like if the study were performed again today?
From: gegu@zurich.spectrospin.ch (Gerry Gucher)
Newsgroups: comp.lang.c
Subject: Re: Pascal as C prelude?
Summary: learn pascal before C ? Certainly yes
Date: 21 Nov 92 17:13:12 GMT
Organization: Spectrospin AG, Fallanden Switzerland

In article <forb0004.94.722315425@student.tc.umn.edu>, forb0004@student.tc.umn.edu (Eric Forbis) writes:
> The U of Mn suggests, but does not require, taking a quarter of Pascal 
> before taking C. I have no experience with pascal, but have read that the 
> two languages utilize similar concepts and structures couched in different 
> terms. Is pascal really a useful introduction to C- should I be taking 
> that class after all? It's not my intent to start a C vs pascal flame war 
> here... It seems to me that, if pascal is that similar to C, you might as 
> well forego pascal and hop right into C. 
> 
> Any thoughts?
> 

I believe that it is a very good idea to learn Pascal before C.

Please do not expect that you have an easy time when switching from Pascal to C.
Although the two languages use similar concepts, they are still very different.

The two languages have different syntax and emphasize different things.
E.g C is very strong at dynamic memory handling, pointers and efficiency
tricks, where on the other hand Pascal enforces a clean and structured
design and coding style.

Your thinking and your programming style will benefit from learning Pascal
first. But after that you will have to learn the C language in a separate
step. Learning both will help you to write well structured, readable
but still efficient programs. Achieving this by learning only one language
is possible, but unlikely. 

+------------------------------------------------------------------+
| Gerry Gucher                             gegu@spectrospin.ch	   |
| Spectrospin AG,  Industriestr 26,  8117  Faellanden Switzerland  | 
+------------------------------------------------------------------+
| A program that  returns the  wrong | There is nothing wrong with |
| result twice as fast is infinitely | making  mistakes,  but make |
| slower.               - H. Spencer | new ones.           - D.Sim |	
+------------------------------------------------------------------+




Newsgroups: comp.lang.c
From: andy@research.canon.oz.au (Andy Newman)
Subject: Re: People's Criticism of C (was Re: Macros)
Organization: Canon Information Systems Research Australia
Date: Fri, 20 Nov 1992 05:45:26 GMT

chambles@whale.st.usm.edu (John William Chambless) writes:
>The very characteristics that make C so useful to many programmers are
>the ones that make it so dangerous to the unwary. C will do whatever
>you tell it to; if you tell it to do something stupid, well...
>
>	who's to blame?

Well in other environments where you have tools that can possibly be
used incorrectly and cause damage you have regulatory bodies. Think
about the USA's FAA, FCC, FDA, etc... Should there be a Federal
Computer Language Authority that dictates what langauges can be used
and in what situations? (Shades of the UK's DoD standards.)

-- 
Andy Newman (andy@research.canon.oz.au)
Xref: sparky comp.lang.c:16920 comp.lang.c++:16680 comp.misc:4359
From: fhi0055@hq.dla.mil (Marc Poole)
Newsgroups: comp.lang.c,comp.lang.c++,comp.misc
Subject: Confused
Date: 20 Nov 92 16:07:52 GMT
Followup-To: comp.lang.c,comp.lang.c++,comp.misc
Organization: HQ Defense Logistics Agency/DASC, Cameron Station, VA


 The following is a program that I am trying to write.  I can not seem
 how to get the outer loop to work.  The situation is, the inner loop
 will run until it is finished, when it falls through the program should
 prompt for another int input.  If the user inputs 0 then the whole
 program will end.  If the user inputs any other number, the loop will
 continue. 

 My problem is I can't seem to contruct the outer loop to end once 0 is
 entered.  I either get an endless loop (with wrong answers the 2nd time
 through) or I get no answer after input of first int and the program
 ends.

#include <stdio.h>
main()
{
float answr;
int fact;
int count;
count = 1;
printf ("This program is designed to print the factoral of a number ");
printf ("entered by the user.\n");
printf ("Enter you number: ____\b\b\b\b");
scanf ("%d",&fact); 

while 
{
    while (fact > 0)
       {
       count = count * fact--;
       }
answr = count;
printf ("%e", answr);
printf ("\n");
printf ("Enter another number or 0 to quit: ___\b\b\b");
}


printf ("\n");
}

 I left the while statement in the beginning of the outer loop, because
 that's the loop I am trying to use.  It's the coding for that statement
 I can't figure.  Should scanf come after the first while, with it or is
 while not correct at all?

 If anyone can help or steer me in right direction please let me know.

 Hints and not answers would be greatly appreciated, explanations would
 be appreciated aslo.

 mpoole@hq.dla.mil                   |       To some avail

   
Newsgroups: comp.lang.c
From: blume@kastle.Princeton.EDU (Matthias Blume)
Subject: Re: Rounding floating point numbers in C
Reply-To: blume@kastle.Princeton.EDU (Matthias Blume)
Organization: Dept. of Computer Science, Princeton University
Date: Sat, 21 Nov 1992 15:57:41 GMT

In article <1992Nov20.215133.3271@enterprise.rdd.lmsc.lockheed.com>,
gumerman@aspen.ops.lmsc.lockheed.com () writes:
|> 
|> Hi everybody,
|> 
|> Below is an example program and its output.
|> 
|> 
  [ parts deleted ]

|> main()
|> {                                              
|>    one = (float) 1.15;   
|>    two = (float) 1.25;
|>    three = (float) 1.35;
|>    four = (float) 1.45;
|>    five = (float) 1.55;
|>    six = (float) 1.65;
|>    seven = (float) 1.75;
|>    eight = (float) 1.85;
|>    nine = (float) 1.95;
|> 
|>    printf("1.15       %1.1f\n",one);
|>    printf("1.25       %1.1f\n",two);
|>    printf("1.35       %1.1f\n",three);
|>    printf("1.45       %1.1f\n",four);
|>    printf("1.55       %1.1f\n",five);
|>    printf("1.65       %1.1f\n",six);
|>    printf("1.75       %1.1f\n",seven);
|>    printf("1.85       %1.1f\n",eight);
|>    printf("1.95       %1.1f\n",nine);
|> 
|>  }
|> 
|> 

Try to print these numbers with a format that uses many more digits.
You will see, that not every number, which has been written in decimal can
be represented precisely in a finite number of binary digits.
Sometimes there is simply no tie in cases where you expect that printf uses
something like ``round to even''.

BTW: The same program gives other (also virtually inconsistent) results on a
DECstation (MIPS/Ultrix):

1.15       1.1
1.25       1.2
1.35       1.4
1.45       1.5
1.55       1.5
1.65       1.6
1.75       1.8
1.85       1.9
1.95       2.0


-Matthias
Newsgroups: comp.lang.c
From: rene@hamel.uucp (Rene Mueller)
Subject: Re: Rounding floats to integers
Organization: Free University of Berlin, Germany
Date: Thu, 19 Nov 1992 17:45:23 GMT

In article <92314.134711IA8@psuvm.psu.edu>, IA8@psuvm.psu.edu (Alan R. Heyd) writes:
|> Is there a C routine that will round off floating point numbers
|> to the nearest integer.  K&R says that floats are converted to
|> integers by removing the fractional part, however, I could not
|> find mention of a routine which rounds to the nearest integer.
|> What I do now is add 0.5 to the float before it is converted to
|> an integer, for example:
|> 
|>           int i;
|>                                  /* Using Turbo C on and IBM PC: */
|>           i = 6.0 / 0.3;         /*   i = 19                     */
|>           i = 6.0 / 0.3 + 0.5;   /*   i = 20 as expected         */
|> 
|> is there a better way?
|> 
|> Thanks,
|> 
|> Alan Heyd
|> ia8@psuvm.psu.edu
Special roundfunctions, if you have any within your libraries, do it the same way.
Cause it is the fastest solution to ROUND...
But converting to integer just means: forget all behind the decimalpoint....
So i = 6.0 / 0.3; is 'real' converting to integer and will produce on every
machine with any compiler i = 19!

	Rene
From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
Newsgroups: comp.lang.c
Subject: Re: the abs() function in C
Date: 20 Nov 92 20:22:43 GMT
Organization: University of Helsinki

maurer@nova.stanford.edu (Michael Maurer) writes:
>>Isn't abs(-2)=2 in C? I always get 0.
>
>you probably want to say abs(-2.0), if the abs() function expects a
>floating point argument.  or abs((double)-2).

As the quickest of glances at the friendly manual will tell you, abs
does not expect a floating point argument, it expects an integer.  Use
fabs for floating point.

I do not know what causes the trouble for the original poster.  It
could have been invalid code (he did not show any actual code),
invalid compilation.  It could be an error in the compiler or
libraries, but somehow I doubt that: abs is far too easy to get right.

If the original poster has not solved his problem yet, perhaps he
should ask again, this time giving a small (preferably less than 10
lines) but still complete (preferably a complete program) example of
source code that shows the problem.

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
   MS-DOS, you can't live with it, you can live without it.
Newsgroups: comp.lang.c
From: puckett@lambda.msfc.nasa.gov (Jim Puckett)
Subject: ANSI testing for gcc
Organization: NASA/MSFC
Date: Fri, 20 Nov 1992 12:24:20 GMT

...so my boss says 'Is gcc ansi compatible? does it work?'

...of course, he can man gcc as well as i can, and in fact did - and 
printed it out and left it on my desk, by way of reminding me that
he had asked the above question...8-)

...and he can see -ansi and -pedantic as well as i can too....

...but is there any way of _proving_ ansi compatibility/compliance? is 
there any test code for that sort of thing?....

humbly asking,
jim p.
-- 
Jim Puckett    NTI    puckett@lambda.msfc.nasa.gov     
Madison,AL (205)461-4922  
i need to ask myself.....
***********         Would I rather be right, or happy?         ***********
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: fwrite & fread
Date: 19 Nov 92 11:04:56 GMT
Organization: AND Software BV Rotterdam

In article <92324.000622U17868@uicvm.uic.edu> U17868@uicvm.uic.edu writes:
|I am using write & fread to read and write to a file. The structure that I
|am writing has 194 bytes. After executing fwrite I check the value, in vari
|able a which is 1 (correct), because I am writing one structure. Then I check
|the values of returned by fclose and ferror and they are also correct i-e 0.
|But when I quit from the program without writing more structures or without
|running any other functions and look for the size of my file it shows that it
|has 414 bytes. Actually, it should have 194 bytes. [ ... ]

No it shouldn't. I assume you're working with 2 byte ints (sizeof(int) == 2),
and no structure element padding. If I add up all the bytes, I get this:

|typedef struct activity{
|	int  id;		/* total =   2 */
|	int  mm;		/* total =   4 */
|	int  dd;		/* total =   6 */
|	int  yy;		/* total =   8 */
|	char day[10];		/* total =  18 */
|	int  hour;		/* total =  20 */
|	int  min;		/* total =  22 */
|	int  end_hour;		/* total =  24 */
|	int  end_min;		/* total =  26 */
|	char location[25];	/* total =  51 */
|       char with_who[20];	/* total =  71 */
|	char phone[11];		/* total =  82 */
|	char subj[30];		/* total = 112 */
|	char note[300];		/* total = 412 */
|       int  flag;		/* total = 414 */
|};

BTW this is not a very useful type definition, you forgot to give
the user defined type its own name. 

kind regards,

Jos aka jos@and.nl
Newsgroups: comp.lang.c
From: chambles@whale.st.usm.edu (John William Chambless)
Subject: Re: Can you program in C?
Organization: University of Southern Mississippi
Date: Thu, 19 Nov 1992 04:22:26 GMT

In article <craigh.722123907@cserver> craigh@cserver.plexus.com (Craig Heilman) writes:
>tada@athena.mit.edu (Michael J Zehr) writes:
>
>>In article <00963BF4.675CEA80@vms.csd.mu.edu> 2644danticoj@vms.csd.mu.edu writes:
>>>My name is Cetera ... can you help me write  these programs, thereby
>>>allowing me to graduate and go on to serve my country as an officer on a
>>>nuclear submarine? 

/*  Many replies deleted... */

I could use some help , too. Would someone send me programs for
my data structuresz class, also for advanced C. I could use a few
spare term papers, too.

Anybody got an extra doctoral thesis, so I can be a physicist, too?

Fraudulently  yours....

-- 
* Billy Chambless   University of Southern Mississippi, USA 
*   chambles@whale.st.usm.edu
*    
*   Programming exclusively in (--(C++))
From: scotth@felix.filenet.com (Scott Hopson)
Newsgroups: comp.lang.c
Subject: Re: How can I make a c prg a TSR prg?
Date: 21 Nov 92 17:53:49 GMT
Reply-To: scotth@fritz.filenet.com (Scott Hopson)
Organization: FileNet Corp., Costa Mesa, CA

In article <BxyKKG.LuE@uxa.ecn.bgu.edu> curdm@uxa.ecn.bgu.edu (Richard Mancuso) writes:
>
>Can you please help me? I want to make a program run after no keys have been
>touched for a certain amount of time.  Its not a screen saver.

Are you saying that you would like to attach a process to the timer interrupt?
And I'm assuming you want to do this on a PC.....

Building a TSR on a PC is not the easist thing to do, if you have a program 
ready written that you want to convert to a TSR you need to be aware of
a few things. 

1. Does it write to the screen in graphics, text mode, or both?

2. Does it write or read the disk?

3. Does it need to cooperate with other processes?

These three basic questions will determine how you write your TSR. You 
should probably get a copy of the "Dos Programmers Reference" manual.	

You will also need a knowledge of 80x86 Assembler and Dos Internals.




-- 
Scott Hopson   (scotth@filenet.com)
Newsgroups: comp.lang.c
From: andy@research.canon.oz.au (Andy Newman)
Subject: People's Criticism of C (was Re: Macros)
Organization: Canon Information Systems Research Australia
Date: Mon, 16 Nov 1992 23:06:06 GMT

chuckb@stein.u.washington.edu (Charles Bass) writes:
>
>After reading some of the posts it seems they slam macros and
>generally for cases when users don't know how to use them
>safely.

Many of the posts slam C when users don't know how to use it safely.
Is it C's fault that it is being used by inappropriate people in
applications where another language may be more produective? I think not.

-- 
Andy Newman (andy@research.canon.oz.au)