HDTenEightyP/NetNews huggingface dataset:
From: rene@hamel.uucp (Rene Mueller)
Subject: Re: If statement question
Organization: Free University of Berlin, Germany
Distribution: na
Date: Mon, 23 Nov 1992 23:16:24 GMT

In article <GOWEN.92Nov22235007@jade.tufts.edu>, gowen@jade.tufts.edu (G. Lee Owen) writes:
|> 
|> 	
|> 	Sorry, took me a day extra to get this out, but here we go...
|> 
|> From ckkoo@magnus.acs.ohio-state.edu (Chee K Koo) on 20 Nov 92:
|> CKK> I am new to C programming, while i was doing a numerical analysis
|> CKK> program which uses many for loop
|> CKK> here is the loop looks like
|> CKK> for(i=1;i<=n;i++);
|> CKK> {
|> CKK> }
|> CKK> i put the ";" after the loop header, when the program is excuted, the
|> CKK> loop is skipped, however, it works fine when the ";" is removed.
|> 	
|>   When you say 'for(i=1;i<=n;i++);' you are really telling the
|> compiler 'for(i=1;i<=n;i++) /* DO NOTHING */;'.  The for loop will
|> work on the (single) statement following it OR on the block following
|> it, where { and } mark off the block.  
|>   If you were writing a loop that would execute one statement, it
|> would be like this, right?
|>     for(i=1;i<=n;i++) printf("Hi #%d\n", i);
|> Notice how there is no ; between the end of the loop parens and the
|> printf statement.  Well, the same thing goes for a for loop with a
|> block following it.  Say you had to execute two statements, you would
|> put them in a block:
|>     for(i=1;i<=n;i++) 
|>         {
|>         printf("Hi ");
|>         printf("#%d\n", i);
|> 	}
|> like such. The output of this would be (n == 5 here)
|> Hi 1
|> Hi 2
|> Hi 3
|> Hi 4
|> Hi 5
|>   Notice that, without the blocks, like this:
|>     for(i=1;i<=n;i++) 
|>         printf("Hi ");
|>         printf("#%d\n", i);
|> it will print "Hi " n times and then print "#i" where i has the same
Ok so far...
|> value as n. If n equalled 5 you would get "Hi Hi Hi Hi Hi 5".
That was wrong!
Your condition was i<=n, so i==n will be executed, then i++ and THEN the loop
will be breaked...
That means the output is:
"HI HI HI HI HI 6"!!!

|> 	
|> 	I'm afraid I find this difficult to explain succinctly; I hope
|> these examples illustrate what you are seeing.  Perhaps you should dig
|> in your textbook a bit more...
|> 
|> CKK> I just want to find out why the compiler does not catch it during
|> CKK> compilation. It is compiled with UNIX gcc.
|>   Well, frankly, it's not the compiler's job.  More importantly,
|> neither would it always be correct to flag that.  Consider this:
|>   for (i=0; ((i<ARRAY_MAX)&&(array[i]!=42)); i++)  /* DO NOTHING */ ;
|>     printf("The Answer to Life is at array position %d\n", i);
|>   This fragment uses the loop to find the position in the array which
|> holds the value 42; the loop need not execute a statement, and the
|> side effect is that when the loop terminates, i has the value we are
|> interested in.
Sorry, but here is the same mistake...
You must FIRST decrement(increment?? grmbl) SUBSTRACT 1 from i to get the
correct array position:
printf("The Answer to Life is at array position %d\n", --i);

