A C tutorial

R

Richard Heathfield

Dan said:
In <[email protected]> Richard Heathfield


Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.

That's tricky, because the quality obtained from PDF documents is so low.
Here's an example:

~Iå¨~R_ß^U~Pp>Ì7
Ô~Pì$~@Í×à·ÑNæ`~B^SÔ~Sm^Uéúï^O²~R~C8!»ì^@}z~Z¬^_~G§¬õë?y+d½Ì¬ª\ê^?¥f¨w1^R¢
·-.~I¸:^?q~RVÐð~C2D~U,ÞC%|¢^Ròèz©ü«`,ä½~XSÕ;óI÷w"°^]ðXI^R^_?eqa#]¸ñÞ'åv^L6¥|
¾HQº^X^^~^ÕUõ/^VÇ~GÒpA×É=^G~HÞZ^GÜTÌl¢6µW~L^^`ñ|°³^TØ~H
½C^Y¬~C©?Ëût3^U^EçÒ^C¹1~Vþz^QºFÙjÿ©¶~SM~Qä~X£wÈ^Rǵ¾mH^NÝ!XH}~Ky«t0^CFTz~N¸ðlE
cx.ÙhjAA¸$| üO?Ñ~Bìõ^S~]Y;Õ0ÆH$TECÄ~I^K0
Þ~U¡§?Ç~WÉÙ Ê~I|"@¬~GdË^V¼¥Á»/^Q~X^An~].Nè~V&¨ü<õY¶^A^DѬåÎ^G~G7­
FQ~M?I~L¨ÑaÇÚ^HiedJè^]^WÝâ~_~HÎ~B¨SÓ^^X ]¶¹ï^S~DU^G~\«%e1o^XFã~S¡¯V


I can't manage anything quite so bad using text, I'm afraid.
 
M

Martin Dickopp

Reread the underlined text above and explain what it was supposed to
mean.

The underlined text is not a complete sentence and was therefore not
supposed to mean anything by itself. Only the whole sentence was
supposed to have meaning.

Martin
 
M

Mark McIntyre

See 5.2.1 of C99 (Character sets).

This defines "character sets", not "text". If you consider the two to be
synonyms then you presumably consider all non-English text documents to be
non-text. I'd call you a rude name at that point, but then we could invoke
godwin... :)

Anyway, I was fully expecting 7.19.2....
 
M

Mark McIntyre

That's tricky, because the quality obtained from PDF documents is so low.

for pathological definitions of "low".
Here's an example:

Just because you can't read it, doesn't mean its not high quality.

Or do you claim that because your C code is converted from "text" to
"binary" then by definition it is poor quality? :)
I can't manage anything quite so bad using text,

You're simply not trying hard enough.

And by the way, that /was/ text....
 
N

Nick Landsberg

Dan Pop wrote:
[snip}
There is a nice paper by Ken Thompson, proving that such scans cannot
guarantee a lack of malicious code being included in the application,
unless you have assembled your own compiler. He had included a backdoor
in Unix via the C compiler and no matter how carefully you'd study the
source code of the C compiler, that you could use to rebuild the compiler
from the sources, you'd see nothing because there was nothing left in the
source code. The malicious code was inside the executable of the compiler
that was coming with the system and it would reproduce itself in the
binaries of the clean compiler you'd compile with that compiler.

Dan

I was wondering when someone would bring up the Thompson paper
in this thread :)
 
R

Richard Heathfield

Mark said:
This defines "character sets", not "text".

This seemed to me to be sufficient.
If you consider the two to be synonyms

Not really, but I consider one to be built out of the other, pretty much.
I'm not silly about it, though; I would be perfectly prepared to accept
common extensions, such as @ and $ (both available in both ASCII and
EBCDIC).
then you presumably consider all non-English text documents to be
non-text.

Not so. For example, I consider C programs to be text documents, and they
are most certainly not written in English.
I'd call you a rude name at that point, but then we could invoke
godwin... :)

If you were to call me a rude name at that point, I suspect it would be
because of your misunderstanding of my position, rather than because of my
actual position.
Anyway, I was fully expecting 7.19.2....

That is another good expression of my point, yes.
 
R

Richard Heathfield

Mark said:
for pathological definitions of "low".

<shrug> It is claimed that PDF documents are in a portable document format.
That's what PDF /stands for/. And yet PDF is clearly /not/ a portable
format, requiring as it does special readers which are not available on all
platforms.
Just because you can't read it, doesn't mean its not high quality.

Well, it doesn't mean it's not of high quality from someone else's point of
view. I will agree with you thus far. But from /my/ point of view, if I
can't read it, it's useless. Useless *to me*, that is.
Or do you claim that because your C code is converted from "text" to
"binary" then by definition it is poor quality? :)

No, but then I don't claim that my C compiler produces portable documents,
either.
You're simply not trying hard enough.

I don't say other people can't manage anything quite so bad. :)
And by the way, that /was/ text....

To you, perhaps. Not to me.
 
R

Richard Bos

Richard Heathfield said:
I know. I don't have a problem trusting gcc.

Besides, given the existence of other, if necessary self-designed,
languages, Thompson's reflections are not as significant as they appear
at first sight.

Richard
 
R

Richard Bos

Richard Heathfield said:
<shrug> It is claimed that PDF documents are in a portable document format.
That's what PDF /stands for/. And yet PDF is clearly /not/ a portable
format, requiring as it does special readers which are not available on all
platforms.

You can write your own reader, if you wish. There are systems without
HTML readers, but few people would call HTML unportable, because it is
at least possible to write an HTML reader for just about any platform;
the same thing should be true for PDF.
Hell, if you're satisfied with a plain-text representation, a PDF reader
could even be on-topic in c.l.c :)

Richard
 
D

Dan Pop

In said:
Yes, I do.

Please elaborate. Which other pieces of Adobe software have bitten you
with their malicious code?
But I'm not using /Adobe/ software that I haven't scanned.
Why?


I know. I don't have a problem trusting gcc.

On the contrary, gcc is the ideal target for pulling such a trick,
precisely because its code is widely available and most people use gcc
to build gcc.

Dan
 
D

Dan Pop

In said:
Dan said:
In <[email protected]> Richard Heathfield


Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.

That's tricky, because the quality obtained from PDF documents is so low.
Here's an example:

~Iå¨~R_ß^U~Pp>Ì7
Ô~Pì$~@Í×à·ÑNæ`~B^SÔ~Sm^Uéúï^O²~R~C8!»ì^@}z~Z¬^_~G§¬õë?y+d½Ì¬ª\ê^?¥f¨w1^R¢
·-.~I¸:^?q~RVÐð~C2D~U,ÞC%|¢^Ròèz©ü«`,ä½~XSÕ;óI÷w"°^]ðXI^R^_?eqa#]¸ñÞ'åv^L6¥|
¾HQº^X^^~^ÕUõ/^VÇ~GÒpA×É=^G~HÞZ^GÜTÌl¢6µW~L^^`ñ|°³^TØ~H
½C^Y¬~C©?Ëût3^U^EçÒ^C¹1~Vþz^QºFÙjÿ©¶~SM~Qä~X£wÈ^Rǵ¾mH^NÝ!XH}~Ky«t0^CFTz~N¸ðlE
cx.ÙhjAA¸$| üO?Ñ~Bìõ^S~]Y;Õ0ÆH$TECÄ~I^K0
Þ~U¡§?Ç~WÉÙ Ê~I|"@¬~GdË^V¼¥Á»/^Q~X^An~].Nè~V&¨ü<õY¶^A^DѬåÎ^G~G7­
FQ~M?I~L¨ÑaÇÚ^HiedJè^]^WÝâ~_~HÎ~B¨SÓ^^X ]¶¹ï^S~DU^G~\«%e1o^XFã~S¡¯V


