Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Message forJack Klein - please read

2 views
Skip to first unread message

Brad

unread,
Jun 18, 2001, 11:25:44 AM6/18/01
to
From Jack: Did you or did you not see the several responses to
that post telling you that there was no such thing as a default
printer, or any printer
at all, in the C language?

Obviously you know very little about the C language. Not only can C
read a printer but you can also set the default printer through C
using the SetDefaultPrinter(). You made an ass out of yourself and the
rest of your fudge packing friends who responded to his post. Hey
Jack, who is the dense one now? I suggest this Jack. Don't take your
anger out on a person who wrote a legit question in the proper group
because your Penis hasn't gotten wet since the ice age....

Richard Bos

unread,
Jun 18, 2001, 11:23:24 AM6/18/01
to
shawn...@aol.com (Brad) wrote:

> Obviously you know very little about the C language. Not only can C
> read a printer but you can also set the default printer through C
> using the SetDefaultPrinter().

And where, in the ISO C Standard, is this SetDefaultPrinter() function
defined, Grasshopper?

Read and learn.

Richard

Mark A. Odell

unread,
Jun 18, 2001, 11:41:08 AM6/18/01
to
shawn...@aol.com (Brad) wrote in news:31b38465.0106180725.7762233
@posting.google.com:

> From Jack: Did you or did you not see the several responses to
> that post telling you that there was no such thing as a default
> printer, or any printer
> at all, in the C language?
>
> Obviously you know very little about the C language. Not only can C
> read a printer but you can also set the default printer through C
> using the SetDefaultPrinter().

My ISO C implementation for the embedded PowerPC has no such function in the
supplied standard C library. Nor does my ISO C implementation for the 8-bit
8051. So, this is not an ISO C function. You are off-topic.

> You made an ass out of yourself and the
> rest of your fudge packing friends who responded to his post. Hey
> Jack, who is the dense one now? I suggest this Jack. Don't take your
> anger out on a person who wrote a legit question in the proper group
> because your Penis hasn't gotten wet since the ice age....

Nice mouth, not very nice, nor professional.

--
Warmest regards.

Optimize only if it runs too slowly or does not fit, spaces instead of tabs.

Joona I Palaste

unread,
Jun 18, 2001, 11:55:35 AM6/18/01
to
Brad <shawn...@aol.com> scribbled the following:

Hello Asshole,

Obviously you:
1) Haven't been on this newsgroup for very long,
2) Don't know squat about C, and
3) Wouldn't know good manners if they sat on you and said "'ave a
banana, will you, bloke?".

If you had a half-working braincell in the entire foul-smelling
contraption you have the nerve to call your body, you would have
long since recognised that C is an ISO-standardised, portable,
low-level programming language and not a Microsoft Windows product
like Windows, Office or Explorer.
There exist many C implementations (for OS/2, Macintosh, Linux,
Solaris, etc...) that have not had, do not have, and will not have
a function called SetDefaultPrinter. It is purely a Microsoft
extension and does not deserve to be called a C function.

As if this wasn't bad enough, you somehow think you are so high-
and-mighty that you can insult established regulars on comp.lang.c
(such as Jack Klein) simply because they say things YOU don't know.
Insulting them when they are WRONG is barely tolerable (they should
be corrected nicely), but insulting them when they are RIGHT (such
as in this case) is downright unforgivable. If Jack Klein were to
shoot a double-barreled shotgun at your head at this very instant,
I would think you got off too lightly.

As for your final comment, the fact that you think a man's penis is
the be-all and end-all of your entire life, makes it apparent what
little remains of your cognitive functions has migrated from your
brain to your genitalia. You are truly a waste of protoplasm, and
this is putting it lightly.

Sheesh, I should stop being so nice... I let this guy off way too
easily. Come on, other comp.lang.c readers, give him the full roasting
he requires.

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"That's no raisin - it's an ALIEN!"
- Tourist in MTV's Oddities

Chris Van Extergem

unread,
Jun 18, 2001, 1:02:15 PM6/18/01
to
"Brad" <shawn...@aol.com> wrote in message
news:31b38465.0106...@posting.google.com...

<snipped insulting post>

Not wanting to disobeye much respected regulars <g>, here's my contribution
:

Hey, dickhead, put your nogood fat and ugly head back in your arse where it
belongs and leave us alone, you worthless excuse for a primate.

Phew, that felt good :)

To get this post on topic : how would I write a program that would generate
random insulting sentences like the one above given some arrays with nouns,
verbs and adverbs ?

HTH,

Chris

God gave man a brain and a penis. Unfortunately he didn't provide us with
enough blood to operate both of them at the same time.


Richard Heathfield

unread,
Jun 18, 2001, 12:15:59 PM6/18/01
to
Brad wrote:
>
> From Jack: Did you or did you not see the several responses to
> that post telling you that there was no such thing as a default
> printer, or any printer
> at all, in the C language?
>
> Obviously you know very little about the C language.

Mr Klein knows a lot more about the C language than you realise, and you
don't know C as well as you thought you did.

> Not only can C
> read a printer but you can also set the default printer through C
> using the SetDefaultPrinter().

C is such an important language that many operating system suppliers
provide C interfaces to libraries which perform
operating-system-specific tasks such as driving printers. That does not
mean, however, that C itself provides this functionality. The C language
standard, ISO/IEC 9899:1999, does not include the function
SetDefaultPrinter() in the definition of the standard library. IMHO you
owe Mr Klein an apology.

<snip childish tantrum>

--
Richard Heathfield : bin...@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


Martin Ambuhl

