HDTenEightyP/NetNews huggingface dataset:
From: Jon Freivald <jaf@jaflrn.UUCP>
Newsgroups: comp.lang.c
Subject: Re: TSR Pop-up Editor?
Date: Wed, 12 Aug 92 18:03:41 EDT
Organization: The Wizzard's Cave, East Meadow, NY

rfries@fries_Robert@ub.ub.com (Robert Fries) writes:

> In article <29710001@hpspkla.spk.hp.com> dubner@hpspkla.spk.hp.com (Joe Dubne
> 
> >gilmour@binah.cc.brandeis.edu         Jeffrey R. Gilmour at Brandeis Univers
> 
> >> Anyone know of a editor that I can write code in, save it to disk and then
> >> pop out.  Then after compiling it and finding errors in my code, jump back
> >> into the editor with a couple keystrokes right back to the spot where I le
> >> off.  Any info appreciated!
> 
> >Sure, Jeff -- I use SideKick in exactly the manner you describe.  It's a
> >TSR that can edit ASCII text files of up to about 50KB in size (it's
> >also other things, such as a calculator and ASCII chart).  Its editor's
> >user interface is compatible with WordStar and most folks either love it
> >or hate it.
> 
> >I'm referring to version 1.56 of Borland International's Sidekick, circa
> >1985.  Since then, Borland has "upgraded" it to SideKick Plus and
> >Sidekick 2, but I've stuck with my old version for various reasons.
> 
> >Since editors are a religious issue, I should mention that this is my
> >opinion and members of other "religions" will have other opinions.
> 
> >Regards,
> >Joe 
> 
> >---------------------------------------------------------------------------
> >Joe Dubner   K7JD  |  Hewlett Packard Company  |  dubner@hpspkla.spk.HP.COM
> >                   |  TAFC-34         M.S. 2I  |
> >                   |  Spokane, WA  99220       |  (509) 921-3514
> >---------------------------------------------------------------------------
> 
> The Microsoft Editor, as supplied with Microsoft C 5.1, works very well for 
> this type of use. It's not a TSR, but it remembers where you were each time 
> it is invoked. I've been using it for 4 years. Very extensible.
> 
> Unfortunately, it has evolved into PWB, of which I'm not fond. So, I just use
> the old one.
> 
> Robert

I use BRIEF, which is not a TSR either, but will spawn your compiler for 
you, and go directly to the line with the error.  It also can be configured 
to remember where it was in your last editing session.  It is a very 
powerful, wonderful tool...

Jon

=============================================================================
		   Jon Freivald ( jaflrn!jaf@uunet.UU.NET )
	 Nothing is impossible for the man who doesn't have to do it.
=============================================================================
Newsgroups: comp.lang.c
From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
Subject: Re: POWER OF LARGE NUMBERS
Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
Organization: Motorola Codex, Canton, MA
Date: Mon, 17 Aug 1992 22:29:48 GMT

In article <1992Aug16.052157.1991@organpipe.uug.arizona.edu>, dave@cs.arizona.edu (Dave Schaumann) writes:
|>>
|>>>	Does any one know how to raise power of possibly 100 digits 
|>>>to possibly 100 digits. Any algorithm or code will be appriciated.
|>>
|>>>Example >(1234367463746464647464...up to 100 digit)**(647254627463048736...up to 100 digit)
|>>
|>>The order of magnitude of the solution to this problem is 
|>>
|>>              10**(10**102)
|>>
|>>which is a ridiculously large number.
|>
|>Yah.
|>
|>>Is there any hope of solving this?
|>
|>Only if you're willing to give up most of the significant digits.
|>But it's certainly within the bounds of imagination to have a
|>program that could do something like
|>
|>  google_t a, b ;
|>
|>  a = make_google( 10, make_int(100) ) ;
|>  b = google_mult( a, a ) ;
|>
|>At this point, the value of `b' could be expressed as
|>
|>  make_google( 10, make_google( 10, make_int(10) ) ) ;
|>
|>Of course, using C++ would make certain aspects of this easier...

It seems that an accurate answer might take rather a long time...

On a connected note, I once wrote a  program to calculate 6^6^6.  My
first attempt actually calculated (6^6)^6 and ran fairly quickly; my
second attempt calculated 6^(6^6) and ran overnight on a VAX 11/780.
It did it by taking 6^6 as a constant and used variable length arithmetic
to multiply a variable-length number repeatedly by 6 that number of times.
The variable length arithmetic may not have been optimal, but it wasn't
too hard to write - I did it with each bunch of 3 digits held in an int
as part of a linked list - if I overflowed I simply added a new element
to the list.  The answer had around 40,000 digits in it, i.e. was close to
100^2 - if you want to calculate a 100-digit number raised to the power
of another 100-digit number, my guess is that you'll either run out of
space in the universe to store the answer, or you'll run out of time 
before the universe ends.

Lezz "no steady-state cosmology here" Giles
From: scotth@felix.filenet.com (Scott Hopson)
Newsgroups: comp.lang.c
Subject: Re: Routine to disable Ctrl-Alt-Del on PC
Date: 16 Aug 92 19:33:13 GMT
Reply-To: scotth@fritz.filenet.com (Scott Hopson)
Organization: FileNet Corp., Costa Mesa, CA

In article <1992Aug13.032504.8555@cs.uow.edu.au> u9035710@cs.uow.edu.au (Scott Anthony Barnett) writes:
>Help !!
>
>I am after a little routine (either in C or inline assembler) to simply
>disable the Ctrl-Alt-Del interrupt on an IBM PC.
>
>I am using Borland C++ v 3.0 (in standard ANSI C).
>
>Also, I would like to disable Ctrl-Break.
>

The Ctrl-Alt-Del function is handled by the INT 9 keyboard interrupt.
To redirect this function you need to trap INT 9 and check for the
key combination while passing all others onto the orginal INT 9 handler.
If you are not familiar with DOS internals this could be quite difficult
to do. It is possible to do it in C but you will need some inline ASM code.
Disabling Ctrl-Break is a much easier task. In Turbo or Borland C there
is a function which allows you to trap Ctrl-Break and handle it anyway
you want.

The Big question now is: Do you want to disable these functions within
a particular program or do you want to disable it while at the DOS Prompt.
To do it from DOS you will need to run a TSR which throws another angle
into the approach you use.

I will look and see if I have any code to distribute that does this.
If you want some let me know. Maybe I'll post some code if I can find it.





-- 
Scott Hopson   (scotth@filenet.com)
From: davisonj@bnr.ca (John Davison)
Newsgroups: comp.lang.c
Subject: Re: Memory alignment of struct elements
Date: 17 Aug 92 19:15:43 GMT
Organization: Bell-Northern Research, Richardson, Tx.

In article <25533@dog.ee.lbl.gov> torek@horse.ee.lbl.gov (Chris Torek) writes:
>Some machines---like the ones I use---are physically
>incapable of accessing unaligned data.  (It causes a machine fault.)

        They can; they just can't access it directly.  Some copy-to-an-aligned-
chunk piece of code would be needed.  This extra code could (I think) be
restricted to only the places where it is needed by the addition of an
"byte_aligned" type qualifier.


-- 
NOTE: I CAN'T SEND/RECEIVE E-MAIL HERE!!!  Use --> davisonj@ecn.purdue.edu <--
      During (roughly) August 20-25, I will be in transit.  Please be patient.
      The opinions and other information contained herein are not necessarily
      representative of Northern Telecom or any of its subsidiaries.
From: dave@cs.arizona.edu (Dave Schaumann)
Newsgroups: comp.lang.c
Subject: Re: Sorry, but...
Date: 17 Aug 92 16:54:00 GMT
Reply-To: dave@cs.arizona.edu (Dave Schaumann)
Distribution: usa
Organization: University of Arizona

In article <1992Aug17.011508.12238@crash>, jott@crash (Joan Tine) writes:
>
>I've waited, read the FAQ, and tried not to trouble the newsgroup, but
>I don't seem to be able to find any information about the National
>Obfuscated C Contest, such as: where are the results posted, when 
>each year do they come out, and what newsgroup carries them?

>I've only got one year's entries, and they were wonderful.  I'd like
>to complete my collection of them

The winners from 1984 to 1991 are available at ftp.uu.net:pub/ioccc.
You can read the `rules' file to answer the rest of your questions.

-- 
The safety of the Enterprise is of Paramount importance.
						-J. L. Picard
Newsgroups: comp.lang.c
From: steve@taumet.com (Steve Clamage)
Subject: Re: Pointer/address r 2/2
Organization: TauMetric Corporation
Distribution: na
Date: Sun, 23 Aug 1992 15:24:25 GMT

ted.jensen@spacebbs.com (Ted Jensen)  writes:

>Thus I think that by virtue of the fact that we have two
>different words for describing the a variable type (pointer) and
>the contents stored in such a variable type (address) a
>description of what is actually taking place when using pointers
>_can_, in a sense, be made clearer than when using integers or
>floats.

"Pointer" is a C language concept independent of any machine, and
"address" (as usually used) is a machine feature.

If you want to talk about C programming, it usually just confuses
the issue when you delve into the low-level details of individual
compilers or machines.  It depends on whether you want to discuss
how to copy C strings, or about how to cause a particular machine
to behave in a particular way.

Finally, a pointer variable need not contain a machine address.  It
might contain more than an address, as on capability architectures,
or less than an address, as on some segmented architectures, or something
which only describes an address, as when part of the pointer is an index
into a table of segments or addresses.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: mwilson@ncratl.AtlantaGA.NCR.COM (Mark Wilson)
Newsgroups: comp.lang.c
Subject: Re: About the 'F' in RTFM
Date: 13 Aug 92 21:19:00 GMT
Organization: NCR Engineering and Manufacturing Atlanta -- Atlanta, GA

>For the record: I too have an AT&T manual.  There is no index.  The machine
>which I do a great deal of work on has no man pages.  This sucks.
>David is right.

For the record: I too have an AT&T manual.  There is an index.  Just for
the record I am only familiar with SVR4, I don't know about the previous
releases.

There is no index for each book, there is instead a seperate book, the
permutated index that covers the entire series.

If you can't find the permutated index, then you're dead meat.

BTW, don't try to learn how to use the index on your own, you might hurt
yourself.  I have been using it for 6 months now and I still consider
myself an amateur.

>C Frog
-- 
--Mark

Newsgroups: comp.lang.c
From: tim@shovel.Prime.COM (Tim Cantin)
Subject: Re: Using ANSI.SYS codes from C?  (Turbo)
Followup-To: comp.lang.c
Keywords: ansi.sys
Organization: Prime Computer R&D
Date: Tue, 18 Aug 1992 15:13:56 GMT

In article <1992Aug18.013912.12547@cs.umb.edu>, cteague@ra.cs.umb.edu (Charles F. Teague II) writes:

> Is there any way to use ANSI.SYS escape sequences from C?

In article <josef.714123379@uranium>, josef@nixpbe.sni.de (Moellers) writes:

> I've never tried this, but something like
> 	printf("\033[3mText\033[0m");
> should do something to Your "Text".

Charles, Josef hit it right on the head. The only catches are that you MUST
have ansi.sys loaded in your \config.sys file, and you cannot use conio.h
functions with ANSI codes. When you send ANSI codes through cprintf() they are
printed literally.

Here are some codes off the top of my head: (I know you didn't ask for them,
but someone else might want to know) (btw, 'esc' below is hex33, the ESC char.)

ANSI		output
code		results
----		-------
esc[0m		normal (no attributes, default)
esc[1m		high intensity (the default for some, i.e. Prime terminals)
esc[2m		low intensity (in some environments, i.e. Prime terminals)
esc[4m		underlined
esc[5m		blinking
esc[7m		reverse

esc[r;cH	position cursor to r,c
esc[2J		clear screen (may differ for some terminals, Prime PT200 is esc?)

esc[xm		set color x where colors are:
		foreground:	background:
		30 black	40 black
		31 		41 
		32 		42 
		33 		43 
		34 		44 
		35 		45 
		36 		46 
		37 		47 
		38 		48 
		39 		49 

		^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^___darn, I can't remember them!
						it's the same as the resistor
						code table if you know that! :)~

You can also combine 'm' attributes by seperating them with a semi-colon:

	printf("\033[4;5m***This is underlined and blinking***\033[0m\n");

Have fun!
-Tim

p.s.
	If anyone knows those color codes, feel free to post them! *grin*

-- 
#include "stddisclaimer.h"
/* Tim Cantin          {uunet, csnet-relay}!primerd!tim || tim@s35.prime.com
   Prime Computer Inc. 10-21, 500 Old Conn. Path, Framingham, MA 01701 (USA) */
flames > /dev/null 2>&1
From: scotth@felix.filenet.com (Scott Hopson)
Newsgroups: comp.lang.c
Subject: Re: Borland using MSC libs
Keywords: libs obj borland bcc msc
Date: 15 Aug 92 19:48:47 GMT
Reply-To: scotth@fritz.filenet.com (Scott Hopson)
Distribution: comp.lang.c
Organization: FileNet Corp., Costa Mesa, CA

In article <1992Aug13.182240.15939@tamsun.tamu.edu> miller@eemips.tamu.edu (Kelly M Miller) writes:
>
>Is it possible to link in libs created under MSC 5.0
>into a Borland C app? What must I include in the link?
>the MSC libs? Must I exclude some of the Borland libs?
>

The answer is a big NO, although it might work for some functions
Borland does not support linking of MSC Libs.

The basic reason is that when building the libraries there are these little
things called "Help Functions" which are used to load and align the lib
fuctions. Borland and Microsoft both use different methods.


There may be other reasons also but the is the primary reason I got from
a Borland support person.


-- 
Scott Hopson   (scotth@filenet.com)
From: jos@and.nl (Jos Horsmeier)
Newsgroups: comp.lang.c
Subject: Re: general tree
Date: 13 Aug 92 08:01:57 GMT
Organization: AND Software BV Rotterdam

In article <1992Aug11.200208.19716@infonode.ingr.com> dpm@wizard.b29.ingr.com (David Mikesell) writes:

|I am beginning work on a C program that will manipulate a general tree, i.e.
|a tree in which each node can have an arbitrary number of children.  An ex-
|ample declaration of the structure follows:

[ data structure deleted ... ]

|problem
|-------
|
|My problem is in initializing the structure.  Algorithms I have seen for 
|building binary trees from a file or array do not appear to me to be easily
|adaptible to the general case, so I am looking for some ideas on how to get
|this accomplished.  Perhaps there is a better implementation of a general tree
|that would make this easier...any ideas will be greatly appreciated.  Thanks,

You can easily adapt these binary tree algorithms to the general case,
because every tree can be represented as a binary tree. As an example
consider the following tree:

	R(A(E F G) B(H) C(I J K) D(L M))

It reads: R is the root with 4 children (A, B, C and D), A has three
children (E, F and G) etc.

This tree can be converted as follows:

- the left pointer of a node points to a list containing the children
  of the node.

- the right pointer points to the next node at the same level (siblings).

The tree would look something like this:

	R
	|
	A-----B-----C-----D
	|     |     |     |
	E-F-G H     I-J-K L-M

Well, at least it looks like a binary tree to me ;-)

Throwing in some grammar stuff might help implementing the initialization
of such a tree:

Tree 		-> Node Children

Children	-> ( Tree NextChild
		-> /* nothing */

NextChild	-> Tree NextChild
		-> )

Directly from this small grammar, the following (heavily recursive)
functions can be derived:

---------------------------------------------------------------------------
NODE *Tree() {

NODE *Root= Node();			/* Read current node */

Root->Left=  Children();		/* Link the list of kids */
Root->Right= NULL;			/* All alone at the top level */

return Root;

} /* Tree */

NODE *Children() {

NODE *Node= NULL;			/* Assume no kids */

if (has_children()) {			/* Some appropriate predicate */
	Node= Tree();			/* Read the first child */
	Node->Right= NextChild();	/* Link the siblings */
}

return Node;

} /* Children */

NODE *NextChild() {

NODE *Node= NULL;			/* Assume no sibblings */

if (has_sibblings()) {			/* Some appropriate predicate */
	Node= Tree();			/* Get first sibling */
	Node->Right= NextChild();	/* Link the others */
}

return Node;

} /* NextChild */
---------------------------------------------------------------------------

Note that a lot of tail recursion can be removed by using an iteration
(a while loop) instead.

I hope this is of any help to you,

kind regards,

Jos aka jos@and.nl
Newsgroups: comp.lang.c
From: markh@csd4.csd.uwm.edu (Hunk)
Subject: Re: generic interpreter
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Date: Mon, 17 Aug 1992 17:38:32 GMT

In article <DAVIS.92Aug17105356@pacific.mps.ohio-state.edu> davis@amy.tch.harvard.edu  (John E. Davis) writes:
>Hi,
>
>   I am looking for an extensible interpreter (preferably in C).

A recent issue of Dr. Dobb's Magazine had a listing for one.  All listings
from that magazine can be found in /msdos/ddjmag on SIMTEL.  I also temporarily
put a copy of the interpreter at the ftp site csd4.csd.uwm.edu in the
directory /pub.  It is named Interp.
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c
Subject: Re: Byte Order Question
Date: 20 Aug 1992 15:27:23 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1992Aug20.131614.23729@bnrmtl.bnr.ca> bnrmtl!john@larry.mcrcim.mcgill.edu writes:
>My suspicion is that the result of the shift of a positive number could depend
>on whether the byte order is big or little endian.  Is my suspicion correct?

No.  The shift operators are defined on the abstract numerical value, and
aren't implementation-dependent.  A right shift always shifts from the high
order byte to the low order byte, no matter what the byte order is.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.c
From: dylan@ibmpcug.co.uk (Matthew Farwell)
Subject: Re: Allocate memory to typed in string, How?
Organization: The IBM PC User Group, UK.
Date: Sun, 16 Aug 1992 14:13:54 GMT

In article <1992Aug15.201359.3601@athena.mit.edu> scs@adam.mit.edu (Steve Summit) writes:
>P.S.  Please, don't anyone get too steamed if it seems like I'm
>      branding you as "too lazy and/or stupid to do any better."
>      I frequently write little throwaway utilities with
>      arbitrary limits, because I'm lazy, too.  You can perform a
>      cost/benefit analysis which may show that it's not
>      worthwhile to accept arbitrarily-large inputs: in a way,
>      that's just institutionalized laziness, but if the analysis
>      is accurate and well-founded it may well be perfectly
>      reasonable and nothing to be ashamed of.

I submit that it is very easy to write code which does not have line
length limits.  To take the example of:

	char buf[512];

	while (fgets(buf, sizeof buf, stdin)) {
		/* do something with buf */
	}

This is very easy to translate, all you need is something like fgetmfs
from the c-news distribution..., ie

#define fgetms(fp) fgetmfs(fp, -1, CONT_NO)	/* unbounded read */

	char *buf;

	while (buf = fgetms(stdin)) {
		/* do something with buf */
	}

This one small change does wonders.  All you need to take the time to do
is get & compile fgetmfs, and shove it into a library somewhere.

Dylan.
Newsgroups: comp.lang.c,comp.lang.c++
From: sdarbha@ho08.eng.ua.edu (Subrahmanyam Darbha)
Subject: Problem with linked lists
Originator: sdarbha@ho08.eng.ua.edu
Organization: The University of Alabama, Tuscaloosa
Julieline: see if this comes up.
Date: Thu, 20 Aug 1992 15:01:31 GMT

I have a problem with making a three dimensional linked list
Because I have to have a capability to expand the three dimensions to the       following limits [1000][1000][4]
I can not directly declare pointers to all these elements because of the memory limitations..
That is why I am having to use linked lists.
For two-dimensional list I do the following
struct array {
Int ycoord;
int val;
struct array *next;
}

Now I declare struct array *M[1000] this gives me the X-coordinate
and the Ycoord gives me the Y-coordinate
I have trouble expanding this to a three-dimensional list because I think
it needs to be written with three *** in that case.

Any help in this is highly appreciated
Thanks much

Subrahmanyam. 

-- 
*************************** Who else But Darbha ******************************* 
sdarbha@buster.eng.ua.edu     Res: (205) 349 - 5143   Off: (205) 348 - 9289
*******************************************************************************
Newsgroups: comp.lang.c,comp.programming
From: boyd@prl.dec.com (Boyd Roberts)
Subject: Re: A LITTLE BRAINTEASER...
Organization: Digital Equipment Corporation - Paris Research Laboratory
Date: Sat, 15 Aug 1992 15:15:30 GMT

In article <josef.713800013@uranium>, Josef Moellers <mollers.pad@sni.de> writes:
> 
> It'll run perfectly on systems that have signed characters!
> EOF usually is -1, so '\377' will expand to -1.
> 

Nonsense.  On input containing '\377' it will terminate prematurely.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Xref: sparky comp.lang.c:12413 comp.programming:2350
From: chuckb@milton.u.washington.edu (Chuck Bass)
Newsgroups: comp.lang.c,comp.programming
Subject: Re: Allocate memory to typed in string, How?
Date: 17 Aug 92 06:46:34 GMT
Article-I.D.: milton.chuckb.714033994
Organization: University of Washington

I've been programming for a couple of years now and I must say
that at first I though all of this BS about not using buffers
that "should be plenty big" was just that.  A bunch of anal
perfections with nothing better to do than flame others coding
practices.

Now I've been bit by failed assumptions that occur when source
is modified and now that routine that assumes a NULL ptr can
never be passed is.  Well people, listen to what these guys are
saying.  Program defensively and you will have robust code that
won't break (as much ;-)  I thought I was smart enough to write
code that didn't require things like Assert or Assure (as
recently posted here in comp.lang.c) Now I've realized that I'm
at the point that I'm smart enough to use the Assert and Assure
macros.

Just a word of experience from someone with almost no
experience.  Anyway writing programs is a lot more fun that
debugging them!

Chuck Bass
Cooperative for Forest-Systems Engineering

PS  for some reason I always agree with Mr. Summit!
Newsgroups: comp.lang.c
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Re: AFS calls from C code
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Wed, 19 Aug 1992 04:41:38 GMT

Not sure how to get mail to you, so I'll post.

Gonzalo Diethelm writes:
>
>Does anybody know how to have AFS-like functionality in your
>C code? Pipes or system() is not acceptable. For example,
>how would you implement a function like:
>
>int klog(char *username, char *password)
>/*
> * Same thing as the Kerberos klog utility.
> */
>
>but without opening a pipe and actually executing the program
>in /usr/afs/bin/klog?

Take a look in /afs/transarc.com/public/afs-contrib/tools/reauth

(BTW, this was not really a C question, but it would have been 
good for the AFS mailing list)

Haven't seen the man pages for the afs library functions, myself.
Are they out there for perusal on afs somewhere?  (oops.  not
a C question, either :-)

Brian
From: richw@inmet.camb.inmet.com
Date: 12 Aug 1992 10:48 EDT
Newsgroups: comp.lang.c
Subject: Re: Computer terms, etc
Message-ID: <20900024@inmet>