Help needed ...

  • Thread starter Prashanth Badabagni
  • Start date
P

Prashanth Badabagni

X-No-archive: yes
I wonder why this code works .. can u please explain


int main(void) { if (putchar((((main==main)+(main==main))*((main==
main)+(main==main)) * ((main==main)+(main==main)) * ((main==main)+
(main==main))* ((main==main)+(main==main)) * ((main==main)+(main==
main)))-(((main==main)+(main==main))*((main==main)+(main==main)))-
(main==main)), putchar((((main==main)+(main==main))*((main==main)+
(main==main)) * ((main==main)+(main==main)))+((main==main)+(main==
main))),exit(main!=main),main==main){}}
 
C

Case

Prashanth said:
X-No-archive: yes
I wonder why this code works .. can u please explain


int main(void) { if (putchar((((main==main)+(main==main))*((main==
main)+(main==main)) * ((main==main)+(main==main)) * ((main==main)+
(main==main))* ((main==main)+(main==main)) * ((main==main)+(main==
main)))-(((main==main)+(main==main))*((main==main)+(main==main)))-
(main==main)), putchar((((main==main)+(main==main))*((main==main)+
(main==main)) * ((main==main)+(main==main)))+((main==main)+(main==
main))),exit(main!=main),main==main){}}

The symbol 'main' simple represents the address of this routine.
This means that:
a. (main==main) is equal to 1
b. (main!=main) is equal to 0

You can substitue 1's and a 0 in the code above. This yields many
(1+1)'s which you can rewrite to 2. Then you get something like
2 * 2 * 2 * 2 - .... as one of the arguments of putchar ... So
continue simplifying the code to end up with a simple version with
a couple of integer literals and a couple of standard function calls.

Let us know what this results in.

Kees
 
J

Joona I Palaste

Can you explain what is X-No-archive?

An NNTP header that prevents nicely-behaving NNTP servers from archiving
the article away, instead forgetting it as soon as it expires. But for
it to be of any use, AFAIK it should go to the headers (before the first
blank line), not to the body (after the first blank line). Feel free to
correct me if (because?) I'm wrong.
 
C

CBFalconer

Joona said:
An NNTP header that prevents nicely-behaving NNTP servers from
archiving the article away, instead forgetting it as soon as it
expires. But for it to be of any use, AFAIK it should go to the
headers (before the first blank line), not to the body (after
the first blank line). Feel free to correct me if (because?)
I'm wrong.

Either version works, because it is unofficial and the servers
choose whether or not to observe it. Google does. Thus use of
the silly thing keeps the article off the whole google system.
 
D

Dan Pop

In said:
Either version works, because it is unofficial and the servers
choose whether or not to observe it. Google does.

Nonsense. If it's inside the article body, it has no semantics for the
server, which is NOT supposed to be scanning the article body for headers.

Are you *really* claiming that *this* article won't be archived by
Google because it contains the following line?

X-No-archive: yes

I'd be really surprised...

Dan
 
J

Joona I Palaste

Nonsense. If it's inside the article body, it has no semantics for the
server, which is NOT supposed to be scanning the article body for headers.
Are you *really* claiming that *this* article won't be archived by
Google because it contains the following line?
X-No-archive: yes
I'd be really surprised...

The servers aren't supposed to scan the body, but that doesn't stop them
from doing so.
AFAIK, WWW browsers are supposed to determine the content type of the
HTTP response based on the Content-Type header. But yet AFAIK,
Microsoft browsers generally don't give a toss about this header, but
instead scan both the body and the filename part in the URL to
determine the content type.
If things like that can be done in WWW browsers, why not in NNTP
servers?
 
C

Case

Dan said:
Nonsense. If it's inside the article body, it has no semantics for the
server, which is NOT supposed to be scanning the article body for headers.

Are you *really* claiming that *this* article won't be archived by
Google because it contains the following line?

X-No-archive: yes

I'd be really surprised...

I searched Google and my post was there already but not
the one from the OP. Surprized?

Kees
 
D

Dan Pop

In said:
If things like that can be done in WWW browsers, why not in NNTP
servers?

Because you have the control over what WWW browser you use and can always
choose one that plays by the rules, but your choice of an NNTP server is
much more limited. Therefore, servers are supposed to adhere more
strictly to the specs than user clients.

Dan
 
J

Joona I Palaste

Because you have the control over what WWW browser you use and can always
choose one that plays by the rules, but your choice of an NNTP server is
much more limited. Therefore, servers are supposed to adhere more
strictly to the specs than user clients.

You said "are supposed to" again. What happens if some NNTP server still
does scan the body?

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"As a boy, I often dreamed of being a baseball, but now we must go forward, not
backward, upward, not forward, and always whirling, whirling towards freedom!"
- Kang
 
D

Dan Pop

In said:
You said "are supposed to" again. What happens if some NNTP server still
does scan the body?

Whatever the programmer who wrote the code wanted to happen. Wasn't the
answer obvious? Wasn't it equally obvious that broken code can do
anything it wants? This is exactly why I used "are supposed to".

Dan
 
J

Joona I Palaste

Whatever the programmer who wrote the code wanted to happen. Wasn't the
answer obvious? Wasn't it equally obvious that broken code can do
anything it wants? This is exactly why I used "are supposed to".

From your earlier post...
------------------------------------------------------------------------
"Are you *really* claiming that *this* article won't be archived by
Google because it contains the following line?

X-No-archive: yes

I'd be really surprised..."
 
M

Mabden

Joona I Palaste said:
An NNTP header that prevents nicely-behaving NNTP servers from archiving
the article away, instead forgetting it as soon as it expires. But for
it to be of any use, AFAIK it should go to the headers (before the first
blank line), not to the body (after the first blank line). Feel free to
correct me if (because?) I'm wrong.

How does one put things in the header? Ok, I'll admit it... I use Outlook in
Windows. I'm very sorry, but there it is.
 
C

CBFalconer

Dan said:
.... snip ...

Are you *really* claiming that *this* article won't be archived
by Google because it contains the following line?

X-No-archive: yes

I'd be really surprised...

Not *that* article, because that line is not the initial line.
But the original article on which I commented had that as an
initial line, and google will not archive it.
 
A

Andrey Tarasevich

Dan said:
Because you have the control over what WWW browser you use and can always
choose one that plays by the rules, but your choice of an NNTP server is
much more limited. Therefore, servers are supposed to adhere more
strictly to the specs than user clients.
...

It has absolutely nothing to do with any NNTP specs.

As you were told before, this entry is supposed to control whether
existing Usenet archival service(s) store this article. Such service(s)
may offer absolutely arbitrary methods of control over this
functionality to outside user. These methods are not governed in any way
by NNTP protocol.

One of such services that immediately comes to mind is Google. As most
of us know, Google will not store an article with the aforementioned
entry in its header or its body.
 
J

Jack Klein

How does one put things in the header? Ok, I'll admit it... I use Outlook in
Windows. I'm very sorry, but there it is.

With Outlook and Outlook Express it happens automatically. But the
things put in the header are viruses (virii?) and worms.
 
D

Dan Pop

In said:
From your earlier post...
------------------------------------------------------------------------
"Are you *really* claiming that *this* article won't be archived by
Google because it contains the following line?

X-No-archive: yes

I'd be really surprised..."
------------------------------------------------------------------------
What proof do you have that the code in Google's NNTP server is not
broken? If you don't have any, then why would you be really surprised if
Google scanned the body and reacted to the X-No-archive line? If you
have some, please present it.

Nope, it is you who have to prove that the code is broken. Production
code is assumed to be correct, unless proven broken, not the other way
round.

Dan
 

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

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top