unread,
Jun 18, 2001, 1:20:00 PM6/18/01
to
Chris Van Extergem wrote:
>
> "Brad" <shawn...@aol.com> wrote in message
> news:31b38465.0106...@posting.google.com...
>
> <snipped insulting post>
>
> Not wanting to disobeye much respected regulars <g>, here's my contribution
> :
>
> Hey, dickhead, put your nogood fat and ugly head back in your arse where it
> belongs and leave us alone, you worthless excuse for a primate.
>
> Phew, that felt good :)
>
> To get this post on topic : how would I write a program that would generate
> random insulting sentences like the one above given some arrays with nouns,
> verbs and adverbs ?

The MSVC++ absolutely standard function
Cstring GenerateRandomInsultingSentences(Cstring *nouns,
Cstring *verbs, Cstring *adverbs);
The <MSVC++AbsoultelyStandard.h> header contains standard
noun, verb, and adverb lists (along with other parts of
speech). It may be augmented with data from the
<MSEncartaCrappyDisctionary.h> functions.

Dann Corbit

unread,
Jun 18, 2001, 1:52:41 PM6/18/01
to
From: Dann Corbit
Sent: Monday, June 18, 2001 10:49 AM
To: 'ab...@aol.com'
Cc: 'tosu...@aol.com'; 'tosge...@aol.com'; 'tos...@aol.com';
'tos...@aol.com'
Subject: shawn...@aol.com is posting libelous crap to news:comp.lang.c

Take immediate action.
<<attachment:Message forJack Klein - please read>>
--
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
"The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. FAQ: ftp://cap.connx.com/pub/Chess%20Analysis%20Project%20FAQ.htm


Joona I Palaste

unread,
Jun 18, 2001, 3:07:18 PM6/18/01
to
Dann Corbit <dco...@solutionsiq.com> scribbled the following:

> From: Dann Corbit
> Sent: Monday, June 18, 2001 10:49 AM
> To: 'ab...@aol.com'
> Cc: 'tosu...@aol.com'; 'tosge...@aol.com'; 'tos...@aol.com';
> 'tos...@aol.com'
> Subject: shawn...@aol.com is posting libelous crap to news:comp.lang.c

> Take immediate action.
> <<attachment:Message forJack Klein - please read>>

Libelous crap? LIBELOUS CRAP? Calling shawn...@aol.com's posting
"libelous crap" is like calling the Pacific Ocean "a little puddle"!

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"The truth is out there, man! Way out there!"
- Professor Ashfield

Tor Rustad

unread,
Jun 18, 2001, 2:52:49 PM6/18/01
to
"Brad" <shawn...@aol.com> wrote in message
> From Jack: Did you or did you not see the several responses to
> that post telling you that there was no such thing as a default
> printer, or any printer
> at all, in the C language?
>
> Obviously you know very little about the C language.

LOL. You obviously don't know what a complete fool you just made of
yourself....

> Not only can C
> read a printer but you can also set the default printer through C
> using the SetDefaultPrinter().

Nonsense, there is no such function in the standard C library. You don't
have a clue about C or c.l.c.

> You made an ass out of yourself and the
> rest of your fudge packing friends who responded to his post. Hey
> Jack, who is the dense one now? I suggest this Jack. Don't take your
> anger out on a person who wrote a legit question in the proper group
> because your Penis hasn't gotten wet since the ice age....

*PLONK*

--
Tor <torust AT online DOT no>
http://www.eskimo.com/~scs/C-faq/top.html

Eric Sosman

unread,
Jun 18, 2001, 4:24:21 PM6/18/01
to
Joona I Palaste wrote:
>
> Dann Corbit <dco...@solutionsiq.com> scribbled the following:
> > From: Dann Corbit
> > Subject: shawn...@aol.com is posting libelous crap to news:comp.lang.c
>
> > Take immediate action.
> > <<attachment:Message forJack Klein - please read>>
>
> Libelous crap? LIBELOUS CRAP? Calling shawn...@aol.com's posting
> "libelous crap" is like calling the Pacific Ocean "a little puddle"!

Please, children, can we just drop this? Imitation is the
sincerest form of flattery.

--
Eric....@sun.com

Kaz Kylheku

unread,
Jun 18, 2001, 5:33:52 PM6/18/01
to
On 18 Jun 2001 08:25:44 -0700, Brad <shawn...@aol.com> wrote:
>From Jack: Did you or did you not see the several responses to
>that post telling you that there was no such thing as a default
>printer, or any printer
>at all, in the C language?
>
>Obviously you know very little about the C language. Not only can C
>read a printer but you can also set the default printer through C
>using the SetDefaultPrinter().

This function is in the Windows programming interface, not in the C language.
The C language existed long before Windows, is currently used to program
platforms other than Windows, and will exist long after Windows.

386sx

unread,
Jun 18, 2001, 5:44:24 PM6/18/01
to
shawn...@aol.com (Brad) wrote:

> because blah blah blah....

From 386: Did you or did you not see the several responses to your
post telling you to go pack some fudge? If you want to change attitudes
you're going about it the wrong way. Or maybe you just want to make an ass
out of yourself?

--
386

clc FAQ:
http://www.eskimo.com/~scs/C-faq/top.html

David Rubin

unread,
Jun 18, 2001, 5:43:15 PM6/18/01
to
Chris Van Extergem wrote:

> To get this post on topic : how would I write a program that would generate
> random insulting sentences like the one above given some arrays with nouns,
> verbs and adverbs ?

Take a look at Programming Perls 2ed by Jon Bentley or The Practice of
Programming by Kernighan and Pike. Both explain the implementation of a program
wich generates random sentences given an input text using a technique called
Markov chains. I think that you will find just what you are looking for here...

david

--
If 91 were prime, it would be a counterexample to your conjecture.
-- Bruce Wheeler

Micah Cowan

unread,
Jun 18, 2001, 5:48:27 PM6/18/01
to
shawn...@aol.com (Brad) writes:

Do you have *ANY* idea who you're flaming here, or how much of an
asshole you just made of yourself, buddy?