I can't manage anything quite so bad using text, I'm afraid.

If this was an attempt at being funny, you failed. If it was an attempt
at being stupid, you brilliantly succeeded.

Dan
 
R

Richard Heathfield

Richard Bos wrote:

[PDF]
You can write your own reader, if you wish. There are systems without
HTML readers, but few people would call HTML unportable, because it is
at least possible to write an HTML reader for just about any platform;
the same thing should be true for PDF.
Hell, if you're satisfied with a plain-text representation, a PDF reader
could even be on-topic in c.l.c :)

What an interesting idea. :)
 
R

Richard Heathfield

Dan said:
In <[email protected]> Richard Heathfield


On the contrary, gcc is the ideal target for pulling such a trick,
precisely because its code is widely available and most people use gcc
to build gcc.

Are you claiming that gcc contains a back door? If so, do you have any
evidence to support that claim?
 
R

Richard Bos

Richard Heathfield said:
Are you claiming that gcc contains a back door? If so, do you have any
evidence to support that claim?

No, he is not. He is claiming that _if_ you want to install a back door
of the Ken Thompson kind, _then_ gcc is your ideal target, for the
reasons he cites. Which is true.
OTOH, if you're a commercial compiler writer, you don't even need
Thompson's trick. Ask M$.

Richard
 
D

Dan Pop

In said:
Are you claiming that gcc contains a back door? If so, do you have any
evidence to support that claim?

I am claiming exactly what I have written above. If you have a problem
reading plain English text, it is your problem, not mine.

Dan
 
D

Dan Pop

In said:
The underlined text is not a complete sentence and was therefore not
supposed to mean anything by itself. Only the whole sentence was
supposed to have meaning.

Then, pray tell, what was the whole sentence supposed to mean?

Dan
 
R

Richard Heathfield

Dan said:
In <[email protected]> Richard Heathfield


I am claiming exactly what I have written above.

Presumably, then, you are not claiming that gcc contains a back door. Fine.
So - I /had/ no reason not to trust gcc, and I /still have/ no reason not
to trust gcc. Nothing has changed, then. Good.

If you have a problem
reading plain English text, it is your problem, not mine.

If I have a problem reading plain English text, it is indeed my problem. (I
don't, as it happens.)
 
T

Thomas Stegen CES2000

Richard said:
<shrug> It is claimed that PDF documents are in a portable document format.
That's what PDF /stands for/. And yet PDF is clearly /not/ a portable
format, requiring as it does special readers which are not available on all
platforms.

That is like saying C is not portable because you need special
software for each platform it needs to support. Tell me about one
platform which does not have and acrobat reader available and
you have ever found yourself in need of one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,793
Messages
2,569,640
Members
45,353
Latest member
RogerDoger

Latest Threads

Top