Hope there will be nobody confused to much...
Newsgroups: comp.lang.c,comp.software-eng
From: rsd@sei.cmu.edu (Richard S D'Ippolito)
Subject: Engineering Software (Was: ...ignoring this productivity issue?)
Organization: The Software Engineering Institute
Date: Mon, 16 Nov 1992 19:06:28 GMT


In article <1992Nov16.091643.13590@netcom.com>, Phil Howard writes:

> mat@mole-end.matawan.nj.us writes:
>
> >An Engineering School education is a special blend of theory and practice,
> >one I feel quite privileged to have enjoyed.  It's been ten years since I
> >got my degrees, but I see no evidence that the software world has as yet
> >anything like it.
> 
> NOTHING like it... and I didn't even have to go through engineering to
> know that.

Please note that there is something like it!

The Air Force Institute of Technology (AFIT) has been incorporating the
Model-Based Software Development (MBSD) method into the Master of Software
Engineering Program, and we just presented a joint tutorial with Major Paul
Bailor, Ph.D.  of AFIT at the recent Conference on Software Engineering
Education in San Diego last month.  This technology is rigorously based on
traditional methods of engineering design using architectural models, and was
developed by my project (Software Architectures Engineering) at the SEI.

The method is an application of the engineering mindset to software
development, and is characterized by:

  () the routine use of formal system models
  () the use of model-based solutions
  () the expression of designs in terms of system models
  () the synthesis of solutions from models of prior experience

We teach that designs are not created from first principles, but from elements
of captured, well-known systems models.  These systems models comprise
stylistically-consistent sets of basic-level pattern classifiers which are
used to form the problem space, to set the problem in terms of known patterns
of missions and services, and to solve the problem by providing a mapping of
the patterns to templated structures of known performance.  MBSD has been used
to develop the embedded control system for the Advance Millimeter-Wave
Maverick missile seeker, the C-17 flight trainer, the Joint Modeling and
Simulation System (J-MASS) for electronic combat design simulation, and the
embedded training system for the Navy's new class of minehunting and clearing
ships.

The tutorial defined the elements of traditional engineering missing from the
program and described how MBSD provides those elements and is integrated into
a program of instruction.

Richard S. D'Ippolito, P.E., Ph.D.
rsd@sei.cmu.edu

Newsgroups: comp.lang.c,comp.software-eng
From: bwb@sei.cmu.edu (Bruce Benson)
Subject: Re: Will we keep ignoring this productivity issue?
Organization: Software Engineering Institute
Date: Tue, 17 Nov 1992 16:59:37 GMT

In article <1992Nov17.003350.2649@tcsi.com> miket@hermes.tcs.com (Michael Turner nmscore Assoc.) writes:
>
>This still begs the question of whether high programmer productivity is
>something that can be taught.  How you get to where you get in something
>like programming is very much a function of how much you love it.
>As with many areas of expertise, there is no shortage of people who
>are in love with the image of themselves as superior programmers.
>But how many really live for the game itself?  Those, I think, are
>the superprogrammers.  Can love of programming be taught?

Do we want to teach everyone to be a super programmer or do we want to help
everyone become a better programmer?  In other words can we get what we need,
produce the products - be competitive, with other than super programmers?

My wife is a good example of someone who is very good at programming but has
no particular love for it.  I'd rather have someone like her work for me
than many of the super-programmers (fast, prolific, quick to see solutions,
know their tools [OS, languages], creative) I've worked with or who have 
worked for me.  Most of the effort always seems boringly straight forward
and we've only really needed the super-star to solve/code the few hard
areas.  For every super programmer I would want about 10 good solid
programmers who put in a full day, and go home at night to their families.


This might not be the best approach for the leading/bleeding edge software
company (MS, Borland, etc.) but for the average business that uses software 
to support their primary business, I suspect it works well.  Of course, 
these 10 good solid programmers will need a good management function to
provide direction/resources/etraining/etc, and a super programmer for the
really hard parts.
* Bruce Benson                 + Internet  - bwb@sei.cmu.edu  +       +
* SSC/XPE                      +      bbenson@xpe.ssc.af.mil  +    >--|>
* Gunter AFB, AL 36114         +                              +       +
* (SEI Affiliate Alumni)       + Voice     - 205 416-4445     +  US Air Force
Newsgroups: comp.lang.c,comp.lang.c++
From: andy@research.canon.oz.au (Andy Newman)
Subject: Re: *** IMPORTANT DISCOVERY ***
Organization: Canon Information Systems Research Australia
Date: Tue, 17 Nov 1992 07:46:36 GMT

danodom@matt.ksu.ksu.edu (Dan Odom) writes:
>What the hell was that?
Its called leaving your shell unattended.
-- 
Andy Newman (andy@research.canon.oz.au)
Newsgroups: comp.lang.c
From: dfuller@portal.hq.videocart.com (Dave Fuller)
Subject: Re: the abs() function in C
Organization: VideOcart Inc.
X-Newsreader: Tin 1.1 PL3
Date: Fri, 20 Nov 1992 06:06:46 GMT

pebi@aem.umn.edu (Peter A. Bidian) writes:
: 
: Isn't abs(-2)=2 in C?
: I always get 0.
: 
: Confused!
: 
: Peter
: 

Correct. abs(-2) should return an integer value of 2. Maybe if some more
code were made available, there is another reason you are seeing a 0
for the value.

Dave Fuller
dfuller@portal.hq.videocart.com
From: jfw@ksr.com (John F. Woods)
Newsgroups: comp.lang.c
Subject: Re: has anybody heard of 'onexit' ?
Date: 23 Nov 92 10:56:59 EST

llew@bigwpi.WPI.EDU (Lok C. Lew Yan Voon) writes:
>now i decided to convert all the prog into C by using f2c.
>when i tried to compile everything, the linker complains:
>	Undefined:
>	onexit
>does anyone know what's going on?
>(i've no knowledge of C beyond chp one of K&R!)

This is not a standard C function; probably it is part of the FORTRAN support
that f2c assumes is present.  Presumably it has similar functionality to
atexit() (which was standardized in ANSI C), but it's hard to tell without
seeing the source in question.
Xref: sparky comp.lang.c:17017 comp.software-eng:4458
From: mal2n@fulton.seas.Virginia.EDU (Matt Leonard)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Windows schmatic drawing program
Date: 23 Nov 92 07:11:22 GMT
Organization: University of Virginia


Does anyone know of a nice application to draw simple schmatics of simple 
circuits in the Windows environment, mainly for pasting into Word for
Windows?   

	Any help would be appreciated....
	Thanks in advance.
Newsgroups: comp.lang.c
From: cpcahil@vti.com (Conor P. Cahill)
Subject: Re: Help me track down memory leakage
Organization: Virtual Technologies Inc.
Date: Wed, 18 Nov 1992 11:34:02 GMT

abuhr@owlnet.rice.edu (Aaron M. Buhr) writes:

>     I've inherited a very large C program that I am trying to maintain and
>expand, and I've come to the point where I HAVE to find out where the
>program's leaking memory.  The program starts out with about 7MB virtual
>mem usage, 6MB real, and grows over the course of 6-8 hours to around 20MB
>virtual, 10MB real.  The program uses straight malloc() and realloc() calls.
>I don't know where or how to start trying to track this down.  Any help
>would be greatly appreciated.  Email is preferred, but I'll try to watch
>the posts to this group as well.  Much thanks in advance.

Assuming you are talking about a program in a UNIX environment, you could
use my freeware dbmalloc (or malloclib) library which does have some support
for tracking memory leaks.  This was posted to comp.sources.misc in Sept.

Another (better, but I'm biased) solution would be to use our SENTINEL
product which you would just link in and get a full report of memory
leaks in addition to lots of other interesting debugging capabilities.
Send email if you would like additional information.

-- 
*** SENTINEL(tm) The ultimate Debugging Environment - email for more info ***

Conor P. Cahill              (703)430-9247            cpcahil@virtech.vti.com
Virtual Technologies, Inc.  46030 Manekin Plaza          Dulles, VA 20166 
Newsgroups: comp.lang.c
From: curdm@uxa.ecn.bgu.edu (Richard Mancuso)
Subject: How can I make a c prg a TSR prg?
Organization: Educational Computing Network
Date: Thu, 19 Nov 1992 10:17:02 GMT


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.

Richard Mancuso

Eastern Illinois University

curdm@uxa.ecn.bgu.edu
From: gowen@jade.tufts.edu (G. Lee Owen)
Newsgroups: comp.lang.c
Subject: Re: Multiple &'s in an if statement
Date: 23 Nov 92 18:05:36 GMT
Distribution: na
Organization: Tufts University - Medford, MA



Seen on 23-Nov-92, From: bcochell@ws14.ips.iacd.honeywell.com (Bill Cochell)
> Can anyone explain why this works correctly (That is, it checks to see that
> the last 5 characters of name are all digits and that it is null terminated):
>   if ( isdigit(name[strlen(path)]) &
>             /* ......... */
>        isdigit(name[(strlen(path) + 4)]) )
>      if ( iscntrl(name[(strlen(path) + 5)]) ) {
>         printf("%s\n",name);
>      }
>While the following does not?:
>   if ( isdigit(name[strlen(path)]) &
>           /* ....... */
>        isdigit(name[(strlen(path) + 4)]) &
>        (name[(strlen(path) + 5)] == NULL ) ) {
>      printf("%s\n",name);
>   }
> Why do I have to check for NULL with a separate if statement?
	Well, I suspect that the use of bitwise AND operator & instead
of the logical AND operator && is at fault here.  Bitwise ANDing will
often give you the same result as logical ANDing, but not always.  Try
replacing the &'s with &&'s and see what happens.

> Any opinions will be appreciated
      ^^^^^^^^
	Good, because without more code I wasn't really able to test
my guess.  Standard nontested code disclaimers apply.


--
--Greg Owen
	gowen@forte.cs.tufts.edu, gowen@jade.tufts.edu
"C Spot. C Spot run. C Spot run without a core dump! Run, Spot, Run!"
Xref: sparky comp.lang.c:17030 comp.software-eng:4464
From: bergquis@gdc.com (Brett Bergquist)
Newsgroups: comp.lang.c,comp.software-eng
Subject: Re: Wanted: Supported equivalent of FileMerge
Date: 23 Nov 92 13:00:40 GMT
Followup-To: comp.lang.c

: dougv@vnet.ibm.com (Doug Valkenaar) writes:
: 
: >Does anyone know of a "FileMerge" type program which allows you to visually
: >merge two files into a third one with selected parts from each of the
: >originals?  SUN used to distribute such a program, but it's only SunView
: >(I'd like OpenLook), and it's no longer supported.
: 
: >Surely there's something like this in an 'X' or OpenLook GUI.
: 

Another possiblity if you use GNU Emacs is a package called "emerge", written
by Dale Worley <drw@math.mit.edu>.  This package provides side by side
merging similar to "FileMerge", but with emacs.

-- 
Brett M. Bergquist, Principal Engineer | "Remind me" ... "to write an
General DataComm, Inc.,                | "article on the compulsive reading
Middlebury, CT 06762                   | of news." - Stranger in a Strange Land
Email: bergquis@gdc.com		Voice: (203) 758-1811 ext. 7635
From: blimoges@sobeco.com (Bertrand Limoges)
Newsgroups: comp.lang.c
Subject: C source to mktime() ?
Date: 20 Nov 92 21:29:36 GMT
Followup-To: comp.lang.c
Organization: Sobeco Ernst & Young

Here I am coding away, and I need to use mktime() in order to convert
a struct tm * to a time_t value but the function is not present on the
system I'm working on (MIPS). time, localtime, ... are there, but not
mktime! I've written a quick hack just to get on with my work, but I'd
like something a little more standard and tested. It must be in C, for
I will use it on other platforms as well.

Snippets of code or pointers to sources much appreciated,

Bertrand Limoges, Sobeco Ernst & Young Inc., Montreal, Canada
---
We extend and amplify impoverished data on the basis of what we know about
how the world typically behaves, and the result is that prejudice becomes
a natural part of "rational" thought.     --Jeremy Campbell
From: GNR100@psuvm.psu.edu
Newsgroups: comp.lang.c
Subject: Multiple Parameter Passing (unspecified number)
Date: 16 Nov 92 17:48:34 GMT
Organization: Penn State University


   Hi.

   I'm looking to write a function that accepts any number of paramerter.
There will be at least two, an int and a char[]. The rest will all be char[]'s.
I need to know how this is done.  The meathod would be similar to that of
printf(), so if anybody know how that works, please let me know.
                 Thanks,
                     Gordon Rogers
                     gnr100@psuvm.psu.edu
Newsgroups: comp.lang.c
From: Nico Tranquilli <ntranqu@caticsuf.cati.csufresno.edu>
Subject: Re: Virtual memory Management Systems
X-Xxmessage-Id: <A72FB8AE7D010B1B@mac2.di.unipi.it>
X-Xxdate: Wed, 18 Nov 92 08: 09:02 GMT
Organization: Department of Computer Science, Pisa University
X-Useragent: Nuntius v1.1.1d9
Date: Wed, 18 Nov 1992 08:11:23 GMT

In article <1992Nov17.143327@gese.ge14.mdadv.gv.at> Petzi Schweda,
sca@gese.ge14.mdadv.gv.at writes:
>Huh ?
>
>UNIX: don't know more then malloc/calloc ...
>VMS: see lib$get_vm in your RTL-doc's
>PC/WINDOWS: GlobalAlloc/GlobalLock 
>WINDOWS NT: VirtualAlloc
>
>Is it that you wanted to know ?

No. Perhaps I should have asked : "What is the name of HARDWARE devices
which allocate virtual memory on disks whenever the internal memory
become full ?
From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
Newsgroups: comp.lang.c
Subject: Re: Looking for "c" language to PDL Converter
Date: 17 Nov 92 16:36:30 GMT
Organization: Texas Instruments Inc

In <1e95a2INN48l@usenet.INS.CWRU.Edu> ch981@cleveland.Freenet.Edu (Tony Alicea) writes:


>	I am looking for a product that will take a "c" language code
>source program and generate PDL from it. Does anybody know of such
>animal?

Uh, aren't you going about this sort of bass-ackwards?  The PDL
generally comes BEFORE the code.  Oh, and if you want 'PDL', you
really ought to specify WHICH PDL; as in, what you want it to look
like.  As far as I'm concerned, properly commented C code makes a
great PDL (assuming the project doesn't specify something else).

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
Newsgroups: comp.lang.c
From: linnoise@bigboy (LineNoise)
Newsgroups: comp.lang.c
Subject: Text file of C examples
Date: 20 Nov 92 15:03:57 GMT
Organization: Temple University

I seem to learn things at at light speed when I see examples of solutions to a
given problem.  I'm sure there are huge text files out there in net land which
contain useful examples of c programming.  If you have any information on
anonymous ftp sites which have these files, please send me email and I will
post a summary of sites & files here for others to use.  Thanks in advance.

linnoise@129.32.32.98    "I'm so broke, I can't afford room to think!" 
Newsgroups: comp.lang.c,comp.lang.c++,comp.misc
From: cbrooks@afit.af.mil (Christopher L Brooks)
Subject: Re: Confused
Organization: Air Force Institute of Technology
Date: Fri, 20 Nov 1992 19:31:42 GMT

fhi0055@hq.dla.mil (Marc Poole) writes:


> 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. 

>#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 

Try "while (fact != 0)" here instead.  My compiler won't even accept
the above syntax (while with no argument).

>{
>    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.

Hope this helps.

Chris
Newsgroups: comp.lang.c,comp.lang.c++,rec.humor
From: mat@mole-end.matawan.nj.us
Subject: Re: *** IMPORTANT DISCOVERY ***
Summary: A reminder
Organization: :
Date: Tue, 17 Nov 1992 06:29:22 GMT

In article <1992Nov13.210911.3086@msuinfo.cl.msu.edu>, knaggs@cps.msu.edu (Scott A Knaggs) writes:
> "Will you do anything for me?", I asked. "Yes", was your answer. ...

This may have been posted from a stolen account.  If not, the author
should reflect that among the people who read it may be someone to whom
he will someday apply for a job.

Would he have put this up on his company bulletin board or included it
in a corporate memo, I wonder?

My opinion of alt.tasteless is irrelevant, of course.  But the article
did not belong on any of the other groups to which it was posted, and
the author has just made a fool of himself in front of tens of thousands
of people whose respect he ought to crave.

He may also have made himself some enemies.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c
From: andersen@reality (Robert Andersen)
Subject: Re: Please Help Me Keep My Job!
Organization: Encompass
Date: Thu, 19 Nov 1992 23:12:40 GMT

In article <marrou.722202712@eola.cs.ucf.edu> marrou@cs.ucf.edu (Lance R.  
Marrou) writes:
> hollasch@kpc.com (Steve Hollasch) writes:
> 
> >    My manager has asked me to finish several projects by the end of this
> >year, and they're really hard!  I told her I could do them, but now I don't
> >know; they're pretty tricky.  I'm sure other people have done stuff like
> >this, so why should I reinvent the wheel?  Why not use the resources of the
> >net?
> (some text deleted)
> 
> Perhaps we should let you lose your job and let someone who either knows what
> they are doing or doesn't open his/her mouth as wide take over! :)
> 
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Lance R. Marrou
>    Work   - Marrou@IST.UCF.edu
>    School - Marrou@Eola.cs.UCF.edu

--

Gee Lancer sounds like your mouth is just as wide or even wider.  Working for a  
university is a pretty meally job.  Until you work in the REAL world why don't  
you slurp all the butts of us hardworking individuals who have come out of  
mommy's womb!!!!!

Robert John Andersen           
(919) 380-6523 (v,w)
andersen%reality@glv.com - NeXT mail!

Outside of a dog, a book is man's best friend.
Inside of a dog it's too dark to read.
Newsgroups: comp.lang.c
From: 93jay@williams.edu (Jonathan Young)
Subject: PD Floating Point code?
Organization: Williams College, Williamstown, MA
Date: Sat, 21 Nov 1992 06:04:58 GMT

I need to write my own software floating point routines for use on the
HP 95 palmtop computer. A quirk of the operating system prevents the
use of the microsoft or borland libraries even though it is nominally
an MSDOS system. 

I will most likely have to write my own routines in assembly or C for
standard and extended math functions for high accuracy floating point
numbers.

Are there resources on this sort of thing? I don't generally mind a
little re-inventing the wheel in moderation, but I really don't want
to have to work out all new ways of getting hyperbolic tangents etc...

I don't really speak 8088 assembly, but the trasition from 6800
shouldn't be too hard... right? right?

Aggg this all seemed much simpler on the back of that napkin.


Jonathan Young
Williams College

From: gajdos@hpavla.lf.hp.com (Larry Gajdos)
Date: Thu, 19 Nov 1992 15:13:40 GMT
Subject: Re: Reasons for using C vs. Fortran or vice/versa
Organization: Hewlett-Packard Little Falls Site