When he says there is no such thing as SetDefaultPrinter() in C (which
there isn't), or that C doesn't know anything about printers, he damn
well knows what he's talking about.

I find it highly satisfying to know that this incredibly,
mind-numbingly stupid remark (complete with utter lack of context,
proving you know as little about USENET as you do about C) will be
archived and kept on permanent record for everyone to see what
blooming idiot you are.

If Walnut Creek releases a comp.lang.c archive including this, I'm
getting it, just so I can go into spasmatic fits of uncontrollable
laughter everytime I read it.

And posted with an AOL address, no less. ROTFL hysterically.

Micah

Micah Cowan

unread,
Jun 18, 2001, 5:51:05 PM6/18/01
to
"Tor Rustad" <tor...@online.no.spam> writes:

> > You made an ass out of yourself and the
> > rest of your fudge packing friends who responded to his post. Hey
> > Jack, who is the dense one now? I suggest this Jack. Don't take your
> > anger out on a person who wrote a legit question in the proper group
> > because your Penis hasn't gotten wet since the ice age....
>
> *PLONK*

Why bother? Since his account will ceratinly be terminated
*yesterday*, doesn't it seem like a waste of precious killfile?

Micah

Des Walker

unread,
Jun 18, 2001, 3:50:44 PM6/18/01
to

Brad <shawn...@aol.com> wrote in message
news:31b38465.0106...@posting.google.com...

Somehow I feel this post was just sent to elicit responses for some
perverse entertainment.
However you can find out what is in ANSI C for a mere $18 by purchasing
your very own copy of the C99 standard via the ANSI website. I picked up
a copy by using the reference posted by Mr Jack Klein. 'nuff said.

Des Walker

Parinioa

unread,
Jun 18, 2001, 8:56:47 PM6/18/01
to

> any printer at all, in the C language?

Just to add a touch of sanity and decency to this well broiled topic I would
like to point out that though C has no standard function for controling the
printer one can be very simply written (Thus providing a function) even if
it isn't C standard you can use a printer using the C language.

viod printchar(char c)
{
union REGS regs;
regs.h.ah=0x00; /*Print Character function*/
regs.h.al=c; /*Character to Print*/
regs.x.dx=0x00; /*Print using LPT1
int86(PRINTER,&regs,&regs);
}

please note that this is predominately Windows code and I do not know if it
can be easily ported (if at all) I found it in "C For Dummies: Volume 2"
which is great for beginers though it seriouly stresses DOS programming.

Brad

unread,
Jun 18, 2001, 11:05:26 PM6/18/01
to
Hey Jack, your mom gived good head.

Paul D. Boyle

unread,
Jun 18, 2001, 1:09:11 PM6/18/01
to
Brad (shawn...@aol.com) wrote:
: From Jack: Did you or did you not see the several responses to

Wow, while many clueless people post to comp.lang.c, it relatively
uncommon for a person such as this who makes a complete idiot of himself
in an international technical forum such as comp.lang.c. This guy is
almost of Nuddsian magnitude in his ignorance. This bright star, Brad
(shawn...@aol.com), shines brightly among the other luminaries of this
group like G.MOORE, ALC, and, of course, KaRL MalBrain.

If Brad only knew Jack Klein' true programming acumen, he could go back
and cringe at what he wrote in this post. Let's leave to do a web search
on "Jack Klein" and leave him to his solitary horror when he finds the
URL to Jack fine web page.

Paul

--
Paul D. Boyle
bo...@laue.chem.ncsu.edu
North Carolina State University
http://laue.chem.ncsu.edu/web/xray.welcome.html

Zoran Cutura

unread,
Jun 19, 2001, 1:08:32 AM6/19/01
to
Once upon a while "Parinioa" <Pari...@hotmail.com> wrote:

>> any printer at all, in the C language?
>
> Just to add a touch of sanity and decency to this well broiled
> topic I would like to point out that though C has no standard
> function for controling the printer one can be very simply
> written (Thus providing a function) even if it isn't C standard
> you can use a printer using the C language.
>
> viod printchar(char c)
> {
> union REGS regs;
> regs.h.ah=0x00; /*Print Character function*/ regs.h.al=c;
> /*Character to Print*/ regs.x.dx=0x00; /*Print using
> LPT1 int86(PRINTER,&regs,&regs);
> }
>
> please note that this is predominately Windows code and I do
> not know if it can be easily ported (if at all) I found it in

This crap is absolutly unportable,as you may have noticed, there
exists a whole lot of more plattforms, operating systems and
implementations of the C language than the author of a book
called

> "C For Dummies: Volume 2"

probably can ever think of.

> which is great for beginers though it
> seriouly stresses DOS programming.

Which is not C programming by the means of ANSI.
--
Z (Zoran....@daimlerchrysler.com)
"LISP is worth learning for the profound enlightenment experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days." -- Eric S. Raymond

Arthur H. Gold

unread,
Jun 18, 2001, 10:32:05 PM6/18/01
to
Parinioa wrote:
>
> > any printer at all, in the C language?
>
> Just to add a touch of sanity and decency to this well broiled topic I would
> like to point out that though C has no standard function for controling the
> printer one can be very simply written (Thus providing a function) even if
> it isn't C standard you can use a printer using the C language.
Unfortunately...WRONG.
This makes use of a system specific extension. The C language itself has
no concept of printers whatever.

>
> viod printchar(char c)
> {
> union REGS regs;
> regs.h.ah=0x00; /*Print Character function*/
> regs.h.al=c; /*Character to Print*/
> regs.x.dx=0x00; /*Print using LPT1
> int86(PRINTER,&regs,&regs);
> }
>
> please note that this is predominately Windows code and I do not know if it
> can be easily ported (if at all) I found it in "C For Dummies: Volume 2"
> which is great for beginers though it seriouly stresses DOS programming.
Which therefore makes it unsuitable for learning ISO/ANSI standard C.

--ag

--
Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info)
mailto:ag...@bga.com or mailto:ag...@cs.utexas.edu
--
I am looking for work. Contact me.

Dave Vandervies

unread,
Jun 19, 2001, 1:13:38 AM6/19/01
to
In article <unxX6.13914$9r1.1...@e3500-atl1.usenetserver.com>,

Parinioa <Pari...@hotmail.com> wrote:
>
>Just to add a touch of sanity and decency to this well broiled topic I would
>like to point out that though C has no standard function for controling the
>printer one can be very simply written (Thus providing a function) even if
>it isn't C standard you can use a printer using the C language.
>
>viod printchar(char c)
>{
>union REGS regs;
>regs.h.ah=0x00; /*Print Character function*/
>regs.h.al=c; /*Character to Print*/
>regs.x.dx=0x00; /*Print using LPT1
>int86(PRINTER,&regs,&regs);
>}

You're joking, I hope.

Let's count the ways this is wrong:
-Syntactically incorrect (easily fixed by closing a comment)
-No standard header defines the type viod, and you don't provide a
definition for it
-No standard header defines union REGS, and you don't provide a
definition for it
-No standard header defines the function int86, and you don't provide a
definition for it
-No standard header defines the identifier PRINTER, and you don't
provide a definition for it.
-A declared as returning something other than void falls off the end
without returning a value
-The [lack of] indentation makes any nontrivially sized chunk of code
unreadable

That's where I had to stop and look for more... anybody else see
something I missed?


>please note that this is predominately Windows code

I have trouble believing that; it looks too DOSish to run even under
Windows to me.

> and I do not know if it
>can be easily ported (if at all)

Then why did you bother posting it to a newsgroup that deals with a
portable platform-independent language?

> I found it in "C For Dummies: Volume 2"
>which is great for beginers though it seriouly stresses DOS programming.

I'm sure I've seen that title somewhere...
<grepgrepgrep>
Ahh, yes, that one. The only book I've ever seen get bad reviews both
on content and on the author's attitude in three different newsgroups,
all populated by (mostly) highly knowledgeable and competent people.

Yes, that could explain it.


dave

--
Dave Vandervies dj3v...@student.math.uwaterloo.ca

Because your book was written by an idiot. You can recover some of its cost by
converting it to heat. --Kaz Kylheku in comp.lang.c

Joona I Palaste

unread,
Jun 19, 2001, 2:55:52 AM6/19/01
to
Brad <shawn...@aol.com> scribbled the following:
> Hey Jack, your mom gived good head.

Apparently you have failed to follow our advice to kill yourself as
quickly as possible. I'm not sure if you're old enough to buy firearms,
and I'm not sure you know where your family keeps the dangerous
substances, but there are other ways. Do you have a good, strong rope?
That might come in handy, providing you have some trees growing in your
yard. Or just put your face under the water for a very long time.
Running in the front of a moving bus sometimes works, but not always.
There is a good chance the driver will notice you and stop the bus
before you succeed. You have to explain something like "No, it's
alright, I'm the lowest form of scum and deserve to die slowly and
painfully". The more humane bus driver (humane to us, at least, if not
to you) should understand.

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"A bee could, in effect, gather its junk. Llamas (no poor quadripeds) tune
and vow excitedly zooming."
- JIPsoft

Dik T. Winter

unread,
Jun 19, 2001, 5:58:00 AM6/19/01
to
In article <ruqX6.42814$mR5.5...@afrodite.telenet-ops.be> "Chris Van Extergem" <chri...@pandora.be> writes:
...

> To get this post on topic : how would I write a program that would generate
> random insulting sentences like the one above given some arrays with nouns,
> verbs and adverbs ?

Somewhere in the comp.sources.games archives there is a program called
'insult'. This will nicely do what you wish, but beware, it predates
ISO C.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/

Dik T. Winter

unread,
Jun 19, 2001, 6:02:56 AM6/19/01
to
In article <unxX6.13914$9r1.1...@e3500-atl1.usenetserver.com> "Parinioa" <Pari...@hotmail.com> writes:
...

> regs.h.ah=0x00; /*Print Character function*/
> regs.h.al=c; /*Character to Print*/
> regs.x.dx=0x00; /*Print using LPT1
> int86(PRINTER,&regs,&regs);
>
> please note that this is predominately Windows code and I do not know if it
> can be easily ported (if at all)

I know. It can not be ported to the systems I work on. On those systems
you can not change the default printer with a program.

Tim Robinson

unread,
Jun 19, 2001, 8:53:32 AM6/19/01
to
"Parinioa" <Pari...@hotmail.com> wrote in message
news:unxX6.13914$9r1.1...@e3500-atl1.usenetserver.com...

> please note that this is predominately Windows code and I do not know if
it
> can be easily ported (if at all) I found it in "C For Dummies: Volume 2"
> which is great for beginers though it seriouly stresses DOS programming.

This isn't even Windows code. If you put this code in your Windows program
(and actually got it to compile), it will crash and burn.


Joona I Palaste

unread,
Jun 19, 2001, 9:13:04 AM6/19/01
to
Parinioa <Pari...@hotmail.com> scribbled the following:

I suppose you have some kind of header so you can test this code
safely:

#ifndef PRINTER_H
#define PRINTER_H
#define viod void
union REGS {
union h h;
union x x;
};
union h {
int ah;
int al;
};
union x {
int dx;
};
void int86(char p, union REGS *regs, union REGS *regs) {
}
#define PRINTER 0x00
#endif

This still doesn't fix the missing */ on the last comment, but once
that's fixed, this header gets the code to compile.

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"This is a personnel commuter."
- Train driver in Scientific American

fred smith

unread,
Jun 19, 2001, 6:29:09 AM6/19/01
to
Parinioa <Pari...@hotmail.com> wrote:

: Just to add a touch of sanity and decency to this well broiled topic I would

Gee, I don't think that'll work on my Prime 50-series computer! (Or on my
Mac, or on my Yopy, or...)

--
---- Fred Smith -- fre...@fcshome.stoneham.ma.us ----------------------------
The eyes of the Lord are everywhere,
keeping watch on the wicked and the good.
----------------------------- Proverbs 15:3 (niv) -----------------------------

Joona I Palaste

unread,
Jun 19, 2001, 12:31:30 PM6/19/01
to
fred smith <fre...@fcshome.stoneham.ma.us> scribbled the following:
> Parinioa <Pari...@hotmail.com> wrote:

> : Just to add a touch of sanity and decency to this well broiled topic I would
> : like to point out that though C has no standard function for controling the
> : printer one can be very simply written (Thus providing a function) even if
> : it isn't C standard you can use a printer using the C language.

> : viod printchar(char c)
> : {
> : union REGS regs;
> : regs.h.ah=0x00; /*Print Character function*/
> : regs.h.al=c; /*Character to Print*/
> : regs.x.dx=0x00; /*Print using LPT1
> : int86(PRINTER,&regs,&regs);
> : }

> : please note that this is predominately Windows code and I do not know if it
> : can be easily ported (if at all) I found it in "C For Dummies: Volume 2"
> : which is great for beginers though it seriouly stresses DOS programming.

> Gee, I don't think that'll work on my Prime 50-series computer! (Or on my
> Mac, or on my Yopy, or...)

As said before, that code won't even work on Windows (despite what
Parinioa tries to claim). Windows has discontinued MS-DOS's way of
directly addressing anything made out of iron and/or silicon. Windows
uses API functions defined in <Windows.h>, which Parinioa's code
blatantly ignores.
Other than that, Parinioa's comment "This is predominately Windows code
and I do not know if it can be easily ported" is pretty much the same
thing as saying "humans are made of predominately organic matter and
I do not know if inorganic humans are easy to produce".

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"It's time, it's time, it's time to dump the slime!"
- Dr. Dante

Parinioa

unread,
Jun 19, 2001, 12:41:23 PM6/19/01
to
#include <stdio.h>
#include <conio.h>
#include <dos.h>

> >
> >viod printchar(char c)
> >{
> >union REGS regs;
> >regs.h.ah=0x00; /*Print Character function*/
> >regs.h.al=c; /*Character to Print*/
> >regs.x.dx=0x00; /*Print using LPT1*/
> >int86(PRINTER,&regs,&regs);
> >}
>

Now does that look better?

> You're joking, I hope.
>
> Let's count the ways this is wrong:
> -Syntactically incorrect (easily fixed by closing a comment)

Please don't tell me that you are God and have never made a typo.

> -No standard header defines the type viod, and you don't provide a
> definition for it
> -No standard header defines union REGS, and you don't provide a
> definition for it
> -No standard header defines the function int86, and you don't provide a
> definition for it
> -No standard header defines the identifier PRINTER, and you don't
> provide a definition for it.
> -A declared as returning something other than void falls off the end
> without returning a value
> -The [lack of] indentation makes any nontrivially sized chunk of code
> unreadable

As for tabs I see no need for them in such a small part where every
statement executes regardless of the others. why waste space putting a tab
at the begining? Indead I do use tabs quite rigourously when writting code
that needs them (even a lot that doesn't) but this code (minus the '>') is
quite readable in any monospaced font.

> That's where I had to stop and look for more... anybody else see
> something I missed?
>

I thought it was rather obvios that this code was not ment to be cut and
paste and whala it works, it was merely a demonstration of a point.


> >please note that this is predominately Windows code
>
> I have trouble believing that; it looks too DOSish to run even under
> Windows to me.
>
> > and I do not know if it
> >can be easily ported (if at all)
>
> Then why did you bother posting it to a newsgroup that deals with a
> portable platform-independent language?

I posted it it help, and included the disclamer (THIS IS DOS CODE) so that I
wouln't get flamed over it. Perhaps I was wrong about some of this group.

Parinioa

unread,
Jun 19, 2001, 12:43:06 PM6/19/01
to
> ...
> > regs.h.ah=0x00; /*Print Character function*/
> > regs.h.al=c; /*Character to Print*/
> > regs.x.dx=0x00; /*Print using LPT1
> > int86(PRINTER,&regs,&regs);
> >
> you can not change the default printer with a program.

Please note that this code does not use the 'Default' printer but sends its
data to LPT1, or what ever that port is called on your system.

Parinioa

unread,
Jun 19, 2001, 12:44:50 PM6/19/01
to
> > please note that this is predominately Windows code and I do not know if
> it
> > can be easily ported (if at all) I found it in "C For Dummies: Volume 2"
> > which is great for beginers though it seriouly stresses DOS programming.
>
> This isn't even Windows code. If you put this code in your Windows program
> (and actually got it to compile), it will crash and burn.

Pardon me I ment DOS code. However it will work in a DOS box in Windows (and
seeing that windows is based on dos I would think it would work anyway
though I am no expert on that point)

Parinioa

unread,
Jun 19, 2001, 12:47:34 PM6/19/01
to
Sorry that I missed this to
#define PRINTER 0x17 /*BIOS printer interupt*/

Parinioa

unread,
Jun 19, 2001, 12:50:39 PM6/19/01
to
> I suppose you have some kind of header so you can test this code
> safely:
I posted the rest of the code to someone who was asking about it earlyer in
the discution I do n't feel like reposting it so please look there. Thanks.

Joona I Palaste

unread,
Jun 19, 2001, 1:08:49 PM6/19/01
to
Parinioa <Pari...@hotmail.com> scribbled the following:
> #include <stdio.h>
> #include <conio.h>
> #include <dos.h>
>> >
>> >viod printchar(char c)
>> >{
>> >union REGS regs;
>> >regs.h.ah=0x00; /*Print Character function*/
>> >regs.h.al=c; /*Character to Print*/
>> >regs.x.dx=0x00; /*Print using LPT1*/
>> >int86(PRINTER,&regs,&regs);
>> >}
>>

> Now does that look better?

Probably. But since we can't know what <conio.h> and <dos.h> contain,
the whole code is off-topic for comp.lang.c. Please stop posting it
here.

>> You're joking, I hope.
>>
>> Let's count the ways this is wrong:
>> -Syntactically incorrect (easily fixed by closing a comment)

> Please don't tell me that you are God and have never made a typo.

No, he is God but he has made a typo once. =)

>> -No standard header defines the type viod, and you don't provide a
>> definition for it
>> -No standard header defines union REGS, and you don't provide a
>> definition for it
>> -No standard header defines the function int86, and you don't provide a
>> definition for it
>> -No standard header defines the identifier PRINTER, and you don't
>> provide a definition for it.
>> -A declared as returning something other than void falls off the end
>> without returning a value
>> -The [lack of] indentation makes any nontrivially sized chunk of code
>> unreadable

> As for tabs I see no need for them in such a small part where every
> statement executes regardless of the others. why waste space putting a tab
> at the begining? Indead I do use tabs quite rigourously when writting code
> that needs them (even a lot that doesn't) but this code (minus the '>') is
> quite readable in any monospaced font.

Obviously you have never written any useful C program, or at least
you haven't had to read it. I've written C programs over 2000 lines
long, and without proper indentation they would be impossible to
maintain. But you do have a point that it doesn't affect the execution.

>> That's where I had to stop and look for more... anybody else see
>> something I missed?
>>
> I thought it was rather obvios that this code was not ment to be cut and
> paste and whala it works, it was merely a demonstration of a point.

No, it wasn't very obvious.

>> >please note that this is predominately Windows code
>>
>> I have trouble believing that; it looks too DOSish to run even under
>> Windows to me.
>>
>> > and I do not know if it
>> >can be easily ported (if at all)
>>
>> Then why did you bother posting it to a newsgroup that deals with a
>> portable platform-independent language?

> I posted it it help, and included the disclamer (THIS IS DOS CODE) so that I
> wouln't get flamed over it. Perhaps I was wrong about some of this group.

You're right that you did say it was non-portable, but it still does not
answer the question: What the heck are you doing posting non-portable
code on comp.lang.c in the first place?
It's like saying "Hello, look here, I made a program that only works on
the GizmoStation 9500. Please ignore it.".

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"Nothing lasts forever - so why not destroy it now?"
- Quake

Tim Robinson

unread,
Jun 19, 2001, 1:30:46 PM6/19/01
to
"Parinioa" <Pari...@hotmail.com> wrote in message
news:ngLX6.16221$9r1.1...@e3500-atl1.usenetserver.com...

> > This isn't even Windows code. If you put this code in your Windows
program
> > (and actually got it to compile), it will crash and burn.
> Pardon me I ment DOS code. However it will work in a DOS box in Windows
(and
> seeing that windows is based on dos I would think it would work anyway
> though I am no expert on that point)

The version of Windows I use isn't based on DOS, although it does include a
DOS emulator. Windows does include support for printing to a device context
provided by the printer driver -- but that's beside the point. C supports OS
extensions but it does not have any inherent support specifically for
printers.


Kevin D. Quitt

unread,
Jun 19, 2001, 4:15:46 PM6/19/01
to
On Mon, 18 Jun 2001 17:02:15 GMT, "Chris Van Extergem"
<chri...@pandora.be> wrote:
>To get this post on topic : how would I write a program that would generate
>random insulting sentences like the one above given some arrays with nouns,
>verbs and adverbs ?


Check out http://www-csag.cs.uiuc.edu/individual/pakin/complaint

On a simpler note, you could redo ftp://ftp.quitt.net/outgoing/sifi.c


--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91351-4454 96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list

Ian Woods

unread,
Jun 19, 2001, 4:29:41 PM6/19/01
to
mi...@cowanbox.com (Micah Cowan) wrote in <yu8n175zcgk.fsf@mcowan-
linux.transmeta.com>:


>If Walnut Creek releases a comp.lang.c archive including this, I'm
>getting it, just so I can go into spasmatic fits of uncontrollable
>laughter everytime I read it.

>Micah

I think this scores 8 out of 10 for qoutability. This is an average of the
following criteria:

How much sense does it make out of context: 9 ... works amazingly.
Satirist humour : 8
Length : 6 ... a tad long, but not too long.

Overall... 8 out of 10 ... "Boffo! A good one!"

Ian Woods.

Mark McIntyre

unread,
Jun 19, 2001, 5:26:52 PM6/19/01
to
On Tue, 19 Jun 2001 12:44:50 -0400, "Parinioa" <Pari...@hotmail.com>
wrote:

You might want to read up on Hardware Abstraction layers, and OS
protection against direct hardware access. Completely OT here, a bit
like your post....

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>

Brian B. Rodenborn

unread,
Jun 19, 2001, 5:32:56 PM6/19/01
to
In article <sqgvit4hc6g9l3mi0...@4ax.com>,
Mark McIntyre <ma...@garthorn.demon.co.uk> wrote:

>You might want to read up on Hardware Abstraction layers, and OS
>protection against direct hardware access. Completely OT here, a bit
>like your post....

Yes, but Parinioa's post did effectively derail the original topic
that was going under this thread.

We can give him that, can't we?


--
A program should follow the `Law of Least Astonishment'. What is this law? It
is simply that the program should always respond to the user in the way that
astonishes him least. - The Tao of Programming

Dan Pop

unread,
Jun 19, 2001, 7:22:23 PM6/19/01
to
In <unxX6.13914$9r1.1...@e3500-atl1.usenetserver.com> "Parinioa" <Pari...@hotmail.com> writes:

>viod printchar(char c)
>{
>union REGS regs;
>regs.h.ah=0x00; /*Print Character function*/
>regs.h.al=c; /*Character to Print*/
>regs.x.dx=0x00; /*Print using LPT1
>int86(PRINTER,&regs,&regs);
>}

Ignoring all the correctness issues, I'll merely point out that the
platforms where this code *is supposed* to work also provide the stdprn
stream (as an extension), so your function can be trivially replaced by:

putc(c, stdprn);

But, since most of the time you want to output more than one character,
an fputs or fprintf call would do the job.

On real operating systems, user programs aren't supposed to talk
directly to printers, so different approaches are used for this purpose.

Dan
--
Dan Pop
CERN, IT Division
Email: Dan...@cern.ch
Mail: CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland

Micah Cowan

unread,
Jun 19, 2001, 7:49:49 PM6/19/01
to
"Parinioa" <Pari...@hotmail.com> writes:

> I posted it it help, and included the disclamer (THIS IS DOS CODE) so that I
> wouln't get flamed over it. Perhaps I was wrong about some of this group.

Marking it 'THIS IS DOS CODE' doesn't magically make it topical for
this newsgroup. Any code which is implementation-specific is
automatically off-topic in this newsgroup. It would be on-topic in
some microsoft-programming-related newsgroup, no doubt. That is,
after all, what they are for.

Micah

Tor Rustad

unread,
Jun 19, 2001, 7:04:06 PM6/19/01
to
"Micah Cowan" <mi...@cowanbox.com> wrote in message

> "Tor Rustad" <tor...@online.no.spam> writes:
>
> > > You made an ass out of yourself and the
> > > rest of your fudge packing friends who responded to his post. Hey
> > > Jack, who is the dense one now? I suggest this Jack. Don't take your
> > > anger out on a person who wrote a legit question in the proper group
> > > because your Penis hasn't gotten wet since the ice age....
> >
> > *PLONK*
>
> Why bother? Since his account will ceratinly be terminated
> *yesterday*, doesn't it seem like a waste of precious killfile?

To explain..

1. My post was written and posted before I read the post by Dann Corbit, if
there is another relevant post, I have simply missed it. :-(

2. I have a lot of catch-up to do, ca. 5000 old unread messages and by
killfiling OP, all his posts are removed. :-)

3. I have always space for rude people in my killfile, in fact there is even
room for smart & rude people aswell. No problem.

4. When I responded to OP, it felt like a syntax error not to plonk. The
last section was simply too much for my C compiler to handle...

OK?

--
Tor <torust AT online DOT no>


Micah Cowan

unread,
Jun 19, 2001, 8:09:12 PM6/19/01
to
shawn...@aol.com (Brad) writes:

> Hey Jack, your mom gived good head.

Further complaints sent to groups-...@google.com and AOL's TOS
email addresses. Expect the imminent termination of your accounts.

Suspecting that you are a juvenile and that your parent may hold the
Master Account at AOL, I have also requested that they inform the
holder of the Master Account of this misbehavior.

Micah

Micah Cowan

unread,
Jun 19, 2001, 8:38:35 PM6/19/01
to
"Tor Rustad" <tor...@online.no.spam> writes:

> "Micah Cowan" <mi...@cowanbox.com> wrote in message
> > "Tor Rustad" <tor...@online.no.spam> writes:
> >
> > > > You made an ass out of yourself and the
> > > > rest of your fudge packing friends who responded to his post. Hey
> > > > Jack, who is the dense one now? I suggest this Jack. Don't take your
> > > > anger out on a person who wrote a legit question in the proper group
> > > > because your Penis hasn't gotten wet since the ice age....
> > >
> > > *PLONK*
> >
> > Why bother? Since his account will ceratinly be terminated
> > *yesterday*, doesn't it seem like a waste of precious killfile?
>
> To explain..
>

<snip>

Hmmph. Well, it appears you were right to do so, anyway. He
apparently posted another since, which indicates that his account was
not terminated nearly fast enough to please me. I sent further
complaints based on his second post, hoping that if they get enough of
them, they'll get the hint that this guy is in serious need of LART
application. (BTW, what sort of LART seems appropriate to this sort
of luser? A two-by-four with several nails sticking through the end
comes to mind.... thermonukes seem too good for him (over too
quickly)).

At any rate, I'll continue to keep him unplonked to verify that aol
and google do terminate his account, or at least until it's clear that
they won't.

> 4. When I responded to OP, it felt like a syntax error not to plonk. The
> last section was simply too much for my C compiler to handle...

LOL. I hear you!

Micah

Parinioa

unread,
Jun 19, 2001, 11:08:44 PM6/19/01
to
Perhaps I was over eager to help this guy and I must admit 3 things:
I never read his original post and you guys seem to be grilling him pretty
hard and I was trying to help a guy out.
I do not know Jack Klein or his work, behavior, or quality of advice so I
have very little incling as to why this one insult (though what I have seen
of the poster proves that he is a jackass). I do have to also say that the
quality of most of the posts on this topic have been on nearly the same
level (insulting, vulger, lude, profane, ect.)
I am a programer that has for most of my few years been programming in DOS.
Since I have not had to worry about coding for other OS's I made the mistake
of mostly ignoring them. I have since tried to rectify that but still have
some reminets of that time with me.
Also I have indead written useful programs, and I have written programs with
over 5000 lines (nicely tabed and everything) so I do have some grasp of how
to work with something bigger than trivial code .
Sorry for the interuption of your flames but my orriginal post was sort of,
in an indirect way, kinda ment to stop the childish insults that I saw
hurtling across cyberspace.

Dik T. Winter

unread,
Jun 20, 2001, 5:46:42 AM6/20/01
to
In article <LeLX6.16219$9r1.1...@e3500-atl1.usenetserver.com> "Parinioa" <Pari...@hotmail.com> writes:
> > ...
> > > regs.h.ah=0x00; /*Print Character function*/
> > > regs.h.al=c; /*Character to Print*/
> > > regs.x.dx=0x00; /*Print using LPT1
> > > int86(PRINTER,&regs,&regs);
> > >
( I preceded this line with: On the systems I use )

> > you can not change the default printer with a program.
>
> Please note that this code does not use the 'Default' printer but sends its
> data to LPT1, or what ever that port is called on your system.

On the systems I use there is no port associated with the printer.

Micah Cowan

unread,
Jun 20, 2001, 4:40:43 PM6/20/01
to
"Parinioa" <Pari...@hotmail.com> writes:

> Perhaps I was over eager to help this guy and I must admit 3 things:
> I never read his original post and you guys seem to be grilling him pretty
> hard and I was trying to help a guy out.

Since you don't provide any context, I have absolutely no idea what
guy you're talking about.

> I am a programer that has for most of my few years been programming in DOS.
> Since I have not had to worry about coding for other OS's I made the mistake
> of mostly ignoring them. I have since tried to rectify that but still have
> some reminets of that time with me.
> Also I have indead written useful programs, and I have written programs with
> over 5000 lines (nicely tabed and everything) so I do have some grasp of how
> to work with something bigger than trivial code .
> Sorry for the interuption of your flames but my orriginal post was sort of,
> in an indirect way, kinda ment to stop the childish insults that I saw
> hurtling across cyberspace.

Of course there's nothing wrong with writing DOS-specific code. But
there is something wrong with posting it here at comp.lang.c, which is
not a forum for system-specific coding. DOS provides extensions
(which you used) which are not themselves part of the C language
(which we discuss here), but are part of a specific implementation
(which we don't). This is why it's always a good idea to lurk on
newsgroups for a while until you're sure you know the culture well
enough to start posting in them. Reading the regularly posted
introductory and welcome messages are a good idea too.

Micah

Matt Lundberg

unread,
Jun 20, 2001, 5:08:22 PM6/20/01
to
Chris Van Extergem <chri...@pandora.be> wrote in message
news:ruqX6.42814$mR5.5...@afrodite.telenet-ops.be...
: "Brad" <shawn...@aol.com> wrote in message
: news:31b38465.0106...@posting.google.com...

: To get this post on topic : how would I write a program that would


generate
: random insulting sentences like the one above given some arrays with
nouns,
: verbs and adverbs ?

To go off topic again, try http://dev.null.org/dadaengine/
It does exactly what you want given a fairly simple BNF-like
specification.

Matt


Peter Shaggy Haywood

unread,
Jun 20, 2001, 10:26:14 PM6/20/01
to
Groovy hepcat Brad was jivin' on 18 Jun 2001 08:25:44 -0700 in
comp.lang.c.
Message forJack Klein - please read's a cool scene! Dig it!

>From Jack: Did you or did you not see the several responses to
>that post telling you that there was no such thing as a default
>printer, or any printer


>at all, in the C language?

Why don't you learn to quote a Usenet post properly?

>Obviously you know very little about the C language. Not only can C

Jack's comments were quite correct. If you stay around here long
enough, and not go wimpering off into the night never to be seen
again, after the flaming you're now recieving, then you will come to
realise that Jack is very knowlegeable about C. He is one of our
resident gurus, and if you were a fraction as clueful as him you could
be very proud.

>read a printer but you can also set the default printer through C

Standard C (what we discuss here) has *no* support for printers
whatsoever. Your compiler implementor or system may provide ways for
you to do various things with printers and sundry hardware. But the C
standard provides no support for such things.

>using the SetDefaultPrinter(). You made an ass out of yourself and the

You're the one braying and kicking up your hooves. And, stubborn as
a mule, you refuse to listen to one who knows more than you do.

>rest of your fudge packing friends who responded to his post. Hey
>Jack, who is the dense one now? I suggest this Jack. Don't take your

Who is more dense; a very clueful person who corrects a clueless
newbie, or a person who rebukes him and insults him.

>anger out on a person who wrote a legit question in the proper group

IMHO Jack's display of anger was very justified. Idiots who post the
same question multiple times without reading the responses they get
the first time are extremely annoying, and they deserve to be told off
in no uncertain terms.

>because your Penis hasn't gotten wet since the ice age....

Is that the best you can do? You have no facts or valid arguments
with which to refute what Jack said, so you resort to childish
insults. If you have some specific problem with what he said, then
let's hear it. If you can site where in the standard it mentions
SetDefaultPrinter() - or printers at all - then please don't hold back
with this valid information. Otherwise, stop acting like a moron (Or
aren't you acting?), get your pathetic, little mind out of the gutter
and learn something from those who are significantly more knowlegeable
than you.
--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?

Matt Gessner

unread,
Jun 25, 2001, 2:00:45 PM6/25/01
to
Brad wrote:
>
> From Jack: Did you or did you not see the several responses to
> that post telling you that there was no such thing as a default
> printer, or any printer
> at all, in the C language?
>
> Obviously you know very little about the C language. Not only can C
> read a printer but you can also set the default printer through C
> using the SetDefaultPrinter(). You made an ass out of yourself and the
> rest of your fudge packing friends who responded to his post. Hey
> Jack, who is the dense one now? I suggest this Jack. Don't take your
> anger out on a person who wrote a legit question in the proper group
> because your Penis hasn't gotten wet since the ice age....

LOL... this was a setup, wasn't it?
NOBODY could be THIS stupid!

I give you 4 out of 5 stars for humor.

Matt Gessner

unread,
Jun 26, 2001, 10:33:32 AM6/26/01
to

You know, this was so funny that I read it again today,
and I STILL laughed!

0 new messages